:root {
  color-scheme: dark;
  --bg: #0b100d;
  --surface: #111915;
  --surface-2: #17211b;
  --line: #29362e;
  --text: #f1f3e9;
  --muted: #96a399;
  --lime: #c7f36b;
  --mint: #70d6a2;
  --amber: #f2c66d;
  --red: #ff867a;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { min-width: 280px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 72% -10%, #1b2a20 0, transparent 38%), var(--bg); }
button, a { font: inherit; }
.ambient { position: fixed; inset: 0; pointer-events: none; opacity: .15; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 72%); }

.masthead { position: relative; z-index: 2; width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--lime); color: #10170f; font: 900 22px Georgia, serif; transform: rotate(-3deg); }
.brand b { display: block; font-size: 15px; letter-spacing: .18em; }
.brand small { display: block; margin-top: 3px; font: 600 9px/1 system-ui; color: var(--muted); letter-spacing: .14em; }
.status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px #f2c66d13; }
.status[data-state="ready"] .status-dot { background: var(--mint); box-shadow: 0 0 0 5px #70d6a213; }
.status[data-state="stale"] .status-dot, .status[data-state="corrected"] .status-dot, .status[data-state="corrected-stale"] .status-dot { background: var(--amber); }
.status[data-state="error"] .status-dot { background: var(--red); }

main { position: relative; width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.hero { min-height: 380px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 80px; align-items: end; padding: 78px 0 58px; }
.eyebrow { margin: 0 0 14px; font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--lime); text-transform: uppercase; }
h1 { margin: 0; max-width: 720px; font-size: clamp(42px, 7vw, 82px); line-height: .99; letter-spacing: -.065em; }
h1 em { color: var(--lime); font-style: normal; }
.hero-copy { max-width: 590px; margin: 24px 0 0; color: var(--muted); line-height: 1.75; word-break: keep-all; }
.hero-meta { border-left: 1px solid var(--line); padding-left: 28px; }
.hero-meta div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.hero-meta span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.hero-meta strong { font-size: 14px; font-weight: 650; }

.error-panel { margin: 20px 0 80px; padding: clamp(30px, 6vw, 64px); border: 1px solid #603a36; background: linear-gradient(125deg, #241715, #141916); }
.error-code { color: var(--red); font: 800 10px/1 system-ui; letter-spacing: .18em; }
.error-panel h2 { margin: 14px 0 10px; font-size: clamp(24px, 4vw, 40px); }
.error-panel p { color: var(--muted); }
.error-panel button { margin-top: 18px; padding: 12px 18px; border: 1px solid var(--red); color: var(--text); background: transparent; cursor: pointer; }
.notice { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 15px 18px; border: 1px solid #6b5830; background: #211d13; color: #dbcda8; font-size: 13px; }
.notice[hidden] { display: none; }
.notice strong { color: var(--amber); white-space: nowrap; }

.summary-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1px; margin-bottom: 20px; background: var(--line); border: 1px solid var(--line); }
.metric { position: relative; min-width: 0; padding: 28px; background: var(--surface); overflow: hidden; }
.metric > p { margin: 0 0 30px; color: var(--muted); font-size: 13px; }
.metric > strong { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric > span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.circulation { background: var(--lime); color: #11170f; }
.circulation > p, .circulation > span, .circulation .metric-foot span { color: #40532b; }
.metric-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 14px; border-top: 1px solid currentColor; color: var(--muted); font-size: 11px; opacity: .9; }
.metric-foot b { color: currentColor; font-size: 12px; }
.balance-track { height: 3px; margin-top: 22px; background: #29332d; }
.balance-track i { display: block; height: 100%; width: 50%; background: var(--mint); }

.panel { padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); background: linear-gradient(145deg, var(--surface), #0f1612); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.035em; }
.panel-heading > span { color: var(--muted); font-size: 11px; }
.privacy-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; }
.panel-intro { max-width: 700px; margin: 14px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.65; word-break: keep-all; }
.flow-panel { margin-bottom: 20px; }
.flow-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; }
.flow-columns h3 { display: flex; align-items: center; margin: 0 0 10px; font-size: 13px; }
.flow-columns h3 small { margin-left: auto; color: var(--muted); font-weight: 400; }
.legend-dot { width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; }
.legend-dot.faucet { background: var(--mint); }.legend-dot.sink { background: var(--amber); }
.flow-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.flow-row span { font-size: 13px; }.flow-row strong { font-variant-numeric: tabular-nums; }
.flow-row small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.flow-row[data-state="suppressed"] strong, .flow-row[data-state="absent"] strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.flow-bar { grid-column: 1 / -1; height: 2px; background: #253029; }.flow-bar i { display: block; height: 100%; background: var(--mint); }.sink-list .flow-bar i { background: var(--amber); }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.delta { color: var(--lime); font-size: 20px; }
.price-chart { height: 210px; margin-top: 32px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.price-chart svg { width: 100%; height: 100%; overflow: visible; }.price-chart .grid { stroke: #2a352e; stroke-width: 1; }.price-chart .area { fill: url(#area); }.price-chart .line { fill: none; stroke: var(--lime); stroke-width: 3; vector-effect: non-scaling-stroke; }.price-chart circle { fill: var(--lime); stroke: #101713; stroke-width: 3; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; }
.basket-items { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.basket-items span { padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.wealth-chart { display: grid; grid-template-columns: repeat(10, 1fr); align-items: end; gap: 6px; height: 245px; padding-top: 20px; }
.decile { min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.decile b { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 54px; overflow: hidden; }
.decile i { width: 100%; min-height: 2px; background: linear-gradient(to top, #486154, var(--mint)); }
.decile span { color: var(--muted); font-size: 9px; }.decile[data-state="suppressed"] i { height: 28% !important; background: repeating-linear-gradient(135deg, #29342d 0 4px, #1a231e 4px 8px); }.decile[data-state="suppressed"] b { writing-mode: horizontal-tb; transform: none; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 32px 0 48px; color: var(--muted); font-size: 10px; letter-spacing: .05em; }
footer p { margin: 0; }

@media (max-width: 760px) {
  .masthead, main { width: min(100% - 28px, 560px); }
  .masthead { min-height: 72px; }.status { font-size: 0; }.status-dot { width: 9px; height: 9px; }
  .hero { min-height: 0; display: block; padding: 52px 0 36px; }.hero h1 { font-size: clamp(39px, 12.5vw, 62px); }.hero-copy { font-size: 14px; }
  .hero-meta { display: grid; grid-template-columns: 1fr 1fr; margin-top: 34px; padding: 0; border-left: 0; border-top: 1px solid var(--line); }.hero-meta div { padding-right: 12px; }.hero-meta div:last-child { grid-column: 1 / -1; }
  .notice { align-items: flex-start; flex-direction: column; gap: 5px; }
  .summary-grid { grid-template-columns: 1fr; }.metric { padding: 24px; }.metric > p { margin-bottom: 18px; }.metric > strong { font-size: 46px; }
  .flow-columns, .two-column { grid-template-columns: 1fr; }.flow-columns { gap: 30px; }.panel-heading { flex-wrap: wrap; }.privacy-chip { order: -1; }
  .wealth-chart { height: 220px; gap: 4px; }.decile b { display: none; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  #dashboard:not([hidden]) { animation: reveal .45s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
}
