:root {
  --ink: #10231b; --muted: #5b6b63; --line: #e3e9e5; --bg: #f7faf8; --card: #fff;
  --forest: #0f3d2e; --leaf: #2f7d5b; --mint: #9cc5b0; --saffron: #f5a524; --red: #d64545;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand b { display: block; font-size: 17px; }
.brand span { font-size: 12px; color: var(--muted); }
nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--forest); }
main { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; padding: 44px 0 28px; align-items: center; }
.eyebrow { color: var(--leaf); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: 38px; line-height: 1.12; margin: 0 0 14px; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; max-width: 62ch; }
.hero-card { background: var(--forest); color: #fff; border-radius: 18px; padding: 24px; display: grid; gap: 18px; }
.hero-card .kpi b { font-size: 34px; color: var(--saffron); display: block; font-variant-numeric: tabular-nums; }
.hero-card .kpi span { font-size: 13px; color: #cfe3d8; }
.panel { scroll-margin-top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-top: 22px; }
.panel-head h2 { margin: 0 0 4px; font-size: 22px; }
.panel-head p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.hidden { display: none; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.chip:hover, .chip.on { border-color: var(--leaf); background: #eef6f1; }
.ingest-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
textarea { width: 100%; height: 300px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; background: #fbfdfc; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 16px; cursor: pointer; }
button:active { transform: scale(.98); }
button.primary { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 600; }
button:disabled { opacity: .6; cursor: progress; }
.file { font-size: 14px; color: var(--muted); cursor: pointer; }
.file input { width: 190px; }
.trace { list-style: none; margin: 0; padding: 12px; height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #0c1f17; color: #d6e8de; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.trace li { padding: 2px 0; animation: in .25s ease-out; }
.trace li.ok::before { content: "✓ "; color: #6fd29b; }
.trace li.warn { color: #ffcf7a; } .trace li.warn::before { content: "! "; }
.trace li.sub { padding-left: 18px; color: #a9c4b6; }
.trace li.muted { color: #7f9a8c; }
.trace b { color: #fff; }
@keyframes in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis.small { grid-template-columns: repeat(2, 1fr); }
.kpi-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfdfc; }
.kpi-card span { font-size: 12px; color: var(--muted); display: block; }
.kpi-card b { font-size: 24px; display: block; margin: 4px 0; font-variant-numeric: tabular-nums; color: var(--forest); }
.kpi-card small { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card h3 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.bar { display: grid; grid-template-columns: 170px 1fr 54px; gap: 10px; align-items: center; font-size: 12.5px; margin: 8px 0; }
.bar .track { background: #eef3f0; border-radius: 6px; height: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; transition: width .3s ease; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }
.tbl th, .tbl td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.tot td { font-weight: 700; border-bottom: none; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: #eef3f0; }
.chart .ax { font-size: 10px; fill: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.note { font-size: 12px; color: var(--muted); }
.insights { margin-top: 16px; }
.insights ul { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 14px; }
.lever { margin-bottom: 16px; }
.lever label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.lever label b { color: var(--leaf); font-variant-numeric: tabular-nums; }
.lever input { width: 100%; accent-color: var(--forest); }
.lever small { color: var(--muted); font-size: 12px; }
pre { background: #0c1f17; color: #d6e8de; border-radius: 12px; padding: 14px; max-height: 360px; overflow: auto; font-size: 12px; }
footer { max-width: 1180px; margin: 0 auto; padding: 10px 24px 40px; color: var(--muted); font-size: 12px; }
@media (max-width: 860px) {
  .hero, .ingest-grid, .two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  nav { display: none; }
  h1 { font-size: 28px; }
}
@media print { .top, #ingest, #plan, .row { display: none; } .panel { break-inside: avoid; } }
@media (prefers-reduced-motion: reduce) { .trace li { animation: none; } .bar i { transition: none; } }

.lang { margin-left: 18px; padding: 5px 12px; font-size: 13px; border-radius: 999px; }
.scenario { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: end; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; margin-bottom: 14px; background: #fbfdfc; }
.scenario label { font-size: 13px; color: var(--muted); display: block; }
.scenario label b { color: var(--forest); }
.scenario input { width: 100%; accent-color: var(--forest); }
.conf { text-align: center; min-width: 150px; }
.conf b { display: block; font-size: 26px; color: var(--leaf); font-variant-numeric: tabular-nums; }
.conf span { font-size: 12px; color: var(--muted); }
.rows { display: grid; gap: 8px; font-size: 13.5px; }
.rows div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.rows div b { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; margin: 8px 6px 0 0; background: #eef6f1; color: var(--forest); font-weight: 600; }
.tag.warn { background: #fdecec; color: var(--red); }
.letter { white-space: pre-wrap; background: #fbfdfc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12.5px; line-height: 1.55; margin: 8px 0; }
@media (max-width: 860px) { .scenario { grid-template-columns: 1fr; } }
