/* 2Able 공정관리 시스템 웹판 공통 스타일. 원래 프로그램의 색(Teal #00ADB5 · Charcoal #393E46 · 밝은 회색 바탕)을 잇는다.
   화면 틀: 옆 메뉴(어두운 Charcoal) + 위 막대(흰색) + 본문(옅은 회색). 페이지 전체는 스크롤하지 않고 표·패널 안에서만 스크롤한다.
   쓰는 법(클래스 목록): docs/FOUNDATION.md */
@font-face { font-family: "Pretendard"; src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations"),
  url("/static/fonts/PretendardVariable.woff2") format("woff2"); font-weight: 45 920; font-display: swap; }

:root {
  --bg: #f2f4f6; --surface: #ffffff; --surface-2: #f7f9fa; --surface-3: #eef1f3;
  --line: #e1e5e9; --line-strong: #cbd2d8;
  --text: #1d2228; --text-2: #46505a; --muted: #6f7984; --faint: #98a1aa;
  --teal: #00adb5; --teal-strong: #00838a; --teal-deep: #006a70; --teal-soft: #e5f6f7; --teal-line: #9fdde0;
  --ink: #222831; --charcoal: #393e46; --side: #2a2f36; --side-2: #333941; --side-text: #c5cbd2; --side-muted: #8b939c;
  --danger: #d23b3b; --danger-soft: #fdecec; --warn: #b86e00; --warn-soft: #fff4e2; --ok: #1d8a57; --ok-soft: #e7f5ee;
  --info: #2c68d6; --info-soft: #eaf1fd;
  /* 공정 색 묶음: 준비 · 스캔 · 이미지 · 색인 · 검수 · 업로드 */
  --t-prep: #5f6f84; --t-prep-bg: #eef1f5; --t-scan: #7350c0; --t-scan-bg: #f1ecfb; --t-img: #2b72c6; --t-img-bg: #e8f1fc;
  --t-idx: #00838a; --t-idx-bg: #e2f5f6; --t-isp: #b06a00; --t-isp-bg: #fdf2e0; --t-up: #1d8a57; --t-up-bg: #e5f4ec;
  --radius: 10px; --radius-sm: 7px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .05), 0 1px 1px rgba(20, 30, 40, .03);
  --shadow-pop: 0 12px 32px rgba(20, 30, 40, .16), 0 2px 6px rgba(20, 30, 40, .08);
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --side-w: 236px; --top-h: 60px;
  --focus: 0 0 0 3px rgba(0, 173, 181, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--teal-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 15px; height: 15px; } .ico-lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ 틀 */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; overflow: hidden; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--teal); display: grid; place-items: center; color: #0b3436;
  font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { color: var(--side-muted); font-size: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 10px; scrollbar-width: thin; scrollbar-color: #4a515a transparent; }
.nav-group { margin-top: 8px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { padding: 0 10px 3px; font-size: 11px; font-weight: 600; color: var(--side-muted); letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 8px; color: var(--side-text); font-size: 13.5px;
  position: relative; text-decoration: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.is-active { background: rgba(0, 173, 181, .14); color: #fff; font-weight: 600; }
.nav a.is-active::before { content: ""; position: absolute; left: -10px; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.nav a .ico { color: var(--side-muted); } .nav a.is-active .ico, .nav a:hover .ico { color: var(--teal); }
.nav a .lock { margin-left: auto; font-size: 11px; color: var(--side-muted); }
.side-foot { padding: 10px 18px 12px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.side-foot img { width: 26px; height: auto; opacity: .85; }
.side-foot small { display: block; color: var(--side-muted); font-size: 11.5px; line-height: 1.4; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top-h); flex: none; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 16px; padding: 0 22px; }
.top-title h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.top-title p { font-size: 12.5px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-date { font-size: 12.5px; color: var(--muted); padding-right: 6px; }
.att { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2); }
.att .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.att.on .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(29, 138, 87, .15); }
.att button { height: 26px; padding: 0 10px; border-radius: 999px; border: 0; background: var(--charcoal); color: #fff; font-size: 12px; cursor: pointer; }
.att button:hover { background: var(--ink); }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border: 0; background: none; border-radius: 10px; cursor: pointer; }
.user-btn:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-deep); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; }
.user-meta { text-align: left; line-height: 1.25; }
.user-meta b { display: block; font-size: 13px; font-weight: 600; }
.user-meta small { font-size: 11.5px; color: var(--muted); }
.user-menu { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 6px; z-index: 40; }
.user-menu .um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.user-menu button, .user-menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  font-size: 13px; cursor: pointer; color: var(--text); text-decoration: none; }
.user-menu button:hover, .user-menu a:hover { background: var(--surface-3); }

.view { flex: 1; min-height: 0; overflow: hidden; padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.view.scroll { overflow-y: auto; }

/* ------------------------------------------------------------------ 카드·패널 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.005em; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 12px; }
.card.fill > .card-body { flex: 1; min-height: 0; overflow: auto; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 2px 0 10px; display: flex; align-items: center; gap: 8px; }
.split { display: grid; gap: 14px; min-height: 0; flex: 1; }
.split > * { min-height: 0; }
.row { display: flex; gap: 14px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 14px; min-height: 0; min-width: 0; }

/* ------------------------------------------------------------------ 입력 */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer, .spacer { flex: 1; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req::after { content: " *"; color: var(--danger); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-3 { grid-column: span 3; } .form-grid .span-all { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; }
.form-row > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.inp { height: 34px; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 13.5px; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.inp:hover { border-color: #b6bec6; }
.inp:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.inp:disabled, .inp[readonly] { background: var(--surface-3); color: var(--text-2); }
.inp.is-bad { border-color: var(--danger); background: #fffafa; }
textarea.inp { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select.inp { padding-right: 30px; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f7984' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.inp-sm { height: 30px; font-size: 13px; }
.inp-group { display: flex; gap: 6px; align-items: center; }
.inp-group > .inp { flex: 1; }
.hint { font-size: 12px; color: var(--muted); }
.err-text { font-size: 12px; color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--teal-strong); margin: 0; cursor: pointer; }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .inp { padding-left: 34px; }

/* ------------------------------------------------------------------ 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s, color .12s; text-decoration: none; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--teal-strong); border-color: var(--teal-strong); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn-dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn-dark:hover { background: var(--ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--danger); border-color: #efc4c4; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #b52f2f; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 34px; padding: 0; } .btn-sm.btn-icon { width: 30px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* 탭: .seg(알약 모양 전환) · .tabs(밑줄) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button .cnt { margin-left: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: 0; background: none; height: 42px; padding: 0 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--teal-strong); border-bottom-color: var(--teal); }

/* ------------------------------------------------------------------ 표 */
.tbl-wrap { overflow: auto; min-height: 0; flex: 1; position: relative; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12.5px; text-align: left;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl td.wrap { white-space: normal; }
.tbl td.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr { cursor: default; }
.tbl tbody tr:hover td { background: #f8fbfb; }
.tbl tbody tr.is-selected td { background: var(--teal-soft); }
.tbl tbody tr.is-current td { background: #d6f0f1; box-shadow: inset 0 0 0 0 transparent; }
.tbl tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.tbl tbody tr.is-muted td { color: var(--faint); }
.tbl .chk { width: 38px; text-align: center; padding-left: 12px; padding-right: 4px; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl .lb { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--text-2); letter-spacing: .02em; }
.tbl-foot { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.tbl.compact td { padding: 6px 10px; } .tbl.compact th { padding: 7px 10px; }

/* ------------------------------------------------------------------ 배지·통계 */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.st-prep { background: var(--t-prep-bg); color: var(--t-prep); } .st-scan { background: var(--t-scan-bg); color: var(--t-scan); }
.st-img { background: var(--t-img-bg); color: var(--t-img); } .st-idx { background: var(--t-idx-bg); color: var(--t-idx); }
.st-isp { background: var(--t-isp-bg); color: var(--t-isp); } .st-up { background: var(--t-up-bg); color: var(--t-up); }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); }
.b-err { background: var(--danger-soft); color: var(--danger); } .b-info { background: var(--info-soft); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; line-height: 1.15; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 11.5px;
  background: var(--surface); color: var(--text-2); font-family: inherit; }

/* 빈 상태 */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 16px; color: var(--muted);
  text-align: center; font-size: 13px; }
.empty .ico { width: 34px; height: 34px; color: var(--faint); stroke-width: 1.4; }
.empty b { color: var(--text-2); font-size: 14px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--info-soft); color: #23498f;
  font-size: 12.5px; line-height: 1.55; }
.note.warn { background: var(--warn-soft); color: #7a4a00; } .note.err { background: var(--danger-soft); color: #8f2424; }
.note.ok { background: var(--ok-soft); color: #145c3b; }
.note .ico { margin-top: 1px; }

/* ------------------------------------------------------------------ 창·알림 */
.modal-back { position: fixed; inset: 0; background: rgba(23, 28, 34, .42); display: grid; place-items: center; z-index: 60; padding: 24px; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); width: min(560px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column; }
.modal.wide { width: min(860px, 100%); } .modal.narrow { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 4px 18px 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.msgbox { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); width: min(440px, 100%); padding: 20px 20px 16px; }
.msgbox-top { display: flex; gap: 14px; }
.msgbox-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.msgbox-ico.info { background: var(--teal-soft); color: var(--teal-strong); } .msgbox-ico.warn { background: var(--warn-soft); color: var(--warn); }
.msgbox-ico.err { background: var(--danger-soft); color: var(--danger); } .msgbox-ico.ok { background: var(--ok-soft); color: var(--ok); }
.msgbox-text h3 { font-size: 15.5px; font-weight: 700; margin-top: 2px; }
.msgbox-text p { font-size: 13.5px; color: var(--text-2); margin-top: 6px; white-space: pre-line; }
.msgbox-list { margin: 12px 0 0; padding: 0; list-style: none; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.msgbox-list li { display: flex; gap: 10px; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
.msgbox-list li:last-child { border-bottom: 0; }
.msgbox-list .lb { font-family: ui-monospace, Menlo, monospace; color: var(--text-2); flex: none; }
.msgbox-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.drawer-back { position: fixed; inset: 0; background: rgba(23, 28, 34, .3); z-index: 55; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-pop); z-index: 56;
  display: flex; flex-direction: column; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-pop);
  font-size: 13px; animation: toast-in .18s ease-out; }
.toast-ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.12); }
.toast.ok .toast-ico { background: var(--ok); } .toast.warn .toast-ico { background: var(--warn); } .toast.err .toast-ico { background: var(--danger); }
.toast-text { flex: 1; min-width: 0; } .toast-text strong { font-weight: 600; } .toast-text p { margin-top: 2px; color: #cfd5db; font-size: 12.5px; white-space: pre-line; }
.toast .x { border: 0; background: none; color: #aab2ba; cursor: pointer; padding: 2px; border-radius: 6px; }
.toast .x:hover { color: #fff; background: rgba(255,255,255,.1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .7); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; z-index: 20; border-radius: inherit; }
.busy-text { font-size: 13px; color: var(--text-2); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--teal-line); border-top-color: var(--teal-strong); animation: spin .8s linear infinite;
  display: inline-block; }
.spin-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 원문 이미지 보기(어두운 뷰어) */
.viewer { position: relative; background: #1f242a; border-radius: var(--radius); overflow: hidden; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.viewer-stage { flex: 1; min-height: 0; overflow: hidden; position: relative; cursor: grab; display: grid; place-items: center; }
.viewer-stage.grabbing { cursor: grabbing; }
.viewer-stage img { max-width: none; user-select: none; -webkit-user-drag: none; box-shadow: 0 6px 24px rgba(0,0,0,.4); transform-origin: center center; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #272d34; color: #d5dbe1; font-size: 12.5px; }
.viewer-bar .btn { height: 28px; background: transparent; border-color: #434b54; color: #d5dbe1; font-size: 12.5px; padding: 0 9px; }
.viewer-bar .btn:hover { background: #343b43; }
.viewer-bar .btn.btn-icon { width: 28px; padding: 0; }
.viewer-bar .pg { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.viewer-empty { color: #8f99a3; font-size: 13px; text-align: center; padding: 24px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px; background: #272d34; scrollbar-width: thin; }
.thumbs button { flex: none; width: 58px; border: 2px solid transparent; border-radius: 6px; padding: 0; background: #1f242a; cursor: pointer; position: relative; }
.thumbs button img { width: 100%; display: block; border-radius: 4px; }
.thumbs button.is-on { border-color: var(--teal); }
.thumbs button span { position: absolute; left: 3px; bottom: 3px; background: rgba(0,0,0,.6); color: #fff; font-size: 10.5px; padding: 0 4px; border-radius: 4px; }
