:root {
  --royal: #2E2FA6;
  --royal-dark: #1f2070;
  --royal-light: #eceffb;
  --ink: #16182b;
  --muted: #5a5f78;
  --line: #e2e5f0;
  --bg: #f7f8fc;
  --card: #ffffff;
  --accent: #c8a24a;
  --good: #1a7f4e;
  --bad: #b3372f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
h1, h2, h3, h4, .brand { font-family: "Space Grotesk", "Inter", sans-serif; }

nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--royal); text-decoration: none; font-size: 1.05rem; letter-spacing: .2px; }
.brand span { color: var(--ink); font-weight: 500; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .88rem; padding: 7px 11px; border-radius: 7px; font-weight: 500; }
.nav-links a:hover { background: var(--royal-light); color: var(--royal); }
.nav-links a.on { background: var(--royal); color: #fff; }

.hero { background: linear-gradient(135deg, var(--royal-dark) 0%, var(--royal) 55%, #4a4cc9 100%); color: #fff; padding: 54px 20px 46px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%); }
.hero-inner { max-width: 1140px; margin: 0 auto; position: relative; }
.hero .kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; opacity: .85; margin-bottom: 10px; }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.15; max-width: 820px; }
.hero p.sub { margin-top: 14px; max-width: 760px; opacity: .92; font-size: 1.02rem; }
.hero .chips { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.3); padding: 6px 13px; border-radius: 999px; font-size: .8rem; }

main { max-width: 1140px; margin: 0 auto; padding: 34px 20px 70px; }
section { margin-bottom: 42px; }
.section-title { font-size: 1.35rem; margin-bottom: 6px; color: var(--royal-dark); }
.section-sub { color: var(--muted); font-size: .95rem; margin-bottom: 18px; max-width: 860px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h3 { font-size: 1.02rem; margin-bottom: 8px; color: var(--royal-dark); }
.card p, .card li { font-size: .9rem; color: var(--ink); }
.card .src { display: block; margin-top: 10px; font-size: .78rem; color: var(--muted); }
.card .src a { color: var(--royal); text-decoration: none; }

.kpi { text-align: left; }
.kpi .v { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--royal); }
.kpi .l { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.neg .v { color: var(--bad); }
.kpi.pos .v { color: var(--good); }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .87rem; }
th { background: var(--royal-light); color: var(--royal-dark); text-align: left; padding: 10px 12px; font-weight: 600; }
td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: #fafbfe; }
.table-wrap { overflow-x: auto; border-radius: 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.flag-bad { color: var(--bad); font-weight: 600; }
.flag-good { color: var(--good); font-weight: 600; }

.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.ctl { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.ctl label { display: block; font-size: .8rem; font-weight: 600; color: var(--royal-dark); margin-bottom: 6px; }
.ctl output { float: right; font-weight: 700; color: var(--royal); font-family: "Space Grotesk", sans-serif; }
.ctl input[type=range] { width: 100%; accent-color: var(--royal); }
.ctl .seg { display: flex; gap: 6px; }
.ctl .seg button { flex: 1; border: 1px solid var(--line); background: #fff; padding: 7px 0; border-radius: 7px; cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--muted); }
.ctl .seg button.on { background: var(--royal); color: #fff; border-color: var(--royal); }

.note { background: var(--royal-light); border-left: 4px solid var(--royal); border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: .87rem; color: var(--ink); }
.warn { background: #fdf6e8; border-left-color: var(--accent); }

.phase { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.phase .name { width: 250px; min-width: 180px; font-size: .85rem; font-weight: 600; }
.phase .bar-track { flex: 1; background: #eef0f8; border-radius: 6px; height: 26px; position: relative; }
.phase .bar { position: absolute; height: 100%; border-radius: 6px; background: var(--royal); opacity: .88; color: #fff; font-size: .72rem; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; }
.phase .bar.gate { background: var(--accent); color: var(--ink); font-weight: 700; }
.phase .bar.review { background: #7a7ce0; }

footer { background: var(--royal-dark); color: rgba(255,255,255,.85); padding: 34px 20px; font-size: .82rem; }
.foot-inner { max-width: 1140px; margin: 0 auto; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
footer a { color: #cdd3ff; text-decoration: none; }
footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.2); padding-top: 16px; font-size: .76rem; opacity: .8; line-height: 1.6; }

.pill { display: inline-block; background: var(--royal-light); color: var(--royal-dark); font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.chart-box h3 { font-size: .98rem; color: var(--royal-dark); margin-bottom: 10px; }
@media (max-width: 640px) { .phase .name { width: 130px; } }
