/* Ryan B — Ocean slate theme. Light and dark. */
:root {
  --bg: #F7F9FB;
  --surface: #FFFFFF;
  --surface-2: #EEF3F8;
  --text: #14202B;
  --muted: #566778;
  --accent: #1F6FB2;
  --accent-hover: #185A92;
  --on-accent: #FFFFFF;
  --border: #DCE3EA;
  --placeholder: #E3EAF1;
  --chip: #E6F0F9;
  --chip-text: #174F80;
  --risk-none: #D5DDE5;
  --risk-low: #B9D6EE;
  --risk-elevated: #5A9BD3;
  --risk-high: #E08A3A;
  --risk-severe: #A84A16;
  --radius: 20px;
  --max: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --surface: #111A2B; --surface-2: #16223A; --text: #E8EEF5; --muted: #93A4B5;
    --accent: #5AB0F0; --accent-hover: #86C6F5; --on-accent: #0B1220; --border: #22304A;
    --placeholder: #1A2740; --chip: #16304D; --chip-text: #BFE0FA;
    --risk-none: #26344D; --risk-low: #2D5A84; --risk-elevated: #5AB0F0; --risk-high: #E59A4C; --risk-severe: #C4561E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #111A2B; --surface-2: #16223A; --text: #E8EEF5; --muted: #93A4B5;
  --accent: #5AB0F0; --accent-hover: #86C6F5; --on-accent: #0B1220; --border: #22304A;
  --placeholder: #1A2740; --chip: #16304D; --chip-text: #BFE0FA;
  --risk-none: #26344D; --risk-low: #2D5A84; --risk-elevated: #5AB0F0; --risk-high: #E59A4C; --risk-severe: #C4561E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; color: var(--on-accent); }
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.spaced { margin-top: 20px; }
.section-tight { padding-top: 8px; padding-bottom: 88px; }
.prose { max-width: 720px; margin: 0 auto; font-size: 17px; }
.prose h2 { font-size: 26px; letter-spacing: -0.02em; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--text); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { color: var(--text); }
.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--text); padding: 16px 0; }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-tools { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); border-radius: 12px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav { flex-wrap: wrap; }
  .nav-links { display: none; order: 3; width: 100%; flex-direction: column; gap: 0; padding-bottom: 12px; font-size: 17px; }
  .nav-links a { padding: 12px 0; border-top: 1px solid var(--border); }
  .site-header.open .nav-links { display: flex; }
}

/* Type */
.eyebrow { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--accent); }
.display { margin: 0; font-size: clamp(44px, 8vw, 88px); line-height: 1.03; font-weight: 700; letter-spacing: -0.035em; }
.h2 { margin: 0; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
.h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.lead { margin: 20px auto 0; max-width: 640px; font-size: clamp(17px, 2vw, 20px); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* Buttons and links */
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 16px; border: 1px solid var(--accent); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { color: var(--accent); background: transparent; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 20px; font-weight: 600; }
.links a { padding: 10px 0; }
.links a::after, .more::after { content: " \203A"; }
.more { font-weight: 600; padding: 10px 0; display: inline-block; }

/* Sections */
.hero { text-align: center; padding-top: 96px; padding-bottom: 72px; }
.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section { padding-top: 80px; padding-bottom: 80px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-width: 0; }
.band .card { background: var(--bg); }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ph-fill { height: 100%; }
.ph { background: var(--placeholder); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; text-align: center; padding: 16px; }

/* Badge */
.badge { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.badge .badge-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; flex: none; }
.badge strong { color: var(--text);  display: block; font-size: 14px; }
.badge span { display: block; font-size: 13px; color: var(--muted); }

/* News */
.news-item { display: block; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.band .news-item { background: var(--bg); }
.news-item:hover { border-color: var(--accent); color: var(--text); }
.news-topic { display: block; font-size: 12px; font-weight: 600; color: var(--accent); }
.news-title { display: block; font-size: 16px; font-weight: 600; margin-top: 6px; line-height: 1.35; }
.news-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.skeleton { height: 92px; border-radius: 16px; background: var(--placeholder); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Risk map */
.map { width: 100%; aspect-ratio: 2 / 1; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.map svg { width: 100%; height: 100%; display: block; }
.map path { stroke: var(--bg); stroke-width: 0.4; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.risk-none { background: var(--risk-none); } .risk-low { background: var(--risk-low); } .risk-elevated { background: var(--risk-elevated); } .risk-high { background: var(--risk-high); } .risk-severe { background: var(--risk-severe); }
.map-tip { min-height: 22px; margin-top: 8px; font-size: 14px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); }
td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td:first-child { font-weight: 600; }
.level { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.level i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Photo grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 240px), 1fr)); gap: 12px; }
.cat { color: var(--text); }
.cat:hover { color: var(--accent); }
.cat-img { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--placeholder); display: flex; align-items: flex-end; padding: 14px; color: var(--muted); font-size: 12px; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; margin: -14px; width: calc(100% + 28px); height: calc(100% + 28px); max-width: none; }
.cat-name { display: block; margin-top: 10px; font-size: 16px; font-weight: 600; }
.cat-count { display: block; font-size: 13px; color: var(--muted); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 40px 32px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.tile.wide { grid-column: 1 / -1; }
.tile h2 { margin: 0; font-size: clamp(28px, 3.4vw, 36px); letter-spacing: -0.03em; line-height: 1.1; }
.tile p { margin: 12px 0 0; max-width: 440px; color: var(--muted); font-size: 17px; }
.tile .ph { width: 100%; height: 200px; margin-top: 24px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.chips li { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--chip); color: var(--chip-text); }

/* Feature cards on section pages */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-text); }
.empty { text-align: center; padding: 40px 24px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.filter { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.gallery { columns: 3 260px; column-gap: 12px; }
.shot { break-inside: avoid; margin: 0 0 12px; display: block; width: 100%; padding: 0; border: 0; background: var(--placeholder); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; height: auto; transition: transform .4s ease; }
.shot:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .shot img { transition: none; } }

/* Lightbox */
.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(5, 9, 16, 0.94); color: #E8EEF5; }
.lightbox::backdrop { background: rgba(5, 9, 16, 0.94); }
.lb-inner { height: 100%; display: flex; flex-direction: column; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.lb-bar .icon-btn { color: #E8EEF5; }
.lb-bar .icon-btn:hover { background: rgba(255,255,255,0.1); }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.lb-stage img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.lb-info { padding: 14px 20px 22px; text-align: center; }
.lb-title { font-weight: 600; font-size: 17px; }
.exif { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 6px; font-size: 14px; color: #93A4B5; }
.lb-info a { color: #86C6F5; font-size: 14px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea, .field select { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.field textarea { min-height: 140px; resize: vertical; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 32px 24px; font-size: 13px; color: var(--muted); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--text); }

/* ===== Categorical colors for charts ===== */
:root { --c1: #1F6FB2; --c2: #E08A3A; --c3: #2E8B6E; --c4: #7A5AC8; --c5: #C2452D; --c6: #5A6B7B; --good: #2E8B6E; --bad: #C2452D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c1: #5AB0F0; --c2: #F0A35E; --c3: #4CC3A0; --c4: #A68BEA; --c5: #E8735A; --c6: #93A4B5; --good: #4CC3A0; --bad: #E8735A; } }
:root[data-theme="dark"] { --c1: #5AB0F0; --c2: #F0A35E; --c3: #4CC3A0; --c4: #A68BEA; --c5: #E8735A; --c6: #93A4B5; --good: #4CC3A0; --bad: #E8735A; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); } .c5 { background: var(--c5); } .c6 { background: var(--c6); }
.fill.c1 { fill: var(--c1); } .fill.c2 { fill: var(--c2); } .fill.c3 { fill: var(--c3); } .fill.c4 { fill: var(--c4); } .fill.c5 { fill: var(--c5); } .fill.c6 { fill: var(--c6); }
.seg { fill: none; } .seg.c1 { stroke: var(--c1); } .seg.c2 { stroke: var(--c2); } .seg.c3 { stroke: var(--c3); } .seg.c4 { stroke: var(--c4); } .seg.c5 { stroke: var(--c5); } .seg.c6 { stroke: var(--c6); }

/* ===== Shared bits ===== */
.hero-compact { padding-top: 72px; padding-bottom: 40px; }
.spaced-sm { margin-top: 10px; }
.spaced-lg { margin-top: 64px; }
.small-lead { font-size: 16px; margin-top: 0; margin-bottom: 20px; text-align: center; }
.err { color: var(--bad); margin: 6px 0 0; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--accent-hover); }
.small-btn { width: 36px; height: 36px; }
.small-btn svg { width: 18px; height: 18px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline .lbl { margin: 0; }
input[type="search"], input[type="number"], input[list], .wset input, .fx input, select { font: inherit; font-size: 16px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); min-width: 0; }
.wset .inline input { flex: 1 1 140px; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.credit { margin: 12px 0 0; font-size: 12px; }
.credit a { color: var(--muted); }
.skeleton-line { height: 18px; border-radius: 6px; background: var(--placeholder); margin: 10px 0; list-style: none; animation: pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .skeleton-line { animation: none; } }

/* ===== Today widgets ===== */
.customize { margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.customize[hidden] { display: none; }
.customize p { width: 100%; margin: 0 0 4px; }
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 20px; min-width: 0; }
.widget[hidden] { display: none; }
.widget-head { display: flex; justify-content: space-between; align-items: center; margin: -6px -8px 8px 0; }
.widget-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.widget-settings { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.results { display: flex; flex-direction: column; margin-top: 6px; }
.result { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 10px 2px; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.result:hover { color: var(--accent); }

.wx-place { margin: 0; font-weight: 600; }
.wx-now { display: flex; align-items: center; gap: 12px; margin: 6px 0 8px; }
.wx-temp { font-size: 52px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.wx-desc { font-size: 15px; line-height: 1.35; }
.wx { color: var(--accent); flex: none; }
.wx-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.wx-days { list-style: none; margin: 6px 0 0; padding: 0; }
.wx-days li { display: grid; grid-template-columns: 56px 24px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.wx-days .r { color: var(--muted); font-size: 12px; }
.wx-days .t { text-align: right; font-variant-numeric: tabular-nums; }

.clock-big { margin: 2px 0; font-size: 44px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock-list, .tz-edit, .fx-quick, .hol-list { list-style: none; padding: 0; margin: 12px 0 0; }
.clock-list li, .tz-edit li, .fx-quick li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.clock-list li > span:first-child { display: flex; flex-direction: column; }
.clock-t { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tz-edit li { padding: 2px 0; font-size: 15px; }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 14px; }
.cal-n { color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 0; }
.cal-d { padding: 7px 0; border-radius: 10px; position: relative; font-variant-numeric: tabular-nums; }
.cal-d.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-d.hol::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--c2); }
.hol-list li { display: flex; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--border); }
.hol-date { color: var(--c2); font-weight: 600; min-width: 52px; }

.fx input { width: 100%; font-size: 22px; font-weight: 600; }
.fx-row { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 6px; align-items: center; margin-top: 8px; }
.fx-result { font-size: 22px; font-weight: 600; margin: 14px 0 2px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.fx-quick li { font-size: 14px; }

.playlist-start { width: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.playlist-start:hover .play-dot { transform: scale(1.06); }
.play-dot { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.play-dot svg { width: 24px; height: 24px; margin-left: 3px; }
.playlist-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; }
.playlist-ph { min-height: 160px; }

/* ===== Topic hub ===== */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.hub-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; min-width: 0; display: flex; flex-direction: column; }
.hub-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.tip { background: var(--surface); border-radius: 14px; padding: 14px 16px 6px; margin-bottom: 16px; }
.tip-label { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
.tip-text { margin: 0; font-size: 15px; min-height: 4.5em; }
.headlines { list-style: none; margin: 0; padding: 0; }
.headlines li { padding: 10px 0; border-top: 1px solid var(--border); }
.headlines a { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.35; display: block; }
.headlines a:hover { color: var(--accent); }
.hl-tag { display: block; font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.hl-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ===== Top 10 ===== */
.top10 { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; counter-reset: none; }
.top10 li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; font-size: 15px; }
.top10 .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--chip); color: var(--chip-text); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.section-head .pill { margin-top: 16px; }

/* ===== Infographics ===== */
#ig-tabs .filter { display: inline-flex; gap: 6px; align-items: center; }
#ig-tabs .filter[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
#ig-tabs .filter[aria-selected="true"] .muted { color: inherit; opacity: 0.75; }
.band .ig-panel { background: var(--bg); }
.ig-panel { padding: 28px; }
.ig-split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.ig-visual { flex: 1 1 380px; min-width: 0; }
.ig-visual.center { display: flex; flex-direction: column; align-items: center; }
.ig-controls { flex: 1 1 300px; min-width: 0; }
.ig-field { margin-bottom: 16px; }
.ig-field select, .ig-field input[type="number"] { width: 100%; }
.ig-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ig-label output { color: var(--accent); font-variant-numeric: tabular-nums; }
.ig-sum { font-size: 15px; margin: 10px 0 0; text-align: center; }
.ig-big { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 0; text-align: center; font-variant-numeric: tabular-nums; }
.ig-sub { margin: 18px 0 4px; font-size: 16px; }
.ig-notes { list-style: none; padding: 0; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.ig-notes li { padding: 4px 0; }
.ig-notes strong { color: var(--text); }
.ig-scene { width: 100%; border-radius: 14px; display: block; }
.ig-meter { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.ig-meter-bar { position: relative; flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #1b2533, var(--surface-2) 50%, #fff); border: 1px solid var(--border); }
.ig-meter-bar i { position: absolute; top: -5px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--accent); }
.ig-rings { width: min(100%, 320px); }
.ig-ring { cursor: pointer; transition: opacity .2s; }
.ig-ring.dim { opacity: 0.35; }
.ig-asset { fill: var(--surface); stroke: var(--border); }
.ig-ring-t { fill: #fff; font-size: 14px; font-weight: 700; pointer-events: none; }
.ig-ring-t.small-t { fill: var(--text); font-size: 11px; }
.ig-tabs-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ig-layer-info p { margin: 4px 0; }
.ig-race-row { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.ig-race-row div { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.ig-race-row i { display: block; height: 100%; background: var(--good); border-radius: 6px; transition: width .2s; }
.ig-race-row i.bad { background: var(--bad); }
.ig-profile { width: 100%; }
.ig-base { stroke: var(--border); }
.ig-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 14px; }
.ig-stack i { display: block; height: 100%; transition: width .2s; }
.ig-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.ig-legend li { display: flex; align-items: center; gap: 6px; }
.ig-legend.col { flex-direction: column; align-items: stretch; width: min(100%, 360px); text-align: left; }
.ig-legend.col li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ig-gears { width: min(100%, 420px); }
.ig-chain { stroke: var(--muted); }
.ig-hole { fill: var(--bg); }
.band .ig-hole { fill: var(--bg); }
.ig-donut { width: min(100%, 240px); }
.ig-track { fill: none; stroke: var(--surface-2); }
.ig-donut-big { fill: var(--text); font-size: 18px; font-weight: 700; }
.ig-donut-small { fill: var(--muted); font-size: 11px; }
.ig-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 16px; }
.ig-kpis div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.ig-kpis strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ig-kpis .pos { color: var(--good); } .ig-kpis .neg { color: var(--bad); }
.ig-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 420px) { .ig-two { grid-template-columns: 1fr; } .ig-panel { padding: 18px; } }

/* ===== Security briefing additions ===== */
table.compact { min-width: 420px; font-size: 14px; }
table.compact td, table.compact th { padding: 8px 6px; }
.picks { margin: 10px 0 0; padding-left: 20px; }
.picks li { padding: 8px 0; border-top: 1px solid var(--border); }
.picks li:first-child { border-top: 0; }
.pick-top { display: flex; justify-content: space-between; gap: 8px; }
.stars { color: var(--c2); letter-spacing: 1px; font-size: 13px; }

/* ===== Slideshow ===== */
.slideshow { position: relative; margin-bottom: 56px; }
.ss-track { position: relative; aspect-ratio: 16 / 9; max-height: 640px; width: 100%; border-radius: 28px; overflow: hidden; background: #0B1220; }
.ss-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
.ss-slide.is-active { opacity: 1; visibility: visible; transition: opacity .8s ease, visibility 0s; z-index: 1; }
.ss-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 7s ease-out; }
.ss-slide.is-active .ss-img { transform: scale(1); }
.ss-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 14, 26, 0.78) 0%, rgba(8, 14, 26, 0.45) 38%, rgba(8, 14, 26, 0) 68%); }
.ss-copy { position: absolute; left: 0; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(24px, 6vw, 72px); max-width: min(560px, 62%); color: #F2F6FA; }
.ss-area { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: #86C6F5; }
.ss-title { margin: 0; font-size: clamp(32px, 5vw, 60px); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; color: #fff; }
.ss-text { margin: 14px 0 0; font-size: clamp(16px, 1.6vw, 19px); color: rgba(242, 246, 250, 0.86); }
.ss-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 26px; }
.ss-btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: #fff; color: #0B1220; font-weight: 600; font-size: 15px; }
.ss-btn:hover { background: #E6F0F9; color: #0B1220; }
.ss-link { color: #fff; font-weight: 600; font-size: 15px; padding: 12px 0; }
.ss-link::after { content: " \203A"; }
.ss-link:hover { color: #86C6F5; }
.ss-slide a:focus-visible { outline-color: #fff; }
.ss-controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.ss-dots { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ss-dot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 44px; justify-content: center; padding: 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.ss-dot[aria-current="true"] { color: var(--text); }
.ss-dot-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ss-bar { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.ss-bar b { display: block; height: 100%; width: 0; background: var(--accent); }
.ss-dot[aria-current="true"] .ss-bar b { width: 100%; }
.slideshow.ss-run .ss-dot[aria-current="true"] .ss-bar b { width: 0; animation: ss-fill var(--ss-dur, 6s) linear forwards; }
@keyframes ss-fill { to { width: 100%; } }
.ss-arrows { display: flex; gap: 6px; }
.ss-ctl { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.ss-ctl:hover { border-color: var(--accent); color: var(--accent); }
.ss-ctl svg { width: 18px; height: 18px; }
@media (max-width: 700px) {
  .ss-track { aspect-ratio: 4 / 5; border-radius: 22px; }
  .ss-shade { background: linear-gradient(0deg, rgba(8, 14, 26, 0.85) 0%, rgba(8, 14, 26, 0.5) 45%, rgba(8, 14, 26, 0) 75%); }
  .ss-copy { top: auto; max-width: 100%; padding: 0 22px 26px; justify-content: flex-end; }
  .ss-dot-label { display: none; }
  .ss-dots { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-slide, .ss-slide.is-active { transition: none; }
  .ss-img, .ss-slide.is-active .ss-img { transform: none; transition: none; }
}

/* ===== Logo ===== */
.brand { display: inline-flex; align-items: center; padding: 6px 0; }
.brand img { height: 40px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
@media (max-width: 420px) { .brand img { height: 36px; } }

/* ===== Tip card media and icons ===== */
.hub-card { padding: 0; overflow: hidden; }
.hub-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.hub-media { position: relative; display: block; aspect-ratio: 16 / 7; background: var(--placeholder); overflow: hidden; }
.hub-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hub-card:hover .hub-media img { transform: scale(1.04); }
.hub-icon { position: absolute; left: 16px; bottom: -22px; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px var(--bg); }
.hub-media { overflow: visible; }
.hub-media img { border-radius: var(--radius) var(--radius) 0 0; }
.hub-body { padding-top: 32px; }
.ic { width: 26px; height: 26px; }
.ic-sm { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }
.tip-label { display: flex; align-items: center; }
@media (prefers-reduced-motion: reduce) { .hub-media img { transition: none; } }

/* ===== Security treatments ===== */
.center-text { text-align: center; }
.treat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; margin-top: 14px; }
.treat-col { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.treat-h { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--accent); display: flex; align-items: center; }
.treat ul { margin: 0; padding-left: 18px; font-size: 14px; }
.treat li { padding: 3px 0; }
.ig-race-box { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.ig-split.tight { gap: 0 24px; }

/* ===== Tire pressure ===== */
.gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.gauge { margin: 0; text-align: center; background: var(--surface-2); border-radius: 18px; padding: 14px 10px 16px; }
.gauge svg { width: 100%; max-width: 220px; display: block; margin: 0 auto; }
.g-track, .g-fill { fill: none; stroke-width: 14; stroke-linecap: round; }
.g-track { stroke: var(--border); }
.g-fill { stroke: var(--accent); transition: stroke-dasharray .3s ease; }
.g-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.g-hub { fill: var(--text); }
.gauge figcaption { display: flex; flex-direction: column; gap: 2px; }
.gauge strong { font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tp-warn { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c2) 18%, transparent); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .g-fill { transition: none; } }

/* ===== Calculator ===== */
.calc { outline: none; border-radius: 16px; }
.calc:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.calc-screen { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; text-align: right; margin-bottom: 10px; min-height: 76px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc-expr { font-size: 14px; color: var(--muted); min-height: 20px; overflow-wrap: anywhere; }
.calc-out { display: block; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.calc-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.calc-k { min-height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 19px; font-weight: 500; cursor: pointer; }
.calc-k:hover { border-color: var(--accent); }
.calc-k:active { transform: scale(0.97); }
.calc-k.fn { background: var(--surface-2); color: var(--text); }
.calc-k.op { background: var(--chip); color: var(--chip-text); font-weight: 700; }
.calc-k.eq { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }

/* ===== Wide widgets ===== */
.widget[data-widget="map"], .widget[data-widget="translate"] { grid-column: 1 / -1; }
@media (min-width: 1060px) {
  .widget[data-widget="map"], .widget[data-widget="translate"] { grid-column: span 2; }
}

/* ===== Translator ===== */
.tr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: start; }
.tr-pane { background: var(--surface-2); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; min-height: 210px; }
.tr-out-pane { background: var(--chip); }
.tr-top select { border: 0; background: transparent; font-weight: 600; color: var(--accent); padding-left: 0; min-height: 36px; max-width: 100%; }
.tr-pane textarea { flex: 1; min-height: 120px; resize: vertical; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 18px; line-height: 1.45; padding: 4px 0; }
.tr-pane textarea:focus { outline: none; }
.tr-pane:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.tr-out { flex: 1; display: block; font-size: 18px; line-height: 1.45; padding: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 120px; color: var(--text); }
.tr-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.tr-swap { align-self: center; margin-top: 0; }
@media (max-width: 640px) {
  .tr { grid-template-columns: minmax(0, 1fr); }
  .tr-swap { justify-self: center; transform: rotate(90deg); }
  .tr-pane { min-height: 0; }
}

/* ===== Map widget ===== */
.gmap { position: relative; }
.map-box { height: 420px; border-radius: 16px; overflow: hidden; background: var(--surface-2); position: relative; z-index: 0; }
.map-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gmap-search { position: absolute; top: 12px; left: 12px; right: 12px; max-width: 380px; z-index: 500; display: flex; flex-wrap: wrap; background: var(--surface); border-radius: 999px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }
.gmap-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 6px 0 18px; min-height: 46px; border-radius: 999px; font-size: 16px; color: var(--text); }
.gmap-search input:focus { outline: none; }
.gmap-search:focus-within { box-shadow: 0 0 0 2px var(--accent), 0 2px 10px rgba(0, 0, 0, 0.18); }
.gmap-go { width: 46px; height: 46px; border: 0; background: none; color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.gmap-go svg { width: 20px; height: 20px; }
.gmap-results { position: absolute; top: 52px; left: 0; right: 0; background: var(--surface); border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); padding: 6px 12px; max-height: 260px; overflow-y: auto; }
.gmap-results .result { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.gmap-results .result:last-child { border-bottom: 0; }
.gmap-err { position: absolute; top: 52px; left: 12px; background: var(--surface); padding: 6px 10px; border-radius: 10px; }
.gmap-layer { position: absolute; left: 12px; bottom: 26px; z-index: 500; width: 76px; height: 76px; padding: 0; border: 2px solid #fff; border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); background: var(--surface-2); }
.gmap-thumb { position: absolute; inset: 0; background-size: cover; background-position: center; }
.gmap-layer-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 5px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,0)); }
.gmap-layer:focus-visible, .gmap-here:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gmap-here { position: absolute; right: 10px; bottom: 104px; z-index: 500; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.gmap-here svg { width: 22px; height: 22px; }
.gmap .leaflet-bar { border: 0; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); border-radius: 10px; overflow: hidden; }
.gmap .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 20px; background: var(--surface); color: var(--text); border-color: var(--border); }
.gmap .leaflet-bar a:hover { background: var(--surface-2); }
.gmap .leaflet-bottom.leaflet-right { margin-bottom: 4px; }
.map-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; margin-top: 10px; }
.map-links { display: flex; gap: 16px; font-size: 14px; font-weight: 600; }
.map-links a { padding: 8px 0; }
.map-pin span { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: #EA4335; border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.leaflet-container { font: inherit; font-size: 12px; background: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  .leaflet-control-attribution { background: rgba(17, 26, 43, 0.85) !important; color: #93A4B5; }
  .leaflet-control-attribution a { color: #86C6F5; }
}
@media (max-width: 600px) { .map-box { height: 360px; } .gmap-layer { width: 64px; height: 64px; } }

/* ===== Risk map list ===== */
.risk-extra { margin-top: 10px; }
.risk-list summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 8px 0; }
.risk-list p { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.risk-list strong { color: var(--text); }
.map-tip a { font-weight: 600; }

/* =====================================================================
   Phase 2: editorial homepage, journal, tools panel, search
   ===================================================================== */
:root { --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", "Book Antiqua", Georgia, serif; }
.serif, .h2.serif, .display.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; }

/* Mark in the header follows light/dark */
.mark { width: 38px; height: 36px; display: block; }
.mark-acc { stroke: var(--accent); }
.mark-ink { stroke: var(--text); }
.brand { min-height: 44px; }

/* Header sits below the hero on the homepage and stays visible while scrolling */
.site-header { position: sticky; top: 0; }
.nav { gap: 12px; }
.nav-links { gap: 28px; }

/* ---------- Homepage hero ---------- */
.home-hero { position: relative; height: clamp(560px, 92vh, 920px); display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; background: #0E1A2B; color: #fff; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-dark { background: #1B2D45; }
.hero-shade { position: absolute; inset: 0; background: rgba(8, 14, 26, 0.32); }
.hero-center { position: relative; max-width: 600px; padding: 0 24px; }
.hero-mark { width: 84px; height: 80px; display: block; margin: 0 auto 22px; }
.hero-intro { margin: 0; font-family: var(--serif); font-size: clamp(19px, 2.4vw, 24px); line-height: 1.5; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
.hero-down { position: absolute; bottom: 18px; left: 50%; margin-left: -22px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; }
.hero-down:hover { color: #86C6F5; }
.hero-down svg { width: 28px; height: 28px; }
.hero-caption { position: absolute; right: 24px; bottom: 20px; margin: 0; font-size: 12px; line-height: 1.6; text-align: right; color: rgba(255, 255, 255, 0.82); }
@media (max-width: 600px) { .hero-caption { display: none; } }

/* ---------- Featured stories ---------- */
.featured { position: relative; padding-top: 56px; padding-bottom: 24px; padding-left: 64px; }
.vlabel { margin: 0; font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); writing-mode: vertical-rl; }
.featured > .vlabel { position: absolute; left: 22px; top: 60px; transform: rotate(180deg); }
.feat-row { display: flex; flex-wrap: wrap; gap: 28px; }
.feat { flex: 1 1 440px; min-width: 0; }
.feat-media { position: relative; display: block; color: var(--text); }
.feat-media.pair { display: flex; gap: 4px; }
.feat-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--placeholder); }
.feat-img.tall { aspect-ratio: 3 / 4.4; flex: 1; min-width: 0; }
.feat-img.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.vlabel.side { position: absolute; right: -20px; top: 0; font-size: 10px; }
.feat-title { margin: 16px 0 4px; font-size: 19px; }
.feat-title a { color: var(--text); }
.feat-title a:hover { color: var(--accent); }
.feat-text { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--muted); }
@media (max-width: 640px) { .featured { padding-left: 24px; } .featured > .vlabel { display: none; } .vlabel.side { display: none; } }

/* ---------- Journal cards ---------- */
.chips-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 24px; }
.chips-nav .filter { display: inline-flex; align-items: center; color: var(--text); }
.chips-nav .filter[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.entry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.entry-card[hidden] { display: none; }
.entry-media { display: block; aspect-ratio: 16 / 10; background: var(--placeholder); overflow: hidden; }
.entry-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.entry-img.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.entry-card:hover .entry-img { transform: scale(1.03); }
.entry-body { padding: 18px 22px 22px; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 13px; color: var(--muted); }
.tagchip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: 12px; font-weight: 600; }
a.tagchip:hover { color: var(--chip-text); text-decoration: underline; }
.entry-title { margin: 12px 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.25; }
.entry-title a { color: var(--text); }
.entry-title a:hover { color: var(--accent); }
.entry-stat { margin: 0; font-size: 15px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .entry-img { transition: none; } }

/* ---------- Journal entry page ---------- */
.entry-head { max-width: 820px; padding-top: 64px; text-align: center; }
.entry-head .entry-meta { justify-content: center; }
.entry-h1 { margin: 16px 0 0; font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 5.5vw, 60px); line-height: 1.08; letter-spacing: -0.015em; }
.entry-lede { margin: 16px auto 0; max-width: 640px; font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--muted); }
.entry-stats { margin: 14px 0 0; font-weight: 600; color: var(--accent); }
.entry-cover { margin: 40px auto 0; }
.entry-cover img { width: 100%; max-height: 80vh; object-fit: cover; border-radius: 6px; }
.entry-text { padding-top: 40px; padding-bottom: 24px; font-family: var(--serif); font-size: 20px; line-height: 1.7; }
.entry-text h2, .entry-text h3, .entry-text h4 { font-family: var(--font); letter-spacing: -0.01em; }
.entry-text img { border-radius: 6px; margin: 8px auto; }
.entry-text figure { margin: 28px 0; }
.entry-text blockquote { margin: 24px 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.entry-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; padding-bottom: 40px; }
.entry-gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: var(--placeholder); }
.entry-gallery img { width: 100%; height: 100%; object-fit: cover; }
.entry-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding-top: 24px; padding-bottom: 80px; border-top: 1px solid var(--border); }
.entry-nav a { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.entry-nav .right { text-align: right; align-items: flex-end; }
.entry-all { padding: 10px 0; }
@media (max-width: 640px) { .entry-nav { grid-template-columns: 1fr; } .entry-nav .right { text-align: left; align-items: flex-start; } }

/* ---------- Security consulting band ---------- */
.consult { background: #0B1220; color: #E8EEF5; --text: #E8EEF5; --muted: #93A4B5; --accent: #5AB0F0; --accent-hover: #86C6F5; --on-accent: #0B1220; --border: #22304A; --surface: #111A2B; --surface-2: #16223A; --bg: #0B1220; --placeholder: #1A2740; --risk-none: #26344D; --risk-low: #2D5A84; --risk-elevated: #5AB0F0; --risk-high: #E59A4C; --risk-severe: #C4561E; }
.consult .h2 { color: #fff; }
.consult-top { display: flex; flex-wrap: wrap; gap: 48px; padding-top: 88px; padding-bottom: 32px; }
.consult-intro { flex: 1 1 440px; min-width: 0; }
.consult-intro .badge { display: inline-flex; margin-top: 24px; }
.lead.left { margin-left: 0; }
.btns.left { justify-content: flex-start; align-items: center; }
.consult-services { flex: 1 1 440px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-content: start; }
.svc { background: #111A2B; border: 1px solid #22304A; border-radius: 18px; padding: 20px; }
.svc h3 { margin: 0 0 6px; font-size: 17px; color: #fff; }
.svc p { margin: 0; font-size: 14px; color: #93A4B5; }
.consult-map { padding-bottom: 88px; }
.consult .card { background: #111A2B; }

/* ---------- Tools panel ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(400px, 100vw); background: var(--bg); border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--border); }
.drawer-head .h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.drawer-body .widget { padding: 16px; }
.drawer-body .tr { grid-template-columns: minmax(0, 1fr); }
.drawer-body .tr-swap { justify-self: center; transform: rotate(90deg); }
.drawer-body .tr-pane { min-height: 0; }
.drawer-more { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-more .pill[aria-expanded="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.drawer-tab { position: fixed; right: 0; top: 45vh; z-index: 80; writing-mode: vertical-rl; padding: 16px 10px; border: 0; border-radius: 14px 0 0 14px; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
.drawer-tab:hover { background: var(--accent-hover); }
.drawer-tab[hidden] { display: none; }
@media (max-width: 600px) { .drawer-tab { top: auto; bottom: 90px; } }

/* ---------- Search ---------- */
.search-dlg { width: min(640px, calc(100vw - 32px)); margin-top: 10vh; padding: 0; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); }
.search-dlg::backdrop { background: rgba(8, 14, 26, 0.5); }
.search-form { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--border); }
.search-form input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 19px; color: var(--text); min-height: 48px; }
.search-form input:focus { outline: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.search-results li { padding: 0; }
.search-results li.muted { padding: 12px; }
.search-results a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; color: var(--text); font-weight: 600; }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface-2); }

/* Area pages */
.area-tool { margin-top: 8px; }

/* ===== Route maps (from GPX files) ===== */
.route { margin-top: 32px; display: grid; gap: 12px; }
.route-box { background: var(--surface-2); border-radius: 14px; padding: 8px; }
.route-map, .route-mini { width: 100%; height: auto; display: block; }
.route-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.route-mini .route-line { stroke-width: 6; }
.route-start { fill: var(--good); stroke: var(--bg); stroke-width: 3; }
.route-end { fill: var(--bad); stroke: var(--bg); stroke-width: 3; }
.elev-box { position: relative; background: var(--surface-2); border-radius: 14px; padding: 12px 12px 6px; }
.elev-box .small { position: absolute; top: 8px; left: 14px; }
.elev { width: 100%; height: 120px; display: block; }
.elev-fill { fill: var(--accent); opacity: 0.18; }
.elev-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.route-card { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--surface-2); padding: 12px; }
.feat-img.route-card { aspect-ratio: 4 / 3; }
.route-box .route-map { max-height: 480px; margin: 0 auto; }

/* ===== Farm records app ===== */
.fa { padding-top: 48px; padding-bottom: 80px; }
.fa-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 24px; }
.fa-head .h2 { margin: 0; }
.fa-user { margin: 0; }
.fa-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 18px; }
.fa-bar .lbl { margin: 0; }
.fa-spacer { flex: 1; }
a.pill { color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.kpi strong { display: block; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.fa-form, .fa-import { margin-bottom: 18px; }
.fa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0 14px; }
.fa-grid .wide { grid-column: span 2; }
@media (max-width: 480px) { .fa-grid .wide { grid-column: auto; } }
.fa-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars { list-style: none; margin: 8px 0 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 1.2fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .link-btn { padding: 6px 4px; margin-left: 6px; }
.link-btn.danger { color: var(--bad); }
#fa-q { min-height: 40px; }
.fa-import input[type=file] { margin: 8px 0; font: inherit; }

/* ===== Public farm tools ===== */
.ft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.wx-farm-days { list-style: none; margin: 10px 0 0; padding: 0; }
.wx-farm-days li { display: grid; grid-template-columns: 64px 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.spray { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.spray.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.spray.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.cal { overflow-x: auto; }
.cal table { min-width: 640px; font-size: 13px; }
.cal td.m { padding: 4px 2px; text-align: center; }
.cal i { display: block; height: 18px; border-radius: 4px; }
.cal .plant { background: var(--accent); }
.cal .harvest { background: var(--c2); }
.cal .both { background: linear-gradient(90deg, var(--accent) 50%, var(--c2) 50%); }
.cal th.m { text-align: center; padding: 6px 2px; }
.fert-out { margin-top: 12px; }
.fert-out table { min-width: 0; }
.tracker-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.plant-key, .harvest-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.plant-key { background: var(--accent); } .harvest-key { background: var(--c2); }
.cal th[scope=row] { font-weight: 600; min-width: 170px; padding-right: 12px; }
.cal-note { display: block; font-weight: 400; }
.cal th.now { color: var(--accent); }
.fz-products { border: 0; padding: 0; margin: 8px 0 0; }
.fz-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; align-items: center; }
.fz-row input[type=number] { width: 100%; }

/* Phase 3 fixes: let grid columns shrink so wide tables scroll inside their card,
   keep hidden pill buttons hidden, and keep dates on one line. */
.fa-cols > *, .fa-grid > * { min-width: 0; }
.table-wrap, .cal { position: relative; } /* keeps screen-reader labels inside the scroll box */
.pill[hidden], .btn[hidden] { display: none; }
#fa-table td:first-child { white-space: nowrap; }

/* Farm sharing */
.fa-farmbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -6px 0 18px; }
.fa-farmbar .lbl { margin: 0; }
.role-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.role-badge.viewer { color: var(--accent); border-color: var(--accent); }
.fa-share { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 12px 0 4px; }
.fa-share .field { margin: 0; }
@media (max-width: 640px) { .fa-share { grid-template-columns: 1fr; } }
.people { list-style: none; margin: 12px 0 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.people-email { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
td .by { display: block; }

/* Setup checklist and hidden farm bar */
.fa-farmbar[hidden] { display: none; }
.setup { text-align: left; max-width: 720px; margin: 0 auto; }
.setup-list { list-style: none; padding: 0; margin: 14px 0; }
.setup-list li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 15px; }
.setup-list li span { display: inline-block; width: 1.4em; font-weight: 700; }
.setup-list .done span { color: #2E9E6A; }
.setup-list .todo span, .setup-list .todo strong:last-child { color: #D2553F; }
.setup code { font-size: 0.9em; overflow-wrap: anywhere; }
