/* ==========================================================================
   /tide — the linkable tide guide (tide plan §5.1)

   Loads *after* main.css and borrows its tokens, fonts and .panel language.
   The one thing it has to undo is `body { overflow: hidden }`: the app shell
   is a fixed viewport, this is a document that scrolls.
   ========================================================================== */

body.tide-page {
  overflow: auto;
  overflow-x: hidden;           /* only the chart scrolls sideways, never the page */
  min-height: 100%;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ---------- header ---------- */
.tg-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 18px calc(10px + env(safe-area-inset-top, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(6,12,22,0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tg-home {
  flex: none; text-decoration: none; color: var(--text);
  font-family: var(--disp); font-weight: 500; font-size: 15px; letter-spacing: 3px;
  opacity: 0.9;
}
.tg-home:hover { opacity: 1; text-shadow: var(--glow-cyan); }
.tg-home b { color: var(--cyan); font-weight: 900; }
.tg-place { flex: 1 1 220px; min-width: 0; }
.tg-place h1 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(17px, 2vw, 23px);
  letter-spacing: 2px; color: var(--text); line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tg-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--dim); letter-spacing: 0.4px; }
.tg-sub b { color: var(--text); font-weight: 600; }
.tg-stale {
  margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  font-family: var(--disp); font-size: 9px; letter-spacing: 2px;
  color: var(--amber); border: 1px solid rgba(255,179,71,0.5);
}

.tg-prefs { flex: none; display: flex; gap: 8px; }
.tg-seg {
  display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
  background: rgba(10,18,32,0.6);
}
.tg-segb {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 6px 11px;
  font-family: var(--disp); font-size: 10.5px; letter-spacing: 2px; color: var(--dim);
}
.tg-segb + .tg-segb { border-left: 1px solid var(--line); }
.tg-segb:hover { color: var(--text); }
.tg-segb.on { color: #04070d; background: var(--cyan); font-weight: 700; }

.tg-banner {
  margin: 10px 18px 0; padding: 9px 13px; border-radius: 8px;
  font-size: 12.5px; color: var(--amber);
  background: rgba(255,179,71,0.09); border: 1px solid rgba(255,179,71,0.4);
}

/* ---------- layout ---------- */
.tg-main {
  position: relative; z-index: 1;
  max-width: 1560px; margin: 0 auto; padding: 16px 18px 0;
  display: flex; flex-direction: column; gap: 16px;
}
.tg-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 13px 15px 15px;
}
.tg-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--disp); font-size: 10.5px; letter-spacing: 3px; color: var(--dim);
  margin-bottom: 11px;
}
.tg-h > span:first-child { flex: none; white-space: nowrap; }
.tg-hsub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px; color: var(--dim); text-align: right; }
.tg-none { padding: 22px 6px; text-align: center; color: var(--dim); font-size: 12.5px; letter-spacing: 1px; }
.tg-dim { color: var(--dim); }

/* ---------- hero row ---------- */
.tg-hero {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}
.tg-hcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 12px 14px 13px;
  border-top: 2px solid rgba(64,224,255,0.3);
}
.tg-hcard.x-high { border-top-color: var(--green); }
.tg-hcard.x-low { border-top-color: var(--amber); }
.tg-hcard.tg-now { border-top-color: var(--cyan); }
.tg-htag { font-family: var(--disp); font-size: 9px; letter-spacing: 3px; color: var(--dim); }
.tg-hmain {
  margin-top: 5px; display: flex; align-items: baseline; gap: 7px;
  line-height: 1.05; min-height: 38px;
}
.tg-num {
  font-family: var(--disp); font-weight: 700; font-size: clamp(27px, 3vw, 36px);
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
}
.tg-unit { font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.tg-arrow { font-size: 20px; }
.t-rising { color: var(--green); }
.t-falling { color: var(--amber); }
.t-slack { color: var(--dim); }
.tg-hsubline {
  margin-top: 5px; font-size: 12.5px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tg-hfoot { margin-top: 4px; font-size: 11.5px; color: var(--dim); }
.tg-cd {
  font-family: var(--disp); font-weight: 700; font-size: 15px; letter-spacing: 1px;
  color: var(--cyan); font-variant-numeric: tabular-nums;
}
.tg-sunrow { font-family: var(--disp); font-weight: 500; font-size: 19px; letter-spacing: 1px; color: var(--text); }
.tg-hcard.tg-sun .tg-hsubline { font-family: var(--disp); font-size: 19px; letter-spacing: 1px; }
.tg-moonglyph { font-size: 30px; line-height: 1; }
.tg-moonpct { font-size: clamp(22px, 2.4vw, 29px); }
.ph-flood { color: var(--green); }
.ph-ebb { color: var(--amber); }
.ph-slack { color: var(--dim); }

/* ---------- chart ---------- */
.tg-chartcard { padding-bottom: 10px; }

/* The day pager. `TODAY` is pinned outside the scrolling chips, in amber,
   because it is the one control on the row that undoes where the reader has
   got to — the lit day chip is already cyan. */
.tg-days { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.tg-daychips {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  overscroll-behavior-x: contain; flex: 1 1 auto; padding: 1px;
}
.tg-daychips::-webkit-scrollbar { display: none; }
.tg-daychip, .tg-today {
  flex: 0 0 auto; cursor: pointer;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10.5px; letter-spacing: 1.2px; line-height: 1;
  padding: 5px 8px; border-radius: 999px;
  color: var(--dim); background: transparent;
  border: 1px solid rgba(64,224,255,0.16);
}
.tg-daychip:hover { color: var(--text); border-color: var(--cyan); }
.tg-daychip.on { color: #04070d; background: var(--cyan); border-color: var(--cyan); }
.tg-today { color: #04070d; background: var(--amber); border-color: var(--amber); }
.tg-daychip:focus-visible, .tg-today:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tg-scroll {
  overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;                /* never hand the swipe to the page */
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: rgba(4,7,13,0.5);
}
.tg-plot {
  position: relative;
  touch-action: pan-x;                            /* sideways drag scrolls, a tap scrubs */
}
.tg-plot svg { display: block; }
#tg-svg { position: absolute; inset: 0; }

/* A zero-width sticky rail, so its children ride the left edge of the viewport
   while the chart scrolls under them. */
.tg-yaxis {
  position: sticky; left: 0; top: 0;
  width: 0; height: 100%;
  z-index: 3; pointer-events: none;
}
/* A chip behind each value rather than a band down the edge: a band wide
   enough to be legible also washes out whatever H/L callout starts the week. */
.tg-ytick {
  position: absolute; left: 5px;
  transform: translateY(-0.82em);
  padding: 1px 5px; border-radius: 4px;
  background: rgba(4,7,13,0.82);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--dim); white-space: nowrap;
}

.tg-scrub { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.tg-scrub-line {
  position: absolute; left: 0; width: 1px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 8px rgba(33,230,255,0.5);
}
/* The dot rides the curve; the finger only chooses the time. A ring, not a
   blob, so the curve underneath it stays readable. */
.tg-scrub-dot {
  position: absolute; left: 0; top: 0;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 1.5px #fff, 0 0 10px rgba(33,230,255,0.7);
}
/* Snapped to a turn the mark grows; snapped to now the rule goes white. */
.tg-scrub[data-kind="H"] .tg-scrub-dot,
.tg-scrub[data-kind="L"] .tg-scrub-dot { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
.tg-scrub[data-kind="H"] .tg-scrub-dot { background: var(--green); }
.tg-scrub[data-kind="L"] .tg-scrub-dot { background: var(--amber); }
.tg-scrub[data-kind="now"] .tg-scrub-line { background: #fff; width: 2px; }
.tg-plot:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- the place title (onboarding brief §1 / §5) ----------
   The place is a title, not a field. Idle it is the page heading with a
   caret; clicking it opens the places sheet, where the search field lives. */
.tg-title {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  min-height: 32px; text-align: left; color: var(--text);
}
.tg-bar-label {
  font-family: var(--disp); font-weight: 700; font-size: clamp(17px, 2vw, 23px);
  letter-spacing: 2px; line-height: 1.15;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tg-title-caret { color: var(--cyan); font-size: 0.75em; flex: none; }
.tg-title:hover .tg-bar-label { text-shadow: var(--glow-cyan); }
.tg-title:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.tg-title .tg-ghost-tag { color: var(--amber); font-size: 9px; letter-spacing: 2px; margin-left: 8px; }
.tg-hint { margin: 4px 0 0; font-size: 11.5px; color: var(--dim); }
.tg-hint[hidden] { display: none; }
.tg-hint-link {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--cyan); font: inherit; text-decoration: underline;
}

/* ---------- places tabs (§4.4) — web keeps chips: no swipe on a desktop ---------- */
.tg-tabs {
  display: flex; gap: 6px; margin-top: 7px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tg-tabs::-webkit-scrollbar { display: none; }
.tg-tab {
  flex: none; cursor: pointer; white-space: nowrap;
  background: rgba(10,18,32,0.6); color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; font-family: var(--disp); font-size: 10px; letter-spacing: 1.6px;
  text-transform: uppercase;
}
.tg-tab:hover { color: var(--text); }
.tg-tab.is-on { color: var(--cyan); border-color: rgba(94,234,255,0.55); }
.tg-tab.is-ghost { border-style: dashed; }
.tg-tab-plus { margin-left: 5px; color: var(--cyan); }
.tg-tab-add { padding: 4px 10px; font-size: 12px; letter-spacing: 0; }

/* ---------- the places sheet ----------
   A dialog over the dimmed page. Bottom sheet on a phone, a centred panel on
   a desktop; the chart stays mounted underneath either way. */
.tg-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,7,13,0.62);
}
.tg-sheet {
  position: fixed; z-index: 61;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column;
  background: rgba(6,12,22,0.98);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
@media (min-width: 720px) {
  .tg-sheet {
    left: 50%; right: auto; bottom: auto; top: 7vh;
    width: min(580px, 92vw); max-height: 84vh;
    transform: translateX(-50%);
    border-bottom: 1px solid var(--line); border-radius: 16px;
  }
}
.tg-scrim[hidden], .tg-sheet[hidden], .tg-offline[hidden], .tg-tabs[hidden], .tg-onboard[hidden] { display: none; }
.tg-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 10px 4px 18px;
}
.tg-sheet-title { font-family: var(--disp); font-size: 10.5px; letter-spacing: 3px; color: var(--cyan); }
.tg-bar-clear {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--dim); font-size: 15px; line-height: 1; padding: 6px;
  min-width: 36px; min-height: 36px;
}
.tg-bar-clear:hover { color: var(--text); }
.tg-field {
  display: flex; align-items: center; gap: 8px;
  margin: 0 14px 6px; padding: 0 10px; min-height: 44px;
  border: 1px solid rgba(64,224,255,0.34); border-radius: 8px;
  background: rgba(13,22,38,0.82);
}
.tg-field-glyph { color: var(--cyan); font-size: 16px; }
.tg-bar-input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  background: transparent; border: 0; outline: none; padding: 8px 0;
  font-family: var(--mono); font-size: 15px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.tg-bar-input::placeholder { color: var(--dim); }
.tg-sheet-body { overflow-y: auto; padding: 0 14px 10px; min-height: 120px; }
.tg-offline {
  display: inline-block; margin: 0 0 8px 14px; padding: 2px 7px; border-radius: 4px;
  font-family: var(--disp); font-size: 9px; letter-spacing: 1.6px;
  color: var(--amber); border: 1px solid rgba(255,179,71,0.45);
}
.tg-sec {
  margin: 12px 0 5px; font-family: var(--disp); font-size: 9.5px;
  letter-spacing: 2.2px; color: var(--dim); font-weight: 500;
}
.tg-sec:first-child { margin-top: 4px; }
.tg-sec small { font-family: var(--mono); font-size: 9px; letter-spacing: 0.5px; text-transform: none; }
/* Scoped to the sheet and the first-run card: the tide table further down
   also uses `.tg-rows` / `.tg-row` (a four-column grid), and source order
   would otherwise hand these rows its columns. */
.tg-sheet .tg-rows, .tg-onboard .tg-rows { display: block; list-style: none; margin: 0; padding: 0; }
.tg-sheet .tg-row, .tg-onboard .tg-row {
  display: flex; grid-template-columns: none; align-items: center; gap: 6px;
  padding: 0; margin: 0; border: 0; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 0;
  background: none; opacity: 1;
}
.tg-sheet .tg-row.is-active { border-left: 2px solid var(--cyan); }
.tg-sheet .tg-row-strip { display: block; padding: 0; border: 0; }
.tg-row-pick {
  flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 8px;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 9px 4px; min-height: 44px; color: var(--text); font: inherit;
}
.tg-row-pick:hover { background: rgba(94,234,255,0.06); }
.tg-row-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tg-row-label { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-row-sub {
  grid-column: 1 / -1; min-width: 0; font-size: 11px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.tg-row-dist { flex: none; font-size: 11px; color: var(--dim); align-self: center; }
.tg-row-next { grid-column: 1 / -1; font-size: 11px; color: var(--text); opacity: 0.85; margin-top: 2px; }
.tg-approx { color: var(--green); font-size: 12px; }
.tg-badge {
  flex: none; padding: 1px 5px; border-radius: 4px;
  font-family: var(--disp); font-size: 8.5px; letter-spacing: 1.4px;
  color: var(--dim); border: 1px solid var(--line);
}
.tg-badge-hilo { color: var(--amber); border-color: rgba(255,179,71,0.4); }
.tg-badge-slot { color: var(--cyan); border-color: rgba(64,224,255,0.34); }
.tg-star {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--line); font-size: 17px; line-height: 1;
  min-width: 44px; min-height: 44px;
}
.tg-star:hover { color: var(--dim); }
.tg-star.is-on { color: var(--cyan); }
.tg-row-edit {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--dim); font-size: 14px; min-width: 36px; min-height: 44px;
}
.tg-row-edit:hover { color: var(--text); }
.tg-edit-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
.tg-edit-strip button {
  appearance: none; cursor: pointer; background: none; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
  font-family: var(--disp); font-size: 9px; letter-spacing: 2px;
}
.tg-edit-strip button[disabled] { opacity: 0.4; cursor: default; }
.tg-edit-strip button.x-danger { color: #ff5f56; }
.tg-edit-strip input {
  flex: 1 1 140px; background: transparent; color: var(--text); border: 0;
  border-bottom: 1px solid var(--cyan); font: inherit; font-size: 14px; outline: none;
}
.tg-foot {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 12px 4px; min-height: 44px;
  font-family: var(--disp); font-size: 9px; letter-spacing: 2.4px; color: var(--cyan);
}
.tg-foot:hover { text-shadow: var(--glow-cyan); }
.tg-foot small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.3px; color: var(--dim); }
.tg-foot.x-warn { color: var(--amber); }
.tg-none { margin: 10px 4px; font-size: 12.5px; color: var(--dim); }

/* ---------- first run (onboarding brief §2) ---------- */
.tg-onboard { border-top: 2px solid var(--cyan); }
.tg-onb-step { font-family: var(--disp); font-size: 9.5px; letter-spacing: 3px; color: var(--cyan); }
.tg-onb-head {
  margin: 8px 0 6px; font-family: var(--disp); font-weight: 700;
  font-size: clamp(18px, 2.2vw, 24px); letter-spacing: 1.5px; color: var(--text);
}
.tg-onb-body { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--dim); max-width: 60ch; }
.tg-onb-foot { margin: 8px 0 0; font-size: 11.5px; color: var(--dim); }
.tg-onb-or { margin: 14px 0 6px; font-family: var(--disp); font-size: 9px; letter-spacing: 3px; color: var(--dim); }
.tg-onb-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.tg-btn {
  appearance: none; cursor: pointer; min-height: 44px; padding: 0 18px;
  border-radius: 6px; border: 1px solid var(--line); background: transparent;
  font-family: var(--disp); font-size: 10px; letter-spacing: 2.5px; color: var(--text);
}
.tg-btn:hover { border-color: rgba(64,224,255,0.34); }
.tg-btn.x-primary { background: var(--cyan); border-color: var(--cyan); color: #04070d; font-weight: 700; }
.tg-btn.x-primary[disabled] { opacity: 0.45; cursor: default; }
.tg-btn.x-skip { border: 0; color: var(--dim); }
.tg-onb .tg-field { margin: 0; }
.tg-onb-notice {
  margin: 10px 0; padding: 8px 12px; border: 1px solid rgba(255,179,71,0.5); border-radius: 8px;
  font-size: 12px; color: var(--amber);
}
.tg-onb-notice button { appearance: none; background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.tg-onb-cap { margin: 8px 0; font-size: 12px; color: var(--amber); }
.tg-onb-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 10px; }
.tg-tile {
  appearance: none; cursor: pointer; text-align: left; min-height: 60px; padding: 9px 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  background: rgba(13,22,38,0.82); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  font: inherit;
}
.tg-tile:hover { border-color: rgba(64,224,255,0.34); }
.tg-tile.is-on { border-color: var(--cyan); background: rgba(33,230,255,0.10); color: var(--cyan); }
.tg-tile[disabled] { opacity: 0.4; cursor: default; }
.tg-tile-label { font-size: 14px; font-weight: 600; }
.tg-tile-badge { font-family: var(--disp); font-size: 8.5px; letter-spacing: 1.4px; color: var(--dim); }
.tg-tile.is-on .tg-tile-badge { color: var(--cyan); }
.tg-tile-badge.x-hilo { color: var(--amber); }
.tg-onb-rows .tg-row-pick { grid-template-columns: 1fr auto; }
.tg-check { flex: none; width: 44px; min-height: 44px; display: grid; place-items: center; color: var(--dim); font-size: 16px; }
.tg-onboard .tg-row.is-on .tg-check { color: var(--cyan); }
.tg-onboard .tg-row.is-off { opacity: 0.4; }
.tg-onb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.tg-onb-chip {
  padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(64,224,255,0.34);
  font-family: var(--disp); font-size: 9px; letter-spacing: 2px; color: var(--cyan); text-transform: uppercase;
}
.tg-onb-chip small { color: var(--dim); font-size: 8px; margin-left: 6px; }
.tg-onb-widget {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 10px 12px;
  border: 1px solid rgba(64,224,255,0.34); border-radius: 10px; background: rgba(13,22,38,0.82);
  max-width: 520px;
}
.tg-onb-widget-tile {
  flex: none; width: 60px; height: 60px; border-radius: 8px; border: 1px solid var(--line);
  background: #0a1a30; display: grid; align-content: center; padding: 0 6px;
}
.tg-onb-widget-num { font-family: var(--disp); font-weight: 700; font-size: 20px; color: var(--text); }
.tg-onb-widget-sub { font-size: 7.5px; color: var(--green); }
.tg-onb-widget-title { font-size: 13.5px; color: var(--text); }
.tg-onb-widget-note { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ---------- station picker (legacy markup: /display and the kiosk) ---------- */
.tg-picker { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tg-vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.tg-search, .tg-select {
  background: rgba(6,12,22,0.75); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; font-size: 12px; font-family: inherit;
  max-width: 100%;
}
.tg-search { width: 170px; }
.tg-select { max-width: 320px; }
.tg-search:focus, .tg-select:focus { outline: 1px solid var(--cyan); }
.tg-chip {
  display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 4px;
  font-family: var(--disp); font-size: 8.5px; letter-spacing: 1.4px;
  color: var(--dim); border: 1px solid var(--line);
}
.tg-chip.tg-far { color: var(--amber); border-color: rgba(255,179,71,0.4); }

/* ---------- window finder ---------- */
.tg-windows { margin-bottom: 16px; }
.tg-wctl { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tg-wlist { display: flex; flex-direction: column; gap: 4px; }
.tg-wrow {
  --k: 74px; --t: 152px; --i: 92px;
  width: 100%; text-align: left; cursor: pointer;
  border: 0; border-left: 3px solid var(--amber); color: inherit; font: inherit;
}
.tg-wrow.is-weekend { border-left-color: var(--cyan); }
.tg-wrow:hover { background: rgba(33,230,255,0.09); }
.tg-wrow .tg-rm { text-align: left; }
.tg-more {
  margin-top: 8px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-family: var(--disp); font-size: 10px; letter-spacing: 2px;
}
.tg-more:hover { color: var(--text); border-color: var(--cyan); }
.tg-hkind {
  font-family: var(--disp); font-weight: 700; font-size: 13px; letter-spacing: 2px;
  color: var(--amber); margin-right: 7px;
}
.tg-hcard.is-scrub { border-top-color: #fff; }
.tg-hcard.is-scrub.x-high .tg-hkind { color: var(--green); }
.tg-scrollnote {
  margin: 7px 2px 0; font-size: 11px; color: var(--dim); letter-spacing: 1px;
}

/* ---------- two columns ---------- */
.tg-cols {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: start;
}

/* ---------- tide table ---------- */
.tg-table {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
}
.tg-day {
  background: rgba(10,18,32,0.5); border: 1px solid rgba(64,224,255,0.09);
  border-radius: 9px; padding: 9px 10px 10px;
}
.tg-dayh {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-family: var(--disp); font-weight: 700; font-size: 11px; letter-spacing: 2.5px;
  color: var(--cyan); margin-bottom: 7px;
}
.tg-daydate { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 1px; color: var(--dim); }
.tg-rows {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  --k: 44px;   /* ▼ LOW      */
  --t: 72px;   /* 12:30 AM   */
  --i: 56px;   /* in 45h 14m */
}
/* Fixed pixel tracks, not `auto`: each row is its own grid, so only equal
   track widths make the numbers line up down a day column. */
.tg-row {
  display: grid; grid-template-columns: var(--k) var(--t) minmax(0, 1fr) var(--i);
  align-items: baseline; gap: 6px;
  padding: 4px 7px; border-radius: 6px;
  background: rgba(6,12,22,0.55);
  border-left: 3px solid transparent;
}
.tg-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-row.x-high { border-left-color: var(--green); }
.tg-row.x-low { border-left-color: var(--amber); }
.tg-row.is-past { opacity: 0.42; }
.tg-row.is-next {
  background: rgba(33,230,255,0.11);
  box-shadow: inset 0 0 0 1px rgba(33,230,255,0.35);
}
.tg-row-none { display: block; color: var(--dim); font-size: 11.5px; }
.tg-rk { font-family: var(--disp); font-size: 9px; letter-spacing: 1.1px; color: var(--dim); }
.tg-rt { font-family: var(--disp); font-weight: 700; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.tg-rm { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.tg-rm i { font-style: normal; font-size: 10.5px; color: var(--dim); }
.tg-rin { font-size: 10.5px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- current ---------- */
.tg-currows { gap: 3px; --k: 78px; }   /* MAX FLOOD is a wider first column */
.tg-curday {
  margin: 9px 0 3px;
  font-family: var(--disp); font-weight: 700; font-size: 10px; letter-spacing: 2.5px; color: var(--cyan);
}
.tg-currows .tg-curday:first-child { margin-top: 0; }
.tg-cur-slack { border-left-color: rgba(107,130,153,0.7); }
.tg-cur-max.p-flood { border-left-color: var(--green); }
.tg-cur-max.p-ebb { border-left-color: var(--amber); }
.tg-cur-max.p-slack { border-left-color: var(--dim); }

/* ---------- credits ---------- */
.tg-credit {
  margin: 4px 0 10px; padding: 12px 15px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; line-height: 1.6; color: var(--dim);
}
.tg-credit b { color: var(--text); font-weight: 600; }

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .tg-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tg-top { gap: 10px; padding: 9px 12px; }
  .tg-home { font-size: 13px; letter-spacing: 2px; }
  .tg-place { order: 3; flex-basis: 100%; }
  .tg-sheet { margin-left: 12px; margin-right: 12px; max-height: 62vh; }
  .tg-row-sub { display: none; }
  .tg-prefs { margin-left: auto; }
  .tg-main { padding: 12px 12px 0; gap: 13px; }
  .tg-hero { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
  /* An odd number of cards would leave the last one stranded beside a hole. */
  .tg-hero > .tg-hcard:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tg-hcard { padding: 10px 11px 11px; }
  .tg-hmain { min-height: 32px; }
  .tg-table { grid-template-columns: 1fr; }
  .tg-card { padding: 11px 12px 13px; }
}
