/* Underlink web app: Minimal UI (Material Kit) theme with glass surfaces and top navigation.
   Palette, fonts and shadows follow minimal-ui-kit/material-kit-react (src/theme/theme-config.ts).
   Variable names used by app.js (--ink, --line, --blue, --orange, --panel, ...) are kept. */
:root {
  color-scheme: light;
  --navy: #16325C; --navy-2: #2B4F80; --sky: #EAF3FC;
  --primary: #1E6FD9; --primary-light: #6FAEF5; --primary-lighter: #D6E8FC; --primary-dark: #16325C;
  --secondary: #7B61D9; --secondary-lighter: #ECE6FB; --secondary-dark: #4B35A6;
  --info: #0EA5C6; --info-lighter: #D5F4FA; --info-dark: #0B6E85;
  --success: #22A55E; --success-lighter: #DDF6E6; --success-dark: #137A43;
  --warning: #F29A3F; --warning-lighter: #FFF0DD; --warning-dark: #A35B12;
  --error: #E4602E; --error-lighter: #FDE6DA; --error-dark: #A83A12;
  --g100: #F9FAFB; --g200: #F4F6F8; --g300: #DFE3E8; --g400: #C4CDD5; --g500: #8A96A3; --g600: #5B6878; --g700: #3D4A5A; --g800: #16325C;

  --ink: #14243B;
  --muted: #4F5E70;
  --faint: #8A96A3;
  --line: rgba(22, 50, 92, 0.12);
  --bg: #F7F9FC;
  --panel: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.9);
  --soft: rgba(22, 50, 92, 0.05);
  --orange: var(--error);
  --orange-soft: rgba(228, 96, 46, 0.12);
  --blue: var(--primary);
  --blue-soft: rgba(30, 111, 217, 0.1);
  --dark: #3D5A80;
  --focus: var(--primary);
  --radius: 16px;
  --shadow-card: 0 0 2px 0 rgba(22, 50, 92, 0.12), 0 12px 24px -4px rgba(22, 50, 92, 0.08);
  --shadow-z8: 0 8px 16px 0 rgba(22, 50, 92, 0.1);
  --blur: blur(18px) saturate(160%);
  --font: "DM Sans", "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-num: "Barlow", "DM Sans", system-ui, Arial, sans-serif;
  --blob-a: rgba(111, 174, 245, 0.28); --blob-b: rgba(246, 176, 110, 0.26); --blob-c: rgba(252, 217, 160, 0.3);
}



* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: linear-gradient(180deg, #F3F7FD 0%, #FBF8F4 60%, #FFF5EA 100%) fixed; color: var(--ink); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }  /* clip: no scroll box of its own */
/* soft colour blobs behind the glass */
body::before, body::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none; }
body::before { width: 620px; height: 620px; top: -160px; right: -120px; background: radial-gradient(circle, var(--blob-a), transparent 70%), radial-gradient(circle at 20% 80%, var(--blob-b), transparent 60%); }
body::after { width: 560px; height: 560px; bottom: -180px; left: -160px; background: radial-gradient(circle, var(--blob-c), transparent 70%); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 0.85em/1 ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 0.15em 0.4em; border-radius: 6px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 0.8em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 40px; } }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--bg); padding: 8px; z-index: 10; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* glass surface shared by cards */
.panel, .stat, .sandbox-canvas, .sandbox-side, .steps li, .tier, .product, .cycle li, .topbar {
  background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-card);
}

/* top app bar (the reference uses a side nav; this keeps navigation on top) */
.topbar { position: sticky; top: 12px; z-index: 5; margin: 12px 16px 0; border-radius: 16px; }
@media (min-width: 900px) { .topbar { margin: 12px 40px 0; } }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; padding: 4px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); font-size: 0.875rem; font-weight: 600; white-space: nowrap; padding: 6px 12px; border-radius: 8px; transition: background 0.2s, color 0.2s; }
.nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--primary); }

/* sections */
section { padding: 48px 0; }
.band { background: transparent; }
.hero { padding-top: 40px; }
.eyebrow { display: inline-block; color: var(--primary); background: var(--blue-soft); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 22ch; margin: 14px 0 12px; letter-spacing: -0.02em; font-weight: 800; }
.lead { font-size: clamp(1rem, 1.8vw, 1.125rem); max-width: 64ch; color: var(--muted); }
.section-lead { max-width: 72ch; color: var(--muted); margin-bottom: 24px; }
.note { color: var(--muted); font-size: 0.85rem; }
.label { font-size: 0.875rem; font-weight: 600; margin: 14px 0 6px; }

/* hero chain: primary gradient card with a glass sheen */
.chain-card { position: relative; overflow: hidden; margin: 28px 0 24px; border-radius: var(--radius); padding: 20px 22px 16px; color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--secondary)); box-shadow: 0 16px 32px -4px rgba(24, 119, 242, 0.32); }
.chain-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 45%); pointer-events: none; }
.chain-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 99px; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; }
.chain-card .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.12); }
.chain-scroll { position: relative; overflow-x: auto; }
#chain { width: 100%; min-width: 600px; height: auto; display: block; margin-top: 6px; }
#chain .relay { cursor: pointer; }
#chain .relay:focus-visible circle { stroke: #fff; stroke-width: 4; }
.chain-status { position: relative; font-weight: 700; margin: 4px 0 6px; min-height: 1.5em; }
.chain-card figcaption { position: relative; font-size: 0.85rem; opacity: 0.9; }

/* summary widgets (AnalyticsWidgetSummary style: soft colour, big Barlow number) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.stat .num { font: 700 2rem/1.1 var(--font-num); letter-spacing: -0.01em; }
.stat .num.orange { color: var(--error); }
.stat .num.blue { color: var(--primary); }
.stat .what { font-size: 0.875rem; color: var(--muted); margin: 8px 0 0; }
#hero-stats .stat, #works-stats .stat { border: 1px solid rgba(255, 255, 255, 0.55); }
#hero-stats .stat:nth-child(1), #works-stats .stat:nth-child(1) { background: linear-gradient(135deg, rgba(255, 233, 213, 0.85), rgba(255, 172, 130, 0.35)); }
#hero-stats .stat:nth-child(2), #works-stats .stat:nth-child(2) { background: linear-gradient(135deg, rgba(208, 236, 254, 0.85), rgba(115, 186, 251, 0.35)); }
#hero-stats .stat:nth-child(3), #works-stats .stat:nth-child(3) { background: linear-gradient(135deg, rgba(239, 214, 255, 0.85), rgba(198, 132, 255, 0.3)); }
#hero-stats .stat:nth-child(4) { background: linear-gradient(135deg, rgba(255, 245, 204, 0.9), rgba(255, 214, 102, 0.35)); }
#hero-stats .stat:nth-child(5) { background: linear-gradient(135deg, rgba(202, 253, 245, 0.85), rgba(97, 243, 243, 0.3)); }
#hero-stats .stat:nth-child(1) .num, #works-stats .stat:nth-child(1) .num { color: var(--error-dark); }
#hero-stats .stat:nth-child(2) .num, #works-stats .stat:nth-child(2) .num { color: var(--primary-dark); }
#hero-stats .stat:nth-child(3) .num, #works-stats .stat:nth-child(3) .num { color: var(--secondary-dark); }
#hero-stats .stat:nth-child(4) .num { color: var(--warning-dark); }
#hero-stats .stat:nth-child(5) .num { color: var(--info-dark); }
#hero-stats .stat .what, #works-stats .stat .what { color: var(--g700); }
#hero-stats .stat::after, #works-stats .stat::after { content: ""; position: absolute; width: 120px; height: 120px; right: -40px; top: -40px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }

/* cards */
.panel { border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel h3 { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel, .panel + .grid-2, .stats + .panel, .table-wrap + .grid-2 { margin-top: 20px; }
.callout { border-left: 4px solid var(--error); }

/* buttons and controls */
.btn, .btn-ghost { font: 700 0.875rem/1 var(--font); border-radius: 8px; padding: 9px 16px; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; }
.btn { background: var(--g800); color: #fff; border: 0; }
.btn:hover { background: var(--g700); box-shadow: var(--shadow-z8); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(145, 158, 171, 0.32); }
.btn-ghost:hover { background: var(--soft); }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 8px 0 14px; }
.seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.seg .seg-label { padding: 4px 8px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.seg button { font: 600 0.8125rem/1 var(--font); border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 7px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-z8); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.toggle input { accent-color: var(--primary); width: 16px; height: 16px; }

/* sandbox */
.sandbox { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; }
@media (max-width: 860px) { .sandbox { grid-template-columns: 1fr; } }
.sandbox-canvas, .sandbox-side { border-radius: var(--radius); padding: 18px; }
.sandbox-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 8px; }
.sandbox-scroll { overflow-x: auto; }
#sandbox { width: 100%; min-width: 520px; height: auto; display: block; }
#sandbox .node { cursor: pointer; }
#sandbox text { font: 600 12px var(--font); fill: var(--ink); }
.sb-list { list-style: none; padding: 0; margin: 0 0 12px; }
.sb-list li { border-bottom: 1px dashed var(--line); padding: 10px 0; font-size: 0.9rem; }
.sb-list .st { font-weight: 700; }
.sb-list .cut { color: var(--error-dark); }
.sb-list .ok { color: var(--primary); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.lg { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; }
.lg-fibre { background: var(--primary); border-radius: 3px; }
.lg-relay { background: var(--panel); border: 2px solid var(--ink); }
.lg-spof { background: var(--error); }
.lg-off { background: var(--line); border: 2px dashed var(--faint); }
.lg-comm { background: var(--blue-soft); border: 2px solid var(--primary); }
.lg-dark { background: var(--dark); border-radius: 3px; }
.lg-orange { background: var(--error); border-radius: 3px; }

/* charts */
.hbars .row { display: grid; grid-template-columns: 180px 1fr 40px; align-items: center; gap: 10px; margin: 10px 0; font-size: 0.875rem; }
@media (max-width: 480px) { .hbars .row { grid-template-columns: 120px 1fr 32px; } }
.hbars .bar { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--g500), var(--g400)); }
.hbars .bar.hl { background: linear-gradient(90deg, var(--error), var(--warning)); }
.hbars .val { font: 700 1rem var(--font-num); text-align: right; }
.vbars svg { width: 100%; height: auto; display: block; }
.vbars text { font: 500 12px var(--font); fill: var(--ink); }
.vbars rect { rx: 4; }
.factlist { display: grid; gap: 4px; }
.fact { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: baseline; border-bottom: 1px dashed var(--line); padding: 10px 0; }
.fact:last-child { border-bottom: 0; }
.fact .n { font: 700 1.5rem/1.1 var(--font-num); white-space: nowrap; }
.fact .n.orange { color: var(--error); }
.fact .n.blue { color: var(--primary); }
.fact p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.sens-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sens-out .stat { box-shadow: none; background: var(--soft); border-color: var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
.big-out { margin-top: 16px; padding: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; font-size: 1rem; }
.big-out strong { font: 700 2rem var(--font-num); color: var(--error); }

/* repair bands */
.band-row { margin: 12px 0 18px; }
.band-row .mo { font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; }
.stack { display: flex; height: 32px; border-radius: 8px; overflow: hidden; gap: 2px; }
.stack span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; overflow: hidden; }
.stack .b-fast { background: var(--primary); }
.stack .b-mid { background: var(--primary-light); color: var(--primary-dark); }
.stack .b-slow { background: #C2410C; }

/* tables (Minimal table head: grey band, rounded) */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
table.data th { text-align: left; color: var(--muted); font-size: 0.8125rem; font-weight: 600; background: var(--soft); padding: 12px 14px; border-bottom: 1px dashed var(--line); }
table.data th:first-child { border-radius: 8px 0 0 8px; }
table.data th:last-child { border-radius: 0 8px 8px 0; }
table.data td { border-bottom: 1px dashed var(--line); padding: 12px 14px; vertical-align: top; }
table.data tbody tr:hover td { background: var(--soft); }
table.data td.num, table.data th.num { text-align: right; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-right: 4px; }
.tag.fit { background: var(--blue-soft); color: var(--primary-dark); }
.tag.miss { background: var(--soft); color: var(--muted); }

/* community card: stays a printable paper sheet */
.card-sheet { background: #fff; color: #1b1f24; border-radius: 16px; padding: 24px; max-width: 840px; box-shadow: 0 16px 32px -4px rgba(145, 158, 171, 0.24); border: 1px solid var(--g300); }
.card-top { display: flex; flex-wrap: wrap-reverse; justify-content: space-between; gap: 8px 12px; align-items: flex-start; }
.card-title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.card-sub { color: #4a525c; font-size: 0.875rem; }
.watermark { border: 1.5px dashed #4a525c; color: #4a525c; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; white-space: nowrap; }
.card-grid { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 0.875rem; margin: 10px 0 14px; }
.card-grid th { text-align: left; font-size: 0.78rem; color: #4a525c; padding: 2px 4px; }
.card-grid td.svc { font-weight: 700; padding: 4px; }
.card-grid td.cell { text-align: center; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.02em; border-radius: 8px; padding: 8px 4px; }
.cell.works { background: #0A5CE6; color: #fff; }
.cell.degraded { background: #D0ECFE; color: #1b1f24; }
.cell.na { background: #FF5630; color: #1b1f24; }
.cell.ask { background: #DFE3E8; color: #1b1f24; }
.cell .sym { display: block; font-size: 1rem; line-height: 1; margin-bottom: 2px; }
.card-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .card-cols { grid-template-columns: 1fr; } }
.card-h { font-weight: 700; margin: 6px 0 4px; }
.card-list { margin: 0 0 10px; padding-left: 18px; font-size: 0.875rem; }
.card-t0 { font-size: 0.9rem; }
.lang-panel { border: 2px dashed #4a525c; border-radius: 10px; padding: 10px 12px; min-height: 110px; font-size: 0.85rem; color: #4a525c; }
.card-foot { font-size: 0.78rem; color: #4a525c; border-top: 1px solid #DFE3E8; padding-top: 8px; margin: 12px 0 0; }
.card-actions { margin-top: 16px; }

/* government */
.schema { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.schema-col { display: flex; flex-direction: column; gap: 6px; }
.tbl { font: 0.8rem ui-monospace, Menlo, Consolas, monospace; padding: 7px 10px; border-radius: 8px; }
.tbl.dim { background: var(--blue-soft); color: var(--primary-dark); }
.tbl.fact { background: var(--orange-soft); color: var(--error-dark); }
ol.plain { padding-left: 20px; }
ol.plain li { margin: 6px 0; }

/* method */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.steps li { counter-increment: s; border-radius: var(--radius); padding: 14px 16px 14px 58px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font: 700 0.875rem var(--font-num); display: flex; align-items: center; justify-content: center; }
.sources { columns: 2 320px; column-gap: 28px; padding-left: 0; list-style: none; margin: 0; }
.sources li { break-inside: avoid; margin: 0 0 10px; font-size: 0.875rem; }
.sources .pub { color: var(--muted); font-size: 0.8rem; }
.plain-list { padding-left: 20px; }
.plain-list li { margin: 6px 0; }

/* ethics tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tier { border-radius: var(--radius); padding: 18px; border-top: 4px solid var(--primary); }
.tier:nth-child(2) { border-top-color: var(--error); }
.tier:nth-child(3) { border-top-color: var(--secondary); }
.tier-name { font-weight: 700; }

/* footer */
.footer { padding: 28px 0 40px; font-size: 0.85rem; color: var(--muted); }
.footer .wrap { border-top: 1px dashed var(--line); padding-top: 24px; }
.ack { max-width: 80ch; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* print: the community card by default; the hazard map alone when body[data-print="map"] */
@page { size: A4; margin: 12mm; }
/* Product */
.compare { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); margin-bottom: 28px; }
.compare-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.compare-row span { padding: 12px 16px; border-top: 1px solid var(--line); }
.compare-row span:first-child { color: var(--muted); }
.compare-row span:last-child { font-weight: 600; border-left: 3px solid var(--primary); }
.compare-head span { border-top: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--soft); }
.compare-head span:first-child { color: var(--muted); }
.compare-head span:last-child { color: var(--primary); font-weight: 700; }
.product-h { margin: 8px 0 12px; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 28px; }
.product { border-radius: var(--radius); padding: 18px; border-top: 4px solid var(--primary); display: flex; flex-direction: column; gap: 6px; }
.product:nth-child(2) { border-top-color: var(--error); }
.product:nth-child(3) { border-top-color: var(--secondary); }
.product:nth-child(4) { border-top-color: var(--success); }
.product p { margin: 0; }
.product-who { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.product-name { font-weight: 800; font-size: 1.05rem; }
.product a { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 0.875rem; }
.cycle { counter-reset: c; list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cycle li { counter-increment: c; position: relative; border-radius: var(--radius); padding: 14px 16px 14px 56px; }
.cycle li::before { content: counter(c); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font: 700 0.875rem var(--font-num); display: flex; align-items: center; justify-content: center; }
@media (max-width: 560px) { .compare-row { grid-template-columns: 1fr; } .compare-row span:last-child { border-top: 0; padding-top: 0; } .compare-head span:first-child { display: none; } .compare-head span:last-child { border-left: 3px solid var(--primary); } }

@media print {
  html, body { background: #fff !important; }
  body::before, body::after, .skip, .topbar, .footer { display: none !important; }
  body:not([data-print="map"]) main > section:not(#card),
  body:not([data-print="map"]) #card h2, body:not([data-print="map"]) #card .section-lead,
  body:not([data-print="map"]) #card .plain, .card-actions { display: none !important; }
  #card { padding: 0; }
  #card .wrap { padding: 0; max-width: none; }
  .card-sheet { max-width: none; width: 100%; box-shadow: none; border: 1.5px solid #1b1f24; break-inside: avoid; }
  .card-grid td.cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="map"] main > section:not(#hazards), body[data-print="map"] #hazards h2,
  body[data-print="map"] #hazards .plain, body[data-print="map"] .hz-side { display: none !important; }
  body[data-print="map"] #hazards { padding: 0; }
  body[data-print="map"] .hz-wrap { display: block; }
  body[data-print="map"] .hz-map { box-shadow: none; border: 0; padding: 0; }
  body[data-print="map"] #hazard-map { height: 165mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="map"] .leaflet-control-zoom, body[data-print="map"] .hz-legend summary::after { display: none; }
}

/* summary widgets: keep text above the decorative circle; dark-mode tints */
#hero-stats .stat > *, #works-stats .stat > * { position: relative; z-index: 1; }
#hero-stats .stat::after, #works-stats .stat::after { z-index: 0; right: -48px; top: -56px; }


/* ---- Light theme to match the logo, readable header, plain-language mode -------------- */
.topbar { background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(22, 50, 92, 0.1); box-shadow: 0 8px 24px -8px rgba(22, 50, 92, 0.18); }
.topbar-inner { height: 68px; gap: 16px; }
.brand { color: var(--navy); font-size: 1.15rem; letter-spacing: -0.01em; }
.brand img { width: 40px; height: auto; display: block; }
.nav { margin-left: 8px; }
.nav a { color: var(--navy-2); font-size: 0.9rem; padding: 8px 12px; }
.nav a:hover { background: var(--sky); color: var(--navy); }
.nav a.active { background: var(--navy); color: #fff; }

/* switch, as in Pyrantis: plain view by default, numbers on demand */
.switch { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--sky); color: var(--navy); font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; border: 1px solid rgba(30, 111, 217, 0.18); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #B9C6D6; transition: background 0.2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 720px) { .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; } .switch { margin-left: 0; order: 2; } .nav { order: 3; width: 100%; margin-left: 0; } }
body:not(.show-numbers) .detail { display: none !important; }

.hero h1 { color: var(--navy); }
.eyebrow { color: var(--navy); background: rgba(246, 176, 110, 0.25); }

/* chain card: navy hills into sunset, like the logo */
.chain-card { background: linear-gradient(120deg, #16325C 0%, #2B5C9A 55%, #E8935A 120%); box-shadow: 0 16px 32px -8px rgba(22, 50, 92, 0.35); }

/* plain-words boxes and glossary */
.plain { max-width: 72ch; background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(246, 176, 110, 0.45); border-left: 4px solid #F29A3F; border-radius: 12px; padding: 12px 16px; color: var(--ink); font-size: 1rem; margin: 14px 0 20px; }
.plain strong { color: var(--navy); }
.glossary { margin-top: 20px; background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px 20px; }
.glossary-title { font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.glossary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.glossary dt { font-weight: 700; color: var(--navy); }
.glossary dt span { font-weight: 500; color: var(--muted); font-size: 0.85em; }
.glossary dd { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

/* summary cards: warm and cool tints from the logo */
#hero-stats .stat .what, #works-stats .stat .what { color: var(--g700); }
h2 { color: var(--navy); }
.nav a { padding: 7px 9px; font-size: 0.85rem; }
.topbar-inner { gap: 10px; }
@media (max-width: 1499px) { .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; } .nav { order: 3; width: 100%; margin-left: -9px; } }
html { overflow-anchor: none; }

/* colours from the U logo: blue end, purple middle, orange end */
:root { --primary: #0A5CE6; --primary-light: #5B93F2; --blue: #0A5CE6; --error: #F2652A; --orange: #F2652A; --warning: #FF8A3D; }
.chain-card { background: linear-gradient(120deg, #0A4FCC 0%, #3D5BD6 45%, #8656A8 75%, #F2652A 115%); }
.eyebrow { background: rgba(10, 92, 230, 0.1); color: #0A4FCC; }
.plain { border-left-color: #F2652A; border-color: rgba(242, 101, 42, 0.3); }

.card-grid sup { font-size: 0.65em; margin-left: 2px; }
.card-notes { margin: -6px 0 8px; padding-left: 18px; font-size: 0.78rem; color: #4a525c; }
.card-key { font-size: 0.8rem; color: #4a525c; background: #F4F6F8; border-radius: 8px; padding: 8px 10px; margin: 0 0 12px; }
@media print {
  .card-sheet { padding: 14px 16px; font-size: 12.5px; }
  .card-title { font-size: 1.35rem; }
  .card-grid { margin: 6px 0 8px; border-spacing: 3px; }
  .card-grid td.cell { padding: 5px 4px; }
  .card-grid td.svc { padding: 2px 4px; }
  .card-cols { gap: 14px; }
  .card-list { margin-bottom: 6px; }
  .lang-panel { min-height: 70px; }
  .card-foot { margin-top: 8px; }
}

/* ======================================================================
   Phones (screen only, under 720 px wide). Desktop rules above are unchanged.
   ====================================================================== */
.swipe-hint { display: none; }
@media screen and (max-width: 720px) {
  html { scroll-padding-top: 118px; }
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  section { padding: 32px 0; }
  .hero { padding-top: 20px; }

  /* compact header: logo + switch on one row, menu as a swipeable strip */
  .topbar { top: 6px; margin: 6px 8px 0; border-radius: 14px; }
  .topbar-inner { flex-wrap: wrap; height: auto; gap: 6px 10px; padding: 8px 12px 6px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 32px; }
  .switch { order: 2; margin-left: auto; padding: 4px 10px 4px 6px; font-size: 0.78rem; gap: 7px; }
  .switch .track { width: 32px; height: 18px; }
  .switch .track::after { width: 12px; height: 12px; }
  .switch input:checked + .track::after { transform: translateX(14px); }
  .nav { order: 3; width: 100%; margin: 0 -4px; padding: 2px 0; gap: 2px; scroll-snap-type: x proximity;
         -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nav a { padding: 7px 10px; font-size: 0.82rem; scroll-snap-align: start; }

  /* type */
  .eyebrow { font-size: 0.68rem; }
  .hero h1 { font-size: 1.85rem; margin: 10px 0 10px; }
  h2 { font-size: 1.4rem; }
  .lead, .section-lead { font-size: 0.95rem; }
  .plain { font-size: 0.93rem; padding: 10px 12px; }

  /* chain card and sandbox: contain the wide drawings and say they can be swiped */
  .chain-card { padding: 14px 12px 12px; margin: 20px 0 18px; }
  #chain { min-width: 0; max-width: 330px; margin: 6px auto 0; }
  .chip { font-size: 0.72rem; }
  .chain-status { font-size: 0.9rem; }
  .swipe-hint { display: block; font-size: 0.75rem; opacity: 0.8; margin: 4px 0 0; }
  .sandbox > * { min-width: 0; }
  .sandbox-canvas, .sandbox-side { padding: 12px; }
  .sandbox-tools { gap: 8px 14px; }
  .sandbox-canvas .swipe-hint { color: var(--muted); }

  /* cards, stats, facts */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .num { font-size: 1.5rem; }
  .stat .what { font-size: 0.8rem; }
  #hero-stats .stat:last-child:nth-child(odd), #works-stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .panel { padding: 16px; border-radius: 14px; }
  .grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .grid-2 > *, .panel { min-width: 0; }
  .fact { grid-template-columns: 84px 1fr; gap: 10px; }
  .fact .n { font-size: 1.2rem; }
  .sens-out { grid-template-columns: 1fr 1fr; }
  .big-out strong { font-size: 1.6rem; }
  .glossary { padding: 14px; }
  .glossary dl { grid-template-columns: 1fr; gap: 10px; }

  /* controls wrap instead of overflowing */
  .controls { gap: 8px; }
  .seg { width: 100%; }
  .seg .seg-label { width: 100%; padding: 2px 6px 4px; }
  .seg button { flex: 1 1 auto; padding: 8px 8px; }

  /* charts */
  .hbars .row { grid-template-columns: 104px 1fr 30px; font-size: 0.8rem; }
  .stack { height: 36px; }
  .stack span { font-size: 0.72rem; white-space: normal; text-align: center; line-height: 1.1; padding: 0 2px; }

  /* tables: each row becomes a small stacked card with the column names as labels */
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tr { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; }
  table.data tbody tr:hover td { background: transparent; }
  table.data td { display: grid; grid-template-columns: 42% 1fr; gap: 10px; border-bottom: 1px dashed var(--line); padding: 8px 0; font-size: 0.85rem; text-align: left !important; }
  table.data td:last-child { border-bottom: 0; }
  table.data td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: 0.78rem; }
  table.data td:first-child { font-weight: 700; color: var(--navy); }

  /* community card */
  .card-sheet { padding: 14px; border-radius: 12px; }
  .card-title { font-size: 1.2rem; }
  .card-grid { font-size: 0.78rem; border-spacing: 3px; }
  .card-grid th { font-size: 0.7rem; }
  .card-grid td.cell { font-size: 0.64rem; padding: 6px 2px; }
  .card-grid td.svc { font-size: 0.8rem; }
  .card-key { font-size: 0.76rem; }
  .card-actions .btn { width: 100%; padding: 12px; }

  /* method, tiers, footer */
  .steps li { padding: 12px 12px 12px 50px; }
  .steps li::before { left: 12px; }
  .sources { columns: 1; }
  .tiers { grid-template-columns: 1fr; }
  .footer { font-size: 0.8rem; }
}


/* ---- Off-grid scenario --------------------------------------------------------------- */
.og-wrap { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 20px; margin-bottom: 20px; }
.og-stage { padding: 14px; }
#offgrid-scene svg { width: 100%; height: auto; display: block; }
.og-dim { opacity: 0.18; transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1); }
.og-node, #og-sat, #og-ntes, #og-bus, #og-hill-lbl { transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1); }
.og-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.og-controls .btn, .og-controls .btn-ghost { transition: transform 160ms ease-out, background 200ms; }
.og-controls .btn:active, .og-controls .btn-ghost:active { transform: scale(0.97); }
.og-dots { display: flex; gap: 0; margin-left: auto; }
.og-dots button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; padding: 0; position: relative; }
.og-dots button::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #8A96A3; transition: transform 160ms ease-out, background 200ms; }
.og-dots button[aria-current="true"]::after { background: var(--navy); transform: scale(1.25); }
.og-caption { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.og-step-n { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.og-caption h3 { font-size: 1.15rem; color: var(--navy); margin: 0 0 6px; }
.og-uses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.og-use { font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(123, 97, 217, 0.1); color: #4B35A6; }
.og-proven { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.og-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); transition: transform 160ms ease-out, background 200ms; }
.og-card b { color: var(--navy); }
.og-card span { font-size: 0.86rem; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .og-card:hover { background: var(--blue-soft); text-decoration: none; } }
.og-card:active { transform: scale(0.98); }
@media (max-width: 860px) { .og-wrap { grid-template-columns: 1fr; } }

/* ---- Hazard map ------------------------------------------------------------------------ */
.hz-wrap { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 20px; }
.hz-map { padding: 10px; }
#hazard-map { height: 560px; border-radius: 10px; background: #EEF3F9; z-index: 0; font: inherit; }
.hz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 2px 4px 10px; }
.hz-head b { color: var(--navy); font-size: 1.05rem; }
.hz-head span { color: var(--muted); font-size: 0.8rem; }
.layer-chip.base-chip { grid-template-columns: auto 1fr; }
.hz-legend { background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.78rem; color: #14243B; max-width: 250px; box-shadow: 0 2px 10px rgba(22,50,92,0.12); }
.hz-legend-t { margin: 0 0 4px; font-weight: 700; color: var(--navy); font-size: 0.8rem; }
.hz-legend ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; }
.hz-legend ul:last-child { margin-bottom: 0; }
.hz-legend li { display: flex; align-items: center; gap: 6px; }
.hz-legend li b { font-family: var(--font-num); color: var(--muted); margin-left: auto; padding-left: 6px; }
.hz-legend i.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.hz-legend i.bar { width: 14px; height: 4px; border-radius: 2px; flex: none; }
.hz-legend i.area { width: 14px; height: 10px; border-radius: 2px; flex: none; opacity: 0.45; }
.hz-legend i.sq { width: 9px; height: 9px; flex: none; margin: 0 2.5px; }
.hz-sq { background: #0E8FA8; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(14,143,168,0.4); }
.hz-warn li { display: list-item; margin-left: 12px; list-style: disc; }
.hz-legend summary { cursor: pointer; list-style: none; }
.hz-legend summary::-webkit-details-marker { display: none; }
.hz-legend summary::after { content: " +"; color: var(--muted); }
.hz-legend details[open] summary::after { content: " –"; }
.hz-legend details[open] summary { margin-bottom: 4px; }
.leaflet-popup-content { font: 0.82rem/1.4 var(--font, inherit); }
.hz-layers { display: grid; gap: 6px; margin-bottom: 14px; }
.layer-chip { display: grid; grid-template-columns: auto 14px 1fr auto; align-items: center; gap: 8px; font-size: 0.86rem; padding: 6px 8px; border-radius: 8px; background: var(--soft); cursor: pointer; }
.layer-chip input { accent-color: var(--navy); }
.layer-chip i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.layer-chip b { font-family: var(--font-num); color: var(--muted); }
.hz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hz-actions .btn:active, .hz-actions .btn-ghost:active { transform: scale(0.97); }
@media (max-width: 860px) { .hz-wrap { grid-template-columns: 1fr; } }

@media screen and (max-width: 720px) {
  .og-scroll, .hz-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #offgrid-scene svg { min-width: 560px; }
  #hazard-map { height: 460px; }
  #hazard-map .leaflet-control-attribution { font-size: 0.6rem; line-height: 1.3; max-width: 70%; }
  .hz-legend { max-width: 180px; font-size: 0.72rem; }
  .og-dots { margin-left: 0; width: 100%; justify-content: center; }
  .og-controls .btn, .og-controls .btn-ghost { flex: 1 1 auto; }
  .hz-actions .btn, .hz-actions .btn-ghost { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .og-dim, .og-node, .og-dots button::after { transition: none; } }

/* ---- Method pipeline animation: each stage lights up in turn ---------------------------- */
.pl-wrap { padding: 12px 16px; margin-bottom: 16px; }
#pipeline-anim svg { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: no-preference) {
  .pl-stage circle { animation: pl-glow 6s cubic-bezier(0.23, 1, 0.32, 1) infinite; animation-delay: calc(var(--i) * 1s); transform-box: fill-box; transform-origin: center; }
  @keyframes pl-glow { 0%, 12% { transform: scale(1.18); fill: #FFF5EA; } 22%, 100% { transform: scale(1); fill: #fff; } }
}

/* ==== Hero map: content layer, no overlays ================================================== */
.hero-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr); gap: 48px; align-items: stretch; }
.hero-text { align-self: center; }
.hero-art { position: relative; margin: 0; border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(234, 243, 252, 0.95), rgba(255, 255, 255, 0.85) 50%, rgba(255, 245, 234, 0.9));
  border: 1px solid rgba(22, 50, 92, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(22, 50, 92, 0.05), 0 16px 40px -16px rgba(22, 50, 92, 0.2); }
.hero-art svg { position: absolute; inset: 20px; width: calc(100% - 40px); height: calc(100% - 40px); display: block; }
.hero-text > :first-child { margin-top: 0; }
.hero-text > :last-child { margin-bottom: 0; }
  background: rgba(255, 255, 255, 0.62); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(22, 50, 92, 0.08), 0 4px 14px -6px rgba(22, 50, 92, 0.18); }
.hero-art .hm-label { fill: var(--navy); font: 700 12px var(--font); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.hero-art .hm-hop { transition: stroke-opacity 400ms ease; }
.hero-art .hm-hop.hm-off { stroke-opacity: 0.1; }
.hero-art .hm-dot { fill: #16325C; }
.hero-art .hm-weak .hm-dot { fill: #fff; stroke: #E4602E; stroke-width: 1.8; transition: fill 300ms ease; }
.hero-art .hm-weak.hm-down .hm-dot { fill: #E4602E; }
.hero-art .hm-ripple { opacity: 0; transform-box: fill-box; transform-origin: center; }
.hero-art .hm-down .hm-ripple { animation: hm-ripple 1.6s cubic-bezier(0.23, 1, 0.32, 1) infinite; }
.hero-art .hm-halo { fill: #1E6FD9; fill-opacity: 0.16; transition: fill-opacity 400ms ease; }
.hero-art .hm-core { fill: #6FAEF5; stroke: #1E6FD9; stroke-width: 1.5; transition: fill 400ms ease, stroke 400ms ease; }
.hero-art .hm-dark .hm-halo { fill-opacity: 0; }
.hero-art .hm-dark .hm-core { fill: #D5DCE5; stroke: #8A96A3; }
@keyframes hm-ripple { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(4); opacity: 0; } }
@media (prefers-reduced-motion: no-preference) { .hero-art .hm-flow { animation: hm-flow 2.4s linear infinite; } }
@keyframes hm-flow { to { stroke-dashoffset: -52; } }
@media (max-width: 980px) { .hero-top { grid-template-columns: 1fr; gap: 20px; } .hero-art { aspect-ratio: 4 / 5; max-width: 480px; width: 100%; } }

/* ==== Findings: one square per place ========================================================== */
.waffle-wrap { margin: 18px 0 14px; }
.waffle-t { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.waffle { display: grid; grid-template-columns: repeat(29, 1fr); gap: 3px; }  /* 116 = 29 x 4 */
.waffle i { aspect-ratio: 1; border-radius: 3px; background: #D5DCE5; }
@media (max-width: 560px) { .waffle { grid-template-columns: repeat(20, 1fr); } }
.waffle i.w-fibre { background: #7F9BBF; }
.waffle i.w-spof { background: var(--error); }
.waffle i.w-chain { background: #F6B98F; }
.waffle i.w-island { background: #B7A7EC; }
.waffle-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.waffle-key span { display: inline-flex; align-items: center; gap: 6px; }
.waffle-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ==== Hazards: the map fills its panel ======================================================== */
@media (min-width: 901px) {
  .hz-map { display: flex; flex-direction: column; }
  #hazard-map { flex: 1 1 auto; height: auto; min-height: 560px; }
}

/* ==== Liquid glass ============================================================================
   Glass only where it does a job: the sticky top bar floats over scrolling content, so it gets
   the regular material (backdrop blur). Cards sit on the page, so they get the static variant:
   same fill, rim and highlight, no backdrop-filter. Controls are pills with a tinted primary. */
:root {
  --lg-fill: rgba(255, 255, 255, 0.62);
  --lg-fill-static: rgba(255, 255, 255, 0.7);
  --lg-solid: #F6F8FB;
  --lg-blur: blur(24px) saturate(140%);
  --lg-rim: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  --lg-edge: rgba(22, 50, 92, 0.08);
  --lg-shadow: 0 1px 2px rgba(22, 50, 92, 0.05), 0 10px 30px -8px rgba(22, 50, 92, 0.12);
  --radius: 22px;
}
.panel, .stat, .sandbox-canvas, .sandbox-side, .steps li, .tier, .product, .cycle li {
  background: var(--lg-fill-static); -webkit-backdrop-filter: none; backdrop-filter: none;
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-rim), var(--lg-shadow);
}
.topbar { background: var(--lg-solid); border: 1px solid var(--lg-edge); border-radius: 24px; box-shadow: var(--lg-rim), var(--lg-shadow); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--lg-fill); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .topbar { background: var(--lg-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* navigation: pills; the current section is a lifted fill, not a solid slab */
.nav { gap: 2px; padding: 3px; }
.nav a { border-radius: 999px; padding: 7px 13px; color: var(--navy-2); transition: background-color 150ms ease, color 150ms ease; }
.nav a:hover { background: rgba(22, 50, 92, 0.06); color: var(--navy); }
.nav a.active { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px rgba(22, 50, 92, 0.08), 0 1px 2px rgba(22, 50, 92, 0.08), 0 4px 12px -4px rgba(22, 50, 92, 0.18); }

/* buttons: tinted glass primary, clear glass secondary, a small press, nothing else moves */
.btn, .btn-ghost { border-radius: 999px; padding: 10px 18px; font-weight: 700; transition: background-color 150ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.btn { background: linear-gradient(180deg, rgba(43, 79, 128, 0.9), rgba(22, 50, 92, 0.94)); color: #fff; border: 1px solid rgba(22, 50, 92, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px -6px rgba(22, 50, 92, 0.45); }
.btn:hover { background: linear-gradient(180deg, rgba(52, 92, 146, 0.92), rgba(28, 60, 108, 0.95)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px -6px rgba(22, 50, 92, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.6); color: var(--ink); border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(22, 50, 92, 0.06); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.9); }
.btn:active, .btn-ghost:active { transform: scale(0.97); }
.chain-card .btn-ghost { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.chain-card .btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }

/* segmented control, as on Apple platforms */
.seg { border-radius: 999px; background: rgba(118, 118, 128, 0.12); border: 0; padding: 3px; }
.seg button { border-radius: 999px; transition: background-color 150ms ease, color 150ms ease; }
.seg button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }

/* switch */
.switch { background: rgba(255, 255, 255, 0.6); border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9); }
.switch .track { width: 42px; height: 26px; background: rgba(120, 120, 128, 0.22); }
.switch .track::after { top: 2px; left: 2px; width: 22px; height: 22px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.switch input:checked + .track::after { transform: translateX(16px); }
input[type="checkbox"] { accent-color: var(--primary); }

/* chips and the hero card: brand colours, no purple wash */
.eyebrow { border-radius: 999px; padding: 5px 12px; }
.chain-card { border-radius: 28px; background: linear-gradient(135deg, #16325C, #1E5FBF 60%, #2B6FD6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 20px 40px -12px rgba(22, 50, 92, 0.35); }
@media (forced-colors: active) { .topbar, .panel, .btn, .btn-ghost { background: Canvas; border: 1px solid CanvasText; backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { .btn:active, .btn-ghost:active { transform: none; } }

/* Printing the page (Cmd/Ctrl+P): drop the costly blur, glass and animation layers, which made
   some browsers crash while preparing the print. */
@media print {
  body::before, body::after { display: none !important; }
  * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; animation: none !important; }
  .hero-art { display: none !important; }
}

/* offline download, in the product section */
.offline-dl { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 28px; padding: 18px 20px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(22, 50, 92, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 30px -8px rgba(22, 50, 92, 0.12); }
.offline-dl > div { flex: 1 1 320px; }
.offline-dl p { margin: 0; }
.offline-t { font-weight: 800; color: var(--navy); margin-bottom: 2px !important; }
.offline-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.offline-btn:hover { text-decoration: none; }
.offline-btn span { font-weight: 500; opacity: 0.8; }
@media (max-width: 560px) { .offline-btn { width: 100%; justify-content: center; } }
