:root {
  --bg: #061423; --panel: #0c2236; --line: #1b3a55; --text: #e8f1f8; --dim: #8aa4ba; --faint: #4d6a82;
  --water: #1e88e5; --water2: #1565c0; --green: #2ecc71; --orange: #f39c12; --red: #e74c3c;
  --pad: clamp(8px, 1.2cqw, 16px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
/* Night: dimmed but colours kept, so green / orange / red still read at a glance. A tap brightens it for a minute. */
body.night #app { filter: brightness(0.4); }
body { transition: filter 1s; }

#app { height: 100%; display: grid; gap: var(--pad);
  padding: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
  grid-template-columns: minmax(220px, 26cqw) 1fr;
  grid-template-rows: auto auto auto auto 1fr auto auto;
  grid-template-areas: "tide title" "tide warn" "tide head" "tide tiles" "tide hours" "tide best" "tide foot"; }

  body.port #app { grid-template-columns: minmax(220px, 34cqw) 1fr;
    grid-template-rows: auto auto auto 1fr auto auto auto;
    grid-template-areas: "title title" "warn warn" "head head" "tide tiles" "hours hours" "best best" "foot foot"; }
  body.port .tiles { grid-template-columns: repeat(2, 1fr) !important; align-content: stretch; }
  body.port .tidecurve { flex: none; height: 150px; }
  body.port .tile { display: flex; flex-direction: column; justify-content: center; }
  body.port .tile .v { font-size: clamp(30px, 5.5cqw, 54px); }
  body.port .tile .s { font-size: clamp(13px, 1.9cqw, 17px); }
.tide { grid-area: tide; } .warn { grid-area: warn; } .head { grid-area: head; } .tiles { grid-area: tiles; }
.best { grid-area: best; } .hours { grid-area: hours; } .foot { grid-area: foot; }

/* ---------- tide column ---------- */
.tide { position: relative; border-radius: 18px; overflow: hidden; background: linear-gradient(#0a1c2e, #0d2a44); border: 1px solid var(--line); min-height: 300px; }
.water { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; transition: height 2s ease; display: flex; flex-direction: column; }
.wave { width: 200%; height: 28px; flex: none; display: block; margin-bottom: -1px; animation: drift 9s linear infinite; }
.wave .w1 { fill: var(--water); opacity: .9; }
.wave .w2 { fill: var(--water2); opacity: .7; }
.water-body { flex: 1; background: linear-gradient(var(--water), #0b4d8c 60%, #08345f); }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tide-mark { position: absolute; left: 0; right: 0; padding: 12px 14px; text-align: center; z-index: 2; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.tide-mark.top { top: 0; } .tide-mark.bottom { bottom: 0; }
.tide-mark .lbl { font-size: clamp(12px, 1.4cqw, 16px); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.tide-mark .big { font-size: clamp(22px, 3.2cqw, 40px); font-weight: 700; line-height: 1.1; }
.tide-mark .when { font-size: clamp(13px, 1.5cqw, 18px); color: var(--dim); }
.tide-mark.passed .big { opacity: .6; }
.tide-now { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; z-index: 2; text-shadow: 0 2px 6px rgba(0,0,0,.9); }
.tide-now .arrow { font-size: clamp(54px, 8cqw, 110px); line-height: 1; font-weight: 800; }
.tide-now .ht { font-size: clamp(24px, 3cqw, 40px); font-weight: 700; }
.tide-now .st { font-size: clamp(14px, 1.6cqw, 20px); color: #cfe3f3; }

/* ---------- warnings ---------- */
.warn { display: flex; flex-direction: column; gap: 6px; }
.warn a { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 12px; text-decoration: none; color: #fff; font-weight: 600; font-size: clamp(14px, 1.6cqw, 19px); }
.warn a.amber { background: #8a5a00; border: 1px solid var(--orange); }
.warn a.red { background: #7d1a12; border: 1px solid var(--red); animation: pulse 2.5s ease-in-out infinite; }
.warn a .w-when { margin-left: auto; font-weight: 400; opacity: .85; white-space: nowrap; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(231,76,60,.35); } }

/* ---------- header ---------- */
.head { display: flex; align-items: center; gap: clamp(10px, 2cqw, 28px); }
.clock { font-size: clamp(48px, 7cqw, 96px); font-weight: 700; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock small { font-size: .38em; font-weight: 500; color: var(--dim); margin-left: 4px; }
.date { color: var(--dim); font-size: clamp(14px, 1.6cqw, 20px); margin-top: 4px; }
.place-block { flex: 1; min-width: 0; }
.place { background: none; border: 0; padding: 0; font-size: clamp(20px, 2.4cqw, 30px); font-weight: 700; cursor: pointer; text-align: left; }
.place .chev { font-size: .6em; color: var(--dim); }
.sub { color: var(--dim); font-size: clamp(13px, 1.4cqw, 17px); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-btns { display: grid; grid-template-columns: auto auto; gap: 6px 8px; justify-items: end; align-items: center; }
.head-btns .btnrow { grid-column: 1 / -1; }
.boats { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.boats button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--dim); font-size: clamp(13px, 1.4cqw, 16px); white-space: nowrap; }
.boats button.on { background: var(--water2); color: #fff; font-weight: 600; }
.radar { color: var(--text); text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: clamp(13px, 1.4cqw, 16px); }
.radar small { color: var(--dim); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--pad); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.tile .k { font-size: clamp(11px, 1.1cqw, 14px); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.tile .v { font-size: clamp(22px, 2.6cqw, 34px); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.tile .v small { font-size: .5em; font-weight: 500; color: var(--dim); }
.tile .s { font-size: clamp(12px, 1.2cqw, 15px); color: var(--dim); line-height: 1.25; }
.dir { display: inline-block; width: .8em; height: .8em; vertical-align: -.05em; }

/* ---------- best time ---------- */
.best { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); }
.best .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.best .t { font-size: clamp(20px, 2.4cqw, 30px); font-weight: 700; }
.best .why { color: var(--dim); font-size: clamp(13px, 1.4cqw, 17px); }
.best.g { border-color: var(--green); } .best.g .dot { background: var(--green); }
.best.o { border-color: var(--orange); } .best.o .dot { background: var(--orange); }
.best.r { border-color: var(--red); } .best.r .dot { background: var(--red); }

/* ---------- hour by hour ---------- */
.hours { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 8px; display: flex; flex-direction: column; min-height: 0; }
.hours-title { font-size: clamp(12px, 1.2cqw, 15px); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; display: flex; gap: 12px; }
.hours-title .legend span { margin-left: 10px; text-transform: none; letter-spacing: 0; }
.hours-title .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.hours { --lblw: clamp(58px, 6.5cqw, 82px); }
.hours-title { flex-wrap: wrap; align-items: center; }
.howbtn { margin-left: 10px; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--text); padding: 2px 10px; font-size: inherit; cursor: pointer; text-transform: none; letter-spacing: 0; }
.hgrid { display: grid; column-gap: 3px; row-gap: 0; flex: none; }
.rl { font-size: clamp(10px, 1.05cqw, 13px); color: var(--dim); display: flex; align-items: center; padding: 2px 0; white-space: nowrap; }
.rl small { margin-left: 3px; opacity: .8; }
.hc { text-align: center; padding: 2px 1px; font-size: clamp(11px, 1.15cqw, 15px); display: flex; align-items: center; justify-content: center; min-height: clamp(20px, 2.9cqh, 28px); }
.hc.first { border-radius: 8px 8px 0 0; } .hc.last { border-radius: 0 0 8px 8px; }
.hc.past { opacity: .35; }
.hc.now { background: rgba(255,255,255,.08); }
.hc.inbest { box-shadow: inset 2px 0 0 #fff, inset -2px 0 0 #fff; }
.hc.inbest.first { box-shadow: inset 2px 0 0 #fff, inset -2px 0 0 #fff, inset 0 2px 0 #fff; }
.hc.inbest.last { box-shadow: inset 2px 0 0 #fff, inset -2px 0 0 #fff, inset 0 -2px 0 #fff; }
.hc .hh { font-weight: 700; color: var(--dim); }
.hc .rate { height: clamp(14px, 2.2cqh, 22px); border-radius: 5px; width: 100%; margin: 0 2px; }
.hc .rate.g { background: var(--green); } .hc .rate.o { background: var(--orange); } .hc .rate.r { background: var(--red); }
.hc .rate.dark { opacity: .45; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(0,0,0,.35) 4px 8px); }
.chip { display: block; width: 100%; margin: 0 2px; border-radius: 5px; padding: 1px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.gg { background: rgba(46,204,113,.22); color: #8ff0b6; }
.chip.go { background: rgba(243,156,18,.28); color: #ffd08a; }
.chip.gr { background: rgba(231,76,60,.35); color: #ffb3a8; }
.dirc { font-size: .8em; color: var(--dim); line-height: 1.05; }
.hc .bite { font-size: 11px; color: #ffd54f; min-height: 13px; }
.gg { color: var(--green); } .go { color: var(--orange); } .gr { color: var(--red); }
.tidecurve { flex: 1; min-height: 60px; position: relative; margin-top: 4px; margin-left: calc(var(--lblw) + 3px); }
/* live tiles graded the same way */
.tile.lg { border-color: var(--green); } .tile.lo { border-color: var(--orange); } .tile.lr { border-color: var(--red); }
.tile .lamp { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-left: 6px; vertical-align: -.05em; }
.tile.lg .lamp { background: var(--green); } .tile.lo .lamp { background: var(--orange); } .tile.lr .lamp { background: var(--red); }
.nowgrade { font-weight: 700; }
.btnrow { display: flex; gap: 8px; }
.daytabs { display: inline-flex; gap: 4px; margin-right: 6px; }
.daytabs button { background: var(--bg); border: 1px solid var(--line); color: var(--dim); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: inherit; text-transform: none; letter-spacing: 0; }
.daytabs button.on { background: var(--water2); border-color: var(--water2); color: #fff; font-weight: 600; }
[data-tip] { cursor: help; }
.tipbox { position: fixed; z-index: 20; max-width: min(420px, 90cqw); background: #fff; color: #0b1b2b; border-radius: 12px; padding: 10px 14px;
  font-size: 15px; line-height: 1.4; white-space: pre-line; box-shadow: 0 8px 30px rgba(0,0,0,.5); pointer-events: auto; }
.tipbox[hidden] { display: none; }
.fsbtn { position: fixed; z-index: 15; bottom: calc(4px + env(safe-area-inset-bottom)); right: calc(8px + env(safe-area-inset-right)); width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(12,34,54,.85); color: var(--dim); font-size: 16px; cursor: pointer; padding: 0; }
.fsbtn[hidden] { display: none; }
.btnrow button.radar { cursor: pointer; }
.tidecurve svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.foot { color: var(--faint); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.foot .ok { color: #3fa56b; } .foot .stale { color: var(--orange); font-weight: 600; }

/* ---------- setup ---------- */
.setup { position: fixed; inset: 0; background: rgba(2,8,16,.85); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 20px; }
.setup[hidden] { display: none; }
.setup-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(720px, 100%); max-height: 92cqh; overflow: auto; -webkit-user-select: text; user-select: text; }
.setup h2 { margin: 0 0 12px; } .setup h3 { margin: 18px 0 8px; font-size: 16px; } .setup h3 small { color: var(--dim); font-weight: 400; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 16px; }
.setup input[type=search] { flex: 1; min-width: 220px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 17px; }
.btn { padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.btn.primary { background: var(--water2); border-color: var(--water2); font-weight: 600; min-width: 120px; }
.list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.list button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.list button.on { border-color: var(--water); background: #0f3355; }
.list button small { color: var(--dim); }
.boat-list { flex-direction: row; flex-wrap: wrap; } .boat-list button { flex: 1; min-width: 200px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--dim); }
.check input { width: 20px; height: 20px; }
.tip { color: var(--dim); font-size: 14px; margin-top: 14px; }
.msg { color: var(--dim); padding: 6px 2px; }

/* ---------- compact fit for a 1180x820 iPad (v1.1) ---------- */
.clock { font-size: clamp(42px, 6cqw, 84px); }
.boats button { padding: 5px 12px; }
.radar { padding: 5px 14px; }
.tile { padding: 7px 10px; }
.tile .v { font-size: clamp(20px, 2.3cqw, 30px); }
.tile .s { font-size: clamp(11px, 1.05cqw, 14px); }
.nowgrade { font-size: .75em; }
.best { padding: 7px 14px; }
.best .t { font-size: clamp(18px, 2.1cqw, 26px); }
.best .dot { width: 18px; height: 18px; }
.hours { padding: 8px 10px 6px; }
.hours-title { margin-bottom: 4px; gap: 8px; }
.hc { min-height: clamp(17px, 2.5cqh, 26px); padding: 1px; }
.dirc { font-size: .75em; white-space: nowrap; }
.dirc br { display: none; }
.tidecurve { min-height: 56px; }

  body.port .tile .v { font-size: clamp(30px, 5.5cqw, 54px); }
  body.port .tile .s { font-size: clamp(13px, 1.9cqw, 17px); }

/* ---------- v1.2: the page box ("stage"), turned sideways on a phone held upright ---------- */
#stage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; overflow: hidden; container-type: size; }
body.rot #stage { transform-origin: 0 0; transform: rotate(90deg); }
.tipbox, .fsbtn, .setup { position: absolute; }

/* Header: wraps instead of running off the edge on a narrower iPad */
.head { flex-wrap: wrap; row-gap: 6px; }
.place-block { flex: 1 1 180px; }
.head-btns { margin-left: auto; }

/* Hour by hour: all 24 hours, swipe sideways; the row names stay put */
.hours { --colw: clamp(40px, 4.2cqw, 56px); }
.hscroll { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; overscroll-behavior-x: contain; }
.hgrid { width: max-content; }
.rl { position: sticky; left: 0; z-index: 2; background: var(--panel); padding-right: 4px; }
.tidecurve { flex: 1; }

/* Tide size */
.tsize { margin-top: 6px; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: clamp(12px, 1.4cqw, 16px); font-weight: 600; background: rgba(0,0,0,.35); }
.tsize.big { color: #ffd54f; } .tsize.small { color: #9fd3ff; } .tsize.mid { color: #e8f1f8; }

/* Warnings bar: always there */
.warn a.none { background: rgba(46,204,113,.12); border: 1px solid #1f7a49; color: #9fe8bd; font-weight: 500; }
.warn a.none.wait { background: var(--panel); border-color: var(--line); color: var(--dim); }

/* Editable limits */
.boat-list { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.boatcard { flex: 1 1 260px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg); }
.boatcard.on { border-color: var(--water); background: #0f3355; }
.boatcard > button { font-weight: 700; font-size: 17px; background: none; border: 0; padding: 2px 0 6px; cursor: pointer; text-align: left; }
.limits { border-collapse: collapse; margin: 4px 0; }
.limits th { font-size: 12px; font-weight: 600; text-align: left; padding: 2px 6px; }
.limits td { padding: 3px 6px; font-size: 14px; color: var(--dim); }
.lim { width: 72px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; }

/* ---------- phones: everything scrolls; the tide stays pinned beside it ---------- */
body.compact #app { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  grid-template-rows: auto auto auto auto auto auto auto; align-content: start; }
body.compact .tide { position: sticky; top: 0; align-self: start; height: calc(100cqh - 2 * var(--pad)); min-height: 0; }
body.compact .hours { min-height: 330px; }
body.compact .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
body.compact .clock { font-size: 44px; }
body.compact .tile .v { font-size: 22px; }
body.compact .tide-mark .big { font-size: 22px; } body.compact .tide-now .arrow { font-size: 48px; } body.compact .tide-now .ht { font-size: 22px; }
body.compact.port #app { grid-template-columns: 1fr; grid-template-rows: none;
  grid-template-areas: "title" "warn" "head" "tide" "tiles" "hours" "best" "foot"; }
body.compact.port .tide { position: relative; height: 52cqh; }
body.compact.port .tiles { grid-template-columns: repeat(2, 1fr) !important; }
body.compact .setup { padding: 8px; } body.compact .setup-card { max-height: 96cqh; padding: 14px; }
.orient { display: none; }
body.phone .orient { display: inline-block; }
.apptitle { font-size: clamp(11px, 1.15cqw, 14px); letter-spacing: .14em; text-transform: uppercase; color: #6fb6f2; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daytabs button { border-width: 2px; }
.daytabs button.dg { border-color: var(--green); } .daytabs button.do { border-color: var(--orange); } .daytabs button.dr { border-color: var(--red); }
.daytabs button.dg::before, .daytabs button.do::before, .daytabs button.dr::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.daytabs button.dg::before { background: var(--green); } .daytabs button.do::before { background: var(--orange); } .daytabs button.dr::before { background: var(--red); }
.foot { flex-direction: column; gap: 2px; padding-right: 44px; }
.joke { color: #cfe3f3; font-size: clamp(12px, 1.25cqw, 15px); font-style: italic; }
.srcs { color: var(--faint); }
#refreshBtn.busy { opacity: .6; }
/* grid children may shrink below their content (the 24-hour strip scrolls inside instead of widening the page) */
#app > * { min-width: 0; }
.bjoke { margin-left: auto; max-width: 46%; padding-left: 16px; border-left: 1px solid var(--line); color: #cfe3f3; font-style: italic; font-size: clamp(12px, 1.25cqw, 15px); line-height: 1.3; }
.bjoke span { display: block; font-style: normal; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
body.compact.port .best { flex-wrap: wrap; } body.compact.port .bjoke { max-width: 100%; margin-left: 0; border-left: 0; padding-left: 0; }
/* v1.2.2: everything fits one iPad screen, no page scroll. Only phones (body.compact) scroll. */
#app { overflow: hidden; }
.head { flex-wrap: nowrap; gap: clamp(8px, 1.4cqw, 20px); }
.clock { font-size: clamp(40px, 5.2cqw, 72px); }
.date { font-size: clamp(12px, 1.3cqw, 17px); margin-top: 2px; }
.place { font-size: clamp(17px, 1.9cqw, 26px); }
.head-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; max-width: 62%; }
.head-btns .btnrow { grid-column: auto; gap: 6px; }
.boats button { padding: 6px 10px; }
.radar { padding: 6px 11px; white-space: nowrap; }
body:not(.phone) #orientBtn { display: none; }
.setgrp { display: inline-flex; }
.setgrp #refreshBtn { border-radius: 999px 0 0 999px; border-right: 0; }
.setgrp #setBtn { border-radius: 0 999px 999px 0; }
.tile .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best .why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best > div:not(.bjoke) { min-width: 0; }
.bjoke { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bjoke span { display: inline; margin-right: 6px; }
body.compact #app { overflow-y: auto; }
body.compact .head { flex-wrap: wrap; } body.compact .head-btns { max-width: none; }
body.compact .tile .s { white-space: normal; }
.hours-title { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.hours-title .howbtn { margin-left: auto; }
.hc { min-height: clamp(15px, 2.2cqh, 26px); }
.hc .rate { height: clamp(12px, 1.9cqh, 22px); }
.chip { padding: 0; }
.tidecurve { flex: 1 1 40px; min-height: 34px; }
.tiles .tile { padding: 6px 10px; }
/* v1.2.3: header gives the place its room; table rows size to the space left */
.clock-block { flex: none; }
.sunline { white-space: normal; }
.sunline span { display: block; white-space: nowrap; }
.place-block { flex: 1 1 0; min-width: 120px; }
.place { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-btns { flex: none; max-width: 52%; }
.boats button, .radar { font-size: clamp(12px, 1.2cqw, 15px); padding: 5px 10px; }
.radar small { display: none; }
#refreshBtn.stale { color: var(--orange); border-color: var(--orange); }
.warn a { padding: 6px 14px; }
.warn a .w-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { white-space: nowrap; overflow: hidden; }
.foot > * { overflow: hidden; text-overflow: ellipsis; }
.hours { --rowh: 22px; }
.hc, .rl { min-height: 0; height: var(--rowh); padding-top: 0; padding-bottom: 0; }
.hc { font-size: min(clamp(11px, 1.15cqw, 15px), calc(var(--rowh) * .7)); }
.rl { font-size: min(clamp(10px, 1.05cqw, 13px), calc(var(--rowh) * .65)); }
.chip { line-height: calc(var(--rowh) - 4px); padding: 0; }
.hc .rate { height: calc(var(--rowh) - 6px); }
.hc .bite { min-height: 0; font-size: inherit; }
.dirc { line-height: 1; }
body.compact .hc, body.compact .rl { height: auto; min-height: 22px; }
.warn a.none { padding: 3px 12px; font-size: clamp(11px, 1.1cqw, 14px); font-weight: 500; }
/* v1.2.3: short screens (iPad Safari with its bars): every section gives up a little height so the table rows stay readable */
.sunline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { display: block; }
.parr { font-size: .6em; color: var(--dim); }
body.short { --pad: clamp(6px, 0.8cqw, 10px); }
body.short .clock { font-size: clamp(38px, 4.6cqw, 60px); }
body.short .apptitle { font-size: 11px; }
body.short .place { font-size: clamp(16px, 1.6cqw, 22px); }
body.short .sub { font-size: clamp(12px, 1.15cqw, 15px); margin-top: 0; }
body.short .tile { padding: 4px 9px; }
body.short .tile .k { font-size: 11px; }
body.short .tile .v { font-size: clamp(18px, 2cqw, 26px); line-height: 1.1; }
body.short .best { padding: 4px 12px; }
body.short .best .t { font-size: clamp(16px, 1.8cqw, 22px); }
body.short .best .why { font-size: clamp(12px, 1.15cqw, 15px); }
body.short .bjoke { font-size: clamp(11px, 1.1cqw, 14px); -webkit-line-clamp: 2; }
body.short .hours { padding: 5px 8px 4px; }
body.short .hours-title { margin-bottom: 2px; }
body.short .daytabs button { padding-top: 2px; padding-bottom: 2px; }
body.short .warn a { padding: 4px 12px; font-size: clamp(13px, 1.3cqw, 16px); }
body.short .warn a.none { padding: 2px 12px; font-size: 12px; }
.rl[data-tip] { cursor: pointer; }
.rli { font-style: normal; font-size: .75em; width: 1.2em; height: 1.2em; line-height: 1.2em; text-align: center; border-radius: 50%; border: 1px solid var(--line); color: var(--dim); margin-left: 3px; flex: none; }
.ricon { font-size: 1.25em; line-height: 1; vertical-align: -.1em; color: #6fb6f2; margin-right: 2px; }
#refreshBtn.stale .ricon { color: var(--orange); }
/* full-screen button sits top right with the other buttons: ⛶ to go full screen, ✕ to come out */
.fsb { min-width: 2.4em; font-size: clamp(14px, 1.4cqw, 18px); cursor: pointer; }
.fsb[hidden] { display: none; }
/* v1.3: the top bar is one line that rotates (warnings, then the Bureau's worded forecast) */
.warn a { white-space: nowrap; overflow: hidden; }
.warn a.fc { background: rgba(43,108,176,.18); border: 1px solid #2b5f8f; color: #cfe3f3; font-weight: 500; cursor: pointer; }
.warn a, .warn a.none, body.short .warn a, body.short .warn a.none { padding: 3px 12px; font-size: clamp(12px, 1.2cqw, 15px); line-height: 1.35; }
.warn a.red, .warn a.amber { font-weight: 600; }
.w-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.w-lbl { color: #8cc4f0; font-weight: 600; }
.w-run { display: inline-block; animation: wrun linear 1.5s forwards; animation-delay: 1.5s; }
@keyframes wrun { from { transform: translateX(0); } to { transform: translateX(var(--over)); } }
.w-when { flex: none; }
.w-dots { flex: none; display: inline-flex; gap: 3px; margin-left: 6px; }
.w-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; }
.w-dots i.on { opacity: .9; }
.tide-now .st2 { font-size: clamp(13px, 1.3cqw, 17px); color: #cfe3f3; margin-top: 2px; }
.rivtag { color: #8cc4f0; }
/* "you've moved" bar: floats over the top of the screen, doesn't push the layout */
.wherebar { position: absolute; z-index: 30; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: 94%;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 10px 14px; border-radius: 14px;
  background: #12385c; border: 1px solid #3f86c6; box-shadow: 0 8px 30px rgba(0,0,0,.5); color: #fff; font-size: clamp(14px, 1.4cqw, 17px); }
.wherebar[hidden] { display: none; }
.wherebar button { border: 1px solid #3f86c6; background: var(--water2); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: inherit; cursor: pointer; }
.wherebar button + button { background: none; }
.hc .sky { font-size: calc(var(--rowh) * .85); line-height: 1; }
body.compact .hc .sky { font-size: 20px; }
/* 1.8.0: dad joke strip under the hour table (replaces the "Best today" banner) */
.best.jokebar { display: flex; align-items: baseline; gap: 10px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 12px;
  color: #cfe3f3; font-style: italic; font-size: clamp(12px, 1.25cqw, 15px); line-height: 1.3; min-width: 0; }
.best.jokebar[hidden] { display: none; }
.jokebar .jk { flex: none; font-style: normal; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.jokebar .jt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.compact .jokebar .jt { white-space: normal; }
body.short .best.jokebar { padding: 3px 12px; }
.radico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
/* 1.9.0 My places */
.savechk { margin-top: 8px; }
.saved { display: flex; gap: 6px; }
.saved button:first-child { flex: 1; }
.saved.on button:first-child { border-color: var(--water); background: #0f3355; }
.list .saved .del { flex: none; width: 46px; text-align: center; color: var(--dim); }
.list .saved .del.sure { width: auto; color: #fff; background: #8a2a20; border-color: #c0392b; }
.list .addsaved { border-style: dashed; color: var(--dim); }
/* 2.0.0 title at the very top; Paddy's Fishing Score row */
.toptitle { grid-area: title; text-align: center; font-size: clamp(13px, 1.5cqw, 18px); margin-bottom: calc(var(--pad) * -0.6); }
body.short .toptitle { font-size: 13px; }
.rl .rl2 { white-space: nowrap; font-size: .85em; color: #ffd54f; }
.rl:has(.rl2) { overflow: hidden; }
.hc .bite { letter-spacing: -1px; white-space: nowrap; }
.hc .bite.s3, .hc .bite.s4 { font-size: .8em; }
.hc .bite.s5 { font-size: .68em; letter-spacing: -1.5px; }
/* 2.3.0 info pop-up close button */
.tipbox { padding-right: 40px; }
.tipx { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #e3ebf3; color: #0b1b2b; font-size: 14px; cursor: pointer; line-height: 28px; padding: 0; }
/* 2.3.0 tide gauge down the right edge of the tide panel */
.tgauge { position: absolute; top: 0; bottom: 0; right: 10px; width: 64px; z-index: 3; cursor: pointer; }
.tide-now { right: 64px; left: 0; }
.tg-seg { position: absolute; right: 8px; width: 4px; border-radius: 2px; }
.tg-seg.done { background: repeating-linear-gradient(to bottom, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.tg-seg.togo { background: #ffd54f; box-shadow: 0 0 8px rgba(255,213,79,.6); }
.tg-now { position: absolute; right: 2px; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid #ffd54f; box-shadow: 0 0 8px rgba(0,0,0,.6); }
.tg-head { position: absolute; right: 3px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; }
.tg-head.down { border-top: 12px solid #ffd54f; margin-top: -12px; }
.tg-head.up { border-bottom: 12px solid #ffd54f; }
.tg-lab { position: absolute; right: 18px; transform: translateY(-50%); text-align: right; font-size: clamp(12px, 1.25cqw, 15px); font-weight: 700; line-height: 1.1; text-shadow: 0 1px 4px rgba(0,0,0,.9); white-space: nowrap; }
.tg-lab small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .04em; color: #cfe3f3; }
.tg-lab.done { color: rgba(255,255,255,.75); }
.tg-lab.togo { color: #ffd54f; }
body.compact .tgauge { width: 58px; right: 6px; }
/* 2.3.0 wave direction arrows; bigger gauge numbers */
.chip .wdir .dir { width: .75em; height: .75em; margin-right: 1px; opacity: .85; }
.chip.wsh { color: var(--dim); }
.tg-lab { font-size: clamp(14px, 1.6cqw, 20px); }
.tg-lab small { font-size: 11px; }
body.compact .tide-mark, body.compact .tide-now { right: 54px; }
body.compact .tg-lab { font-size: 12px; right: 14px; }
body.compact .tg-lab small { font-size: 9px; }
/* 2.4.0 title line holds the full-screen button (top right) */
.toptitle { position: relative; display: flex; justify-content: center; align-items: center; min-height: 22px; }
.toptitle .apptitle { font-size: inherit; }
.toptitle .fsb { position: absolute; right: 0; top: 50%; transform: translateY(-50%); padding: 1px 10px; min-width: 0; font-size: 14px; line-height: 1.3; }
/* half star: a star cut down the middle */
.hstar { background: linear-gradient(90deg, #ffd54f 50%, rgba(255,213,79,.2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* 2.4.0 wind & waves graph */
.hours-title .viewbtn { margin-left: auto; }
.hours-title .viewbtn + .howbtn { margin-left: 6px; }
.hchart { height: calc(var(--rowh) * 6); position: relative; background: rgba(255,255,255,.03); border-radius: 6px; }
body.compact .hchart { height: 150px; }
.hchart svg { display: block; }
.hchart .cv { fill: #e8f2fb; font-size: 10px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #0d2a44; stroke-width: 3px; }
.hchart .cw { fill: #d9c4ff; font-size: 10px; text-anchor: middle; paint-order: stroke; stroke: #0d2a44; stroke-width: 3px; }
.rl.rlchart { height: calc(var(--rowh) * 6); flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 4px 0; line-height: 1.1; }
body.compact .rl.rlchart { height: 150px; }
.rlchart span { color: #9fd0ff; } .rlchart .rlw { color: #c39bff; }
.hc .bite .s0 { color: var(--dim); font-weight: 700; }
body.short .toptitle .apptitle, .toptitle .apptitle { font-size: clamp(13px, 1.5cqw, 18px); }
body.compact .hours:has(.hchart) { min-height: 385px; }
/* 2.5.0 boat drop-down */
.boats .boatpick { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 10px; color: var(--dim); font-size: clamp(13px, 1.4cqw, 16px); }
.boats select { background: var(--water2); color: #fff; font-weight: 600; border: 0; border-radius: 999px; padding: 6px 12px; font-size: inherit; cursor: pointer; }
/* 2.5.0 one best-time box + now line over the hour table */
.hgrid { position: relative; }
.hc.inbest, .hc.inbest.first, .hc.inbest.last { box-shadow: none; }
.hoverlay { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 1; }
.bestbox { position: absolute; top: 0; border: 2px solid #fff; border-radius: 9px; box-shadow: 0 0 10px rgba(255,255,255,.25); }
.bestbox span { position: absolute; top: -1px; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #0b1b2b; font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 999px; white-space: nowrap; line-height: 14px; }
.nowline { position: absolute; top: 0; width: 0; border-left: 2px solid #ffd54f; box-shadow: 0 0 6px rgba(255,213,79,.7); }
.nowline span { position: absolute; bottom: 0; left: 3px; background: #ffd54f; color: #0b1b2b; font-size: 9px; font-weight: 800; padding: 0 3px; border-radius: 3px; white-space: nowrap; }
/* 2.5.0 radar window */
.radarmodal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
.radarmodal[hidden] { display: none; }
.rm-card { width: min(1000px, 100%); height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.rm-bar { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rm-bar b { flex: 1; font-weight: 600; }
.rm-bar a { color: #9fd0ff; font-size: 14px; }
.rm-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; cursor: pointer; }
.rm-card iframe { flex: 1; width: 100%; border: 0; background: #fff; }
#moonLine { cursor: pointer; }

/* 2.6.1: room above the table for the "Best time" tag (the scroll box clips above its top) */
.hscroll { padding-top: 8px; }
/* 2.6.1: in full screen the button is pinned top right, above everything, clear of the iPad's own corner controls */
body.isfs .toptitle .fsb { position: fixed; top: calc(6px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); transform: none; z-index: 60; }

/* version beside the title; Wind graph switch made a proper button */
.apptitle .ver { font-size: .7em; letter-spacing: .04em; text-transform: none; color: var(--muted, #8aa); font-weight: 400; margin-left: 6px; }
.hours-title .viewbtn { background: #1f6fd1; border-color: #1f6fd1; color: #fff; font-weight: 700; padding: 3px 12px; display: inline-flex; align-items: center; gap: 6px; }
.hours-title .viewbtn.on { background: none; border-color: var(--line); font-weight: 400; }
.viewbtn .gicon { width: 22px; height: 15px; }
/* keep the Wind graph + How it's graded buttons on screen: the boat / water words shrink instead */
.hours-title { min-width: 0; }
.hours-title > span:not(.daytabs) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hours-title > .daytabs, .hours-title > button { flex: 0 0 auto; }
.hours-title > .daytabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.hours-title > .daytabs::-webkit-scrollbar { display: none; }

.hchart .ckey { font-size: 10px; fill: #dbe7f5; }
.hchart .chartkey { pointer-events: none; }
.hours { position: relative; }
.chartkey { position: absolute; z-index: 5; pointer-events: none; background: rgba(10,20,35,.6); border-radius: 4px; line-height: 0; }
.chartkey .ckey { font-size: 10px; fill: #dbe7f5; }

/* Table / Wind graph: a two-sided switch, the side showing is lit */
.hours-title > .viewsw { flex: 0 0 auto; margin-left: auto; display: inline-flex; border: 1px solid #1f6fd1; border-radius: 999px; overflow: hidden; }
.viewsw button { background: none; border: 0; color: var(--text); padding: 3px 11px; font-size: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; opacity: .75; }
.viewsw button.on { background: #1f6fd1; color: #fff; font-weight: 700; opacity: 1; }
.viewsw .gicon { width: 20px; height: 14px; }
.hours-title > .viewsw + .howbtn { margin-left: 6px; }

/* 2.9.0 tide column: narrower; next turn up top, today's curve, today's list, how hard it's running */
#app { grid-template-columns: minmax(190px, 20cqw) 1fr; }
.tide-mark, .tgauge { display: none !important; }
.tide-now { position: absolute; inset: 0; transform: none; top: 0; left: 0; right: 0 !important; display: flex; flex-direction: column; gap: clamp(6px, 1cqh, 12px);
  padding: 12px 12px 10px; text-align: left; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
.water { opacity: .45; }
.tc-msg { margin: auto; text-align: center; font-size: 16px; color: #cfe3f3; }
.tc-top { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tc-lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.tide-now .tsize { margin: 0; font-size: 12px; padding: 2px 9px; cursor: pointer; }
.tc-now { cursor: pointer; }
.tc-dir { font-size: clamp(15px, 1.6cqw, 20px); font-weight: 800; letter-spacing: .04em; }
.tc-dir.up { color: #7fd4ff; } .tc-dir.down { color: #ffb36b; }
.tc-ht { font-size: clamp(28px, 3.4cqw, 44px); font-weight: 800; line-height: 1.05; }
.tc-ht small { font-size: 13px; font-weight: 500; color: #cfe3f3; }
.tc-next { font-size: clamp(14px, 1.35cqw, 17px); margin-top: 4px; }
.tc-sub { font-size: 13px; color: #cfe3f3; }
.tc-togo { color: #ffd54f; font-weight: 700; }
.tc-flow { align-self: flex-start; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.35); cursor: pointer; }
.tc-flow small { font-weight: 500; color: #cfe3f3; margin-left: 4px; }
.tc-flow.slack { color: #b9c7d4; } .tc-flow.gentle { color: #7fd4ff; } .tc-flow.hard { color: #ffd54f; }
.tc-curve { flex: 1 1 90px; min-height: 70px; max-height: 190px; background: rgba(0,0,0,.28); border-radius: 10px; cursor: pointer; overflow: hidden; }
.tc-curve svg { display: block; }
.tc-curve .tcg { stroke: rgba(255,255,255,.08); }
.tc-curve .tcx { fill: #7f97ad; font-size: 9px; text-anchor: middle; }
.tc-curve .tcfill { fill: rgba(30,136,229,.28); }
.tc-curve .tcpast { fill: none; stroke: #4fa3f7; stroke-width: 2.5; }
.tc-curve .tcfut { fill: none; stroke: #9fd0ff; stroke-width: 2; stroke-dasharray: 4 3; }
.tc-curve .tcm { fill: #e8f1f8; }
.tc-curve .tcl { fill: #e8f1f8; font-size: 10px; text-anchor: middle; font-weight: 600; }
.tc-curve .tcnow { fill: #ffd54f; stroke: #0b1b2b; stroke-width: 2; }
.tc-list { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tcr { display: grid; grid-template-columns: 3.4em 1fr auto; gap: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.25); }
.tcr.past { opacity: .5; }
.tcr.next { background: rgba(255,213,79,.18); outline: 1px solid rgba(255,213,79,.55); font-weight: 700; }
.tct.h { color: #7fd4ff; } .tct.l { color: #ffb36b; }
body.compact .tide-now { padding: 8px 8px 6px; gap: 5px; }
body.compact .tc-ht { font-size: 24px; }
body.compact .tc-next, body.compact .tc-list { font-size: 12px; }
body.compact .tc-curve { min-height: 60px; }
body.port #app { grid-template-columns: minmax(200px, 30cqw) 1fr; }
.tc-day { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 6px 0 2px 2px; }
