/* DevScope 화면 스타일 — v0.10.0 다크 기본 테마(의미별 토큰). 밝은 화면은 html[data-theme="light"].
   인쇄용 PDF/DOCX 는 서버가 흰 종이로 만들며 이 스타일과 무관하다(iframe 의 PDF 는 흰 배경 그대로). */
:root {
  color-scheme: dark;
  --bg: #0f1724; --panel: #172233; --raised: #1e2b40; --sunken: #121c2b; --head: #223149; --sec: #273955; --chip: #26354d;
  --line: #31425c; --line-strong: #6a80a6; --input: #101a29;
  --text: #e6ebf2; --muted: #a3afc2; --accent: #8fb3ff; --accent-strong: #3b6fd8; --accent-weak: rgba(91, 141, 239, .16);
  --ok: #6fd6a3; --warn: #f2bd6b; --bad: #ff8f9c; --private: #d0a8f5; --ai: #c7a9ff;
  --ok-bg: rgba(111, 214, 163, .14); --warn-bg: rgba(242, 189, 107, .14); --bad-bg: rgba(255, 143, 156, .14);
  --private-bg: rgba(208, 168, 245, .14); --ai-bg: rgba(199, 169, 255, .15);
  --side: #0b111c; --side-text: #c9d3e2; --side-active: #1e2b40; --toast: #26354d; --focus: #ffd27a;
  --overlay: rgba(4, 8, 15, .7); --shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9; --panel: #fff; --raised: #fff; --sunken: #f7f8fa; --head: #eef1f5; --sec: #e3e9f2; --chip: #e9edf3;
  --line: #d9dee6; --line-strong: #8794a8; --input: #fff;
  --text: #1d2430; --muted: #5d6879; --accent: #2457c5; --accent-strong: #2457c5; --accent-weak: #e8eefb;
  --ok: #1a7148; --warn: #8f5500; --bad: #b00020; --private: #7a2fb0; --ai: #5b2aa6;
  --ok-bg: #dff3e8; --warn-bg: #fff1d6; --bad-bg: #fde3e7; --private-bg: #f1e4fa; --ai-bg: #efe7fb;
  --side: #1f2a3d; --side-text: #dbe2ec; --side-active: #2d3b55; --toast: #1f2a3d; --focus: #2457c5;
  --overlay: rgba(20, 28, 42, .45); --shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 "Malgun Gothic", "맑은 고딕", system-ui, sans-serif; color: var(--text); background: var(--bg); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 7px; background: var(--input); min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
textarea { resize: vertical; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px; }
button, .button-link { border: 1px solid var(--line-strong); background: var(--raised); border-radius: 5px; padding: 5px 12px; cursor: pointer; white-space: nowrap; color: var(--text); }
.button-link { display: inline-block; text-align: center; }
button:hover, .button-link:hover { border-color: var(--accent); }
button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
button.primary:hover { filter: brightness(1.12); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
select option { background: var(--panel); color: var(--text); }

.shell { display: grid; grid-template-columns: 176px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 12px 0; border-right: 1px solid var(--line); }
.side a { color: var(--side-text); padding: 10px 18px; font-size: 15px; }
.side a.active, .side a:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.side a.active { box-shadow: inset 3px 0 0 var(--accent); }
.brand { font-weight: 700; font-size: 18px; color: #fff; padding: 4px 18px 14px; }
.brand span { font-size: 12px; font-weight: 400; color: #9aa7ba; margin-left: 6px; }
.side-foot { margin-top: auto; padding: 12px 18px; font-size: 13px; display: grid; gap: 6px; }
.side-foot .link { color: #a9c2ff; text-align: left; }
main { overflow: auto; padding: 14px 18px; }

h1 { font-size: 19px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 6px; }
h3 { font-size: 15px; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bar .grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.split { display: grid; grid-template-columns: 1fr 400px; gap: 12px; align-items: start; }
.stack { display: grid; gap: 10px; }

table.t { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14px; }
table.t th, table.t td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
table.t th { background: var(--head); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t tr.click:hover td { background: var(--accent-weak); cursor: pointer; }
table.t td.num, table.t th.num { text-align: right; }
table.t td input, table.t td select, table.t td textarea { width: 100%; }
table.t.edit td { padding: 2px 3px; }
table.t.small, .small table.t { font-size: 13px; }
.ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tablewrap { max-height: calc(100vh - 150px); overflow: auto; border: 1px solid var(--line); }
.tablewrap table.t th, .tablewrap table.t td { border-top: 0; }

.form { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; align-items: center; }
.form label { color: var(--muted); }
.form .full { grid-column: 1 / -1; }
.form textarea { min-height: 60px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.checks label { color: var(--text); display: inline-flex; gap: 4px; align-items: center; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-strong); width: 16px; height: 16px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 8px 0 12px; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--muted); }
.policy-intro { margin: -4px 0 8px; }
.tabs a.active { background: var(--panel); border-color: var(--line); color: var(--text); font-weight: 600; margin-bottom: -1px; box-shadow: inset 0 2px 0 var(--accent); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; background: var(--chip); color: var(--text); white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: currentColor; }
.badge.private { background: var(--private-bg); color: var(--private); }
.badge.rule { background: var(--accent-weak); color: var(--accent); }
.badge.ai { background: var(--ai-bg); color: var(--ai); }
.badge.prep { background: var(--accent-weak); color: var(--accent); border-color: currentColor; }
.badge.muted-badge { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.private-field label, label.private-field { color: var(--private); }
.notice { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 7px 11px; border-radius: 4px; }
.notice.info { border-color: var(--accent); background: var(--accent-weak); }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; min-width: 120px; }
.kpi b { display: block; font-size: 17px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--toast); color: #fff; padding: 9px 15px; border-radius: 6px; max-width: 520px; z-index: 50; box-shadow: var(--shadow); border: 1px solid var(--line-strong); }
.toast.err { background: #8c1d2c; border-color: #d4566a; }
.auth { display: grid; place-items: center; height: 100vh; padding: 16px; }
.auth .panel { width: min(440px, 100%); }
.pre { white-space: pre-wrap; word-break: break-word; }
.mono { font-family: Consolas, monospace; font-size: 13px; }
.diff { max-width: 560px; white-space: pre-wrap; word-break: break-all; font-family: Consolas, monospace; font-size: 12.5px; }
.w60 { width: 64px; }
table.t tr.touched > th { background: var(--sec); }
.form textarea[rows="1"] { min-height: 30px; }
#sections .form { gap: 3px 8px; }
details > summary { cursor: pointer; }
.cols3 { columns: 4; column-gap: 10px; }
.cols3 > .panel { break-inside: avoid; margin-bottom: 10px; display: grid; }
.subtabs { display: flex; gap: 4px; margin: -4px 0 8px; }
.subtabs a { padding: 3px 12px; border-radius: 12px; background: var(--chip); color: var(--muted); font-size: 13.5px; }
.subtabs a.active { background: var(--accent-strong); color: #fff; }
.stages { display: flex; gap: 6px; align-items: stretch; flex-wrap: nowrap; margin-bottom: 8px; }
.stage { border: 1px solid var(--line); border-left-width: 4px; border-radius: 4px; padding: 3px 10px; background: var(--panel); display: grid; min-width: 0; white-space: nowrap; }
.stage b { font-size: 12.5px; color: var(--muted); }
.stage.none { border-left-color: var(--line-strong); }
.stage.info { border-left-color: var(--accent); }
.stage.wait { border-left-color: var(--warn); }
.stage.ok { border-left-color: var(--ok); }
.stage.bad { border-left-color: var(--bad); }
.stages button { flex: none; }
.dgrid { display: grid; grid-template-columns: 1fr 1.35fr 1.15fr; gap: 10px; align-items: start; }
.boxes { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13.5px; }
.boxes .on { font-weight: 600; color: var(--accent); }
.boxes .off { color: var(--muted); }
.reasons { margin: 0; padding-left: 18px; }
.refs { display: grid; gap: 2px; border-top: 1px dashed var(--line); padding-top: 4px; }
.w100 { width: 100%; margin-top: 2px; }
.grow { flex: 1; }
.grow2 { flex: 2; }
.bad-text { color: var(--bad); }
.grp { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
#selform .form { grid-template-columns: 118px 1fr 118px 1fr; }
#selform .form textarea { min-height: 28px; }
.tablewrap.agrwrap { max-height: calc(100vh - 235px); }

/* ---- 정책 검토(상세·고급) — 27개 항목을 한 화면에 두는 조밀한 표 ---- */
.pgrid { display: grid; grid-template-columns: 2fr 0.78fr; gap: 10px; align-items: start; }
.pflow { columns: 2; column-gap: 10px; }
.pflow > .psec, .pflow > details { break-inside: avoid; margin-bottom: 6px; display: block; }
.pflow > :last-child { margin-bottom: 0; }
.pcol { display: grid; gap: 8px; }
.psec { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.psec h3 { font-size: 14px; margin: 0 0 4px; }
.pflow .psec { padding: 4px 6px; }
.pflow .psec h3 { margin: 0 0 2px; font-size: 13.5px; }
.ptable { table-layout: fixed; font-size: 13px; }
.ptable th { width: 31%; font-weight: 500; background: var(--sunken); white-space: normal; position: static; }
.ptable td:nth-child(2) { width: 25%; }
.ptable td, .ptable th { padding: 1px 4px; }
.ptable select, .ptable input { width: 100%; height: 25px; padding: 1px 4px; }
.ptable tr.attn th { box-shadow: inset 3px 0 0 var(--warn); }
.ptable .rule { color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 12px; line-height: 15px; margin-top: 1px; }
.ptable .rule .badge { font-size: 11px; padding: 0 4px; }
input.has-hint::placeholder { color: var(--warn); }
select.st-위험 { border-color: var(--bad); color: var(--bad); }
select.st-확인\ 필요, select.st-회사\ 확인·사전\ 승인\ 필요 { border-color: var(--warn); color: var(--warn); }
select.st-문제\ 없음 { color: var(--ok); }
.attn-list { margin: 0; padding-left: 16px; display: grid; gap: 3px; font-size: 13.5px; }
.refs-list { margin: 2px 0 6px; padding-left: 16px; }
.side-col .psec { display: grid; gap: 4px; }

/* ---- 문서 미리보기·대화 상자 ---- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: grid; place-items: center; }
.ov-panel { background: var(--bg); width: min(1760px, 96vw); height: 92vh; border-radius: 10px; display: grid; grid-template-rows: auto 1fr; padding: 12px 16px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.ov-head h2 { margin: 0; }
.ov-grid { display: grid; grid-template-columns: 1fr 380px; gap: 14px; min-height: 0; }
.ov-body { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
.ov-body h3 { font-size: 15px; margin: 14px 0 6px; }
.ov-body h4 { font-size: 13.5px; margin: 10px 0 4px; }
.ov-body table.t { margin-bottom: 6px; }
.ov-body table.t th { position: static; white-space: normal; width: 22%; }
.ov-side { align-content: start; overflow: auto; }
.ov-side > button, .ov-side > .button-link { width: 100%; padding: 9px 12px; font-size: 15px; }
.ov-panel.ov-small { width: min(760px, 94vw); height: auto; max-height: 90vh; }
.ov-panel.ov-small .ov-body { overflow: auto; }
/* PDF 미리보기: 종이는 흰색 그대로(브라우저 PDF 뷰어) */
.ov-pdf-wrap { min-height: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #525659; }
.ov-pdf { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.check-box dl.summary { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; margin: 8px 0; }
.check-box dt { color: var(--muted); }
.check-box dd { margin: 0; overflow-wrap: anywhere; }

/* ---- 이전 상세 협의 기록(27개) ---- */
.cs-wrap { max-height: calc(100vh - 250px); overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.cs-table { table-layout: fixed; width: 100%; }
.cs-table thead th { position: sticky; top: 0; z-index: 1; }
.cs-table th:nth-child(1) { width: 15%; } .cs-table th:nth-child(2) { width: 9%; } .cs-table th:nth-child(3) { width: 31%; }
.cs-table th:nth-child(4) { width: 8%; } .cs-table th:nth-child(5) { width: 23%; } .cs-table th:nth-child(6) { width: 14%; }
.cs-table tbody th { font-weight: 500; background: var(--sunken); white-space: normal; position: static; }
.cs-table td, .cs-table th { padding: 2px 4px; vertical-align: top; }
.cs-table tr.cs-sec td { background: var(--sec); font-weight: 600; }
.cs-opts label { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; white-space: nowrap; }
.cs-table select, .cs-table input, .cs-table textarea { width: 100%; }
.cs-table textarea { min-height: 25px; resize: vertical; font: inherit; }
.hscroll { overflow-x: auto; max-width: 100%; }
.doc-table td { vertical-align: top; overflow-wrap: anywhere; }
.doc-table td .badge { white-space: normal; }
.doc-table th { white-space: normal; }
.doc-table .nowrap { white-space: nowrap; }
.doc-table td.mono { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 1600px) { .doc-table .nowrap { white-space: normal; } }
.ds-wrap { max-height: calc(100vh - 360px); }
.ds-table th:nth-child(1) { width: 13%; } .ds-table th:nth-child(2) { width: 17%; } .ds-table th:nth-child(3) { width: 21%; }
.ds-table th:nth-child(4) { width: 33%; } .ds-table th:nth-child(5) { width: 10%; } .ds-table th:nth-child(6) { width: 6%; }
.ds-table .cs-opts label { margin-right: 8px; }
.ex-json { max-height: 40vh; overflow: auto; background: var(--sunken); border: 1px solid var(--line); padding: 6px; font-size: 12.5px; }
[hidden] { display: none !important; }
.update-banner { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--raised); color: var(--text); border: 1px solid var(--warn);
  border-radius: 6px; padding: 8px 14px; box-shadow: var(--shadow); font-size: 14px; max-width: min(900px, 94vw); }

/* ---- 검토 결과(기본 화면) ---- */
.adv-tabs { margin-left: auto; align-self: center; font-size: 13.5px; }
.adv-tabs summary { color: var(--muted); padding: 5px 10px; }
.adv-tabs[open] summary { color: var(--text); }
.adv-links { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.adv-links a { padding: 3px 8px; border-radius: 4px; color: var(--muted); }
.adv-links a.active { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.home-idea { margin-bottom: 10px; }
.home-idea .pre { white-space: pre-wrap; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.action-card { display: grid; gap: 10px; align-content: start; }
.action-card h2 { margin: 0; font-size: 17px; }
button.big { font-size: 15.5px; padding: 9px 18px; white-space: normal; justify-self: start; }
.ai-result h3 { font-size: 15px; margin: 8px 0 4px; }
.review-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.conclusion { background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; }
.issue-card { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 4px; padding: 7px 9px; margin-bottom: 6px; display: grid; gap: 2px; background: var(--sunken); }
.home-actions > *, .review-grid > * { min-width: 0; }
.conclusion .lead { font-size: 16px; margin: 6px 0; }
.conclusion .badge, .issue-card .badge, ol.todo .badge { white-space: normal; }  /* 긴 상태 문구는 칸 안에서 줄바꿈 */
ol.todo { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
ul.rec { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
details.rv-more { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; overflow-wrap: anywhere; }
details.rv-more > summary { font-weight: 600; padding: 4px 0; }
details.rv-more .issue-card { margin-top: 6px; }
.ai-result, .issue-card, .conclusion, .home-idea { overflow-wrap: anywhere; }
.theme-toggle { font-size: 12.5px; color: #a9c2ff; }

@media (max-width: 1100px) {
  .home-actions, .review-grid, .ov-grid { grid-template-columns: 1fr; }
  .ov-grid { grid-template-rows: auto minmax(360px, 1fr); overflow: auto; }
  .ov-side { order: -1; overflow: visible; }  /* 좁은 화면: 조작 버튼을 PDF 위에 */
  .adv-tabs { margin-left: 0; }
}
/* 좁은 화면(휴대폰·200% 확대): 왼쪽 메뉴를 위쪽 가로 메뉴로, 긴 문장은 칸 안에서 줄바꿈 */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 4px 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { padding: 7px 10px; }
  .side a.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .brand { padding: 4px 10px; }
  .side-foot { margin: 0 0 0 auto; padding: 4px 10px; display: flex; flex-wrap: wrap; gap: 8px; }
  main { padding: 10px 12px; }
  .grid2, .grid3, .split, .pgrid { grid-template-columns: minmax(0, 1fr); }
  .grid2 > *, .grid3 > *, .split > *, .stack > * { min-width: 0; }
  .form { grid-template-columns: minmax(0, 1fr); }
  main table.t:not(.cs-table):not(.ptable) { display: block; overflow-x: auto; }  /* 넓은 표는 표 안에서만 가로 스크롤 */
  .stage { white-space: normal; }
  .pflow { columns: 1; }
  .ov-panel { width: 100vw; height: 100vh; border-radius: 0; padding: 8px 10px; }
  .stages { flex-wrap: wrap; }
}
/* 화면을 인쇄할 때 어두운 배경을 종이에 찍지 않는다 */
/* v0.12.0 협의 준비서 작성·출력 — 인쇄 양식과 같은 순서(협의 정보 → 확인 주제 6개 → 협의 후 정리) */
.prep .pp-sec { border-top: 1px solid var(--line); padding-top: 8px; }
.prep .pp-sec h3 { margin: 2px 0 6px; }
.pp-meet { display: grid; grid-template-columns: 1fr 2fr 1.3fr; gap: 8px; }
.pp-meet label, .prep label.small { display: flex; flex-direction: column; gap: 3px; }
.pp-topic { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 5px; }
.pp-topic .pp-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pp-topic textarea, .prep textarea { width: 100%; resize: vertical; }
.pp-fu input { width: 100%; }
.pp-offer ul { margin: 4px 0; }
.pp-checks { display: flex; flex-direction: column; gap: 3px; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; }
.pp-cg { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.pp-cg .pp-cl { min-width: 7.5em; font-weight: 600; }
.pp-cg label { display: inline-flex; gap: 4px; align-items: center; }
/* v0.14.0 기본 흐름(사전 정책 검토 → 협의 준비서 → 협의 결과 → 이력) */
.stages.flow { margin: 6px 0 2px; align-items: center; overflow-x: auto; }
.stages.flow a.stage { text-decoration: none; color: var(--text); flex: 1 1 0; }
.stages.flow a.stage span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.stages.flow a.stage.cur { outline: 2px solid var(--accent); outline-offset: -1px; }
.flow-arrow { color: var(--muted); flex: none; }
.flow-next { margin: 2px 0 6px; }
.button-link.primary-link { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.mk { padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--input); color: var(--text); font-size: 12.5px; cursor: pointer; }
.mk.mk-fact { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.mk.mk-ask { border-style: dashed; border-color: var(--warn); color: var(--warn); font-weight: 600; }
.mk.mk-legacy { border-color: var(--muted); color: var(--muted); }
span.mk { cursor: default; display: inline-block; }
.pp-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.pp-memo { display: flex; flex-direction: column; gap: 4px; }
.pp-warn:empty { display: none; }
.pp-warn { color: var(--bad); font-weight: 600; }
.pp-rule { font-weight: 400; }
.pp-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pp-h { font-weight: 600; }
.pp-q .pp-qg { font-weight: 600; margin-top: 4px; }
.pp-q .pp-dt { margin-left: 14px; }
.pp-start { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line, #2a3446); border-radius: 8px; }
.pp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-big { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; }
.pp-big b { font-size: 15px; } .pp-big span { font-size: 12px; opacity: .85; }
.pp-editor > summary { cursor: pointer; padding: 6px 0; }
.ov-panel.ov-narrow { max-width: 760px; height: auto; max-height: 92vh; overflow: auto; grid-template-rows: auto auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-q .pp-qt { width: auto; padding: 1px 4px; font-size: 12px; margin-left: 6px; }
.pp-q { margin: 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.pp-dev, .pp-cost { width: 100%; }
.pp-dev caption, .pp-cost caption { text-align: left; color: var(--muted); padding: 2px 0; }
.pp-dev td label, .pp-dev td { white-space: nowrap; }
.pp-dev input.dev-note, .pp-cost input.cost-note { width: 100%; }
.pp-dev td input[type=checkbox] { width: 16px; vertical-align: middle; }  /* table.t 의 칸 입력 100% 를 체크박스에는 쓰지 않음 */
.pp-prev ul { margin: 2px 0; padding-left: 18px; }
.pp-find { border-left: 3px solid var(--accent); background: var(--accent-weak); padding: 4px 8px; border-radius: 4px; }
.pp-find ul { margin: 2px 0; padding-left: 18px; }
.pp-tools { flex-wrap: wrap; gap: 6px; }
.pc-table th:first-child { white-space: nowrap; }
.pc-table td { min-width: 12em; }
.pc-f { margin-bottom: 4px; }
.pc-f.pc-caution { color: var(--warn); font-weight: 600; }
.pc-f.pc-caution .muted { font-weight: 400; }
.mt-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.mt-row label { display: flex; flex-direction: column; gap: 3px; }
.mt-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.mt-topics textarea { width: 100%; }
@media (max-width: 1100px) { .pp-body { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .pp-meet { grid-template-columns: 1fr; } }

@media print {
  :root, html[data-theme="light"] { --bg: #fff; --panel: #fff; --raised: #fff; --sunken: #fff; --head: #eee; --text: #000; --muted: #444; --line: #999; }
  body { background: #fff; color: #000; }
  .side, .tabs, .adv-tabs, button, .toast, .update-banner { display: none !important; }
  .shell { display: block; height: auto; }
  main { overflow: visible; }
}
