/* ===========================================================
   Tokens. Light is the default. Dark via [data-theme="dark"].
   Per-screen accent colour comes in as --screen (set by app.js).
   Per-card accent comes in as --accent (falls back to --screen).
   =========================================================== */
:root {
  --bg: #cfd5df;
  --surface: #e0e4eb;
  --surface-2: #d3d9e2;
  --ink: #1b2330;
  --muted: #4e5a6c;
  --border: #bec6d3;
  --good: #2f9e63;
  --warn: #c6873f;
  --bad: #d2564e;
  --screen: #6d74e8;
  --accent: var(--screen);
  --shadow: 0 1px 2px rgba(27,35,48,.04), 0 4px 16px rgba(27,35,48,.06);
  --radius: 16px;
  --gap: clamp(12px, 2vw, 22px);
  --pad: clamp(16px, 3vw, 32px);
}
:root[data-theme="dark"] {
  --bg: #13171d;
  --surface: #1c2129;
  --surface-2: #252b34;
  --ink: #e6ebf1;
  --muted: #9aa5b3;
  --border: #2f3742;
  --good: #4cc38a;
  --warn: #e0a94e;
  --bad: #ef8f8f;
  --shadow: 0 1px 2px rgba(0,0,0,.25);
  color-scheme: dark;
}
/* Dark mode: cards stay one neutral grey (no per-card colour wash), and the
   selected tab or button uses a soft tint with light text, not a bright fill. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .info-card,
:root[data-theme="dark"] .sea-stat,
:root[data-theme="dark"] .wx-current { background: var(--surface); }
:root[data-theme="dark"] .tab.active,
:root[data-theme="dark"] .cal-seg button.active {
  background: color-mix(in srgb, var(--screen) 26%, var(--surface-2));
  color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--screen) 55%, transparent);
}
:root[data-theme="dark"] .tab.active .icon { color: var(--screen); }
:root[data-theme="dark"] .meal-today { background: color-mix(in srgb, var(--screen) 30%, var(--surface-2)); color: var(--ink); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; overflow: hidden;
  font-size: clamp(15px, 1.5vw, 17px);
}
button { font-family: inherit; }
.icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

/* a reusable rounded accent chip around an inline svg icon */
.ic-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px; border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ---------------- top bar ---------------- */
#topbar { display: flex; align-items: center; gap: var(--gap); padding: 11px var(--pad); background: var(--surface); box-shadow: var(--shadow); position: relative; z-index: 2; flex: 0 0 auto; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(18px, 2.3vw, 24px); letter-spacing: -.02em; }
#tabs { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--muted); border: 1px solid transparent; padding: 8px 13px; border-radius: 999px; font-size: clamp(13px, 1.5vw, 15px); font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.tab .icon { color: var(--screen); }
.tab:hover { background: color-mix(in srgb, var(--screen) 10%, var(--surface-2)); color: var(--ink); }
.tab.active { background: var(--screen); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--screen) 45%, transparent); }
.tab.active .icon { color: #fff; }
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); height: 38px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 650; transition: background .15s, border-color .15s; }
.icon-btn.square { width: 38px; padding: 0; justify-content: center; }
.icon-btn .icon { color: var(--ink); }
.icon-btn:hover { border-color: var(--screen); color: var(--screen); }
.icon-btn:hover .icon { color: var(--screen); }

/* ---------------- views ---------------- */
#views { position: relative; flex: 1 1 auto; overflow: hidden; }
.view { position: absolute; inset: 0; padding: var(--pad); overflow: auto; display: none; flex-direction: column; }
.view.active { display: flex; }
.view h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--gap); font-size: clamp(22px, 3vw, 32px); font-weight: 750; letter-spacing: -.02em; }
.view h2 .icon { color: var(--screen); background: color-mix(in srgb, var(--screen) 16%, transparent); padding: 8px; border-radius: 12px; box-sizing: content-box; }
.view .body { flex: 1 1 auto; display: flex; flex-direction: column; }
.loading, .muted { color: var(--muted); }

.kiosk-only { display: none !important; }

/* ---------------- home overview ---------------- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: var(--gap); flex: 1 1 auto; min-height: 0; }
.card { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 2.2vw, 28px); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.h-wx-two { display: flex; gap: 14px; margin-top: auto; padding-top: 16px; }
.h-wx-day { flex: 1 1 0; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 12px 6px; }
.h-wx-lbl { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.h-wx-ic { margin: 6px 0; }
.h-wx-t b { font-size: 22px; }
@media (max-width: 680px) { .home-grid { grid-template-columns: 1fr; grid-auto-rows: auto; } }
.card-head { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }
.card-head .icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); padding: 7px; border-radius: 10px; box-sizing: content-box; }
.card-big { display: flex; align-items: center; gap: 14px; font-size: clamp(40px, 6vw, 60px); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.card-big .icon { color: var(--accent); }
.card-sub { color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: clamp(14px, 1.6vw, 17px); }
.card-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-list li { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; font-size: clamp(14px, 1.7vw, 18px); }
.card-list .ct { color: var(--accent); font-weight: 700; min-width: 86px; font-variant-numeric: tabular-nums; }
.card-meal { font-size: clamp(24px, 3.4vw, 34px); font-weight: 750; margin-top: 4px; }
#h-weather { --accent: #0ea5e9; } #h-today { --accent: #6366f1; }
#h-tide { --accent: #14b8a6; } #h-meal { --accent: #f43f5e; }

/* ---------------- weather ---------------- */
.wx-place { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; margin-bottom: 14px; }
.wx-place .icon { color: var(--screen); }
.wx-current { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: var(--gap); background: color-mix(in srgb, var(--screen) 6%, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 2.4vw, 28px); box-shadow: var(--shadow); }
.wx-current .big { font-size: clamp(50px, 9vw, 92px); font-weight: 800; letter-spacing: -.03em; line-height: .9; }
.wx-now-meta { display: flex; flex-direction: column; gap: 4px; }
.wx-now-meta .cond { font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; }
.wx-now-meta .m { color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.wx-detail { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.wx-pill { display: inline-flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 20px; font-weight: 650; }
.wx-pill .icon { color: var(--screen); flex: 0 0 auto; }
.wx-pill b { font-weight: 800; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.01em; line-height: 1; display: block; }
.wx-pill .wl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; display: block; margin-bottom: 3px; }
.wx-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; flex: 0 0 auto; }
.wx-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 10px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.wx-day.is-today { background: color-mix(in srgb, var(--screen) 10%, var(--surface)); border-color: color-mix(in srgb, var(--screen) 45%, var(--border)); }
.wx-day .d { color: var(--ink); font-size: clamp(14px, 1.4vw, 17px); font-weight: 750; }
.wx-day .dnum { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.wx-day .ic { margin: 6px 0; }
.wx-temps { font-size: clamp(16px, 1.8vw, 22px); }
.wx-day .hi { font-weight: 800; } .wx-day .lo { color: var(--muted); }
.wx-day .pp { color: #2f8fd0; font-size: 12px; font-weight: 700; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.wx-day .pp.dry { color: var(--muted); }
.wx-sun { color: #f3a712; } .wx-cloudSun { color: #e0a815; } .wx-cloud { color: #8595a8; }
.wx-rain { color: #2f9fe0; } .wx-snow { color: #6cc5f0; } .wx-storm { color: #9b7cf0; } .wx-fog { color: #8595a8; }

/* ---------------- lists ---------------- */
.list-add { display: flex; gap: 10px; margin-bottom: 14px; max-width: 680px; }
.list-add input { flex: 1 1 auto; background: var(--surface); border: 1px solid var(--border); color: var(--ink); padding: 14px 16px; border-radius: 12px; font-size: 16px; }
.list-add input:focus { outline: none; border-color: var(--screen); box-shadow: 0 0 0 3px color-mix(in srgb, var(--screen) 22%, transparent); }
.list-add button { display: inline-flex; align-items: center; gap: 6px; background: var(--screen); color: #fff; border: 0; border-radius: 12px; padding: 0 20px; font-weight: 700; cursor: pointer; font-size: 15px; }
.list-add button .icon { color: #fff; }
.list-count { color: var(--muted); font-size: 13px; font-weight: 650; margin-bottom: 12px; }
ul.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; align-content: start; }
ul.items li { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); transition: opacity .2s; }
ul.items li.done { opacity: .55; }
ul.items li.done .txt { text-decoration: line-through; color: var(--muted); }
ul.items li .txt { flex: 1 1 auto; font-size: clamp(15px, 1.8vw, 18px); }
ul.items li.empty { justify-content: center; box-shadow: none; background: transparent; border-style: dashed; grid-column: 1 / -1; }
.chk { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
li.done .chk { background: var(--good); border-color: var(--good); }
.chk .icon { color: #fff; }
.del { background: transparent; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; padding: 4px; border-radius: 8px; }
.del:hover { color: var(--bad); background: var(--surface-2); }

/* ---------------- screen edit toggle + edit rows (links/info/meals) ---------------- */
.screen-bar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; align-items: center; }
.edit-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 9px 15px; font-weight: 650; cursor: pointer; }
.edit-toggle:hover { border-color: var(--screen); color: var(--screen); }
.edit-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.edit-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.edit-row input { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 11px 13px; font-size: 15px; min-width: 0; }
.edit-row input:focus { outline: none; border-color: var(--screen); }
.add-row { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; background: var(--screen); color: #fff; border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 700; cursor: pointer; }
.add-row .icon { color: #fff; }

/* ---------------- meals (read-first grid of 7) ---------------- */
.meals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); align-content: start; }
.meal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; }
/* per-cook tint: --cook set inline by JS */
.meal-card[style*="--cook"] { background: color-mix(in srgb, var(--cook) 8%, var(--surface)); border-color: color-mix(in srgb, var(--cook) 28%, var(--border)); }
.meal-card.today { outline: 2px solid var(--screen); outline-offset: -2px; }
.meal-card-day { font-weight: 750; font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meal-date { color: var(--muted); font-weight: 600; margin-left: 6px; }
.meal-today { font-size: 10px; background: var(--screen); color: #fff; padding: 3px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.meal-card-meal { font-size: clamp(18px, 1.9vw, 22px); font-weight: 650; flex: 1 1 auto; line-height: 1.25; }
.meal-card-cook { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; padding: 6px 11px; border-radius: 999px; align-self: flex-start;
  color: var(--cook, var(--muted)); background: color-mix(in srgb, var(--cook, var(--muted)) 16%, transparent); }
.meal-card-cook .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cook, var(--muted)); flex: 0 0 auto; }
.meal-in-meal, .meal-in-cook, .meal-in-pick { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; color: var(--ink); font-size: 15px; width: 100%; font-family: inherit; }
.meal-in-cook { border-color: var(--cook, var(--border)); }
.meal-in-pick { color: var(--muted); font-weight: 650; }
.meal-in-meal:focus, .meal-in-cook:focus, .meal-in-pick:focus { outline: none; border-color: var(--screen); }
/* cook manager (edit mode) */
.cook-manager { max-width: 760px; margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.cook-manager h4 { margin: 0 0 4px; font-size: 15px; }
.cook-manager p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.cook-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cook-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  color: var(--cook); background: color-mix(in srgb, var(--cook) 15%, transparent); border: 1px solid color-mix(in srgb, var(--cook) 35%, transparent); }
.cook-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cook); }
.cook-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; opacity: .7; }
.cook-chip button:hover { opacity: 1; }
.cook-add { display: flex; gap: 8px; max-width: 360px; }
.cook-add input { flex: 1 1 auto; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.cook-add input:focus { outline: none; border-color: var(--screen); }
.cook-add button { background: var(--screen); color: #fff; border: 0; border-radius: 10px; padding: 0 16px; font-weight: 700; cursor: pointer; }

/* ---------------- links grid ---------------- */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.link-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .1s; }
.link-card:hover { border-color: var(--screen); transform: translateY(-2px); }
.link-ic { color: var(--screen); background: color-mix(in srgb, var(--screen) 15%, transparent); padding: 8px; border-radius: 10px; align-self: flex-start; display: inline-flex; }
.link-label { font-weight: 700; font-size: 17px; }
.link-host { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------------- info grid ---------------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.info-card { position: relative; background: color-mix(in srgb, var(--screen) 5%, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.info-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.info-value { font-size: clamp(18px, 2vw, 22px); font-weight: 650; }

/* ---------------- trains ---------------- */
.train-sub { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; }
.train-sub .icon { color: var(--screen); }
.train-note { margin-top: 14px; max-width: 70ch; }
.train-list { display: flex; flex-direction: column; gap: 8px; }
.train-boards { display: flex; flex-direction: column; gap: 28px; }
.train-board { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.train-board .train-sub { align-self: flex-start; }
.train-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 16px; align-items: center; padding: 15px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); font-size: clamp(15px, 2vw, 20px); }
.train-row.cancelled { background: color-mix(in srgb, var(--bad) 7%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.train-row.delayed { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 32%, var(--border)); }
.train-row .time { font-variant-numeric: tabular-nums; font-weight: 800; }
.train-row .exp { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .85em; background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.train-row .exp.delayed { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.train-row .exp.cancelled { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.train-row .dest { font-weight: 650; }
.train-row .plat { color: var(--muted); font-weight: 650; white-space: nowrap; }

/* ---------------- tides + sea ---------------- */
.sea-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.sea-stat { background: color-mix(in srgb, var(--screen) 6%, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.sea-stat .l { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 7px; }
.sea-stat .l .icon { color: var(--screen); }
.sea-stat .v { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.02em; }
.sea-stat .v .unit { font-size: .42em; font-weight: 700; color: var(--muted); margin-left: 2px; }
.sea-stat .ctx { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 7px; }
.sea-stat .ctx .dot { width: 9px; height: 9px; border-radius: 50%; }
.sea-stat .sea-sub { color: var(--muted); font-size: 13px; font-weight: 600; }
.sea-stat .sea-sub b { color: var(--ink); font-weight: 750; }
.sea-stat.wide { grid-column: span 2; }
.wave-chart { margin-top: 12px; }
.wave-chart svg { width: 100%; height: 46px; display: block; overflow: visible; }
.wave-area { fill: color-mix(in srgb, var(--screen) 16%, transparent); stroke: none; }
.wave-line { fill: none; stroke: var(--screen); stroke-width: 2; vector-effect: non-scaling-stroke; }
.wave-now { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; opacity: .6; }
.wave-scale { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 650; }
.wave-scale span { color: var(--muted); }
.wave-scale .now { color: var(--screen); font-weight: 800; }
.wave-scale b { color: var(--ink); }
@media (max-width: 680px) { .sea-stat.wide { grid-column: auto; } }
.rate-good { color: var(--good); } .rate-good .dot { background: var(--good); }
.rate-ok { color: var(--warn); } .rate-ok .dot { background: var(--warn); }
.rate-bad { color: var(--bad); } .rate-bad .dot { background: var(--bad); }
.swim-banner { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: var(--radius); margin-bottom: var(--gap); font-weight: 700; font-size: clamp(16px, 2vw, 20px); border: 1px solid var(--border); box-shadow: var(--shadow); }
.swim-banner .icon { flex: 0 0 auto; }
.swim-banner.rate-good { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, var(--border)); }
.swim-banner.rate-ok { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.swim-banner.rate-bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.swim-banner small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }
/* The Tides page fits the screen height on every screen size: the banner and
   sea cards shrink with the height, and the 7 day rows share what is left. */
.view .body:has(> .tides) { min-height: 0; }
.tides { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 18px); }
.tides > * { margin: 0; flex: 0 0 auto; }
.tides .swim-banner { padding: clamp(8px, 1.4vh, 16px) clamp(12px, 1.6vw, 20px); font-size: clamp(14px, 2.1vh, 20px); }
.tides .sea-stats { grid-template-columns: 1fr 2fr 1fr; gap: var(--gap); }
.tides .sea-stat { padding: clamp(10px, 1.8vh, 20px) clamp(12px, 1.6vw, 22px); min-width: 0; }
.tides .sea-stat.wide { grid-column: auto; }
.tides .sea-stat .v { font-size: clamp(24px, 5vh, 46px); line-height: 1.1; }
.tides .wave-chart { margin-top: clamp(4px, 1vh, 12px); }
.tides .wave-chart svg { height: clamp(22px, 4.5vh, 46px); }
.tide-list { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, .7fr) repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(var(--days, 7), minmax(0, 1fr)); gap: clamp(4px, 1vh, 10px); }
.tide-day { grid-column: 1; align-self: center; color: var(--muted); font-size: clamp(12px, 1.7vh, 17px); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; min-width: 0; }
.tide-day .short { display: none; }
.tide-row { container-type: inline-size; min-width: 0; min-height: 0; display: flex; align-items: center; padding: 0 clamp(8px, 1vw, 16px); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: clamp(14px, min(2vh, 1.5vw), 21px); overflow: hidden; }
.tide-row.high { background: color-mix(in srgb, #2f9fe0 8%, var(--surface)); border-color: color-mix(in srgb, #2f9fe0 28%, var(--border)); }
.tide-in { display: flex; gap: 12px; align-items: center; width: 100%; }
.tide-row .tag { font-weight: 800; white-space: nowrap; }
.tide-row.high .tag { color: #2f8fd0; } .tide-row.low .tag { color: var(--muted); }
.tide-row .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1em; margin-left: auto; }
.tide-row .ht { color: var(--muted); font-weight: 650; white-space: nowrap; }
/* Narrow tide cells: drop the words "High tide" / "Low tide" (the arrow and colour stay). */
@container (max-width: 200px) {
  .tide-in { gap: 8px; }
  .tide-row .word { display: none; }
}
/* Very narrow cells (phones, portrait screens): time on top, arrow and height underneath. */
@container (max-width: 165px) {
  .tide-in { flex-wrap: wrap; row-gap: 0; column-gap: 4px; line-height: 1.15; }
  .tide-row .time { order: -1; flex: 1 0 100%; margin: 0; font-size: clamp(14px, 17cqi, 30px); }
  .tide-row .tag, .tide-row .ht { font-size: clamp(11px, 11cqi, 19px); }
}
/* Portrait screens: short day names so the day column stays narrow. */
@media (max-aspect-ratio: 1/1), (max-width: 680px) {
  .tide-day .long { display: none; } .tide-day .short { display: inline; }
  .tide-day .date { display: block; }
  .tide-list { grid-template-columns: minmax(0, .5fr) repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .tides .sea-stats { grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
  .tides .sea-stat { padding: 8px 10px; }
  .tides .sea-stat .l { font-size: 10px; gap: 4px; }
  .tides .sea-stat .l .icon { display: none; }
  .tides .sea-stat .ctx { font-size: 12px; }
  .tides .sea-stat .sea-sub, .tides .wave-scale { font-size: 11px; }
  .tides .wave-scale span:not(.now) { display: none; }
  .tide-list { grid-template-columns: minmax(0, .5fr) repeat(4, minmax(0, 1fr)); gap: 5px; }
  .tide-row { border-radius: 9px; padding: 0 7px; font-size: 15px; }
  .tide-day { letter-spacing: 0; font-size: 12px; }
}
/* Short landscape screens (small kiosk displays, laptops with the browser bars):
   drop the extra lines from the top cards so the 7 day rows keep room to read. */
@media (max-height: 720px) and (min-aspect-ratio: 1/1) {
  .view:has(.tides) h2 { margin-bottom: 8px; font-size: 22px; }
  .view:has(.tides) h2 .icon { padding: 5px; }
  .tides { gap: 8px; }
  .tides .swim-banner { padding: 6px 12px; font-size: 14px; }
  .tides .swim-banner small { display: inline; margin-left: 8px; }
  .tides .swim-banner .icon { width: 20px; height: 20px; }
  .tides .sea-stats { gap: 10px; }
  .tides .sea-stat { padding: 8px 12px; gap: 2px; }
  .tides .sea-stat .v { font-size: 24px; }
  .tides .sea-stat .sea-sub { display: none; }
  .tides .wave-chart { display: none; }
  .tide-list { gap: 4px; }
  .tide-row { font-size: 14px; border-radius: 8px; }
  .tide-day { font-size: 12px; }
}
/* Very short screens: put the sea temperature, waves and wind on one line each. */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  .view:has(.tides) { padding-top: 10px; padding-bottom: 10px; }
  .view:has(.tides) h2 { display: none; }
  .tides .sea-stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding: 6px 10px; }
  .tides .sea-stat .l { flex: 1 0 100%; font-size: 11px; }
  .tides .sea-stat .v { font-size: 20px; }
  .tides .sea-stat .ctx { font-size: 13px; }
  .tide-row { font-size: 13px; padding: 0 8px; }
  .tide-day { font-size: 11px; letter-spacing: 0; }
  /* keep each tide on one line: the rows are too short for two */
  .tide-in { flex-wrap: nowrap; gap: 6px; line-height: 1.2; }
  .tide-row .time { order: 0; flex: 0 0 auto; margin-left: auto; font-size: 1.05em; }
  .tide-row .tag, .tide-row .ht { font-size: inherit; }
}

/* ---------------- calendar ---------------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); }
.cal-seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.cal-seg button { background: transparent; color: var(--muted); border: 0; padding: 9px 18px; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; }
.cal-seg button.active { background: var(--screen); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--screen) 40%, transparent); }
.cal-nav { display: inline-flex; align-items: center; gap: 8px; }
.cal-nav .lbl { font-weight: 750; font-size: clamp(16px, 2vw, 20px); min-width: 9.5em; text-align: center; }
.cal-nav button { background: var(--surface-2); color: var(--ink); border: 0; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.cal-nav button.today { width: auto; padding: 0 16px; font-weight: 700; font-size: 14px; }
.cal-nav button:hover { color: var(--screen); }

/* event colour per calendar index */
.cal-c0 { --cev: var(--screen); }
.cal-c1 { --cev: #b06bf0; }
.cal-c2 { --cev: #2fb0a0; }
.cal-c3 { --cev: #e0894f; }

/* month grid */
.cal-month { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dow span { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cal-weeks { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.cal-week { position: relative; flex: 1 1 0; }
.cal-week-bg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 100%; }
.cal-cell { background: var(--surface); border-radius: 12px; padding: 6px 8px; box-shadow: var(--shadow); min-height: 84px; }
.cal-cell.out { background: var(--surface-2); opacity: .5; }
.cal-cell.today { background: color-mix(in srgb, var(--screen) 12%, var(--surface)); outline: 2px solid var(--screen); outline-offset: -2px; }
.cal-cell .dnum { font-weight: 700; font-size: 14px; color: var(--ink); }
.cal-cell.out .dnum { color: var(--muted); }
.cal-bars { position: absolute; left: 0; right: 0; top: 28px; bottom: 4px; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 22px; gap: 4px 6px; pointer-events: none; }
.cal-bar { background: var(--cev); color: #fff; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.cal-bar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar .bt { opacity: .85; font-variant-numeric: tabular-nums; margin-right: 5px; }

/* week view */
.cal-week-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 10px; }
.cal-band { position: relative; }
.cal-band .cal-bars { position: relative; top: 0; bottom: auto; min-height: 26px; }
.cal-cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; flex: 1 1 auto; min-height: 0; }
.cal-col { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 5px; overflow: auto; }
.cal-col.today { background: color-mix(in srgb, var(--screen) 10%, var(--surface)); outline: 2px solid var(--screen); outline-offset: -2px; }
.cal-colhd { text-align: center; padding-bottom: 6px; }
.cal-colhd .dw { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.cal-colhd .dn { font-weight: 800; font-size: 18px; }
.cal-col.today .cal-colhd .dn, .cal-col.today .cal-colhd .dw { color: var(--screen); }

/* shared event chip (week + day views) */
.cal-chip { background: color-mix(in srgb, var(--cev) 12%, var(--surface)); border-radius: 9px; padding: 8px 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cev) 35%, transparent); }
.cal-chip .ct { font-variant-numeric: tabular-nums; color: var(--cev); font-weight: 700; font-size: 13px; }
.cal-chip .cs { font-weight: 650; font-size: 14px; }
.cal-chip .cl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cal-chip.allday { background: var(--cev); color: #fff; }
.cal-chip.allday .ct, .cal-chip.allday .cs, .cal-chip.allday .cl { color: #fff; }

/* day view */
.cal-dayview { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; max-width: 760px; }
.cal-dayview .cal-chip { padding: 14px 16px; display: flex; gap: 14px; align-items: baseline; }
.cal-dayview .cal-chip .ct { min-width: 110px; font-size: 15px; }
.cal-dayview .cal-chip .cs { font-size: 17px; flex: 1 1 auto; }
.cal-empty { color: var(--muted); padding: 20px 2px; }

/* ---------------- notes / web / image ---------------- */
.notes-edit { width: 100%; height: 100%; min-height: 60vh; resize: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); padding: 18px; font-size: clamp(16px, 2vw, 20px); line-height: 1.5; box-shadow: var(--shadow); }
.notes-edit:focus { outline: none; border-color: var(--screen); }
.notes-view { white-space: pre-wrap; font-size: clamp(18px, 2.6vw, 28px); line-height: 1.5; }
.embed { width: 100%; height: calc(100% - 26px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.embed-note { font-size: 12px; margin-top: 8px; }
.ships-map { height: 100%; min-height: 400px; }
.mg-ships { display: flex; gap: 8px; padding: 4px 8px; }
.mg-ships label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted, inherit); }
.mg-ships input { width: 6.5em; min-width: 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); color: var(--ink); font-size: 14px; padding: 2px; }
.image-screen { position: absolute; inset: var(--pad); }
.image-screen img { width: 100%; height: 100%; object-fit: contain; }

/* ---------------- setup hint ---------------- */
.setup { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; color: var(--muted); max-width: 640px; box-shadow: var(--shadow); line-height: 1.6; }
.setup code { color: var(--screen); background: color-mix(in srgb, var(--screen) 12%, var(--surface-2)); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------------- pictures slideshow ---------------- */
.slideshow { position: absolute; inset: 0; }
.slideshow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.slideshow img.show { opacity: 1; }

/* ---------------- manage modal ---------------- */
.manage-overlay { position: fixed; inset: 0; background: rgba(10,14,20,.5); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow: auto; }
.manage-overlay.show { display: flex; }
.mg-panel { background: var(--surface); color: var(--ink); width: min(820px, 100%); border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.mg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: var(--surface-2); }
.mg-head h3 { margin: 0; font-size: 20px; }
.mg-x { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px; }
.mg-rows { padding: 12px 22px; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; }
.mg-row { display: grid; grid-template-columns: auto 1fr auto 1.2fr auto auto auto; gap: 10px; align-items: center; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.mg-move { display: flex; flex-direction: column; gap: 2px; }
.mg-move button { width: 26px; height: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 6px; cursor: pointer; font-size: 11px; line-height: 1; }
.mg-move button:disabled { opacity: .3; cursor: default; }
.mg-title, .mg-url { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 14px; min-width: 0; }
.mg-title:focus, .mg-url:focus { outline: none; border-color: var(--screen); }
.mg-type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.mg-flag { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mg-flag input { accent-color: var(--screen); }
.mg-del { background: transparent; border: 1px solid var(--border); color: var(--bad); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 650; cursor: pointer; }
.mg-del:disabled { color: var(--muted); opacity: .5; cursor: default; }
.mg-add { padding: 16px 22px; background: var(--surface-2); }
.mg-add h4 { margin: 0 0 10px; font-size: 15px; }
.mg-add-form { display: flex; gap: 10px; flex-wrap: wrap; }
.mg-add-form select, .mg-add-form input { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.mg-add-form select { flex: 2 1 220px; } .mg-add-form input { flex: 1 1 160px; }
.mg-add-form button { background: var(--screen); color: #fff; border: 0; border-radius: 10px; padding: 0 20px; font-weight: 700; cursor: pointer; }
.mg-foot { display: flex; align-items: center; gap: 14px; padding: 16px 22px; background: var(--surface-2); }
.mg-save { background: var(--screen); color: #fff; border: 0; border-radius: 10px; padding: 11px 22px; font-weight: 700; font-size: 15px; cursor: pointer; }

/* ---------------- settings modal ---------------- */
.set-body { padding: 8px 22px 4px; max-height: 64vh; overflow: auto; }
.set-sec { padding: 10px 14px; margin: 10px 0; background: var(--surface-2); border-radius: 12px; }
.set-sec h4 { margin: 0 0 4px; font-size: 16px; }
.set-help { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.set-help b { color: var(--ink); font-weight: 650; }
.set-ok { color: var(--good); font-style: normal; font-weight: 700; font-size: 12px; }
.set-err { color: var(--bad); font-style: normal; font-weight: 700; }
.set-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.set-field > span { font-size: 13px; font-weight: 650; color: var(--muted); }
.set-field input, .set-field textarea { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; resize: vertical; }
.set-field input:focus, .set-field textarea:focus { outline: none; border-color: var(--screen); }
.set-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.set-find { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-weight: 650; cursor: pointer; height: 42px; }
.set-find:hover { border-color: var(--screen); }
.set-stations { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.station-pick { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); border-radius: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; }
.station-pick em { color: var(--muted); font-style: normal; }
.station-pick:hover { border-color: var(--screen); }

/* ---------------- kiosk ---------------- */
body.kiosk #topbar { display: none; }
body.kiosk .view { padding-top: clamp(20px, 5vh, 56px); }
body.kiosk .kiosk-only { display: block !important; }
#kioskProgress { position: fixed; left: 0; bottom: 0; height: 4px; width: 100%; }
#kioskBar { display: block; height: 100%; width: 0; background: var(--screen); }

/* ---------------- responsive ---------------- */
@media (max-aspect-ratio: 1/1), (max-width: 680px) {
  .wx-days { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
  .wx-detail { margin-left: 0; width: 100%; }
  .train-row { grid-template-columns: auto auto 1fr; }
  .train-row .plat { grid-column: 1 / -1; }
  .mg-row { grid-template-columns: auto 1fr auto; row-gap: 8px; }
  .mg-url { grid-column: 1 / -1; }
}
/* Phones: clock and buttons on one row, tabs on a second row that scrolls sideways. */
@media (max-width: 680px) {
  #topbar { flex-wrap: wrap; row-gap: 8px; }
  .clock { flex: 1 1 auto; }
  #tabs { order: 3; flex: 1 0 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; }
}
@media (min-width: 1400px) and (min-aspect-ratio: 1/1) {
  :root { --gap: 26px; }
  body { font-size: 20px; }
}

/* ---------------- meals + shopping list shared with the food app ---------------- */
.meal-line { display: flex; flex-direction: column; gap: 7px; }
.meal-line + .meal-line { border-top: 1px solid var(--border); padding-top: 9px; }
.meal-line.done .meal-card-meal { text-decoration: line-through; color: var(--muted); }
.meal-slot { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: block; }
.meal-por { font-size: 12px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 1px 8px; margin-left: 8px; vertical-align: middle; }
.meal-edit { display: flex; flex-direction: column; gap: 6px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.meal-edit-top, .meal-add { display: flex; gap: 6px; align-items: center; }
.meal-edit-top input, .meal-add input { flex: 1 1 auto; min-width: 0; }
.meal-add select { flex: 0 0 auto; width: auto; }
.meal-add-btn { flex: 0 0 auto; background: var(--screen); color: #fff; border: 0; border-radius: 9px; width: 38px; height: 38px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.meal-add-btn .icon { color: #fff; }
.shop-add { max-width: 820px; flex-wrap: wrap; }
.shop-add input { min-width: 160px; }
.shop-add select { background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 12px; padding: 0 12px; font-size: 15px; font-family: inherit; min-height: 48px; }
.shop-add button { min-height: 48px; }
.shop-clear { margin-left: 12px; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 4px 10px; font-weight: 650; cursor: pointer; font-family: inherit; }
.shop-clear:hover { border-color: var(--screen); color: var(--screen); }
.shop-group { margin-bottom: 18px; }
.shop-group h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.shop-group h3 span { background: color-mix(in srgb, var(--screen) 16%, transparent); color: var(--screen); border-radius: 999px; padding: 0 8px; font-weight: 800; }
.shop-meal { display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 9px; vertical-align: middle; }
.meal-add { flex-wrap: wrap; }
.meal-add input { flex: 1 1 100%; }
.meal-add select { flex: 1 1 auto; }

/* ---------------- fill the page on landscape screens (kiosk, laptop, TV) ----------------
   Cards stretch to the bottom of the page and text scales with the screen height,
   so short pages do not leave an empty band at the bottom. Phones and portrait
   screens keep the normal scrolling layout. */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .view .body { min-height: 0; }

  /* meals: one column per day, full height */
  .meals-grid.fill { flex: 1 1 auto; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); grid-auto-rows: 1fr; }
  .meals-grid.fill .meal-card { padding: clamp(16px, 2.2vh, 26px) clamp(14px, 1.2vw, 22px); gap: clamp(10px, 1.6vh, 18px); }
  .meals-grid.fill .meal-card-day { font-size: clamp(17px, 2.6vh, 28px); flex-wrap: wrap; }
  .meals-grid.fill .meal-date { display: block; margin: 2px 0 0; font-size: .75em; }
  .meals-grid.fill .meal-card-meal { flex: 0 0 auto; font-size: clamp(19px, 3.2vh, 36px); }
  .meals-grid.fill .meal-line { gap: clamp(7px, 1.2vh, 14px); }
  .meals-grid.fill .meal-line + .meal-line { padding-top: clamp(9px, 1.6vh, 18px); }
  .meals-grid.fill .meal-card-cook { font-size: clamp(14px, 1.9vh, 20px); }
  .meals-grid.fill .meal-slot { font-size: clamp(11px, 1.4vh, 15px); }

  /* lists (Discuss and other lists): rows fill the page */
  ul.items.fill { flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); grid-auto-flow: column; align-content: stretch; gap: clamp(10px, 1.4vh, 16px); }
  ul.items.fill li { padding: 0 clamp(16px, 1.6vw, 28px); gap: clamp(14px, 1.4vw, 22px); }
  ul.items.fill li .txt { font-size: clamp(18px, 3.2vh, 34px); font-weight: 600; }
  ul.items.fill .chk { width: clamp(28px, 4vh, 44px); height: clamp(28px, 4vh, 44px); }

  /* trains: rows share the page height; two boards sit side by side */
  .train-boards { flex: 1 1 auto; min-height: 0; }
  .train-boards.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
  .train-board { flex: 1 1 auto; }
  .train-boards.two .train-row { font-size: clamp(15px, 2.8vh, 30px); gap: clamp(10px, 1.2vw, 20px); padding: 0 clamp(12px, 1.2vw, 22px); }
  .train-list { flex: 1 1 auto; min-height: 0; gap: clamp(8px, 1.4vh, 16px); }
  .train-row { flex: 1 1 0; max-height: 24vh; font-size: clamp(17px, 3.4vh, 38px); padding: 0 clamp(18px, 2vw, 34px); gap: clamp(16px, 2vw, 32px); }
  .train-note { font-size: clamp(14px, 1.8vh, 18px); }

  /* weather: the 7-day cards fill the rest of the page */
  .wx-days { flex: 1 1 auto; min-height: 0; gap: var(--gap); }
  .wx-day { gap: clamp(4px, 1vh, 12px); }
  .wx-day .d { font-size: clamp(16px, 2.8vh, 30px); }
  .wx-day .dnum { font-size: clamp(12px, 1.7vh, 18px); }
  .wx-day .ic svg { width: clamp(46px, 9vh, 110px); height: clamp(46px, 9vh, 110px); }
  .wx-temps { font-size: clamp(20px, 3.8vh, 42px); }
  .wx-day .pp { font-size: clamp(12px, 1.8vh, 19px); }

}
