/* Proptics Model Desk 새 화면(desk.html, js/desk)의 스타일. 기존 화면(classic.html)은 css/app.css를 쓴다.
   다크가 기본이고 라이트는 토큰만 바꾼다. 라이트 토큰은 두 블록에 같은 값으로 둔다: 사용자가 고른 경우(:root[data-theme="light"])와
   저장한 테마가 없어 기기 설정을 따르는 경우(@media (prefers-color-scheme: light)의 :root:not([data-theme])). tests/desk-shell.test.mjs가 두 블록이 같은지 확인한다.
   시각 요소는 글자, 선, 도형뿐이다. 아이콘 글리프와 이미지를 쓰지 않는다.
   크기 하한: 글자 12px(차트 눈금 11px), 조작 요소 높이 32px. 골드는 로고 모노그램의 사선과 점, 선택 표시, 손잡이, 현재 칸 테두리에만 쓴다. */

/* ---------- 서체 (동봉본, 외부 요청 없음) ---------- */
@font-face {
  font-family: "Pretendard Variable"; font-style: normal; font-weight: 45 920; font-display: swap;
  src: url("../vendor/fonts/PretendardVariable.woff2") format("woff2-variations"), url("../vendor/fonts/PretendardVariable.woff2") format("woff2");
}
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/jost-latin-wght-normal.woff2") format("woff2-variations"), url("../vendor/fonts/jost-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/IBMPlexMono-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); }

/* ---------- 토큰 ---------- */
:root {
  --bg0: #070C17;
  --bg: linear-gradient(90deg, #070C17 0%, #101B31 50%, #070C17 100%);
  --surface: #0C1424;              /* 차트 면의 대표색(막대 사이 틈과 점 테두리에 쓴다) */
  --rail-bg: rgba(7, 12, 23, .46);
  --bar-bg: rgba(7, 12, 23, .78);
  --pop-bg: #101B31;
  --paper: rgba(16, 27, 49, .55);  /* 보고 화면의 문서 면 */
  --txt: #EDEAE0;
  --dim: #C2BEB2;
  --mut: #9D998E;
  --line: rgba(237, 234, 224, .10);
  --line2: rgba(237, 234, 224, .18);
  --line3: rgba(237, 234, 224, .36);
  --wash: rgba(237, 234, 224, .045);
  --wash2: rgba(237, 234, 224, .085);
  --gold: #B99C64;
  --gold-hi: #F2E2BC;
  --gold-txt: #D9C08E;
  --gold-grad: linear-gradient(90deg, #B99C64, #F2E2BC 50%, #B99C64);
  --cta-fg: #070C17;
  --pos: #7FC4A0;
  --neg: #EE958D;
  --warn: #E3B865;
  /* 차트: 누구의 몫인가. 대주(선순위, 중순위)는 블루, 자기자본(우선주, 보통주)은 토프와 아이보리, 비용은 빗금, 보증금은 속 빈 칸 */
  --c-senior: #617CC8;
  --c-mezz: #9EB0DF;
  --c-pref: #817352;
  --c-common: #E6DDC8;
  --c-cost: #7C879F;
  --c-cost-bg: rgba(124, 135, 159, .16);
  --c-hollow: rgba(237, 234, 224, .62);
  --c-use: #7D879C;
  --c-use2: #A9B0BF;
  --heat-hi: 185, 156, 100;
  --heat-lo: 126, 143, 181;
  --focus: #F2E2BC;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --font-ko: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-en: "Jost", "Pretendard Variable", sans-serif;
  /* 숫자 서체: 숫자와 라틴 글자는 IBM Plex Mono, 그 안에 섞인 한글(억, 년차, 미입력 등)은 Pretendard로 받는다(시스템 고정폭 한글 글꼴로 떨어지지 않게) */
  --font-num: "IBM Plex Mono", "Pretendard Variable", Pretendard, ui-monospace, "SFMono-Regular", Consolas, monospace;
  /* 간격 단위 4px: 4, 8, 12, 16, 24, 32, 48 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --top-h: 52px;
  --rail-w: 348px;
  --ctl-h: 32px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg0: #F6F4EF;
  --bg: linear-gradient(90deg, #F0EDE4, #FBFAF5 50%, #F0EDE4);
  --surface: #F6F4EF;
  --rail-bg: rgba(255, 255, 255, .5);
  --bar-bg: rgba(251, 250, 245, .92);
  --pop-bg: #FDFCF9;
  --paper: rgba(255, 255, 255, .62);
  --txt: #101B31;
  --dim: #3A4356;
  --mut: #5A5F6C;
  --line: rgba(16, 27, 49, .11);
  --line2: rgba(16, 27, 49, .20);
  --line3: rgba(16, 27, 49, .42);
  --wash: rgba(16, 27, 49, .035);
  --wash2: rgba(16, 27, 49, .07);
  --gold: #A98F5D;
  --gold-hi: #C9B083;
  --gold-txt: #6F5628;
  --gold-grad: linear-gradient(90deg, #101B31, #1B2A48);
  --cta-fg: #F2E2BC;
  --pos: #1F6A47;
  --neg: #A8352D;
  --warn: #7A5208;
  --c-senior: #2C4188;
  --c-mezz: #6F89CF;
  --c-pref: #9C8A5E;
  --c-common: #3A3528;
  --c-cost: #6F7482;
  --c-cost-bg: rgba(111, 116, 130, .14);
  --c-hollow: rgba(16, 27, 49, .62);
  --c-use: #7A8296;
  --c-use2: #A7ADBB;
  --heat-hi: 169, 143, 93;
  --heat-lo: 94, 110, 140;
  --focus: #101B31;
  --shadow: 0 12px 32px rgba(16, 27, 49, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg0: #F6F4EF;
    --bg: linear-gradient(90deg, #F0EDE4, #FBFAF5 50%, #F0EDE4);
    --surface: #F6F4EF;
    --rail-bg: rgba(255, 255, 255, .5);
    --bar-bg: rgba(251, 250, 245, .92);
    --pop-bg: #FDFCF9;
    --paper: rgba(255, 255, 255, .62);
    --txt: #101B31;
    --dim: #3A4356;
    --mut: #5A5F6C;
    --line: rgba(16, 27, 49, .11);
    --line2: rgba(16, 27, 49, .20);
    --line3: rgba(16, 27, 49, .42);
    --wash: rgba(16, 27, 49, .035);
    --wash2: rgba(16, 27, 49, .07);
    --gold: #A98F5D;
    --gold-hi: #C9B083;
    --gold-txt: #6F5628;
    --gold-grad: linear-gradient(90deg, #101B31, #1B2A48);
    --cta-fg: #F2E2BC;
    --pos: #1F6A47;
    --neg: #A8352D;
    --warn: #7A5208;
    --c-senior: #2C4188;
    --c-mezz: #6F89CF;
    --c-pref: #9C8A5E;
    --c-common: #3A3528;
    --c-cost: #6F7482;
    --c-cost-bg: rgba(111, 116, 130, .14);
    --c-hollow: rgba(16, 27, 49, .62);
    --c-use: #7A8296;
    --c-use2: #A7ADBB;
    --heat-hi: 169, 143, 93;
    --heat-lo: 94, 110, 140;
    --focus: #101B31;
    --shadow: 0 12px 32px rgba(16, 27, 49, .14);
    color-scheme: light;
  }
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr);
  font-family: var(--font-ko); font-size: 14px; line-height: 1.55; letter-spacing: -.005em;
  color: var(--txt); background: var(--bg0); background-image: var(--bg);
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: rgba(185, 156, 100, .35); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
svg.defs { position: absolute; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 60; padding: 8px 12px; background: var(--pop-bg); border: 1px solid var(--gold); border-radius: 3px; color: var(--txt); font-size: 13px; text-decoration: none; }
.skip:focus { top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.warn { color: var(--warn); }
.mut { color: var(--mut); }
.only-read { display: none; }
.nowrap { white-space: nowrap; }
.mt { margin-top: var(--s4); }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line2); border-radius: 3px; font-family: var(--font-ko); font-size: 12px; line-height: 18px; text-align: center; color: var(--dim); }

/* ---------- 단추와 선택 묶음 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h); padding: 0 14px; border: 1px solid var(--line2); border-radius: 3px;
  font-size: 13px; color: var(--dim); white-space: nowrap; background: transparent;
}
.btn:hover { color: var(--txt); border-color: var(--line3); }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--mut); border-color: var(--line); cursor: default; }
.btn[aria-pressed="true"] { color: var(--txt); border-color: var(--gold); }
.btn-primary { border: 0; color: var(--cta-fg); background: var(--gold-grad); font-weight: 600; }
.btn-primary:hover { color: var(--cta-fg); filter: brightness(1.05); }
.btn-primary[disabled] { background: var(--wash2); color: var(--mut); }
.btn-sm { padding: 0 10px; font-size: 12.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line2); border-radius: 2px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.badge-sample { border-color: var(--gold); color: var(--gold-txt); max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 18px; }
.badge-mine { border-color: var(--line3); color: var(--txt); }
.badge-hold { border-color: var(--warn); color: var(--warn); }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; height: var(--ctl-h); padding: 0 12px; font-size: 13px; color: var(--mut); cursor: pointer; white-space: nowrap; }
.seg label + label { border-left: 1px solid var(--line2); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { color: var(--txt); background: var(--wash2); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -3px; }
.seg-btn { display: inline-flex; border: 1px solid var(--line2); border-radius: 3px; overflow: hidden; }
.seg-btn button { height: var(--ctl-h); padding: 0 11px; font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.seg-btn button + button { border-left: 1px solid var(--line2); }
.seg-btn button:hover { color: var(--txt); }
.seg-btn button[aria-pressed="true"] { color: var(--txt); background: var(--wash2); font-weight: 600; }
.seg-btn button[disabled] { color: var(--mut); opacity: .6; cursor: default; }
.seg-btn button:focus-visible { outline-offset: -3px; }
.pr-link { min-height: var(--ctl-h); padding: 0; color: var(--dim); font-size: 12.5px; text-align: left; border-bottom: 1px solid transparent; }
.pr-link:hover { color: var(--txt); }
.pr-link b { font-weight: 600; color: var(--txt); }

/* ---------- 상단 바 ---------- */
.top { display: flex; align-items: center; gap: var(--s4); padding: 0 20px; min-width: 0; border-bottom: 1px solid var(--line); background: var(--bar-bg); }
.brand { display: flex; align-items: baseline; gap: 12px; flex: none; }
.logo { display: inline-flex; align-items: center; gap: .5em; font-family: var(--font-en); font-size: 18px; letter-spacing: .01em; line-height: 1; color: var(--txt); white-space: nowrap; text-decoration: none; }
.logo-mark { width: 1.3em; height: 1.3em; flex: none; overflow: visible; }
.lm-frame { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; stroke-linejoin: miter; }
.lm-ray { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.lm-dot { fill: var(--gold); }
.logo-word { display: inline-flex; align-items: baseline; }
.logo-a { font-weight: 600; }
.logo-b { font-weight: 300; }
.product { font-family: var(--font-en); font-size: 12px; font-weight: 450; letter-spacing: .26em; color: var(--mut); padding-left: 12px; border-left: 1px solid var(--line2); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 10px; height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--line2); border-radius: 3px; font-size: 13px; font-weight: 600; color: var(--txt); white-space: nowrap; }
.chip small { font-size: 12px; font-weight: 400; color: var(--mut); padding-left: 10px; border-left: 1px solid var(--line2); }
.chip:hover { border-color: var(--line3); }
.top-mid { flex: 1; min-width: 0; display: flex; justify-content: center; }
.top-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
.toast { display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 0 12px; height: var(--ctl-h); border: 1px solid var(--line2); border-radius: 3px; background: var(--wash); font-size: 12.5px; color: var(--txt); min-width: 0; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 알림의 되돌리기 단추: 누르는 영역은 알림 줄 높이(32px)를 다 쓰고 밑줄은 글자에만 긋는다 */
.toast button { flex: none; height: var(--ctl-h); margin: -1px 0; padding: 0 2px; color: var(--gold-txt); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 시작 화면 ---------- */
.start { overflow: auto; }
.start-in { max-width: 1120px; margin: 0 auto; padding: 56px 32px 48px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.start-kicker { font-size: 13px; color: var(--gold-txt); margin-bottom: var(--s2); }
.start h1 { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.start-lead { margin: var(--s3) 0 var(--s5); font-size: 14.5px; line-height: 1.7; color: var(--dim); max-width: 560px; }
/* 조합 표: 자리마다 글자 없는 단추 하나를 둔다. 포인터를 올리거나 고른 단추의 행과 열 머리글이 진해져 어느 조합인지 읽힌다.
   고른 단추는 골드 테두리와 옅은 골드 면이다(골드는 선택 표시에만 쓴다). 열 머리글 규칙은 거래유형 3열(행의 둘째~넷째 자리)을 전제로 한다 */
.matrix { width: 100%; table-layout: fixed; font-size: 13px; }
.matrix th { padding: 6px 8px; font-weight: 500; color: var(--mut); text-align: left; }
.matrix thead th { padding-bottom: 8px; font-size: 12.5px; text-align: center; }
.matrix tbody th { width: 96px; padding-left: 0; color: var(--dim); }
.matrix td { padding: 3px; }
.cell { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--wash); color: var(--mut); }
.cell:hover { border-color: var(--line3); background: var(--wash2); color: var(--txt); }
.cell[aria-pressed="true"] { border-color: var(--gold); background: rgba(var(--heat-hi), .16); color: var(--gold-txt); box-shadow: inset 0 0 0 1px var(--gold); }
.matrix tr:has(.cell:hover) > th,
.matrix:has(td:nth-child(2) .cell:hover) thead th:nth-child(2),
.matrix:has(td:nth-child(3) .cell:hover) thead th:nth-child(3),
.matrix:has(td:nth-child(4) .cell:hover) thead th:nth-child(4) { color: var(--txt); }
.matrix tr:has(.cell[aria-pressed="true"]) > th,
.matrix:has(td:nth-child(2) .cell[aria-pressed="true"]) thead th:nth-child(2),
.matrix:has(td:nth-child(3) .cell[aria-pressed="true"]) thead th:nth-child(3),
.matrix:has(td:nth-child(4) .cell[aria-pressed="true"]) thead th:nth-child(4) { color: var(--txt); font-weight: 650; }
/* 검증 수준 눈금: 오른쪽으로 높아지는 막대 3개이고 켜진 막대 수가 수준이다(3개: 다른 도구와 대조, 2개: 참조 모델과 대조, 1개: 손계산 테스트만).
   켜진 막대는 글자색, 꺼진 막대는 옅은 선색이다. 막대는 배경으로 그린다(글리프와 그림을 쓰지 않는다) */
.lv {
  --lv-w: 3px; --lv-gap: 2px; --lv-step: 3px; --lv-on: currentColor; --lv2: var(--line2); --lv3: var(--line2);
  display: inline-block; flex: none; width: calc(var(--lv-w) * 3 + var(--lv-gap) * 2); height: calc(var(--lv-step) * 3 + 2px);
  background:
    linear-gradient(var(--lv-on), var(--lv-on)) 0 100% / var(--lv-w) calc(var(--lv-step) + 2px) no-repeat,
    linear-gradient(var(--lv2), var(--lv2)) calc(var(--lv-w) + var(--lv-gap)) 100% / var(--lv-w) calc(var(--lv-step) * 2 + 2px) no-repeat,
    linear-gradient(var(--lv3), var(--lv3)) calc((var(--lv-w) + var(--lv-gap)) * 2) 100% / var(--lv-w) 100% no-repeat;
}
.lv-ref { --lv2: var(--lv-on); }
.lv-ext { --lv2: var(--lv-on); --lv3: var(--lv-on); }
.cell .lv { --lv-w: 4px; --lv-gap: 3px; --lv-step: 4px; }
.mx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: var(--s4); font-size: 12.5px; color: var(--dim); }
.mx-legend li { display: inline-flex; align-items: center; gap: 7px; }
.mx-legend .mx-legend-h { color: var(--mut); }
.start-r { padding-top: 44px; }
.start-r h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.cd-desc { margin-top: 6px; font-size: 13.5px; color: var(--dim); line-height: 1.65; }
.cd-dl { margin-top: var(--s4); display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px 14px; font-size: 13px; }
.cd-dl dt { color: var(--mut); }
.cd-dl dd { color: var(--txt); }
.cd-dl dd .lv { margin-right: 7px; }
.cd-dl dd small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.6; color: var(--mut); }
.start-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: var(--s5) 0 var(--s3); }
.start-actions .btn { height: 40px; padding: 0 20px; font-size: 14px; }
.start-saved { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.start-saved li { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.start-foot { margin-top: var(--s5); font-size: 12px; line-height: 1.7; color: var(--mut); font-family: var(--font-ko); }
/* 문장 안의 링크도 누르는 영역은 32px 이상으로 둔다(위아래 안쪽 여백을 주고 같은 만큼 바깥 여백을 빼 줄 간격은 그대로 둔다) */
.start-foot a { display: inline-block; padding: 9px 0; margin: -9px 0; color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.start-foot a:hover { color: var(--txt); }
.start-saved:empty { display: none; }

/* ---------- 작업 화면 ---------- */
.desk { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 0; }

/* 가정 레일 */
.rail { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; border-right: 1px solid var(--line); background: var(--rail-bg); }
.rail-head { padding: 12px 18px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.rail-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-title h2 { font-size: 16px; font-weight: 650; }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--dim); }
.req-ticks { display: flex; gap: 3px; flex: 1; min-width: 0; }
.req-ticks i { flex: 1; max-width: 22px; height: 3px; background: var(--line2); }
.req-ticks i.on { background: var(--gold); }
.req b { font-family: var(--font-num); font-weight: 500; color: var(--txt); }

.rail-scroll { overflow: auto; min-height: 0; padding: 2px 0 12px; }
.grp { border-bottom: 1px solid var(--line); }
.grp-core { padding: 4px 0 8px; }
.grp > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; cursor: pointer; font-size: 13px; color: var(--dim); }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary:hover { color: var(--txt); }
.grp > summary:focus-visible { outline-offset: -3px; }
/* 접힘 표시: 선 두 개로 만든 더하기(열리면 빼기) */
.tw { position: relative; display: inline-block; width: 9px; height: 9px; flex: none; }
.tw::before, .tw::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: currentColor; }
.tw::after { transform: rotate(90deg); }
details[open] > summary .tw::after { transform: none; }
.grp[open] > summary { color: var(--txt); }
.grp-name { font-weight: 600; }
.grp-meta { margin-left: auto; font-size: 12px; color: var(--mut); white-space: nowrap; }
.grp-meta b { font-weight: 500; color: var(--warn); }
.grp-body { padding: 0 0 10px; }
.sub { padding: 8px 18px 0; font-size: 12px; color: var(--mut); letter-spacing: .02em; }

.row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 104px 64px; align-items: center; column-gap: 8px; min-height: 38px; padding: 0 18px; }
.row::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; background: transparent; }
.row:focus-within::before { background: var(--gold-txt); width: 3px; }
.row:focus-within { background: var(--wash); }
.row label, .row .lab { font-size: 13px; color: var(--dim); line-height: 1.3; min-width: 0; }
.row .tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.tag { display: inline-block; padding: 0 5px; border: 1px solid var(--line2); border-radius: 2px; font-size: 12px; line-height: 16px; color: var(--mut); white-space: nowrap; }
.tag-req { border-color: transparent; padding: 0; color: var(--mut); }
.tag-miss { border-color: transparent; padding: 0; color: var(--warn); font-weight: 600; }
.tag-ledger { border-style: dashed; color: var(--dim); }
.tag-carry { border-color: var(--warn); color: var(--warn); }
.tag-note { border-color: transparent; padding: 0; color: var(--gold-txt); }
.tag-est { border-color: var(--warn); color: var(--warn); }
.row input.fi {
  width: 100%; height: 34px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; background: transparent;
  font-family: var(--font-num); font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; color: var(--txt);
}
.row input.fi::placeholder { color: var(--mut); font-family: var(--font-ko); font-size: 12px; opacity: 1; }
.row input.fi:hover { border-bottom-color: var(--line3); }
/* 포커스 밑줄은 글자용 골드(--gold-txt)로 긋는다: 라이트 테마에서도 바탕과 3:1 이상 차이가 난다(포인트 골드 --gold는 2.95:1) */
.row input.fi:focus-visible { outline: none; border-bottom: 2px solid var(--gold-txt); }
.row[data-miss="1"] input.fi { border-bottom: 1px dashed var(--warn); }
.row[data-bad="1"] input.fi { border-bottom-color: var(--neg); }
/* 방금 넣은 값 때문에 새로 필수가 된 칸으로 옮겨 왔을 때 그 줄을 잠깐 표시한다(지금 있는 칸의 표시) */
.row.is-newreq { background: var(--wash2); box-shadow: inset 3px 0 0 var(--gold); }
.row .unit { font-size: 12px; line-height: 1.2; color: var(--mut); }
/* 긴 단위(% of EGI(보증금 운용수익 제외) 등)는 좁은 단위 칸에서 여러 줄로 꺾이므로 입력 칸 아래 한 줄로 내린다 */
.row .unit.unit-long { grid-column: 1 / -1; padding: 0 0 6px; text-align: right; }
.row .note { grid-column: 1 / -1; padding: 0 0 6px; font-size: 12px; line-height: 1.45; color: var(--mut); text-align: right; }
.row .note.is-bad { color: var(--neg); text-align: left; }
.row .note.is-warn { color: var(--warn); text-align: left; }
/* 추천: 이름 옆의 글자 단추와 칸 아래에 펼치는 패널. 닫힌 상태에서는 단추가 이름과 같은 줄에 흘러 들어가 줄이 늘지 않는다. 골드를 쓰지 않는다 */
.row .lab-cell { min-width: 0; font-size: 13px; line-height: 1.3; }
.row .lab-cell label, .row .lab-cell .lab { display: inline; }
.g-btn { position: relative; display: inline; margin-left: 6px; font-size: 12px; line-height: 16px; color: var(--mut); white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; }
.g-btn::after { content: ""; position: absolute; inset: -6px -4px; }
.g-btn:hover, .g-btn[aria-expanded="true"] { color: var(--txt); text-decoration-style: solid; }
/* 넣을 수 있는 범위나 법정 값이 있는 칸의 단추는 실선 밑줄, 참고 통계는 점선, 확인할 자료만 있는 칸은 밑줄 없이 흐리게 적는다 */
.g-btn[data-glevel="range"] { color: var(--dim); text-decoration-style: solid; }
.g-btn[data-glevel="check"] { text-decoration-line: none; }
.g-btn[data-glevel="check"]:hover, .g-btn[data-glevel="check"][aria-expanded="true"] { text-decoration-line: underline; }
.tag-guide { border-color: var(--line3); color: var(--dim); }
.row .g-panel {
  grid-column: 1 / -1; margin: 2px 0 10px; padding: 9px 11px 6px; max-height: min(400px, 46vh); overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line2); border-left: 2px solid var(--line3); border-radius: 2px; background: var(--wash);
  font-size: 12.5px; line-height: 1.55; color: var(--dim); text-align: left;
}
.g-panel:focus-visible { outline-offset: -2px; }
/* 항목 이름. 한 칸에 항목이 여럿이면 항목마다 접히는 묶음이고, 묶음 머리에 이름과 범위가 보인다 */
.g-name { font-size: 12.5px; font-weight: 600; color: var(--txt); }
div.g-item > .g-name { margin-bottom: 5px; }
details.g-item { padding: 6px 0; border-top: 1px solid var(--line); }
details.g-item:first-child { padding-top: 0; border-top: 0; }
details.g-item > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 24px; cursor: pointer; }
details.g-item > summary::-webkit-details-marker { display: none; }
details.g-item > summary:focus-visible { outline-offset: 1px; }
details.g-item[open] > summary { margin-bottom: 5px; }
details.g-item[open] > summary .g-sum { display: none; }
.g-sum { font-size: 12px; color: var(--mut); }
.g-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12px; color: var(--mut); }
.g-head b { padding: 0 5px; border: 1px solid var(--line2); border-radius: 2px; font-weight: 500; line-height: 16px; color: var(--txt); white-space: nowrap; }
.g-range { margin-top: 6px; }
.g-range .g-num { font-family: var(--font-num); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--txt); }
.g-range small, .g-ref small { margin-left: 8px; font-size: 12px; color: var(--mut); }
.g-lead { margin-top: 6px; color: var(--txt); }
.g-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.g-picks > :only-child { grid-column: 1 / -1; justify-self: start; }
.g-pick { min-height: 26px; padding: 2px 9px; border: 1px solid var(--line2); border-radius: 3px; font-size: 12px; line-height: 1.4; color: var(--dim); text-align: left; }
.g-pick small { display: block; font-size: 12px; color: var(--mut); }
.g-pick-cur { border-style: dashed; }
.g-pick b { margin-left: 2px; font-family: var(--font-num); font-weight: 500; color: var(--txt); }
.g-pick:hover { border-color: var(--line3); }
.g-pick[aria-pressed="true"] { border-color: var(--line3); background: var(--wash2); }
.g-ref { margin-top: 8px; overflow-wrap: anywhere; }
.g-ref b { display: block; font-size: 12px; font-weight: 400; color: var(--mut); }
.g-ref small { display: block; margin-left: 0; }
.g-dl { display: grid; gap: 6px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
/* 출처 한 줄: 출처 구분, 기준일, 확인 수준. 근거와 판단 바로 아래에 두어 스크롤하지 않고 보인다 */
.g-src { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--dim); }
.g-src .g-st { margin-right: 0; }
/* 자세히: 나머지 근거와 판단, 출처 표기, 확인 경로와 한계 */
.g-more { margin-top: 6px; }
.g-more > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 24px; font-size: 12px; color: var(--dim); cursor: pointer; }
.g-more > summary::-webkit-details-marker { display: none; }
.g-more > summary small { font-size: 12px; color: var(--mut); }
.g-more[open] > summary small { display: none; }
.g-more > .g-dl { margin-top: 4px; }
.g-dl dt { font-size: 12px; line-height: 1.4; color: var(--mut); }
.g-dl dd { overflow-wrap: anywhere; }
.g-dl a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.g-st { display: inline-block; margin-right: 6px; padding: 0 5px; border: 1px solid var(--line2); border-radius: 2px; font-size: 12px; line-height: 16px; color: var(--txt); white-space: nowrap; }
.g-stale-p { margin-top: 5px; }
.g-stale { color: var(--warn); }
.g-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.g-close { min-height: 24px; margin-top: 2px; font-size: 12px; color: var(--mut); text-decoration: underline; text-underline-offset: 3px; }
.g-close:hover { color: var(--txt); }
/* 근거 카드의 추천 줄: 한 줄로 줄여 적고 끝에 펼치기 단추를 둔다 */
.g-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.g-line > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-line .card-more { flex: none; min-height: 0; color: var(--mut); }
.grp-core .row { min-height: 38px; }
.grp-core .row label { color: var(--txt); font-size: 13.5px; }
.grp-core .row input.fi { height: 34px; font-size: 15.5px; font-weight: 500; }
.row-wide { grid-template-columns: minmax(0, 1fr) auto; }
.row select.fs { height: var(--ctl-h); max-width: 180px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 3px; background: transparent; font-size: 13px; }
.row select.fs option, .ctl select option { color: #101B31; background: #fff; }
/* 켬·끔: 체크박스를 선과 원으로 그린 스위치 */
.sw-toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-h); font-size: 12.5px; color: var(--mut); cursor: pointer; }
.sw-toggle input { position: absolute; opacity: 0; width: 38px; height: 32px; margin: 0; cursor: pointer; }
.sw-toggle .trk { width: 36px; height: 20px; border: 1px solid var(--line3); border-radius: 10px; position: relative; flex: none; }
.sw-toggle .trk::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--mut); }
.sw-toggle input:checked + .trk { border-color: var(--gold); }
.sw-toggle input:checked + .trk::after { left: 19px; background: var(--gold); }
.sw-toggle input:focus-visible + .trk { outline: 2px solid var(--focus); outline-offset: 2px; }
.rail-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--mut); }
.rail-slot b { display: block; font-size: 13px; font-weight: 600; color: var(--dim); }
.rail-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 14px 18px 4px; }

/* 근거 카드(레일 아래 고정 자리) */
.rail-card { border-top: 1px solid var(--line2); padding: 10px 18px 12px; height: 224px; overflow: auto; font-size: 12.5px; line-height: 1.55; color: var(--dim); background: var(--wash); }
.rail-card:focus-visible { outline-offset: -2px; }
#card-impact { margin: 2px 0 8px; }
.rail-card h3 { font-size: 13.5px; font-weight: 650; color: var(--txt); margin-bottom: 4px; }
.rail-card h3 small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--mut); }
.card-idle { color: var(--mut); }
.card-keys { margin-top: 8px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
.card-dl { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; }
.card-dl dt { color: var(--mut); font-size: 12px; }
.card-dl dd { color: var(--dim); font-size: 12.5px; }
.card-src { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; margin: 8px 0 6px; }
.card-src label { display: grid; gap: 1px; font-size: 12px; color: var(--mut); }
.card-src input { height: var(--ctl-h); padding: 0 2px; border: 0; border-bottom: 1px solid var(--line2); background: transparent; font-size: 12.5px; color: var(--txt); min-width: 0; }
.card-src input:focus-visible { outline: none; border-bottom: 2px solid var(--gold-txt); }
.card-src input::placeholder { color: var(--mut); opacity: 1; }
.card-mut { color: var(--mut); font-size: 12px; }
/* 근거 카드의 쓰임 문단: 길면 두 줄까지만 보이고 [전체 보기]로 펼친다(상태와 출처 칸이 카드 높이 안에 들어오게) */
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.card-more { min-height: 24px; padding: 0; font-size: 12px; color: var(--gold-txt); text-decoration: underline; text-underline-offset: 3px; }
#card-impact { margin-bottom: 4px; }
.card-use { margin-top: 6px; }
.impact { width: 100%; font-size: 12px; }
.impact th, .impact td { padding: 2px 0 2px 8px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.impact th:first-child { text-align: left; padding-left: 0; font-weight: 400; color: var(--dim); }
.impact thead th { font-weight: 400; color: var(--mut); border-top: 0; }
.impact td { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--txt); }
.impact td.pos { color: var(--pos); } .impact td.neg { color: var(--neg); } .impact td.mut { color: var(--mut); font-family: var(--font-ko); }

/* 결과 캔버스 */
.canvas { --cv-pad: 14px; position: relative; min-width: 0; min-height: 0; overflow: auto; padding: var(--cv-pad) 24px 28px; }
.mini { position: sticky; top: 0; height: 0; z-index: 6; }
.mini-in { position: absolute; left: -24px; right: -24px; top: calc(var(--cv-pad) * -1); display: none; align-items: center; gap: 22px; height: 38px; padding: 0 24px; background: var(--pop-bg); border-bottom: 1px solid var(--line2); font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.mini.is-on .mini-in { display: flex; }
.mini-in b { margin-left: 4px; font-weight: 500; font-size: 14px; color: var(--txt); }
/* 캔버스 머리: 첫 줄에 딜 이름과 단추, 둘째 줄에 딜 종류 표시와 사실 한 줄, 저장 상태(캔버스 전체 너비를 써서 한 줄에 담는다) */
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name actions" "sub sub"; align-items: center; column-gap: 16px; min-width: 0; margin-bottom: 10px; }
.head-main { display: contents; }
.deal-name { grid-area: name; }
.head-sub { grid-area: sub; }
.head-actions { grid-area: actions; }
.deal-name { width: 100%; height: 32px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 19px; font-weight: 650; letter-spacing: -.015em; text-overflow: ellipsis; }
.deal-name:hover { border-bottom-color: var(--line2); }
.deal-name:focus-visible { outline: none; border-bottom-color: var(--gold-txt); box-shadow: 0 1px 0 0 var(--gold-txt); }
.deal-name::placeholder { color: var(--mut); font-weight: 500; }
.head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 12.5px; color: var(--mut); }
.head-sub .combo-text { color: var(--dim); }
.head-sub .saved { margin-left: auto; }
.head-sub .saved.is-warn { color: var(--warn); }
.head-actions { display: flex; align-items: center; gap: 8px; }

.result { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.result.is-gated > :not(.sum) { display: none; }

/* 결과 요약 블록(작업 화면, 보고 화면, 인쇄가 같은 구조를 쓴다) */
.sum { border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line); min-width: 0; }
/* 세 칸의 줄(이름, 숫자, 판정, 범위선)은 칸마다 같은 높이에 놓인다: 숫자 줄은 가장 큰 숫자(첫 칸)의 높이를 함께 쓰고 숫자는 밑줄(baseline)에 맞춘다 */
.metrics { display: grid; grid-template-columns: 1.2fr 1fr 1fr; grid-template-rows: auto auto auto auto; }
.metric { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 4; align-content: start; gap: 0; padding: 8px 18px 6px 0; text-align: left; min-width: 0; }
.metric > .m-value { align-self: end; }
.m-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; min-height: 22px; }
.metric + .metric { padding-left: 18px; border-left: 1px solid var(--line); }
button.metric:hover, button.metric[aria-pressed="true"] { background: var(--wash); }
button.metric[aria-pressed="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--gold); }
.m-label { font-size: 13px; color: var(--dim); }
.m-label small { font-size: 12px; color: var(--mut); margin-left: 5px; }
.m-value { font-weight: 500; font-size: 30px; line-height: 1.12; letter-spacing: -.02em; color: var(--txt); }
.m-value small { font-size: .5em; font-weight: 400; margin-left: 2px; color: var(--dim); letter-spacing: 0; }
.metric-hero .m-value { font-size: 44px; }
.m-sub { font-size: 12.5px; color: var(--dim); min-height: 20px; }
.m-word { font-weight: 600; }
.m-range { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 22px; font-size: 12px; color: var(--mut); }
.m-range i { font-style: normal; }
.m-end { white-space: nowrap; }
.m-end .num { color: var(--dim); }
.m-end.is-on, .m-end.is-on .num { color: var(--txt); font-weight: 600; }
.m-note { font-size: 12.5px; color: var(--dim); }
.m-cmp { font-size: 12.5px; color: var(--mut); }
.m-cmp.is-cmp { color: var(--gold-txt); }
.mini-range .r-line { stroke: var(--line3); stroke-width: 2; stroke-linecap: round; }
.mini-range .r-end { fill: var(--surface); stroke: var(--dim); stroke-width: 1.5; }
.mini-range .r-end.is-on { fill: var(--txt); stroke: var(--txt); }
.mini-range .r-base { fill: var(--txt); stroke: var(--surface); stroke-width: 2; }
.mini-range .r-ref { stroke: var(--gold-txt); stroke-width: 1.5; stroke-dasharray: 3 2; }
.aux { display: flex; flex-wrap: wrap; gap: 2px 0; padding: 6px 0; border-top: 1px solid var(--line); }
.aux > div { display: flex; align-items: baseline; gap: 7px; min-width: 0; padding: 0 14px; border-left: 1px solid var(--line); }
.aux > div:first-child { padding-left: 0; border-left: 0; }
.aux dt { font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.aux dd { font-size: 13.5px; font-weight: 500; color: var(--txt); white-space: nowrap; }
.aux-lender dd { font-weight: 400; }
.aux-lender dd .num { font-weight: 500; }
.aux-lender dd .st { font-size: 12.5px; margin-left: 4px; font-weight: 600; }
.aux-lender dd small { margin-left: 6px; font-size: 12px; color: var(--mut); }
.aux-note { padding: 0 0 6px; font-size: 12px; color: var(--mut); }
.sum-verdict { padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--dim); }
.principle { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0; padding: 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mut); min-height: var(--ctl-h); }
.principle > * { padding: 0 14px; border-left: 1px solid var(--line); line-height: 1.4; }
.principle > *:first-child { padding-left: 0; border-left: 0; }
.principle b { font-weight: 600; color: var(--dim); }
.principle .is-warn b { color: var(--warn); }
.principle .is-bad b { color: var(--neg); }
.pr-sample { color: var(--gold-txt); }

/* 단위 확인 */
.gate { padding: 18px 0 16px; max-width: 760px; }
.gate h3 { font-size: 18px; font-weight: 650; margin-bottom: 8px; }
.gate p { font-size: 14px; color: var(--dim); }
.gate-list { margin: 8px 0; }
.gate-actions { margin: 10px 0; }

/* 변경 줄 */
.change { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 4px 12px; border: 1px dashed var(--line3); border-radius: 3px; font-size: 13px; color: var(--dim); }
/* 변경 줄의 글은 한 줄에 가둔다: 목록이 길면 말줄임으로 자르고 '외 n개'는 자르지 않는다(전체 목록은 title) */
.ch-text { display: flex; align-items: baseline; gap: 6px; flex: 1; min-width: 0; white-space: nowrap; }
.ch-list { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ch-n, .ch-more { flex: none; }
.ch-text b { font-weight: 600; color: var(--txt); }
.ch-actions { display: flex; gap: 8px; flex: none; }

/* 딜 타임라인 */
/* 높이는 구획 전체가 아니라 그림 영역에 보장한다(272px 이상). 폭이 좁아 머리줄(범례, 겹쳐 보기 단추)이 접히면 구획이 그만큼 길어진다 */
.tl { display: grid; grid-template-rows: auto auto minmax(272px, 1fr) auto; min-height: clamp(336px, calc(100dvh - 536px), 500px); min-width: 0; }
.tl-cap { grid-row: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 4px; }
.overlay-note { grid-row: 2; }
.tl-plot { grid-row: 3; }
.tl-trace { grid-row: 4; }
.tl-title { font-size: 14px; font-weight: 650; }
.legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--dim); }
.tl-cap .legend { margin-right: auto; }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { display: inline-block; width: 10px; height: 10px; flex: none; }
.sw-senior { background: var(--c-senior); }
.sw-mezz { background: var(--c-mezz); }
.sw-pref { background: var(--c-pref); }
.sw-common { background: var(--c-common); }
.sw-cost { background: repeating-linear-gradient(135deg, var(--c-cost) 0 2px, var(--c-cost-bg) 2px 4px); }
.sw-hollow { border: 1px solid var(--c-hollow); }
.sw-dscr { width: 14px; height: 2px; background: var(--txt); }
.sw-knob { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); background: var(--surface); }
.overlay-note { padding: 0 0 4px; font-size: 12.5px; color: var(--dim); }
.overlay-note b { color: var(--txt); margin-right: 4px; }
.tl-plot { position: relative; min-height: 0; min-width: 0; }
.tl-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.tl-trace { min-height: 22px; padding-top: 2px; font-size: 12.5px; color: var(--dim); }
.tl-trace .num { color: var(--txt); }
.tl-trace b { color: var(--txt); font-weight: 600; }

/* SVG 글자와 표식(타임라인과 차트가 함께 쓴다) */
svg text { font-family: var(--font-ko); fill: var(--dim); font-size: 11.5px; }
svg .t-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
svg .t-cap { font-size: 12px; fill: var(--dim); }
svg .t-strong { fill: var(--txt); font-weight: 600; }
svg .t-mut { fill: var(--mut); }
svg .t-neg { fill: var(--neg); }
svg .t-cf { fill: var(--txt); }
svg .grid { stroke: var(--line); stroke-width: 1; }
svg .axis { stroke: var(--line3); stroke-width: 1; }
svg .pat-bg { fill: var(--c-cost-bg); }
svg .pat-ln { stroke: var(--c-cost); stroke-width: 2.2; }
svg .pat-room { stroke: var(--dim); stroke-width: 1; opacity: .55; }
svg .seg-senior { fill: var(--c-senior); }
svg .seg-mezz { fill: var(--c-mezz); }
svg .seg-pref { fill: var(--c-pref); }
svg .seg-common { fill: var(--c-common); }
svg .seg-dist { fill: var(--c-pref); }
svg .seg-cost { fill: url(#hatch-cost); }
svg .seg-use { fill: var(--c-use); }
svg .seg-use2 { fill: var(--c-use2); }
svg .seg-hollow, svg .seg-put { fill: var(--wash); stroke: var(--c-hollow); stroke-width: 1; }
svg .seg-short { fill: none; stroke: var(--neg); stroke-width: 1; stroke-dasharray: 3 2; }
svg .room-fill { fill: url(#hatch-room); }
svg .noi-cap { stroke: var(--txt); stroke-width: 2; }
svg .dscr-line { fill: none; stroke: var(--txt); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .dscr-dot { fill: var(--txt); stroke: var(--surface); stroke-width: 2; }
svg .dscr-dot.is-bad { fill: var(--surface); stroke: var(--neg); }
svg .cov-line { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 5 4; }
svg .ghost { stroke: var(--gold-txt); stroke-width: 1.5; stroke-dasharray: 3 3; fill: none; }
svg .band { fill: var(--wash); }
svg .leader { stroke: var(--line3); stroke-width: 1; fill: none; }
svg .cf-rule { stroke: var(--line3); stroke-width: 1; }
svg .r-line { stroke: var(--line3); stroke-width: 2; stroke-linecap: round; }
svg .r-end { fill: var(--surface); stroke: var(--dim); stroke-width: 2; }
svg .r-base { fill: var(--txt); stroke: var(--surface); stroke-width: 2; }
svg .r-ref { stroke: var(--gold-txt); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart { display: block; overflow: visible; max-width: 100%; }
/* 참조 눈금: 평소에는 짧은 선만, 손잡이를 잡거나 포커스하면 이름이 보인다 */
svg .ref-tick { stroke: var(--gold-txt); stroke-width: 1.5; }
svg .ref-line { stroke: var(--gold-txt); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
svg .ref-text { fill: var(--gold-txt); opacity: 0; }
svg.on-exit .ref-exit .ref-text, svg.on-ltv .ref-entry .ref-text, svg.on-exit .ref-exit .ref-line, svg.on-ltv .ref-entry .ref-line { opacity: 1; }
svg.tl-static .ref-text, svg.tl-static .ref-line { opacity: 1; }
svg.on-exit #h-rate text, svg.on-exit #h-rate .h-knob, svg.on-exit #h-rate .h-dot, svg.on-exit #h-rate .h-line { opacity: 0; }
svg.on-exit .noi-end { opacity: 0; }
svg .col { cursor: default; outline: none; }
svg .col .hit { fill: transparent; }
svg .col:hover .hit, svg .col:focus-visible .hit { fill: var(--wash); }
svg .col:focus-visible .hit { stroke: var(--focus); stroke-width: 1.5; }
/* 근거 강조: 주 지표를 고르면 그 숫자를 만든 부분만 남기고 흐리게 한다 */
svg.trace-eq .seg-senior, svg.trace-eq .seg-mezz, svg.trace-eq .seg-cost, svg.trace-eq .seg-hollow, svg.trace-eq .dscr-g { opacity: .22; }
svg.trace-eq .cf-row text { font-weight: 600; }
svg.trace-eq .cf-rule { stroke: var(--gold); }
svg.trace-dscr .seg-common, svg.trace-dscr .seg-pref, svg.trace-dscr .seg-cost, svg.trace-dscr .seg-hollow { opacity: .25; }
svg.trace-dscr .col.is-min .hit { fill: var(--wash2); }
/* 손잡이 */
svg .handle { cursor: ns-resize; outline: none; touch-action: none; }
svg .handle .h-line { stroke: var(--gold); stroke-width: 2; }
svg .handle .h-guide { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
svg .handle .h-knob { fill: var(--surface); stroke: var(--gold); stroke-width: 2; }
svg .handle .h-dot { fill: var(--gold); }
svg .handle .h-hit { fill: transparent; }
svg .handle .h-name { fill: var(--mut); }
svg .handle .h-val { font-family: var(--font-num); font-size: 12.5px; font-weight: 500; fill: var(--gold-txt); }
svg .handle:hover .h-knob, svg .handle.is-drag .h-knob { fill: var(--gold); }
svg .handle:focus-visible .h-ring { stroke: var(--focus); stroke-width: 2; fill: none; }
svg .handle .h-ring { fill: none; stroke: none; }

.tip { position: absolute; z-index: 5; min-width: 200px; max-width: 290px; padding: 10px 12px; pointer-events: none; background: var(--pop-bg); border: 1px solid var(--line2); border-radius: 3px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--dim); }
.tip h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--txt); }
.tip dl { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; }
.tip dd { font-family: var(--font-num); color: var(--txt); text-align: right; }
.tip .tip-k { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; }
.k-senior { background: var(--c-senior); } .k-mezz { background: var(--c-mezz); } .k-cost { background: var(--c-cost); } .k-common { background: var(--c-common); }
.tip p { margin-top: 6px; font-size: 12px; color: var(--mut); }

/* 상세 구획 */
.detail { min-width: 0; border-top: 1px solid var(--line2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.tabs button { position: relative; height: 40px; padding: 0 14px; font-size: 13.5px; color: var(--mut); white-space: nowrap; }
.tabs button:first-child { padding-left: 0; }
.tabs button:hover { color: var(--txt); }
.tabs button[aria-selected="true"] { color: var(--txt); font-weight: 600; }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--gold); }
.tabs button:first-child[aria-selected="true"]::after { left: 0; }
.tabs button:focus-visible { outline-offset: -3px; }
.tabs .cnt { margin-left: 6px; font-family: var(--font-num); font-size: 12px; color: var(--mut); }
.tabs .cnt.is-warn { color: var(--warn); }
.tabs .cnt.is-bad { color: var(--neg); }
.panel { padding: 14px 0 0; min-height: 190px; }
.pgrid { display: grid; gap: 16px 32px; align-items: start; }
.pgrid > * { min-width: 0; }
.pg-sens { grid-template-columns: 176px minmax(0, 1fr) 260px; }
.pg-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pg-led { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.ctl { display: grid; gap: 10px; }
.ctl label { display: grid; gap: 3px; font-size: 12px; color: var(--mut); }
.ctl select { height: var(--ctl-h); padding: 0 6px; border: 1px solid var(--line2); border-radius: 3px; background: transparent; font-size: 13px; color: var(--txt); }
.p-note { font-size: 12.5px; line-height: 1.6; color: var(--mut); }
.p-note + .p-note, .tb-wrap + .p-note, table + .p-note, .chart + .p-note { margin-top: 6px; }
.p-note b { font-weight: 600; color: var(--dim); }
.p-note.warn { color: var(--warn); }
.p-title { font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
.pick-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-top: 8px; font-size: 13px; color: var(--dim); }
.pick-line b { color: var(--txt); font-weight: 600; }

/* 표 */
.tb { width: 100%; font-size: 12.5px; }
.tb th, .tb td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tb th:first-child, .tb td:first-child { text-align: left; padding-left: 0; }
.tb thead th { font-size: 12px; font-weight: 500; color: var(--mut); border-bottom-color: var(--line2); }
.tb tbody th { font-weight: 400; color: var(--dim); }
.tb td { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--txt); }
.tb td.txt, .tb th.txt { font-family: var(--font-ko); color: var(--dim); text-align: left; white-space: normal; }
.tb td.def, .tb th.def { font-family: var(--font-ko); text-align: left; white-space: normal; font-size: 12px; line-height: 1.5; color: var(--mut); min-width: 180px; }
.tb td.nowrap { white-space: nowrap; }
.tb td.act { white-space: nowrap; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more-w { margin-left: 4px; color: var(--dim); border-bottom: 1px solid var(--line3); white-space: nowrap; }
.more[open] .more-w { display: none; }
.more p { margin-top: 2px; }
.tb td.act .btn + .btn { margin-left: 6px; }
.tb td.wait { font-family: var(--font-ko); color: var(--mut); font-size: 12px; }
.tb tr.is-sum > * { border-top: 1px solid var(--line2); color: var(--txt); font-weight: 600; }
.tb tr.is-key > * { color: var(--txt); font-weight: 600; }
.tb .st { font-family: var(--font-ko); font-size: 12.5px; font-weight: 600; }
.tb .st.mut { font-weight: 400; }
/* 원장 번호와 출처 글자: 화면에서는 글자 하한 12px을 지킨다(한 장 요약은 인쇄 크기라 비율로 둔다) */
.tb sup, .nar sup, .src-list sup { font-family: var(--font-num); font-size: max(12px, .78em); line-height: 1; color: var(--gold-txt); margin-left: 1px; }
.sh sup { font-family: var(--font-num); font-size: .78em; color: var(--gold-txt); margin-left: 1px; }
.tb-wrap { overflow-x: auto; }
.tb-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.is-stale { opacity: .5; }
.chk-lab { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-h); cursor: pointer; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin-top: 12px; }
.kv dt { font-size: 12px; color: var(--mut); }
.kv dd { font-family: var(--font-num); font-size: 13.5px; color: var(--txt); }
/* 자산군 지표 줄: 조달·사용 구획과 보고 화면의 조달과 사용 표 아래에 한 줄로 둔다(설계서 2.4절). 줄 자체의 모양(.akpi)은 css/desk-guide.css에 있다 */
#p-cap > .akpi, .rp .akpi { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* 민감도 격자: 높은 칸은 골드, 낮은 칸은 블루그레이와 빗금. 칸마다 차이를 글자로 적는다 */
.heat { width: 100%; table-layout: fixed; font-size: 12.5px; }
.heat caption { caption-side: top; text-align: left; padding-bottom: 6px; font-size: 12px; color: var(--mut); }
.heat th { height: 24px; padding: 0 4px; font-family: var(--font-num); font-size: 12px; font-weight: 400; color: var(--dim); text-align: center; }
.heat th[aria-current="true"] { color: var(--txt); font-weight: 600; }
.heat td { padding: 1px; }
.hc { position: relative; display: grid; align-content: center; justify-items: center; width: 100%; height: 40px; border-radius: 2px; }
.hc b { font-family: var(--font-num); font-weight: 500; font-size: 13px; line-height: 1.15; color: var(--txt); }
.hc i { font-family: var(--font-num); font-style: normal; font-size: 12px; line-height: 1.15; color: var(--txt); }
.hc.up.l1 { background: rgba(var(--heat-hi), .14); } .hc.up.l2 { background: rgba(var(--heat-hi), .26); } .hc.up.l3 { background: rgba(var(--heat-hi), .38); } .hc.up.l4 { background: rgba(var(--heat-hi), .5); }
.hc.dn { background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--line2) 5px 6px); }
.hc.dn.l1 { background-color: rgba(var(--heat-lo), .14); } .hc.dn.l2 { background-color: rgba(var(--heat-lo), .26); } .hc.dn.l3 { background-color: rgba(var(--heat-lo), .38); } .hc.dn.l4 { background-color: rgba(var(--heat-lo), .4); }
/* 가장 낮은 단계는 면을 더 짙게 하지 않고 빗금을 촘촘히 한다: 다크 테마에서 빗금이 지나는 자리의 글자 명도비가 4.5:1 아래로 내려가지 않게(tests/desk-review2.test.mjs가 네 단계를 계산한다) */
.hc.dn.l4 { background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--line2) 3px 4px); }
.hc.base { box-shadow: inset 0 0 0 2px var(--gold); }
.hc.miss i { font-family: var(--font-ko); font-weight: 700; color: var(--txt); }
.hc.miss { box-shadow: inset 0 0 0 1px var(--neg); }
.hc.picked { box-shadow: inset 0 0 0 2px var(--txt); }
button.hc:hover { box-shadow: inset 0 0 0 1px var(--line3); }
button.hc.base:hover { box-shadow: inset 0 0 0 2px var(--gold); }
button.hc.picked:hover { box-shadow: inset 0 0 0 2px var(--txt); }
button.hc:focus-visible { outline-offset: -2px; }

/* 미입력 안내: 방향이나 상태를 적는 빈 칸의 목록. 누르면 그 칸으로 간다 */
.blank-line { margin: 0 0 8px; font-size: 12.5px; line-height: 1.7; color: var(--dim); }
.blank-line b { margin-right: 6px; font-weight: 600; color: var(--txt); }
.blank-line .pr-link { border-bottom-color: var(--line3); }
.sh .blank-line { font-size: 7.4pt; }

/* 점검과 판정 */
.chk li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.chk .lv-w { font-size: 12px; font-weight: 600; white-space: nowrap; }
.chk .lv-bad { color: var(--neg); }
.chk .lv-warn { color: var(--warn); }
.chk .lv-info, .chk .lv-ok { color: var(--mut); font-weight: 400; }
.verdict li { position: relative; padding: 0 0 6px 14px; font-size: 13.5px; line-height: 1.6; color: var(--txt); }
.verdict li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 1px; background: var(--dim); }
.ver-label { font-size: 13.5px; margin-bottom: 4px; }
.defs-list { margin-top: 6px; }
.defs-list li { font-size: 12.5px; line-height: 1.6; color: var(--mut); }
.defs-list b { font-weight: 600; color: var(--dim); margin-right: 6px; }

/* 계산 보류와 빈 상태 */
.hold { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 48px; padding: 20px 0 0; border-top: 1px solid var(--line2); align-items: start; }
.hold h3 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 8px; }
.hold-lead { font-size: 14px; line-height: 1.7; color: var(--dim); max-width: 580px; margin-bottom: var(--s4); }
.hold-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s4); }
.hold-list { counter-reset: n; }
.hold-list li { counter-increment: n; border-bottom: 1px solid var(--line); }
.hold-list li:first-child { border-top: 1px solid var(--line2); }
.hold-list button { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 40px; padding: 0 4px; text-align: left; font-size: 14px; color: var(--txt); }
.hold-list button::before { content: counter(n, decimal-leading-zero); font-family: var(--font-num); font-size: 12px; color: var(--mut); }
.hold-list button:hover { background: var(--wash); }
/* 확인 자료 문장은 두 줄까지 줄을 바꾼다(말줄임으로 자르지 않는다. 전체 문장은 title에도 있다) */
.hold-list .where { font-size: 12px; line-height: 1.35; color: var(--mut); padding: 3px 0 3px 12px; text-align: right; max-width: 340px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.hold-err li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--neg); }
.hold-side h4 { margin: var(--s5) 0 6px; font-size: 14px; font-weight: 650; }
.hold-side h4 small { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--mut); }
.skel { display: grid; grid-template-columns: 1.2fr 1fr 1fr; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line); }
.skel > div { padding: 10px 16px 14px 0; }
.skel > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.skel span { font-size: 13px; color: var(--mut); }
.skel i { display: block; width: 72px; height: 0; margin-top: 30px; border-top: 2px dashed var(--line3); }
.hold-pr { grid-column: 1 / -1; }

/* ---------- 보고 화면(읽기 전용 메모) ---------- */
.report { overflow: auto; }
.rp { max-width: 1056px; margin: 24px auto 64px; padding: 36px 48px 48px; background: var(--paper); border: 1px solid var(--line); }
.rp-mast { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line3); font-size: 12.5px; color: var(--mut); }
.rp-kind { font-weight: 650; color: var(--txt); letter-spacing: .02em; }
.rp-head h1 { margin-top: 18px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 13px; color: var(--dim); }
.rp-sample { color: var(--gold-txt); }
.rp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.rp-note { margin-top: 10px; font-size: 12.5px; color: var(--mut); }
.rp-sec { margin-top: 36px; }
.rp-sec h2 { display: flex; align-items: baseline; gap: 12px; padding-bottom: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line2); font-size: 17px; font-weight: 650; }
.rp-sec h2 .no { font-size: 12.5px; font-weight: 500; color: var(--gold-txt); }
.rp-sec h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 650; }
.rp-sum .sum { border-top: 0; }
.rp-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 36px; align-items: start; margin-top: 14px; }
.rp-two > * { min-width: 0; }
.cap { margin: 16px 0 6px; font-size: 12.5px; color: var(--dim); }
.cap b { margin-right: 6px; color: var(--txt); font-weight: 600; }
.nar { font-size: 14px; line-height: 1.85; color: var(--dim); }
.nar + .nar { margin-top: 4px; }
.nar > b { display: inline-block; min-width: 76px; margin-right: 8px; font-size: 12.5px; font-weight: 600; color: var(--mut); }
.nar .av { white-space: nowrap; }
.nar .k { color: var(--dim); }
.nar .v { color: var(--txt); font-weight: 500; }
.nar .v-app, .sh .v-app { color: var(--mut); font-weight: 400; }
.nar .rr-off { color: var(--mut); font-size: .93em; }
.blank-help { margin: -4px 0 8px; }
.nar-sub { font-size: 13px; line-height: 1.8; }
.nar sup.src, .src-list sup { color: var(--dim); }
.nar-key { margin-top: 8px; }
.src-list { margin-top: 8px; font-size: 12.5px; color: var(--dim); }
.ov { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: 12.5px; color: var(--mut); }
.ov-desc { color: var(--dim); }
.fold { margin-top: 12px; border-top: 1px solid var(--line); }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 13px; color: var(--dim); }
.fold > summary::-webkit-details-marker { display: none; }
.fold-body { padding: 4px 0 8px; }
.rp-miss { margin: 10px 0; padding-left: 20px; list-style: decimal; font-size: 14px; }
.rp-foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line2); font-size: 12.5px; color: var(--mut); }

/* ---------- 대화상자 ---------- */
dialog.dlg { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line2); border-radius: 4px; background: var(--pop-bg); color: var(--txt); box-shadow: var(--shadow); }
dialog.dlg-wide { width: min(920px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(7, 12, 23, .6); }
.dlg-in { padding: 20px 24px 20px; display: grid; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h3 { font-size: 17px; font-weight: 650; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.dlg-body { min-width: 0; }
.dlg-list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--dim); }
.dlg-list li:last-child { border-bottom: 1px solid var(--line); }
.dlg-body .p-note a { color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.dlg-body .p-note a:hover { color: var(--txt); }
.combo-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 32px; align-items: start; }
.combo-body > .matrix, .combo-body > .mx-legend { grid-column: 1; }
.combo-body > #combo-detail { grid-column: 2; grid-row: 1 / span 2; }
.combo-body > .p-note, .combo-body > .dlg-actions { grid-column: 1 / -1; }
.combo-body h2 { font-size: 17px; font-weight: 650; }

/* ---------- 파일 끌어 놓기 안내 (SPEC 18.5절) ---------- */
/* 파일을 끌어 창 위로 가져온 동안만 보인다. 포인터를 받지 않아 아래의 화면이 끌기 알림을 그대로 받는다. 놓으면 자료 가져오기가 열린다 */
.dropveil { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: var(--bar-bg); pointer-events: none; }
.dropveil-in { display: grid; gap: 6px; justify-items: center; width: min(560px, 100%); padding: 34px 28px; border: 2px dashed var(--gold); border-radius: 6px; background: var(--pop-bg); text-align: center; box-shadow: var(--shadow); }
.dropveil-t { font-size: 20px; font-weight: 650; letter-spacing: -.02em; color: var(--txt); }
.dropveil-d { font-size: 13.5px; line-height: 1.6; color: var(--dim); }


/* ---------- 한 장 요약(A4 세로): 화면 미리보기와 인쇄가 같은 규칙을 쓴다. 색은 항상 밝은 인쇄용 토큰이다 ---------- */
.preview { position: fixed; inset: 0; z-index: 30; overflow: auto; background: rgba(7, 12, 23, .82); padding: 0 0 40px; }
.preview-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 20px; background: #070C17; color: #EDEAE0; font-size: 13px; --line2: rgba(237, 234, 224, .28); --line3: rgba(237, 234, 224, .5); --dim: #D5D1C5; --txt: #EDEAE0; }
.preview-bar span { margin-right: auto; }
/* 미리보기를 열면 포커스는 미리보기 자체에 놓인다(읽기가 먼저다). 틀 전체에 포커스 테두리를 두르지 않는다 */
.preview:focus, .preview:focus-visible { outline: none; }
.sheet {
  --bg0: #fff; --surface: #fff; --paper: transparent; --pop-bg: #fff; --txt: #101B31; --dim: #333C4E; --mut: #555B68;
  --line: rgba(16,27,49,.16); --line2: rgba(16,27,49,.30); --line3: rgba(16,27,49,.55);
  --wash: rgba(16,27,49,.04); --wash2: rgba(16,27,49,.08); --gold: #8F7640; --gold-txt: #6F5628; --pos: #1F6243; --neg: #A3342C; --warn: #6B4706;
  --c-senior: #2C4188; --c-mezz: #6F89CF; --c-pref: #9C8A5E; --c-common: #3A3528; --c-cost: #5F6472; --c-cost-bg: rgba(95,100,114,.12); --c-hollow: rgba(16,27,49,.7);
  --c-use: #7A8296; --c-use2: #A7ADBB; --heat-hi: 169, 143, 93; --heat-lo: 94, 110, 140;
  box-sizing: content-box; width: 186mm; min-height: 275mm; margin: 20px auto 0; padding: 11mm 12mm; background: #fff; color: var(--txt);
  font-size: 8.4pt; line-height: 1.45; color-scheme: light;
}
/* 한 장 요약 */
.sh { color: var(--txt); }
.sh-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 0 14pt; padding-bottom: 5pt; border-bottom: 1.2pt solid var(--txt); }
.sh-brand { display: grid; gap: 2pt; }
.sh-brand .logo { font-size: 10.5pt; }
.sh-brand .product { font-size: 7.2pt; padding-left: 0; border-left: 0; }
.sh-title h1 { font-size: 13.5pt; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.sh-title p { font-size: 8pt; color: var(--dim); }
.sh-flag { padding: 2pt 6pt; border: .8pt solid var(--gold); font-size: 7.6pt; color: var(--gold-txt); white-space: nowrap; }
.sh .sum { border-top: 0; border-bottom: .6pt solid var(--line2); }
.sh .metric { padding: 5pt 10pt 3pt 0; }
.sh .metric + .metric { padding-left: 10pt; }
.sh .m-label { font-size: 8.4pt; } .sh .m-label small { font-size: 7.4pt; }
.sh .m-value { font-size: 19pt; } .sh .metric-hero .m-value { font-size: 27pt; }
.sh .m-sub, .sh .m-cmp, .sh .m-note, .sh .m-range { font-size: 7.6pt; min-height: 0; }
.sh .m-cmp:empty { display: none; }
.sh .aux { padding: 3pt 0; flex-wrap: nowrap; } .sh .aux > div { padding: 0 6pt; gap: 3pt; } .sh .aux > div:first-child { padding-left: 0; }
.sh .aux dt { font-size: 7.2pt; } .sh .aux dd { font-size: 8pt; }
.sh .aux-lender dd .st { font-size: 7.2pt; }
.sh .aux-note { font-size: 7.2pt; padding-bottom: 2pt; }
.sh .sum-verdict { padding: 3pt 0; font-size: 8.2pt; line-height: 1.45; color: var(--txt); }
.sh .principle { min-height: 0; padding: 2.5pt 0; font-size: 7.4pt; }
.sh .principle > * { padding: 0 7pt; } .sh .principle > *:first-child { padding-left: 0; }
.sh-fig { margin-top: 5pt; }
.sh-fig figcaption { display: flex; align-items: baseline; gap: 8pt; font-size: 8pt; color: var(--dim); }
.sh-fig figcaption b { color: var(--txt); font-size: 8.6pt; }
.sh-fig .legend { font-size: 7.2pt; gap: 0 8pt; margin-left: auto; }
.sh-fig .sw { width: 6pt; height: 6pt; } .sh-fig .sw-dscr { width: 9pt; height: 1.4pt; }
.sh-fig svg { width: 100%; height: auto; }
/* 오른쪽 단(표 세 개)이 더 길어 조금 넓게 준다: 표의 긴 이름이 줄을 덜 바꿔 한 쪽에 들어간다 */
.sh-cols { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 0 14pt; margin-top: 4pt; align-items: start; }
.sh h2 { margin: 5pt 0 2pt; padding-bottom: 1.5pt; border-bottom: .6pt solid var(--line2); font-size: 8.6pt; font-weight: 650; }
.sh h2 .num { font-weight: 500; }
.sh-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 0 12pt; }
.sh-dl > div.wide { grid-column: 1 / -1; }
.sh-dl > div { display: flex; justify-content: space-between; gap: 6pt; padding: 1.4pt 0; border-bottom: .4pt solid var(--line); }
.sh-dl dt { font-size: 7.8pt; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-dl dd { font-size: 8pt; white-space: nowrap; }
.sh .tb { font-size: 7.6pt; } .sh .tb th, .sh .tb td { padding: 1pt 4pt; } .sh .tb thead th { font-size: 7.2pt; }
.sh .tb td.def, .sh .tb th.def { display: none; }
/* 한 장 요약의 표는 좁은 단 안에 다 들어가야 한다(스크롤 상자를 만들지 않는다). 첫 열의 긴 이름은 줄을 바꾼다 */
.sh .tb-wrap { overflow: visible; }
.sh .tb th:first-child, .sh .tb td:first-child { white-space: normal; }
.sh .tb .st { font-size: 7.4pt; }
/* 한 장 요약의 글자 하한: 표 본문과 민감도 칸(값, 차이, 축 머리)은 7.6pt, 주석과 꼬리와 보조 이름은 7.2pt. 민감도 칸은 높이를 지키고 줄 간격으로 맞춘다 */
.sh .p-note { font-size: 7.2pt; line-height: 1.4; margin-top: 1.5pt; }
.sh .heat { font-size: 7.6pt; } .sh .heat caption { display: none; } .sh .heat th { height: 11pt; font-size: 7.6pt; }
.sh .hc { height: 16pt; } .sh .hc b { font-size: 7.8pt; line-height: 1; } .sh .hc i { font-size: 7.6pt; line-height: 1; }
.sh .hc.base { box-shadow: inset 0 0 0 1.2pt var(--txt); }
.sh-p { font-size: 7.4pt; line-height: 1.5; color: var(--dim); }
.sh-p b { color: var(--txt); }
.sh-ledger { margin-top: 5pt; padding-top: 3pt; border-top: .6pt solid var(--line2); }
.sh-ledger .sh-p + .sh-p { margin-top: 2pt; }
/* 원장 줄: 근거 구분별 묶음(.lg). 근거 구분 이름은 엔진 글자 그대로 한 번씩 적고, 항목은 낱개로 줄이 바뀐다 */
.sh-ledger .sh-p .lg { margin-right: 6pt; }
.sh-ledger .sh-p .lg > span { white-space: nowrap; }
.sh-ledger .sh-p i { font-style: normal; font-weight: 600; color: var(--txt); }
/* 한 쪽에 맞추는 1단계(js/desk/report.js의 fitSheet): 표와 구획의 간격만 줄인다. 글자 크기와 값은 그대로다 */
.sh.sh-tight .hc { height: 15.6pt; }
.sh.sh-tight h2 { margin-top: 3.5pt; }
.sh.sh-tight .sh-dl > div { padding: .9pt 0; }
.sh.sh-tight .metric { padding-top: 3.5pt; padding-bottom: 2pt; }
.sh.sh-tight .sh-fig, .sh.sh-tight .sh-ledger, .sh.sh-tight .sh-foot { margin-top: 3.5pt; }
.sh.sh-tight .sh-p { line-height: 1.4; }
.sh.sh-tight .tb th, .sh.sh-tight .tb td { padding-top: .6pt; padding-bottom: .6pt; }
.sh-foot { display: flex; flex-wrap: wrap; gap: 0 12pt; margin-top: 5pt; padding-top: 3pt; border-top: .8pt solid var(--txt); font-size: 7.2pt; color: var(--dim); }
.sh-hold h2 { font-size: 12pt; border: 0; margin-top: 14pt; }
.sh-hold p { font-size: 9.5pt; margin-top: 4pt; }


/* ---------- 높이가 낮은 화면: 타임라인을 줄이고 캔버스를 스크롤한다 ---------- */
@media screen and (max-height: 780px) and (min-width: 720px) {
  .tl { min-height: 320px; }
  .rail-card { height: 204px; }
  .canvas { --cv-pad: 12px; }
  .head { margin-bottom: 8px; }
  .result { gap: 10px; }
  .metric-hero .m-value { font-size: 40px; }
  /* 탭 줄이 첫 화면에 남게 세로 여백을 줄인다(대주 관점이거나 가정을 고쳐 변경 줄이 생겨도. 1366x768 기준) */
  .result { gap: 8px; }
  .head { margin-bottom: 6px; }
  .metric { padding-top: 5px; padding-bottom: 3px; }
  .change { min-height: 34px; padding-top: 1px; padding-bottom: 1px; }
  /* 대주 지표 줄은 한 줄에 둔다(기준과 판정을 값 옆에). 앱 기본 기준 안내 문장은 대주 구획의 표 아래와 판정 문장에 있다 */
  .desk .aux-lender { flex-wrap: nowrap; }
  .desk .aux-lender > div { padding: 0 10px; gap: 5px; }
  .desk .aux-lender dd small { margin-left: 4px; }
  .desk .aux-note { display: none; }
  /* 원칙 줄이 두 줄로 접히지 않게 항목 사이를 조금 좁힌다(검증 수준 이름이 긴 조합) */
  .desk .principle > * + * { padding: 0 0 0 10px; margin-left: 10px; }
  /* 낮은 화면에서는 요약 블록의 판정 문장을 접는다(판정·점검 구획과 보고 화면에는 그대로 있다). 탭 줄이 첫 화면에 들어온다 */
  .desk .sum-verdict { display: none; }
}
@media screen and (min-height: 1000px) and (min-width: 1100px) {
  .tl { min-height: clamp(380px, calc(100dvh - 600px), 520px); }
}

/* ---------- 좁은 데스크톱과 태블릿 ---------- */
/* 상단 바에 [자료 가져오기]가 들어온 만큼(1.6.0) 가운데 알림 자리가 좁아진다. 노트북 너비에서는 조합 단추의 덧붙임 글을 먼저 가려 알림 자리를 지킨다 */
@media screen and (max-width: 1439px) {
  .chip small { display: none; }
}
@media screen and (max-width: 1279px) {
  :root { --rail-w: 320px; }
  .canvas { --cv-pad: 12px; padding: var(--cv-pad) 18px 24px; }
  .mini-in { left: -18px; right: -18px; padding: 0 18px; }
  .pg-sens { grid-template-columns: 150px minmax(0, 1fr); }
  .pg-sens > #sens-note { grid-column: 1 / -1; }
  .product, .chip small { display: none; }
}
@media screen and (max-width: 999px) {
  .pg-two, .pg-led, .rp-two { grid-template-columns: minmax(0, 1fr); }
  /* 상단 바에 알림 한 줄이 들어갈 자리가 없다: 알림이 있는 동안만 상단 바 아래에 한 줄을 더 둔다(본문을 가리지 않고 밀어 내린다) */
  body:has(#toast:not([hidden])) { grid-template-rows: auto minmax(0, 1fr); }
  .top { flex-wrap: wrap; min-height: var(--top-h); }
  .top-mid { order: 9; flex: 0 0 100%; justify-content: flex-start; padding-bottom: 8px; }
  .top-mid:has(#toast[hidden]) { display: none; }
  .top-actions { margin-left: auto; }
  /* 캔버스 머리: 딜 이름 칸이 한 줄을 다 쓰고 관점 전환과 단추는 다음 줄로 내린다(이름이 가려지지 않게) */
  .head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "actions" "sub"; row-gap: 4px; }
  .head-actions { flex-wrap: wrap; }
  .start-in { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; }
  .start-r { padding-top: 0; }
  .hold { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 720px 미만: 열람 전용(보고 화면만 보인다) ---------- */
@media screen and (max-width: 719px) {
  :root { --top-h: 48px; }
  body { height: auto; min-height: 100dvh; overflow: auto; display: block; }
  .top { height: var(--top-h); padding: 0 16px; gap: 10px; position: sticky; top: 0; z-index: 10; background: var(--bg0); }
  .product, #btn-combo, #seg-view, #btn-vault, #btn-export, #btn-guide, .skip, .top-mid { display: none !important; }
  .top-actions { margin-left: auto; }
  .top .btn { height: 40px; }
  .only-read { display: block; }
  .only-desk { display: none !important; }
  .desk { display: none !important; }
  .report, .start { overflow: visible; }
  .rp { margin: 0; padding: 16px 16px 28px; border: 0; background: none; }
  /* 문서 머리는 두 줄로 세운다(종류, 빌드 줄). 나란히 두면 좁은 폭에서 둘 다 낱말 중간에서 접힌다 */
  .rp-mast { display: grid; gap: 2px; }
  .rp-build { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rp-guide, .start-tools { margin-top: 16px; }
  .rp-guide .btn, .start-tools .btn { min-height: 40px; }
  .rp-head h1 { margin-top: 12px; font-size: 21px; }
  .rp-sec { margin-top: 20px; }
  .ov-desc:empty { display: none; }
  .rp-sec h2 { margin-bottom: 10px; font-size: 16px; }
  .rp-sec h3 { margin: 14px 0 6px; }
  .rp-two { margin-top: 8px; gap: 8px; }
  .cap { margin: 10px 0 4px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 10px 0 8px; }
  .metric-hero { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .metric + .metric { padding-left: 0; border-left: 0; }
  .metric:nth-child(3) { padding-left: 14px; border-left: 1px solid var(--line); }
  .metric-hero .m-value { font-size: 52px; }
  .m-value { font-size: 30px; }
  .m-range { flex-wrap: wrap; gap: 2px 8px; }
  .metric:not(.metric-hero) .mini-range { display: none; }
  /* 보조 지표는 3열 격자로 둔다(줄마다 열의 시작이 같게) */
  .aux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
  .aux > div { display: block; padding: 0; border-left: 0; }
  .aux dt, .aux dd { white-space: normal; }
  .start-saved .pr-link, .start-saved .btn { min-height: 40px; }
  .aux-lender { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .aux-lender > div { display: block; }
  .aux-lender dd small { display: block; margin-left: 0; }
  span.only-read { display: inline; }
  .principle { display: block; padding: 6px 0; }
  /* 원칙 줄은 항목 단위로 줄이 바뀐다(항목 중간에서 끊기지 않게 항목마다 한 덩어리로 둔다) */
  .principle > * { display: inline-block; max-width: 100%; padding: 0 12px 0 0; border-left: 0; line-height: 1.7; }
  .nar { font-size: 13.5px; line-height: 1.75; }
  .nar > b { min-width: 0; margin-right: 8px; }
  .nar-sub { display: none; }
  .tb th, .tb td { padding: 5px 0 5px 8px; }
  /* 좁은 화면: 첫 열의 긴 이름(LTV(취급 시점, 보증금 제외) 등)은 줄을 바꿔 표가 화면 폭을 넘지 않게 한다 */
  .tb tbody th:first-child { white-space: normal; }
  .tb td.def, .tb th.def { display: none; }
  .hc { height: 36px; }
  .heat th { font-size: 12px; padding: 0 1px; }
  .hc b { font-size: 12px; }
  .start-in { padding: 20px 16px 28px; }
  .start-foot a { padding: 13px 0; margin: -13px 0; }
  .start h1 { font-size: 22px; }
  .matrix tbody th { width: 72px; font-size: 12.5px; }
  .seg-btn button { height: 40px; }
  .rp-tools .seg-btn, .ov .seg-btn { width: 100%; }
  .rp-tools .seg-btn button, .ov .seg-btn button { flex: 1; }
  .fold > summary { min-height: 44px; }
  .toast { position: static; }
}

/* ---------- 움직임 줄이기 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sw-toggle .trk::after { transition: left .12s ease; }
  .req-ticks i { transition: background-color .15s ease; }
  .cell { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
  .matrix th { transition: color .12s ease; }
}

/* ---------- 인쇄: 기본은 A4 세로 한 장(#sheet). html[data-print="report"]이면 보고서 전체를 찍는다 ---------- */
@media print {
  :root, :root[data-theme="light"], :root[data-theme="dark"] {
    --bg0: #fff; --bg: none; --surface: #fff; --paper: transparent; --pop-bg: #fff; --txt: #101B31; --dim: #333C4E; --mut: #555B68;
    --line: rgba(16,27,49,.16); --line2: rgba(16,27,49,.30); --line3: rgba(16,27,49,.55);
    --wash: rgba(16,27,49,.04); --wash2: rgba(16,27,49,.08); --gold: #8F7640; --gold-txt: #6F5628; --pos: #1F6243; --neg: #A3342C; --warn: #6B4706;
    --c-senior: #2C4188; --c-mezz: #6F89CF; --c-pref: #9C8A5E; --c-common: #3A3528; --c-cost: #5F6472; --c-cost-bg: rgba(95,100,114,.12); --c-hollow: rgba(16,27,49,.7);
    --c-use: #7A8296; --c-use2: #A7ADBB; --heat-hi: 169, 143, 93; --heat-lo: 94, 110, 140; --focus: #101B31;
    color-scheme: light;
  }
  @page { size: A4 portrait; margin: 11mm 12mm; }
  html, body { height: auto; }
  body { display: block; overflow: visible; background: #fff; font-size: 8.4pt; line-height: 1.45; }
  .top, .desk, .start, .report, dialog, .skip, .no-print, .preview-bar { display: none !important; }
  #preview, #preview[hidden] { display: block !important; position: static; overflow: visible; background: none; padding: 0; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 0; }
  html[data-print="report"] #preview, html[data-print="report"] #preview[hidden] { display: none !important; }
  html[data-print="report"] .report { display: block !important; overflow: visible; }
  html[data-print="report"] .rp { margin: 0; padding: 0; border: 0; max-width: none; }
  html[data-print="report"] .rp-sec { break-inside: auto; margin-top: 18pt; }
  html[data-print="report"] .rp-sec h2, html[data-print="report"] .cap { break-after: avoid; }
  html[data-print="report"] .chart, html[data-print="report"] .tb-wrap, html[data-print="report"] .heat { break-inside: avoid; }
  html[data-print="report"] details.fold > summary { display: none; }
  .tb-wrap { overflow: visible; }
  html[data-print="report"] .only-desk { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  svg text { font-size: 11.5px; }
}

/* 보고 화면의 단위 확인 단추: 좁은 화면(열람 전용)에서도 누르는 영역 40px 이상 */
@media screen and (max-width: 719px) {
  .rp .gate-actions .btn { min-height: 40px; }
}
