/* 로보북 GUI — 단일 스타일시트 (빌드 체인 없음) */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #fbfbf9;
  --sunken: #f1f1ec;
  --ink: #17181c;
  --ink-2: #3d4048;
  --muted: #7a7d86;
  --line: #e7e6e0;
  --line-2: #efeee9;

  --brand: #4b3fe4;
  --brand-ink: #3529c4;
  --brand-soft: #efedfd;
  --brand-line: #d9d5fb;

  --ok: #157a4b;    --ok-bg: #e8f5ee;
  --warn: #8f5b00;  --warn-bg: #fcf2dc;
  --danger: #b4261a; --danger-bg: #fdeceb;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 24, 28, .04), 0 2px 8px rgba(23, 24, 28, .04);
  --shadow-lg: 0 8px 28px rgba(23, 24, 28, .08);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
/* .badge/.pill 이 display 를 지정하므로 hidden 속성이 무시되지 않게 못박는다 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
code { font-family: var(--mono); font-size: .88em; background: var(--sunken); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--brand-soft); }

/* ── 레이아웃 ─────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand b { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 16px 10px 6px; letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
}
.nav-item:hover { background: var(--sunken); color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav-step {
  width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--sunken); color: var(--muted);
}
.nav-item.on .nav-step { background: var(--brand); color: #fff; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.usage {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 11px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px;
}
.usage .k { color: var(--muted); }
.usage .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.run-badge {
  display: flex !important; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; font-weight: 600;
}
.run-badge[hidden] { display: none !important; }
.run-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1) } 50% { opacity: .35; transform: scale(.8) } }

.main { flex: 1; min-width: 0; }
.content { padding: 40px 48px 64px; max-width: 1160px; margin: 0 auto; }

@media (max-width: 960px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap;
             align-items: center; gap: 6px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 10px 0 0; }
  .brand small, .nav-label { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { padding: 7px 9px; font-size: 13.5px; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .content { padding: 24px 16px 48px; }
}

/* ── 타이포·머리 ──────────────────────────────────────────────────── */
h1 { font-size: 28px; line-height: 1.3; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 8px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 .muted, h2 .small { font-weight: 500; letter-spacing: 0; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.eyebrow { font-size: 12.5px; font-weight: 700; color: var(--brand); letter-spacing: .04em; margin-bottom: 6px; }
.lead { color: var(--ink-2); font-size: 15.5px; margin: 0 0 28px; max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .lead { margin-bottom: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── 카드(패널) ───────────────────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h1, .panel-head h2 { margin: 0; }
.panel > p:last-child { margin-bottom: 0; }
.panel p.muted.small { margin: 0 0 14px; }
.step-no {
  width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex: none;
  background: var(--sunken); color: var(--ink-2); font-size: 13px; font-weight: 800;
}
.panel.is-done .step-no { background: var(--ok-bg); color: var(--ok); }
.panel.is-now { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.panel.is-now .step-no { background: var(--brand); color: #fff; }
.panel.is-locked { opacity: .62; }

/* ── 알림 ────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 11px; margin-bottom: 14px; font-size: 14px; border: 1px solid transparent; }
.alert a { font-weight: 600; margin-left: 4px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #f3e2b8; }
.alert.danger { background: var(--danger-bg); color: var(--danger); border-color: #f6cfcb; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #cbe8d8; }
.alert.warn a, .alert.danger a, .alert.ok a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.empty {
  color: var(--muted); padding: 26px 16px; margin: 0; text-align: center;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 11px; font-size: 14px;
}

/* ── 배지 ────────────────────────────────────────────────────────── */
.badge, .pill, .tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.pill { background: var(--sunken); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.muted { background: var(--sunken); color: var(--muted); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag { background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; }

/* ── 버튼·폼 ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font: 600 14px/1.3 var(--font); letter-spacing: -0.01em;
  cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
  box-shadow: 0 1px 1px rgba(23, 24, 28, .03); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #d8d7d0; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(75, 63, 228, .25); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand);
}

input[type=text], input[type=search], input[type=number], input[type=password], select, textarea {
  font: 14.5px/1.45 var(--font); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); max-width: 100%; transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #a6a8af; }
input:hover, select:hover, textarea:hover { border-color: #d8d7d0; }
select { 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='%237a7d86' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { width: 100%; resize: vertical; }
input[type=file] { font: 13.5px var(--font); color: var(--muted); }
input[type=file]::file-selector-button {
  font: 600 13px var(--font); padding: 7px 12px; margin-right: 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; }
label { cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; margin-right: 14px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input[type=text] { flex: 1; min-width: 220px; }
.msg { font-size: 13px; margin-left: 4px; color: var(--muted); }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

details > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; opacity: .55; margin-right: 2px;
}
details[open] > summary::before { transform: rotate(45deg); }

/* ── 표 ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr:last-child td { border-bottom: none; }
.table.small { font-size: 13.5px; }
.table.small td { padding: 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td .small.muted { margin-top: 2px; }

/* ── 진행 상황 ────────────────────────────────────────────────────── */
.progress-box { font-size: 14px; }
.progress-box:empty { display: none; }
.stepper { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 14px; counter-reset: s; }
.step {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px 4px 0; color: var(--muted); font-size: 13px; font-weight: 600;
}
.step::before {
  counter-increment: s; content: counter(s); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: var(--sunken); color: var(--muted);
}
.step::after { content: ""; width: 18px; height: 1.5px; background: var(--line); margin-left: 7px; }
.step:last-child::after { display: none; }
.step.done { color: var(--ok); }
.step.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.step.now { color: var(--brand-ink); }
.step.now::before { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.pmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pmeta span { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 5px 11px; font-size: 13px; color: var(--ink-2); }
.pmeta b { font-variant-numeric: tabular-nums; }
.console {
  background: #15161a; color: #d6d8de; padding: 14px 16px; border-radius: 11px;
  font: 12.5px/1.6 var(--mono); max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0;
}
details.log { margin-top: 6px; }

/* ── 주제 선정: 세 경로 · 대화 ─────────────────────────────────────── */
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.path {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.path:hover { border-color: var(--brand-line); box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--ink); }
.path.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.path .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.path .ico svg { width: 21px; height: 21px; }
.path b { font-size: 16px; }
.path span.muted { line-height: 1.55; }

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 2px 14px; }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.6; }
.bubble.q { align-self: flex-start; background: var(--sunken); color: var(--ink); border-top-left-radius: 5px; }
.bubble.a { align-self: flex-end; background: var(--brand); color: #fff; border-top-right-radius: 5px; }
.slot-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 12px; }
.slot-bar .slot-empty { opacity: .55; }
#chatNeed { margin-top: 8px; }
.chat-form { border-top: 1px solid var(--line-2); padding-top: 14px; }
.chat-form textarea { width: 100%; }
.chat-form .row { margin-top: 10px; }
.cand { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.cand:last-child { border-bottom: 0; }
.cand input { margin-top: 5px; }
@media (max-width: 640px) { .bubble { max-width: 92%; } }

/* ── 시장 조사 점수·전략 ───────────────────────────────────────────── */
.score-card .scorebox { display: flex; align-items: center; gap: 12px; }
.ring { position: relative; flex: none; width: 68px; height: 68px; color: var(--brand); }
.ring-lg { width: 124px; height: 124px; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 11; }
.ring-track { stroke: var(--sunken); }
.ring-value { stroke: currentColor; stroke-linecap: round; }
.ring.tone-ok { color: var(--ok); }
.ring.tone-warn { color: #d08a12; }
.ring.tone-muted { color: var(--muted); }
.ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; color: var(--ink); }
.ring-text b { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.ring-text span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.ring-lg .ring-text b { font-size: 34px; }
.score-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.score-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.score-item-title { font-weight: 700; margin-bottom: 2px; }

/* ── 주제 카드 화면 ────────────────────────────────────────────────── */
.card-topic { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.card-hero { display: flex; gap: 32px; align-items: center; justify-content: space-between; }
.hero-body { flex: 1; min-width: 0; }
.hero-appeal { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.45; margin: 0 0 16px; padding-left: 14px; border-left: 3px solid var(--brand); }
.hero-scores { display: flex; gap: 24px; flex: none; }
.hero-score { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 124px; }
.hero-score > b { margin-top: 6px; font-size: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.card-grid .panel { margin-bottom: 0; }
.info { margin-bottom: 14px; }
.info:last-child { margin-bottom: 0; }
.info-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.info-text { margin: 0 0 14px; }
ul.dots { margin: 2px 0 0; padding-left: 18px; }
ul.dots li { margin-bottom: 3px; }
ul.dots li::marker { color: var(--muted); }
.job-list li { display: flex; gap: 10px; margin-bottom: 3px; }
.job-list .muted { flex: none; width: 30px; font-size: 13px; line-height: 1.8; }
@media (max-width: 860px) {
  .card-hero { flex-direction: column; align-items: stretch; gap: 20px; }
  .hero-scores { justify-content: space-around; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) { .score-items { grid-template-columns: minmax(0, 1fr); } }

/* ── 설정 ────────────────────────────────────────────────────────── */
.provider-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.provider {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.provider:hover { border-color: #d8d7d0; }
.provider.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.provider input { margin-top: 3px; }
.provider-body { min-width: 0; }
.provider-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }

.keys-group { margin: 22px 0 10px; font-size: 13px; color: var(--muted); font-weight: 650; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.keys-group:first-of-type { margin-top: 6px; }
.keyrow { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.keyrow-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.keyrow .row { margin-bottom: 6px; }
.keyrow input[type=password] { flex: 1; min-width: 220px; font-family: var(--mono); font-size: 13.5px; }

.settings-list { display: flex; flex-direction: column; gap: 12px; }
.setting { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 12px; padding: 14px 16px; display: block; }
.setting-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.setting > .muted.small { margin: -4px 0 8px; }
.setting .row { margin-top: 10px; }
.setting input[type=text], .setting textarea, .setting input[type=number] { width: 100%; }

/* ── 리포트(마크다운) ─────────────────────────────────────────────── */
.markdown { line-height: 1.8; font-size: 15px; color: var(--ink-2); }
.markdown h1 { font-size: 22px; color: var(--ink); margin: 0 0 12px; }
.markdown h2 { font-size: 18px; color: var(--ink); margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-2); display: block; }
.markdown h3 { font-size: 15.5px; color: var(--ink); margin: 20px 0 8px; }
.markdown table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 12px 0; display: block; overflow-x: auto; }
.markdown th, .markdown td { border-bottom: 1px solid var(--line-2); padding: 8px 10px; text-align: left; }
.markdown th { color: var(--muted); font-weight: 600; border-bottom-color: var(--line); }
.markdown ul { padding-left: 20px; }
.markdown blockquote { margin: 12px 0; padding: 10px 16px; background: var(--surface-2); border-left: 3px solid var(--brand-line); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.markdown hr { border: none; border-top: 1px solid var(--line-2); margin: 22px 0; }
.markdown code { font-size: .85em; }

/* ── 결과 화면: 한눈에 · 접히는 리포트 절 ───────────────────────────── */
ul.plain { list-style: none; margin: 0; padding: 0; }
.digest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 28px; }
.digest-col h3 { font-size: 13.5px; color: var(--muted); font-weight: 600; margin: 0 0 8px; letter-spacing: .01em; }
.digest-col h3 + ul, .digest-col h3 + p { margin-bottom: 18px; }
.digest-col > :last-child { margin-bottom: 0; }
.digest-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; line-height: 1.45; }
.digest-row:last-child { border-bottom: none; }
.digest-row > span:first-child { min-width: 0; }
.digest-row a { color: var(--ink); }
.digest-row a:hover { color: var(--brand); }
.digest-stats { display: flex; gap: 8px; margin: 2px 0 12px; }
.digest-stats > div { flex: 1; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 8px; text-align: center; }
.digest-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.digest-stats span { font-size: 12px; color: var(--muted); }
.report .panel-head { margin-bottom: 4px; }
.report-section { border-top: 1px solid var(--line-2); }
.report-section > summary { display: flex; width: 100%; padding: 13px 2px; font-size: 15px; font-weight: 650; color: var(--ink); }
.report-section > summary:hover { color: var(--brand-ink); }
.report-section > .markdown { padding: 2px 2px 18px; font-size: 14.5px; }
.report-section > .markdown h3:first-child { margin-top: 6px; }

/* ── 전자책 제작 ───────────────────────────────────────────────────── */
.track { display: flex; gap: 4px; margin: 0 0 22px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.track a {
  flex: 1; min-width: 68px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.track a:hover { background: var(--sunken); color: var(--ink); }
.track a i { font-style: normal; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--sunken); }
.track a.done { color: var(--ok); }
.track a.done i { background: var(--ok-bg); }
.track a.now { background: var(--brand-soft); color: var(--brand-ink); }
.track a.now i { background: var(--brand); color: #fff; }
.brief { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.brief dt { color: var(--muted); }
.brief dd { margin: 0; }
.requests { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; margin-bottom: 8px; }
.requests h3 { margin: 0 0 4px; font-size: 14px; }
.requests ul { margin: 0 0 8px; padding-left: 18px; }
.ch-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ch-card.is-next { border-color: var(--brand-line); }
.ch-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ch-draft { max-height: 60vh; overflow-y: auto; margin-top: 10px; padding: 12px 14px; background: var(--sunken); border-radius: 10px; }
.ch-feedback { margin: 0; padding-left: 18px; }
.ch-revise { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ch-revise textarea { width: 100%; }
.outline-row { margin-bottom: 8px; padding: 6px; border-radius: 11px; }
.outline-row:hover { background: var(--surface-2); }
.outline-row .ol-n { width: 38px; font-weight: 700; color: var(--muted); }
#ivBox { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 18px; }
#ivBox h3 { margin: 0 0 10px; }
#bibleForm .bf-fact, #bibleForm .bf-term { margin-bottom: 8px; }
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.file {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.file:hover { border-color: var(--brand-line); box-shadow: var(--shadow-lg); color: var(--ink); }
.file b { font-size: 14px; }
.file span { font-size: 12.5px; color: var(--muted); }
.file.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.file.primary span { color: rgba(255, 255, 255, .78); }

/* ── 오류 화면 ────────────────────────────────────────────────────── */
.error-panel { max-width: 560px; margin: 8vh auto 0; text-align: center; padding: 40px 32px; }
.error-code { font-size: 54px; font-weight: 800; letter-spacing: -0.04em; color: var(--brand); line-height: 1; margin-bottom: 14px; }
.table.board td:first-child { min-width: 210px; }
.table.board td:nth-child(2) { min-width: 200px; max-width: 320px; }
.provider .model-pick { width: 100%; margin: 6px 0 4px; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.provider .model-price { font-size: 12px; }

/* ── 주제 카드 ────────────────────────────────────────────────────── */
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
.facts ul.plain { margin-top: 6px; }
.facts ul.plain li { margin-bottom: 3px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: 2px 0; } .facts dd { margin-bottom: 10px; } }

/* ── 디자인·최종본 ─────────────────────────────────────────────────── */
#s-publish h3 { margin: 22px 0 6px; }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 10px; }
.cover-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: none; border: 2px solid transparent;
  border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.cover-pick img { width: 100%; display: block; border-radius: 3px; box-shadow: 0 1px 6px rgba(0, 0, 0, .22); }
.cover-pick:hover { border-color: var(--line, #ddd); }
.cover-pick.on { border-color: var(--brand, #3C6A61); }
.design-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.design-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.design-sample { margin-top: 12px; padding: 14px 18px; max-width: 460px; border: 1px solid var(--line, #ddd); border-radius: 6px; background: #fff; color: #222; }
.design-sample p { margin: 6px 0 0; text-align: justify; }
.extra-list { list-style: none; margin: 10px 0 0; padding: 0; }
.extra-list li { padding: 10px 0; border-bottom: 1px solid var(--line, #eee); }
.extra-list .row a { margin-right: 10px; }

/* ── 상세페이지 ───────────────────────────────────────────────────── */
#s-sales h3 { margin: 22px 0 6px; }
.sales-form .wide { grid-column: 1 / -1; }
.sales-form textarea, .sales-listing textarea, .sales-fields textarea { width: 100%; box-sizing: border-box; font: inherit; }
.sales-top { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; align-items: flex-start; }
.sales-phone { flex: none; width: 300px; max-width: 100%; height: 560px; overflow-y: auto; border: 1px solid var(--line, #ddd); border-radius: 14px; background: #fff; }
.sales-phone img { display: block; width: 100%; }
.sales-side { flex: 1; min-width: 220px; }
.sales-listing { display: grid; gap: 10px; }
.sales-listing label, .sales-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sales-sec { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line, #eee); scroll-margin-top: 12px; }
.sales-sec.is-hidden .sales-thumb { opacity: .5; }
.sales-thumb img { display: block; width: 100%; height: 240px; object-fit: contain; object-position: top; background: #F3F4F6; border-radius: 6px; border: 1px solid var(--line, #eee); }
.sales-noimg { padding: 30px 10px; text-align: center; border: 1px dashed var(--line, #ddd); border-radius: 6px; }
.sales-move { margin-top: 8px; gap: 6px; }
.sales-move .btn { flex: 1; padding: 4px 6px; font-size: 12px; }
.sales-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sales-fields label.sales-hide { flex-direction: row; align-items: center; margin-left: auto; }
.sales-fields label.sales-check { flex-direction: row; align-items: center; align-self: end; padding-bottom: 8px; }
.sales-design { border: 1px solid var(--line, #eee); border-radius: 8px; padding: 8px 12px; }
.sales-design summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.sales-design .design-form { margin-top: 10px; }
.sales-ai { display: flex; flex-wrap: wrap; gap: 8px; }
.sales-ai input { flex: 1; min-width: 180px; }
.sales-fields { display: grid; gap: 8px; min-width: 0; }
.sales-fields p { margin: 0; }
@media (max-width: 640px) { .sales-sec { grid-template-columns: 1fr; } .sales-phone { width: 100%; } }
