/* ==========================================================================
   Samoa.si — App UI layer
   Loaded after styles.css. Re-skins the shell, typography, cards and controls
   for a mobile-first "app" feel, and adds the components the new pages use:
   the glance hero, horizontal snap rails, the bottom tab bar, the desk sheet
   and the data-visualisation primitives.

   Nothing here depends on a page-specific class being absent: every rule is a
   refinement of the existing markup, so pages that were not touched still get
   the new shell and card language.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* The old palette names are remapped, not removed: every rule in styles.css
     keeps working while the whole site moves to the refreshed palette. */
  --paper: #f1f3ec;
  --white: #ffffff;
  --ink: #101d17;
  --muted: #6b7a70;
  --green: #0f4c3d;
  --green-deep: #0a3229;
  --green-light: #e4efe4;
  --lime: #c8f26c;
  --line: #e2e6d9;
  --amber: #d9663c;

  /* New tokens */
  --surface: #ffffff;
  --surface-2: #f7f8f3;
  --surface-3: #eef1e7;
  --surface-glass: rgba(255, 255, 255, .72);
  --brand: #0a3229;
  --brand-2: #11543f;
  --brand-3: #1c6b52;
  --accent: #b9ee5f;
  --accent-ink: #16300a;
  --sky: #2f9fd4;
  --sun: #f3b64a;
  --coral: #ec6a4e;
  --danger: #cf4436;
  --ok: #2f8b5c;
  --violet: #7b6bd6;
  --teal: #2aa79b;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-2xl: 34px;

  --shadow-xs: 0 1px 2px rgba(12, 32, 24, .05);
  --shadow-sm: 0 1px 2px rgba(12, 32, 24, .04), 0 8px 20px -14px rgba(12, 32, 24, .3);
  --shadow-md: 0 2px 4px rgba(12, 32, 24, .04), 0 18px 40px -24px rgba(12, 32, 24, .38);
  --shadow-lg: 0 30px 70px -40px rgba(8, 40, 32, .6);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --font-display: 'Fraunces', Georgia, serif;
  --shell-max: 1240px;
  --gutter: clamp(14px, 4vw, 40px);
  --tabbar-h: 62px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(199, 236, 160, .34), transparent 62%),
    radial-gradient(900px 520px at -10% 4%, rgba(190, 224, 229, .3), transparent 58%),
    var(--paper);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { color: var(--accent-ink); background: var(--accent); }

h1, h2, h3, h4 { letter-spacing: -.024em; text-wrap: balance; }
h1 em, h2 em, h3 em { font-style: normal; }
p { text-wrap: pretty; }

strong, b { font-weight: 650; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Slim, unobtrusive scrollbars (desktop). */
* { scrollbar-width: thin; scrollbar-color: rgba(16, 29, 23, .22) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(16, 29, 23, .18); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(16, 29, 23, .3); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Shell
   -------------------------------------------------------------------------- */

.app-shell {
  max-width: var(--shell-max);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 var(--gutter);
  background: none;
}

.maf-shell { background: none; }

main { padding-bottom: 28px; }

/* Mobile: leave room for the fixed tab bar. */
@media (max-width: 899px) {
  body { padding-bottom: 0; }
  .app-shell {
    padding-bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  }
}

/* --------------------------------------------------------------------------
   4. Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  background: rgba(241, 243, 236, .78);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 29, 23, .12) 18%, rgba(16, 29, 23, .12) 82%, transparent);
  content: '';
  pointer-events: none;
}

/* The bar lifts off the page once you scroll. */
.is-scrolled .topbar {
  border-bottom-color: transparent;
  background: rgba(244, 246, 239, .93);
  box-shadow: 0 10px 30px -24px rgba(9, 36, 27, .55);
}

.brand { gap: 10px; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--brand-3), var(--brand));
  box-shadow: 0 6px 16px -8px rgba(10, 50, 41, .75), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.brand-mark svg { width: 27px; stroke-width: 1.6; }

.brand-name {
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.brand-name > span { color: var(--amber); }

.brand-name small {
  margin-top: 3px;
  color: var(--muted);
  font: 500 8px/1 var(--font-mono);
  letter-spacing: .16em;
}

.topbar-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}

.topbar-right::-webkit-scrollbar { display: none; }

.topbar-right > a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: none;
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.topbar-right > a svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.7;
  opacity: .85;
}

.topbar-right > a:hover,
.topbar-right > a:focus-visible {
  color: var(--brand);
  background: rgba(255, 255, 255, .85);
}

.topbar-right > a:hover svg { opacity: 1; }

/* ui.js marks the current desk. */
.topbar-right > a[aria-current='page'] {
  color: var(--surface);
  background: var(--brand);
  box-shadow: 0 8px 18px -12px rgba(10, 50, 41, .9);
}

.topbar-right > a[aria-current='page'] svg { opacity: 1; }

.island-label { display: none; }

/* Some pages put one or two contextual links directly in the bar (Parliament,
   the map). They become quiet pills on desktop and fold away on a phone. */
.topbar > a:not(.brand) {
  padding: 8px 11px;
  color: var(--muted);
  border-radius: 999px;
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.topbar > a:not(.brand):hover { color: var(--brand); background: rgba(255, 255, 255, .85); }

@media (max-width: 899px) {
  .topbar > a:not(.brand) { display: none; }
}

/* Install + injected actions */
.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: var(--brand);
  border: 1px solid rgba(16, 29, 23, .1);
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-xs);
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}

.icon-button:hover { border-color: rgba(16, 29, 23, .2); background: #fff; transform: translateY(-1px); }

.icon-button svg { width: 18px; height: 18px; }

.install-button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}

.install-button svg { width: 16px; height: 16px; }

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.topbar-menu {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

/* The legacy nav is a desktop rail; below 900px the tab bar takes over. */
@media (max-width: 899px) {
  .topbar { min-height: 58px; }
  .topbar-right { display: none; }
  .topbar-menu { display: grid; }
  .brand-name { font-size: 17px; }
  .brand-name small { display: none; }
}

/* --------------------------------------------------------------------------
   5. Page headers (inner desks)
   -------------------------------------------------------------------------- */

.maf-hero,
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: end;
  gap: 22px clamp(18px, 4vw, 44px);
  padding: clamp(22px, 4vw, 40px) 0 clamp(16px, 2.4vw, 24px);
}

.page-heading { grid-template-columns: minmax(0, 1fr) auto; }

.maf-hero h1,
.page-heading h1 {
  max-width: 20ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.95rem, 4.4vw, 3rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.maf-hero h1 em,
.page-heading h1 em {
  color: var(--brand-3);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.02em;
}

.maf-hero h1 em { white-space: normal; }

.maf-deck,
.home-deck {
  max-width: 58ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.62;
}

/* Source stamp becomes a glass card. */
.maf-source-stamp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.maf-source-stamp > span:last-child { grid-column: auto; }

.maf-source-stamp .stamp-label {
  color: var(--brand-3);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.maf-source-stamp strong { color: var(--ink); font-size: 13.5px; font-weight: 650; }

.maf-source-stamp > span:last-child { color: var(--muted); font-size: 10.5px; line-height: 1.5; }

@media (max-width: 760px) {
  .maf-hero,
  .page-heading { grid-template-columns: 1fr; align-items: start; gap: 16px; }
  .maf-source-stamp { width: 100%; }
  .maf-hero h1,
  .page-heading h1 { max-width: none; }
}

/* --------------------------------------------------------------------------
   6. Eyebrows, stamps, notes
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  color: var(--brand-3);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
  opacity: .55;
}

.home-card-head .eyebrow::before,
.hub-section-heading .eyebrow::before { opacity: 1; }

.home-stamp,
.maf-source-stamp .stamp-label {
  color: var(--muted);
  font: 500 10px/1.3 var(--font-mono);
  letter-spacing: .01em;
  white-space: nowrap;
}

/* Farm stamps carry a full sentence ("model estimate, confirm with MAF"), so
   they have to wrap — a nowrap here widened the whole page on a phone. */
.farm-stamp {
  color: var(--muted);
  font: 500 10px/1.3 var(--font-mono);
  letter-spacing: .01em;
  white-space: normal;
}

.section-note {
  color: var(--muted);
  font: 500 10.5px/1.5 var(--font-mono);
}

/* --------------------------------------------------------------------------
   7. Snapshot strip → stat cards / horizontal rail on phones
   -------------------------------------------------------------------------- */

.maf-snapshot {
  display: flex;
  gap: 10px;
  margin: 4px 0 clamp(22px, 3vw, 34px);
  padding: 2px 2px 10px;
  border: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.maf-snapshot::-webkit-scrollbar { display: none; }

.snapshot-item {
  display: flex;
  min-width: 0;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  scroll-snap-align: start;
}

.snapshot-item:first-child,
.snapshot-item:last-child { padding: 14px 16px; border-right: 1px solid var(--line); }

.snapshot-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--amber);
  border-radius: 7px;
  background: rgba(217, 102, 60, .1);
  font: 600 9.5px/1 var(--font-mono);
}

.snapshot-item small {
  margin: 0;
  color: var(--muted);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.snapshot-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.01em;
}

@media (min-width: 900px) {
  /* The desktop bar keeps the five daily desks visible and puts the rest one
     tap away in the desk sheet. */
  .topbar-right > a { display: none; }

  .topbar-right > a.weather-nav-link,
  .topbar-right > a.news-nav-link,
  .topbar-right > a.farm-nav-link,
  .topbar-right > a.jobs-nav-link,
  .topbar-right > a.tenders-nav-link { display: inline-flex; }

  /* The original stylesheet hides every label once the bar is "crowded";
     the five desks that stay on the desktop bar keep theirs. */
  .topbar-right.is-crowded > a.weather-nav-link span,
  .topbar-right.is-crowded > a.news-nav-link span,
  .topbar-right.is-crowded > a.farm-nav-link span,
  .topbar-right.is-crowded > a.jobs-nav-link span,
  .topbar-right.is-crowded > a.tenders-nav-link span { display: inline; }

  .topbar-desks {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 13px 0 11px;
    color: var(--brand);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    font: 600 10px/1 var(--font-mono);
    letter-spacing: .05em;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  }

  .topbar-desks svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .topbar-desks:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
}

@media (max-width: 899px) {
  .topbar-desks { display: none; }
}

/* The glance card uses the width on a large screen instead of stacking. */
@media (min-width: 900px) {
  .glance {
    display: grid;
    grid-template-columns: minmax(300px, .85fr) minmax(0, 1.55fr);
    grid-template-areas:
      'head head'
      'main chart'
      'chips chips'
      'day day'
      'foot foot';
    align-items: center;
    column-gap: clamp(22px, 3vw, 44px);
  }

  .glance-head { grid-area: head; }
  .glance-main { grid-area: main; margin-top: 10px; }
  .glance-chart { grid-area: chart; margin-top: 10px; padding-top: 0; border-top: 0; }
  .glance-chips { grid-area: chips; margin-top: 18px; }
  .glance-day { grid-area: day; }
  .glance-foot { grid-area: foot; }
}

/* Keep a lone third stat from looking like a broken grid on phones. */
@media (max-width: 899px) {
  .viz-band .viz-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Snapshot figures become a swipeable strip with a soft edge. */
  .snapshot-item { flex: 0 0 auto; min-width: min(72vw, 260px); }

  .maf-snapshot {
    margin-right: calc(var(--gutter) * -1);
    padding-right: calc(var(--gutter) + 28px);
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
}

/* --------------------------------------------------------------------------
   8. Hub sections
   -------------------------------------------------------------------------- */

.hub-section {
  padding-top: 0;
  margin-top: clamp(24px, 4vw, 38px);
}

.hub-section:first-of-type { margin-top: clamp(18px, 2.6vw, 26px); }

.hub-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 14px;
}

.hub-section-heading .eyebrow { margin-bottom: 5px; }

.hub-section-heading h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -.03em;
}

/* --------------------------------------------------------------------------
   9. Cards — one surface language for every desk
   -------------------------------------------------------------------------- */

.home-card,
.job-card,
.job-dept-card,
.job-source-card,
.tender-card,
.tender-dept-card,
.gov-card,
.resource-card,
.ev-card,
.news-card,
.bx-card,
.rental-card,
.rental-dir-card,
.rental-lv-card,
.ship-ferry-card,
.place-item,
.securities-item,
.farm-panel,
.newsline {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}

.home-card { padding: 17px 17px 15px; }

.home-card:hover,
.job-card:hover,
.tender-card:hover,
.gov-card:hover,
.resource-card:hover,
.ev-card:hover,
.news-card:hover,
.bx-card:hover,
.rental-dir-card:hover,
.place-item:hover {
  border-color: rgba(16, 76, 61, .22);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.home-card h2 {
  margin: 1px 0 10px;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.home-body { display: grid; gap: 2px; margin-bottom: 12px; }

.home-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(16, 29, 23, .08);
}

.home-row:last-child { border-bottom: 0; }

.home-row-label {
  flex: 0 0 auto;
  color: var(--muted);
  font: 600 9.5px/1.3 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.home-row-value {
  min-width: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.home-row-value.is-good { color: var(--ok); }
.home-row-value.is-alert { color: var(--danger); }
.home-row-value.is-muted { color: var(--muted); font-weight: 500; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 12px 8px 13px;
  color: var(--brand);
  border: 1px solid rgba(16, 76, 61, .14);
  border-radius: 999px;
  background: rgba(228, 239, 228, .55);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .24s var(--ease), color .24s var(--ease), transform .24s var(--ease), border-color .24s var(--ease);
}

.home-link span { transition: transform .24s var(--ease); }

.home-card:hover .home-link { background: var(--brand); color: #fff; border-color: var(--brand); }
.home-card:hover .home-link span { transform: translate(2px, -2px); }

.home-link:hover,
.home-link:focus-visible { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }

.home-news-item {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid rgba(16, 29, 23, .07);
  text-decoration: none;
}

.home-news-item:first-child { padding-top: 2px; border-top: 0; }

.home-news-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
}

.home-news-meta {
  color: var(--muted);
  font: 500 9.5px/1.3 var(--font-mono);
}

.home-news-item:hover .home-news-title { color: var(--brand-3); }

.home-weather-headline { display: flex; align-items: baseline; gap: 9px; margin: 2px 0 6px; }
.home-temp { font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.home-cond { color: var(--brand-3); font-size: 12.5px; }

.home-jobs-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.farm-loading,
.farm-error,
.loading-copy {
  margin: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.farm-error { color: var(--danger); }

/* --------------------------------------------------------------------------
   10. Landing — greeting
   -------------------------------------------------------------------------- */

.greet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px 24px;
  padding: clamp(18px, 3vw, 32px) 0 clamp(14px, 2vw, 20px);
}

.greet-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--brand-3);
  font: 600 10.5px/1.2 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.greet-title {
  max-width: 18ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.04em;
}

.greet-title em {
  color: var(--brand-3);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.02em;
}

.greet-sub {
  max-width: 46ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.greet-actions { display: flex; align-items: center; gap: 8px; }

.greet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}

.greet-chip:hover { border-color: rgba(16, 76, 61, .25); }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47, 139, 92, .16);
  animation: live-pulse 2.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47, 139, 92, .16); }
  50% { box-shadow: 0 0 0 6px rgba(47, 139, 92, .04); }
}

@media (max-width: 760px) {
  .greet { grid-template-columns: 1fr; }
  .greet-title { max-width: none; }
}

/* Search — compact app pill */
.home-search { position: relative; max-width: none; margin: 0 0 clamp(14px, 2vw, 18px); }

.home-search-box {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  color: var(--brand-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.home-search-box:hover { border-color: rgba(16, 76, 61, .25); }

.home-search-box:focus-within {
  border-color: var(--brand-3);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(17, 84, 63, .12), var(--shadow-sm);
}

.home-search-box svg { width: 18px; height: 18px; }

.home-search-box input { font-size: 14.5px; }

.home-search-box kbd {
  display: none;
  padding: 3px 6px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font: 500 10px/1 var(--font-mono);
}

@media (min-width: 760px) { .home-search-box kbd { display: inline-block; } }

.home-search-results {
  top: calc(100% + 8px);
  padding: 8px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.home-search-group + .home-search-group { border-top-color: var(--line); }

.home-search-heading { color: var(--muted); font: 600 9.5px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }

.home-search-item { padding: 9px 10px; border-radius: var(--r-sm); }
.home-search-item:hover, .home-search-item:focus-visible { background: var(--surface-2); }
.home-search-title { font-size: 13px; }
.home-search-meta { font: 500 9.5px/1.3 var(--font-mono); }

/* --------------------------------------------------------------------------
   11. Landing — the glance hero
   -------------------------------------------------------------------------- */

.glance {
  position: relative;
  overflow: hidden;
  margin-top: 6px;
  padding: clamp(17px, 2.6vw, 26px);
  color: #e9f2ea;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-2xl);
  background:
    radial-gradient(120% 120% at 100% -10%, rgba(28, 107, 82, .95) 0%, rgba(13, 62, 48, .96) 46%, #082a22 100%);
  box-shadow: 0 40px 80px -48px rgba(6, 34, 26, .9), inset 0 1px 0 rgba(255, 255, 255, .1);
  isolation: isolate;
}

.glance::before {
  position: absolute;
  top: -140px;
  right: -80px;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 242, 108, .5), rgba(200, 242, 108, 0) 66%);
  content: '';
  filter: blur(10px);
}

.glance::after {
  position: absolute;
  bottom: -160px;
  left: -120px;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 159, 212, .34), rgba(47, 159, 212, 0) 68%);
  content: '';
}

.glance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.glance-place {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.glance-place strong { font-weight: 600; }
.glance-place span:last-child { color: rgba(233, 242, 234, .6); }
.glance-place .live-dot { box-shadow: 0 0 0 3px rgba(200, 242, 108, .2); background: var(--accent); }

.glance .home-stamp { color: rgba(233, 242, 234, .62); }

.glance-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  margin-top: clamp(14px, 2.4vw, 22px);
}

.glance-temp-wrap { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }

.glance-deg {
  color: #f7fbf3;
  font-size: clamp(3.6rem, 12vw, 5.6rem);
  font-weight: 500;
  line-height: .86;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}

.glance-deg sup {
  top: -.55em;
  font-size: .42em;
  font-weight: 500;
  letter-spacing: 0;
  opacity: .8;
}

.glance-cond-block { padding-bottom: 6px; }
.glance-cond { margin: 0; color: #f2f8ed; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.glance-feels { margin: 3px 0 0; color: rgba(233, 242, 234, .66); font: 500 11px/1.4 var(--font-mono); }

.glance-side {
  display: grid;
  place-items: center;
  min-width: 108px;
}

.glance-chart {
  margin: clamp(12px, 2vw, 18px) 0 0;
  padding: 4px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.glance-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.glance-chips .home-row {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .055);
  text-align: left;
}

.glance-chips .home-row-label { color: rgba(233, 242, 234, .58); font-size: 9px; }
.glance-chips .home-row-value { color: #f4f9ef; font-size: 13px; text-align: left; }
.glance-chips .home-row-value.is-good { color: var(--accent); }
.glance-chips .home-row-value.is-alert { color: #ffb4a2; }
.glance-chips .home-row-value.is-muted { color: rgba(233, 242, 234, .6); }

.glance-day {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.glance-panel {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .055);
}

.glance-panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  color: rgba(233, 242, 234, .62);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.glance-panel-title span { color: #eaf4e5; letter-spacing: 0; text-transform: none; }

.glance-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.glance-note { color: rgba(233, 242, 234, .5); font: 500 9.5px/1.35 var(--font-mono); }

.glance .home-link {
  color: var(--accent-ink);
  border-color: transparent;
  background: var(--accent);
  margin-top: 0;
}

.glance .home-link:hover { background: #d2ff7a; color: var(--accent-ink); }

@media (min-width: 700px) {
  .glance-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .glance-day { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   12. Landing — satellite band
   -------------------------------------------------------------------------- */

.sat-hero {
  margin-top: clamp(14px, 2.2vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: var(--brand);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sat-hero .sat-stage { border-radius: 0; }

.sat-hero-copy { padding: clamp(18px, 3vw, 30px); }
.sat-hero-copy h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); letter-spacing: -.035em; }

@media (max-width: 899px) {
  .sat-hero { margin-inline: calc(var(--gutter) * -1); border-right: 0; border-left: 0; border-radius: 0; }
}

/* --------------------------------------------------------------------------
   13. Rails — the swipeable card shelves
   -------------------------------------------------------------------------- */

.rail { margin-top: clamp(24px, 4vw, 36px); }

.rail-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.rail-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 650;
  letter-spacing: -.032em;
}

.rail-head .eyebrow { margin-bottom: 5px; }

.rail-tools { display: flex; align-items: center; gap: 6px; }

.rail-count {
  margin-right: 4px;
  color: var(--muted);
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rail-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease), opacity .2s var(--ease);
}

.rail-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.rail-arrow:hover:not(:disabled) { background: var(--brand); color: #fff; transform: translateY(-1px); }
.rail-arrow:disabled { opacity: .32; cursor: default; }

@media (max-width: 899px) { .rail-arrow { display: none; } }

.rail-track {
  display: flex;
  gap: 11px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail-track::-webkit-scrollbar { display: none; }

.rail-track > * {
  flex: 0 0 min(84%, 356px);
  scroll-snap-align: start;
  scroll-margin-left: var(--gutter);
}

.rail-track > .is-wide { flex-basis: min(92%, 640px); }

/* First/last card breathing room; the fade hints that more is off-screen. */
.rail-wrap { position: relative; }

.rail-wrap::after {
  position: absolute;
  z-index: 3;
  top: 0;
  right: calc(var(--gutter) * -1);
  bottom: 14px;
  width: 88px;
  background: linear-gradient(90deg, rgba(241, 243, 236, 0), rgba(241, 243, 236, .9) 42%, var(--paper) 74%);
  content: '';
  pointer-events: none;
  opacity: 1;
  transition: opacity .25s var(--ease);
}

.rail-wrap.is-end::after { opacity: 0; }

@media (min-width: 900px) {
  .rail-track { gap: 14px; padding-bottom: 16px; scroll-snap-type: x proximity; }
  .rail-track > * { flex-basis: 340px; }
  .rail-track > .is-wide { flex-basis: 560px; }
}

@media (min-width: 1180px) {
  .rail-track > * { flex-basis: 356px; }
  .rail-track > .is-wide { flex-basis: 680px; }
}

.rail-progress {
  position: relative;
  height: 3px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: rgba(16, 29, 23, .08);
  overflow: hidden;
}

.rail-progress span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-3), var(--accent));
  transition: transform .12s linear, width .2s var(--ease);
}

@media (min-width: 900px) { .rail-progress { display: none; } }

/* Keyboard focus on the rail itself should show a ring. */
.rail-track:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; border-radius: 18px; }

/* --------------------------------------------------------------------------
   14. Landing — all-desks index
   -------------------------------------------------------------------------- */

.desk-index { margin-top: clamp(30px, 5vw, 46px); }

.desk-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.desk-index-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: transform .24s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease);
}

.desk-index-link:hover {
  border-color: rgba(16, 76, 61, .24);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.desk-index-link svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: var(--brand-3); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.desk-index-link strong { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; }
.desk-index-link small { display: block; margin-top: 1px; color: var(--muted); font: 500 9.5px/1.3 var(--font-mono); }

@media (max-width: 620px) {
  /* A tidy two-column index: the name is the tap target, the description is
     carried by the desk sheet. */
  .desk-index-link { padding: 11px 12px; }
  .desk-index-link small { display: none; }
  .desk-index-link strong { font-size: 12px; }
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */

.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: clamp(28px, 4vw, 44px);
  padding: 18px 0 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font: 500 10px/1.5 var(--font-mono);
}

.app-footer > span { color: var(--muted); }
.app-footer > span:last-of-type { color: var(--brand-3); }

.footer-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
}

.footer-topics-label {
  color: var(--brand);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .1em;
}

.footer-topics a {
  padding: 6px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  font: 500 9.5px/1 var(--font-mono);
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.footer-topics a:hover,
.footer-topics a:focus-visible {
  color: var(--brand);
  border-color: rgba(16, 76, 61, .25);
  background: #fff;
  text-decoration: none;
}

.footer-topics-all { color: var(--brand) !important; }

/* --------------------------------------------------------------------------
   16. Ticker
   -------------------------------------------------------------------------- */

.news-ticker { gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.news-ticker-label {
  padding: 5px 9px;
  background: var(--brand);
  font: 600 9px/1 var(--font-mono);
  letter-spacing: .12em;
}

.news-ticker a { font-size: 12.5px; }
.news-ticker-outlet { font: 500 9px/1 var(--font-mono); }
.news-ticker-all { color: var(--brand-3); font: 600 9px/1 var(--font-mono); }

@media (max-width: 620px) {
  .news-ticker { margin-inline: calc(var(--gutter) * -1); padding: 7px var(--gutter); }
}

/* The live Faleolo observation strip */
.observation-panel {
  margin: 0 0 clamp(14px, 2.2vw, 20px);
  padding: 16px 18px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.observation-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  color: var(--brand-3);
  border-radius: 12px;
  background: rgba(56, 111, 114, .1);
}

.observation-heading .eyebrow { color: var(--brand-3); }
.observation-heading h2 { font-size: 1rem; letter-spacing: -.02em; }
.station-detail { font-size: 10.5px; }
.observation-state { color: var(--brand-3); font: 600 9px/1.3 var(--font-mono); letter-spacing: .06em; }
.observation-state time { color: var(--muted); font: 500 9px/1.3 var(--font-mono); }

.station-metrics {
  gap: 10px;
  margin-top: 12px;
  border-top-color: var(--line);
}

.station-metrics small {
  margin-bottom: 3px;
  color: var(--muted);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.station-metrics strong {
  color: var(--ink);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -.03em;
}

.station-footnote { color: var(--muted); font-size: 10px; }
.station-footnote a { color: var(--brand-3); }

/* --------------------------------------------------------------------------
   16b. Weather desk components (the page predates the card language)
   -------------------------------------------------------------------------- */

.current-panel,
.advice-panel {
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
}

.current-panel {
  padding: 22px 22px 18px;
  background:
    radial-gradient(120% 120% at 100% -10%, rgba(28, 107, 82, .9) 0%, rgba(10, 50, 41, .97) 58%, #082a22 100%);
}

.current-panel .temperature {
  font-size: clamp(3.4rem, 11vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: .9;
}

.current-panel .condition-label {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: .06em;
}

.current-panel .today-label { color: rgba(233, 242, 234, .66); font: 600 9.5px/1 var(--font-mono); letter-spacing: .1em; }

.current-panel .current-stats { gap: 8px; }

.current-panel .weather-art svg { width: 88px; height: 88px; stroke-width: 1.4; }

.advice-panel { padding: 20px 20px 16px; background: var(--surface); }

.advice-item { border-bottom-color: rgba(16, 29, 23, .08); }
.advice-item p { font-size: 12px; line-height: 1.55; }

.advice-number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--brand-3);
  border-radius: 8px;
  background: var(--green-light);
  font: 600 9.5px/1 var(--font-mono);
}

/* The hourly strip becomes a swipeable rail instead of a clipped grid. */
.hourly-forecast {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(74px, 1fr);
  grid-template-columns: none;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.hourly-forecast::-webkit-scrollbar { display: none; }

.hour-item {
  min-height: 118px;
  padding: 11px 8px 10px;
  border: 1px solid rgba(16, 29, 23, .06);
  border-radius: var(--r-md);
  background: var(--surface-2);
  scroll-snap-align: start;
}

.hour-item:first-child { border-color: rgba(17, 84, 63, .3); background: rgba(228, 239, 228, .55); }
.hour-time { font: 600 9px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.hour-temp { font-size: 13px; }
.hour-rain { color: var(--sky); font: 500 9px/1.3 var(--font-mono); }

.week-table-wrap {
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

.week-row { transition: background .18s var(--ease); }
.week-row:hover { background: var(--surface-2); }
.week-header { font: 600 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.brief-item {
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.brief-item strong { font-size: clamp(1.1rem, 3vw, 1.35rem); letter-spacing: -.03em; }

@media (max-width: 620px) {
  .brief-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* --------------------------------------------------------------------------
   17. Bottom tab bar (phones / small tablets)
   -------------------------------------------------------------------------- */

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(16, 29, 23, .08);
  background: rgba(249, 250, 246, .9);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 -24px 44px -34px rgba(9, 36, 27, .5);
}

@media (max-width: 899px) { .tabbar { display: grid; } }

.tabbar-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px 3px;
  color: var(--muted);
  border: 0;
  border-radius: 14px;
  background: none;
  font: 600 9.5px/1.1 var(--font-mono);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.tabbar-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 9px;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}

.tabbar-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.tabbar-item:active .tabbar-icon { transform: scale(.92); }

.tabbar-item.is-active { color: var(--brand); }
.tabbar-item.is-active .tabbar-icon { color: var(--accent); background: var(--brand); }

.tabbar-item:hover { color: var(--brand); }

/* --------------------------------------------------------------------------
   18. Desk sheet (jump-to menu)
   -------------------------------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: end center;
}

.sheet[hidden] { display: none; }

.sheet-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 26, 20, .46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: pointer;
  animation: sheet-fade .28s var(--ease);
}

.sheet-panel {
  position: relative;
  display: flex;
  width: 100%;
  max-height: 88vh;
  flex-direction: column;
  padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -30px 80px -20px rgba(6, 26, 20, .5);
  animation: sheet-up .42s var(--ease-out);
}

.sheet-grab {
  width: 38px;
  height: 4px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: rgba(16, 29, 23, .16);
}

.sheet-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -.03em;
}

.sheet-head .eyebrow { margin-bottom: 4px; }

.sheet-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
}

.sheet-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

.sheet-search {
  display: flex;
  height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 0 14px;
  color: var(--brand-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.sheet-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.sheet-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: none;
  font-size: 14.5px;
}

.sheet-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.sheet-group + .sheet-group { margin-top: 14px; }

.sheet-group-title {
  margin: 0 0 7px;
  color: var(--muted);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sheet-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.sheet-link:hover,
.sheet-link:focus-visible { border-color: rgba(16, 76, 61, .28); background: var(--surface-2); }

.sheet-link-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--brand-3);
  border-radius: 10px;
  background: var(--green-light);
}

.sheet-link-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sheet-link-copy { min-width: 0; }
.sheet-link strong { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; }
.sheet-link small { display: block; margin-top: 1px; overflow: hidden; color: var(--muted); font: 500 9px/1.3 var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }

.sheet-link[aria-current='page'] { border-color: var(--brand); background: var(--brand); color: #fff; }
.sheet-link[aria-current='page'] .sheet-link-icon { background: rgba(255, 255, 255, .16); color: var(--accent); }
.sheet-link[aria-current='page'] small { color: rgba(255, 255, 255, .6); }

.sheet-empty { margin: 10px 2px 4px; color: var(--muted); font-size: 12.5px; }

.sheet-foot {
  margin: 10px 0 0;
  padding-top: 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font: 500 9.5px/1.4 var(--font-mono);
  text-align: center;
}

body.is-sheet-open { overflow: hidden; }

@media (min-width: 760px) {
  .sheet { place-items: center; }
  .sheet-panel {
    width: min(760px, 92vw);
    max-height: 82vh;
    padding: 10px 20px 18px;
    border-radius: 28px;
  }
  .sheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(46px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   19. Data visualisation primitives
   -------------------------------------------------------------------------- */

.viz {
  position: relative;
  width: 100%;
  color: var(--green);
}

.viz svg { display: block; width: 100%; height: auto; overflow: visible; }

.viz-grid-line { stroke: rgba(16, 29, 23, .09); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis-line { stroke: rgba(16, 29, 23, .16); stroke-width: 1; shape-rendering: crispEdges; }
.viz-label { fill: var(--muted); font: 500 9px var(--font-mono); letter-spacing: .02em; }
.viz-label-strong { fill: var(--ink); font: 600 10px var(--font-mono); }
.viz-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.viz-line-dashed { fill: none; stroke-width: 1.6; stroke-dasharray: 4 4; opacity: .7; }
.viz-area { opacity: .18; }
.viz-bar { transition: transform .6s var(--ease), opacity .3s var(--ease); transform-origin: center bottom; }
.viz-bar-group:hover .viz-bar { opacity: .82; }
.viz-dot { stroke: var(--surface); stroke-width: 2; transition: r .18s var(--ease); }
.viz-dot:hover { r: 5; }
.viz-now-line { stroke: var(--coral); stroke-width: 1.4; stroke-dasharray: 3 3; }
.viz-guide { stroke: rgba(16, 29, 23, .35); stroke-width: 1; stroke-dasharray: 2 3; }
.viz-threshold { stroke: rgba(16, 29, 23, .22); stroke-width: 1; stroke-dasharray: 2 3; }
.viz-tick { stroke: rgba(16, 29, 23, .18); stroke-width: 1; }

/* Tooltip shared by every chart */
.viz-tip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  min-width: 74px;
  padding: 7px 9px;
  color: #f4f9f0;
  border-radius: 10px;
  background: rgba(9, 39, 30, .94);
  box-shadow: 0 12px 26px -14px rgba(6, 26, 20, .8);
  font: 500 10px/1.4 var(--font-mono);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity .14s var(--ease), left .12s var(--ease), top .12s var(--ease);
  white-space: nowrap;
}

.viz-tip.is-on { opacity: 1; }
.viz-tip strong { display: block; color: #fff; font-size: 12px; font-weight: 600; }

/* Legend */
.viz-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 0; }

.viz-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font: 500 9.5px/1.3 var(--font-mono);
}

.viz-key::before {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
  content: '';
}

.viz-key.is-rain { color: var(--sky); }
.viz-key.is-temp { color: var(--coral); }
.viz-key.is-usd { color: var(--brand-3); }
.viz-key.is-nzd { color: var(--sky); }
.viz-key.is-aud { color: var(--sun); }

/* Rings and gauges */
.viz-ring { display: grid; place-items: center; color: var(--accent); }
.viz-ring svg { width: 100%; height: auto; }
.viz-ring-track { stroke: rgba(255, 255, 255, .16); }
.viz-ring-value { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.viz-ring-text { font: 600 17px var(--font-sans); fill: currentColor; letter-spacing: -.02em; }
.viz-ring-sub { font: 600 7px var(--font-mono); fill: rgba(255, 255, 255, .55); letter-spacing: .08em; }

/* Donuts keep their intended size instead of stretching to the card, and sit
   beside their legend once there is room. */
.viz-donut-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.viz-donut-wrap { display: grid; flex: 0 0 auto; place-items: center; }
.viz-donut-wrap svg { width: auto; height: auto; max-width: 100%; }
.viz-donut-body .viz-legend { flex: 1 1 190px; margin: 0; }

/* Compact stat blocks used by the desk viz band */
.viz-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
  margin: 0 0 clamp(18px, 3vw, 28px);
}

.viz-stat {
  position: relative;
  overflow: hidden;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.viz-stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 600 9px/1.2 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.viz-stat-value {
  display: block;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

.viz-stat-value small { margin-left: 3px; color: var(--muted); font-size: .5em; font-weight: 600; letter-spacing: 0; }
.viz-stat-note { display: block; margin-top: 5px; color: var(--muted); font: 500 9.5px/1.4 var(--font-mono); }
.viz-stat-spark { margin-top: 8px; }

.viz-card {
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.viz-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 4px;
}

.viz-card-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.viz-card-head span { color: var(--muted); font: 500 9.5px/1.3 var(--font-mono); }

.viz-card-note { margin: 8px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.viz-band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 10px;
  margin: 0 0 clamp(18px, 3vw, 28px);
}

/* A lone donut should sit in a readable column, not stretch across 1200px. */
.desk-viz .viz-band-grid:has(> .viz-card.is-donut:only-child) {
  grid-template-columns: minmax(0, 520px);
  justify-content: start;
}

@media (max-width: 899px) {
  .viz-band-grid { grid-template-columns: 1fr; }
  .viz-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Countdown ring used by jobs/tenders */
.viz-countdown { display: inline-grid; place-items: center; color: var(--brand-3); }
.viz-countdown .viz-ring-text { fill: currentColor; }

/* Per-desk visualisation band */
.desk-viz { margin: 0 0 clamp(8px, 1.8vw, 16px); }

.desk-viz-note {
  margin: 6px 2px 0;
  color: var(--muted);
  font: 500 9.5px/1.5 var(--font-mono);
}

.farm-window-grid { display: grid; gap: 4px; }

.farm-window-labels,
.farm-window-row {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
}

.farm-window-labels span {
  color: var(--muted);
  font: 600 9px/1.2 var(--font-mono);
  text-align: center;
}

.farm-window-name {
  color: var(--muted);
  font: 600 9.5px/1.2 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.farm-window-cell {
  display: grid;
  place-items: center;
  height: 30px;
  color: #fff;
  border-radius: 9px;
  font-size: 12px;
  transition: transform .18s var(--ease);
}

.farm-window-cell:hover { transform: scale(1.06); }

/* Horizontal bars (rates, salaries, prices) */
.viz-hbar-row { display: grid; grid-template-columns: minmax(64px, 34%) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; }
.viz-hbar-label { overflow: hidden; color: var(--ink); font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.viz-hbar-track { position: relative; height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.viz-hbar-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand-3), var(--accent)); transition: width .9s var(--ease); }
.viz-hbar-row.is-best .viz-hbar-fill { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.viz-hbar-value { color: var(--ink); font: 600 11.5px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Heat strip (rain days, activity by hour) */
.viz-heat { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.viz-heat-cell { position: relative; height: 34px; border-radius: 7px; background: var(--surface-3); transition: transform .2s var(--ease); }
.viz-heat-cell:hover { transform: translateY(-2px); }
.viz-heat-labels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin-top: 4px; }
.viz-heat-labels span { color: var(--muted); font: 500 8.5px/1 var(--font-mono); text-align: center; }

/* --------------------------------------------------------------------------
   20. Controls, chips and filters
   -------------------------------------------------------------------------- */

select,
input[type='search'],
input[type='text'],
input[type='email'],
input[type='number'],
input[type='date'],
textarea {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  font-family: inherit;
}

select {
  min-height: 38px;
  padding: 0 30px 0 11px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type='search']:focus,
input[type='text']:focus,
select:focus { border-color: var(--brand-3); outline: 0; box-shadow: 0 0 0 3px rgba(17, 84, 63, .12); }

button,
.cal-button,
.resource-filter,
.job-sector-chip,
.tender-source-chip,
.rail-arrow {
  font-family: inherit;
}

.cal-button,
.resource-filter {
  min-height: 34px;
  padding: 0 12px;
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.cal-button:hover,
.resource-filter:hover { border-color: rgba(16, 76, 61, .28); background: var(--surface-2); }

.cal-button.is-active,
.resource-filter.is-active,
.resource-filter[aria-pressed='true'] { color: #fff; border-color: var(--brand); background: var(--brand); }

/* Status chips */
.job-sector-chip,
.tender-source-badge,
.job-source-badge,
.gov-badge,
.ev-badge,
.job-close-chip,
.tender-close-chip,
.sea-chip {
  border-radius: 999px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

/* Generic inner-page rows that were flat tables */
.quake-row,
.flight-row,
.tide-row,
.fuel-row,
.price-row,
.window-row,
.reef-row {
  border-radius: var(--r-sm);
  transition: background .2s var(--ease);
}

.quake-row:hover,
.flight-row:hover,
.tide-row:hover,
.fuel-row:hover { background: var(--surface-2); }

/* Page-specific card families share the new radius even where padding is set
   by their own rules. */
.job-card,
.tender-card,
.tender-dept-card,
.gov-card,
.resource-card,
.ev-card,
.news-card,
.bx-card,
.rental-dir-card,
.rental-lv-card,
.ship-ferry-card,
.job-source-card,
.job-dept-card { padding: 16px 17px; }

.job-title,
.tender-title,
.gov-card-name,
.bx-card-name,
.news-card h3,
.news-card-title {
  letter-spacing: -.02em;
  font-weight: 620;
}

/* Map + Leaflet surfaces */
.place-item,
.place-plan { border-radius: var(--r-md); }

/* Cross-links between desks (government → parliament, etc.) */
.gov-cross-card {
  padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.gov-cross-card:hover,
.gov-cross-card:focus-visible {
  border-color: rgba(16, 76, 61, .25);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.gov-cross-card h3 { font-size: 1rem; letter-spacing: -.02em; }
.gov-cross-card p { font-size: 12px; }
.gov-cross-link { font: 600 9.5px/1.3 var(--font-mono); }

.leaflet-container { font-family: var(--font-sans); border-radius: var(--r-lg); }

/* Tables */
table { border-collapse: collapse; }
th { color: var(--muted); font: 600 9.5px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
td, th { border-color: var(--line); }

/* Disclosure + details blocks */
details > summary { cursor: pointer; }

/* --------------------------------------------------------------------------
   21. Motion utilities
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

.reveal.is-in { opacity: 1; transform: none; }

.is-tap-press { transform: scale(.985); }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* A reveal that never fires is worse than no reveal: reduced motion, print and
   no-IntersectionObserver browsers all get the final state immediately. */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   22. Dark theme
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1411;
    --white: #121e19;
    --ink: #e8efe8;
    --muted: #96a89a;
    --green: #9fd8b5;
    --green-deep: #06100c;
    --green-light: #172a21;
    --lime: #c8f26c;
    --line: #223329;
    --amber: #f0a071;

    --surface: #121e19;
    --surface-2: #16241e;
    --surface-3: #1b2c25;
    --surface-glass: rgba(18, 30, 25, .72);
    --brand: #0f3f32;
    --brand-2: #11553f;
    --brand-3: #8fd8bd;
    --accent: #c8f26c;
    --accent-ink: #122804;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .24), 0 10px 24px -18px rgba(0, 0, 0, .8);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .3), 0 22px 44px -28px rgba(0, 0, 0, .9);
    --shadow-lg: 0 30px 70px -40px rgba(0, 0, 0, .95);
  }

  body {
    background:
      radial-gradient(900px 560px at 86% -14%, rgba(28, 107, 82, .28), transparent 60%),
      radial-gradient(760px 480px at -12% 6%, rgba(22, 63, 84, .34), transparent 58%),
      var(--paper);
  }

  .topbar { background: rgba(11, 20, 17, .78); }
  .is-scrolled .topbar { background: rgba(11, 20, 17, .92); }

  .brand-name { color: #dcefe3; }
  .brand-mark { background: linear-gradient(145deg, #17624c, #0a3229); }

  .topbar-right > a:hover,
  .topbar-right > a:focus-visible { color: #e8f3ea; background: rgba(255, 255, 255, .08); }

  .greet-chip,
  .topbar > a:not(.brand) {
    color: #d8ebe0;
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
  }

  .greet-chip:hover,
  .topbar > a:not(.brand):hover { color: #fff; background: rgba(255, 255, 255, .1); }

  .topbar-right > a[aria-current='page'] { color: #0b1411; background: var(--accent); }

  .icon-button { color: #cfe6d6; border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); }
  .icon-button:hover { background: rgba(255, 255, 255, .12); }
  .install-button { color: var(--accent-ink); background: var(--accent); }

  .table,
  .home-search-box,
  .home-search-results,
  .maf-source-stamp,
  .snapshot-item,
  .home-card,
  .job-card,
  .tender-card,
  .tender-dept-card,
  .gov-card,
  .resource-card,
  .ev-card,
  .news-card,
  .bx-card,
  .rental-card,
  .rental-dir-card,
  .rental-lv-card,
  .ship-ferry-card,
  .place-item,
  .securities-item,
  .farm-panel,
  .newsline,
  .viz-card,
  .viz-stat,
  .desk-index-link,
  .sheet-panel,
  .sheet-link { background: var(--surface); border-color: var(--line); }

  .sheet-panel { box-shadow: 0 -30px 80px rgba(0, 0, 0, .6); }
  .sheet-search { background: var(--surface-2); }
  .sheet-link-icon { background: rgba(255, 255, 255, .07); color: var(--accent); }
  .sheet-link[aria-current='page'] { background: var(--accent); color: #0f2410; }
  .sheet-link[aria-current='page'] small { color: rgba(10, 30, 12, .6); }
  .sheet-link[aria-current='page'] .sheet-link-icon { background: rgba(0, 0, 0, .12); color: #0f2410; }

  .tabbar { background: rgba(12, 22, 18, .92); border-top-color: rgba(255, 255, 255, .07); }
  .tabbar-item { color: var(--muted); }
  .tabbar-item.is-active { color: #dff0e4; }
  .tabbar-item.is-active .tabbar-icon { background: var(--accent); color: #0d2410; }

  .home-link { color: #cfe9d8; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); }
  .home-card:hover .home-link { color: #10240f; background: var(--accent); border-color: var(--accent); }

  .footer-topics a { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, .04); }
  .footer-topics a:hover { color: var(--ink); background: rgba(255, 255, 255, .09); }

  .news-ticker-label { background: var(--accent); color: #10240f; }
  .news-ticker a { color: var(--ink); }

  .rail-wrap::after { background: linear-gradient(90deg, rgba(11, 20, 17, 0), var(--paper) 78%); }
  .rail-progress { background: rgba(255, 255, 255, .1); }

  .viz-label { fill: var(--muted); }
  .viz-grid-line { stroke: rgba(255, 255, 255, .08); }
  .viz-axis-line { stroke: rgba(255, 255, 255, .16); }
  .viz-dot { stroke: var(--surface); }
  .viz-hbar-track { background: rgba(255, 255, 255, .09); }
  .viz-tip { background: rgba(6, 16, 12, .96); }

  /* Flat-colour leftovers from the light-only rules. */
  .fuel-row:nth-child(odd),
  .tide-row:nth-child(odd),
  .spotlight-row,
  .week-row:nth-child(odd),
  .tender-dept-card,
  .job-dept-card { background: var(--surface-2); }

  .newsline,
  .maf-hero .maf-deck { color: var(--muted); }

  .maf-data-note { border-color: #3a2f1c; background: #241d10; }
  .maf-data-note p { color: #d8c79c; }
  .maf-data-note strong { color: #f0e2b8; }
  .maf-data-note > a { color: #f0b47a; }
}

/* --------------------------------------------------------------------------
   23. Print
   -------------------------------------------------------------------------- */

@media print {
  .tabbar, .sheet, .topbar-actions, .rail-arrow, .home-search, .news-ticker { display: none !important; }
  .app-shell { max-width: none; padding: 0; }
  .home-card, .viz-card, .viz-stat { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

