/* ============================================================================
   TSDIS Portal — visual system
   Design thesis: an official wayfinding instrument for the PNG transport sector.
   Signature: mode "lanes" (Road / Maritime / Aviation) as a consistent colour
   system, plus instrument-grade tabular numerics. Institutional navy chrome,
   document-paper ground, hairline rhythm. No JS, no webfonts — low-bandwidth.
   ============================================================================ */
/* Display face — Archivo (signage grotesque), self-hosted, headings only.
   Variable weight 600-800, Latin subset (~34KB). font-display: swap so a
   slow connection paints text immediately in the system fallback. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/static/fonts/archivo-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  /* Institutional chrome */
  --navy: #0b3d5c;
  --navy-deep: #072a40;
  --accent: #c8102e;          /* PNG red — brand keyline only, used sparingly */

  /* Ground & structure */
  --paper: #f3f2ee;           /* faint document stock — not SaaS-grey, not cream */
  --surface: #ffffff;
  --ink: #172029;             /* primary text */
  --line: #e0e2e0;            /* hairlines */
  --line-strong: #c5cace;
  --muted: #536068;           /* WCAG AA on paper/white (>=4.5:1) */

  /* Mode lanes — the signature. Colour IS the transport mode. */
  --road: #a85a17;            /* bitumen / kilometre-post ochre */
  --maritime: #0e6a80;        /* nautical chart teal */
  --aviation: #3a4c99;        /* altitude indigo */
  --road-tint: #f6efe6;
  --maritime-tint: #e8f2f4;
  --aviation-tint: #ecedf7;

  /* Status (RAG) — AA-safe */
  --ok: #1b7f3b;
  --warn: #8a5a00;
  --bad: #b3261e;

  /* Type roles */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(11, 61, 92, 0.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans);
  color: var(--ink); background: var(--paper); line-height: 1.5;
}
a { color: var(--navy); }
a:hover { color: var(--navy-deep); }
.muted { color: var(--muted); }
/* Data reads like an instrument: figures align in columns everywhere it matters */
table.grid, .stat .num, ul.kv, .tier, .summary { font-variant-numeric: tabular-nums; }
code, .tier {
  font-family: var(--mono); background: #eef1f2; padding: 1px 5px;
  border-radius: 4px; font-size: 0.86em; color: #33424c;
}

/* ---- Protective marking (top & bottom, full width) ---------------------- */
.protective-marking {
  background: #26333b; color: #eef1f2; text-align: center;
  font-family: var(--display); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; padding: 0.32rem 1rem;
}

/* ---- Government masthead: parent authority + crest ---------------------- */
.masthead {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface); padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.masthead .crest { height: 54px; width: auto; flex: none; object-fit: contain; }
.masthead .authority { line-height: 1.25; }
.masthead .authority .nation {
  display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted);
}
.masthead .authority .dept {
  display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 800;
  color: var(--navy); letter-spacing: -0.01em;
}

/* ---- Top chrome: institutional bar with a PNG-red keyline ---------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--navy); color: #fff; padding: 0.7rem 1.5rem;
  border-bottom: 2px solid var(--accent);
}
.brand { display: flex; align-items: baseline; }
.brand-mark { font-family: var(--display); font-weight: 800; letter-spacing: 2px; font-size: 1.2rem; }
.brand-sub { margin-left: 0.7rem; font-size: 0.78rem; opacity: 0.82; letter-spacing: 0.2px; }
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  color: #eaf1f6; margin-left: 1.15rem; text-decoration: none;
  font-size: 0.9rem; padding: 0.15rem 0; border-bottom: 2px solid transparent;
}
.topbar nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.6); }
.topbar .who { margin-left: 1.25rem; font-size: 0.82rem; opacity: 0.85; }

.container { max-width: 1000px; margin: 1.75rem auto; padding: 0 1.5rem; }

/* ---- Wayfinding kicker + headings ---------------------------------------- */
.kicker {
  display: block; font-family: var(--display); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); margin: 0 0 0.35rem;
}
/* Mode kickers stay institutional navy; the mode is shown by a small dot. */
h1 {
  margin: 0.1rem 0 0.5rem; font-family: var(--display); font-size: 2.05rem; font-weight: 800;
  letter-spacing: -0.015em; line-height: 1.1;
}
h2 { font-family: var(--display); font-size: 1.08rem; font-weight: 700; margin: 0 0 0.7rem; letter-spacing: -0.005em; }
h3 { font-family: var(--display); font-size: 0.98rem; font-weight: 700; margin: 0 0 0.35rem; }
.lede { color: var(--muted); max-width: 62ch; margin: 0.2rem 0 0.6rem; }
.meta { color: var(--muted); margin: 0.2rem 0; }

/* ---- Cards + mode lanes (the signature) --------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.35rem; margin: 1.1rem 0;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 440px; margin: 2.5rem auto; }
.mode-road { border-left: 3px solid var(--road); }
.mode-maritime { border-left: 3px solid var(--maritime); }
.mode-aviation { border-left: 3px solid var(--aviation); }

/* mode dot — used in coverage tables to tie a row to its lane */
.mode-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 0.45rem; vertical-align: baseline; background: var(--muted);
}
.mode-dot.road { background: var(--road); }
.mode-dot.maritime { background: var(--maritime); }
.mode-dot.aviation { background: var(--aviation); }

/* ---- Forms -------------------------------------------------------------- */
label { display: block; margin: 0.5rem 0 0.6rem; font-weight: 600; }
input, select, button, textarea { font: inherit; }
input[type=text], input[type=email], input[type=number], input[type=date],
input[type=password], select, textarea {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font-weight: 400; margin-top: 0.25rem;
  background: #fff; color: var(--ink);
}
input:hover, select:hover { border-color: var(--muted); }
input[type=file] { margin: 0.4rem 0 0.8rem; }
button, .btn {
  display: inline-block; background: var(--navy); color: #fff; border: 0;
  padding: 0.55rem 1.05rem; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; font-weight: 600; letter-spacing: 0.01em;
}
button:hover, .btn:hover { background: var(--navy-deep); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--navy); }
.req { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.35rem; }
.form-grid button { grid-column: 1 / -1; justify-self: start; margin-top: 0.6rem; }
.form-grid select, .form-grid input { width: 100%; }

/* ---- Tables: the control board ------------------------------------------ */
table.grid { width: 100%; border-collapse: collapse; }
table.grid caption { text-align: left; }
table.grid th, table.grid td {
  text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.grid thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); border-bottom: 1.5px solid var(--line-strong);
  font-weight: 700;
}
table.grid tbody tr:hover { background: #f7f9fa; }
table.grid.small { font-size: 0.9rem; }
.grid th.nowrap, .grid td.nowrap { white-space: nowrap; }
.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Tags & tiers ------------------------------------------------------- */
.tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.75rem;
  background: #e9edf0; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.tag-ok { background: #e0f1e6; color: var(--ok); }
.tag-bad { background: #fbe5e3; color: var(--bad); }
.tag-warn { background: #fbf0da; color: var(--warn); }
.tag-public { background: #e0f1e6; color: var(--ok); }
.tag-internal { background: #e9edf0; color: var(--navy); }
.tag-restricted { background: #fbf0da; color: var(--warn); }
.tag-confidential { background: #fbe5e3; color: var(--bad); }

/* ---- Alerts ------------------------------------------------------------- */
.alert { padding: 0.75rem 0.95rem; border-radius: var(--radius); border-left: 3px solid transparent; }
.alert.ok { background: #e6f4ec; color: #135e2c; border-left-color: var(--ok); }
.alert.error { background: #fbeae8; color: #8f1c16; border-left-color: var(--bad); }
.alert.warn { background: #fbf0da; color: var(--warn); border-left-color: var(--warn); }
.alert code { background: transparent; word-break: break-all; }

/* ---- Instrument stat tiles ---------------------------------------------- */
.summary { display: flex; gap: 0.9rem; margin: 1.1rem 0; flex-wrap: wrap; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong); border-radius: var(--radius);
  padding: 0.85rem 1.2rem; min-width: 128px; flex: 1; box-shadow: var(--shadow);
}
.stat .num {
  display: block; font-family: var(--display); font-size: 1.95rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.stat .den { font-size: 0.58em; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.stat .lbl {
  display: block; margin-top: 0.25rem; font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
}
.stat.ok { border-top-color: var(--ok); }
.stat.ok .num { color: var(--ok); }
.stat.bad { border-top-color: var(--bad); }
.stat.bad .num { color: var(--bad); }

/* ---- Summary: mode columns + key/value lists ---------------------------- */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.cols3 > div { padding-left: 0.75rem; border-left: 2px solid var(--line-strong); }
.cols3 h3 { margin: 0 0 0.4rem; display: flex; align-items: center; }
.cols3 h3 .kicker { margin: 0; }
ul.kv { list-style: none; margin: 0 0 0.6rem; padding: 0; }
ul.kv li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
ul.kv li:last-child { border-bottom: 0; }

/* ---- Misc --------------------------------------------------------------- */
ul.issues { margin: 0.2rem 0; padding-left: 1.1rem; }
ul.issues li { margin: 0.15rem 0; }
.row-bad { background: #fdf3f2; }
.hint ul { font-size: 0.85rem; }
.footer {
  text-align: center; color: var(--muted); font-size: 0.8rem; padding: 2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--line); margin-top: 2rem;
}
#map { height: 520px; border: 1px solid var(--line); border-radius: var(--radius); }

/* Back-link above detail pages */
.backlink { font-size: 0.88rem; margin: 0 0 0.5rem; }
.backlink a { text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

/* Secondary (Operations Unit) nav — a hairline bar under the section links */
.admin-nav {
  margin: 0 0 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
  font-size: 0.88rem; color: var(--muted);
}
.admin-nav a { margin-right: 0.15rem; text-decoration: none; }
.admin-nav a:hover { text-decoration: underline; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }
details summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.stack form { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.stack input, .stack select { width: auto; }
.row-actions { display: flex; gap: 0.3rem; }

/* ============================================================================
   Accessibility floor — kept from the WCAG 2.2 AA pass
   ============================================================================ */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 0.5rem 0.9rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #ffbf47; outline-offset: 2px;
}

/* ---- Inline help / guidance box ----------------------------------------- */
.help {
  background: var(--maritime-tint); border: 1px solid #cfe0ea;
  border-left: 4px solid var(--maritime);
  border-radius: var(--radius); padding: 0.85rem 1.05rem; margin: 1.1rem 0; color: var(--ink);
}
.help ol { margin: 0.4rem 0 0.4rem 1.1rem; }
.help li { margin: 0.2rem 0; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 800px) {
  .cols3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .topbar nav a:first-child { margin-left: 0; }
  h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- AI layer: answers carry their provenance ----------------------------- */
.ai-badge { display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; padding:.12rem .45rem; border:1px solid var(--navy); color:var(--navy);
  border-radius:3px; vertical-align:middle; }
.ai-answer { white-space:pre-wrap; line-height:1.55; border-left:4px solid var(--navy);
  padding:.75rem 1rem; background:var(--surface); margin:.75rem 0; }
.ai-ask textarea { width:100%; min-height:5rem; font:inherit; padding:.6rem; box-sizing:border-box; }
.ai-examples { display:flex; flex-wrap:wrap; gap:.4rem; margin:.5rem 0 0; padding:0; list-style:none; }
.ai-examples a { display:inline-block; font-size:.88rem; padding:.3rem .6rem; border:1px solid var(--line-strong);
  border-radius:999px; text-decoration:none; color:var(--ink); background:var(--surface); }
.ai-examples a:hover, .ai-examples a:focus-visible { border-color:var(--navy); }
.ai-trace { font-size:.88rem; }
.ai-trace code { font-size:.8rem; word-break:break-word; }
.ai-inline { display:inline; }
.ai-inline button { margin-right:.3rem; }
.map-table select { max-width:100%; }
.conf-high { color:var(--ok); font-weight:600; }
.conf-mid { color:var(--warn); font-weight:600; }
.conf-none { color:var(--muted); }

/* ===========================================================================
   Usability layer (2026-10): task-first navigation, Home, one upload path.
   =========================================================================== */
.small { font-size: 0.86rem; }
.brand { text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }

/* ---- Main navigation: plain links + two <details> menus (no JS needed) ---- */
.topbar nav { gap: 0.15rem 0; }
.topbar nav > a, .navmenu > summary {
  color: #eaf1f6; margin-left: 1.1rem; text-decoration: none; font-size: 0.92rem;
  padding: 0.2rem 0; border-bottom: 2px solid transparent; list-style: none; cursor: pointer;
}
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary::after { content: " \25BE"; font-size: 0.75em; opacity: 0.8; }
.topbar nav > a:hover, .navmenu > summary:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.6); }
.topbar nav > a[aria-current="page"], .navmenu > summary[aria-current="page"] {
  color: #fff; border-bottom-color: #fff; font-weight: 600;
}
.navmenu { position: relative; display: inline-block; }
.navmenu .menu {
  position: absolute; top: calc(100% + 0.55rem); left: 0.6rem; z-index: 20; min-width: 300px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(7, 42, 64, 0.16); padding: 0.35rem;
}
.navmenu.right .menu { left: auto; right: 0; min-width: 220px; }
.navmenu .menu a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 4px; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 0.92rem; margin: 0; border-bottom: 0;
}
.navmenu .menu a span { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.navmenu .menu a:hover, .navmenu .menu a:focus-visible { background: #eef3f6; color: var(--navy); }
.navmenu.right > summary { font-size: 0.84rem; opacity: 0.9; }

/* ---- Home --------------------------------------------------------------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-left-width: 4px;
  border-radius: var(--radius); margin-bottom: 0.5rem; background: var(--surface);
}
.task.overdue { border-left-color: var(--bad); }
.task.due_soon { border-left-color: var(--warn); }
.task .when { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.tasks.compact .task { padding: 0.45rem 0.7rem; border-left-width: 1px; }
.done { font-size: 1.02rem; color: var(--ok); margin: 0.2rem 0; }
.done span { font-weight: 800; margin-right: 0.3rem; }
details.later { margin-top: 0.6rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin: 1.1rem 0; }
.tile {
  display: block; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: var(--radius); padding: 0.85rem 0.9rem; text-decoration: none; color: var(--ink);
}
.tile strong { display: block; color: var(--navy); font-family: var(--display); margin-bottom: 0.2rem; }
.tile span { font-size: 0.86rem; color: var(--muted); }
.tile:hover, .tile:focus-visible { border-color: var(--navy); box-shadow: 0 2px 8px rgba(11, 61, 92, 0.12); }
a.stat.link { text-decoration: none; color: inherit; }
a.stat.link:hover { box-shadow: 0 2px 8px rgba(11, 61, 92, 0.12); }
.score {
  display: inline-block; min-width: 2.6em; text-align: center; font-family: var(--display);
  font-weight: 800; font-size: 1.4rem; padding: 0.1rem 0.4rem; border-radius: var(--radius);
}
.score.ok { background: #e0f1e6; color: var(--ok); }
.score.bad { background: #fbe5e3; color: var(--bad); }

/* ---- Dataset page: one obvious way to send data ------------------------- */
.card.send { border-top: 3px solid var(--navy); }
.send-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.4rem; align-items: start; }
.upload-label { font-size: 1rem; margin-top: 0; }
.upload input[type=file] {
  display: block; width: 100%; padding: 0.9rem; background: #f7f9fa;
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
}
.upload input[type=file]:hover { border-color: var(--navy); }
.template-box { background: var(--paper); border-radius: var(--radius); padding: 0.9rem; }
.template-box .btn { margin: 0.2rem 0.4rem 0.2rem 0; }
details.fold > summary { list-style: none; display: block; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { display: inline; margin: 0; }
details.fold > summary h2::before { content: "\25B8  "; color: var(--muted); }
details.fold[open] > summary h2::before { content: "\25BE  "; }
details.fold > summary .muted { display: block; margin: 0.2rem 0 0; font-weight: 400; }
details.fold[open] > summary { margin-bottom: 0.8rem; }
.about ul.kv li span:first-child { display: inline-block; min-width: 11rem; color: var(--muted); }
.about .links { margin: 0.4rem 0 0; font-size: 0.9rem; }
.searchbar { display: flex; gap: 0.4rem; align-items: center; margin: 0.4rem 0 1rem; }
.searchbar input { width: 100%; max-width: 380px; }
.card.empty { text-align: left; }

/* ---- Results / next steps ------------------------------------------------ */
.next-steps { border-left: 3px solid var(--navy); }
ol.steps { padding-left: 1.2rem; margin: 0.3rem 0 0.6rem; }
ol.steps li { margin-bottom: 0.55rem; }
ol.steps li .muted { display: block; }
.alert p { margin: 0.2rem 0; }

/* ---- Help ------------------------------------------------------------------ */
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.5rem 0 1.2rem; font-size: 0.92rem; }
.glossary dt { font-weight: 700; margin-top: 0.6rem; }
.glossary dd { margin: 0.1rem 0 0; color: var(--muted); }
.code-input { font-size: 1.4rem; letter-spacing: 0.25em; max-width: 12rem; font-family: var(--mono); }

/* ---- Small screens: stack everything; menus open in place ----------------- */
@media (max-width: 800px) {
  .topbar nav > a, .navmenu > summary { margin-left: 0; margin-right: 1rem; }
  .navmenu .menu { position: static; min-width: 0; margin: 0.4rem 0; box-shadow: none; }
  .send-grid { grid-template-columns: 1fr; }
  .task { flex-direction: column; align-items: flex-start; }
  table.grid { display: block; overflow-x: auto; }
  .about ul.kv li span:first-child { min-width: 0; display: block; }
}

/* ---- Charts (server-rendered SVG, charts.py) ------------------------------ */
.chart { display: block; width: 100%; height: auto; max-width: 100%; font-family: var(--sans); }
.chartcard h2 { margin-top: 0; }
.chartcard .meta { margin-top: -0.2rem; }
.chartgrid { display: grid; gap: 1rem; margin: 1rem 0; }
.chartgrid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.chartgrid .card { margin: 0; }
.section-title { margin-top: 2rem; }
.sector-block { padding: 0.8rem 1.1rem; }
.sector-block > summary { cursor: pointer; font-size: 1.05rem; padding: 0.2rem 0; }
.minigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; margin-top: 0.8rem; }
.minichart { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.7rem; background: var(--surface); }
.minichart figcaption { font-size: 0.86rem; line-height: 1.3; min-height: 2.6em; margin-bottom: 0.3rem; }
.minichart .code { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.mini-foot { font-size: 0.8rem; margin: 0.2rem 0 0; color: var(--ink); }
.small { font-size: 0.82rem; }

/* ---- Sector map ------------------------------------------------------------ */
.maplayout { display: grid; grid-template-columns: 1fr 270px; gap: 1rem; align-items: start; margin-top: 1rem; }
#sector-map { height: 600px; border: 1px solid var(--line); border-radius: var(--radius); }
.maplegend { margin: 0; }
.maplegend h2 { margin-top: 0; font-size: 1.05rem; }
.layer-row { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0; font-size: 0.9rem; cursor: pointer; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); flex: none; }
@media (max-width: 800px) {
  .maplayout { grid-template-columns: 1fr; }
  #sector-map { height: 420px; }
  .chartgrid.two { grid-template-columns: 1fr; }
}
