/* IT System Cost Overview — Executive / Data-first */
:root {
  --navy: #0B1B36;
  --navy-2: #1C2F52;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #EEF2F6;
  --bg: #F1F4F8;
  --card: #FFFFFF;
  --head: #F8FAFC;

  --dep: #1E3A6E;        /* 무형자산상각비 */
  --dep-soft: #C3CEE2;
  --svc: #0E7C7B;        /* 전산용역비 */
  --svc-soft: #B9DCDA;
  --em: #C0262D;         /* 핵심 금액 강조 */
  --chg: #E5484D;        /* 비교 연도 대비 변동 테두리 */
  --amber: #A15C07;      /* 확인 필요 */
  --amber-bg: #FEF3C7;
  --amber-line: #F2B233;
  --green: #047857;

  --r: 6px;
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; word-break: keep-all; overflow-wrap: break-word; }
h1, h2, h3 { letter-spacing: -0.01em; }
button, input, select { font: inherit; }
.num, .r, .hero__value, .sub__total, .mini td { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.print-only { display: none; }
:focus-visible { outline: 2px solid #2F6BFF; outline-offset: 2px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.up { color: var(--em); }
.down { color: #1D4ED8; }
.u { margin-left: 3px; font-size: .78em; font-weight: 500; color: var(--muted); } /* 금액 단위 */

/* ---------- Header ---------- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px 32px; background: var(--navy); color: #fff;
}
@media (min-width: 900px) { .top { position: sticky; top: 0; z-index: 20; } }
.top .eyebrow { color: #93A8CF; }
.top h1 { margin: 2px 0 0; font-size: 21px; font-weight: 700; }
.top__meta { margin: 2px 0 0; font-size: 12px; color: #AFBDD6; }
.top__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.updated { font-size: 11px; line-height: 1.25; color: #93A8CF; text-align: right; }
.updated strong { display: block; font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; }
.btn { padding: 7px 12px; border: 1px solid #fff; border-radius: var(--r); background: #fff; color: var(--navy); font-weight: 700; cursor: pointer; }
.btn:hover { background: #E8EDF6; }
.btn--ghost { border-color: var(--line); color: var(--ink-2); }
.btn--primary { margin-top: 14px; padding: 9px 16px; border-color: var(--navy); background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-2); }

/* ---------- Layout ---------- */
main { display: grid; gap: 16px; max-width: 1760px; margin: 0 auto; padding: 20px 32px 40px; }

/* ---------- Hero: 연간 합계 ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px 48px; align-items: center;
  padding: 24px 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.hero__label { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.hero__label span { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.hero__value { margin: 4px 0 2px; font-size: 58px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; color: var(--navy); white-space: nowrap; }
.hero__value .cur, .sub__total .cur { margin-right: 6px; font-size: .45em; font-weight: 700; color: var(--muted); }
.hero__value .unit, .sub__total .unit { margin-left: 8px; font-size: .32em; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.hero__sub { margin: 0; font-size: 13px; color: var(--muted); }

.split { display: flex; height: 18px; overflow: hidden; border-radius: 4px; background: var(--line-2); }
.split__seg { display: block; height: 100%; }
.split__seg--dep { background: var(--dep); }
.split__seg--svc { background: var(--svc); }
.split__legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.split__item {
  display: block; padding: 12px 16px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: inherit;
}
.split__item:hover { border-color: var(--ink-2); }
.split__top { display: flex; align-items: center; gap: 8px; }
.split__name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.split__pct { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.split__item b { display: block; margin-top: 2px; font-size: 28px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.split__item b .u { font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.dot--dep { background: var(--dep); }
.dot--svc { background: var(--svc); }

.alert {
  display: block; width: 100%; padding: 10px 16px; text-align: left; cursor: pointer;
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: var(--r); color: #7C4A03; font-weight: 700;
}

/* ---------- 연도별 추이 ---------- */
.trend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { margin: 0; min-width: 0; padding: 16px 20px 10px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--dep); border-radius: var(--r); }
.chart-card--total { border-top-color: var(--navy); }
.chart-card figcaption { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; min-height: 58px; font-size: 14px; color: var(--muted); }
.chart-card figcaption b { margin-right: 4px; font-size: 16px; color: var(--ink); }
.chart-card .legend { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 12px; }
.chart-card .legend .dot { margin-right: 4px; }
.legend__proj[hidden] { display: none; }
.trend__hint { margin: -8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.chart { width: 100%; min-height: 270px; }
.chart svg { display: block; overflow: visible; }
.chart .base { stroke: var(--line); }
.chart .hit { fill: transparent; }
.chart .bar { cursor: pointer; outline: none; }
.chart .col { transition: fill .15s; }
.chart .val { font-size: 13px; font-weight: 700; fill: var(--ink-2); text-anchor: middle; }
.chart .val__u { font-size: 10.5px; font-weight: 500; fill: var(--muted); }
.chart .xl { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.chart .is-sel .val { font-size: 14px; font-weight: 800; fill: var(--ink); }
.chart .is-sel .xl { font-weight: 800; fill: var(--ink); }
.chart .bar:focus-visible .xl { text-decoration: underline; }
.chart .compact .val, .chart .compact .is-sel .val { font-size: 10px; }
.chart .compact .val__u { font-size: 8.5px; }
.chart .compact .xl { font-size: 10.5px; }
.chart-card--dep .col { fill: var(--dep-soft); }
.chart-card--dep .bar:hover .col { fill: #8FA3C6; }
.chart-card--dep .is-sel .col { fill: var(--dep); }
.chart-card--total .seg--dep { fill: var(--dep-soft); }
.chart-card--total .seg--svc { fill: var(--svc-soft); }
.chart-card--total .bar:hover .seg--dep { fill: #8FA3C6; }
.chart-card--total .bar:hover .seg--svc { fill: #7FBDB9; }
.chart-card--total .is-sel .seg--dep { fill: var(--dep); }
.chart-card--total .is-sel .seg--svc { fill: var(--svc); }

/* Project 비용 (LNIC 등): 반투명 노란 해치 — 아래 막대 색이 비쳐 보이게 */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dot--proj { background: repeating-linear-gradient(45deg, rgba(250, 204, 21, .25) 0 2px, rgba(202, 138, 4, .7) 2px 3.5px); box-shadow: inset 0 0 0 1px #CA8A04; }
.chart .proj { fill: url(#projHatch); stroke: #CA8A04; stroke-width: 1; stroke-opacity: .7; pointer-events: none; }
.chart .proj__v { font-size: 11px; font-weight: 800; fill: #8A5A00; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.chart .proj__v.is-in { text-anchor: middle; }
/* 기타 Project (LNIC와 별도): 붉은 빗금 */
.dot--other { background: repeating-linear-gradient(-45deg, rgba(248, 113, 113, .22) 0 2px, rgba(220, 38, 38, .7) 2px 3.5px); box-shadow: inset 0 0 0 1px #DC2626; }
.chart .proj.proj--other { fill: url(#otherHatch); stroke: #DC2626; }
.chart .proj__v.proj--other { fill: #B91C1C; }
.legend__other[hidden] { display: none; }
.proj-foot { line-height: 1.6; }
.proj-foot .dot { margin-right: 4px; vertical-align: -1px; }
.proj-foot .other { color: #B91C1C; }
.chart .proj__u { font-size: 9px; font-weight: 600; }
.chart .compact .proj__v { font-size: 9px; }
.chart .compact .proj__u { font-size: 7.5px; }
.proj-sum { padding: 6px 12px; border: 1px solid #F1D48A; border-radius: var(--r); background: #FFFBEB; text-align: right; }
.proj-sum:empty, .proj-foot:empty { display: none; }
.proj-sum__head { margin: 0; font-size: 12px; font-weight: 700; color: #8A5A00; white-space: nowrap; }
.proj-sum__head .dot { margin-right: 5px; vertical-align: -1px; }
.proj-sum__head small { margin-left: 4px; font-weight: 500; color: var(--muted); }
.proj-sum__value { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; color: #7A4F06; font-variant-numeric: tabular-nums; }
.proj-foot { margin: 4px 0 2px; font-size: 12px; color: #7A4F06; }
.hero__proj { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 10px 0 0; padding: 7px 12px; border-left: 3px solid #CA8A04; border-radius: 4px; background: #FFFBEB; font-size: 13px; color: #7A4F06; }
.hero__proj .dot { align-self: center; }
.hero__proj b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero__proj small { flex-basis: 100%; font-size: 12px; color: #8A6A2A; }
.proj-note { color: #7A4F06; }
.proj-note .dot { margin-right: 4px; vertical-align: -1px; }
.tbl td small.proj-tag { font-weight: 700; color: #8A5A00; }
.tbl .spend-col { font-size: 13px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .spend-col .u { margin-right: 2px; }
.tbl thead th small { font-weight: 500; }

/* 비교 연도 대비 변동 항목: 빨간 테두리 (행 전체를 감싸는 사각형) */
.tbl tbody tr.is-chg > * { box-shadow: inset 0 2px 0 var(--chg), inset 0 -2px 0 var(--chg); }
.tbl tbody tr.is-chg > :first-child { box-shadow: inset 2px 0 0 var(--chg), inset 0 2px 0 var(--chg), inset 0 -2px 0 var(--chg); }
.tbl tbody tr.is-chg > :last-child { box-shadow: inset -2px 0 0 var(--chg), inset 0 2px 0 var(--chg), inset 0 -2px 0 var(--chg); }
.tbl td small.chg-note { font-weight: 700; color: var(--chg); }
.chg-legend { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--chg); }
.chg-legend i { display: inline-block; width: 16px; height: 10px; border: 2px solid var(--chg); border-radius: 2px; }
.tag--proj { background: #FEF3C7; color: #7A4F06; }

/* ---------- 상세 내역 ---------- */
.detail { display: grid; gap: 16px; padding: 20px 24px 24px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--r); }
.detail[hidden] { display: none; }
.detail__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.detail__head h2 { margin: 0 auto 0 0; font-size: 20px; }
.search input { width: 200px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); }

.sub { min-width: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.sub__head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "title title title" "total note chips";
  align-items: end; gap: 2px 28px; margin-bottom: 12px;
}
.sub__title { grid-area: title; }
.sub__title h3 { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--ink-2); }
.sub--dep .sub__title h3 { color: var(--dep); }
.sub--svc .sub__title h3 { color: var(--svc); }
.sub__total { grid-area: total; margin: 0; font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--em); white-space: nowrap; }
.sub__total .cur, .sub__total .unit { color: #D26A6F; }
.sub__note { grid-area: note; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.sub__note b { color: var(--ink-2); }
.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.chip b { margin-left: 2px; font-weight: 700; }
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.tbl thead th { background: var(--head); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tbl thead th.em { color: var(--em); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: #F6F8FB; }
.tbl tbody th.name { font-weight: 600; min-width: 200px; }
.tbl td small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl td.em { font-size: 15px; font-weight: 800; color: var(--ink); background: #FFFAFA; }
.tbl .nowrap { white-space: nowrap; }
.tbl tfoot th, .tbl tfoot td { background: var(--head); border-top: 2px solid var(--line); border-bottom: 0; font-weight: 800; }
.tbl tfoot td.em { color: var(--em); font-size: 16px; }
.tbl .unit-note { font-size: 11px; font-weight: 400; color: var(--muted); }
.tbl tr.empty td { padding: 24px; text-align: center; color: var(--muted); cursor: default; }
.share-col { width: 170px; }
.share { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.share__bar { flex: 1; height: 8px; overflow: hidden; border-radius: 4px; background: var(--line-2); }
.share__bar i { display: block; height: 100%; background: var(--dep); }
.sub--svc .share__bar i { background: var(--svc); }
.share__pct { width: 44px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.remark { font-size: 12px; color: var(--muted); white-space: pre-line; min-width: 160px; }
#svcTable .remark { width: 30%; }
.dim { color: #94A3B8; }
.warn { color: var(--amber); font-weight: 700; white-space: nowrap; }
.raw { font-family: Consolas, "D2Coding", monospace; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #EEF1F5; color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; }

.st { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st--active { background: #E3F4EA; color: var(--green); }
.st--planned { background: #E9EEFF; color: #3730A3; }
.st--done { background: #EEF0F3; color: #4B5563; }
.st--check { background: var(--amber-bg); color: var(--amber); }

tr.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 40% { background: #FFF1BF; } 100% { background: transparent; } }

/* ---------- DATA CHECK ---------- */
.check { background: var(--head); border: 1px solid var(--line); border-radius: var(--r); }
.check--warn { border-left: 4px solid var(--amber-line); }
.check summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 16px; cursor: pointer; list-style: none; }
.check summary::-webkit-details-marker { display: none; }
.check__title { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--navy); }
.pill { font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill--ok { color: var(--green); }
.pill--warn { color: var(--amber); }
.pill--info { color: var(--muted); }
.check__more { margin-left: auto; font-size: 12px; color: var(--muted); }
.check__more::after { content: ' ▾'; }
.check[open] .check__more::after { content: ' ▴'; }
.check__body { padding: 4px 16px 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
.check__list, .check__notes { margin: 8px 0 0; padding: 0; list-style: none; }
.check__list li { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.check__list button { padding: 0; border: 0; background: none; color: #1D4ED8; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.check__list em { font-style: normal; font-weight: 700; color: var(--amber); margin-right: 4px; }
.check__notes li { padding: 3px 0; color: var(--green); }
.check__notes li.is-bad { color: var(--amber); }
.check__notes li.is-info { color: var(--muted); }

/* ---------- Drawer ---------- */
.drawer-wrap[hidden] { display: none; }
.drawer__backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(11, 27, 54, .3); }
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 40; width: min(600px, 100vw); overflow-y: auto;
  padding: 24px 28px 36px; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(11, 27, 54, .12);
}
.drawer h2 { margin: 4px 40px 10px 0; font-size: 22px; line-height: 1.3; }
.drawer__close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.dw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag--line { background: #fff; border: 1px solid var(--line); font-weight: 600; }
/* 핵심 금액 */
.dw-kpi { margin-bottom: 12px; padding: 16px 20px; background: #FFF6F6; border: 1px solid #F5D3D5; border-radius: var(--r); }
.dw-kpi__label { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dw-kpi__value { margin: 2px 0 0; font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--em); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dw-kpi__value .cur { margin-right: 6px; font-size: .45em; color: #D26A6F; }
.dw-kpi__value .unit { margin-left: 6px; font-size: .36em; color: #D26A6F; letter-spacing: 0; }
.dw-kpi__sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.dw-kpi--na { background: var(--head); border-color: var(--line); }
.dw-kpi__na { margin: 4px 0 0; font-size: 20px; font-weight: 800; color: var(--ink-2); }
/* 요약 타일 */
.dw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 18px; }
.dw-tile { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.dw-tile span { display: block; font-size: 11px; color: var(--muted); }
.dw-tile b { display: block; margin-top: 3px; font-size: 15px; font-weight: 700; color: var(--ink); white-space: pre-line; font-variant-numeric: tabular-nums; }
.dw-tile b small, .dw-sum small { font-size: 11px; font-weight: 500; color: var(--muted); }
/* 상각 진행 */
.dw-progress { margin-bottom: 18px; }
.dw-progress__top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.dw-progress__top b { color: var(--ink); }
.dw-progress__bar { height: 10px; overflow: hidden; border-radius: 5px; background: var(--line-2); }
.dw-progress__bar i { display: block; height: 100%; background: var(--dep); }
/* 섹션 · 막대 그래프 */
.dw-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.dw-sec h3 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.dw-sec h3 small { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
.mbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.mbar { display: flex; flex-direction: column; align-items: center; height: 170px; }
.mbar__v { min-height: 30px; font-size: 12px; font-weight: 800; line-height: 1.15; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.mbar__v small { display: block; font-size: 9px; font-weight: 500; color: var(--muted); }
.mbar__track { display: flex; flex: 1; align-items: flex-end; justify-content: center; width: 100%; border-bottom: 1px solid var(--line); }
.mbar__track i { display: block; width: 70%; max-width: 30px; border-radius: 3px 3px 0 0; }
.mbar__m { margin-top: 5px; font-size: 11px; color: #94A3B8; }
.mbar.has .mbar__m { font-weight: 700; color: var(--ink-2); }
.mbars--svc .mbar__track i { background: var(--svc); }
.mbars--dep .mbar__track i { background: var(--dep-soft); }
.mbars--dep .is-sel .mbar__track i { background: var(--dep); }
.mbars--svcy .mbar__track i { background: var(--svc-soft); }
.mbars--svcy .is-sel .mbar__track i { background: var(--svc); }
:is(.mbars--dep, .mbars--svcy) .is-sel .mbar__m { color: var(--ink); font-weight: 800; }
:is(.mbars--dep, .mbars--svcy) .mbar:not(.is-sel) .mbar__v { font-weight: 600; color: var(--muted); }
.dw-sum { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.dw-sum b { font-size: 15px; color: var(--ink); }
.dw-note { margin: 8px 0 0; padding: 8px 12px; background: var(--head); border-left: 3px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--muted); }
.dw-raw { margin-top: 20px; font-size: 12px; }
.dw-raw summary { cursor: pointer; color: var(--muted); }
.dw-raw .mini { margin-top: 8px; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 9px 14px; margin: 0; }
.kv dt { font-size: 12px; color: var(--muted); padding-top: 1px; }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; white-space: pre-line; }
.kv small { display: block; font-size: 11px; color: var(--muted); }
.issues { margin: 0 0 14px; padding: 10px 12px; list-style: none; background: var(--amber-bg); border-radius: var(--r); font-size: 13px; }
.issues li + li { margin-top: 4px; }
.issues b { color: var(--amber); margin-right: 4px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini th, .mini td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.mini.src th { width: 34%; color: var(--muted); font-weight: 600; }
.mini.src .addr { width: 56px; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.mini.src td:last-child { white-space: pre-line; }

/* ---------- Tooltip ---------- */
.tip {
  position: fixed; z-index: 60; max-width: 380px; padding: 6px 10px; border-radius: 4px;
  background: var(--navy); color: #fff; font-size: 12px; line-height: 1.5; white-space: pre-line; pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ---------- Messages ---------- */
.error-card { padding: 16px 20px; background: #fff; border: 1px solid #F3C1C1; border-left: 4px solid var(--em); border-radius: var(--r); }
.error-card h2 { margin: 0 0 6px; font-size: 16px; color: #9B2226; }
.error-card p { margin: 0; white-space: pre-line; }
.section-error { padding: 12px 14px; margin-top: 8px; background: var(--amber-bg); border-radius: 4px; color: #7C2D12; font-size: 13px; }
.section-error small { display: block; margin-top: 2px; color: #92400E; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; background: #FFF7E6; border: 1px solid var(--amber-line); border-radius: var(--r); font-size: 13px; }
.is-error .hero, .is-error #alert, .is-error .trend, .is-error .trend__hint, .is-error .detail { display: none; }

/* ---------- Footer ---------- */
.foot { font-size: 12px; color: var(--muted); }
.foot summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.foot ul { margin: 8px 0 0; padding-left: 18px; }
.admin { margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--r); background: #fff; }
.admin p { margin: 6px 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero, .trend { grid-template-columns: 1fr; }
  .sub__head { grid-template-columns: 1fr; grid-template-areas: "title" "total" "note" "chips"; }
  .chips { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .top, main { padding-left: 16px; padding-right: 16px; }
  .top h1 { font-size: 17px; }
  .top__controls { width: 100%; }
  .updated { text-align: left; }
  .hero, .detail { padding: 16px; }
  .hero__value { font-size: 42px; }
  .split__legend { grid-template-columns: 1fr; }
  .sub__total { font-size: 34px; }
  .search, .search input { width: 100%; }
  .check__list li { grid-template-columns: 1fr; gap: 2px; }
  .kv { grid-template-columns: 100px 1fr; }
}

/* ---------- Print / PDF (A4 Landscape) ---------- */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10px; }
  .no-print, .drawer-wrap, .tip, #check, #banner, #alert { display: none !important; }
  .print-only { display: inline; }
  .top { position: static; padding: 0 0 6px; background: #fff; color: var(--ink); border-bottom: 2px solid var(--navy); }
  .top h1 { font-size: 16px; color: var(--navy); }
  .top .eyebrow, .top__meta, .updated { color: var(--muted); }
  .updated strong { color: var(--ink); }
  main { max-width: none; padding: 10px 0 0; gap: 10px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding: 14px 18px; }
  .hero__value { font-size: 44px; }
  .trend { grid-template-columns: repeat(2, minmax(0, 1fr)); break-inside: avoid; }
  .chart { min-height: 0; }
  .chart svg { height: auto; }
  .detail { break-before: page; padding: 12px 16px; border: 0; }
  .sub--svc { break-before: page; }
  .sub__head { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "title title" "total note"; }
  .sub__total { font-size: 32px; }
  .table-wrap { overflow: visible; }
  .tbl th, .tbl td { padding: 2px 6px; }
  .tbl td.em { font-size: 11px; }
  .remark { font-size: 9px; line-height: 1.25; }
  .tbl tr { break-inside: avoid; }
  .tbl thead { display: table-header-group; }
  .tbl tfoot { display: table-row-group; } /* 합계는 표 끝에 한 번만 */
  .tbl tbody th.name { min-width: 0; }
  .tbl td small { display: inline; margin-left: 4px; }
  .share { min-width: 90px; }
}
