/* YachtPilot dashboard — the one stylesheet.
   Tokens come from the mobile app (Resources/Styles/Colors.xaml, EssentialColors.xaml) so web and
   app read as one product. Light is the default; [data-theme="dark"] on <html> mirrors the app's
   dark theme. Montserrat = headings and numbers, Lato = everything else. */

/* ===== Tokens ===== */
:root {
  --canvas: #f2f2f2;
  --surface: #fefefe;
  --surface-alt: #f6f7f8;
  --line: #e6e8ea;
  --text: #1b1b1b;
  --text-2: #6b737b;
  --accent: #0272c2;
  --accent-text: #0272c2;
  --success: #4eb22d;
  --warning: #ffbe28;
  --danger: #bf0000;
  --glass: rgba(254, 254, 254, .86);
  --backdrop: rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .12);

  --r-tile: 16px;
  --r-card: 12px;
  --r-btn: 8px;

  --font-body: Lato, system-ui, sans-serif;
  --font-head: Montserrat, system-ui, sans-serif;

  --topbar-h: 60px;
  --side-w: 316px;

  /* Text in a status colour: readable on the surface in both themes (the fills above stay strong). */
  --danger-text: #b3261e;
  --warning-text: #8a5a00;
  --strong: #d9661f; /* strong wind (22+ kt): orange — red is kept for gale */

  color-scheme: light;
}

[data-theme="dark"] {
  --danger-text: #ff8f87;
  --warning-text: #ffcf6e;
  --strong: #ffa463;
  --canvas: #1c2428;
  --surface: #29353b;
  --surface-alt: #232d32;
  --line: #34424a;
  --text: #f2f2f2;
  --text-2: #b0b7bb;
  --accent-text: #338bff;
  --glass: rgba(41, 53, 59, .86);
  --shadow-sm: none;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--canvas); color: var(--text); font: 14px/1.45 var(--font-body); }
h1, h2, h3, h4, .num, .brand { font-family: var(--font-head); }
h1 { font-size: 22px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* hidden always hides, even on elements whose class sets a display (flex/grid). */
[hidden] { display: none !important; }
/* Placeholders: one soft tone everywhere (browsers each pick their own grey otherwise). */
::placeholder { color: color-mix(in srgb, var(--text-2) 75%, transparent); opacity: 1; }
.spacer { flex: 1; }

/* ===== App frame ===== */
.app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.app-main { flex: 1; display: flex; min-height: 0; }
.content { flex: 1; min-width: 0; overflow: auto; padding: 20px 24px 32px; }

/* ===== Top bar ===== */
/* Navigation progress (js/yp.js): runs from a click to the new page arriving. */
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 5000; pointer-events: none; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; }
.nav-progress.run { opacity: 1; transform: scaleX(.85); transition: transform 2.5s cubic-bezier(.1,.7,.2,1), opacity .1s; }
.nav-progress.done { transform: scaleX(1); opacity: 0; transition: transform .2s ease-out, opacity .3s .15s; }
html.navigating, html.navigating a { cursor: progress; }
/* While a page loads: the page being left dims (after .25 s, so quick ones don't flicker) and the
   clicked menu item / tab spins in place of its icon (js/yp.js navStart). */
.app-main > :not(.side) { transition: opacity .2s; }
html.navigating .app-main > :not(.side) { opacity: .55; transition: opacity .2s .25s; }
.nav-pending .ic, .tabs a.nav-pending { position: relative; }
.item.nav-pending .ic i, .tabs a.nav-pending i { visibility: hidden; }
.item.nav-pending .ic::after, .tabs a.nav-pending i::after { content: ""; visibility: visible; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: nav-spin .7s linear infinite; }
.tabs a.nav-pending i { position: relative; display: inline-block; }
.item.nav-pending { background: var(--surface-alt); }
.item.nav-pending .nm { color: var(--text); }
@keyframes nav-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .item.nav-pending .ic::after, .tabs a.nav-pending i::after { animation-duration: 2s; } }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 1000; }
/* Brand name: the headline face, bold and a little tight, so it reads as a name not body text. */
.brand { display: flex; align-items: center; gap: 10px; font: 700 19px var(--font-head); letter-spacing: -.01em; color: var(--accent); white-space: nowrap; }
.brand img { height: 23px; }
.tabs { display: flex; gap: 4px; height: 100%; }
/* The headline face, a touch above the fleet's boat names (Montserrat 500, 15px). */
.tabs a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--text-2); border-bottom: 2px solid transparent; font: 600 16px var(--font-head); }
.tabs a i { font-size: 16px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
/* Ask Ray: the AI entry point, so it reads as a real control — full-strength text on a faint accent
   tint — rather than a greyed-out placeholder. */
.ask { display: flex; align-items: center; gap: 10px; width: 320px; padding: 9px 16px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); color: var(--text); font-size: 15px; cursor: pointer; transition: border-color .15s, background .15s; }
.ask:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.ask .spark { font-size: 17px; flex: none; }
.ask { min-width: 51px; flex-shrink: 1; white-space: nowrap; overflow: hidden; container-type: inline-size; }
/* too narrow for the shortcut hint: just the spark and as much of the prompt as fits */
@container (max-width: 190px) { .ask .k { display: none; } }
.ask .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ask .k { flex: none; }
.ask .k { margin-left: auto; font: 700 11px var(--font-head); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.spark { color: var(--accent-text); }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); cursor: pointer; position: relative; background: none; border: 0; }
.topbar .iconbtn { width: 40px; height: 40px; font-size: 19px; }
.iconbtn:hover { background: var(--surface-alt); color: var(--text); }
.iconbtn .badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
/* Profile menu (avatar in the top bar). */
.profile { position: relative; }
.menu-pop { display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; z-index: 1100; }
.profile.open .menu-pop { display: block; }
.menu-who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.menu-who .avatar { flex: none; }
.menu-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.menu-who b { font: 600 15px var(--font-head); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-who small { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pop a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font: 500 15px var(--font-head); color: var(--text); }
.menu-pop a:hover { background: var(--surface-alt); }
.menu-pop a i { width: 18px; text-align: center; color: var(--text-2); font-size: 16px; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.avatar { width: 38px; height: 38px; font-size: 16px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); }
.theme-dark-only { display: none; }
[data-theme="dark"] .theme-dark-only { display: inline; }
[data-theme="dark"] .theme-light-only { display: none; }

/* ===== Side menu (boat) ===== */
.side { width: var(--side-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 16px 20px 10px; }
.side-head .back { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.side-head h1 { margin-top: 6px; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; }
.side-head .sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.side-scroll { overflow: auto; flex: 1; padding-bottom: 16px; scrollbar-width: none; } /* no bar: the fade + "More" cue below say there's more */
.side-scroll::-webkit-scrollbar { display: none; }
/* "More below" cue (js/yp.js scrollHint) for the boat menu and the fleet list. */
.side, .fleet { position: relative; }
.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); }
.scroll-more { position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 6px); opacity: 0; pointer-events: none; display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px var(--font-head); color: var(--accent-text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); cursor: pointer; transition: opacity .2s, transform .2s; z-index: 5; }
.scroll-more.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.scroll-more i { font-size: 10px; animation: more-nudge 1.6s ease-in-out infinite; }
@keyframes more-nudge { 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .scroll-more i { animation: none; } }
.grp { font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); padding: 16px 20px 6px; display: flex; align-items: center; gap: 8px; }
.grp .r { margin-left: auto; letter-spacing: 0; text-transform: none; font: 400 12px var(--font-body); }
.item { margin: 1px 10px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.item:hover, .item.sel { background: var(--surface-alt); }
.item .ic { width: 28px; text-align: center; color: var(--text-2); font-size: 16px; flex: none; }
.item .nm { flex: 1; min-width: 0; font: 500 15px var(--font-head); color: var(--text-2); }
.item.sel .nm, .item:hover .nm { color: var(--text); }
.item.sel .ic { color: var(--accent-text); }
/* "Ask Ray about this boat" in the side menu: same treatment as the top bar's Ask Ray. */
.item[data-yp-ray-open] .nm { color: var(--text); }
.item[data-yp-ray-open] .ic { color: var(--accent-text); }
.item[data-yp-ray-open] .meta { display: none; } /* the top bar's Ask Ray already shows Ctrl K; keeps the label on one line */
.item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .val { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 16px; }

/* Collapse button and the icon rail. The rail is not a second layout: the menu keeps its full layout
   and the rail is a 68 px window onto its left edge (the icons), with the words faded out. So flying
   out (hover) or pinning only widens the window and fades the words in: nothing reflows or redraws. */
.side-toggle { position: absolute; top: 12px; left: calc(100% - 42px); z-index: 6; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; transition: background .15s, color .15s, left .24s cubic-bezier(.2, .7, .3, 1); }
.side-toggle:hover { background: var(--surface-alt); color: var(--text); border-color: var(--line); }
.side-toggle i { transition: transform .24s; }
@media (min-width: 761px) {
  .side.rail { width: 68px; overflow: hidden; transition: width .24s cubic-bezier(.2, .7, .3, 1), margin-right .24s cubic-bezier(.2, .7, .3, 1), box-shadow .24s; }
  .side.rail > .side-head, .side.rail > .side-scroll { width: var(--side-w); flex-shrink: 0; }
  .side.rail > .side-scroll { flex: 1 0 0; }
  /* the words: fade out on the rail, in (just behind the widening) when it flies out */
  .side.rail :is(.side-head .back, .side-head .sub, .boat-clock, .mode-row, .mode-said, .item .nm, .item .val, .item .spark, .item .meta, .item .pill, .item .lv-menu-beat, .ray-watch .rw-b, .grp, .scroll-more) { transition: opacity .2s ease .06s; }
  .side.rail .side-head h1 { transition: color .2s ease .06s; }
  .side.rail .ray-watch { transition: background-color .2s, border-color .2s; }
  .side.rail:not(.flyout) :is(.side-head .back, .side-head .sub, .boat-clock, .mode-row, .mode-said, .item .nm, .item .val, .item .spark, .item .meta, .item .pill, .item .lv-menu-beat, .ray-watch .rw-b, .grp, .scroll-more) { opacity: 0; pointer-events: none; transition-delay: 0s; transition-duration: .12s; }
  .side.rail:not(.flyout) .side-head h1 { color: transparent; transition-delay: 0s; transition-duration: .12s; }
  .side.rail:not(.flyout) .ray-watch { background-color: transparent; border-color: transparent; }
  /* on the rail the button sits where "All boats" was, pointing out; flown out it moves back and becomes a pin */
  .side.rail:not(.flyout) .side-toggle { left: 19px; }
  .side.rail:not(.flyout) .side-toggle i { transform: rotate(180deg); }
  .side.rail.flyout { width: var(--side-w); margin-right: calc(68px - var(--side-w)); z-index: 950; box-shadow: 12px 0 40px rgba(0, 0, 0, .16); }
  .side.rail.flyout .side-toggle .fa-angles-left::before { content: "\f08d"; } /* thumbtack: keep it open */
}
@media (prefers-reduced-motion: reduce) { .side.rail, .side.rail *, .side-toggle { transition: none !important; } }
/* A phone: the rail always (no room for the full menu); the button slides the whole menu over the page. */
@media (max-width: 760px) {
  .side { width: 68px; }
  .side:not(.peek) .side-toggle { position: static; margin: 12px auto 4px; flex: none; }
  .side:not(.peek) .side-toggle i { transform: rotate(180deg); }
  .side:not(.peek) .side-head { padding: 4px 0 8px; display: flex; justify-content: center; }
  .side:not(.peek) .side-head > :not(h1) { display: none; }
  .side:not(.peek) .side-head h1 { font-size: 0; gap: 0; margin: 0; }
  .side:not(.peek) .side-head h1 .dot { width: 10px; height: 10px; }
  .side:not(.peek) .ray-watch { margin: 2px 10px 6px; padding: 10px 0; justify-content: center; }
  .side:not(.peek) .ray-watch .rw-b, .side:not(.peek) .grp .r, .side:not(.peek) .scroll-more { display: none; }
  .side:not(.peek) .grp { font-size: 0; padding: 8px 14px 4px; }
  .side:not(.peek) .grp::before { content: ""; flex: 1; border-top: 1px solid var(--line); }
  .side:not(.peek) .item { padding: 10px 0; justify-content: center; position: relative; }
  .side:not(.peek) .item > :not(.ic) { display: none; }
  .side.peek { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: min(316px, 88vw); z-index: 900; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
  .side.peek .side-toggle i { transform: none; }
}
.item .val small { font: 400 13px var(--font-body); color: var(--text-2); margin-left: 2px; }
.item .meta { font-size: 13px; color: var(--text-2); }
.raycard { margin: 4px 10px 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--success) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 25%, var(--line)); }
.raycard .v { font-family: var(--font-head); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.raycard p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.raycard.warn { background: color-mix(in srgb, var(--warning) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.raycard.bad { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

/* ===== Status primitives ===== */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); flex: none; display: inline-block; }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.dot.off { background: #888d93; box-shadow: none; }
.ring { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; flex: none; font-size: 14px; }
.ring i { color: var(--text); }
.ring.ok { color: var(--success); background: color-mix(in srgb, var(--success) 22%, transparent); }
.ring.warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 28%, transparent); }
.ring.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 25%, transparent); }
.ring.info { color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.pill { font: 700 11px/1.4 var(--font-head); padding: 3px 10px; border-radius: 999px; color: #fff; flex: none; }
.pill.n { background: var(--danger); }
.pill.ok { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.pill.off { background: var(--surface-alt); color: var(--text-2); border: 1px solid var(--line); }
.pill.warn { background: var(--warning); color: #1b1b1b; }
.pill.info { background: var(--accent); }

/* ===== Content building blocks ===== */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin-right: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tile); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px 0; }
.card-b { padding: 14px 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-btn); border: 0; font: 600 14px var(--font-head); cursor: pointer; white-space: nowrap; color: var(--text); background: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--surface-alt); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; height: 44px; font-size: 15px; }
.btn:disabled { background: #888d93; color: #fefefe; cursor: default; }
.segp { display: flex; gap: 4px; background: var(--surface-alt); padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.segp a, .segp span { padding: 7px 14px; border-radius: 8px; font: 600 13px var(--font-head); color: var(--text-2); cursor: pointer; }
.segp .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; }
.chip.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--text); }
.ray-sum { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--r-tile); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.ray-sum > i { color: var(--accent-text); margin-top: 3px; }
.ray-sum b { font-family: var(--font-head); }
.ray-sum > .chip { flex: none; align-self: center; }
.stats-row { display: flex; gap: 24px; padding: 4px 18px 0; font-size: 12px; color: var(--text-2); flex-wrap: wrap; align-items: baseline; }
.stats-row b { font-family: var(--font-head); color: var(--text); font-size: 18px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.glass { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--r-tile); box-shadow: 0 4px 20px rgba(0, 0, 0, .08); }

/* ===== Forms ===== */
/* One typography for every form on the site — account pages, modals, settings, boat details, rules:
   labels in the headline face (medium, full-strength text), 15px inputs, 46px fields and main buttons. */
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; font: 500 13px var(--font-head); color: var(--text); margin-bottom: 7px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=tel], .field input:not([type]), .field select {
  width: 100%; height: 46px; padding: 0 14px; font-size: 15px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field-hint { font-size: 14px; color: var(--text-2); margin: -2px 0 10px; line-height: 1.45; }
.field .err { color: var(--danger); font-size: 13px; margin-top: 4px; display: block; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* ===== Modal ===== */
.modal-scrim { position: fixed; inset: 0; background: var(--backdrop); z-index: 4000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-scrim.open { display: flex; }
.modal { width: 520px; max-width: 100%; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.modal-h h3 { font-size: 18px; flex: 1; }
.modal-b { padding: 8px 20px 18px; }
.confirm-modal .modal { width: 440px; }
.confirm-modal .modal-b p { margin: 0 0 4px; }
.confirm-modal .field { margin-top: 14px; }
.modal-f { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-alt); }

/* ===== Chrome-less pages (sign-in, errors) ===== */
.center-card { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }

/* ===== Notices ===== */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-card); font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.notice i { margin-top: 2px; }
.notice.info { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.notice.info i { color: var(--accent-text); }
.notice.success { background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 35%, var(--line)); }
.notice.success i { color: var(--success); }
.notice.warning { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.notice.warning i { color: #b47f00; }
.notice.danger { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.notice.danger i { color: var(--danger); }

/* ===== Sign-in pages ===== */
.auth { min-height: 100%; display: flex; flex-direction: column; background: #0b2233 center / cover no-repeat; position: relative; }
.auth::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35)); }
.auth-main { flex: 1; display: grid; place-items: center; padding: 32px 16px; position: relative; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; padding: 32px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-logo img.mark { height: 48px; }
.auth-logo img.word { height: 14px; }
[data-theme="dark"] .auth-logo img.word { filter: brightness(0) invert(1); }
.auth-card h1 { font-size: 20px; text-align: center; }
.auth-card .lead { text-align: center; color: var(--text-2); margin: 6px 0 20px; font-size: 14px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; font-size: 13px; flex-wrap: wrap; }
.auth-row a, .auth-foot a, .link { color: var(--accent-text); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input:not(.toggle) { width: 16px; height: 16px; accent-color: var(--accent); }
.divider { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--line); }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-2); }
.auth-support { position: relative; display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; padding: 14px 16px; background: var(--glass); backdrop-filter: blur(10px); font-size: 13px; }
.auth-support a { color: var(--accent-text); font-weight: 700; }
.auth-support i { color: var(--accent-text); margin-right: 6px; }
.pw { position: relative; }
.pw input { padding-right: 44px !important; }
.pw .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--text-2); cursor: pointer; border-radius: 8px; }
.pw .eye:hover { color: var(--text); }
.pw .eye .fa-eye-slash, .pw.shown .eye .fa-eye { display: none; }
.pw.shown .eye .fa-eye-slash { display: inline; }
.otp { width: 100%; height: 56px; text-align: center; font: 700 26px var(--font-head); letter-spacing: .5em; padding-left: .5em; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); outline: none; }
.otp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.rules { list-style: none; display: grid; gap: 5px; margin: -4px 0 14px; font-size: 13px; color: var(--text-2); }
.rules li::before { content: '\f111'; font: 400 8px 'Font Awesome 7 Pro'; margin-right: 8px; vertical-align: 2px; }
.rules li.ok { color: var(--success); }
.rules li.ok::before { content: '\f00c'; font-weight: 900; font-size: 10px; vertical-align: 0; }
.field label.check { justify-content: flex-start; font: 400 14px var(--font-body); color: var(--text-2); }

/* ===== Maps ===== */
.mapwrap { flex: 1; position: relative; min-width: 0; min-height: 0; }
/* Fleet map, first load: a message over the empty map until the boats are on it (Fleet.razor, fleet.js). */
.mapwrap > .map { z-index: 0; } /* keep HERE's own layers (z-index up to 100) inside the map, under the cover */
.map-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--canvas); opacity: 0; animation: ml-in .4s ease forwards; transition: opacity .7s ease; }
.map-loading.leaving { pointer-events: none; }
.map-loading b { font: 600 15px var(--font-head); color: var(--text); }
.ml-bar { position: relative; width: 140px; height: 4px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--accent) 15%, transparent); }
.ml-bar i { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 2px; background: var(--accent); animation: ml-slide 1.2s ease-in-out infinite; }
@keyframes ml-in { to { opacity: 1; } }
/* Real boat rows ease in where the placeholders were (new rows only: a live refresh keeps the existing ones). */
#fleet .boat-row:not(.skel-row) { animation: row-in .35s ease both; }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes ml-slide { from { left: -40%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ml-bar i, #fleet .boat-row { animation: none; } .map-loading { animation-duration: 0s; transition: none; } }
.map { position: absolute; inset: 0; background: var(--canvas); }
.map-ctl { position: absolute; z-index: 5; }
.layers { right: 16px; bottom: 16px; display: flex; gap: 4px; padding: 4px; }
/* HERE's zoom buttons sit bottom-right too: lift them clear of the Chart / Satellite switch
   (not needed where the switch lives in the top-right .map-stack, as on the fleet page). */
.mapwrap .H_l_bottom.H_l_right { margin-bottom: 52px; }
.mapwrap:has(.map-stack .layers) .H_l_bottom.H_l_right { margin-bottom: 0; }
.layers button { padding: 6px 12px; border-radius: 10px; font: 600 12px var(--font-head); cursor: pointer; color: var(--text-2); background: none; border: 0; }
.layers button.on { background: var(--surface-alt); color: var(--text); }
/* Nautical-mile scale bar (js/here.js), bottom left above the HERE logo and its copyright line. */
.wind-flow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.nm-scale { position: absolute; left: 16px; bottom: 46px; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 8px 5px;
  border-radius: 8px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font: 600 11px var(--font-head); color: var(--text); pointer-events: none; }
.nm-scale i { display: block; height: 6px; border: 2px solid currentColor; border-top: 0; }
/* Seamark card (js/seamarks.js): same look as the fleet map's boat card, sitting just above the mark. */
.sm-float { position: absolute; z-index: 20; width: 0; height: 0; }
.sm-card { position: absolute; left: calc(-140px + var(--sm-shift, 0px)); bottom: 16px; width: 280px; padding: 12px 14px 10px; border-radius: 14px; cursor: default;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font: 400 12.5px/1.4 var(--font-body); white-space: normal; animation: sm-in .14s ease-out; }
@keyframes sm-in { from { opacity: 0; transform: translateY(4px); } }
.sm-card::after { content: ""; position: absolute; bottom: -7px; left: calc(50% - var(--sm-shift, 0px)); margin-left: -6px; width: 12px; height: 12px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
/* No room above the mark (js/map-card.js): the card hangs below it, arrow on top. */
.sm-float.below .sm-card { bottom: auto; top: 16px; animation-name: sm-in-below; }
.sm-float.below .sm-card::after { bottom: auto; top: -7px; transform: rotate(225deg); }
@keyframes sm-in-below { from { opacity: 0; transform: translateY(-4px); } }
.sm-h { display: flex; align-items: center; gap: 10px; }
.sm-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-alt); }
.sm-ic svg { width: 26px; height: 26px; }
.sm-ic.line { color: #cd2da0; font-size: 15px; }
.sm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-t b { font: 700 14px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-t small { font-size: 12px; color: var(--text-2); }
.sm-flag { margin-right: 6px; font: 18px/1 'CountryFlags', sans-serif; vertical-align: -3px; }
.sm-x { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text-2); cursor: pointer; }
.sm-x:hover { color: var(--text); }
/* AIS card favourite star (js/ais.js). */
.sm-fav:hover, .sm-fav.on { color: #e0a800; }
.sm-what { margin: 9px 0 0; color: var(--text); }
.sm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sm-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font: 600 11.5px var(--font-head); background: var(--surface-alt); border: 1px solid var(--line); color: var(--text-2); }
.sm-chip.light i { color: #e0a800; }
.sm-chip.virtual { color: #c026d3; border-color: color-mix(in srgb, #c026d3 40%, var(--line)); }
.sm-chip.warn { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.sm-pos { display: flex; flex-direction: column; gap: 3px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-2); font-variant-numeric: tabular-nums; }
.sm-pos span { display: flex; gap: 7px; align-items: center; }
.sm-pos i { width: 13px; text-align: center; color: var(--accent-text); font-size: 11px; }
/* Same look as the header's Ask Ray box (.ask): a pale accent tint with an accent border. */
.sm-ray { margin-top: 9px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); color: var(--text); transition: border-color .15s, background .15s; }
.sm-ray:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.sm-ray i { color: var(--accent-text); }
.sm-src { margin-top: 7px; font-size: 10.5px; color: var(--text-2); opacity: .8; }
/* The AIS card's footer starts with the data source's credit (js/ais.js), which may link to the provider. */
.sm-src a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.sm-src a:hover { color: var(--text); }
/* AIS overlay (js/ais.js): on/off button above the distance tool. Its tap card uses the .sm-* card styles below. */
.map-ais { position: absolute; left: 16px; bottom: 134px; z-index: 4; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer; font: 700 11px var(--font-head); letter-spacing: .02em; }
.map-ais:hover { color: var(--accent-text); }
.map-ais.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.map-wind { position: absolute; left: 16px; bottom: 176px; z-index: 4; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer; font-size: 14px; }
.map-wind:hover { color: var(--accent-text); }
.map-wind.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.boat-pin { position: relative; width: 0; height: 0; cursor: pointer; }
/* Fleet map: hover a boat for a card of its latest readings, just below it (js/pages/fleet.js). */
.boat-pin .pin-card { position: absolute; left: 50%; top: 18px; width: 272px; margin-left: -136px; z-index: 30; padding: 11px 13px 10px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  font: 400 12.5px/1.35 var(--font-body); white-space: normal; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility 0s .15s; pointer-events: none; }
.boat-pin.has-card:hover .pin-card { opacity: 1; visibility: visible; transform: none; transition: opacity .15s .12s, transform .15s .12s, visibility 0s .12s; pointer-events: auto; }
.boat-pin.has-card:hover { z-index: 40; }
.pin-card::before { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -6px; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.pin-card .pc-h { display: flex; align-items: center; gap: 7px; }
.pin-card .pc-h b { font: 700 14px var(--font-head); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-card .pc-st { font: 600 11px var(--font-head); color: var(--text-2); }
.pin-card .pc-where { color: var(--text-2); margin-top: 3px; }
.pin-card .pc-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.pin-card .pc-vals span { display: flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; }
.pin-card .pc-vals i { width: 14px; text-align: center; color: var(--accent-text); }
.pin-card .pc-vals b { font: 600 13px var(--font-head); color: var(--text); font-variant-numeric: tabular-nums; }
.pin-card .pc-alerts { margin-top: 8px; color: var(--warning-text); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.pin-card .pc-go { margin-top: 9px; font: 600 12px var(--font-head); color: var(--accent-text); display: flex; gap: 6px; align-items: center; }
/* The boat's name opens it: just the hand on hover, no link colour (keeps the list calm). */
.boat-row a.nm, .boat-row a.nm:hover { color: var(--text); text-decoration: none; cursor: pointer; }
.boat-row.skel-row { pointer-events: none; }
/* distance tool (js/here.js measureTool): ruler above the NM scale, readout along the bottom of the map */
.map-measure { position: absolute; left: 16px; bottom: 92px; z-index: 4; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer; font-size: 15px; }
.map-measure:hover { color: var(--accent-text); }
.map-measure.on { background: #ffb020; border-color: #ffb020; color: #3a2600; }
.measure-read { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: 0 4px 16px rgba(0, 0, 0, .22); font-size: 13px; white-space: nowrap; }
.measure-read b { font: 700 14px var(--font-head); font-variant-numeric: tabular-nums; }
.measure-read button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--surface-alt); color: var(--text-2); cursor: pointer; }
.measure-read .from-boat { width: auto; padding: 0 10px; border-radius: 999px; font: 600 12px var(--font-head); color: var(--accent-text); }
.measure-read .from-boat[hidden] { display: none; }
.measure-read[hidden] { display: none; }
.measuring, .measuring canvas { cursor: crosshair !important; }
.measure-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #ffb020; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
/* HERE places a DomIcon's top-left corner on the coordinate and owns that element's transform (so an
   offset there gets overwritten). Hence the zero-size root, with the hull centred on it from inside. */
/* The YachtPilot hull from the old site's marker (without its circle): white with a blue edge so it
   reads on chart and satellite alike. Bow points east; js/here.js rotates it by heading − 90. */
.boat-pin .hull { position: absolute; left: -20px; top: -10.5px; width: 40px; height: 21px; background: url("/img/boat.svg") center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.boat-pin .lbl { position: absolute; left: 26px; top: -12px; white-space: nowrap; background: var(--surface); color: var(--text); padding: 3px 9px; border-radius: 999px; font: 700 12px var(--font-head); box-shadow: 0 2px 8px rgba(0,0,0,.18); display: flex; align-items: center; gap: 6px; }
.boat-pin .lbl .dot { width: 7px; height: 7px; box-shadow: none; }

/* ===== Fleet ===== */
.fleet { width: 400px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; transition: width .2s; }
.fleet-head { padding: 18px 20px 12px; display: flex; align-items: flex-start; gap: 12px; }
.fleet-head h1 { flex: 1; }
.fleet-tools { display: flex; gap: 8px; padding: 0 20px 12px; align-items: center; }
.fleet-tools input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); outline: none; }
.fleet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 20px 14px; }
.fleet-stats div { background: var(--surface-alt); border-radius: var(--r-card); padding: 12px 14px; }
.fleet-stats .num { font-family: var(--font-head); font-size: 28px; line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.fleet-stats span:last-child { font-size: 13px; color: var(--text-2); }
.fleet-list { overflow: auto; flex: 1; border-top: 1px solid var(--line); padding-bottom: 12px; scrollbar-width: none; } /* no bar, as the boat menu */
.fleet-list::-webkit-scrollbar { display: none; }
.seg-ic { display: flex; background: var(--surface-alt); border: 1px solid var(--line); padding: 2px; border-radius: 10px; }
.seg-ic button { width: 32px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); cursor: pointer; background: none; border: 0; }
.seg-ic button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
/* text segmented control (Settings > Theme) */
.seg-txt { display: flex; flex-wrap: wrap; background: var(--surface-alt); border: 1px solid var(--line); padding: 2px; border-radius: 10px; }
.seg-txt button { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 0; background: none; color: var(--text-2); font: 600 13px var(--font-head); cursor: pointer; }
.seg-txt button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.boat-row { margin: 2px 10px; border-radius: 12px; cursor: pointer; }
.boat-row:hover, .boat-row.sel { background: var(--surface-alt); }
.boat-row .r { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.boat-row .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); position: relative; flex: none; }
.boat-row .ic .dot { position: absolute; right: 0; bottom: 2px; width: 9px; height: 9px; border: 2px solid var(--surface); box-shadow: none; }
.boat-row.sel .ic .dot, .boat-row:hover .ic .dot { border-color: var(--surface-alt); }
.boat-row .nm { flex: 1; min-width: 0; font-size: 15px; font-family: var(--font-head); font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boat-row .locate { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; font-size: 15px; }
.boat-row .locate:hover { background: var(--surface); color: var(--accent-text); }
.boat-row .locate.ray { margin-left: auto; color: var(--accent-text); }
.boat-row .locate.ray + .locate { margin-left: 0; }
.boat-row .more { display: none; padding: 0 12px 14px 56px; margin-top: -4px; }
.boat-row.sel .more, .boat-row.full .more { display: block; }
.boat-row .where { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.boat-row .vals { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.boat-row .vals b { color: var(--text); font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.boat-row .acts { display: flex; gap: 8px; margin-top: 12px; }
.boat-row .acts .btn { height: 30px; padding: 0 12px; font-size: 12px; }
.boat-row.full:not(.sel) .acts { display: none; }
.add-row { margin: 8px 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--line); color: var(--text-2); display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.add-row:hover { color: var(--accent-text); border-color: var(--accent); }
.add-row i { width: 32px; text-align: center; }
.empty { padding: 40px 24px; text-align: center; color: var(--text-2); }
.empty .ring { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 20px; }
/* Controls stacked in the map's top-right corner, right-aligned. */
.map-stack { position: absolute; top: 16px; right: 16px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.map-stack > .map-ctl { position: static; }
.fleet-summary { padding: 12px 16px; display: flex; gap: 18px; font-size: 13px; align-items: center; }
.fleet-summary b { font-family: var(--font-head); font-size: 16px; }

/* ===== Boat overview ===== */
.center { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* Weather at a glance on the boat map (top left); links to the boat's Weather page. */
.wx { left: 16px; top: 16px; padding: 12px 14px; width: 300px; max-width: calc(100% - 340px); display: block; color: var(--text); transition: box-shadow .15s; }
.wx:hover { box-shadow: 0 6px 24px rgba(0,0,0,.16); }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-ic { font-size: 26px; color: var(--accent); width: 30px; text-align: center; }
.wx-t { font: 700 24px var(--font-head); line-height: 1; }
.wx-c { flex: 1; min-width: 0; display: flex; flex-direction: column; font: 600 14px var(--font-head); }
.wx-c small { font: 400 12px var(--font-body); color: var(--text-2); margin-top: 2px; }
.wx-now .pill { align-self: flex-start; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wx-chip { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-head); padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--text-2); }
.wx-chip.warn { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); color: #8a5a00; }
.wx-chip.bad { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: var(--danger); }
.wx-more { display: flex; align-items: center; gap: 6px; margin-top: 10px; font: 600 12px var(--font-head); color: var(--accent-text); }
.wx-more i { font-size: 11px; transition: transform .15s; }
.wx:hover .wx-more i { transform: translateX(3px); }
.heard { left: 16px; bottom: 16px; padding: 9px 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.alert-flag { top: 16px; right: 16px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; font-size: 13px; max-width: 340px; }
.nosensor { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 18px 20px; display: flex; gap: 14px; align-items: center; max-width: 520px; }
.nosensor p { font-size: 13px; }
.item.live .spark { width: 54px; height: 20px; flex: none; }
.drawer { flex: none; height: 0; overflow: hidden; background: var(--surface); border-top: 1px solid var(--line); transition: height .25s ease; }
.drawer.open { height: 330px; }
/* The overview's history chart floats over the bottom of the map instead of pushing it up: a card
   that slides in from below. Its other controls live top right (.map-stack); the zoom rises above it. */
.center { position: relative; }
.drawer.float { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 330px; z-index: 20; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 -6px 30px rgba(0,0,0,.18); transform: translateY(calc(100% + 24px)); visibility: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s .35s; }
.drawer.float.open { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.center .mapwrap .H_l_bottom.H_l_right { transition: margin-bottom .35s cubic-bezier(.2,.8,.2,1); }
.center:has(.drawer.float.open) .mapwrap .H_l_bottom.H_l_right { margin-bottom: 330px; } /* zoom rides above the card */
.drawer-h { position: relative; display: flex; align-items: center; gap: 10px 18px; padding: 12px 64px 4px 20px; flex-wrap: wrap; }
.drawer-h h2 { font-size: 17px; font-weight: 600; }
.drawer-h [data-drawer-close] { position: absolute; top: 10px; right: 14px; } /* never wraps onto its own line */
.drawer-stats { display: flex; gap: 18px; font-size: 13px; color: var(--text-2); margin-right: auto; }
.drawer-stats b { font-family: var(--font-head); color: var(--text); font-size: 18px; margin-right: 3px; font-variant-numeric: tabular-nums; }
.drawer-chart { position: relative; padding: 0 12px; }
.chart-msg { height: 200px; display: grid; place-items: center; color: var(--text-2); font-size: 13px; }
/* Chart loading (js/charts.js chartSkeleton / statsSkeleton / chartRefreshing). */
.chart-skel { position: relative; overflow: hidden; display: grid; place-items: center; margin: 4px 0 0; }
.chart-skel svg { position: absolute; left: 48px; right: 12px; top: 18px; bottom: 30px; width: calc(100% - 60px); height: calc(100% - 48px); }
.chart-skel .area { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.chart-skel .line { fill: none; stroke: color-mix(in srgb, var(--accent) 28%, transparent); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.chart-skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 25%, color-mix(in srgb, var(--surface) 75%, transparent) 50%, transparent 75%); transform: translateX(-100%); animation: skel-sweep 1.5s ease-in-out infinite; }
.chart-skel > span { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--font-head); color: var(--text-2); background: var(--surface); padding: 6px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.chart-skel > span i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: skel-dot 1s ease-in-out infinite alternate; }
.skel { display: inline-block; height: 20px; border-radius: 6px; background: var(--surface-alt); animation: skel-pulse 1s ease-in-out infinite alternate; vertical-align: middle; }
.refreshing { position: relative; }
.refreshing .uplot { opacity: .4; transition: opacity .2s; }
.refreshing::before { content: ''; position: absolute; z-index: 4; top: 0; left: 12px; right: 12px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 35% 100%; animation: bar-run 1.1s linear infinite; }
@keyframes skel-sweep { to { transform: translateX(100%); } }
@keyframes skel-pulse { from { opacity: .5; } to { opacity: 1; } }
@keyframes skel-dot { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }
@keyframes bar-run { from { background-position: -35% 0; } to { background-position: 135% 0; } }
@media (prefers-reduced-motion: reduce) { .chart-skel::after, .chart-skel > span i, .skel, .refreshing::before { animation: none; } }
.chart-pill { position: absolute; display: none; pointer-events: none; z-index: 3; background: var(--text); color: var(--surface); border-radius: 8px; padding: 5px 10px; font-size: 11px; white-space: nowrap; }
.chart-pill b { display: block; font: 700 13px var(--font-head); }
.uplot, .uplot .u-over, .uplot .u-under { font-family: var(--font-body); }

/* ===== List + detail pages (alerts, trips) ===== */
.list-col { width: 420px; flex: none; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.list-col-h { padding: 16px 18px 10px; display: flex; align-items: center; gap: 10px; }
.list-col-h h2 { font-size: 18px; flex: 1; }
.filters { display: flex; gap: 6px; padding: 0 18px 12px; flex-wrap: wrap; }
.filters .chip { font-size: 12px; padding: 4px 10px; }
.chip .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rows { overflow: auto; flex: 1; }
.day { font: 700 11px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); padding: 12px 18px 6px; border-top: 1px solid var(--line); }
.al { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; padding: 12px 18px; cursor: pointer; align-items: start; }
.al:hover, .al.sel { background: var(--surface-alt); }
.al.sel { box-shadow: inset 3px 0 0 var(--accent); }
.al .ring { width: 40px; height: 40px; position: relative; }
.al .ring .unread { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.al-b { min-width: 0; display: flex; flex-direction: column; }
.al-b b { font: 600 14px var(--font-head); }
.al-b span { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al.read .al-b b { color: var(--text-2); }
.al .tm { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.more-link { display: block; text-align: center; padding: 14px; color: var(--accent-text); font-weight: 700; font-size: 13px; }
.detail .dh { display: flex; gap: 14px; align-items: flex-start; }
.detail .dh .ring { width: 52px; height: 52px; font-size: 20px; }
.meta-row { font-size: 13px; color: var(--text-2); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== AIS traffic (AisTraffic.razor, js/pages/ais-traffic.js): rows like the alerts list, the vessel's own AIS symbol in the ring's place ===== */
.ais-col { width: 400px; }
.ais-flags { padding-top: 0; }
.ais-flags .chip { gap: 5px; }
.ais-flags .chip .sm-flag { margin: 0; font-size: 15px; vertical-align: 0; }
.ais-flags .chip small { font: 600 11px var(--font-head); color: var(--text-2); font-variant-numeric: tabular-nums; }
.ais-flags .ais-more { border-style: dashed; }
.ais-note { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px; font-size: 12.5px; color: var(--text-2); }
.ais-col .rows { border-top: 1px solid var(--line); }
/* Nearby | Favourites toggle. */
.ais-mode { margin: 0 18px 12px; }
.ais-mode button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; white-space: nowrap; border: 0; border-radius: 8px; background: none;
  font: 600 13px var(--font-head); color: var(--text-2); cursor: pointer; }
.ais-mode button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ais-mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ais-mode .fa-star { color: #e0a800; }
.ais-search { display: flex; align-items: center; gap: 8px; margin: 0 18px 12px; padding: 0 12px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); }
.ais-search[hidden] { display: none; }
.ais-search:focus-within { border-color: var(--accent); }
.ais-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 15px var(--font-body, inherit); color: var(--text); }
.ais-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; align-items: center; border-top: 1px solid var(--line); }
.ais-row:first-child, .ais-item:first-child > .ais-row { border-top: 0; }
/* Row plus favourite star: the star is a sibling of the row button, positioned over its right edge. */
.ais-item { position: relative; }
.ais-item > .ais-row { padding-right: 52px; }
.ais-item:hover > .ais-row:not(.nodata) { background: var(--surface-alt); }
.ais-item:hover > .ais-row:not(.nodata) .ais-ic { background: var(--surface); }
.ais-star { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: none; color: var(--text-2); cursor: pointer; }
.ais-star:hover, .ais-star.on { color: #e0a800; }
.ais-star:hover { background: var(--surface); }
.ais-star:disabled { opacity: .4; cursor: default; }
.ais-star:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ais-row.nodata { cursor: default; }
.ais-row.nodata .ais-ic { color: var(--text-2); }
.ais-row.nodata :is(.ais-ic, .al-b) { opacity: .6; }
.ais-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ais-row.skel-row { pointer-events: none; }
.ais-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-alt); }
.ais-row:hover .ais-ic, .ais-row.sel .ais-ic { background: var(--surface); }
.ais-ic svg { width: 26px; height: 26px; }
.ais-row .al-b b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ais-row .al-b .sm-flag { margin-right: 6px; font-size: 15px; vertical-align: -1px; }
.ais-row .ais-m { font-variant-numeric: tabular-nums; }
.ais-row .ais-cpa { align-self: flex-start; margin-top: 5px; font-size: 11.5px; }
.al.ais-row .tm { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }
.ais-row .tm b { font: 700 15px var(--font-head); color: var(--text); font-variant-numeric: tabular-nums; }
.ais-row .tm small { font-size: 11px; }
.ais-row.stale :is(.ais-ic svg, .al-b b) { opacity: .5; }

/* ===== Trips ===== */
.trip { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; padding: 10px 18px; cursor: pointer; align-items: center; }
.trip:hover, .trip.sel { background: var(--surface-alt); }
.trip.sel { box-shadow: inset 3px 0 0 var(--accent); }
.trip-ic { width: 116px; height: 84px; border-radius: 10px; font-size: 22px; overflow: hidden; display: grid; place-items: center; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 10%, var(--surface-alt)); }
.trip.live .trip-ic { color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); }
.trip-m { display: flex; gap: 12px; margin-top: 2px; }
.trip-m b { font: 700 12px var(--font-head); color: var(--text); }
.trip-card { top: 16px; left: 16px; width: 380px; padding: 16px 18px; }
.trip-card h3 { font-size: 17px; margin-top: 4px; }
.trip-card p { font-size: 13px; margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.kpis div { background: var(--surface-alt); border-radius: 10px; padding: 8px 10px; }
.kpis b { display: block; font: 700 15px var(--font-head); white-space: nowrap; }
.kpis span { font-size: 11px; color: var(--text-2); }
.ray-head { display: flex; align-items: center; gap: 8px; font: 700 12px var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }

/* ===== Reports ===== */
.metrics { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; align-items: center; }
.charts { display: flex; flex-direction: column; gap: 12px; }
.chartcard .drawer-chart { padding: 6px 12px 10px; }
.daily { width: 100%; border-collapse: collapse; font-size: 13px; }
.daily th { text-align: left; font-weight: 700; color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.daily td { padding: 9px 18px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.daily tr:last-child td { border-bottom: 0; }
.daily td.n { font-family: var(--font-head); font-weight: 600; }

/* ===== Anchor ===== */
.anchor-card { top: 16px; left: 16px; width: 340px; padding: 16px 18px; }
.anchor-h { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.anchor-h h3 { font-size: 17px; }
.anchor-acts { display: flex; gap: 8px; justify-content: flex-end; }
.anchor-card .field select { height: 40px; }

/* ===== Forms pages ===== */
.narrow { max-width: 760px; }
.back { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.types label { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; cursor: pointer; font: 500 13px var(--font-head); color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.types label i { font-size: 20px; }
.types label.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.types input { position: absolute; opacity: 0; pointer-events: none; }
.home-map { height: 200px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.danger-zone { display: flex; gap: 14px; align-items: center; border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }

/* ===== Settings ===== */
.set-h { font: 700 12px var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); margin: 22px 0 8px 4px; }
/* Settings: the full page width, as two equal halves (account left, alert types right) — one column
   below 992px, like Bootstrap's col-lg-6. */
.narrow.settings { max-width: none; }
.set-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
@media (min-width: 992px) { .set-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .set-col > .set-h:first-child { margin-top: 6px; } }
.set-row input[type=text] { width: 150px; min-width: 0; flex: 0 1 150px; }
.set-row input[type=tel] { width: 170px; min-width: 0; flex: 0 1 170px; }
.set-card { overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: default; }
.set-row:last-child { border-bottom: 0; }
.set-row.sel { background: var(--surface-alt); box-shadow: inset 3px 0 0 var(--accent); }
.set-row a.nm { color: inherit; text-decoration: none; }
.set-row a.nm:hover { color: var(--accent-text); }
/* Sensors & sources: the sensor panel (status, connection, software) */
.sensor-panel { padding: 18px 20px; }
.set-card + .sensor-panel { margin-top: 16px; }
.sp-h { display: flex; align-items: center; gap: 12px; }
.sp-h h3 { font-size: 17px; }
.sp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; margin: 16px 0 4px; }
.sp-facts dt { font-size: 12px; color: var(--text-2); }
.sp-facts dd { margin: 2px 0 0; font: 600 14px var(--font-head); overflow-wrap: anywhere; }
.sp-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sp-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sp-sec-h h4 { font: 600 15px var(--font-head); }
.sp-sec-h .btn { height: 34px; }
.sp-sec-h form { margin: 0; }
.sp-conn { display: grid; gap: 8px; }
.sp-conn > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-alt); }
.sp-conn b { display: block; font: 600 14px var(--font-head); }
.sp-conn small { font-size: 12px; color: var(--text-2); }
.sp-conn em { font: 600 13px var(--font-head); font-style: normal; color: var(--text-2); }
.sp-conn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.sp-conn [data-on="yes"] .dot { background: var(--success); }
.sp-conn [data-on="yes"] em { color: var(--success); }
.sp-conn [data-on="no"] .dot { background: var(--danger); }
.sp-conn [data-on="no"] em { color: var(--danger); }
.sp-sw { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-sw th { text-align: left; font: 600 12px var(--font-head); color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.sp-sw td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sp-sw td small { display: block; font-size: 11px; color: var(--text-2); }
.sp-sw td:last-child { text-align: right; }
.sp-when, .sp-problem { font-size: 12px; margin-top: 8px; }
.sp-progress { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-alt)); }
.sp-progress > i { font-size: 18px; color: var(--accent-text); }
.sp-progress b { display: block; font: 600 14px var(--font-head); }
.sp-progress span { font-size: 13px; color: var(--text-2); }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sp-steps li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-alt); font-size: 13px; }
.sp-steps b { font: 600 14px var(--font-head); }
.sp-steps [data-outcome="done"] span { color: var(--success); }
.sp-steps [data-outcome="failed"] span { color: var(--danger); }
.sp-steps [data-outcome="running"] span { color: var(--warning-text); }
a.set-row, label.set-row { cursor: pointer; }
a.set-row:hover, label.set-row:hover { background: var(--surface-alt); }
.set-row > i { width: 22px; text-align: center; color: var(--text-2); font-size: 16px; }
.set-row .nm { flex: 1; font: 500 15px var(--font-head); display: flex; flex-direction: column; gap: 2px; }
.set-row .nm small { font: 400 13px var(--font-body); color: var(--text-2); }
.set-row .set-val { font-size: 15px; color: var(--text-2); } /* read-only value, same size as the inputs */
.set-row select, .set-row input[type=text], .set-row input[type=tel] { height: 40px; padding: 0 12px; font-size: 15px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); max-width: 260px; }
/* On/off switch (<input type="checkbox" class="toggle">; .sm for inline use beside a label).
   The knob springs across and squishes a little while pressed. */
.toggle { --w: 44px; --h: 26px; --k: 20px; appearance: none; margin: 0; width: var(--w); height: var(--h); border-radius: 999px; flex: none; position: relative; cursor: pointer;
  background: color-mix(in srgb, var(--text-2) 32%, var(--surface-alt)); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); transition: background .2s ease; }
.toggle.sm { --w: 38px; --h: 22px; --k: 16px; }
.toggle::after { content: ''; position: absolute; top: calc((var(--h) - var(--k)) / 2); left: calc((var(--h) - var(--k)) / 2); width: var(--k); height: var(--k); border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .28s cubic-bezier(.34,1.56,.64,1), width .15s ease; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(calc(var(--w) - var(--h))); }
.toggle:active::after { width: calc(var(--k) + 5px); }
.toggle:checked:active::after { transform: translateX(calc(var(--w) - var(--h) - 5px)); }
.toggle:hover:not(:checked) { background: color-mix(in srgb, var(--text-2) 42%, var(--surface-alt)); }
.toggle:focus-visible { outline: none; box-shadow: inset 0 1px 2px rgba(0,0,0,.12), 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.check .toggle { margin-right: 2px; }
.set-row a.nm { color: var(--text); }
.set-row a.nm:hover { color: var(--accent-text); }
.switch-btn { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; border: 0; flex: none; }
.switch-btn span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch-btn.on { background: var(--accent); }
.switch-btn.on span { left: 21px; }
.ring.glyph i { font-style: normal; }
.tpl { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tpl:last-child { border-bottom: 0; }
.tpl:hover { background: var(--surface-alt); }
.tpl b { font: 600 14px var(--font-head); }
.tpl p { font-size: 13px; color: var(--text-2); }
.src-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.src-row:last-of-type { border-bottom: 0; }
.src-row input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; }
.src-row span { display: flex; flex-direction: column; }
.src-row small { font-size: 12px; color: var(--text-2); font-family: ui-monospace, monospace; }
/* Data sources: what each PGN carries (Models/PgnGuide.cs) and soft warnings */
/* "Ask Ray to review these": Ray's own look (his orb colours), set apart from the reading chips above */
.pgn-ray { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, #7c5cff 10%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.pgn-ray-orb { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 16px;
  background: radial-gradient(circle at 35% 30%, #7db8e6, var(--accent) 60%, #014d85); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.pgn-ray-t { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.pgn-ray-t b { font: 700 14px var(--font-head); }
.pgn-ray-t small { font-size: 12.5px; color: var(--text-2); }
.pgn-ray-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 13.5px var(--font-head); color: #fff; background: linear-gradient(135deg, var(--accent), #6a4cf0);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .15s, box-shadow .15s; }
.pgn-ray-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.pgn-help { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-alt); font-size: 13px; }
.pgn-help p { margin: 0 0 6px; color: var(--text); }
.pgn-help dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.pgn-help dt { font: 600 12px var(--font-head); color: var(--text-2); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.pgn-help dt i { color: var(--accent-text); font-size: 11px; }
.pgn-help dd { margin: 0; color: var(--text-2); }
.pgn-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--warning-text); background: color-mix(in srgb, var(--warning) 12%, var(--surface)); }
.pgn-warn.info { color: var(--text-2); background: var(--surface-alt); }
.pgn-warn i { margin-top: 2px; }
.pgn-warn.ok { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.pgn-suggest { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.pgn-suggest > i { color: var(--accent-text); }
.pgn-suggest > span { flex: 1; }
.pgn-suggest small { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.pgn-suggest .btn { height: 32px; flex: none; }
.pgn-suggest.applied { background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }
.src-row b .src-sugg { margin-left: 8px; font-size: 10.5px; vertical-align: 1px; }
.src-why { display: flex; gap: 6px; align-items: flex-start; margin-top: 3px; font-style: normal; font-size: 12px; color: var(--success); }
.src-why.warn { color: var(--warning-text); }
.src-why.muted { color: var(--text-2); }
.src-why i { margin-top: 2px; font-size: 11px; }
.pgn-suggest [hidden] { display: none; }
.src-row.changed { margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.src-row.changed.on { background: color-mix(in srgb, var(--success) 12%, transparent); }
.src-row.changed.off { background: color-mix(in srgb, var(--warning) 14%, transparent); }
.src-change { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font: 700 10.5px var(--font-head); vertical-align: 1px; background: var(--surface); border: 1px solid var(--line); }
.src-row.changed.on .src-change { color: var(--success); }
.src-row.changed.off .src-change { color: var(--warning-text); }

/* ===== Ray chat ===== */
.ray-drawer { position: fixed; isolation: isolate; top: var(--topbar-h); right: 0; bottom: 0; width: 440px; max-width: 100%; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0,0,0,.12); z-index: 3500; transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.ray-drawer.open { transform: none; }
/* Desktop: a floating card like the boat chart card — inset from the edges and the top bar, rounded,
   same slide. Narrow screens keep the full-height attached sheet. */
@media (min-width: 900px) {
  .ray-drawer { top: calc(var(--topbar-h) + 12px); right: 12px; bottom: 12px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.18); transform: translateX(calc(100% + 24px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .ray-drawer.open { transform: none; }
}
.rd-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.rd-h { gap: 8px; }
.rd-h .t { font: 700 17px var(--font-head); }
.rd-h .spark { font-size: 18px; }
.rd-h .rd-av { width: 30px; height: 30px; flex: none; }
.rd-h .iconbtn { font-size: 16px; }
.rd-h .iconbtn.on { background: var(--surface-alt); color: var(--accent-text); }
/* Online / Limited / Offline pill (gateway health). */
.rd-status { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-head); padding: 3px 10px 3px 8px; border-radius: 999px; color: var(--text-2); background: var(--surface-alt); border: 1px solid var(--line); }
.rd-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); }
.rd-status[data-state="online"] { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); border-color: color-mix(in srgb, var(--success) 30%, var(--line)); }
.rd-status[data-state="online"] i { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); animation: ray-live 2.4s ease-in-out infinite; }
.rd-status[data-state="limited"] { color: #9a6700; background: color-mix(in srgb, var(--warning) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 40%, var(--line)); }
.rd-status[data-state="limited"] i { background: var(--warning); }
.rd-status[data-state="offline"] { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.rd-status[data-state="offline"] i { background: var(--danger); }
.rd-status[data-state="checking"] i { animation: skel-pulse .8s ease-in-out infinite alternate; }
@keyframes ray-live { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 8%, transparent); } }
/* Which boat Ray is looking at (opened from a boat page). */
.rd-ctxbar { display: flex; align-items: center; gap: 8px; padding: 8px 18px; font: 500 13px var(--font-head); color: var(--text-2); background: var(--surface-alt); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-ctxbar i { color: var(--accent-text); }
.rd-ctxbar[hidden] { display: none; }
/* Conversations panel: slides over the chat inside the drawer. */
.rd-convos { position: absolute; inset: 57px 0 0 0; z-index: 2; background: var(--surface); display: flex; flex-direction: column; animation: rd-in .2s ease-out; }
.rd-convos[hidden] { display: none; }
.rd-convos-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px 12px 10px; }
.rd-convos-h h3 { flex: 1; }
.rd-convos-h h3 { font-size: 17px; font-weight: 600; }
.rd-convo-list { flex: 1; overflow: auto; padding: 0 10px 16px; }
.rd-convos-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.rd-convos-empty b { font: 600 15px var(--font-head); }
.rd-convos-empty p { font-size: 14px; }
@keyframes rd-in { from { opacity: 0; transform: translateY(6px); } }
.rd-body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.rd-hello { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; }
.rd-hello h3 { font-size: 18px; font-weight: 600; }
.rd-hello-art { width: 190px; height: auto; margin-bottom: 4px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .12)); }
.rd-hello p { font-size: 14px; line-height: 1.5; }
/* Your messages: the Ask Ray pill's light blue rather than solid accent — easier to read, calmer. */
.msg-u { align-self: flex-end; max-width: 82%; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line)); color: var(--text); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.msg-r { display: flex; gap: 10px; }
.msg-r .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.msg-r .av img { width: 30px; height: 30px; display: block; }
.msg-r .bd { flex: 1; min-width: 0; font-size: 15px; line-height: 1.6; }
.msg-r .bd > * + * { margin-top: 8px; }
.msg-r .bd ul, .msg-r .bd ol { padding-left: 20px; }
.msg-r .bd img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.msg-r .bd a { color: var(--accent-text); font-weight: 700; }
.msg-r .bd table { border-collapse: collapse; font-size: 14px; }
.msg-r .bd td, .msg-r .bd th { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.msg-r .bd code { background: var(--surface-alt); border-radius: 4px; padding: 0 4px; }
.tool { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
/* Ray thinking: big enough to notice, in Ray's colour, with how long it's been. */
.thinking { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); }
.thinking i { font-size: 20px; color: var(--accent); }
.thinking .t { font: 500 15px var(--font-head); color: var(--text); }
.thinking .el { font: 500 13px var(--font-head); color: var(--text-2); font-variant-numeric: tabular-nums; }
.msg-r.is-thinking .av { animation: skel-pulse .9s ease-in-out infinite alternate; }
.err-msg { color: var(--danger); }
.rd-sugg { display: flex; gap: 6px; padding: 0 18px 10px; flex-wrap: wrap; }
.rd-sugg .chip { font-size: 13px; }
.rd-attach { display: flex; align-items: center; gap: 8px; margin: 0 18px 8px; padding: 6px 6px 6px 12px; border-radius: 10px; font-size: 12.5px; color: var(--text-2);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rd-attach[hidden] { display: none; }
.rd-attach > i { color: var(--accent-text); }
.rd-attach span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-attach button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; }
.rd-attach button:hover { background: var(--surface-alt); color: var(--text); }
.msg-u .msg-attach { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2); white-space: normal; }
.msg-u .msg-attach i { color: var(--accent-text); font-size: 11px; }
.rd-in { display: flex; gap: 8px; align-items: flex-end; margin: 0 18px 16px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.rd-in:focus-within { border-color: var(--accent); }
.rd-in textarea { flex: 1; border: 0; background: none; resize: none; outline: none; padding: 8px 0; max-height: 140px; color: var(--text); font-size: 15px; }
.rd-in .send { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; border: 0; cursor: pointer; flex: none; }

/* ===== Toasts ===== */
.toasts { position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; width: 340px; }
.toast { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; transition: opacity .6s, transform .6s; }
.toast b { display: block; font: 700 14px var(--font-head); }
.toast > span:last-child span { color: var(--text-2); }
.toast.gone { opacity: 0; transform: translateX(20px); }

/* ===== Fleet page type scale: about 1px above the site default (chosen 2026-10-20). Whether the
   rest of the site follows is still open. ===== */
.fleet { font-size: 15px; }
.fleet-head h1 { font-size: 24px; }
.fleet .grp { font-size: 12px; }
.fleet-tools input { font-size: 15px; }
.fleet-stats span:last-child { white-space: nowrap; } /* stays 13px: "need attention" has to fit one line */
.fleet .boat-row .nm { font-size: 15px; }
.fleet .boat-row .where, .fleet .boat-row .vals { font-size: 13px; }
.fleet .boat-row .acts .btn { font-size: 13px; height: 32px; }
.fleet .pill { font-size: 12px; }
.fleet .add-row { font-size: 15px; }
.fleet-summary { font-size: 14px; }
.fleet-summary b { font-size: 17px; }
.mapwrap[data-yp-module="fleet"] .layers button { font-size: 13px; }
.mapwrap[data-yp-module="fleet"] .boat-pin .lbl { font-size: 13px; }

/* ===== Account pages (sign in, register, forgot / reset password, verify): the card's own sizing.
   Form typography is the shared .field / .btn styles above. ===== */
.auth-card { max-width: 460px; padding: 36px 36px 32px; }
.auth-card h1 { font-size: 24px; font-weight: 600; }
.auth-card .lead { font-size: 15px; margin: 8px 0 24px; line-height: 1.5; }
.auth-card .btn.primary { height: 46px; font-size: 15px; }
.auth-row { font-size: 14px; }
.auth-foot { font-size: 15px; }
.auth-card .divider { font-size: 13px; }
.auth-support { font-size: 14px; }

/* ===== Sensors page (Pages/Boat/Sources.razor) ===== */
.segp a { display: inline-flex; align-items: center; gap: 6px; }
.segp .live-dot { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.filters .chip { font: 500 13px var(--font-head); padding: 6px 13px; color: var(--text-2); }
.filters .chip:hover { border-color: var(--accent); color: var(--text); }
.filters .chip.on { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-text); }
.ring.off { color: color-mix(in srgb, var(--text-2) 60%, transparent); background: var(--surface-alt); }
.ring.off i, .ring.off.glyph { color: var(--text-2); } /* switched off: everything muted */
.set-row .pill { flex: none; }
/* Live tab: a card per reading, every raw field, and how fresh it is. */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.live-card { padding: 14px 16px 10px; }
.live-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.live-h > i { color: var(--accent-text); font-size: 16px; width: 20px; text-align: center; margin-top: 2px; }
.live-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font: 600 15px var(--font-head); }
.live-t small { font: 400 12px var(--font-body); color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-ago { flex: none; font: 600 11px var(--font-head); color: var(--text-2); background: var(--surface-alt); padding: 3px 8px; border-radius: 999px; }
.live-ago.fresh { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--text-2); }
.kv b { font: 600 14px var(--font-head); font-variant-numeric: tabular-nums; text-align: right; }

/* ===== Alert rules (Pages/Boat/AlertRules.razor, AlertRuleEdit.razor) ===== */
.rule-sum { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.rule-sum b { font: 600 15px var(--font-head); }
.rule-sum p { font-size: 14px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.field .hint { display: block; font-size: 13px; color: var(--text-2); margin-top: 5px; }
.anchor-card h3 { font-size: 18px; font-weight: 600; }

/* ===== Reports (Pages/Boat/Reports.razor, js/pages/reports.js) ===== */
.metrics .chip, .ray-sum > .chip { font: 500 13px var(--font-head); padding: 6px 13px; color: var(--text-2); }
.metrics .chip:hover { border-color: var(--accent); color: var(--text); }
.metrics .chip.on { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-text); }
.metrics-l { font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin-right: 6px; }
.chartcard .card-h h3 { font-size: 16px; font-weight: 600; }
.daily td { font-size: 14px; }
.reports-empty { padding: 48px 24px; }
.reports-empty p { max-width: 440px; margin: 6px auto 0; font-size: 14px; }

/* ===== Trips (Pages/Boat/Trips.razor, js/pages/trips.js) ===== */
.trip-ic.has-img { background: var(--surface-alt); } /* the trip's map preview fills the tile */
/* Trips: join (select mode, ?select=1) and rename on the trip card */
.join-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.join-bar { display: grid; gap: 10px; padding: 0 18px 14px; border-bottom: 1px solid var(--line); }
.join-bar p { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.join-bar input[type=text], .trip-rename input[type=text] { width: 100%; height: 40px; padding: 0 12px; font-size: 14px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); outline: none; }
.join-bar input:focus, .trip-rename input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.join-sum { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.join-sum b { color: var(--text); }
.join-sum .warn { display: block; margin-top: 4px; color: var(--warning-text); }
.join-bar .notice { margin: 0; }
.list-notice { padding: 0 18px; }
.trip.pick { grid-template-columns: 18px 116px minmax(0, 1fr); }
.trip.pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.trip.pick:has(input:checked) { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.trip.pick.off { opacity: .45; cursor: default; }
.trip.pick.off:hover { background: none; }
.trip-rename summary { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; list-style: none; cursor: pointer; color: var(--text-2); }
.trip-rename summary::-webkit-details-marker { display: none; }
.trip-rename summary:hover, .trip-rename[open] summary { background: var(--surface-alt); color: var(--text); }
.trip-rename form { display: flex; gap: 8px; margin-top: 10px; }
.trip-rename .btn { height: 40px; }
.trip-card .trip-rename p { font-size: 12px; }
.trip-rename .notice { margin: 8px 0 0; }
.trip-card h3 { padding-right: 70px; }
/* Trip conditions (Trips drawer): one chart, Speed / Wind / Engine / Fuel switch, and a line of figures */
.trip-cond { display: flex; gap: 6px; flex-wrap: wrap; }
.trip-cond .chip i { font-size: 12px; }
.trip-cond-sum { font-size: 13px; color: var(--text-2); margin-right: auto; }
.trip-cond-sum b { color: var(--text); font-weight: 700; }
.tl-empty { display: grid; place-items: center; height: 140px; padding: 0 20px; text-align: center; font-size: 13px; color: var(--text-2); }
.trip-card .trip-tz { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.trip-card .trip-ray { margin-top: 10px; }
.trip-card .trip-ray i { color: var(--accent-text); }
.trip-split-btn { position: absolute; top: 12px; right: 46px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); }
.trip-split-btn:hover, .trip-split-btn.on { background: var(--surface-alt); color: var(--text); }
.trip-split { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.trip-split .ts-h { display: flex; align-items: center; justify-content: space-between; font: 600 14px var(--font-head); }
.trip-split .ts-h a { color: var(--text-2); padding: 2px 6px; }
.trip-card .trip-split p { font-size: 12px; margin: 4px 0 8px; }
.trip-split form { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.ts-stop { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); }
.ts-stop.on { box-shadow: inset 0 0 0 2px var(--accent); }
.ts-n, .stop-pin b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--font-head); color: #fff; background: var(--accent); }
.ts-b { display: grid; min-width: 0; font-size: 12px; color: var(--text-2); }
.ts-b b { font: 600 13px var(--font-head); color: var(--text); }
.ts-b b i { margin-right: 6px; color: var(--accent-text); font-size: 11px; }
.ts-stop .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.trip-split .notice { margin: 8px 0 0; }
/* A stop on the trip's route (split mode): its number, matching the list on the card */
.stop-pin { width: 0; height: 0; position: relative; }
.stop-pin b { position: absolute; left: -12px; top: -12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .15s ease; }
.stop-pin.on b { transform: scale(1.3); }
.trip-ic.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trip-card .replay { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); font: 500 13px var(--font-head); color: var(--text-2); }
.trip-card .replay i { color: var(--accent-text); }
.trip-card .replay.on { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.trip-card .replay b { font-weight: 700; font-variant-numeric: tabular-nums; }
.boat-pin.draggable .hull { cursor: grab; }
.boat-pin.draggable:active .hull { cursor: grabbing; }

/* ===== Alerts (Pages/Boat/Alerts.razor, FleetAlerts.razor) ===== */
.al-b b { font-size: 15px; }
.al-b span { font-size: 14px; }
.al .tm { font-size: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* Unread: like an inbox — tinted, bold, a blue dot under the time. Read: plain, still fully legible. */
.al:not(.read) { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.al:not(.read):hover, .al:not(.read).sel { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.al:not(.read) .al-b b { font-weight: 700; color: var(--text); }
.al:not(.read) .tm { color: var(--accent-text); font-weight: 700; }
.al .tm .ud { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.al.read .al-b b { color: var(--text); font-weight: 500; }
.detail .dh h2 { font-size: 22px; font-weight: 600; line-height: 1.25; }
.meta-row { font-size: 14px; align-items: center; }
.ack-note { font-size: 14px; color: var(--text-2); margin-top: 10px; }
.detail .card-b p { font-size: 15px; line-height: 1.55; }
/* The alert detail's action sits under the title, never squeezing it into a narrow column. */
.detail .dh { flex-wrap: wrap; }
.detail .dh > div { flex: 1 1 260px; }
.detail .dh > form, .detail .dh > .btn { flex-basis: 100%; padding-left: 66px; }
.detail .dh > form .btn { min-width: 160px; }
.list-col { width: 380px; }

/* ===== Ray: stored conversations (Components/Shell/RayDrawer.razor, js/ray.js) ===== */
.rd-convo { display: flex; align-items: center; gap: 4px; border-radius: 10px; padding: 2px 4px 2px 0; }
.rd-convo + .rd-convo { margin-top: 2px; }
.rd-convo:hover, .rd-convo.editing { background: var(--surface-alt); }
.rd-convo.cur { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.rd-convo.failed { box-shadow: inset 0 0 0 1px var(--danger); }
.rd-convo-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 10px; }
.rd-convo-open b { font: 600 15px var(--font-head); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-convo-open span { font-size: 13px; color: var(--text-2); }
.rd-convo.cur .rd-convo-open b { color: var(--accent-text); }
.rd-convo-edit, .rd-convo-del { opacity: 0; font-size: 14px; }
.rd-convo:hover :is(.rd-convo-edit, .rd-convo-del), :is(.rd-convo-edit, .rd-convo-del):focus-visible, .rd-convo.cur .rd-convo-edit { opacity: 1; }
.rd-convo-del:hover { color: var(--danger); }
@media (hover: none) { .rd-convo-edit, .rd-convo-del { opacity: 1; } }
.rd-convo[hidden] { display: none; }
.rd-convo.busy { opacity: .5; pointer-events: none; }
.rd-convo-input { flex: 1; min-width: 0; margin: 6px 4px 6px 8px; padding: 8px 10px; font: 600 15px var(--font-head); color: var(--text); background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; outline: none; }
.rd-convo-more { display: block; margin: 10px auto 0; }
.rd-convos-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: var(--text-2); font-size: 14px; }
.rd-convos-err { text-align: center; font-size: 14px; color: var(--text-2); padding: 12px; }

/* Ray: "what Ray looked at" under an answer (js/ray.js stepsHtml) */
.ray-steps { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.ray-steps summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); }
.ray-steps summary::-webkit-details-marker { display: none; }
.ray-steps summary::after { content: '\f078'; font: 900 9px 'Font Awesome 7 Pro'; margin-left: 2px; transition: transform .15s; }
.ray-steps[open] summary::after { transform: rotate(180deg); }
.ray-steps ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 3px; }

/* Ray: live tool checklist while an answer is being worked out */
.ray-live { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.ray-live:empty { display: none; }
.ray-live li { display: flex; align-items: center; gap: 8px; }
.ray-live li i { width: 14px; text-align: center; }
.ray-live li.ok i { color: var(--success); }
.ray-live li.bad i { color: var(--danger); }

/* A spot Ray linked to on the boat map (here.js pin, vessel.js ?at=). Zero-size root: HERE owns its
   transform, so the icon is offset inside it to put the pin's point on the spot. */
.map-pin { width: 0; height: 0; position: relative; }
.map-pin i { position: absolute; left: -11px; top: -30px; font-size: 30px; color: var(--danger); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }

/* Conversations panel: search and the download footer */
.rd-convos-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; padding: 0 12px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); }
.rd-convos-search:focus-within { border-color: var(--accent); }
.rd-convos-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 15px var(--font-body, inherit); color: var(--text); }
.rd-convos-nomatch { text-align: center; color: var(--text-2); font-size: 14px; padding: 24px 12px; }
.rd-convos-f { border-top: 1px solid var(--line); padding: 12px 18px; }
.rd-convos-f a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.rd-convos-f a:hover { color: var(--accent-text); }

/* ===== Weather page (Pages/Boat/Weather.razor, js/pages/weather.js) ===== */
.wx-page { display: flex; flex-direction: column; gap: 18px; }
.wx-page .page-head { margin-bottom: 0; }
.wx-page .page-head h2 { margin-right: 4px; }
.wx-page .page-head .spacer { flex: 1; }
.wx-page .page-head .muted i { color: var(--accent-text); }

/* Now: big conditions, the wind dial, the readings */
.wx-hero { display: grid; grid-template-columns: minmax(220px, 1.1fr) 190px minmax(260px, 1.3fr); gap: 24px; align-items: center; padding: 22px 24px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 60%); }
.wx-hero-now { display: flex; align-items: center; gap: 18px; }
.wx-hero-ic { font-size: 64px; color: var(--warning); filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--warning) 35%, transparent)); }
.wx-hero-ic.fa-cloud, .wx-hero-ic.fa-smog, .wx-hero-ic.fa-cloud-showers-heavy { color: var(--text-2); filter: none; }
.wx-hero-ic.fa-moon, .wx-hero-ic.fa-cloud-moon, .wx-hero-ic.fa-cloud-moon-rain { color: #9bb4d6; }
.wx-hero-t { font: 700 52px/1 var(--font-head); letter-spacing: -1px; }
.wx-hero-c { font: 600 18px var(--font-head); margin: 4px 0 2px; }

.wx-dial { position: relative; width: 170px; justify-self: center; text-align: center; }
.wx-dial svg { width: 150px; height: 150px; display: block; margin: 0 auto; overflow: visible; }
.wx-dial .ring { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.wx-dial .tick { stroke: var(--text-2); stroke-width: 1.5; opacity: .5; }
.wx-dial .cardinal { font: 700 11px var(--font-head); fill: var(--text-2); text-anchor: middle; }
.wx-dial .arrow { transform-origin: 60px 60px; fill: var(--accent); stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.wx-dial.fresh .arrow { fill: var(--warning); stroke: var(--warning); }
.wx-dial.strong .arrow, .wx-dial.gale .arrow { fill: var(--danger); stroke: var(--danger); }
.wx-dial-c { position: absolute; top: 75px; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: baseline; gap: 2px; }
.wx-dial-c b { font: 700 30px/1 var(--font-head); }
.wx-dial-c small { font-size: 12px; color: var(--text-2); }
.wx-dial-l { font-size: 13px; color: var(--text-2); margin-top: 6px; }

.wx-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wx-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.wx-tile i { grid-row: span 2; color: var(--accent-text); font-size: 15px; width: 18px; text-align: center; }
.wx-tile span { font-size: 12px; color: var(--text-2); }
.wx-tile b { font: 700 18px var(--font-head); }
.wx-tile b small { font: 500 12px var(--font-body); color: var(--text-2); }

/* Sections */
.wx-sec { display: flex; flex-direction: column; gap: 12px; }
.card.wx-sec { padding: 18px 20px; }
.wx-sec-h { display: flex; align-items: center; gap: 10px; }
.wx-sec-h h3 { font: 600 17px var(--font-head); }
.wx-sec-h .spacer { flex: 1; }
.wx-sec-h .more-link { padding: 0; }
.wx-clear { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--text-2); font-size: 14px; }
.wx-clear .ring { width: 30px; height: 30px; font-size: 12px; }

/* Official warnings: MeteoAlarm colours, full text on open */
.wx-warns { display: flex; flex-direction: column; gap: 8px; }
.wx-warn { --lvl: #f2c94c; border: 1px solid var(--line); border-left: 5px solid var(--lvl); border-radius: 12px; background: color-mix(in srgb, var(--lvl) 7%, var(--surface)); overflow: hidden; }
.wx-warn.lvl-orange { --lvl: #f2994a; }
.wx-warn.lvl-red { --lvl: #e5484d; }
.wx-warn.expired { --lvl: var(--line); opacity: .7; }
.wx-warn summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; }
.wx-warn summary::-webkit-details-marker { display: none; }
.wx-warn .hz { font-size: 20px; color: var(--lvl); width: 24px; text-align: center; }
.wx-warn.expired .hz { color: var(--text-2); }
.wx-warn-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wx-warn-b b { font: 600 15px var(--font-head); }
.wx-warn-b span { font-size: 13px; color: var(--text-2); }
.lvl-tag { font: 700 11px var(--font-head); text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 999px; background: var(--lvl); color: #1b1b1b; }
.wx-warn.lvl-red .lvl-tag { color: #fff; }
.wx-warn.expired .lvl-tag { background: var(--surface-alt); color: var(--text-2); }
.wx-warn .chev { color: var(--text-2); transition: transform .2s; }
.wx-warn[open] .chev { transform: rotate(180deg); }
.wx-warn-text { padding: 0 16px 4px 54px; font-size: 14px; line-height: 1.55; display: grid; gap: 8px; }
.wx-warn-do { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.wx-warn-do b { font: 600 13px var(--font-head); display: flex; align-items: center; gap: 8px; }
.wx-warn-meta, .wx-warn-src { font-size: 12px; color: var(--text-2); }
.wx-warn-src { padding: 4px 16px 12px 54px; }

/* Next hours: chart over a scrolling strip of hour cards */
.wx-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-left: auto; }
.wx-legend .lg { width: 16px; height: 0; border-top: 3px solid var(--accent); display: inline-block; margin-left: 8px; }
.wx-legend .lg.gust { border-top: 2px dashed var(--warning); }
.wx-legend .lg.band { height: 10px; border: 0; border-radius: 3px; background: color-mix(in srgb, var(--warning) 30%, transparent); }
.wx-chart { position: relative; min-height: 210px; }
.wx-pill b { display: inline; font-size: 13px; }
.wx-hours { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-behavior: smooth; scrollbar-width: thin; }
.wx-h { flex: 0 0 78px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.wx-h.past { opacity: .5; }
.wx-h.now { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.wx-h .tm { font: 700 12px var(--font-head); color: var(--text-2); }
.wx-h.now .tm { color: var(--accent-text); }
.wx-h .ic { font-size: 22px; color: var(--warning); }
.wx-h .ic.fa-cloud, .wx-h .ic.fa-cloud-showers-heavy, .wx-h .ic.fa-smog { color: var(--text-2); }
.wx-h .ic.fa-moon, .wx-h .ic.fa-cloud-moon, .wx-h .ic.fa-cloud-moon-rain { color: #9bb4d6; }
.wx-h b { font: 700 16px var(--font-head); }
.wd { display: inline-flex; align-items: center; gap: 4px; font: 700 13px var(--font-head); }
.wd i { font-size: 11px; color: var(--accent-text); }
.wd.fresh i { color: var(--warning); }
.wd.strong, .wd.gale { color: var(--danger); }
.wd.strong i, .wd.gale i { color: var(--danger); }
.wx-h .gs { font-size: 11px; color: var(--text-2); }
.wx-h .pr { min-height: 16px; font-size: 11px; color: var(--accent-text); }
.wx-h .pr i, .wx-day .rn i { margin-right: 3px; }
.wx-h .ts, .wx-day .ts { color: var(--warning); font-weight: 700; }

/* Next days: iOS-style range bars across the week */
.wx-days { display: flex; flex-direction: column; }
.wx-day { display: grid; grid-template-columns: 92px 28px minmax(120px, 1fr) minmax(110px, auto) 36px minmax(80px, 160px) 36px 130px; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.wx-day:first-child { border-top: 0; }
.wx-day .d { font: 600 14px var(--font-head); }
.wx-day .ic { font-size: 20px; color: var(--warning); text-align: center; }
.wx-day .ic.fa-cloud, .wx-day .ic.fa-cloud-showers-heavy, .wx-day .ic.fa-smog { color: var(--text-2); }
.wx-day .ph { font-size: 14px; color: var(--text-2); }
.wx-day .rn { display: flex; gap: 10px; font-size: 12px; color: var(--accent-text); }
.wx-day .tmin { text-align: right; color: var(--text-2); font-weight: 700; }
.wx-day .tmax { font-weight: 700; }
.tbar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-alt); }
.tbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #5aa9e6, #f2c94c 60%, #f2994a); }
.wx-day .wd small { font: 500 12px var(--font-body); color: var(--text-2); margin-left: 4px; }

/* Ray's take */
.wx-ray { display: flex; align-items: center; gap: 16px; padding: 16px 20px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.wx-ray:hover { border-color: var(--accent); transform: translateY(-1px); }
.wx-ray.warn { border-left: 4px solid var(--warning); }
.wx-ray.bad { border-left: 4px solid var(--danger); }
.wx-ray.ok { border-left: 4px solid var(--success); }
.wx-ray-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wx-ray-b .k { font: 700 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.wx-ray-b b { font: 600 16px var(--font-head); }
.wx-ray-b .muted { font-size: 13px; }
.wx-ray-go { font: 700 13px var(--font-head); color: var(--accent-text); white-space: nowrap; }
.wx-foot { font-size: 12px; color: var(--text-2); text-align: center; margin: 0; }

@media (max-width: 1100px) {
    .wx-hero { grid-template-columns: 1fr 180px; }
    .wx-tiles { grid-column: 1 / -1; }
    .wx-day { grid-template-columns: 76px 24px 1fr 32px minmax(60px, 120px) 32px 110px; }
    .wx-day .rn { display: none; }
}
@media (max-width: 700px) {
    .wx-hero { grid-template-columns: 1fr; }
    .wx-tiles { grid-template-columns: repeat(2, 1fr); }
    .wx-day { grid-template-columns: 64px 24px 1fr 30px 30px; }
    .wx-day .ph, .wx-day .tbar { display: none; }
}
.wx-h .gs.strong, .wx-h .gs.gale { color: var(--danger); font-weight: 700; }
.wx-h .gs.fresh { color: color-mix(in srgb, var(--warning) 70%, var(--text)); font-weight: 700; }

/* ===== Ray's watch log (Pages/Boat/Checkups.razor, js/pages/checkups.js) ===== */
.ck-live { display: inline-flex; align-items: center; gap: 7px; font: 700 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: var(--success); }
.ck-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: ck-beacon 2.4s infinite; }
@keyframes ck-beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ck-tabs { display: flex; gap: 4px; margin: 0 14px 8px; padding: 4px; background: var(--surface-alt); border-radius: 12px; }
.ck-tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 8px; border-radius: 9px; font: 600 13px var(--font-head); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.ck-tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ck-range { display: flex; gap: 14px; padding: 0 18px 8px; font-size: 12px; }
.ck-range a { color: var(--text-2); text-decoration: none; font-weight: 700; }
.ck-range a.on { color: var(--accent-text); }

/* The timeline: a line down the left, a coloured node per checkup */
.ck-rows { position: relative; }
.ck-row { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 10px 18px; color: inherit; text-decoration: none; }
.ck-row::before { content: ''; position: absolute; left: 34px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.ck-row:hover { background: var(--surface-alt); }
.ck-row.sel { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ck-node { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 2px solid currentColor; background: var(--surface); }
.ck-node.ok { color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.ck-node.warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 20%, var(--surface)); }
.ck-node.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.ck-node i { color: var(--text); }
.ck-b { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ck-b b { font: 600 14px/1.3 var(--font-head); }
.ck-b span { font-size: 12px; color: var(--text-2); }
.ck-row .tm { font-size: 11px; color: var(--text-2); padding-top: 2px; }
.ck-row.failed .ck-b b { color: var(--text-2); font-style: italic; }
.ck-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font: 700 10px var(--font-head); font-style: normal; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ck-fold { position: relative; }
.ck-fold > summary { position: relative; list-style: none; cursor: pointer; padding: 2px 18px 8px 64px; font-size: 12px; font-weight: 700; color: var(--accent-text); }
.ck-fold > summary::-webkit-details-marker { display: none; }
.ck-fold > summary::before { content: ''; position: absolute; left: 34px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.ck-fold > summary i { margin-right: 6px; transition: transform .2s; }
.ck-fold[open] > summary i { transform: rotate(180deg); }

/* Right side */
.ck-main { display: flex; flex-direction: column; gap: 16px; }
.ck-top { display: flex; align-items: center; gap: 12px; }
.ck-top .spacer { flex: 1; }
.ck-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 12px var(--font-head); text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); }
.ck-back { display: inline-flex; align-items: center; gap: 6px; font: 700 13px var(--font-head); color: var(--accent-text); text-decoration: none; }
.ck-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--success); animation: ck-beacon 2.4s infinite; }
.ck-pulse.warn { background: var(--warning); }
.ck-pulse.bad { background: var(--danger); }

.ck-hero { display: flex; gap: 24px; padding: 24px; align-items: flex-start; border-left: 5px solid var(--success);
    background: linear-gradient(120deg, color-mix(in srgb, var(--success) 9%, var(--surface)), var(--surface) 55%); }
.ck-hero.warn { border-left-color: var(--warning); background: linear-gradient(120deg, color-mix(in srgb, var(--warning) 13%, var(--surface)), var(--surface) 55%); }
.ck-hero.bad { border-left-color: var(--danger); background: linear-gradient(120deg, color-mix(in srgb, var(--danger) 11%, var(--surface)), var(--surface) 55%); }
.ck-verdict { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; width: 92px; }
.ck-orb { position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #fff; background: var(--success); box-shadow: 0 8px 24px color-mix(in srgb, var(--success) 35%, transparent); }
.ck-orb.warn { background: var(--warning); color: #1b1b1b; box-shadow: 0 8px 24px color-mix(in srgb, var(--warning) 45%, transparent); }
.ck-orb.bad { background: var(--danger); box-shadow: 0 8px 24px color-mix(in srgb, var(--danger) 40%, transparent); }
/* Ray on the verdict's lower-right corner, his neck fading out so there's no cut edge. */
.ck-orb-ray { position: absolute; right: -14px; bottom: -10px; width: 46px; height: 46px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.ck-empty-ray .ck-ray-art { width: 150px; height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .12)); }
.ck-orb.live::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ck-ring 2.6s infinite; }
.ck-orb.warn.live::after { border-color: var(--warning); }
.ck-orb.bad.live::after { border-color: var(--danger); }
@keyframes ck-ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.ck-vl { font: 700 13px var(--font-head); text-transform: uppercase; letter-spacing: .6px; }
.ck-hero-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ck-hero-b h2 { font: 700 24px/1.25 var(--font-head); }
.ck-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-meta > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12px var(--font-head); background: var(--surface); border: 1px solid var(--line); }
.ck-esc { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)) !important; }
.ck-why { font-size: 15px; line-height: 1.6; max-width: 760px; }
.ck-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-2); }
.ck-foot i { margin-right: 6px; }
.ck-foot .ck-told { color: var(--accent-text); font-weight: 700; }

.ck-sec { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ck-sec h3 { font: 600 16px var(--font-head); display: flex; align-items: center; gap: 10px; }
.ck-sec h3 i { color: var(--accent-text); }
.ck-sec-h { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ck-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ck-actions li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.ck-actions .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--font-head); color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ck-shelters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ck-shelter { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ck-shelter b { font: 600 15px var(--font-head); }
.ck-sh-n { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-top: 4px; }
.ck-sh-n i { margin-right: 5px; color: var(--accent-text); }

.ck-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.ck-map { position: relative; height: 230px; border-radius: 12px; overflow: hidden; background: var(--surface-alt); }
.ck-where .more-link, .ck-sec .more-link { padding: 0; text-align: left; }
.ck-told-line { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ck-told-line i { color: var(--accent-text); }
.ck-log { display: grid; gap: 6px; }
.ck-log-r { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); }
.ck-small { font-size: 12px; color: var(--text-2); margin: 0; }

/* The heartbeat strip */
.ck-tally { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); margin-left: auto; }
.ck-tally b { font: 700 15px var(--font-head); color: var(--text); margin-right: 3px; }
.ck-tally .ok b { color: var(--success); }
.ck-tally .warn b { color: color-mix(in srgb, var(--warning) 75%, var(--text)); }
.ck-tally .bad b { color: var(--danger); }
.ck-beat { position: relative; height: 54px; border-radius: 10px; background: repeating-linear-gradient(90deg, transparent 0 11px, color-mix(in srgb, var(--line) 50%, transparent) 11px 12px), var(--surface-alt); }
.ck-beat-day { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.ck-tick { position: absolute; top: 12px; bottom: 12px; width: 5px; margin-left: -2.5px; border-radius: 3px; background: var(--success); transition: transform .15s; }
.ck-tick.warn { background: var(--warning); top: 8px; bottom: 8px; }
.ck-tick.bad { background: var(--danger); top: 3px; bottom: 3px; }
.ck-tick:hover { transform: scaleX(1.8); z-index: 2; }
.ck-beat-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-top: -6px; }
.ck-beat-axis { position: relative; }
.ck-beat-axis .mid { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ck-beat.slim .ck-tick { width: 3px; margin-left: -1.5px; }
.ck-beat.thin .ck-tick { width: 2px; margin-left: -1px; }
.ck-range.in-card { padding: 0; gap: 4px; }
.ck-range.in-card a { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.ck-range.in-card a.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

/* Emails Ray sent */
.ck-mail-h { display: flex; gap: 14px; align-items: center; }
.ck-mail-h h2 { font: 700 20px var(--font-head); }
.ck-mail { flex: 1; min-height: 560px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-tile); background: #fff; }

@media (max-width: 1200px) { .ck-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .ck-hero { flex-direction: column; } .ck-verdict { flex-direction: row; width: auto; } }

/* Boat menu: Ray's latest verdict (Shell/BoatShell.razor) */
.ray-watch { display: flex; align-items: flex-start; gap: 10px; margin: 2px 10px 6px; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid var(--line); background: color-mix(in srgb, var(--success) 6%, var(--surface)); }
.ray-watch.warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.ray-watch.bad { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.ray-watch:hover { border-color: var(--accent); }
.ray-watch .ck-pulse { margin-top: 5px; flex: none; }
.rw-b { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rw-b b { font: 700 13px var(--font-head); display: flex; justify-content: space-between; gap: 8px; }
.rw-b b small { font: 500 11px var(--font-body); color: var(--text-2); }
.rw-b > span { font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ck-lanes { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; align-items: center; }
.ck-lane-l { font: 700 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.ck-beat.mail { height: 30px; }
.ck-mtick { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); transition: transform .15s; }
.ck-mtick.warn { background: var(--warning); }
.ck-mtick.bad { background: var(--danger); }
.ck-mtick:hover { transform: scale(1.6); z-index: 2; }
.ck-lanes .ck-beat-axis { margin-top: 0; }

/* Map weather card: next 12 hours (Pages/Boat/Overview.razor) */
.wx-next { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.wx-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wx-slot small { font: 700 10px var(--font-head); color: var(--text-2); }
.wx-slot .ic { font-size: 16px; color: var(--warning); }
.wx-slot .ic.fa-cloud, .wx-slot .ic.fa-cloud-showers-heavy, .wx-slot .ic.fa-smog { color: var(--text-2); }
.wx-slot .ic.fa-moon, .wx-slot .ic.fa-cloud-moon, .wx-slot .ic.fa-cloud-moon-rain { color: #9bb4d6; }
.wx-slot b { font: 700 13px var(--font-head); }
.wx-slot .wd { font-size: 11px; gap: 3px; }
.wx-slot .wd i { font-size: 9px; }
.wx-next.days { grid-template-columns: repeat(var(--n, 5), 1fr); }
.wx-slot b em { font: 600 11px var(--font-head); font-style: normal; color: var(--text-2); margin-left: 3px; }
.wx-more .wx-age { margin-left: auto; font: 400 11px var(--font-body); color: var(--text-2); }
.wx-trend { display: block; width: 100%; height: 30px; margin-top: 6px; }
.wx-trend .band { fill: color-mix(in srgb, var(--warning) 14%, transparent); }
.wx-trend .fill { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.wx-trend .wind { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.wx-trend .gust { fill: none; stroke: var(--warning); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }

/* Wind and warning colours: amber fresh, orange strong, red only at gale — and the text tokens so
   they read on a dark card without shouting (Weather page, map card). */
.wd.fresh, .wd.fresh i { color: var(--warning-text); }
.wd.strong, .wd.strong i { color: var(--strong); }
.wd.gale, .wd.gale i { color: var(--danger-text); }
.wx-h .gs.fresh { color: var(--warning-text); }
.wx-h .gs.strong { color: var(--strong); font-weight: 700; }
.wx-h .gs.gale { color: var(--danger-text); font-weight: 700; }
.wx-chip.warn { color: var(--warning-text); }
.wx-chip.bad { color: var(--danger-text); }
[data-theme="dark"] .wx-chip.warn { background: color-mix(in srgb, var(--warning) 16%, var(--surface)); }
[data-theme="dark"] .wx-chip.bad { background: color-mix(in srgb, var(--danger) 26%, var(--surface)); }
.wx-dial.strong .arrow { fill: var(--strong); stroke: var(--strong); }
.wx-dial.gale .arrow { fill: var(--danger-text); stroke: var(--danger-text); }

/* Boat time beside yours (Models/TimeView.cs): boat menu clock, alert/checkup details */
.boat-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.boat-clock > i { color: var(--accent-text); }
.boat-clock b { font: 700 13px var(--font-head); color: var(--text); }
.boat-clock small { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--surface-alt); font-size: 11px; }
.boat-clock .you { opacity: .8; }
.at-boat i { color: var(--accent-text); }

/* ===== Live data page (Components/Pages/Boat/Live.razor) ===== */
.lv-page { display: flex; flex-direction: column; gap: 18px; --lv-fuel: #e0912b; --lv-water: var(--accent); --lv-grey: #7d8b95; --lv-black: #8a6a4f; --lv-oil: #b5832a; --lv-well: #1fa39a; }
.lv-page .page-head { margin-bottom: 0; }
.lv-page .page-head .spacer { flex: 1; }
.lv-status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 10px; border-radius: 999px; font: 700 12px var(--font-head); letter-spacing: .3px; text-transform: uppercase; }
.lv-status .lv-age { font: 500 12px var(--font-body); text-transform: none; letter-spacing: 0; color: inherit; opacity: .85; }
.lv-status.on { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.lv-status.off { color: var(--text-2); background: var(--surface-alt); border: 1px solid var(--line); }
.lv-beat { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lv-status.on .lv-beat, .lv-menu-beat { animation: lv-beat 1.6s ease-out infinite; }
.lv-menu-beat { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }
@keyframes lv-beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

.lv-quiet { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-card); background: var(--surface-alt); border: 1px dashed var(--line); color: var(--text-2); }
.lv-quiet i { font-size: 18px; color: #9bb4d6; }
.lv-quiet b { color: var(--text); margin-right: 4px; }

.lv-age { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-age.old { color: var(--warning-text); }

/* -- instruments -- */
.lv-inst { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.lv-gauge { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 14px 16px 0; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s;
    background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 55%); }
a.lv-gauge:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .07); }
.lv-gh { display: flex; align-items: center; gap: 8px; font: 600 13px var(--font-head); }
.lv-gh i { color: var(--accent-text); width: 16px; text-align: center; }
.lv-gh .lv-age { margin-left: auto; font-family: var(--font-body); font-weight: 400; }
.lv-dial { position: relative; width: 176px; height: 176px; margin: 8px auto 2px; }
.lv-dial svg { width: 100%; height: 100%; overflow: visible; }
.lv-dial .face { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.lv-dial .tick { stroke: var(--text-2); stroke-width: 1; opacity: .45; }
.lv-dial .tick.major { stroke-width: 1.8; opacity: .8; }
.lv-dial .lbl { font: 700 10px var(--font-head); fill: var(--text-2); text-anchor: middle; }
.lv-dial .lbl.n { fill: var(--danger-text); }
.lv-dial g { transform-origin: 80px 80px; transition: transform .8s cubic-bezier(.3, .7, .3, 1); }
.lv-dial-c { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; line-height: 1; pointer-events: none; }
.lv-dial-c b { font: 700 34px/1 var(--font-head); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.lv-dial-c small { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.lv-gf { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); padding: 4px 0 6px; text-align: center; }
.lv-gf b { color: var(--text); font-family: var(--font-head); }
.lv-gf .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lv-gf .lg.true { background: var(--accent); }
.lv-gf .lg.app { width: 0; height: 0; border-radius: 0; border: 5px solid transparent; border-top: 8px solid var(--text-2); border-bottom: 0; vertical-align: 0; }
.lv-trend { display: flex; align-items: flex-end; gap: 6px; margin: 2px -16px 0; padding: 0 12px 0 0; height: 46px; color: var(--accent); }
.lv-trend svg { flex: 1; height: 40px; display: block; }
.lv-trend span { font-size: 10px; color: var(--text-2); padding-bottom: 6px; }

/* wind */
.lv-wind .sector { fill: none; stroke-width: 7; opacity: .55; }
.lv-wind .sector.stbd { stroke: var(--success); }
.lv-wind .sector.port { stroke: var(--danger); }
.lv-wind .bow { fill: var(--text-2); opacity: .6; }
.lv-wind .mk.true { fill: var(--accent); stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.lv-wind .mk.app path { fill: var(--surface); stroke: var(--text-2); stroke-width: 1.8; stroke-linejoin: round; }
/* fresh / strong / gale: the arrow takes the band's colour with a darker edge so it reads on the
   dial face, the legend swatch follows it, and a word under the speed says what the colour means */
.lv-wind { --band: var(--accent); --band-edge: var(--accent); }
.lv-wind.fresh { --band: var(--warning); --band-edge: var(--warning-text); }
.lv-wind.strong { --band: var(--strong); --band-edge: color-mix(in srgb, var(--strong) 70%, var(--text)); }
.lv-wind.gale { --band: var(--danger); --band-edge: var(--danger-text); }
.lv-wind .mk.true path { fill: var(--band); stroke: var(--band-edge); stroke-width: 1.5; stroke-linejoin: round; }
.lv-wind .mk.true line { stroke: var(--band-edge); }
.lv-wind.fresh .lv-dial-c b { color: var(--warning-text); }
.lv-wind.strong .lv-dial-c b { color: var(--strong); }
.lv-wind.gale .lv-dial-c b { color: var(--danger-text); }
.lv-dial-c .band { margin-top: 4px; padding: 1px 7px; border-radius: 999px; font: 700 9.5px var(--font-head); text-transform: uppercase; letter-spacing: .4px; background: color-mix(in srgb, var(--band) 22%, var(--surface)); color: var(--band-edge); }
.lv-gauge:has(.lv-wind.fresh) .lv-gf .lg.true { background: var(--warning); }
.lv-gauge:has(.lv-wind.strong) .lv-gf .lg.true { background: var(--strong); }
.lv-gauge:has(.lv-wind.gale) .lv-gf .lg.true { background: var(--danger); }

/* compass */
.lv-compass .boat path { fill: var(--accent); stroke: color-mix(in srgb, var(--accent) 70%, #000); stroke-width: 1; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); }
.lv-compass .cog line { stroke: var(--success); stroke-width: 2; stroke-dasharray: 4 4; }
.lv-compass .cog circle { fill: var(--success); }
.lv-compass .lv-dial-c { top: 81%; flex-direction: row; align-items: baseline; gap: 3px; }
.lv-compass .lv-dial-c b { font-size: 22px; text-shadow: 0 0 6px var(--surface), 0 0 10px var(--surface); }
.lv-compass .lv-dial-c small { text-shadow: 0 0 6px var(--surface); }

/* depth */
.lv-depth { display: flex; gap: 18px; align-items: center; height: 176px; margin: 8px 0 2px; padding: 0 6px; }
.lv-depth .col { position: relative; width: 58px; height: 160px; border-radius: 10px; overflow: hidden; flex: none; border: 1px solid var(--line);
    background: repeating-linear-gradient(135deg, color-mix(in srgb, #8a6a4f 40%, var(--surface)) 0 6px, color-mix(in srgb, #8a6a4f 55%, var(--surface)) 6px 12px); }
.lv-depth .water { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 35%, var(--surface)), color-mix(in srgb, var(--accent) 85%, #001a33)); transition: height .8s ease; }
.lv-depth .water .waves { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: color-mix(in srgb, #fff 55%, transparent); }
.lv-depth .mark { position: absolute; right: 4px; transform: translateY(-50%); font: 600 9px var(--font-head); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.lv-depth .mark:first-of-type { transform: none; }
.lv-depth .read { display: flex; flex-direction: column; gap: 2px; }
.lv-depth .read b { font: 700 40px/1 var(--font-head); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.lv-depth .read small { font-size: 13px; color: var(--text-2); margin: -2px 0 6px; }
.lv-depth .read .muted { font-size: 12px; }
.lv-depth.low .read b { color: var(--warning-text); }
.lv-depth.shallow .read b { color: var(--danger-text); }
.lv-gauge:has(.lv-depth) .lv-trend { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }

/* battery rings */
.lv-soc .track, .mini-ring .track { fill: none; stroke: color-mix(in srgb, var(--line) 85%, transparent); stroke-width: 12; }
.lv-soc .bar, .mini-ring .bar { fill: none; stroke: var(--text-2); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.lv-page .good .bar { stroke: var(--success); }
.lv-page .warn .bar { stroke: var(--warning); }
.lv-page .bad .bar { stroke: var(--danger); }
.lv-soc .lv-flow { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); }
.lv-gauge:has(.lv-soc) .lv-trend { color: var(--success); }
.lv-flow { font: 700 10px var(--font-head); text-transform: uppercase; letter-spacing: .4px; color: var(--text-2); white-space: nowrap; }
.lv-flow.in { color: var(--success); }
.lv-flow.in::before { content: "\25B2  "; font-size: 8px; }
.lv-flow.out { color: var(--warning-text); }
.lv-flow.out::before { content: "\25BC  "; font-size: 8px; }

/* -- sections -- */
.lv-sec { display: flex; flex-direction: column; gap: 12px; }
.lv-page h3 i { color: var(--accent-text); margin-right: 8px; font-size: 14px; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lv-grid.sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.lv-bat, .lv-chg { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
a.lv-bat:hover, a.lv-env[href]:hover, a.lv-tank[href]:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lv-bat > .lv-age, .lv-env > .lv-age { position: absolute; top: 10px; right: 12px; }
.mini-ring { width: 64px; height: 64px; flex: none; }
.mini-ring .track, .mini-ring .bar { stroke-width: 7; }
.mini-ring .pct { font: 700 15px var(--font-head); fill: var(--text); text-anchor: middle; }
.lv-bat-b { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lv-bat-b > b { font: 600 14px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 60px; }
.lv-bat-b > .muted { font-size: 12px; }
.lv-kv { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.lv-kv > span { display: flex; flex-direction: column; }
.lv-kv small { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; }
.lv-kv b { font: 700 15px var(--font-head); font-variant-numeric: tabular-nums; }
.lv-chg { flex-direction: column; align-items: stretch; gap: 12px; }
.lv-chg.wide { grid-column: 1 / -1; }
.lv-chg-h { display: flex; gap: 14px; align-items: center; }
.lv-chg-h > div { display: flex; flex-direction: column; }
.lv-chg-h .k { font: 600 13px var(--font-head); color: var(--text-2); }
.lv-chg-h b { font: 700 28px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.lv-chg-h b small { font-size: 14px; color: var(--text-2); margin-left: 3px; }
.lv-chg-h .muted { font-size: 12px; }
.lv-chg-h .lv-age { margin-left: auto; align-self: flex-start; }
.lv-chg-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 22px; }
.lv-chg-rows .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm w" "bar bar" "vi vi"; gap: 2px 10px; align-items: baseline; }
.lv-chg-rows .nm { grid-area: nm; font: 600 12.5px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-chg-rows b { grid-area: w; font: 700 13px var(--font-head); font-variant-numeric: tabular-nums; }
.lv-chg-rows .bar { grid-area: bar; height: 6px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; margin: 3px 0 1px; }
.lv-chg-rows .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #f0b429, var(--warning)); transition: width .8s ease; }
.lv-chg-rows .muted { grid-area: vi; font-size: 11px; }
.lv-chg-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; color: var(--text-2); background: var(--surface-alt); }
.lv-chg.on .lv-chg-ic { color: #c98a00; background: color-mix(in srgb, var(--warning) 22%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--warning) 35%, transparent); }
[data-theme="dark"] .lv-chg.on .lv-chg-ic { color: var(--warning); }

/* tanks */
.lv-tanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lv-tank { --tk: var(--lv-water); display: flex; gap: 16px; align-items: stretch; padding: 14px 16px; }
.lv-tank.t-fuel { --tk: var(--lv-fuel); }
.lv-tank.t-graywater { --tk: var(--lv-grey); }
.lv-tank.t-blackwater { --tk: var(--lv-black); }
.lv-tank.t-oil { --tk: var(--lv-oil); }
.lv-tank.t-livewell { --tk: var(--lv-well); }
.vessel-tank { position: relative; width: 46px; height: 112px; border-radius: 10px 10px 12px 12px; border: 2px solid color-mix(in srgb, var(--tk) 45%, var(--line)); background: var(--surface-alt); overflow: hidden; flex: none; }
.vessel-tank .liquid { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--tk) 70%, #fff), var(--tk)); transition: height .8s ease; }
.vessel-tank .surface { position: absolute; left: -10%; right: -10%; top: -3px; height: 6px; border-radius: 50%; background: color-mix(in srgb, #fff 45%, var(--tk)); }
.vessel-tank .q { position: absolute; left: 0; width: 9px; height: 1.5px; background: color-mix(in srgb, var(--text-2) 60%, transparent); }
.lv-tank-b { display: flex; flex-direction: column; gap: 1px; min-width: 0; justify-content: center; }
.lv-tank-b .k { font: 600 13px var(--font-head); display: flex; align-items: center; gap: 6px; }
.lv-tank-b .k i { color: var(--tk); margin: 0; }
.lv-tank-b > b { font: 700 32px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.lv-tank-b > b small { font-size: 14px; color: var(--text-2); margin-left: 2px; }
.lv-tank-b .muted { font-size: 12px; }
.lv-tank-b .small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-tank-b .lv-age { margin-top: 4px; }
.lv-tank.warn .lv-tank-b > b { color: var(--warning-text); }
.lv-tank.bad .lv-tank-b > b { color: var(--danger-text); }
.lv-tank.bad .vessel-tank { animation: lv-warn 1.8s ease-in-out infinite; }
@keyframes lv-warn { 50% { border-color: var(--danger); } }

/* climate */
.lv-env { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.lv-env-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lv-env .k { display: block; font: 600 12.5px var(--font-head); color: var(--text-2); }
.lv-env b { font: 700 24px/1.15 var(--font-head); font-variant-numeric: tabular-nums; }
.lv-env b small { font-size: 13px; color: var(--text-2); margin-left: 1px; }
.lv-env-x { display: flex; gap: 10px; font-size: 12px; color: var(--text-2); }
.lv-env-x i { margin-right: 4px; font-size: 10px; }
.lv-env.warn .lv-env-ic { color: var(--warning-text); background: color-mix(in srgb, var(--warning) 18%, transparent); }

/* navigation + engines */
.lv-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }
.lv-split:empty { display: none; }
.lv-nav, .lv-eng { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.lv-map { position: relative; height: 210px; border-radius: 12px; overflow: hidden; background: var(--surface-alt); }
.lv-navgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
.lv-navgrid > div { display: flex; flex-direction: column; }
.lv-navgrid small { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; }
.lv-navgrid b { font: 600 14px var(--font-head); font-variant-numeric: tabular-nums; }
.lv-navgrid .pos { grid-row: span 2; }
.lv-navgrid .ok-text { color: var(--success); }
.lv-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lv-centre small { font-size: 11.5px; color: var(--text-2); }
.lv-centre small b { color: var(--text); }
.lv-centre .bar { position: relative; height: 8px; border-radius: 4px; margin: 6px 0 3px; background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 25%, var(--surface-alt)), var(--surface-alt) 50%, color-mix(in srgb, var(--success) 25%, var(--surface-alt))); }
.lv-centre .bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); transition: all .6s ease; }
.lv-centre .zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-2); }
.lv-centre .ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-2); }

.lv-engs { display: grid; gap: 14px; }
.lv-engs.twin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lv-split > * { min-width: 0; }
.lv-engine { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface-alt); }
.lv-engine .lv-side { font: 700 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.lv-rpm { position: relative; width: min(190px, 100%); aspect-ratio: 160 / 124; }
.lv-rpm svg { width: 100%; height: 100%; overflow: visible; }
.lv-rpm path { fill: none; stroke-width: 11; stroke-linecap: round; }
.lv-rpm .track { stroke: color-mix(in srgb, var(--line) 90%, transparent); }
.lv-rpm .red { stroke: color-mix(in srgb, var(--danger) 30%, transparent); stroke-linecap: butt; }
.lv-rpm .bar { stroke: var(--accent); }
.lv-rpm .read { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; line-height: 1; }
.lv-rpm .read b { font: 700 28px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.lv-rpm .read small { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.lv-rpm .gear { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font: 700 10.5px var(--font-head); text-transform: uppercase; letter-spacing: .4px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.lv-rpm .gear.g-fwd { color: var(--success); border-color: color-mix(in srgb, var(--success) 50%, var(--line)); }
.lv-rpm .gear.g-rev { color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 60%, var(--line)); }
.lv-engine .lv-kv { justify-content: center; text-align: center; gap: 8px 16px; }
.lv-engine .lv-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.lv-engine .lv-kv > span { align-items: center; min-width: 0; }
.lv-eng.off .lv-rpm .read b { color: var(--text-2); }

/* the slow sections' first load (Live.razor, LiveDataService.InBackground) */
.lv-loading { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); color: var(--text-2); font-size: 13px; }
.lv-spin { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: nav-spin .7s linear infinite; flex: none; }

/* a value that just changed */
.lv-flash { animation: lv-flash 1.4s ease-out; border-radius: 4px; }
@keyframes lv-flash { 0% { background: color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 4px transparent; } }

.lv-page .stale:not(.lv-gauge) { opacity: .8; }
.lv-gauge.stale .lv-dial, .lv-gauge.stale .lv-depth { filter: saturate(.55); }
.lv-gauge.none .lv-depth .read b { color: var(--text-2); }
.lv-gauge.none .lv-depth .col { background: var(--surface-alt); }

@media (max-width: 760px) {
    .lv-split { grid-template-columns: 1fr; }
    .lv-engs.twin, .lv-bars { grid-template-columns: 1fr; }
    .lv-navgrid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .lv-status.on .lv-beat, .lv-menu-beat, .lv-flash, .lv-tank.bad .vessel-tank { animation: none; } .lv-dial g { transition: none; } }

/* ---------- Boat › Sharing (Sharing.razor) ---------- */
.share-lead { margin: -8px 0 16px; }
.share-own > .card { margin-bottom: 12px; }
.share-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.share-h h3 { flex: 1; font-size: 16px; }
.share-h > i { color: var(--accent-text); }
.share-h .check { font-size: 13px; }
.share-start ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.share-start li { display: flex; gap: 12px; align-items: baseline; }
.share-start li i { width: 18px; text-align: center; color: var(--accent-text); }
.share-start form { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link-row .url { flex: 1; min-width: 240px; display: flex; align-items: center; height: 40px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--surface-alt); overflow: hidden; cursor: text; }
.link-row .url:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.link-row .url span { padding-left: 12px; color: var(--text-2); white-space: nowrap; }
.link-row .url input { border: 0; background: none; padding: 0 12px 0 0; height: 100%; font: 600 14px var(--font-body); color: var(--text); min-width: 0; flex: 1; outline: none; }
.link-row .btn:not(.primary) { background: var(--surface-alt); border: 1px solid var(--line); }
.slug-note { font-size: 13px; margin-top: 8px; }
.slug-note.ok { color: var(--success); }
.slug-note.bad { color: var(--danger); }
.slug-note a { color: var(--accent-text); font-weight: 700; }
.pw-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pw-row input, .crew-note textarea, .crew-note input, .set-stack textarea { padding: 9px 12px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); font: 14px var(--font-body); min-width: 0; }
.pw-row input { flex: 1; max-width: 300px; height: 38px; }
.crew-note textarea { width: 100%; resize: vertical; }
.cn-row { margin-top: 12px; }
.cn-l { display: block; font: 600 13px var(--font-head); margin-bottom: 6px; }
.cn-when { display: flex; gap: 8px; flex-wrap: wrap; }
.cn-when input[type=text] { flex: 1; min-width: 180px; }
.cn-hint { font-size: 13px; margin-top: 10px; display: flex; gap: 8px; align-items: baseline; }
.cn-hint a { color: var(--accent-text); }
.cn-acts { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.cn-acts .muted { margin-left: auto; font-size: 13px; }
.set-stack { flex-wrap: wrap; }
.set-stack textarea { flex: 1 1 100%; margin-left: 36px; resize: vertical; }
.set-row input[type=date] { height: 40px; padding: 0 10px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); font: 14px var(--font-body); }
.share-off { margin-top: 16px; }
.set-h .muted { font: 400 12px var(--font-body); text-transform: none; letter-spacing: 0; margin-left: 8px; }

/* ---------- The shared page (SharePage.razor): public, no account. Phone first; two columns from 960px. ---------- */
body:has(.sh), body:has(.sh-gate) { overflow: auto; }
.sh-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sh-mark { width: 28px; height: 28px; flex: none; }
.sh-boat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sh-boat .dot { flex: none; }
.sh-boat h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-boat small { color: var(--text-2); font-size: 12px; display: block; }
.sh-who { margin-left: auto; font-size: 12px; color: var(--text-2); text-align: right; flex: none; }
.sh-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px 20px 24px; max-width: 1400px; margin: 0 auto; }
.sh-mapcol, .sh-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.sh .card { padding: 16px 18px; }
.sh-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sh-h h2 { font-size: 15px; flex: 1; }
.sh-h > i { color: var(--accent-text); }
.sh-h .muted { font-size: 12px; }

.sh-status { border-left: 5px solid var(--success); }
.sh-status.warn { border-left-color: var(--warning); }
.sh-status.bad { border-left-color: var(--danger); }
.sh-overdue { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--text); font-size: 14px; }
.sh-overdue i { color: var(--danger); }
.st-line { display: flex; align-items: center; gap: 12px; }
.st-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: none; background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.st-ic.warn { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning-text); }
.st-ic.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.st-line h3 { font-size: 20px; }
.st-line p { color: var(--text-2); font-size: 13px; }
.st-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.st-facts > div { background: var(--surface-alt); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.st-facts b { display: block; font: 700 15px var(--font-head); }
.st-facts b small { font: 400 11px var(--font-body); color: var(--text-2); }
.st-facts span { font-size: 11px; color: var(--text-2); }
.st-facts .wide { grid-column: 1 / -1; }
.st-facts .wide b { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.st-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.st-acts .btn:not(.primary), .sh-gate .btn:not(.primary) { background: var(--surface-alt); border: 1px solid var(--line); }

.sh-mapcard { padding: 0 !important; overflow: hidden; }
.sh-mapbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.sh-mapbar h2 { font-size: 15px; flex: 1; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.sh-mapbar h2 i { color: var(--accent-text); }
.sh-mapbar .layers { position: static; padding: 3px; border-radius: 10px; box-shadow: none; backdrop-filter: none; background: var(--surface-alt); }
.sh-mapbar .seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--line); }
.sh-mapbar .seg button { padding: 5px 10px; border-radius: 8px; font: 600 12px var(--font-head); cursor: pointer; color: var(--text-2); background: none; border: 0; white-space: nowrap; }
.sh-mapbar .seg button.on, .sh-mapbar .layers button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sh-mapwrap { height: 480px; position: relative; }
.sh-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 16px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); }
.sh-legend span { display: flex; align-items: center; gap: 6px; }
.sh-legend i.ln { width: 22px; height: 4px; border-radius: 2px; display: inline-block; background: var(--accent); }
.sh-legend i.ln.old { opacity: .45; }

.sh-note-text { font-size: 14px; white-space: pre-line; }
.sh-note .due { margin-top: 8px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: baseline; }
.sh-note .due.bad, .sh-note .due.bad i { color: var(--danger); }

.sh .cond { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh .cond.one { grid-template-columns: 1fr; }
.sh .cond > div { background: var(--surface-alt); border-radius: 10px; padding: 10px; text-align: center; }
.sh .cond i { color: var(--accent-text); font-size: 16px; }
.sh .cond b { display: block; font: 700 18px var(--font-head); margin-top: 4px; }
.sh .cond span, .sh .cond small { display: block; font-size: 11px; color: var(--text-2); }
/* Hour tiles match the Weather page's (.wx-h): sun in amber, cloud grey, night blue, so a sun never reads as a cog. */
.sh .hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.sh .hours > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 2px; border-radius: 10px; background: var(--surface-alt); font-size: 11px; color: var(--text-2); }
.sh .hours .tm { font: 700 12px var(--font-head); }
.sh .hours .ic { font-size: 18px; color: var(--warning); }
.sh .hours .ic.fa-cloud, .sh .hours .ic.fa-cloud-showers-heavy, .sh .hours .ic.fa-smog, .sh .hours .ic.fa-wind { color: var(--text-2); }
.sh .hours .ic.fa-moon, .sh .hours .ic.fa-cloud-moon, .sh .hours .ic.fa-cloud-moon-rain { color: #9bb4d6; }
.sh .hours b { font: 700 15px var(--font-head); color: var(--text); }
.sh-warn { margin-top: 8px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: baseline; }
.sh-warn i { color: var(--warning-text); }

.sh-alerts .al { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sh-alerts .al:first-of-type { border-top: 0; }
.sh-alerts .al i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.sh-alerts .al .bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.sh-alerts .al small { color: var(--text-2); }

.sh-foot { max-width: 1400px; margin: 0 auto; padding: 0 20px 28px; font-size: 12px; color: var(--text-2); display: flex; gap: 10px 20px; flex-wrap: wrap; }
.sh-foot a { color: var(--accent-text); }
.sh-emergency { flex-basis: 100%; display: flex; gap: 8px; align-items: baseline; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 12px 16px; white-space: pre-line; }
.sh-emergency i { color: var(--accent-text); }
.sh-by { margin-left: auto; }

.sh-gate { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 18%, var(--canvas)), var(--canvas) 60%); }
.sh-gate .card { width: 100%; max-width: 400px; padding: 28px; text-align: center; }
.sh-gate .boat-ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); font-size: 26px; }
.sh-gate h1 { font-size: 22px; }
.sh-gate p { margin: 6px 0 18px; }
.sh-gate .field { text-align: left; }
.sh-gate .sh-remember { display: flex; margin-bottom: 16px; font-size: 13px; color: var(--text-2); }
.sh-gate .sh-small { margin: 14px 0 0; font-size: 12px; }

@media (max-width: 960px) {
    .sh-body { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
    /* One column in this order: status, crew note, map, messages, conditions, alerts (orders set below). */
    .sh-mapcol, .sh-side { display: contents; }
    .sh-status { order: 1; } .sh-note { order: 2; } .sh-mapcard { order: 3; }
    .sh-mapwrap { height: 340px; }
    .sh-mapbar h2 { flex-basis: 100%; }
    .sh-top { padding: 10px 12px; }
    .sh-who { display: none; }
    .sh-theme { margin-left: auto; }
    .sh-foot { padding: 0 12px 24px; }
    .sh-by { margin-left: 0; }
}

/* ---------- Share messages: the thread on the shared page and on Boat › Sharing ---------- */
.sh-thread { display: grid; gap: 10px; max-height: 320px; overflow: auto; padding: 4px 4px 12px 0; align-content: start; }
.sh-thread .msg { max-width: 85%; justify-self: start; }
.sh-thread .msg .who { font-size: 11px; color: var(--text-2); margin-bottom: 2px; display: flex; gap: 8px; align-items: center; }
.sh-thread .msg .bub { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-alt); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.sh-thread .msg.crew { justify-self: end; }
.sh-thread .msg.crew .who { justify-content: flex-end; }
.sh-thread .msg.crew .bub { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.sh-thread .msg.fresh .bub { box-shadow: inset 3px 0 0 var(--danger); }
.sh-thread .msg .del { border: 0; background: none; padding: 0 2px; color: var(--text-2); cursor: pointer; opacity: .55; font-size: 11px; }
.sh-thread .msg .del:hover { opacity: 1; color: var(--danger); }
.sh-empty { font-size: 13px; padding: 8px 0; }
.send-bar { display: flex; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
/* Same field and button as the rest of the dashboard (the password row, settings): not chat-app pills. */
.send-bar input { height: 38px; padding: 0 12px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); font: 14px var(--font-body); min-width: 0; }
.send-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.send-bar .sb-name { width: 150px; flex: none; }
.send-bar .sb-text { flex: 1; }
.sh-msgs .notice { margin: 10px 0 0; }
.share-msgs .own-thread { max-height: 420px; margin-top: 10px; }
.set-row.off .nm { opacity: .6; }
.set-row .toggle:disabled { opacity: .45; cursor: not-allowed; }
.pill.msg-pill { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }

@media (max-width: 960px) {
    .sh-msgs { order: 4; } .sh-cond { order: 5; } .sh-alerts { order: 6; }
    .send-bar { flex-wrap: wrap; }
    .send-bar .sb-name { width: 100%; }
    .send-bar .btn span { display: none; }
}

/* ---------- Boat members + Aboard/Away (docs/members-awaymode-dashboard-brief.md) ---------- */
/* Read-only for a member: the same form inside a disabled fieldset, so nothing reflows. */
.ro-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.ro-set:disabled :is(input, select, textarea, label) { cursor: not-allowed; }
.ro-set:disabled :is(input, select, textarea) { opacity: .75; }
.switch-btn:disabled { opacity: .45; cursor: not-allowed; }
.role-pill { margin-left: 2px; }

/* Boat menu header: Aboard | Away */
.mode-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.mode-row small { font-size: 12px; }
.mode-row .pill { display: inline-flex; align-items: center; gap: 5px; }
.mode-seg button { padding: 5px 10px; font-size: 12px; }
.mode-seg button i { font-size: 11px; }
.mode-said { margin-top: 6px; font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: baseline; }
.mode-said i { color: var(--success); }
.mode-said.warn i { color: var(--warning-text); }
.mode-said .link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; }
.mode-said .link-btn i { color: inherit; }
.mode-said .link-btn:hover { text-decoration: underline; }

/* Boat › Members */
.pw-row .mb-role { height: 38px; padding: 0 10px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); font: 14px var(--font-body); }
.mb-roles { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.mb-roles b { color: var(--text); margin-right: 4px; }
.set-row .mb-del { height: 36px; width: 36px; padding: 0; justify-content: center; color: var(--text-2); }
.set-row .mb-del:hover { color: var(--danger); }
.link-row .url input[readonly] { padding-left: 12px; font-weight: 500; }

/* /invite */
.inv-boat { width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); font-size: 26px; }

/* Alert rules › Away mode: a limit beside each check, in the row (docs/away-mode-plan.md) */
.away-card .aw-lim { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.away-card .aw-lim input { width: 72px; height: 36px; padding: 0 8px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface-alt); color: var(--text); font: 14px var(--font-body); text-align: right; }
.away-card .aw-lim input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
a.mode-said.warn { color: var(--danger); text-decoration: none; }
a.mode-said.warn i { color: var(--danger); }
@media (max-width: 720px) { .away-card .set-row { flex-wrap: wrap; } .away-card .set-row .nm { flex-basis: calc(100% - 40px); } }
