/* SKY Gallery — styles ported from the design canvas */

:root {
  --wall: #EEEBE5;
  --ink: #1E1C1A;
  --muted: #625C55;
  --rule: rgba(30, 28, 26, .12);
  --paper: #FBFAF6;
  --paper-2: #F6F4EF;
  --line: #CFC9BF;
  --line-soft: #E4DFD6;
  --danger: #A8321F;
  --heart: #C2352B;
  --star: #B8862B;
  --ok: #2F5A39;
  --ok-bg: #DDE8DF;
  --blind: #7A3218;
  --blind-bg: #F3DDD3;
  --serif: 'Noto Serif KR', 'Apple SD Gothic Neo', serif;
  --sans: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --latin: 'Cormorant Garamond', 'Noto Serif KR', serif;
  --gutter: clamp(16px, 5vw, 72px);
}

body.wall-charcoal {
  --wall: #272523;
  --ink: #F0ECE5;
  --muted: #B5AEA4;
  --rule: rgba(240, 236, 229, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--ink); color: var(--wall); padding: 8px 14px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 500; }
.center { text-align: center; }
.serif { font-family: var(--serif); font-weight: 500; }
.ok { color: var(--ok); }
.warn { color: #8A3B1E; font-size: 13px; line-height: 1.6; margin: 0; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.end { justify-content: flex-end; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.stack-6, .stack-10, .stack-24, .stack-28, .stack-32, .stack-36 { display: flex; flex-direction: column; }
.stack-6 { gap: 6px; } .stack-10 { gap: 10px; } .stack-24 { gap: 24px; } .stack-28 { gap: 28px; } .stack-32 { gap: 32px; } .stack-36 { gap: 36px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow-wide { max-width: 1180px; padding-top: clamp(40px, 6vw, 72px); padding-bottom: 80px; }
.admin-wrap { max-width: 1240px; padding-top: clamp(32px, 5vw, 56px); padding-bottom: 80px; }

.page-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); line-height: 1.3; }
.logo { text-decoration: none; font-family: var(--latin); font-size: 20px; font-weight: 600; letter-spacing: .14em; white-space: nowrap; }
.logo-small { font-size: 15px; letter-spacing: .12em; }

/* ---------- header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding: 14px var(--gutter);
  border-bottom: 1px solid var(--rule);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.admin-badge { font-size: 11px; letter-spacing: .12em; padding: 3px 8px; border: 1px solid rgba(240, 236, 229, .4); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 14px; }
.nav-link {
  text-decoration: none; padding: 12px 0; color: var(--muted); background: none; border: 0;
  border-bottom: 1px solid transparent;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-current { color: var(--ink); border-bottom-color: currentColor; }
.nav-cta {
  text-decoration: none; padding: 10px 20px; border: 1px solid currentColor; border-radius: 999px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav-cta.is-current, .nav-cta:hover { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.header-actions { display: none; align-items: center; gap: 2px; }
.menu-toggle { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; }
.mobile-cta { padding: 7px 14px; min-height: 36px; font-size: 13px; }

.site-header.is-admin { background: #1E1C1A; color: #F0ECE5; border-bottom-color: #1E1C1A; }
.site-header.is-admin .nav-link { color: #C9C2B8; }
.site-header.is-admin .nav-link.is-current, .site-header.is-admin .nav-link:hover { color: #F0ECE5; }

@media (max-width: 719px) {
  .site-header { padding: 8px 8px 8px 20px; }
  .header-actions { display: flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 12px 12px 0; }
  .site-header.menu-open .nav { display: flex; }
  .nav .nav-link { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav .nav-link.is-current { border-bottom-color: var(--rule); font-weight: 500; }
  .nav .nav-cta { display: none; }
  .logo { font-size: 17px; }
}

/* ---------- footer ---------- */
.view { flex: 1; outline: none; }
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 32px var(--gutter); border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted);
}

/* ---------- gallery ---------- */
.intro { padding: clamp(48px, 8vw, 104px) 0 clamp(32px, 5vw, 56px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.overline { margin: 0; font-family: var(--latin); font-style: italic; font-size: 18px; letter-spacing: .08em; color: var(--muted); }
.small-over { font-size: 17px; letter-spacing: .04em; }
.intro-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.01em; line-height: 1.3; }
.intro-text { margin: 0; max-width: 460px; font-size: 15px; line-height: 1.75; color: var(--muted); white-space: pre-line; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: clamp(40px, 6vw, 72px); }
.toolbar p { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.pill {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  font-size: 13px; color: var(--ink);
}
.pill[aria-pressed="true"] { border-color: var(--ink); }
.pill-solid { min-height: 40px; border-color: var(--line); }
.pill-solid[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  column-gap: clamp(32px, 5vw, 72px);
  row-gap: clamp(64px, 8vw, 104px);
  align-items: center;
  padding-bottom: 48px;
}
.work { display: flex; justify-content: center; }
.work-inner { width: var(--fw, 100%); display: flex; flex-direction: column; }
.sentinel { height: 1px; }

/* the frame (moulding → lip → mat → bevel → photo); values come from js/frames.js */
.frame {
  position: relative; display: block; width: 100%; margin: 0; border: 0; border-radius: 1px; text-align: left;
  padding: var(--f-pad); background: var(--f-bg);
  box-shadow: var(--f-edge), 0 1px 1px rgba(0, 0, 0, .22), 0 4px 8px -3px rgba(0, 0, 0, .22), 0 30px 46px -26px rgba(0, 0, 0, .55);
  cursor: zoom-in; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.frame:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; }
.frame-static { cursor: default; box-shadow: var(--f-edge), 0 1px 1px rgba(0, 0, 0, .2), 0 14px 22px -14px rgba(0, 0, 0, .55); }
.frame-lip { display: block; padding: var(--f-lip-pad); background: var(--f-lip); }
.frame-mat { display: block; padding: var(--f-mat-pad); background: var(--f-mat-bg); box-shadow: var(--f-mat-shadow); }
.frame-bevel { display: block; box-shadow: var(--f-bevel); background: #D9DFE4; }
.frame-bevel img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }

@keyframes heartpop {
  0% { transform: scale(.2); opacity: 0; }
  18% { transform: scale(1.18); opacity: .96; }
  32% { transform: scale(.94); }
  46% { transform: scale(1.02); opacity: .96; }
  80% { transform: scale(1); opacity: .96; }
  100% { transform: scale(1.08); opacity: 0; }
}
.pop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pop svg { opacity: 0; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.pop.play svg { animation: heartpop .9s ease-out forwards; }

/* museum label card */
.label {
  position: relative; margin-top: 28px; align-self: flex-start; width: 100%; max-width: 264px;
  padding: 16px 18px 10px; background: var(--paper); color: #1E1C1A;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 14px -8px rgba(0, 0, 0, .22);
}
.label p { margin: 0; overflow-wrap: anywhere; }
.label-title { padding-right: 28px; font-family: var(--serif); font-weight: 600; font-size: 15px; line-height: 1.45; }
.label-artist { margin-top: 4px !important; font-size: 13px; }
.label-meta { margin-top: 2px !important; font-size: 12px; color: #625C55; }
.label-meta:empty { display: none; }
.label-desc { margin-top: 10px !important; font-family: var(--serif); font-size: 12.5px; line-height: 1.6; color: #3D3935; }
.label-foot { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.label-no { font-family: var(--latin); font-size: 13px; letter-spacing: .06em; color: #625C55; }
.like-btn {
  display: flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -10px; padding: 0 10px;
  border: 0; background: transparent; font-size: 13px; color: #1E1C1A;
}
.i-heart path { fill: none; stroke: currentColor; transition: fill .15s ease; }
.like-btn.is-liked .i-heart path, .viewer-like.is-liked .i-heart path { fill: var(--heart); stroke: var(--heart); }
.viewer-like.is-liked .i-heart path { fill: #E0574B; stroke: #E0574B; }

/* star rating: button at the label's top-right → five stars; average next to the heart */
.i-star path { fill: none; stroke: currentColor; }
.rate { position: absolute; top: 4px; right: 4px; z-index: 2; }
.rate-btn {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; background: transparent; color: #625C55;
}
.rate-btn.is-rated { color: var(--star); }
.rate-btn.is-rated .i-star path { fill: var(--star); }
.rate-panel { padding: 4px 6px; background: var(--paper); box-shadow: 0 2px 12px rgba(0, 0, 0, .2); animation: fadein .15s ease-out; }
.stars { position: relative; display: block; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.stars-row { display: flex; }
.stars-row svg { display: block; flex: none; }
.stars-off { display: block; color: #8C857B; }
.stars-on { position: absolute; inset: 0; color: var(--star); clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0); pointer-events: none; }
.stars-on .i-star path { fill: var(--star); }
.label-stats { display: flex; align-items: center; gap: 2px; }
.rating-avg { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #1E1C1A; }
.rating-avg .i-star { color: var(--star); }
.rating-avg .i-star path { fill: var(--star); }
.rating-avg.is-empty .i-star { color: #8C857B; }
.rating-avg.is-empty .i-star path { fill: none; }
.rating-n { font-size: 12px; color: #625C55; }

/* confirm dialog */
.dialog {
  width: min(320px, calc(100vw - 32px)); padding: 0; border: 0; background: var(--paper); color: #1E1C1A;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: rise .2s ease-out;
}
.dialog::backdrop { background: rgba(17, 16, 15, .45); }
.dialog-body { padding: 26px 22px 18px; }
.dialog-msg { margin: 0 0 22px; font-family: var(--serif); font-size: 16px; text-align: center; }
.dialog-actions { display: flex; gap: 8px; }
.dialog-actions .btn { flex: 1; min-height: 44px; }

@media (max-width: 640px) {
  .wall-grid { grid-template-columns: minmax(0, 1fr); row-gap: 56px; }
  .work-inner { width: min(var(--fw, 100%), 100%); }
  .label { margin-top: 22px; max-width: 240px; }
}

/* ---------- viewer ---------- */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(17, 16, 15, .96); color: #F0ECE5;
  display: flex; align-items: center; justify-content: center;
  padding: 64px clamp(0px, 6vw, 96px) max(24px, env(safe-area-inset-bottom));
  animation: fadein .22s ease-out;
}
.viewer-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-out; }
.viewer-btn {
  position: absolute; z-index: 2; width: 48px; height: 48px; border: 0; background: transparent; color: #F0ECE5;
  display: flex; align-items: center; justify-content: center;
}
.viewer-close { top: max(8px, env(safe-area-inset-top)); right: 8px; }
.viewer-prev { left: clamp(4px, 2vw, 24px); top: 50%; transform: translateY(-50%); }
.viewer-next { right: clamp(4px, 2vw, 24px); top: 50%; transform: translateY(-50%); }
.viewer-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 100%; pointer-events: none; }
.viewer-stage { position: relative; pointer-events: auto; touch-action: manipulation; }
.viewer-img {
  display: block; max-width: min(1200px, 100vw); max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px);
  width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: rise .32s ease-out; user-select: none; -webkit-user-select: none;
}
.viewer-caption {
  pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 32px; width: 100%; max-width: 720px; padding: 0 20px;
}
.viewer-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 18px; }
.viewer-sub { margin: 4px 0 0; font-size: 13px; color: #B5AEA4; }
.viewer-like {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(240, 236, 229, .3); border-radius: 999px; background: transparent; color: #F0ECE5; font-size: 14px;
}
@media (max-width: 640px) {
  .viewer-prev, .viewer-next { display: none; }
  .viewer-img { max-height: calc(100dvh - 220px); }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px; border: 1px solid var(--ink); background: transparent;
  text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink);
}
.btn-solid { background: #1E1C1A; color: #F6F3EE; border-color: #1E1C1A; }
.btn-solid:disabled { opacity: .45; cursor: not-allowed; }
.btn-line { border-color: var(--line); font-weight: 400; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 13px; font-weight: 400; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.danger { color: var(--danger); }
.btn.danger { border-color: #E2BFB3; }
.text-link { background: none; border: 0; padding: 12px 6px; min-height: 44px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.text-link.center { align-self: center; display: inline-flex; align-items: center; }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.input {
  font-weight: 400; font-size: 16px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line);
  background: var(--paper); color: #1E1C1A; border-radius: 0; width: 100%;
}
select.input { padding: 0 10px; }
.textarea { padding: 12px 14px; line-height: 1.6; resize: vertical; min-height: 96px; }
.input:focus { outline: 2px solid #1E1C1A; outline-offset: -1px; }
.input.is-invalid { border-color: var(--danger); }
.form-error { margin: 0; font-size: 13px; color: var(--danger); }
.notice { margin: 0; padding: 14px 16px; font-size: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.question-box { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line-soft); }
.question-text { font-family: var(--serif); font-size: 16px; }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.radio input { accent-color: #1E1C1A; width: 18px; height: 18px; }

/* ---------- auth ---------- */
.auth-wrap {
  max-width: 1120px; padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(40px, 7vw, 96px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(48px, 8vw, 120px);
}
.auth-decor { flex: 1 1 360px; max-width: 460px; display: flex; flex-direction: column; gap: 24px; }
.auth-tagline { margin: 0; font-family: var(--latin); font-style: italic; font-size: 18px; color: var(--muted); }
.auth-panel { flex: 1 1 340px; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tab {
  min-height: 48px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted);
}
.tab[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }
@media (max-width: 719px) {
  .auth-decor { display: none; }
}

/* ---------- upload ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: clamp(32px, 5vw, 56px) 24px; border: 1px dashed #8C857B; background: var(--paper-2);
  cursor: pointer; text-align: center;
}
.dropzone.is-over { background: #EAE6DE; border-color: #1E1C1A; }
.dropzone-title { font-size: 15px; font-weight: 500; }
.dropzone-title u { text-underline-offset: 3px; }
.on-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .on-touch { display: inline; }
  .on-pointer { display: none; }
}
.dropzone-sub { font-size: 12px; color: var(--muted); }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.list-head p { margin: 0; }
.all-frames { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.swatches-row { display: flex; flex-wrap: wrap; gap: 0; }
.swatch { height: 44px; min-width: 40px; padding: 5px; border: 0; border-radius: 3px; background: transparent; }
.swatches-row .swatch { width: 40px; height: 40px; padding: 6px; }
.swatch[aria-checked="true"] { box-shadow: inset 0 0 0 2px #1E1C1A; }
.swatch-frame { display: block; width: 100%; height: 100%; padding: var(--s-pad); background: var(--s-bg); box-shadow: var(--s-edge), 0 1px 2px rgba(0, 0, 0, .25); }
.swatch-inner { display: block; width: 100%; height: 100%; background: var(--s-inner); }

.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.upload-grid:empty { display: none; }
.upload-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); color: #1E1C1A; }
.upload-preview { position: relative; display: flex; align-items: center; justify-content: center; padding: 22px 18px; background: #E9E5DE; }
.thumb-slot { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #E2E6E9; }
.thumb-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.remove-btn { position: absolute; top: 0; right: 0; }
.icon-btn { width: 44px; height: 44px; border: 0; background: rgba(27, 25, 24, .72); color: #FBFAF6; display: flex; align-items: center; justify-content: center; }
.line-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.line-input { font-size: 15px; color: #1E1C1A; min-height: 38px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: none; border-radius: 0; }
.line-input:focus { border-bottom-color: #1E1C1A; }
.item-status { margin: 0; font-size: 12px; color: var(--muted); }
.item-status:empty { display: none; }
.item-status.is-error { color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 24px; border-top: 1px solid var(--rule); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(30, 28, 26, .2); border-top-color: #1E1C1A; animation: spin .8s linear infinite; }

@media (max-width: 640px) {
  .upload-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .form-actions { position: sticky; bottom: 0; background: var(--wall); padding: 14px 0 max(14px, env(safe-area-inset-bottom)); margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
  .form-actions .btn-solid { flex: 1; }
}

/* ---------- my works ---------- */
.stats { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--serif); font-size: 22px; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.mine-card { display: flex; flex-direction: column; background: var(--paper); color: #1E1C1A; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.mine-preview { padding: 20px; background: #E6E2DA; }
.cover-43 { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.is-dim { opacity: .45; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.card-body p { margin: 0; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.chip { flex: none; font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip-live { background: var(--ok-bg); color: var(--ok); }
.chip-blind { background: var(--blind-bg); color: var(--blind); }
.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.card-action { min-height: 48px; border: 0; background: transparent; font-size: 13px; color: #1E1C1A; }
.card-action + .card-action { border-left: 1px solid var(--line-soft); }
.card-action.danger { color: var(--danger); }
.card-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--line-soft); }
.card-edit { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 16px; border-top: 1px solid var(--line-soft); }
.account { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 1px solid var(--rule); }
.account-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.account-links .text-link { padding-left: 0; color: var(--ink); }
.account-links .text-link.muted { color: var(--muted); }
.account-form { max-width: 420px; }

/* ---------- admin ---------- */
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--paper); flex: 0 1 320px; color: var(--muted); }
.search-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; color: #1E1C1A; }
.table-box { overflow-x: auto; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; color: #1E1C1A; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 14px 12px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 10px 12px; border-bottom: 1px solid #EEEAE3; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.mini-frame { flex: none; width: 64px; height: 48px; padding: 3px; background: #1B1918; display: block; }
.mini-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.settings-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.settings-form { flex: 1 1 360px; min-width: 0; padding: 28px; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); color: #1E1C1A; }
.preview-col { flex: 1 1 420px; min-width: 0; }
.preview-box { background: #EEEBE5; color: #1E1C1A; border: 1px solid #DCD6CC; display: flex; flex-direction: column; --muted: #625C55; }
.preview-box.is-charcoal { background: #272523; color: #F0ECE5; border-color: #272523; --muted: #B5AEA4; }
.preview-head { padding: 14px 20px; border-bottom: 1px solid rgba(127, 120, 110, .25); }
.preview-intro { padding: 56px 24px 64px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.preview-title { font-size: 34px; }
.preview-foot { padding: 14px 20px; border-top: 1px solid rgba(127, 120, 110, .25); font-size: 11px; color: var(--muted); text-align: right; }

/* ---------- misc ---------- */
.empty-page { padding: 120px var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
#toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1E1C1A; color: #F6F3EE; padding: 12px 20px; font-size: 14px; max-width: calc(100vw - 32px);
  transition: opacity .2s ease, transform .2s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: var(--danger); }
@media (max-width: 640px) {
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
