/* 소설 집필실 — 공통 스타일 (기능정의서 CSSOM 확정값 기준) */
:root {
  color-scheme: dark;
  --bg: #101413;
  --sidebar: #121715;
  --panel: #181e1b;
  --panel-2: #1d2520;
  --line: #2b3530;
  --line-soft: #222b26;
  --text: #e8ece5;
  --text-2: #a4afa5;
  --text-3: #77847a;
  --accent: #bad8b4;
  --accent-dark: #203326;
  --warn: #dfbc83;
  --rose: #dc9f9a;
  --blue: #a2bfd1;
  --violet: #b9abd4;
  --menu-on-bg: #253027;
  --menu-on-line: #354539;
  --chip-on-bg: #2d3b2e;
  --chip-on-line: #5d795b;
  --chip-on-text: #dbe9d4;
  --btn2-bg: #1c241e;
  --btn2-line: #38433a;
  --btn2-text: #d2dbcc;
  --graph-line: #344037;
  --graph-bg: #161c18;
  --node-line: #475948;
  --node-bg: #202b22;
  --edge: #4c6251;
  --edge-on: #b5d3ad;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", Batang, serif;
  --side-w: 216px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: #203024; padding: 8px 12px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

/* ── 사이드바 ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w);
  background: var(--sidebar); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 20;
  padding: 26px 18px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin: 0 0 0 10px; }
.brand img { width: 32px; height: 32px; display: block; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.brand-sub { font-size: 10px; color: var(--text-2); letter-spacing: 1.5px; margin-top: 2px; }
.work-card {
  margin: 26px 0 20px; padding: 18px 14px 14px; border: 1px solid var(--line);
  border-radius: 6px; background: linear-gradient(160deg, #1b231e, #141a17);
  position: relative; overflow: hidden; cursor: pointer; text-align: left; width: 100%;
}
.work-card::after { content: "冊"; position: absolute; right: -6px; bottom: -14px; font-size: 92px; color: rgba(186,216,180,.06); font-family: var(--serif); pointer-events: none; }
.work-card .eyebrow { font-size: 10px; color: var(--text-2); }
.work-card .work-title { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.5; letter-spacing: -.5px; margin: 14px 0 12px; word-break: keep-all; }
.work-card .work-vol { font-size: 10px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 9px; padding: 12px 10px; border-radius: 5px;
  font-size: 13px; color: var(--text); background: transparent; border: 1px solid transparent;
  cursor: pointer; text-align: left; text-decoration: none; width: 100%;
}
.nav-btn:hover { background: #18201b; }
.nav-btn.on { background: var(--menu-on-bg); border-color: var(--menu-on-line); color: var(--accent); }
.nav-ico { font-size: 18px; width: 20px; line-height: 1; text-align: center; flex: none; font-family: var(--serif); }
.nav-badge { margin-left: auto; font-size: 10px; background: #3a3322; color: var(--warn); border-radius: 3px; padding: 2px 5px; }
.side-foot { margin-top: auto; padding: 22px 6px 0; font-size: 10px; color: var(--text-2); line-height: 1.7; }
.side-foot strong { display: block; color: var(--text); font-size: 11px; margin-bottom: 6px; }
.side-foot strong::before { content: "• "; color: var(--accent); }
.side-foot .link-btn { margin-top: 10px; display: inline-block; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 11px; cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--accent); }

/* ── 작업 영역 ── */
.workspace { margin-left: var(--side-w); width: calc(100% - var(--side-w)); min-height: 100vh; }
.topbar {
  height: 68px; padding: 0 34px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: rgba(16,20,19,.96); z-index: 15;
}
.crumb { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.crumb .sep { color: var(--text-3); }
.vol-select { height: 37px; min-width: 118px; }
.top-status { margin-left: auto; font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.top-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.top-status.offline::before { background: var(--warn); }
.icon-btn { width: 30px; height: 30px; border-radius: 5px; border: 1px solid var(--btn2-line); background: transparent; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:disabled { opacity: .55; cursor: wait; }
.main { padding: 22px 24px 0; }
.main-inner { padding-bottom: 80px; }

/* ── 페이지 머리 ── */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 18px; }
.page-head .eyebrow { font-size: 9px; letter-spacing: 2px; color: var(--text-2); font-weight: 600; text-transform: uppercase; }
.page-head h1 { font-size: 27px; font-weight: 550; line-height: 1.3; letter-spacing: -1px; margin-top: 10px; }
.page-head p { font-size: 12px; line-height: 1.6; color: var(--text-2); margin: 4px 0 0; }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; font-size: 11px; padding: 10px 13px; border-radius: 5px;
  background: var(--btn2-bg); border: 1px solid var(--btn2-line); color: var(--btn2-text); cursor: pointer;
  transition: filter .15s; text-decoration: none; font-weight: 500; line-height: 1.3;
}
.btn:hover { filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #203024; font-weight: 600; }
.btn.warn { color: var(--warn); }
.btn.danger { color: var(--rose); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn .count { border-left: 1px solid rgba(32,48,36,.35); padding-left: 10px; }
.btn.lg { min-height: 44px; padding: 12px 16px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── 펼침 바 ── */
details.bar { border: 1px solid #3f5640; background: #1d2a20; border-radius: 6px; margin-bottom: 16px; }
details.bar > summary { padding: 14px 16px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
details.bar > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.bar > summary::before, details.fold > summary::before { content: "▸ "; }
details[open].bar > summary::before, details[open].fold > summary::before { content: "▾ "; }
details.bar .bar-body { padding: 0 16px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
details.fold > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; padding: 10px 0; }
details.fold.boxed { border: 1px solid var(--line); border-radius: 6px; padding: 4px 16px; background: var(--panel-2); margin: 14px 0; }

/* ── 검색·필터 ── */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; width: 335px; min-width: 260px; }
.search input, .search input[type=search] {
  width: 100%; height: 37px; padding: 0 40px 0 34px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); font-size: 12px;
}
.search::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: var(--text-2); font-size: 15px; }
.search kbd { position: absolute; right: 10px; top: 10px; font-size: 10px; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; color: var(--text-3); }
select, .select {
  height: 37px; padding: 0 28px 0 12px; border: 1px solid var(--line); border-radius: 5px; background-color: var(--panel);
  font-size: 12px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%239FA99E' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filters .status-select { width: 185px; }
.filters .count-note { margin-left: auto; font-size: 11px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip { font-size: 11px; padding: 7px 10px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip .n { color: var(--text-3); font-size: 10px; }
.chip.on { background: var(--chip-on-bg); border-color: var(--chip-on-line); color: var(--chip-on-text); font-weight: 600; }

/* ── 패널 ── */
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 22px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.4px; }
.panel-head p { font-size: 11px; color: var(--text-2); margin: 6px 0 0; line-height: 1.7; }
.big-num { margin-left: auto; font-size: 22px; font-weight: 500; white-space: nowrap; }
.big-num small { font-size: 10px; color: var(--text-2); margin-left: 4px; }
.notice { border-left: 3px solid var(--warn); background: #2a271d; padding: 12px 16px; font-size: 12px; margin: 12px 0; line-height: 1.6; border-radius: 0 4px 4px 0; }
.notice.green { border-color: var(--accent); background: #1d2a20; }
.muted { color: var(--text-2); }
.small { font-size: 11px; }
.empty { text-align: center; padding: 40px 12px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ── 상태 표시 ── */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #26302a; color: var(--text-2); white-space: nowrap; }
.tag::before { content: "•"; }
.tag.plain::before { content: none; }
.tag.green { background: #23382a; color: var(--accent); }
.tag.warn { background: #3a3322; color: var(--warn); }
.tag.rose { background: #3d2726; color: var(--rose); }
.tag.blue { background: #213039; color: var(--blue); }
.tag.violet { background: #2e2a3d; color: var(--violet); }

/* ── 그래프(설계도) ── */
.atlas-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.atlas-wrap.with-detail { grid-template-columns: minmax(0, 1fr) 360px; }
.graph {
  border: 1px solid var(--graph-line); border-radius: 8px; background-color: var(--graph-bg);
  background-image: radial-gradient(rgba(186,216,180,.08) 1px, transparent 1px); background-size: 22px 22px;
  overflow: hidden; position: relative;
}
.graph-tools { height: 55px; padding: 0 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(24,30,27,.9); }
.graph-tools .title { font-size: 12px; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; padding: 3px; gap: 3px; margin-left: auto; }
.seg button { background: transparent; border: 0; font-size: 10px; padding: 6px 9px; border-radius: 3px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: #2b382d; color: var(--text); font-weight: 600; }
.zoom-tools { display: flex; gap: 4px; }
.zoom-tools button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); cursor: pointer; font-size: 12px; }
.graph-stage { position: relative; height: 640px; overflow: hidden; cursor: grab; touch-action: none; }
.graph-stage.dragging { cursor: grabbing; }
.graph-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.graph-canvas svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edge { stroke: var(--edge); stroke-width: 1.4; fill: none; }
.edge.on { stroke: var(--edge-on); stroke-width: 2; }
.edge.review { stroke-dasharray: 5 6; }
.root-node { position: absolute; border: 1px solid #5d795b; background: #1f3123; border-radius: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 4px 22px; padding: 0 20px; text-align: center; }
.root-node b { font-size: 22px; font-weight: 700; white-space: nowrap; }
.root-node span { font-size: 13px; color: var(--text); }
.node {
  position: absolute; width: 200px; min-height: 96px; padding: 15px 16px 13px; border-radius: 8px;
  border: 1px solid var(--node-line); background: var(--node-bg); box-shadow: 0 5px 18px rgba(0,0,0,.133);
  cursor: pointer; text-align: left; color: var(--text);
}
.node:hover { filter: brightness(1.08); }
.node.on { border-color: var(--edge-on); box-shadow: 0 0 0 1px var(--edge-on), 0 5px 18px rgba(0,0,0,.133); }
.node .n-code { font-size: 9px; color: var(--text-3); letter-spacing: .5px; }
.node .n-title { font-size: 15px; font-weight: 550; line-height: 1.5; margin: 3px 0 5px; word-break: keep-all; }
.node .n-sum { font-size: 11px; color: var(--text-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.branch { width: 254px; min-height: 138px; display: flex; gap: 14px; }
.branch .b-ico { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #6b836b; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 15px; flex: none; margin-top: 18px; }
.branch .n-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.branch .b-meta { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.port { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #6b836b; top: 50%; margin-top: -2px; }
.port.l { left: -3px; } .port.r { right: -3px; }

.item-list { padding: 8px 16px 16px; }
.item-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line-soft); cursor: pointer; align-items: start; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.item-row:hover { background: #1b221d; }
.item-row.on { background: #1f2a21; }
.item-row .code { font-size: 10px; color: var(--text-3); padding-top: 3px; word-break: break-all; }
.item-row .t { font-size: 14px; font-weight: 600; }
.item-row .s { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }

.detail {
  width: 360px; position: sticky; top: 84px; max-height: 74vh; min-height: 620px; overflow-y: auto;
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 20px; font-size: 15px; line-height: 1.8;
}
.detail .close-x { float: right; }
.detail .d-code { font-size: 10px; color: var(--text-3); letter-spacing: .5px; }
.detail h3 { font-size: 20px; font-weight: 600; line-height: 1.45; margin: 4px 0 8px; letter-spacing: -.5px; }
.detail .d-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.detail .d-sec h4 { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.detail .d-sec p { margin: 0; font-size: 14px; white-space: pre-wrap; }
.link-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.link-list li { padding: 4px 0; }
.link-list button { background: none; border: 0; color: var(--text); cursor: pointer; text-align: left; padding: 0; font-size: 13px; }
.link-list button:hover { color: var(--accent); }

/* ── 카드 그리드 ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); background: var(--panel-2); border-radius: 6px; padding: 18px; }
.card h3 { font-size: 15px; font-weight: 600; margin: 4px 0 8px; line-height: 1.5; }
.card .code { font-size: 10px; color: var(--text-3); letter-spacing: .5px; }
.card p { font-size: 12px; color: var(--text-2); line-height: 1.7; margin: 0; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--text-2); }
.card-foot .go { margin-left: auto; }
.stat-card { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; color: var(--text); }
.stat-card .row { display: flex; align-items: center; }
.stat-card .row b { margin-left: auto; font-size: 22px; font-weight: 500; }
.stat-card.on { border-color: var(--chip-on-line); background: #213024; }
.stat-card span.d { font-size: 12px; color: var(--text-2); }
.stats-line { display: flex; gap: 32px; flex-wrap: wrap; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0 20px; }
.stats-line b { font-size: 20px; font-weight: 500; }
.stats-line small { font-size: 10px; color: var(--text-2); margin-left: 4px; }

/* 능력·대가 */
.cost-card { border-top: 1px solid var(--line); padding: 22px 0; }
.cost-card .title-btn { display: inline-flex; font-size: 20px; font-weight: 700; background: #2b3a2e; border: 0; padding: 6px 10px; border-radius: 3px; cursor: pointer; color: var(--text); }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-top: 14px; }
.dl-grid > div { border-top: 1px solid var(--line); padding: 14px 0; }
.dl-grid h4 { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.dl-grid p { margin: 0 0 6px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.dl-grid p b { color: var(--text); font-weight: 600; margin-right: 6px; }
.person-tag { display: inline-flex; border: 1px solid var(--btn2-line); background: var(--btn2-bg); border-radius: 3px; font-size: 10px; padding: 3px 7px; margin: 4px 4px 0 0; cursor: pointer; }

/* 연표 */
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 24px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 26px 12px; }
.timeline li::before { content: ""; position: absolute; left: -17px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline .where { font-size: 10px; color: var(--text-2); }
.timeline .tl-title { font-size: 15px; font-weight: 600; margin: 4px 0; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); text-align: left; }
.timeline p { margin: 2px 0 6px; font-size: 12px; color: var(--text-2); }

/* 자료·삽화 */
.asset-card { border: 1px solid var(--line); background: var(--panel-2); border-radius: 6px; padding: 0 0 14px; overflow: hidden; }
.asset-img { height: 262px; background: #121815; display: flex; align-items: center; justify-content: center; position: relative; cursor: zoom-in; border: 0; width: 100%; padding: 0; }
.asset-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.asset-img .zoom-tag { position: absolute; right: 8px; bottom: 8px; background: rgba(16,20,19,.85); font-size: 11px; padding: 5px 8px; border-radius: 3px; }
.asset-card .meta { padding: 12px 14px 0; }
.asset-card .meta .k { font-size: 11px; font-weight: 600; }
.asset-card .meta .w { font-size: 10px; color: var(--text-2); margin: 3px 0 6px; }
.asset-card .meta .t { font-size: 13px; font-weight: 600; line-height: 1.5; }
.asset-card .meta p { font-size: 11px; color: var(--text-2); margin: 4px 0 0; line-height: 1.6; }
.filter-grid { display: grid; grid-template-columns: 1fr 2fr 1fr 1fr auto; gap: 14px; align-items: end; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; }
.filter-grid label { font-size: 11px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; }
.filter-grid select { width: 100%; height: 40px; }

/* ── 원고 검수 ── */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.review-side { position: sticky; top: 88px; max-height: calc(100dvh - 108px); overflow-y: auto; }
.manuscript { background: #141a17; border: 1px solid var(--line); border-radius: 6px; padding: 22px 18px 22px 8px; font-size: 15px; line-height: 1.9; }
.ms-line { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
.ms-line .ln { font-size: 10px; color: var(--text-3); text-align: right; padding-top: 5px; cursor: pointer; user-select: none; background: none; border: 0; }
.ms-line .ln:hover, .ms-line.picked .ln { color: var(--accent); }
.ms-line.picked .tx { background: rgba(186,216,180,.08); }
.ms-line .tx { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; padding: 0 6px; border-radius: 3px; }
.ms-line .tx.h { font-weight: 700; font-size: 17px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.field input, .field textarea, .field select { width: 100%; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], textarea {
  border: 1px solid var(--line); border-radius: 5px; background: #141a17; padding: 9px 12px; font-size: 13px; line-height: 1.6;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
textarea.tall { min-height: 140px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.steps .card { display: flex; flex-direction: column; gap: 8px; min-height: 230px; }
.steps .card .k { font-size: 10px; color: var(--text-2); }
.steps .card h3 { font-size: 17px; font-weight: 700; margin: 0; }
.steps .card .btn-row { margin-top: auto; }
.ai-out { white-space: pre-wrap; font-size: 13px; line-height: 1.8; background: #141a17; border: 1px solid var(--line); border-radius: 5px; padding: 14px; max-height: 420px; overflow-y: auto; }
.record { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 10px; background: var(--panel-2); }
.record .r-k { font-size: 10px; color: var(--text-2); }
.record .r-t { font-size: 14px; font-weight: 600; margin: 4px 0; }
.record blockquote { margin: 8px 0; padding: 6px 12px; border-left: 2px solid var(--line); color: var(--text-2); font-size: 12px; white-space: pre-wrap; }
.record .r-actions { margin-top: 10px; }

/* ── 판본 ── */
.ver-card { border: 1px solid #3f5640; background: #1d2a20; border-radius: 6px; padding: 18px; margin: 14px 0 20px; font-size: 11px; line-height: 2; }
.ver-card b { font-size: 14px; }
.hash { font-family: ui-monospace, Consolas, monospace; font-size: 10px; background: #141a17; padding: 10px 12px; border-radius: 3px; word-break: break-all; margin-top: 6px; }
.dl-btn { display: flex; justify-content: space-between; align-items: center; width: 420px; max-width: 100%; border: 1px solid #3f5640; background: #22301f; padding: 10px 12px; border-radius: 4px; margin-bottom: 6px; cursor: pointer; text-align: left; font-size: 12px; font-weight: 600; color: var(--text); }
.dl-btn small { display: block; font-size: 10px; font-weight: 400; color: var(--text-2); }
.log { border-left: 1px solid var(--line); padding: 0 0 14px 18px; margin-left: 4px; }
.log .k { font-size: 10px; color: var(--text-2); }
.log .t { font-size: 14px; font-weight: 600; margin: 3px 0; }
.log p { margin: 0; font-size: 12px; color: var(--text-2); }

/* ── 모달·토스트 ── */
dialog.modal {
  width: calc(100% - 40px); max-width: 570px; max-height: 80vh; padding: 24px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); box-shadow: 0 20px 100px rgba(0,0,0,.533);
}
dialog.modal.wide { max-width: 860px; }
dialog.modal::backdrop { background: rgba(5,8,7,.66); }
.modal h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
dialog.img-modal { width: calc(100vw - 32px); max-width: 1400px; height: calc(100dvh - 32px); max-height: none; padding: 0; border: 0; background: #0b0e0d; border-radius: 8px; }
dialog.img-modal::backdrop { background: rgba(0,0,0,.8); }
.img-modal .img-box { width: 100%; height: calc(100% - 52px); overflow: auto; display: flex; align-items: center; justify-content: center; }
.img-modal img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-modal.actual img { max-width: none; max-height: none; }
.img-modal .img-bar { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.img-modal .img-bar .t { font-size: 13px; font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font-size: 12px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #26332a; border: 1px solid #3f5640; color: var(--text); padding: 11px 16px; border-radius: 6px; font-size: 13px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }
.toast.warn { background: #3a3322; border-color: #5a4c2c; color: var(--warn); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 12px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 6px 0; }
.multi-box { max-height: 160px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; background: #141a17; }
.link-edit { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto auto; gap: 6px; margin-bottom: 6px; align-items: center; }

/* ── 반응형 ── */
@media (min-width: 1650px) { .main { padding-left: 42px; padding-right: 42px; } .graph-stage { height: 760px; } }
@media (max-width: 1280px) {
  .review-layout { grid-template-columns: minmax(0, 1fr); }
  .review-side { position: static; max-height: none; }
}
@media (max-width: 1250px) { :root { --side-w: 192px; } .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1050px) {
  :root { --side-w: 172px; }
  .atlas-wrap.with-detail { grid-template-columns: minmax(0, 1fr); }
  .detail { position: fixed; right: 12px; top: 90px; bottom: 18px; width: min(360px, 100vw - 24px); max-height: calc(100dvh - 108px); min-height: 0; z-index: 40; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 0 0; border-right: 0; border-bottom: 1px solid var(--line-soft); overflow: visible; }
  .brand { margin: 0 18px; }
  .brand img { width: 29px; height: 29px; }
  .work-card, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding: 14px 12px 12px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { width: auto; white-space: nowrap; flex: none; padding: 10px 10px; }
  .nav-ico { display: none; }
  .workspace { margin-left: 0; width: 100%; }
  .topbar { height: auto; min-height: 55px; flex-wrap: wrap; padding: 10px 18px; position: static; }
  .crumb .crumb-path { display: none; }
  .crumb { margin-right: auto; }
  .top-status { order: 3; width: 100%; margin-left: 0; }
  .main { padding: 18px 12px 0; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head h1 { font-size: 23px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .head-actions .memo-btn { display: none; }
  .search { width: 100%; min-width: 0; }
  .filters .status-select { width: 180px; }
  .search input, textarea, input[type=text], input[type=email], input[type=password], input[type=search], select { font-size: 16px; }
  .graph-stage { min-height: 570px; height: 75dvh; }
  .grid-2, .grid-3, .grid-4, .steps, .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .item-row { grid-template-columns: minmax(0, 1fr) auto; }
  .item-row .code { grid-column: 1 / -1; }
  .filter-grid { grid-template-columns: 1fr; }
  .manuscript { font-size: 17px; line-height: 2; padding: 16px 10px 16px 0; }
  .ms-line { grid-template-columns: 30px minmax(0, 1fr); gap: 6px; }
  .panel { padding: 16px; }
  .stats-line { gap: 16px; }
  .kv { grid-template-columns: 1fr; }
  .link-edit { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── 장별 검토 페이지 ── */
.cr-top { height: 60px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 14px; padding: 0 4vw; }
.cr-top .brand { margin: 0; }
.cr-top .brand-name { font-size: 15px; }
.cr-top .where { font-size: 13px; color: var(--text-2); }
.cr-top .back { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.cr-main { max-width: 1420px; margin: 0 auto; padding: 38px 4vw 60px; }
.cr-main h1 { font-size: 30px; font-weight: 700; margin: 10px 0 12px; }
.cr-lead { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.cr-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 24px; }
.progress { border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin-top: 18px; }
.progress .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress b { font-size: 15px; }
.progress .meta { margin-left: auto; font-size: 11px; color: var(--text-2); }
.bar-track { height: 3px; background: #3a423d; border-radius: 2px; margin-top: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.cr-nav { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.cr-nav > summary { padding: 16px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.cr-nav > summary::before { content: "▸ "; }
.cr-nav[open] > summary::before { content: "▾ "; }
.cr-nav .inner { padding: 0 12px 12px; }
.cr-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.cr-list button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; display: flex; gap: 8px; align-items: center; color: var(--text); }
.cr-list button:hover { background: #1b221d; }
.cr-list button.on { background: var(--menu-on-bg); color: var(--accent); }
.cr-list .st { margin-left: auto; font-size: 10px; color: var(--text-3); white-space: nowrap; }
.cr-sec { border-top: 1px solid var(--line); padding: 18px 0; }
.cr-sec h4 { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.cr-sec p { margin: 0; font-size: 16px; line-height: 1.85; white-space: pre-wrap; }
.opinion { border: 1px solid var(--line); border-radius: 6px; padding: 24px; margin-top: 30px; background: var(--panel); }
.opinion textarea { width: 100%; min-height: 140px; padding: 12px; line-height: 1.7; resize: vertical; }
.opinion .btn { min-height: 44px; }
@media (max-width: 850px) { .cr-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; } }
@media (max-width: 680px) {
  .cr-grid { grid-template-columns: minmax(0, 1fr); }
  .cr-main { padding: 25px 18px 40px; }
  .cr-list { max-height: 42vh; }
  .cr-top { padding: 0 18px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .cr-top .where { font-size: 12px; }
  .cr-top .back { margin-left: 0; width: 100%; }
  .cr-main h1 { font-size: 26px; }
  .opinion { padding: 16px; }
  .opinion textarea { font-size: 16px; }
}

/* ── 도면 겹쳐 보기 ── */
.bp-page { background: #18201b; min-height: 100vh; }
.bp-main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.bp-main h1 { font-size: 24px; font-weight: 700; margin: 28px 0 18px; }
.bp-grid { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 24px; margin-top: 30px; align-items: start; }
.bp-ctrl { background: #243228; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.bp-ctrl .btn { min-height: 44px; background: #2f4232; border-color: #4a5f4b; font-size: 13px; }
.bp-ctrl .state { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.bp-stage { position: relative; background: #f3ead8; min-height: 420px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bp-rot { position: relative; transition: transform .35s; }
.bp-rot img { display: block; max-width: 100%; }
.bp-rot img.layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.bp-stage.lines img { filter: grayscale(1) contrast(2.4) brightness(1.15); }
@media (max-width: 760px) {
  .bp-grid { grid-template-columns: minmax(0, 1fr); }
  .bp-ctrl .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
}

/* ── 검수 보고서(종이색) ── */
body.paper { background: #f4efe4; color: #2a2620; color-scheme: light; }
.paper .pp-main { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; line-height: 1.8; }
.paper a { color: #3d6b45; }
.paper h1 { font-size: 26px; margin: 14px 0; }
.paper .pp-card { background: #fffdf8; border: 1px solid #dcd3c2; border-radius: 6px; padding: 18px 20px; margin: 14px 0; }
.paper .pp-card h2 { font-size: 16px; margin-bottom: 4px; }
.paper .pp-meta { font-size: 12px; color: #6e665a; }
.paper .pp-body { white-space: pre-wrap; font-size: 14px; margin-top: 10px; }
.paper .btn { background: #fff; color: #2a2620; border-color: #cfc5b2; }
.paper details > summary { cursor: pointer; font-weight: 600; }
@media print { .paper .no-print { display: none; } }

/* 만든이 표시 */
.credit { position: fixed; right: 12px; bottom: 8px; font-size: 10px; color: var(--text-3); z-index: 5; pointer-events: none; }
body.paper .credit { color: #8a8170; }
@media (max-width: 760px) { .credit { position: static; text-align: right; padding: 12px 12px 16px; } }
@media print { .credit { position: static; text-align: right; } }
