/* Rowmend — 재설계 (CSV-GUI-REDESIGN-20261013-05)
   밝은 표면 · navy 본문 · cobalt 주행동 · 절제된 mint 상태 · 변경은 amber, 위험은 red.
   외부 글꼴·이미지·CDN 없음 (시스템 글꼴). 대비 수치는 docs/REDESIGN.md 참조. */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --sunken: #f7f9fc;
  --line: #dde3ec;
  --line-2: #c5cedc;
  --ink: #13213c;
  --ink-2: #44516a;
  --ink-3: #59657c;
  --cobalt: #1d4ed8;
  --cobalt-2: #173fb0;
  --cobalt-tint: #e9effd;
  --mint: #0b6b4b;
  --mint-tint: #e3f4ec;
  --amber: #7a4800;
  --amber-mark: #c27c0e;
  --amber-tint: #fff2d6;
  --red: #b42318;
  --red-tint: #fdecea;
  --focus: #1d4ed8;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Noto Sans Mono CJK KR", "Noto Sans Mono", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); overflow-x: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-s); }
.skip:focus { left: 8px; }
.noscript { padding: 24px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono, code { font-family: var(--mono); }
.hint { color: var(--ink-3); font-size: .875rem; line-height: 1.5; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; min-width: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; text-align: center; }
.btn.primary { background: var(--cobalt); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--cobalt-2); }
.btn.secondary { background: var(--surface); color: var(--cobalt); border-color: var(--line-2); }
.btn.secondary:hover:not(:disabled) { border-color: var(--cobalt); background: var(--cobalt-tint); }
.btn.ghost { color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.btn.sm { padding: .4rem .7rem; font-size: .875rem; }
.btn.big { min-height: 52px; padding: .75rem 1.4rem; font-size: 1.05rem; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn.link { color: var(--cobalt); padding-left: 0; padding-right: 0; text-decoration: underline; text-underline-offset: 3px; justify-content: flex-start; }
.btn.icon-btn { color: var(--ink-2); border-color: var(--line); background: var(--surface); padding: .5rem .75rem; }
.btn.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); }
.btn:disabled { cursor: not-allowed; background: transparent; color: #5b667b; border-color: var(--line); }
.btn.primary:disabled, .btn.secondary:disabled { background: #e8ecf2; color: #4f5b70; border: 1px solid #d3dae5; }
.btn-plain { background: none; border: 0; padding: 0; cursor: pointer; }
.flip .ic { transform: scaleX(-1); }

/* ---------- 표시 요소 ---------- */
.tag { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 650; line-height: 1; padding: .3rem .5rem; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.tag-rec { background: var(--cobalt-tint); color: var(--cobalt-2); }
.tag-bad { background: var(--red-tint); color: var(--red); }
.tag-chg { background: var(--amber-tint); color: var(--amber); }
.tag-warn { background: var(--amber-tint); color: var(--amber); margin-left: .4rem; }
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-m); font-size: .925rem; line-height: 1.5; overflow-wrap: anywhere; }
.notice .ic { margin-top: 1px; }
.notice > span { flex: 1; min-width: 0; }
.notice.info { background: var(--cobalt-tint); color: #12307f; }
.notice.ok { background: var(--mint-tint); color: #0a5a3f; }
.notice.warn { background: var(--amber-tint); color: #693e00; }
.notice.error { background: var(--red-tint); color: #8f1c13; }
.notice .btn { margin-left: auto; }
.busy { align-items: center; }
.spinner { width: 18px; height: 18px; border: 2.5px solid #b8c7f2; border-top-color: var(--cobalt); border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.lang { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); }
.lang select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .4rem 1.9rem .4rem .6rem; max-width: 9.5rem; }
.mark { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--ink); }
.mark-line { stroke: #8ea2c9; stroke-width: 2.4; stroke-linecap: round; }
.mark-fix { stroke: #7ee2bd; stroke-width: 2.6; stroke-linecap: round; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand-name { font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
body.dragging::after { content: ""; position: fixed; inset: 10px; border: 3px dashed var(--cobalt); border-radius: var(--r-l); background: rgba(29, 78, 216, .06); pointer-events: none; z-index: 90; }

/* ======================= 첫 화면 ======================= */
.home { min-height: 100vh; display: flex; flex-direction: column; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px clamp(16px, 4vw, 48px); max-width: 1320px; width: 100%; margin: 0 auto; }
.home main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 48px; outline: none; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding: clamp(24px, 6vh, 72px) 0 56px; }
.hero h1 { font-size: clamp(2.1rem, 3.9vw, 3.5rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 760; max-width: 15ch; text-wrap: balance; }
:lang(ja) .hero h1, :lang(zh-Hans) .hero h1 { letter-spacing: 0; max-width: 14em; }
:lang(ko) .hero h1 { word-break: keep-all; letter-spacing: -0.02em; }
:lang(ja) .hero h1, :lang(ja) .lead { word-break: auto-phrase; }
.lead { font-size: 1.125rem; color: var(--ink-2); margin-top: 1.1rem; max-width: 34em; line-height: 1.6; }
:lang(ko) .lead { word-break: keep-all; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1rem; }
.hero-copy > .notice { margin: .5rem 0; }
.fact { display: flex; gap: .55rem; align-items: flex-start; color: var(--mint); font-weight: 600; font-size: .95rem; margin-top: 1.25rem; max-width: 34em; }
.fact .ic { margin-top: 2px; }
.hero-copy .hint { margin-top: .5rem; max-width: 36em; }
#resume-btn { margin-top: .25rem; }

.demo { background: var(--surface); border-radius: var(--r-l); padding: 20px; box-shadow: 0 1px 2px rgba(19, 33, 60, .06), 0 12px 32px -12px rgba(19, 33, 60, .16); min-width: 0; }
.demo-q { font-weight: 650; color: var(--ink-2); font-size: .9rem; margin-bottom: .6rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg [role=tab] { min-height: 44px; padding: .5rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg [role=tab]:hover { border-color: var(--line-2); color: var(--ink); }
.seg [role=tab][aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.demo-pane { margin-top: 1rem; display: grid; gap: .9rem; }
.demo-side { min-width: 0; }
.demo-cap { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 650; margin-bottom: .4rem; }
.before .demo-cap { color: var(--red); }
.after .demo-cap { color: var(--mint); }
.demo-scroll { overflow-x: auto; border-radius: var(--r-s); }
.demo-table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .875rem; }
.demo-table th, .demo-table td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.demo-table th { font-family: var(--sans); font-size: .8rem; color: var(--ink-2); font-weight: 650; background: var(--sunken); }
.before .demo-table { color: var(--ink-3); }
.before .demo-table td.bad, .demo-table td.bad { color: var(--red); }
.after .demo-table { color: var(--ink); }
.demo-table td.sp { background: var(--amber-tint); color: var(--amber); }
.demo-table tr.dup td { background: #fff8e8; }
.demo-foot { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; padding-top: .9rem; border-top: 1px solid var(--line); }
.demo-note { color: var(--ink-2); font-size: .925rem; flex: 1 1 18rem; }

.scope { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 64px; padding: 36px 0 8px; border-top: 1px solid var(--line); }
.scope h2 { font-size: 1.05rem; margin-bottom: .75rem; }
.facts li { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem 0; color: var(--ink-2); }
.facts .ic { margin-top: 2px; }
.facts.can .ic { color: var(--mint); }
.facts.cannot .ic { color: var(--ink-3); }

/* ======================= 작업대 ======================= */
.ws { display: grid; height: 100vh; height: 100dvh; grid-template-columns: 226px minmax(0, 1fr) minmax(330px, 380px); grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "top top top" "nav notice notice" "nav main panel"; }
.ws-top { grid-area: top; display: flex; align-items: center; gap: 1rem; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.file-id { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-left: 1rem; border-left: 1px solid var(--line); }
.file-name { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: .8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.ws-nav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; overflow-y: auto; }
.ws-nav ul { display: flex; flex-direction: column; gap: 2px; }
.nav-btn { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 46px; padding: .55rem .7rem; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink-2); font-weight: 600; text-align: left; }
.nav-btn:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.nav-btn[aria-current=page] { background: var(--cobalt-tint); color: var(--cobalt-2); box-shadow: inset 3px 0 0 var(--cobalt); }
.nav-btn:disabled { color: #5d687d; cursor: not-allowed; background: none; }
.nav-btn:disabled .badge { opacity: .9; }
.nav-btn[aria-current=page]:disabled { background: var(--cobalt-tint); color: var(--cobalt-2); }
.nav-l { flex: 1; min-width: 0; }
.nav-l .short { display: none; }
.badge { font-size: .75rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--mint-tint); color: var(--mint); }
.badge.need { background: var(--amber-tint); color: var(--amber); }
.badge.warn { background: var(--amber-tint); color: var(--amber); }
.badge.chg { background: var(--amber-tint); color: var(--amber); }
.m-only { display: none; }
.m-only-btn { display: none; }
.scroll-opts { max-height: 300px; overflow-y: auto; }
.badge.text { width: 10px; height: 10px; padding: 0; border-radius: 50%; }
.badge.text.ok { background: var(--mint); }
.badge.text.need { background: var(--amber-mark); }
.nav-fact { display: flex; gap: .5rem; align-items: flex-start; font-size: .8rem; color: var(--mint); padding: .5rem .6rem; line-height: 1.45; }
.nav-fact .ic { width: 18px; height: 18px; margin-top: 1px; }
.ws-notice { grid-area: notice; padding: 0 16px; }
.ws-notice:not(:empty) { padding-top: 10px; }
.ws-notice .notice + .notice { margin-top: 6px; }
.ws-main { grid-area: main; min-width: 0; min-height: 0; overflow: auto; padding: 16px; outline: none; }
.ws-panel { grid-area: panel; min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); }

/* 패널 공통 */
.p-body { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
.p-head h2 { font-size: 1.3rem; font-weight: 720; }
.p-lead { color: var(--ink-2); margin-top: .35rem; font-size: .95rem; }
.p-actions { position: sticky; bottom: 0; margin: auto -20px 0; padding: 14px 20px 16px; background: linear-gradient(rgba(255,255,255,0), var(--surface) 22%); display: flex; flex-direction: column; gap: .5rem; }
.summary { font-size: .875rem; color: var(--ink-3); }
.sub-h { font-size: 1rem; font-weight: 700; }
.opts { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opts legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: .35rem; }
.opts > .hint { margin-bottom: .35rem; }
.opt { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .35rem .5rem; border-radius: 10px; cursor: pointer; }
.opt:hover { background: var(--sunken); }
.opt input { width: 20px; height: 20px; accent-color: var(--cobalt); flex: none; margin: 0; }
.opt { flex-wrap: wrap; }
.opt-l { flex: 1 1 auto; min-width: 0; font-weight: 550; }
.opt.nw .opt-l { white-space: nowrap; }
.opt-tags { margin-left: auto; }
.opt-block { align-items: flex-start; }
.opt-block input { margin-top: 3px; }
.opt-sub { display: block; font-size: .825rem; font-weight: 400; color: var(--ink-3); }
.opt-tags { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; align-items: center; }
.opt-tags .opt-sub { display: inline; }
.field { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .95rem; }
.field input, textarea, .field-inline select { border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); min-height: 44px; padding: .5rem .7rem; width: 100%; }
.field input { font-family: var(--mono); font-weight: 400; }
.field-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .875rem; color: var(--ink-2); font-weight: 600; min-width: 0; }
.field-inline select { width: auto; max-width: 18rem; font-weight: 500; color: var(--ink); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: .8rem; color: var(--ink-3); }
.stats dd { margin: 0; font-size: 1.35rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.block { border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: .5rem; outline: none; }
.block.danger { background: var(--red-tint); color: #7c1810; }
.block h3 { display: flex; gap: .5rem; align-items: center; font-size: 1rem; }
.lines { display: flex; flex-direction: column; gap: 4px; }
.lines li { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.lines code { font-size: .825rem; overflow-wrap: anywhere; color: inherit; opacity: .9; }
.line-row { flex-direction: row !important; align-items: center; justify-content: space-between; gap: .5rem; padding: 4px 0; border-bottom: 1px solid var(--line); }
.where { color: var(--ink-3); font-size: .8rem; font-family: var(--sans); }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: .85rem; }
.row-acts { display: inline-flex; gap: 2px; flex: none; }
.stack { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }

/* 문제 목록 + 상세 */
.issue-list { display: flex; flex-direction: column; gap: 2px; }
.issue-row { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 46px; padding: .55rem .75rem; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; font-weight: 600; font-size: .925rem; }
.issue-row:hover { background: var(--sunken); }
.issue-row[aria-pressed=true] { background: var(--cobalt-tint); color: var(--cobalt-2); box-shadow: inset 3px 0 0 var(--cobalt); }
.issue-row.tone-bad .ic { color: var(--red); }
.issue-row.tone-warn .ic { color: var(--amber-mark); }
.issue-row.tone-info .ic { color: var(--ink-3); }
.detail { display: flex; flex-direction: column; gap: .75rem; padding-top: 16px; border-top: 1px solid var(--line); outline: none; }
.detail > h3 { font-size: 1.05rem; }
.detail.tone-bad > h3 { color: var(--red); }
.detail > p { color: var(--ink-2); font-size: .925rem; }
.mini-cmp { border-collapse: collapse; width: 100%; font-size: .85rem; table-layout: fixed; }
.mini-cmp th, .mini-cmp td { text-align: left; padding: .4rem .45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.mini-cmp th { font-size: .78rem; color: var(--ink-3); font-weight: 650; }
.mini-cmp td.chg, .cmp td.a { background: var(--amber-tint); color: var(--amber); }
.dup-group { padding: 8px 0; border-bottom: 1px solid var(--line); }
.dup-h { font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.dup-group .line-row { border: 0; }
details.excel { border-top: 1px solid var(--line); padding: 12px 0 20px; }
details.excel summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details.excel p { color: var(--ink-2); font-size: .9rem; margin-top: .4rem; }
.results { display: flex; flex-direction: column; gap: 6px; }
.segs { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--line-2); font-size: .9rem; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.seg-opt input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 읽는 방법 미리보기 */
.read-main { display: flex; flex-direction: column; gap: 18px; }
.pv-h { font-size: .95rem; font-weight: 700; margin-bottom: .45rem; }
.pv .hint { margin-bottom: .45rem; }
.raw { font-family: var(--mono); font-size: .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: .5rem 0; max-height: 260px; overflow: auto; }
.raw .ln { display: flex; white-space: pre; }
.raw .no { flex: none; width: 3rem; text-align: right; padding-right: .7rem; color: var(--ink-3); user-select: none; }
.raw .d { background: var(--cobalt); color: #fff; border-radius: 3px; padding: 0 1px; }

/* 표 */
.table-area { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.t-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.t-foot { display: flex; justify-content: flex-end; }
.t-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.btn-group { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 1px; }
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager-t { font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-hint { margin-top: -2px; }
.chip-row { display: flex; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--cobalt-tint); color: var(--cobalt-2); font-weight: 650; font-size: .85rem; border-radius: 999px; padding: 0 0 0 .8rem; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: inherit; border-radius: 999px; cursor: pointer; }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); max-width: 100%; }
.tablewrap.grid { flex: 1; min-height: 240px; }
table.data { border-collapse: separate; border-spacing: 0; font-size: .875rem; min-width: 100%; }
table.data th, table.data td { padding: .35rem .7rem; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf1f6; }
table.data thead th { position: sticky; top: 0; z-index: 2; background: var(--sunken); color: var(--ink-2); font-size: .8rem; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data thead th.idc { color: var(--cobalt-2); }
table.data td.cell { font-family: var(--mono); white-space: pre; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; cursor: text; }
table.data td.cell:hover { background: #f4f7fd; }
table.data td.chg { background: var(--amber-tint); box-shadow: inset 3px 0 0 var(--amber-mark); color: #4f2f00; }
table.data td.hit { box-shadow: inset 0 0 0 2px #8aa6ef; background: #f1f5fe; }
table.data td.chg.hit { box-shadow: inset 3px 0 0 var(--amber-mark), inset 0 0 0 2px #8aa6ef; }
table.data td.sel { box-shadow: inset 0 0 0 2px var(--cobalt); background: var(--cobalt-tint); }
table.data td.sp { text-decoration: underline wavy var(--amber-mark); text-underline-offset: 4px; }
table.data td.risk { color: var(--red); }
table.data td.idc { background-image: linear-gradient(var(--cobalt-tint), var(--cobalt-tint)); }
table.data td.miss { color: var(--ink-3); font-family: var(--sans); font-style: italic; cursor: default; }
table.data tr.hdr td { background: #fbfcfe; font-weight: 700; }
table.data tr.excl td { color: #5c667a; background: #f2f4f7; text-decoration: line-through; }
table.data tr.excl td.status-cell { text-decoration: none; }
table.data .rowno { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--sans); width: 1%; }
table.data .st { width: 1%; }
.status-cell { white-space: nowrap; }
.status-cell .tag { margin-right: .3rem; }
.status-cell .row-x { border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-weight: 550; }
.status-cell .row-x:hover:not(:disabled) { border-color: var(--line-2); }
table.preview td { font-family: var(--mono); white-space: pre; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.empty-row { color: var(--ink-3); text-align: center !important; padding: 2rem !important; }
.cmp { border-collapse: collapse; width: 100%; font-size: .85rem; }
.cmp th, .cmp td { padding: .45rem .55rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.cmp th { background: var(--sunken); font-size: .78rem; color: var(--ink-2); position: sticky; top: 0; }
.cmp td.b { color: var(--ink-2); white-space: pre-wrap; }
.cmp td.a { white-space: pre-wrap; }

/* 편집기 */
.editor textarea { min-height: 120px; font-family: var(--mono); font-size: .9rem; white-space: pre; resize: vertical; }
.ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.ed-head h2 { font-size: 1.1rem; }
.f-lbl { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: -10px; }
.editor .orig { font-family: var(--mono); font-size: .85rem; background: var(--sunken); border-radius: var(--r-s); padding: .5rem .7rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9rem; overflow: auto; }
.ed-actions { flex-direction: row !important; flex-wrap: wrap; }
.ed-actions .btn { flex: 1 1 auto; }

/* ---------- 중간 폭: 탐색을 아이콘 위주로 ---------- */
@media (max-width: 1199px) and (min-width: 900px) {
  .ws { grid-template-columns: 84px minmax(0, 1fr) minmax(320px, 360px); }
  .nav-btn { flex-direction: column; gap: .2rem; font-size: .72rem; padding: .5rem .25rem; text-align: center; }
  .nav-l .full { display: none; }
  .nav-l .short { display: inline; }
  .nav-fact { display: none; }
  .badge { font-size: .68rem; padding: .1rem .35rem; }
  .top-actions .lbl { display: none; }
}

/* ---------- 모바일: 과업 탭 + 필요한 화면 하나 ---------- */
@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; padding-top: 12px; gap: 28px; }
  .hero h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .cta-row .btn { flex: 1 1 100%; }
  .scope { grid-template-columns: 1fr; }
  .demo { padding: 16px; }
  .demo-foot .btn { width: 100%; }

  .ws { display: flex; flex-direction: column; height: auto; min-height: 100vh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .ws-top { flex-wrap: wrap; gap: .4rem .5rem; padding: 6px 12px; }
  .ws-top .brand-name { display: none; }
  .file-id { order: 3; flex-basis: 100%; border-left: 0; padding-left: 0; padding-bottom: 4px; }
  .top-actions { gap: .35rem; }
  .top-actions .lbl, #export-btn { display: none; }
  .lang select { max-width: 7.5rem; }
  .ws-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-right: 0; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow: visible; }
  .ws-nav ul { flex-direction: row; gap: 2px; }
  .ws-nav li { flex: 1 1 0; min-width: 0; }
  .m-only { display: block; }
  .nav-btn { flex-direction: column; gap: 2px; min-height: 58px; padding: 6px 2px; font-size: .72rem; text-align: center; justify-content: center; position: relative; }
  .nav-btn[aria-current=page] { box-shadow: inset 0 3px 0 var(--cobalt); }
  .nav-l { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-l .full { display: none; }
  .nav-l .short { display: inline; }
  .badge { position: absolute; top: 3px; right: calc(50% - 26px); font-size: .62rem; padding: .05rem .32rem; }
  .nav-fact { display: none; }
  .ws-notice { padding: 0 12px; }
  .ws-main { padding: 12px; overflow: visible; }
  .ws-panel { border-left: 0; overflow: visible; }
  .p-body { padding: 16px 12px 0; min-height: 0; }
  .p-actions { bottom: calc(68px + env(safe-area-inset-bottom)); margin: 0 -12px; padding: 12px; }
  .tablewrap.grid { max-height: 62vh; }
  .t-head { flex-direction: column; align-items: stretch; }
  .t-bar { gap: 8px; }
  .t-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .t-bar .btn-group { grid-column: 1 / -1; justify-self: start; }
  .field-inline { flex-direction: column; align-items: stretch; gap: 2px; font-size: .78rem; }
  .field-inline select { max-width: none; width: 100%; }
  .t-hint { display: none; }
  .badge.text { width: 9px; height: 9px; top: 8px; right: calc(50% - 18px); }
  .m-only-btn { display: inline-flex; }
  .p-actions.m-static { position: static; background: none; }
  .file-sub { display: none; }
  .status-cell .row-x { display: none; }
  .raw { max-height: 200px; }
  .read-main .tablewrap { max-height: 240px; }
  /* 화면 하나만: 과업별로 보이는 영역 */
  #app[data-step=table] .ws-panel,
  #app[data-step=issues] .ws-main, #app[data-step=changes] .ws-main, #app[data-step=export] .ws-main { display: none; }
  /* 편집은 아래에서 올라오는 전체 화면 시트 */
  #app.editing .ws-panel { display: block; position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: var(--surface); }
  #app.editing .p-actions { bottom: 0; }
}
@media (max-width: 380px) {
  .btn.big { font-size: 1rem; }
  .seg [role=tab] { font-size: .85rem; padding: .45rem .7rem; }
  .top-actions .btn.icon-btn { padding: .5rem; }
  .lang .ic { display: none; }
  .lang select { max-width: 6.6rem; padding-right: 1.5rem; padding-left: .45rem; }
  .ws-top .top-actions { gap: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  * { scroll-behavior: auto !important; }
}
