:root {
  --night: #0b1220;
  --night-2: #121c2e;
  --night-3: #1a2740;
  --line: #24344f;
  --ink: #e8eef7;
  --ink-dim: #9fb0c8;
  --navy: #14284a;
  --gold: #d9b25f;
  --green: #64b98a;
  --green-2: #9ad9b4;
  --high: #7fb2e5;
  --low: #d59a5f;
  --safe: #d9b25f;
  --focus: #ffd166;
  --radius: 14px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 80% at 80% -10%, #16243d 0%, var(--night) 55%) fixed;
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

.shell { max-width: 720px; margin: 0 auto; padding: 0 var(--pad) 40px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 18, 32, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
}

.brandrow { display: flex; align-items: center; gap: 12px; padding: 10px 0 12px; }
.mark { font-size: 30px; line-height: 1; }
h1 { font-size: 21px; margin: 0; letter-spacing: .3px; font-weight: 650; }
.sub { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-dim); letter-spacing: .2px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding-bottom: 8px; margin: 0 -4px;
  scrollbar-width: none;
  /* fade the right edge so it is obvious the tab row scrolls */
  -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 100%);
  mask-image: linear-gradient(to right, #000 82%, transparent 100%);
  scroll-snap-type: x proximity;
}
/* keep the selected tab legible when it sits under the fade */
.tab[aria-selected="true"] { -webkit-mask-image: none; mask-image: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  background: transparent; color: var(--ink-dim);
  border: 1px solid transparent; border-radius: 999px;
  padding: 7px 13px; font-size: 14px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.tab[aria-selected="true"] {
  background: var(--night-3); color: var(--ink);
  border-color: var(--line);
}

main { padding-top: 18px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: 14px;
}
.card h2 { font-size: 17px; margin: 0 0 10px; font-weight: 640; }
.card h3 { font-size: 15.5px; margin: 12px 0 6px; font-weight: 640; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cardhead h2 { margin-bottom: 8px; }
.stamp { font-size: 11.5px; color: var(--ink-dim); white-space: nowrap; }
.fine { font-size: 12.5px; color: var(--ink-dim); margin: 6px 0 0; }

/* A carried-over feed: the content is real but it is not from the newest
   fetch. It gets a visible edge so it cannot be mistaken for a fresh reading. */
.fine.stale { color: #f2c94c; border-left: 3px solid #f2c94c; padding-left: 10px; }
.kicker { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 14px 0 2px; }

.links { list-style: none; margin: 0; padding: 0; }
.links li + li { border-top: 1px solid var(--line); }
.links a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 2px; color: var(--ink); text-decoration: none;
}
.links a span { font-size: 12.5px; color: var(--ink-dim); }
/* A quick link whose LABEL is translated needs the label to read like a
   label, not like the dim note beside it. The note span keeps the dim
   treatment; .lead is the label span. */
.links a span.lead { font-size: inherit; color: var(--ink); }

/* ---- Tides ---- */
.zone { margin-bottom: 14px; }
.zonehead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 0 2px 8px;
}
.zonehead h2 { font-size: 17px; margin: 0; font-weight: 640; }
.zonehead .stn { font-size: 11.5px; color: var(--ink-dim); text-align: right; }

table.tides { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tides th {
  text-align: left; font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 600; padding: 0 8px 6px;
}
table.tides td { padding: 7px 8px; border-top: 1px solid var(--line); }
table.tides td.t { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.tides td.v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  display: inline-block; min-width: 52px; text-align: center;
  border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 650;
  border: 1px solid;
}
.badge.h { color: var(--high); border-color: rgba(127,178,229,.45); background: rgba(127,178,229,.10); }
.badge.l { color: var(--low);  border-color: rgba(213,154,95,.45);  background: rgba(213,154,95,.10); }
.badge.next { color: #0b1220; background: var(--gold); border-color: var(--gold); }
.daysep td { border-top: 1px solid var(--line); padding-top: 10px; font-size: 11.5px;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-dim); }
.empty { color: var(--ink-dim); font-size: 13.5px; padding: 10px 2px; }

.pro { border-left: 3px solid var(--gold); }
.pro .kicker { color: var(--gold); }

.signup { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.signup input {
  flex: 1 1 200px; min-width: 0;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font: inherit; font-size: 15px; padding: 11px 12px;
}
.signup input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.signup input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.signup button {
  background: var(--gold); color: #0b1220; border: 0; border-radius: 10px;
  padding: 11px 18px; font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
}
.ok { color: var(--green-2); }
.err { color: #e59a8f; }

/* ---- focus visibility ----
   A keyboard user must never have to guess where focus is. One global
   :focus-visible ring, high contrast against every surface this app uses
   (night, night-3, card), replaced the scattered per-element outline rules.
   WCAG 2.2 SC 2.4.7 (Focus Visible) + SC 1.4.11 (Non-text Contrast). */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Keep the old element-specific rings consistent with the global one. */
.signup input:focus-visible,
.tzbtn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.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;
}

.foot {
  margin-top: 26px; padding: 16px 2px 8px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-dim);
}

/* Eco strand accent */
#view-night .card { border-left: 3px solid var(--green); }

@media (prefers-color-scheme: light) {
  /* keep the night identity — this app is deliberately dark */
}

@media (min-width: 640px) {
  .shell { max-width: 760px; }
  h1 { font-size: 24px; }
}

/* ---- timezone toggle ---- */
.tzrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.tzbtn {
  font: inherit; font-size: 0.85rem; line-height: 1;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.05); color: var(--ink, #e8eefc);
  border: 1px solid rgba(232,238,252,0.22);
}
.tzbtn.on { background: rgba(212,175,55,0.16); border-color: rgba(212,175,55,0.65); color: #f4d98a; }
.tzbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- Work tab ---- */
/* The Work view has TWO views inside one panel (Remote roles / Crew Board).
   These are a SECOND tablelist, so they need their own tab stop rather than
   joining the main tab bar's roving tabindex. The selected pill uses the same
   ink/line tokens as the main tabs, so the contrast gate covers it. */
.subtabs { display: flex; gap: 6px; margin: 12px 0 10px; flex-wrap: wrap; }
.subtab {
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.subtab[aria-selected="true"] {
  background: var(--night-3); color: var(--ink);
  border-color: var(--line);
}

/* ---- Eat tab ---- */
ul.bullets { margin: 6px 0 10px; padding-left: 18px; }
ul.bullets li { margin: 5px 0; line-height: 1.45; }
ul.bullets strong { color: #f0dc9a; font-weight: 600; }
table.meals { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
table.meals th[scope="row"] {
  text-align: left; font-weight: 600; color: #9fb6d8;
  padding: 7px 10px 7px 0; white-space: nowrap; vertical-align: top; width: 96px;
}
table.meals td { padding: 7px 0; vertical-align: top; }
.dayblock, .weekblock { border-top: 1px solid rgba(232,238,252,0.12); padding-top: 12px; margin-top: 12px; }
.dayblock h3, .weekblock h3 { margin: 0 0 6px; }
details summary {
  cursor: pointer; font-size: 0.85rem; color: #9fb6d8;
  padding: 6px 0; list-style: revert;
}
details[open] summary { color: #f0dc9a; }

/* honeypot — hidden from people, visible to bots */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px;
      opacity: 0 !important; pointer-events: none !important; }

/* ---- Storms tab ---- */
div.alert { border-left: 4px solid #6c8cc0; background: rgba(255,255,255,0.04);
            padding: 10px 12px; margin: 8px 0; border-radius: 6px; }
div.alert h3 { margin: 0 0 4px; }
div.alert.sev-extreme { border-left-color: #ff4d4d; }
div.alert.sev-severe  { border-left-color: #ff9f43; }
div.alert.sev-moderate{ border-left-color: #f2c94c; }
div.alert.sev-minor   { border-left-color: #6c8cc0; }
div.alert a { color: #9fd0ff; }

/* ---------- shop picks ---------- */
ul.picks { list-style: none; margin: 10px 0 0; padding: 0; }
ul.picks li.pick {
  border-top: 1px solid var(--line);
  padding: 10px 0 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
ul.picks li.pick a { font-size: 14px; color: var(--ink); text-decoration: none; }
ul.picks li.pick a:hover { text-decoration: underline; }
.pickprice { font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; }
.picknote { font-size: 12.5px; color: var(--ink-dim); }

/* ---- The $100 Shop ---- */
table.basket { width: 100%; border-collapse: collapse; }
table.basket th[scope="row"] { text-align: left; font-weight: 600; color: #e8eefc;
  padding: 7px 8px 7px 0; vertical-align: top; }
table.basket td { padding: 7px 0; vertical-align: top; }
table.basket td.price { text-align: right; font-variant-numeric: tabular-nums;
  padding-left: 10px; white-space: nowrap; color: #f0dc9a; }
table.basket tr.totalrow th, table.basket tr.totalrow td {
  border-top: 2px solid rgba(212,175,55,0.45); padding-top: 10px; font-weight: 700; }
table.basket tr.totalrow td.price { font-size: 1.1rem; color: #f4d98a; }

/* ---- Diets tab (life-stage plans) ---- */
div.cohort { border-left: 3px solid rgba(157,208,255,0.45); padding-left: 14px; margin-top: 18px; }
div.cohort h3 { margin-top: 22px; }
div.cohort h4 { margin: 14px 0 4px; color: #f0dc9a; font-size: 0.98rem; }
p.need {
  font-size: 0.85rem; color: #9fd0ff; margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}
div.cohort table.basket { margin-top: 8px; }
div.cohort td.price { color: #f4d98a; }

/* ---- NWS alert sections (cleaned from raw * WHAT... markup) ---- */
p.alertsec { margin: 8px 0 0; line-height: 1.45; }
p.alertsec strong { color: #f0dc9a; font-weight: 600; }

/* tab row: a touch smaller so more of it fits before the scroll */
.tab { font-size: 13.5px; padding: 7px 12px; scroll-snap-align: start; }

/* ---- reader's own place & time (localized panel) ---- */
.nowcard {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: rgba(157,208,255,0.05); border: 1px solid rgba(157,208,255,0.16);
}
.nowrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.nowclock {
  font-size: 1.45rem; font-weight: 700; color: #f4d98a;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.nowplace { font-size: 0.92rem; color: #9fb6d8; }
.topclock {
  margin-left: auto; text-align: right; font-size: 0.8rem; color: var(--ink-dim);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tzbtn.ghost { background: transparent; border-style: dashed; margin-top: 10px; }
.tzbtn.lang { padding: 6px 11px; font-size: 0.82rem; }
.langrow { margin-top: 12px; }

/* Value-first strip on the Deals card: what joining buys you, shown BEFORE
   the form asks for anything. Static, no tracking, no ad — just the deal. */
.crewlstrip { margin: 12px 0 2px; }
.crewlstrip-title {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 4px;
}
.crewlstrip-list { list-style: none; margin: 0; padding: 0; }
.crewlstrip-list li {
  font-size: 13.5px; padding: 6px 0 6px 18px; position: relative;
  border-top: 1px solid var(--line);
}
.crewlstrip-list li:first-child { border-top: none; }
.crewlstrip-list li::before {
  content: "✓"; position: absolute; left: 0; top: 6px;
  color: var(--green-2); font-size: 12.5px;
}
