/* AI 착샷 생성 스튜디오 — design system
   Restrained, typographic, hairline-based. Colour is neutral by default; the one
   accent is a single blue reserved for the primary action and links, so nothing
   reads as a generic purple-gradient template. */

:root {
  /* surfaces */
  --bg: #ffffff;
  --bg-sunken: #f5f5f7;
  --card: #ffffff;
  --card-raised: #fbfbfd;
  /* ink */
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  /* lines */
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  /* the single accent */
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 113, 227, .08);
  --ok: #1d7a33;
  --bad: #c8102e;
  /* shape */
  --r-card: 16px;
  --r-field: 10px;
  --r-pill: 980px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-sunken: #101012;
    --card: #1c1c1e;
    --card-raised: #232326;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --line: #38383a;
    --line-soft: #2a2a2c;
    --accent: #2997ff;
    --accent-ink: #ffffff;
    --accent-soft: rgba(41, 151, 255, .12);
    --ok: #4cd964;
    --bad: #ff6961;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

/* `[hidden]` is display:none from the UA sheet, which any class-level `display`
   rule outranks — that silently left the login gate on screen after sign-in.
   Make the attribute authoritative for every element in the app. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 40px 22px 96px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard",
        "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

#app, .gate-card { max-width: 1020px; margin: 0 auto; }

h1 {
  font-size: 30px; line-height: 1.15; margin: 0;
  font-weight: 600; letter-spacing: -0.022em;
}
h2 {
  font-size: 17px; margin: 0 0 14px;
  font-weight: 600; letter-spacing: -0.01em;
}
p { margin: 0 0 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font: 0.88em/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--bg-sunken); border-radius: 5px; padding: 2px 6px;
}
.muted { color: var(--ink-2); font-weight: 400; }
.error { color: var(--bad); margin: 10px 0 0; font-size: 14px; }
.small-note { font-size: 13px; margin: 0; }

/* ── layout ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 26px;
  margin-bottom: 20px;
}

header { margin-bottom: 26px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header p { margin: 10px 0 18px; color: var(--ink-2); font-size: 15px; max-width: 62ch; }

.badge {
  display: inline-block;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  padding: 9px 18px;
  font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.badge strong { color: var(--ink); font-weight: 600; }
.badge .over { color: var(--bad); }

/* ── login ──────────────────────────────────────────────────────────────── */

.gate { display: grid; place-items: center; min-height: 74vh; }
.gate-card { width: min(400px, 100%); padding: 34px 32px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 24px; }
.gate-card p { font-size: 14px; color: var(--ink-2); margin: 10px 0 22px; }
.gate-card label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; }
.gate-card button { width: 100%; margin-top: 20px; }

/* ── form controls ──────────────────────────────────────────────────────── */

input[type=password], input[type=text], input[type=number], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  background: var(--card);
  color: var(--ink);
  font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 51%, calc(100% - 12px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

button {
  font: inherit; font-size: 15px; font-weight: 500;
  border-radius: var(--r-pill);
  padding: 10px 20px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
button:hover { background: var(--bg-sunken); }
button.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  font-weight: 500;
}
button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
button.primary:disabled { opacity: .4; cursor: not-allowed; background: var(--accent); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--bg-sunken); }
button.small { padding: 6px 14px; font-size: 13px; }
button.danger { color: var(--bad); }
button.danger:hover { background: color-mix(in srgb, var(--bad) 8%, transparent); }

/* ── tabs ───────────────────────────────────────────────────────────────── */

.tabs {
  position: relative;
  display: flex; gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  border: none; background: transparent; color: var(--ink-2);
  border-radius: 0; padding: 11px 15px 13px;
  font-size: 15px; font-weight: 400;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { background: transparent; color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.tab-count {
  display: inline-block; margin-left: 5px;
  font-size: 11px; font-weight: 600;
  border-radius: var(--r-pill); padding: 1px 7px;
  background: var(--accent); color: var(--accent-ink);
}
.tab-count:empty { display: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── upload panels ──────────────────────────────────────────────────────── */

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.dropzone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dropzone-head label { font-weight: 500; font-size: 15px; }
.count {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--bg-sunken); border-radius: var(--r-pill);
  padding: 3px 10px; white-space: nowrap;
}
.dropzone-body { text-align: center; padding: 22px 0 6px; }
.dropzone-body .hint { color: var(--ink-3); margin: 0 0 14px; font-size: 14px; }
.dropzone-actions { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.hidden-input { display: none; }

.thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px; margin-top: 18px;
}
.thumb { position: relative; aspect-ratio: 3 / 4; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 9px; background: var(--bg-sunken);
  border: 1px solid var(--line-soft);
}
.thumb.pending img { opacity: .4; }
.thumb.failed img { outline: 2px solid var(--bad); outline-offset: -2px; }
.thumb .remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border-radius: 50%; border: none; padding: 0;
  background: var(--ink); color: var(--bg);
  font-size: 14px; line-height: 1; font-weight: 500;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  opacity: 0; transition: opacity .12s;
}
.thumb:hover .remove, .thumb:focus-within .remove { opacity: 1; }
.thumb .remove:hover { background: var(--bad); color: #fff; }
.thumb .name {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 10px; padding: 4px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  color: #fff; border-radius: 0 0 9px 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumb .spin {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; color: var(--ink-2); font-weight: 500;
}

.pair-summary {
  margin-top: 18px; padding: 14px 16px;
  border-radius: var(--r-field);
  background: var(--bg-sunken);
  font-size: 14px; line-height: 1.6;
}
.pair-summary strong { font-weight: 600; }
.pair-summary .warn { color: var(--bad); }

/* ── options ────────────────────────────────────────────────────────────── */

.options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 16px; margin: 24px 0 4px;
}
.options label, label.block {
  display: block; font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.options label > *, label.block > * { margin-top: 7px; font-weight: 400; color: var(--ink); }
label.block { margin: 20px 0; }

details { margin: 18px 0; }
summary {
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--accent);
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: '＋ '; font-weight: 400; }
details[open] > summary::before { content: '－ '; }
details textarea { margin-top: 12px; }

.actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
#generate { padding: 12px 26px; font-size: 16px; }

/* ── workflow explainer ─────────────────────────────────────────────────── */

.explainer {
  margin: 20px 0;
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 14px 16px;
}
.explainer-body { overflow-x: auto; margin-top: 16px; }
table.compare { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.compare th, table.compare td {
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 13px; vertical-align: top; text-align: left; white-space: normal;
}
table.compare thead th { font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
table.compare tbody th { width: 92px; color: var(--ink-3); font-weight: 500; }

/* ── pose selectors ────────────────────────────────────────────────────── */

.pose-panel {
  margin: 20px 0; padding: 18px;
  border: 1px solid var(--line-soft); border-radius: 14px;
  background: var(--card-raised);
}
.pose-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pose-head label { font-weight: 500; font-size: 15px; display: block; }
.pose-head .muted { display: block; font-size: 13px; margin-top: 4px; max-width: 46ch; }
.pose-head-actions { display: flex; gap: 7px; }
.pose-grid { display: grid; gap: 12px; margin-top: 18px; }
.pose-cell { font-size: 12px; }
.pose-cell .pos {
  display: block; color: var(--ink-3); font-weight: 500;
  margin-bottom: 6px; letter-spacing: .01em;
}

/* ── progress / results ─────────────────────────────────────────────────── */

.status { font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.status .muted { font-weight: 400; font-size: 13.5px; }
.status .spinner {
  display: inline-block; width: 13px; height: 13px; margin-right: 9px;
  border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.progress-bar { flex: 1; height: 4px; background: var(--line-soft); border-radius: var(--r-pill); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s ease; }
.progress-label { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }

.save-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 20px;
  background: var(--bg-sunken); border-radius: 12px;
}
.save-bar .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.inline-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.inline-check input { width: 16px; height: 16px; accent-color: var(--accent); }

.batch-item {
  border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.batch-item-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 14px; font-weight: 500; margin-bottom: 14px; flex-wrap: wrap;
}
.batch-item-head .meta { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; font-size: 13px; }
.batch-item-body { display: grid; grid-template-columns: 100px 1fr; gap: 16px; align-items: start; }
@media (max-width: 600px) { .batch-item-body { grid-template-columns: 1fr; } }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.input-thumb img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 7px; border: 1px solid var(--line-soft); display: block;
}

.pill {
  font-size: 11.5px; font-weight: 600; border-radius: var(--r-pill);
  padding: 3px 10px; background: var(--bg-sunken); color: var(--ink-2);
  margin-left: 4px;
}
.pill.done { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.pill.error { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.pill.running { background: var(--accent-soft); color: var(--accent); }

.grid-image { width: 100%; border-radius: 12px; border: 1px solid var(--line-soft); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.shots figure { margin: 0; position: relative; }
.shots img { width: 100%; border-radius: 10px; border: 1px solid var(--line-soft); display: block; }
.shots figcaption {
  font-size: 12px; color: var(--ink-3); margin-top: 6px;
  display: flex; justify-content: space-between; gap: 8px;
}
.shots .pick {
  position: absolute; top: 8px; left: 8px; width: 19px; height: 19px; margin: 0;
  accent-color: var(--accent); cursor: pointer; z-index: 2;
  box-shadow: 0 0 0 2px var(--card); border-radius: 4px;
}
.shots figure.picked img { outline: 2px solid var(--accent); outline-offset: -2px; }
.shots figure .retouch {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  border: none; border-radius: var(--r-pill); padding: 4px 10px;
  font-size: 11.5px; font-weight: 500;
  background: rgba(0, 0, 0, .55); color: #fff;
  opacity: 0; transition: opacity .12s, background .12s;
  backdrop-filter: saturate(180%) blur(8px);
}
.shots figure:hover .retouch, .shots figure:focus-within .retouch { opacity: 1; }
.shots figure .retouch:hover { background: var(--accent); }

/* ── retouch panel ─────────────────────────────────────────────────────── */

.refine-panel {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin-bottom: 20px;
  background: var(--card-raised);
}
.refine-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.refine-head strong { font-weight: 600; font-size: 15px; }
.refine-body { display: grid; grid-template-columns: 156px 1fr; gap: 18px; align-items: start; }
@media (max-width: 600px) { .refine-body { grid-template-columns: 1fr; } }
.refine-source { margin: 0; }
.refine-source img { width: 100%; border-radius: 10px; border: 1px solid var(--line-soft); display: block; }
.refine-source figcaption { font-size: 11.5px; text-align: center; margin-top: 6px; letter-spacing: .04em; text-transform: uppercase; }
.refine-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }

.ba-grid { grid-template-columns: 1fr 1fr; }
.ba-grid figcaption span:first-child { font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.ba-grid .after img { outline: 2px solid var(--accent); outline-offset: -2px; }
.refine-note {
  font-size: 13.5px; margin: 0 0 14px; padding: 10px 13px;
  border-radius: var(--r-field); background: var(--bg-sunken);
  white-space: pre-wrap; color: var(--ink-2);
}

/* ── batch history ─────────────────────────────────────────────────────── */

.history-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.history-item { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.history-item.active { border-color: var(--ink); color: var(--ink); font-weight: 500; }

/* ── dashboard ─────────────────────────────────────────────────────────── */

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1px; margin-bottom: 22px; background: var(--line-soft); border-radius: 12px; overflow: hidden; }
.stat { padding: 16px 18px; background: var(--card); }
.stat .label { font-size: 12px; color: var(--ink-3); }
.stat .value { font-size: 23px; font-weight: 600; letter-spacing: -0.018em; font-variant-numeric: tabular-nums; margin: 3px 0 2px; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; letter-spacing: .01em; }
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: none; }
tr.bad td { color: var(--bad); }

pre {
  background: var(--bg-sunken); border-radius: var(--r-field);
  padding: 14px; overflow-x: auto; white-space: pre-wrap;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* ── feature-request board ─────────────────────────────────────────────── */

.feedback-form { margin-top: 16px; }
.feedback-form-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.feedback-form-row input { flex: 1 1 200px; width: auto; }
.feedback-form-row .muted { font-size: 12px; font-variant-numeric: tabular-nums; }
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-list { list-style: none; margin: 16px 0 0; padding: 0; }
.feedback-list li {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 2px; border-bottom: 1px solid var(--line-soft);
}
.feedback-list li:last-child { border-bottom: none; }
.feedback-list input[type=checkbox] {
  width: 18px; height: 18px; margin-top: 2px; flex: none;
  accent-color: var(--accent); border-radius: 4px;
}
.feedback-list .body { flex: 1; min-width: 0; }
.feedback-list .text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.feedback-list li.done .text { text-decoration: line-through; color: var(--ink-3); }
.feedback-list .meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.feedback-list .del {
  flex: none; border: none; background: transparent; color: var(--ink-3);
  font-size: 15px; line-height: 1; padding: 4px 8px; border-radius: 8px;
  opacity: 0; transition: opacity .12s;
}
.feedback-list li:hover .del, .feedback-list li:focus-within .del { opacity: 1; }
.feedback-list .del:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.feedback-empty { color: var(--ink-3); padding: 16px 2px; }

/* ── first-visit hint bubble ───────────────────────────────────────────── */

.hint-bubble {
  /* `left` and `--arrow` are set from JS so the bubble sits under the 개선 요청
     tab specifically, and stays inside the viewport on narrow screens. */
  position: absolute; top: calc(100% + 12px); left: 0; z-index: 20;
  width: min(312px, calc(100vw - 44px));
  background: var(--ink); color: var(--bg);
  border-radius: 14px; padding: 16px 18px 15px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  animation: hint-in .3s cubic-bezier(.16, 1, .3, 1),
             hint-nudge 3.2s ease-in-out .6s infinite;
}
.hint-bubble::after {
  content: ''; position: absolute; top: -6px;
  left: var(--arrow, 34px); margin-left: -7px;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 7px solid var(--ink);
}
.hint-bubble strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.hint-bubble p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; opacity: .8; }
.hint-bubble p b { font-weight: 600; opacity: 1; }
.hint-bubble .primary {
  background: var(--bg); color: var(--ink); border: none;
  padding: 7px 15px; font-size: 13.5px; font-weight: 500;
}
.hint-bubble .primary:hover { background: var(--bg); opacity: .88; }
.hint-close {
  position: absolute; top: 8px; right: 10px;
  border: none; background: transparent; color: var(--bg);
  opacity: .55; font-size: 16px; line-height: 1; padding: 3px 6px; border-radius: 6px;
}
.hint-close:hover { opacity: 1; background: rgba(128, 128, 128, .25); }
@keyframes hint-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes hint-nudge { 0%, 90%, 100% { transform: none; } 95% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .hint-bubble { animation: hint-in .2s ease-out; }
  * { scroll-behavior: auto !important; }
}

/* ── remaining structural hooks ────────────────────────────────────────── */
.tab-panel { animation: panel-in .22s ease-out; }
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }
.outputs .shots { margin-top: 0; }
.outputs .muted { font-size: 13px; }
.refine-form { min-width: 0; }

/* ── image lightbox ────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  background: rgba(0, 0, 0, .88);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: lb-in .16s ease-out;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  grid-column: 2; justify-self: center;
  max-width: 100%; max-height: 86vh;
  border-radius: 10px; display: block;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.lb-close {
  position: absolute; top: 18px; right: 20px; z-index: 2;
  width: 38px; height: 38px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 22px; line-height: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, .26); }
.lb-nav {
  border: none; background: transparent; color: #fff;
  font-size: 42px; line-height: 1; padding: 12px 6px;
  opacity: .5; justify-self: center;
}
.lb-nav:hover { opacity: 1; background: transparent; }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-bar {
  position: absolute; bottom: 20px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  color: rgba(255, 255, 255, .75); font-size: 13px;
}
.lb-bar a { color: #fff; font-weight: 500; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 40px 1fr 40px; }
  .lb-nav { font-size: 30px; }
}

/* ── admin / normal login split ────────────────────────────────────────── */
.gate-card #admin-toggle { margin-top: 9px; font-size: 13.5px; color: var(--ink-2); }
.gate-card.admin { border-color: var(--ink); }
.gate-card.admin #password-label::after {
  content: ' (관리자)'; color: var(--accent); font-weight: 600;
}
.quota { font-variant-numeric: tabular-nums; }
.quota strong { color: var(--ink); font-weight: 600; }
.quota .low { color: var(--bad); }
