:root {
  --ink: #1b2430;
  --ink-2: #4a5566;
  --ink-3: #7a8494;
  --line: #e2e6ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #1f4e79;
  --accent-2: #2f6fa8;
  --low: #5b8c6b;
  --moderate: #d1a73a;
  --elevated: #dd7a2e;
  --high: #b8322a;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }

.sample-banner { background: #fff3cd; color: #6b4e00; text-align: center; padding: 8px 12px; font-weight: 600; font-size: .9rem; border-bottom: 1px solid #f0d78c; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--accent); font-size: 1.4rem; }
.brand small { display: block; color: var(--ink-3); font-size: .78rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.active { background: #e8eef5; color: var(--accent); }
.topbar nav a.nav-cta { background: var(--accent); color: #fff; }
.topbar nav a.nav-cta:hover { background: var(--accent-2); }

main { max-width: 1180px; margin: 0 auto; padding: 24px; outline: none; }
.loading { color: var(--ink-3); }
.lede { color: var(--ink-2); max-width: 760px; margin: 0 0 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.kpi .l { color: var(--ink-3); font-size: .82rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* tile map */
.tilemap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 640px; }
.tile { aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; cursor: pointer; border: none; color: var(--ink); text-decoration: none; transition: transform .1s; }
.tile span { font-weight: 500; font-size: .62rem; opacity: .85; }
.tile:hover, .tile:focus-visible { transform: scale(1.08); outline: 2px solid var(--ink); }
.legend { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: .78rem; color: var(--ink-3); flex-wrap: wrap; }
.legend i { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.map-switch { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 12px; border-radius: 8px;
  font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--ink-3); }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* tables */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.toolbar input { min-width: 220px; flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f3f6fa; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: .85rem; color: var(--ink-3); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; color: #fff; }
.pill.Low { background: var(--low); } .pill.Moderate { background: var(--moderate); color: #3a2c00; }
.pill.Elevated { background: var(--elevated); } .pill.High { background: var(--high); }
.scorebar { display: inline-flex; height: 8px; width: 90px; background: #edf0f4; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.scorebar b { display: block; height: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: #eef1f5; color: var(--ink-2); padding: 1px 7px; border-radius: 5px; font-size: .74rem; white-space: nowrap; }

.tierbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 8px 0; }
.tierbar div { height: 100%; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15, 22, 33, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; max-width: 720px; width: 100%; padding: 26px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 1.6rem; cursor: pointer; color: var(--ink-3); }
.comp { display: grid; grid-template-columns: 210px 1fr 48px; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }
.comp .track { height: 10px; background: #edf0f4; border-radius: 5px; overflow: hidden; }
.comp .track b { display: block; height: 100%; background: var(--accent); }
.flaglist { list-style: none; padding: 0; margin: 8px 0; }
.flaglist li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; font-size: .88rem; margin: 10px 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; }
.notice { background: #f1f5fa; border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; font-size: .88rem; color: var(--ink-2); margin: 12px 0; }
.method table td, .method table th { cursor: default; }
.method tbody tr { cursor: default; }
.method tbody tr:hover { background: none; }

.footer { max-width: 1180px; margin: 10px auto 30px; padding: 0 24px; color: var(--ink-3); font-size: .8rem; }

.fb-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.fb-options .card { margin: 0; }

/* feedback form */
.fb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 8px; }
.fb-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.fb-grid label.full { grid-column: 1 / -1; }
.fb-grid input, .fb-grid select, .fb-grid textarea { font: inherit; font-size: .92rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.fb-grid textarea { resize: vertical; }
.fb-grid .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .fb-grid { grid-template-columns: 1fr; } }
