/* =========================================================
   DRIFT — the team work-river
   Fonts: Literata (display), Space Grotesk (UI), IBM Plex Mono (data)
   ========================================================= */

@font-face { font-family: "Literata"; src: url("assets/literata.ttf") format("truetype"); font-weight: 1 1000; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/space-grotesk.ttf") format("truetype"); font-weight: 1 1000; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/ibm-plex-mono.ttf") format("truetype"); font-weight: 1 1000; font-display: swap; }

:root {
  /* water */
  --deep: #091d2c;
  --water-0: #0c2738;
  --water-1: #123247;
  --water-2: #163e57;
  --foam: #eaf2f4;
  --foam-dim: #9fc3d4;       /* secondary text on water */
  --foam-faint: #6f97ab;     /* tertiary */
  --bank: #2c5163;

  /* boats (paper) */
  --boat: #f4ede0;
  --boat-edge: #d8ccb8;
  --boat-ink: #16323f;
  --boat-ink-soft: #4a6776;

  /* status colors */
  --c-todo: #7fb3cf;        /* slack water */
  --c-ip:   #46c2d6;        /* current */
  --c-blk:  #ef6b4d;        /* snag */
  --c-done: #d8c27a;        /* delta */

  --shadow-boat: 0 14px 26px -16px rgba(0,0,0,0.7), 0 2px 6px -2px rgba(0,0,0,0.5);
  --shadow-boat-hover: 0 22px 40px -18px rgba(0,0,0,0.8), 0 6px 14px -4px rgba(0,0,0,0.5);

  --r-sm: 10px; --r-md: 16px; --r-lg: 22px;
  --ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Literata", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--ui);
  color: var(--foam);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: #46c2d6; color: #06151f; }

:focus-visible { outline: 3px solid #7fd6e6; outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================
   Chart room header
   ========================================================= */
.chartroom {
  position: relative; z-index: 6;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(14px, 2.2vw, 26px) clamp(16px, 3.4vw, 44px);
  background:
    linear-gradient(180deg, rgba(8,26,38,0.96), rgba(8,26,38,0.78));
  border-bottom: 1px solid rgba(122, 180, 204, 0.16);
  backdrop-filter: blur(6px);
}

.chartroom__brand { display: flex; align-items: center; gap: 14px; }
.mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: radial-gradient(120% 120% at 30% 20%, #163e57, #0a1f2e);
  box-shadow: inset 0 0 0 1px rgba(127,214,230,0.18); }
.wordmark h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: 0.06em;
  font-size: clamp(22px, 2.4vw, 30px); margin: 0; color: var(--foam);
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.wordmark .tag {
  margin: 2px 0 0; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--foam-dim);
}

.chartroom__console { display: flex; align-items: flex-end; gap: 14px; justify-content: flex-start; flex-wrap: wrap; }

.field { position: relative; display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--foam-dim); padding-left: 2px;
}
.field__icon {
  position: absolute; left: 12px; bottom: 12px; color: var(--foam-dim); pointer-events: none;
  display: grid; place-items: center;
}
#search, #filter {
  appearance: none; font: inherit; font-family: var(--ui); font-size: 15px;
  color: var(--foam); background: rgba(10, 30, 44, 0.72);
  border: 1px solid rgba(127,214,230,0.22); border-radius: 12px;
  padding: 11px 14px 11px 38px; min-width: 0; width: 100%;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#search { width: clamp(190px, 26vw, 320px); }
#filter {
  padding-right: 36px; width: clamp(200px, 22vw, 250px); cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--foam-dim) 50%),
    linear-gradient(135deg, var(--foam-dim) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  background-position: right 16px center, right 11px center;
}
#search::placeholder { color: var(--foam-faint); }
#search:focus, #filter:focus {
  outline: none; border-color: #7fd6e6;
  box-shadow: 0 0 0 3px rgba(127,214,230,0.18);
  background: rgba(14, 40, 58, 0.85);
}
#search:focus-visible, #filter:focus-visible { outline: 3px solid #7fd6e6; outline-offset: 1px; }
#filter option { color: #06151f; background: #f4ede0; }

.hydrograph {
  display: flex; gap: clamp(10px, 1.6vw, 20px); margin: 0; padding: 0; list-style: none;
  align-items: center;
}
.hydrograph li { display: flex; align-items: center; gap: 7px; }
.hg-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--foam-dim); }
.hg-count { font-family: var(--mono); font-size: 15px; color: var(--foam); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: left; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,0.04); }
.dot--todo { background: var(--c-todo); box-shadow: 0 0 10px rgba(127,179,207,0.6); }
.dot--in-progress { background: var(--c-ip); box-shadow: 0 0 10px rgba(70,194,214,0.7); }
.dot--blocked { background: var(--c-blk); box-shadow: 0 0 10px rgba(239,107,77,0.65); }
.dot--done { background: var(--c-done); box-shadow: 0 0 10px rgba(216,194,122,0.6); }

/* themed scrollbars (the parts we didn’t draw) */
* { scrollbar-width: thin; scrollbar-color: rgba(127,214,230,0.4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(127,214,230,0.28); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(127,214,230,0.5); background-clip: padding-box; }

/* =========================================================
   The river board
   ========================================================= */
.board { position: relative; min-height: calc(100vh - 96px); overflow: hidden; }
.board.is-empty { min-height: 60vh; display: grid; place-items: center; }
.board.is-empty .reaches { display: none; }

.river { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.river--mob { display: none; }

/* flowing current */
.current { stroke-dasharray: 18 26; animation: flow 7s linear infinite; }
.current--slow { stroke-dasharray: 10 40; animation: flow 11s linear infinite; }
.current--vslow { stroke-dasharray: 8 46; animation: flow 13s linear infinite; }
.current--v { stroke-dasharray: 18 26; animation: flow-v 9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -220; } }
@keyframes flow-v { to { stroke-dashoffset: -440; } }

/* drifting particles */
.drifters { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.drift {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127,214,230,0.85), rgba(127,214,230,0));
  opacity: 0.5;
  animation: drift 18s linear infinite;
}
.drift:nth-child(1) { top: 30%; left: -4%; animation-duration: 22s; }
.drift:nth-child(2) { top: 56%; left: -8%; animation-duration: 28s; animation-delay: -6s; }
.drift:nth-child(3) { top: 42%; left: -6%; animation-duration: 32s; animation-delay: -12s; opacity:.35; }
.drift:nth-child(4) { top: 68%; left: -5%; animation-duration: 24s; animation-delay: -3s; opacity:.4; }
.drift:nth-child(5) { top: 22%; left: -7%; animation-duration: 30s; animation-delay: -9s; opacity:.3; }
.drift:nth-child(6) { top: 78%; left: -9%; animation-duration: 26s; animation-delay: -15s; opacity:.45; }
@keyframes drift { to { transform: translateX(112vw); } }

/* =========================================================
   Reaches
   ========================================================= */
.reaches {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 30px);
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3.4vw, 44px) clamp(48px, 7vw, 96px);
  align-items: start;
}

.reach { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.reach__bank h2 {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: clamp(18px, 1.9vw, 24px);
  margin: 0; color: var(--foam); letter-spacing: 0.01em;
}
.reach__bank h2 .dot { width: 12px; height: 12px; }
.reach__meta {
  margin: 6px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--foam-dim);
}
.reach__count { color: var(--foam); font-variant-numeric: tabular-nums; }
.reach__desc {
  margin: 8px 0 0; max-width: 34ch; font-size: 13.5px; line-height: 1.5; color: var(--foam-faint);
  font-family: var(--serif); font-style: italic;
}

/* filtered-out reach dims (when a specific filter is active) */
body[data-reach-flow="single"] .reach { opacity: 0.32; transition: opacity .3s; filter: saturate(0.6); }
body[data-reach-flow="single"] .reach.is-active { opacity: 1; filter: none; }

/* =========================================================
   Fleet / boats
   ========================================================= */
.fleet { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fleet__empty {
  list-style: none; margin: 0; padding: 18px 14px;
  font-family: var(--serif); font-style: italic; font-size: 13.5px; line-height: 1.5;
  color: var(--foam-faint); text-align: center;
  border: 1px dashed rgba(122,180,204,0.16); border-radius: var(--r-md);
  background: rgba(8,24,36,0.25);
}

.boat {
  position: relative; margin: 0;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--boat), #efe6d4);
  border: 1px solid var(--boat-edge);
  box-shadow: var(--shadow-boat);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s, opacity .3s;
  animation: bob 6s ease-in-out infinite;
}
.boat:nth-child(2n) { animation-delay: -2s; }
.boat:nth-child(3n) { animation-delay: -4s; }
@keyframes bob {
  0%,100% { transform: translateY(0) rotate(-0.15deg); }
  50% { transform: translateY(-3px) rotate(0.15deg); }
}
.boat[data-status="todo"]        { --boat-status: var(--c-todo); }
.boat[data-status="in-progress"]{ --boat-status: var(--c-ip); }
.boat[data-status="blocked"]     { --boat-status: var(--c-blk); }
.boat[data-status="done"]        { --boat-status: var(--c-done); }

.boat__sail {
  position: absolute; top: 12px; right: 14px; width: 20px; height: 20px;
  color: var(--boat-status); display: grid; place-items: center;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  pointer-events: none;
}
.boat__sail svg { width: 20px; height: 20px; }

.boat > .open-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 14px 44px 14px 16px; cursor: pointer; color: var(--boat-ink);
  font: inherit; border-radius: var(--r-md);
  transition: background .18s;
}
.boat:hover { transform: translateY(-3px); box-shadow: var(--shadow-boat-hover); }
.boat:hover > .open-item { background: rgba(70,194,214,0.06); }
.boat:focus-within > .open-item { background: rgba(70,194,214,0.1); }

.boat__title {
  font-family: var(--serif); font-weight: 600; font-size: 16.5px; line-height: 1.28;
  color: var(--boat-ink); margin: 0; padding-right: 4px;
}
.boat__line {
  margin: 9px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--boat-ink-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
}
.boat__line .sep { opacity: 0.4; }
.boat__due.is-soon { color: #b8462e; font-weight: 600; }
.boat__foot {
  margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.boat__prio {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor;
  color: var(--boat-ink-soft);
}
.boat__prio[data-priority="high"] { color: #b8462e; background: rgba(184,70,46,0.08); }
.boat__comments {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--boat-ink-soft);
}
.boat__comments svg { width: 14px; height: 14px; }
.boat__comments.is-zero { opacity: 0.4; }

/* wake when a boat just drifted in */
.boat.is-new::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%;
  transform: translate(-50%,-50%); pointer-events: none;
  background: var(--boat-status);
  animation: ripple .9s ease-out forwards;
}
@keyframes ripple {
  0% { box-shadow: 0 0 0 0 var(--boat-status); opacity: .8; }
  100% { box-shadow: 0 0 0 28px rgba(70,194,214,0); opacity: 0; }
}

/* dim non-matching boats when searching */
body.is-seeking .boat { opacity: 0.42; filter: saturate(0.7); }
body.is-seeking .boat.is-hit { opacity: 1; filter: none; box-shadow: var(--shadow-boat-hover), 0 0 0 1.5px rgba(127,214,230,0.4); }

/* =========================================================
   Empty state
   ========================================================= */
.empty {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 40%, rgba(8,26,38,0.4), rgba(8,26,38,0.9));
  text-align: center;
}
.empty[hidden] { display: none; }
.empty__glass {
  max-width: 460px; padding: 36px 28px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(18,50,71,0.66), rgba(9,29,44,0.66));
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7); border: 1px solid rgba(127,214,230,0.16);
}
.empty h2 { font-family: var(--serif); font-weight: 600; margin: 14px 0 8px; color: var(--foam); font-size: 24px; }
.empty p { margin: 0 0 20px; color: var(--foam-dim); font-size: 15px; line-height: 1.5; }

.btn {
  font: inherit; font-family: var(--ui); font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: 12px 22px; border: 1px solid rgba(127,214,230,0.4);
  background: linear-gradient(180deg, #1c5f7a, #134b63); color: var(--foam);
  transition: transform .16s, box-shadow .16s, background .16s;
  letter-spacing: 0.02em;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(70,194,214,0.6); background: linear-gradient(180deg, #2274a0, #185a78); }
.btn:active { transform: translateY(0); }

/* =========================================================
   Logbook detail (dialog)
   ========================================================= */
.logbook {
  border: 0; background: transparent; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%; color: var(--foam);
  position: fixed; inset: 0;
  place-items: center end;
  animation: dialog-in .26s cubic-bezier(.2,.7,.2,1);
}
/* only lay out (and show) when actually open; closed dialog stays display:none via the UA */
dialog.logbook:modal,
dialog.logbook[open] { display: grid; }
@keyframes dialog-in { from { opacity: 0; } to { opacity: 1; } }
.logbook::backdrop { background: radial-gradient(120% 100% at 80% 50%, rgba(8,26,38,0.55), rgba(4,12,18,0.78)); backdrop-filter: blur(3px); }

.logbook__card {
  width: min(560px, 100%); max-height: 100%; overflow: auto;
  margin: 0 0 0 auto; padding: clamp(20px, 3vw, 36px);
  background:
    linear-gradient(180deg, #102e43, #0b2235);
  border-left: 1px solid rgba(127,214,230,0.18);
  box-shadow: -40px 0 80px -30px rgba(0,0,0,0.8);
  display: flex; flex-direction: column; gap: 22px;
  animation: card-in .32s cubic-bezier(.2,.7,.2,1);
}
@keyframes card-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.logbook__head { position: relative; display: flex; flex-direction: column; gap: 12px; }
.logbook__topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logbook__status {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--foam-dim);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(127,214,230,0.08); border: 1px solid rgba(127,214,230,0.18);
}
.logbook__status .dot { width: 9px; height: 9px; }
.logbook__status-text { color: var(--foam); letter-spacing: 0.04em; text-transform: none; font-size: 12px; }
.logbook__title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3vw, 32px); line-height: 1.16;
  margin: 0; color: var(--foam);
}
.logbook__close {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--foam-dim); background: rgba(127,214,230,0.08);
  border: 1px solid rgba(127,214,230,0.22); border-radius: 999px;
  padding: 7px 12px 7px 9px; cursor: pointer; transition: color .16s, background .16s, border-color .16s;
}
.logbook__close span { display: none; }
.logbook__close:hover { color: var(--foam); background: rgba(127,214,230,0.16); border-color: rgba(127,214,230,0.4); }

.logbook__meta {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 16px; border-radius: var(--r-md);
  background: rgba(8,24,36,0.5); border: 1px solid rgba(127,214,230,0.1);
}
.meta-row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.meta-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--foam-faint); }
.meta-v { font-family: var(--ui); font-size: 14px; color: var(--foam); text-align: right; }
.meta-row--tags .meta-v { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag-pill {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(70,194,214,0.12); color: #bfe9f0; border: 1px solid rgba(70,194,214,0.25);
}

.logbook__body { display: flex; flex-direction: column; gap: 14px; }
.logbook__summary {
  margin: 0; padding: 2px 0 0;
  border-top: 1px solid rgba(127,214,230,0.18);
}
.logbook__lead {
  display: block; margin-top: 12px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--foam-faint);
}
.logbook__summary p {
  margin: 6px 0 12px; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.6;
  color: #cfe4ea;
}
.logbook__full {
  white-space: pre-line; font-family: var(--serif); font-size: 15.5px; line-height: 1.65; color: var(--foam);
  padding: 16px 18px; border-radius: var(--r-md);
  background: rgba(244,237,224,0.04); border: 1px solid rgba(244,237,224,0.08);
}

.logbook__helm {
  padding: 18px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(70,194,214,0.1), rgba(70,194,214,0.03));
  border: 1px solid rgba(70,194,214,0.25);
  display: grid; gap: 10px;
}
.helm__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--foam-dim); }
.helm__row { display: flex; align-items: center; gap: 12px; }
.helm__flag { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--c-todo); box-shadow: 0 0 10px var(--c-todo); transition: background .2s, box-shadow .2s; }
.helm__select {
  flex: 1; appearance: none; font: inherit; font-family: var(--ui); font-size: 16px; font-weight: 600;
  color: var(--foam); padding: 12px 36px 12px 14px; border-radius: 12px;
  border: 1px solid rgba(127,214,230,0.3); background: rgba(8,24,36,0.7);
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--foam-dim) 50%),
    linear-gradient(135deg, var(--foam-dim) 50%, transparent 50%);
  background-repeat: no-repeat; background-size: 6px 6px, 6px 6px;
  background-position: right 16px center, right 11px center;
  transition: border-color .16s, box-shadow .16s;
}
.helm__select:focus { outline: none; box-shadow: 0 0 0 3px rgba(127,214,230,0.2); border-color: #7fd6e6; }
.helm__select:focus-visible { outline: 3px solid #7fd6e6; outline-offset: 1px; }
.helm__select option { color: #06151f; background: #f4ede0; }
.helm__readout { font-family: var(--mono); font-size: 12px; color: #bfe9f0; min-width: 0; }
.helm__readout.is-set { color: #d8c27a; }
.helm__hint { margin: 0; font-size: 12.5px; color: var(--foam-faint); font-family: var(--serif); font-style: italic; }

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed; z-index: 20; left: 50%; bottom: 26px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: #06151f;
  background: var(--boat); border: 1px solid var(--boat-edge);
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 20px 40px -16px rgba(0,0,0,0.7);
  display: flex; align-items: center; gap: 10px; max-width: 90vw;
  animation: toast-in .3s cubic-bezier(.2,.7,.2,1);
}
.toast[hidden] { display: none; }
.toast .dot { width: 9px; height: 9px; box-shadow: 0 0 8px currentColor; }
@keyframes toast-in { from { transform: translateX(-50%) translateY(16px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.toast { transform: translateX(-50%); }

/* =========================================================
   Responsive — mobile / tablet
   ========================================================= */
@media (max-width: 920px) {
  .chartroom { grid-template-columns: 1fr; gap: 14px; padding: 14px 16px; }
  .chartroom__console { width: 100%; }
  #search { width: 100%; }
  #filter { width: 100%; flex: 1; }
  .chartroom__console .field { flex: 1; }
  .hydrograph { width: 100%; justify-content: space-between; gap: 8px; }
  .hg-count { font-size: 16px; }

  .river--desk { display: none; }
  .river--mob { display: block; }
  .board { min-height: 0; }

  .reaches { grid-template-columns: 1fr; gap: 0; padding: 18px 16px 80px; }
  .reach { padding: 22px 4px; position: relative; }
  .reach + .reach { border-top: 1px dashed rgba(122,180,204,0.16); }
  .reach__desc { max-width: none; }
  .fleet { gap: 12px; }

  .drift { animation-name: none; opacity: 0; }

  .logbook { place-items: end stretch; }
  .logbook__card { width: 100%; margin: 0; border-left: 0; border-top: 1px solid rgba(127,214,230,0.18); box-shadow: 0 -30px 60px -20px rgba(0,0,0,0.7); animation-name: card-in-mob; }
  @keyframes card-in-mob { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .logbook__close span { display: inline; }
  .logbook__title { padding-right: 0; }

  .toast { bottom: 18px; }
}

@media (max-width: 520px) {
  .boat__title { font-size: 15.5px; }
  .meta-v { font-size: 13px; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .current, .current--slow, .current--vslow, .current--v { animation: none; }
  .drift { display: none; }
  .boat { animation: none; }
  .boat.is-new::after { animation: none; display: none; }
}
