/* Seat Racing screens */
#app { max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; }

/* top bar + role tabs */
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: 10px 16px;
  background: var(--bg);   /* phones without color-mix (iOS 15 and older) */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .home img { width: 34px; height: 34px; display: block; border-radius: 9px; }
.top-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.top-title strong { font-size: 1.05rem; }
.top-session { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill {
  min-height: 34px; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.ok { color: var(--go); background: var(--go-soft); border-color: transparent; }
.status-pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.status-pill.bad { color: var(--stop); background: var(--stop-soft); border-color: transparent; }

.roles, .subtabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px;
  margin: 12px 0;
}
.roles button, .subtabs button { border: 0; background: transparent; min-height: 42px; border-radius: 9px; color: var(--muted); }
.roles button.on, .subtabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.subtabs { max-width: 420px; }

/* role chooser */
.chooser { max-width: 720px; margin: 28px auto; }
.chooser h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.choices { display: grid; gap: 12px; margin-top: 18px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: .3rem;
  padding: 18px 20px; min-height: 92px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  font-weight: 400;
}
.choice strong { font-size: 1.25rem; }
.choice span { color: var(--muted); }
.choice-start { border-left: 6px solid var(--go); }
.choice-finish { border-left: 6px solid var(--stop); }
.choice-coach { border-left: 6px solid var(--accent); }
.empty-card { max-width: 640px; margin: 24px auto; }

/* coach layout */
.race-grid, .results-grid, .setup-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(0, 1fr); }   /* one column on a phone, never wider than the screen (2.1.27) */
.race-side > .card + .card, .results-grid > div > .card + .card, .setup-grid > div > .card + .card { margin-top: 14px; }
@media (min-width: 1000px) {
  .race-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .results-grid, .setup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.race-main > .card + .card { margin-top: 14px; }
.card-actions { margin-top: 12px; }
.toolbar { margin-bottom: 12px; }
.dist-input { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; }
.dist-input input { width: 92px; min-height: 36px; padding: .3rem .5rem; }

table.results td.place { width: 2.2rem; font-weight: 700; }
table.results tr.st-racing td { color: var(--warn); }
.linkish {
  background: none; border: 0; padding: .2rem .3rem; min-height: 0; font-weight: inherit;
  color: inherit; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.linkish:hover { background: var(--surface-2); }
.time-edit { display: inline-flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.time-edit input { width: 96px; min-height: 34px; padding: .25rem .45rem; }
.live { font-weight: 700; }
td.pos { color: var(--go); font-weight: 700; }
td.neg { color: var(--stop); }

/* side markers */
.side {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; font-weight: 800;
  color: #fff; background: var(--muted);
}
.side-P { background: var(--port); }
.side-S { background: var(--star); }
.side-B { background: var(--both); }
.side-C { background: var(--cox); }
.side-n { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* swap banner */
.swap-banner {
  background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.swap-banner .steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.swap-banner .steps li {
  display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted);
  background: var(--surface); border-radius: 8px; padding: .3rem .45rem; min-width: 0;
}
.swap-banner .steps li .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap-banner .steps .n {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 800; font-size: .72rem;
}
.swap-banner .steps li.now { color: var(--text); font-weight: 700; box-shadow: 0 0 0 2px var(--accent); }
.swap-banner .steps li.now .n { background: var(--accent); color: var(--accent-ink); }
.swap-banner .steps li.done .n { background: var(--go-fill); color: #fff; }
.swap-banner .say { flex: 1 1 auto; font-weight: 600; color: var(--accent); }
@media (max-width: 560px) { .swap-banner .steps li .t { display: none; } .swap-banner .steps li { justify-content: center; } }

.changes-now { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.chg { font-size: .8rem; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: .15rem .6rem; font-weight: 600; }

/* boat cards */
.boats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.boat-card {
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2);
  padding: 8px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.boat-card.pickable:hover { border-color: var(--muted); }
.boat-card.sel-a { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.boat-card.sel-b { border-color: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }
.boat-card.bench { border-style: dashed; }
.boat-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 2px 4px 8px; }
.boat-head strong { font-size: 1.02rem; }
.seats { display: flex; flex-direction: column; gap: 5px; }
.seat {
  display: flex; align-items: center; gap: .45rem; width: 100%; justify-content: flex-start;
  text-align: left; min-height: 44px; padding: .35rem .5rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}
.seat .seat-label { width: 46px; flex: 0 0 auto; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.seat .seat-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.empty .seat-name { color: var(--muted); font-style: italic; }
.seat.empty { border-style: dashed; }
.seat.hint { border-color: var(--accent); }
.boat-card.sel-b .seat.hint { border-color: var(--go); }
.seat.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seat.sel .seat-label { color: inherit; opacity: .85; }
.seat.moved { box-shadow: inset 4px 0 0 var(--warn); }
.seat.seat { }
.moved-tag { font-size: .66rem; font-weight: 800; text-transform: uppercase; color: var(--warn); letter-spacing: .04em; }
.seat.sel .moved-tag { color: inherit; }
.rec { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .08rem .45rem; white-space: nowrap; }
.rec.new { background: var(--surface-2); color: var(--muted); }
.rec.win { background: var(--go-soft); color: var(--go); }
.rec.loss { background: var(--stop-soft); color: var(--stop); }
.rec.even { background: var(--warn-soft); color: var(--warn); }
.pad { padding: 4px 6px; margin: 0; }

/* comparisons */
.comp { padding: 10px 0; border-top: 1px solid var(--line); }
.comp:first-of-type { border-top: 0; padding-top: 0; }
.comp .verdict { font-size: 1rem; margin: .15rem 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; }
.comp.big .verdict { font-size: 1.2rem; }
.comp .by { font-weight: 800; color: var(--go); }
.comp .verdict.mixed { font-size: .95rem; color: var(--warn); display: block; }
.standings table td, .standings table th { padding: .4rem .35rem; }

/* history */
.piece-hist { border-top: 1px solid var(--line); padding: 10px 0; }
.piece-hist:first-of-type { border-top: 0; padding-top: 0; }
.piece-hist summary { cursor: pointer; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; min-height: 36px; }
.piece-hist .changes { margin: .4rem 0; padding-left: 1.2rem; font-size: .88rem; color: var(--warn); }
.mini-lineups { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 10px; }
.mini { font-size: .82rem; background: var(--surface-2); border-radius: 9px; padding: 8px; }
.mini ol { list-style: none; margin: .3rem 0 0; padding: 0; }

/* setup */
.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.boat-picks { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.boat-picks legend { font-size: .85rem; color: var(--muted); font-weight: 600; padding: 0 4px; }
label.check { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; cursor: pointer; }
label.check input { width: 20px; height: 20px; min-height: 0; }
.list-row { padding: 6px 0; border-top: 1px solid var(--line); flex-wrap: nowrap; }
.list-row input.grow { min-width: 0; width: 100%; }
.list-row select { max-width: 150px; }
.add-row { margin-bottom: 8px; flex-wrap: nowrap; }
.add-row select { max-width: 150px; }
.other-sessions { margin-top: 14px; }
.other-sessions h3 { margin-bottom: 4px; }
.new-session, .paste { margin-top: 14px; }
.new-session summary, .paste summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.new-session .form-grid { margin-top: 8px; }
.paste textarea { margin: 8px 0; }
.add-boats { margin-top: 10px; }
.welcome { border-left: 6px solid var(--accent); margin-bottom: 14px; }
.welcome ol { margin: .5rem 0 .8rem; padding-left: 1.2rem; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .list-row, .add-row { flex-wrap: wrap; }
  .list-row input.grow { flex-basis: 100%; }
}

/* picker sheet */
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; background: rgba(5, 12, 22, .45);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
}
.sheet {
  width: min(560px, 100%); max-height: min(80vh, 640px); overflow: auto;
  background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
@media (min-width: 700px) { .modal { align-items: center; } }
.pick-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pick { justify-content: flex-start; font-weight: 500; }
.pick-add { margin-top: 14px; }

/* ===== timer screens (start + finish) ===== */
.timer-screen { max-width: 760px; margin: 0 auto; }
.timer-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 0 14px; }
.timer-head h1 { font-size: 2rem; }
.eyebrow { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.start-screen .eyebrow { color: var(--go); }
.finish-screen .eyebrow { color: var(--stop); }
.big-clock { font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; letter-spacing: .02em; }

.big-btn {
  width: 100%; min-height: clamp(150px, 30vh, 260px); border-radius: 22px; border: 0;
  display: flex; flex-direction: column; gap: .3rem; color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18), inset 0 -6px 0 rgba(0, 0, 0, .18);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform .06s ease, filter .06s ease;
}
.big-btn:active { transform: scale(.985); filter: brightness(1.08); }
.big-btn.go { background: var(--go-fill); }
.big-btn.stop { background: var(--stop-fill); }
.big-label { font-size: clamp(2.2rem, 10vw, 3.6rem); font-weight: 900; letter-spacing: .06em; line-height: 1; }
.big-sub { font-size: 1rem; font-weight: 600; opacity: .9; }
.all-started {
  min-height: 120px; border-radius: 22px; display: grid; place-items: center; text-align: center;
  background: var(--go-soft); color: var(--go); font-weight: 800; font-size: 1.3rem; padding: 16px;
}

.start-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.start-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.start-row.started { border-color: var(--go); }
.boat-id { flex: 1 1 auto; min-width: 0; }
.boat-id strong { font-size: 1.15rem; }
.lineup-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-btn {
  flex: 0 0 auto; width: 104px; min-height: 64px; border-radius: 14px; border: 0;
  background: var(--go-fill); color: #fff; font-size: 1.4rem; font-weight: 900; letter-spacing: .06em;
  user-select: none; -webkit-user-select: none;
}
.stat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stat .t { font-size: 1.5rem; font-weight: 800; }
.stat.done .t { color: var(--go); }
.foot { margin-top: 18px; gap: 12px; }

.on-course { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.oc { display: inline-flex; gap: .5rem; align-items: baseline; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: .35rem .8rem; font-weight: 700; }
.oc strong { color: var(--text); }

.finish-card { margin-top: 16px; }
.finish-list { list-style: none; margin: 8px 0 0; padding: 0; }
.finish-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.finish-row:first-child { border-top: 0; }
.finish-row .place { width: 42px; font-weight: 900; font-size: 1.1rem; }
.f-time { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.f-time strong { font-size: 1.35rem; }
.chip {
  min-height: 48px; padding: .4rem .9rem; border-radius: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 2px solid transparent;
  display: inline-flex; gap: .45rem; align-items: center;
}
.chip.none { background: var(--surface-2); color: var(--muted); }
.chip.target { border-color: var(--accent); border-style: dashed; }
.chip.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.del { min-width: 44px; }
.unfinished { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

body[data-role="start"] #app, body[data-role="finish"] #app { padding-bottom: 32px; }

/* steady layout: nothing jumps between taps */
.swap-banner .say-row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 700px) { .swap-banner .say { min-height: 2.9em; display: flex; align-items: center; } }
.on-course { min-height: 38px; align-items: center; }
th, td.num, td.r { white-space: nowrap; }
@media (hover: none) { .kbd-hint { display: none; } }

/* Installed as an app on a notched phone: clear the status bar. */
.topbar { padding-top: max(10px, env(safe-area-inset-top)); }

/* ---- positions: P S X C letters --------------------------------------- */
.abil { display: inline-flex; gap: 2px; flex: 0 0 auto; font-size: .7rem; font-weight: 800; line-height: 1; }
.abil b { display: inline-grid; place-items: center; width: 18px; height: 20px; border-radius: 5px; color: #fff; }
.abil .ab-P, .tg.ab-P.on { background: var(--port); }
.abil .ab-S, .tg.ab-S.on { background: var(--star); }
.abil .ab-X, .tg.ab-X.on { background: var(--scull); }
.abil .ab-C, .tg.ab-C.on { background: var(--cox); }
.abil.any { padding: 4px 6px; border-radius: 5px; background: var(--both); color: #fff; }
.abil.none { width: 18px; height: 20px; display: inline-grid; place-items: center; border-radius: 5px; border: 1px dashed var(--line); color: var(--muted); }
.seat.sel .abil b, .seat.sel .abil.any { box-shadow: 0 0 0 1px rgba(255,255,255,.6); }

/* seat side letter beside the seat name: P / S / X */
.seat .seat-label { width: 62px; display: inline-flex; align-items: center; gap: 4px; }
.seat-side { font-style: normal; font-size: .62rem; font-weight: 900; padding: 1px 4px; border-radius: 4px; letter-spacing: 0; }
.ss-P { color: var(--port); background: var(--stop-soft); }
.ss-S { color: var(--star); background: var(--go-soft); }
.ss-X { color: var(--scull); background: var(--scull-soft); }
.seat.sel .seat-side { background: rgba(255,255,255,.2); color: inherit; }
.seat.misfit { border-color: var(--warn); border-style: dashed; background: var(--warn-soft); }
.misfit-tag { color: var(--warn); font-weight: 900; }

/* position toggles (P S X C Any) and attendance toggles */
.can-toggles, .attend-toggle { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.tg {
  min-height: 34px; min-width: 34px; padding: 0 .45rem; font-size: .8rem; font-weight: 800;
  border-radius: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.tg.on { color: #fff; border-color: transparent; }
.tg.any.on { background: var(--both); }
.attend-toggle .tg { font-weight: 700; padding: 0 .6rem; }
.attend-toggle .tg.here.on { background: var(--go-fill); }
.attend-toggle .tg.away.on { background: var(--stop-fill); }
.attend-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.away-row .grow { color: var(--muted); text-decoration: line-through; }
.add-rower { margin-bottom: 8px; }
.add-rower .add-row { margin-bottom: 6px; }
.can-row { gap: 8px; }
.rower-row { flex-wrap: wrap; }
.rower-row input.grow { flex: 1 1 160px; }
.filters { gap: 6px; margin: 12px 0 4px; }
.fchip { min-height: 34px; padding: .2rem .7rem; border-radius: 999px; font-size: .82rem; }
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.legend { margin: 2px 0 6px; }
.rower-view { margin: 12px 0 0; max-width: 320px; }
select.rig { max-width: 170px; }
.away { padding: 6px 4px 0; }
.pick-h { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; }

/* ---- start controls: mode toggle, coach start card --------------------- */
.mode-toggle {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px;
}
.mode-toggle button { border: 0; background: transparent; min-height: 36px; padding: 0 .8rem; font-size: .85rem; color: var(--muted); border-radius: 8px; }
.mode-toggle button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.start-mode { display: flex; justify-content: center; margin: -4px 0 12px; }
.coach-start .card-head { margin-bottom: 10px; }
.coach-start-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.mid-btn {
  flex: 0 0 auto; min-width: 200px; min-height: 76px; border-radius: 16px; border: 0; color: #fff;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 18px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); user-select: none; -webkit-user-select: none;
}
.mid-btn.go { background: var(--go-fill); }
.mid-label { font-size: 1.35rem; font-weight: 900; letter-spacing: .05em; }
.mid-sub { font-size: .85rem; font-weight: 600; opacity: .9; }
.small-all { min-height: 76px; font-size: 1rem; flex: 1 1 200px; border-radius: 16px; }
.go-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 240px; }
.go-chip { min-height: 40px; border-radius: 10px; font-weight: 800; color: var(--go); background: var(--go-soft); border-color: transparent; user-select: none; -webkit-user-select: none; }
.started-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.started-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 0 0 .7rem; }
.started-chip strong { color: var(--text); }
/* phones: the Race tab's columns never grow wider than the screen (the piece
   table scrolls inside its card); the mode buttons, START and the GO chips
   shrink to fit the Start card, and long labels wrap */
.race-grid > * { min-width: 0; }
.coach-start .card-head .mode-toggle { min-width: 0; max-width: 100%; }
.mid-btn, .go-chip, .started-chip { max-width: 100%; }
.mid-sub { overflow-wrap: anywhere; }

/* ---- Finish piece (top right) and the stopped state --------------------- */
.top-stop:empty { display: none; }
.stop-btn { white-space: nowrap; font-weight: 800; }
.stop-btn:not(.armed) { color: var(--stop); background: var(--stop-soft); border-color: transparent; }
.stopped-panel {
  min-height: clamp(150px, 30vh, 260px); border-radius: 22px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center;
  background: var(--surface-2); border: 2px dashed var(--line);
}
.stopped-panel strong { font-size: 1.4rem; }
.stopped-panel span { color: var(--muted); }
.dnf { color: var(--stop); font-weight: 800; }
table.results tr.st-dnf td { color: var(--muted); }
@media (max-width: 420px) {
  .topbar:has(.top-stop:not(:empty)) .top-title { display: none; }
  .stop-btn { padding: .3rem .55rem; }
}

/* ---- screen buttons row (+ Finish piece) ---------------------------------- */
.role-row { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.role-row .roles { flex: 1 1 auto; margin: 0; }
.role-row .stop-btn { min-height: 50px; }

/* ---- Finish phone while timing: everything below the buttons is FINISH ---- */
body[data-mode="timing"] .topbar { display: none; }
body[data-mode="timing"] #app {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-bottom: 12px;
  padding-top: env(safe-area-inset-top);
}
body[data-mode="timing"] #view { flex: 1 1 auto; display: flex; min-height: 0; }
/* the red area: the FINISH button (.fz-tap) fills it; with two or more boats
   on the course, their names sit below it to drag (see the end of this file) */
.finish-zone {
  flex: 1 1 auto; width: 100%; min-height: 320px; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: stretch;
  border-radius: 24px; color: #fff; background: var(--stop-fill); text-align: center;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18), 0 10px 30px rgba(0, 0, 0, .2);
  user-select: none; -webkit-user-select: none; overflow: hidden;
}
.fz-tap {
  flex: 1 1 auto; width: 100%; min-height: 0; margin: 0; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 0; color: inherit; background: var(--stop-fill); text-align: center; font-weight: inherit;
  touch-action: manipulation; cursor: pointer; transition: filter .08s ease, transform .08s ease;
}
.finish-zone:not(.has-list) .fz-tap { box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18); }
.fz-tap:focus-visible { outline-offset: -6px; }
.fz-tap * { pointer-events: none; }            /* taps on anything inside still hit the button */
.fz-tap:active, .finish-zone.flash .fz-tap { filter: brightness(1.18); }
.finish-zone:not(.has-list) .fz-tap:active, .finish-zone.flash:not(.has-list) .fz-tap { transform: scale(.995); }
.fz-top { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; opacity: .95; }
.fz-clock { font-size: 1.15rem; font-weight: 800; }
.fz-status { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(0, 0, 0, .18); }
.fz-status.bad { background: #fff; color: var(--stop-fill); }
.fz-label { font-size: clamp(3rem, 16vw, 6rem); font-weight: 900; letter-spacing: .06em; line-height: 1; margin-top: auto; }
.fz-sub { font-size: 1rem; font-weight: 600; opacity: .95; }
.fz-course { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fz-oc { background: rgba(0, 0, 0, .2); border-radius: 999px; padding: .3rem .75rem; font-weight: 700; }
.fz-recent { display: flex; flex-direction: column; gap: 4px; width: min(420px, 100%); margin-top: 4px; }
.fz-row { display: grid; grid-template-columns: 3rem 1fr auto; gap: 8px; align-items: baseline; background: rgba(0, 0, 0, .16); border-radius: 10px; padding: .35rem .7rem; }
.fz-row:first-child { background: rgba(255, 255, 255, .22); }
.fz-place { font-weight: 900; text-align: left; }
.fz-time { font-size: 1.15rem; font-weight: 800; text-align: left; }
.fz-boat { font-weight: 700; }
.fz-foot { font-size: .78rem; opacity: .85; margin-top: auto; }

/* review after the piece */
.review-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  background: var(--go-soft); color: var(--go); font-weight: 700;
}
.review-bar span { flex: 1 1 200px; }
.review-next { text-align: center; margin: 14px 0 4px; }

/* ---- Results screen ------------------------------------------------------- */
.results-view > .card { margin-bottom: 14px; }
.winner-card .card-head { margin-bottom: 6px; }
.winner { padding: 12px 0; border-top: 1px solid var(--line); text-align: center; }
.winner:first-of-type { border-top: 0; }
.w-kicker { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--go); margin-top: 4px; }
.w-name { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 900; line-height: 1.1; }
.w-by { font-size: 1.15rem; margin: 4px 0; }
.w-by .by { font-weight: 900; color: var(--go); }
.winner.tie .w-by { color: var(--warn); font-weight: 800; }
/* Phones: Finish piece gets its own full-width row under the screen buttons. */
.top-stop { flex: 0 0 auto; }
@media (max-width: 560px) {
  .role-row { flex-wrap: wrap; }
  .role-row .roles { flex: 1 1 100%; }
  .top-stop { flex: 1 1 100%; }
  .top-stop .stop-btn { width: 100%; min-height: 46px; }
  .roles button { padding-left: .3rem; padding-right: .3rem; }
}

/* ---- Start phone: everything below the buttons starts the next boat ------ */
body[data-mode="timing"] .start-screen { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; max-width: none; margin: 0; }
.start-screen .start-mode { margin: 0 0 10px; }
.start-zone {
  flex: 1 1 auto; min-height: 320px; padding: 16px; border-radius: 24px; color: #fff; background: var(--go-fill);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18), 0 10px 30px rgba(0, 0, 0, .2);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; overflow: hidden;
  transition: filter .08s ease, transform .08s ease; outline-offset: 4px;
}
.start-zone * { pointer-events: none; }          /* a tap on anything inside still starts... */
.start-zone .sz-undo { pointer-events: auto; }   /* ...except the Undo buttons */
.start-zone:active, .start-zone.flash { filter: brightness(1.12); transform: scale(.995); }
.start-zone.done { background: var(--go-soft); color: var(--go); cursor: default; box-shadow: none; border: 2px solid var(--go); }
.start-zone.done:active { filter: none; transform: none; }
.sz-top { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.sz-clock { font-size: 1.15rem; font-weight: 800; }
.start-zone .fz-status { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(0, 0, 0, .18); }
.start-zone.done .fz-status { background: var(--surface); }
.sz-label { font-size: clamp(2.6rem, 13vw, 5rem); font-weight: 900; letter-spacing: .05em; line-height: 1; margin-top: auto; }
.start-zone.done .sz-label { font-size: clamp(1.5rem, 7vw, 2.4rem); }
.sz-sub { font-size: 1.05rem; font-weight: 700; opacity: .95; }
.sz-list { display: flex; flex-direction: column; gap: 5px; width: min(460px, 100%); margin-top: auto; min-height: 0; }
.sz-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px;
  padding: .3rem .4rem .3rem .75rem; border-radius: 10px; background: rgba(0, 0, 0, .16); text-align: left;
}
.start-zone.done .sz-row { background: var(--surface); color: var(--text); }
.sz-row.next { background: rgba(255, 255, 255, .28); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.sz-type { font-size: .75rem; opacity: .8; }
.sz-wait { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.sz-run { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.sz-done { font-weight: 800; }
.sz-undo { background: #fff; color: var(--stop-fill); border-color: transparent; min-height: 34px; }
.start-zone.done .sz-undo { background: var(--stop-soft); color: var(--stop); }

/* ---- boat sizes kept apart ------------------------------------------------ */
.size-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 14px 0 4px; }
.size-h:first-of-type { margin-top: 2px; }
table.results tr.group-row td { background: var(--surface-2); font-weight: 800; font-size: .85rem; padding-top: .4rem; padding-bottom: .4rem; }
.size-block + .size-block { margin-top: 6px; }
.totals tr.partial td { color: var(--muted); }

/* per-switch totals + GMT */
.switch-wrap { margin: 8px -4px 6px; }
table.switch-table th, table.switch-table td { padding: .35rem .4rem; font-size: .88rem; }
table.switch-table tr.lead td:first-child strong { color: var(--go); }
.winner .switch-wrap { max-width: 560px; margin-left: auto; margin-right: auto; }
.winner table.switch-table { text-align: left; }
td.pct { color: var(--accent); font-weight: 700; }
.gmt-dist { max-width: 220px; margin: 6px 0 8px; }
.gmt-class { min-width: 90px; }

/* Squads: a men's or a women's crew, each measured against its own gold medal
   time. Teal for men, magenta for women, purple for mixed (2.1.27), and always
   the word with the colour. */
:root { --squad-m: #08806f; --squad-m-soft: #d7f2ee; --squad-w: #c2255c; --squad-w-soft: #fbe0ea; --squad-x: #6741d9; --squad-x-soft: #e9e3fc; --squad-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --squad-m: #3fcbb7; --squad-m-soft: #0f3a35; --squad-w: #ff6fa0; --squad-w-soft: #45162a; --squad-x: #b197fc; --squad-x-soft: #2a2047; --squad-ink: #0a111d; }
}
:root[data-theme="dark"] { --squad-m: #3fcbb7; --squad-m-soft: #0f3a35; --squad-w: #ff6fa0; --squad-w-soft: #45162a; --squad-x: #b197fc; --squad-x-soft: #2a2047; --squad-ink: #0a111d; }
.squad-word.squad-m { color: var(--squad-m); font-weight: 800; }
.squad-word.squad-w { color: var(--squad-w); font-weight: 800; }
.squad-tag { display: inline-block; font-size: .7rem; font-weight: 800; line-height: 1; padding: .2rem .4rem; border-radius: 6px; vertical-align: middle; }
.squad-tag.squad-m { background: var(--squad-m); color: var(--squad-ink); }
.squad-tag.squad-w { background: var(--squad-w); color: var(--squad-ink); }
.squad-toggle { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.squad-chip { font: inherit; font-size: .8rem; font-weight: 700; padding: .25rem .6rem; min-height: 32px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.squad-chip.squad-m:not(.on):hover { color: var(--squad-m); background: var(--squad-m-soft); }
.squad-chip.squad-w:not(.on):hover { color: var(--squad-w); background: var(--squad-w-soft); }
.squad-chip.squad-m.on { background: var(--squad-m); color: var(--squad-ink); }
.squad-chip.squad-w.on { background: var(--squad-w); color: var(--squad-ink); }
.squad-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.gmt-table { width: 100%; border-collapse: collapse; }
table.gmt-table th, table.gmt-table td { padding: .35rem .4rem; text-align: left; vertical-align: middle; }
table.gmt-table th { font-size: .78rem; font-weight: 700; white-space: nowrap; }
table.gmt-table th.squad-head { font-size: .95rem; text-align: center; border-bottom: 3px solid currentColor; }
table.gmt-table th.squad-m { color: var(--squad-m); }
table.gmt-table th.squad-w { color: var(--squad-w); }
table.gmt-table td.squad-m { background: color-mix(in srgb, var(--squad-m-soft) 60%, transparent); }
table.gmt-table td.squad-w { background: color-mix(in srgb, var(--squad-w-soft) 60%, transparent); }
table.gmt-table tbody tr { border-top: 1px solid var(--line); }
.squad-word.squad-x { color: var(--squad-x); font-weight: 800; }
.squad-tag.squad-x { background: var(--squad-x); color: var(--squad-ink); }
.squad-chip.squad-x:not(.on):hover { color: var(--squad-x); background: var(--squad-x-soft); }
.squad-chip.squad-x.on { background: var(--squad-x); color: var(--squad-ink); }
table.gmt-table th.squad-x { color: var(--squad-x); }
table.gmt-table td.squad-x { background: color-mix(in srgb, var(--squad-x-soft) 60%, transparent); }
table.gmt-table input { width: 96px; min-width: 88px; }
table.gmt-table input:disabled { opacity: .55; }
.gmt-add { margin-top: 8px; }
.gmt-add select { max-width: 260px; }

/* Fold a long card or block to one line (▸ / ▾), remembered per card. */
.fold-btn { font: inherit; font-size: 1rem; line-height: 1; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; flex: 0 0 auto; }
.fold-btn:hover { border-color: var(--muted); }
.fold-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fold-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.oc-order.folded { padding: 6px 10px; }
.oc-order.folded .oc-head { margin-bottom: 0; flex-wrap: nowrap; align-items: center; }
.card.history.folded .card-head { margin-bottom: 0; flex-wrap: nowrap; align-items: center; gap: 8px; }
.card.history .card-head { gap: 8px; }

/* The gold medal time on each lineup card, and the larger board (the default;
   "Smaller / Larger" in the board's header, kept in rs.sr.lineupSize). */
.boat-gmt { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding: 0 4px 8px; }
.boat-gmt .num { font-weight: 700; }
.boat-gmt .linkish { font-size: inherit; padding: 0; }
.size-toggle button { font-size: .8rem; }
.lineup-card.size-large .boats { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.lineup-card.size-large .boat-head strong { font-size: 1.25rem; }
.lineup-card.size-large .boat-gmt { font-size: .95rem; }
.lineup-card.size-large .seats { gap: 7px; }
.lineup-card.size-large .seat { min-height: 56px; font-size: 1.2rem; padding: .45rem .65rem; gap: .55rem; }
.lineup-card.size-large .seat .seat-label { width: 78px; font-size: .86rem; }
.lineup-card.size-large .seat-side { font-size: .74rem; }
.lineup-card.size-large .seat .seat-name { min-width: 5em; }

/* ---- seat race plan --------------------------------------------------------- */
.lineup-card.planning { border-color: var(--both); box-shadow: 0 0 0 3px color-mix(in srgb, var(--both) 25%, transparent); }
.lineup-card.planning .boat-card { border-style: dashed; }
.plan-piece { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 700; }
.plan-piece select { min-height: 36px; padding: .2rem .5rem; }
.plan-say { margin: -4px 0 10px; color: var(--both); }
.plan-due { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-step { padding: 10px 0; border-top: 1px solid var(--line); }
.plan-step:first-child { border-top: 0; }
.plan-step.done { opacity: .7; }
.plan-swaps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.plan-swap { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .4rem .2rem .7rem; font-weight: 600; font-size: .9rem; }
.plan-swap .linkish { color: var(--stop); padding: 0 .3rem; }

/* ---- changed rowers: yellow once, fully coloured when changed twice -------- */
.seat.moved { box-shadow: inset 5px 0 0 var(--warn); background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); }
.seat.moved2 { background: var(--warn); border-color: var(--warn); color: #1d1300; box-shadow: none; }
.seat.moved2 .seat-label, .seat.moved2 .moved-tag { color: #1d1300; }
.seat.moved2 .seat-side { background: rgba(0, 0, 0, .15); color: #1d1300; }
.moved-tag {
  display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
  padding: .1rem .4rem; border-radius: 999px; border: 1px solid currentColor;
}
.moved-tag .x { font-size: .7rem; opacity: .8; }
.moved-tag:hover, .moved-tag:focus-visible { background: var(--warn); color: #1d1300; outline: none; }
.seat.moved2 .moved-tag:hover { background: #1d1300; color: var(--warn); }
.seat.sel.moved, .seat.sel.moved2 { background: var(--accent); color: var(--accent-ink); }
.moved-tag { font-size: .6rem; padding: .05rem .3rem; gap: 2px; flex: 0 0 auto; white-space: nowrap; }
.seat .seat-name { min-width: 4.5em; }

/* ---- Start phone: tap area above, draggable start order below ------------- */
.start-zone { padding: 0; gap: 0; cursor: default; }
.sz-tap {
  flex: 1 1 auto; width: 100%; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; touch-action: manipulation; min-height: 180px;
}
.start-zone.done .sz-tap { cursor: default; }
.sz-tap * { pointer-events: none; }
.sz-tap:active { filter: brightness(1.12); }
.start-zone:active { filter: none; transform: none; }
.start-zone.flash .sz-tap { filter: brightness(1.15); }
.sz-tap .sz-label { margin-top: auto; }
.sz-tap .sz-sub { margin-bottom: auto; }
.sz-list-head {
  width: 100%; padding: 6px 16px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(0, 0, 0, .2); text-align: left;
}
.start-zone.done .sz-list-head { background: var(--surface-2); color: var(--muted); }
.start-zone .sz-list { width: 100%; padding: 8px 10px 10px; margin: 0; background: rgba(0, 0, 0, .12); }
.start-zone.done .sz-list { background: transparent; }
.start-zone .sz-list * { pointer-events: auto; }
.sz-row.dragok { cursor: grab; touch-action: none; }
.grip { font-weight: 900; letter-spacing: -2px; opacity: .75; margin-right: 2px; }

/* dragging (start order and finish order) */
.is-dragging > * { transition: transform .15s ease; }
.is-dragging > .dragging { transition: none; z-index: 5; position: relative; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); cursor: grabbing; }
.sz-row.dragging { background: rgba(255, 255, 255, .35); }
.finish-row.dragging { background: var(--surface); border-radius: 12px; }
.finish-row .chip { touch-action: none; cursor: grab; }
.finish-row .chip::before { content: "⋮⋮"; letter-spacing: -2px; opacity: .6; margin-right: 4px; font-weight: 900; }
.start-zone .sz-tap { pointer-events: auto; }

/* ---- start groups ------------------------------------------------------------ */
.group-builder { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.coach-start .group-builder { margin: 0 0 12px; background: var(--surface-2); }
.gb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gb-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gb-groups li { display: flex; align-items: center; gap: 8px; background: var(--go-soft); color: var(--go); border-radius: 8px; padding: .3rem .5rem; font-weight: 700; }
.gb-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--go-fill); color: #fff; font-size: .75rem; font-weight: 900; flex: 0 0 auto; }
.gb-names { flex: 1 1 auto; }
.gb-groups .linkish { color: var(--stop); }
.gb-new { display: flex; flex-direction: column; gap: 8px; }
.gb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gb-chip { min-height: 40px; border-radius: 10px; font-weight: 700; }
.gb-chip.on { background: var(--go-fill); border-color: var(--go-fill); color: #fff; }
.sz-group { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; }
.sz-group + .sz-group { margin-top: 4px; }
.sz-group.next { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.sz-group-h { font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .9; padding: 0 4px; text-align: left; }
.start-zone.done .sz-group.next { background: transparent; box-shadow: none; }

/* grouping on the phone: New group, then tap boat names in the list */
.group-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.group-bar button { min-height: 44px; }
.start-zone.building .sz-tap { cursor: default; opacity: .85; }
.start-zone.building .sz-label { font-size: clamp(2rem, 10vw, 3.4rem); }
.sz-group.free.picking { background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55) inset; }
.sz-row.pick { cursor: pointer; }
.sz-row.pick.on { background: #fff; color: var(--go-fill); }
.sz-row.pick.on .sz-wait { color: var(--go-fill); }
.sz-group-h { display: flex; justify-content: space-between; align-items: center; }
.sz-group-h .gx { color: inherit; opacity: .85; padding: 0 .4rem; min-height: 0; }

/* folded start groups: one line each */
.sz-gline {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: .3rem .5rem;
  border-radius: 10px; background: rgba(0, 0, 0, .16); text-align: left;
}
.sz-gline + .sz-gline { margin-top: 5px; }
.sz-gline.next { background: rgba(255, 255, 255, .28); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.sz-gline.done { opacity: .75; }
.sz-gline.solo .gl-n { background: transparent; border: 1px solid currentColor; }
.gl-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .25); font-size: .75rem; font-weight: 900; flex: 0 0 auto; }
.gl-names { flex: 1 1 auto; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-st { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.gl-st.num { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.start-zone.done .sz-gline { background: var(--surface); color: var(--text); }
.sz-gline .gx { color: inherit; padding: 0 .3rem; min-height: 0; }
.finish-row .chip, .sz-row.dragok { user-select: none; -webkit-user-select: none; }
.plan-step-nav { display: inline-flex; align-items: center; gap: 4px; }
.plan-step-nav .btn-sm { min-width: 36px; font-size: 1.1rem; }

/* ---- which planned piece (Start / Finish phones) ------------------------------ */
.piece-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; }
.pb-text { flex: 1 1 200px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .9rem; }
.pb-n { font-weight: 900; color: var(--accent); }
.pb-move strong { font-weight: 800; }
.piece-bar.editing { flex-direction: column; align-items: stretch; }
.pb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pb-options { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.pb-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font-weight: 500; padding: .5rem .7rem; }
.pb-opt > span:not(.pb-n) { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .88rem; }
.pb-opt.current { border-style: dashed; }
.pb-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pb-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.pb-confirm span { flex: 1 1 180px; font-weight: 700; }
body[data-mode="timing"] .finish-timing { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.finish-timing .piece-bar { margin-bottom: 8px; }

/* a switched or dragged boat name: its row flashes so you can follow it */
@keyframes rs-swapflash { 0% { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); } 100% { background: transparent; box-shadow: none; } }
.finish-row.swapped { animation: rs-swapflash .9s ease-out; border-radius: 10px; }
.finish-row.swapped .chip { box-shadow: 0 0 0 2px var(--accent); }
.sz-gline.dragok { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.sz-gline.dragging { background: rgba(255, 255, 255, .35); }
.is-dragging > .sz-gline { transition: transform .15s ease; }
.sz-gline + .sz-gline.dragging, .is-dragging > .sz-gline + .sz-gline { margin-top: 5px; }

/* top-left: back to the Coaching home screen */
.topbar .home { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; color: var(--accent); }
.home-back { font-size: 1.8rem; font-weight: 700; line-height: 1; margin-top: -3px; }

/* piece notes */
.piece-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.piece-notes textarea { min-height: 54px; font-size: .95rem; }
.piece-note-text { white-space: pre-wrap; font-style: italic; color: var(--muted); margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--line); }

/* ---- Start phone: which piece ("Piece 3 ▾"), across from Clear groups ------- */
.start-screen .start-mode { flex-wrap: wrap; align-items: center; gap: 8px; }
.piece-switch { margin-left: auto; white-space: nowrap; font-weight: 800; min-height: 40px; }

.piece-switch .ps-caret { font-size: .8em; opacity: .7; }
.piece-switch.rerun { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.group-bar .gb-hint { flex: 1 1 auto; min-width: 0; }
.piece-sheet .ps-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ps-row { justify-content: space-between; text-align: left; font-weight: 500; background: var(--surface); }
.ps-row strong { font-size: 1.05rem; }
.ps-st { color: var(--muted); font-size: .88rem; }
.ps-row.on { border-color: var(--go); box-shadow: 0 0 0 2px var(--go) inset; }
.ps-row.on .ps-st { color: var(--go); font-weight: 700; }
.ps-row.asking { border-color: var(--warn); }
.ps-confirm { background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; }
.ps-confirm p { margin: 0 0 8px; }
@media (max-width: 480px) { .group-bar .gb-hint { display: none; } }
/* Long boat names in a folded group line used to force the whole Start
   screen wider than a phone (the page then zoomed out or slid sideways). */
.start-screen, .finish-screen { min-width: 0; }
@media (max-width: 400px) {
  .group-bar { gap: 6px; }
  .group-bar button { padding-left: .7rem; padding-right: .7rem; }
}

/* ==== Start phone fits every screen ==========================================
   The green area takes the space that is left. The START part keeps room for
   its words; the boat list shrinks and scrolls inside when it runs out of room
   (a finger on a name swipes it, the ⋮⋮ grip drags). */
body[data-mode="timing"] .start-zone { min-height: 0; }
/* START keeps about a third of the screen, never less than 150 px */
.start-zone .sz-tap { min-height: 150px; min-height: clamp(150px, 32vh, 260px); flex: 1 1 auto; }
.start-zone .sz-list {
  flex: 0 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.start-zone .sz-list.scrolls { box-shadow: inset 0 -16px 14px -14px rgba(0, 0, 0, .45); }
.sz-list.scrolls .dragok { touch-action: pan-y; cursor: default; }
.sz-list.scrolls .grip {
  touch-action: none; cursor: grab; opacity: 1;
  padding: 10px 12px 10px 8px; margin: -10px -4px -10px -8px;
}
.sz-list-head { flex: 0 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the top line stays on one row */
.sz-top { flex-wrap: nowrap; }
.sz-top > span { white-space: nowrap; flex: 0 0 auto; }
.sz-top > span:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }

/* big words scale with the screen's width and height */
.sz-label { font-size: clamp(2rem, min(10.5vw, 8.5vh), 5rem); }
.sz-label.long { font-size: clamp(1.7rem, min(8.4vw, 7vh), 4.2rem); }
.start-zone.done .sz-label { font-size: clamp(1.4rem, min(6.5vw, 5vh), 2.4rem); }
.start-zone.building .sz-label { font-size: clamp(1.7rem, min(8.4vw, 7vh), 3.4rem); }
.sz-sub { font-size: clamp(.85rem, 3.9vw, 1.05rem); }

/* mode buttons and Piece ▾ share one row; long labels wrap onto two lines */
.start-screen .start-mode { flex-wrap: nowrap; justify-content: center; }
.start-screen .start-mode .mode-toggle { flex: 0 1 auto; min-width: 0; }
.start-screen .start-mode .piece-switch { flex: 0 0 auto; margin-left: 0; }

/* messages show at the top while timing, never over START, FINISH or the list */
body[data-mode="timing"] #rs-toast { top: calc(env(safe-area-inset-top) + 8px); bottom: auto; transform: translate(-50%, -160%); }
body[data-mode="timing"] #rs-toast.show { transform: translate(-50%, 0); }

@media (max-width: 400px) {
  .start-zone .sz-tap { padding: 12px 12px 14px; gap: 6px; }
  .sz-top { font-size: .8rem; gap: 6px; }
  .sz-clock { font-size: 1rem; }
  .start-zone .fz-status { font-size: .72rem; padding: .12rem .45rem; }
  .fz-detail { display: none; }
  .mode-toggle button { padding: 0 .45rem; font-size: .82rem; }
  .sz-list-head { padding: 5px 12px; font-size: .7rem; }
  .start-zone .sz-list { padding: 6px 8px 8px; }
}
@media (max-height: 700px) {
  body[data-mode="timing"] .roles { margin: 8px 0; }
  body[data-mode="timing"] .roles button { min-height: 38px; }
  .start-screen .start-mode, .start-screen .group-bar, .start-screen .piece-bar { margin-bottom: 8px; }
  .start-zone .sz-tap { padding-top: 10px; padding-bottom: 12px; gap: 6px; }
  .start-zone .sz-row, .start-zone .sz-gline { min-height: 36px; }
}
/* phone on its side: START on the left, the boat list on the right */
@media (orientation: landscape) and (max-height: 500px) {
  body[data-mode="timing"] .start-zone {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch; justify-items: stretch;
  }
  .start-zone .sz-tap { grid-column: 1; grid-row: 1 / span 2; min-height: 0; }
  .start-zone .sz-list-head { grid-column: 2; grid-row: 1; }
  .start-zone .sz-list { grid-column: 2; grid-row: 2; min-height: 0; }
  body[data-mode="timing"] .roles { margin: 6px 0; }
  body[data-mode="timing"] .roles button { min-height: 34px; }
  .fz-detail { display: none; }
}
@media (max-width: 340px) {
  .mode-toggle button { font-size: .74rem; padding: 0 .3rem; }
  .start-screen .piece-switch { padding: 0 .55rem; }
}
/* New group · Clear groups · Piece ▾ stay on one row on phones */
@media (max-width: 400px) {
  .start-screen .group-bar button { font-size: .88rem; padding-left: .5rem; padding-right: .5rem; white-space: nowrap; }
}
@media (max-width: 340px) {
  .start-screen .group-bar button { font-size: .8rem; padding-left: .45rem; padding-right: .45rem; }
}

/* head to head: the rower ahead first, then won–lost and average time */
table.h2h-table td, table.h2h-table th { white-space: nowrap; }
.h2h-who strong, .h2h-vs { display: block; }
.h2h-vs { font-size: .88rem; }
.h2h-lead { color: var(--go); }
/* the results columns may shrink below their tables (tables scroll inside) */
.results-grid > div { min-width: 0; }

/* ==== Every screen fits the screen ===========================================
   The page is exactly as tall as the screen. The title bar and the tabs stay
   put; the screen's content scrolls inside #view (on a laptop or TV, each
   column scrolls on its own). Used by Seat Racing, Erg Results and Rower Stats. */
body { padding-bottom: 0; }
#app {
  display: flex; flex-direction: column;
  height: 100vh; height: var(--app-h, 100vh); height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
#app > .topbar, #app > .roles { flex: none; }
#app > .roles { margin: 10px 0 8px; }
#view {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 0 16px 24px;
}
body[data-mode="timing"] #app { height: 100vh; height: var(--app-h, 100vh); height: 100dvh; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
body[data-mode="timing"] #view { overflow: hidden; padding-bottom: 0; }
body[data-role="start"] #app, body[data-role="finish"] #app { padding-bottom: env(safe-area-inset-bottom); }
body[data-role="start"][data-mode="timing"] #app, body[data-role="finish"][data-mode="timing"] #app { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* Coach: Race / Results / Setup stay at the top while the tab scrolls */
.subtabs-bar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 15;
  margin: 0 -16px; padding: 2px 16px 8px; background: var(--bg);
}
.subtabs-bar .subtabs { margin: 0; }
.tab-body { padding-top: 4px; }

/* Finish review: Undo stop / Back to timing stays at the top */
.finish-screen .review-bar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding-top: 6px; padding-bottom: 6px;
}

/* sheets: never taller than the screen; their title and Close stay put */
.sheet, .sheet-card { max-height: min(80vh, 640px); max-height: min(calc(var(--app-h, 100vh) - 32px), 640px); max-height: min(calc(100dvh - 32px), 640px); }
/* 3.0.18: Rowing Coach's crews into the session's boats */
.crews-list { display: flex; flex-direction: column; gap: 8px; }
.crew-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.crew-row.warn { box-shadow: inset 4px 0 0 #f26b1d; background: rgba(242, 107, 29, .1); }
.crew-row.bad { box-shadow: inset 4px 0 0 #d7263d; background: rgba(215, 38, 61, .1); }
.crew-main { flex: 1 1 auto; min-width: 0; }
.crew-act { display: flex; flex-direction: column; gap: 6px; flex: none; }
.crew-note.warn { color: #f26b1d; }
.crew-note.bad { color: #d7263d; }
.sheet > .card-head:first-child {
  position: -webkit-sticky; position: sticky; top: -16px; z-index: 2;
  margin: -16px -16px 12px; padding: 16px 16px 10px; background: var(--surface);
}

/* Laptop and TV: each column of a coach tab scrolls on its own */
@media (min-width: 1000px) {
  .coach { display: flex; flex-direction: column; height: 100%; }
  #view.has-panes { padding-bottom: 0; }
  .coach > .subtabs-bar { position: static; flex: none; }
  .coach > .tab-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: 6px; }
  .tab-body > .race-grid, .tab-body > .tab-stack { flex: 1 1 auto; min-height: 0; }
  .tab-stack { display: flex; flex-direction: column; }
  .tab-stack > .results-grid, .tab-stack > .setup-grid { flex: 1 1 auto; min-height: 0; }
  .tab-body .race-grid, .tab-body .results-grid, .tab-body .setup-grid { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .tab-body .race-grid > *, .tab-body .results-grid > *, .tab-body .setup-grid > * {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 20px 2px; margin-right: -6px;
    scrollbar-width: thin;
  }
}

/* The Results screen (a laptop, or a TV at the dock): columns side by side,
   each scrolling on its own, and nothing to scroll by hand on a TV */
body[data-role="results"] #app { max-width: none; }
/* one column on a phone: a wide table scrolls inside its card instead of
   pushing the column past the screen edge */
.rv-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.rv-col > * + * { margin-top: 14px; }
.rv-grid.cols-2, .rv-grid.cols-3 { height: 100%; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.rv-grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rv-grid.cols-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); }
.rv-grid.cols-2 > .rv-col, .rv-grid.cols-3 > .rv-col {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 20px 2px; scrollbar-width: thin;
}
#view.has-panes { padding-bottom: 0; }
.rv-wrap.wide { height: 100%; display: flex; flex-direction: column; }
.rv-wrap.wide > .rv-grid { flex: 1 1 auto; min-height: 0; }
.rv-wrap > .toolbar { flex: none; }

/* ---- Single start: one boat on the course at a time ------------------------ */
/* four start modes: on a phone the buttons share the row evenly and the
   longer labels wrap onto two short lines */
.mode-toggle.start-modes button { line-height: 1.1; padding-top: 2px; padding-bottom: 2px; }
@media (max-width: 480px) {
  .mode-toggle.start-modes button { padding-left: .35rem; padding-right: .35rem; font-size: .8rem; }
}
@media (max-width: 340px) {
  .mode-toggle.start-modes button { padding-left: .2rem; padding-right: .2rem; font-size: .72rem; }
}
/* Start phone while a boat is out: START waits (amber), with its clock */
.start-zone.waiting { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.start-zone.waiting .sz-list-head { color: var(--warn); }
.start-zone.waiting .sz-label { letter-spacing: .01em; line-height: 1.15; }
.sz-wait-clock { font-size: clamp(2rem, min(11vw, 8vh), 3.6rem); font-weight: 900; line-height: 1; color: var(--text); }
.start-zone.waiting .sz-tap .sz-sub { margin-bottom: 0; color: var(--text); }
.start-zone .sz-anyway { pointer-events: auto; margin-bottom: auto; min-height: 40px; }
.start-zone .sz-anyway:not(.armed) { background: var(--surface); color: var(--warn); border-color: var(--warn); }
.start-zone.waiting .sz-row.next { background: var(--surface); box-shadow: 0 0 0 2px var(--warn); }
/* coach Start card: START off while a boat is out */
.mid-btn.wait { background: var(--warn-soft); color: var(--warn); box-shadow: none; border: 2px solid var(--warn); cursor: default; }
.mid-btn.wait .mid-label { font-size: 1.05rem; letter-spacing: 0; }
.mid-btn.wait .mid-sub { color: var(--text); }
.started-chip.done { padding-right: .7rem; background: var(--go-soft); color: var(--go); min-height: 34px; }
.single-hint { margin: -2px 0 10px; }
/* Finish phone: whose finish the next tap is */
.fz-finishing { font-size: 1.25rem; font-weight: 700; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: .3rem .9rem; }
.fz-finishing strong { font-weight: 900; }
/* single-start ranking: each boat's crew under its name */
table.results.single td:nth-child(2) { min-width: 12rem; }
table.results .crew-line { font-weight: 400; white-space: normal; max-width: 22rem; margin-top: 1px; line-height: 1.25; font-size: .8rem; }

/* ---- Finish phone: the boats on the course, in the order they'll finish ---- */
/* Boats pass each other: drag them into the new order before they cross, so
   the next FINISH taps go to the right boats (the Start phone's list look). */
.finish-zone.has-list .fz-tap { min-height: 150px; min-height: clamp(150px, 32vh, 260px); }
.finish-zone.has-list .fz-label { font-size: clamp(2.6rem, min(14vw, 9vh), 6rem); }
.finish-zone .sz-list-head { flex: 0 0 auto; }
.finish-zone .sz-list {
  width: 100%; margin: 0; padding: 8px 10px 10px; background: rgba(0, 0, 0, .12);
  flex: 0 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.finish-zone .sz-list.scrolls { box-shadow: inset 0 -16px 14px -14px rgba(0, 0, 0, .45); }
.finish-zone .sz-row .sz-boat { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finish-zone .sz-row .sz-run .sz-wait { font-size: .72rem; }
@media (max-width: 400px) {
  .fz-tap { padding: 12px; gap: 8px; }
  .finish-zone .sz-list { padding: 6px 8px 8px; }
}
@media (max-height: 700px) {
  .finish-zone .sz-row { min-height: 36px; }
  .finish-zone.has-list .fz-tap { gap: 6px; padding-top: 10px; padding-bottom: 12px; }
}
/* phone on its side: FINISH on the left, the boats on the right */
@media (orientation: landscape) and (max-height: 500px) {
  body[data-mode="timing"] .finish-zone.has-list {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  }
  .finish-zone.has-list .fz-tap { grid-column: 1; grid-row: 1 / span 2; min-height: 0; }
  .finish-zone.has-list .sz-list-head { grid-column: 2; grid-row: 1; }
  .finish-zone.has-list .sz-list { grid-column: 2; grid-row: 2; min-height: 0; }
}

/* coach's piece card: the boats on the course, in the order they'll finish */
.oc-order { margin: 2px 0 12px; padding: 8px 10px 10px; border-radius: 12px; background: var(--warn-soft); }
.oc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; color: var(--warn); }
.oc-head strong { color: var(--text); }
.oc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.oc-row {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: .25rem .6rem .25rem .2rem;
  border-radius: 10px; background: var(--surface); cursor: grab; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.oc-row .grip { touch-action: none; padding: 8px 4px 8px 8px; margin: -8px 0; color: var(--muted); }
.oc-row.next { box-shadow: inset 0 0 0 2px var(--warn); }
.oc-row.dragging { background: var(--surface); }
.oc-n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 900;
}
.oc-boat { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-next { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--warn); }
.oc-clock { font-weight: 800; }

/* Finish phone list: finishes so far (place + time), then boats on the course */
.finish-zone .sz-row.fz-done { background: rgba(255, 255, 255, .06); }
.finish-zone .sz-row .fz-place { flex: 0 0 auto; min-width: 2.4rem; font-weight: 800; }
.finish-zone .sz-row.fz-done .sz-run { font-weight: 700; }
.finish-zone .sz-row.swapped { outline: 2px solid var(--accent); }
.fz-earlier { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.finish-screen .fz-earlier { justify-content: center; margin: 4px 0 8px; }

/* Fixing any piece's finish order (sheet) */
.fix-sheet { overflow-y: auto; }
.fix-pieces { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.fix-pieces .on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fix-sheet .finish-list { margin: 8px 0; }
.fix-sheet .table-wrap { margin-top: 4px; }
.fix-results-head { margin-top: 12px; }

/* ==== 2.1.8: teams, boat tags, bow numbers, colour-coded switches ======== */
/* Setup: session | our team | guest team, side by side on a laptop */
@media (min-width: 1000px) { .setup-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.team-col-h { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: 1.05rem; margin: 4px 0 10px; }
.card-head .team-col-h { margin: 0; }
.team-label { display: inline-flex; align-items: center; gap: .35em; font-weight: 700; }
.team-label .rs-team-stripe, .guest-tag .rs-team-stripe { display: inline-block; width: 5px; height: 1em; min-height: 1em; align-self: center; }
.guest-tag { display: inline-flex; align-items: center; gap: .3em; margin-left: .4em; font-size: .72em; font-weight: 600; color: var(--muted); vertical-align: middle; white-space: nowrap; }
.guest-tag .rs-team-stripe { width: 4px; }
.guest-h { font-size: .95rem; margin: 12px 0 4px; }
.guest-block + .guest-block { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.guest-edit { display: block; }
.guest-edit .names { margin-bottom: 6px; }
.names input { min-width: 0; }
.paste-box { margin-top: 6px; }
.paste-box summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.paste-box textarea { width: 100%; font: inherit; margin: 6px 0; box-sizing: border-box; }
.class-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.class-chips .fchip { min-height: 30px; padding: .1rem .5rem; }
.add-boat .can-row { margin: 6px 0; }
/* a colour dot that opens the swatches under it */
.color-field { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.color-dot { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.color-dot.none { background: var(--surface-2); position: relative; overflow: hidden; }
.color-dot.none::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--muted); transform: rotate(45deg); }
.color-field .rs-swatches {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 6; width: max-content; max-width: min(320px, 90vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
/* bow numbers */
.bow-input { width: 3.8em; min-width: 0; text-align: center; padding: .25rem .3rem; flex: 0 0 auto; }
.add-boats { flex-wrap: wrap; }
.add-chip { display: inline-flex; align-items: center; gap: .2em; }
.boat-sum { align-items: center; }
.boat-editor { margin-top: 8px; }
.boat-editor summary { cursor: pointer; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.pick-group { display: flex; flex-wrap: wrap; gap: 4px 14px; width: 100%; }
.pick-group + .pick-group { margin-top: 6px; }
.pick-team { margin: 4px 0 2px; width: 100%; }
.pick-list .pick-team { grid-column: 1 / -1; }
.bench-team { margin: 6px 0 0; }
/* switch marks: the letter in its colour on seats, pills, lines and results */
.rs-pair.small { font-size: .62em; }
.seat .rs-pair, .plan-swap .rs-pair, .chg .rs-pair, .due-swap .rs-pair, .pb-move .rs-pair, .changes .rs-pair { margin-right: .2em; flex: 0 0 auto; }
.seat.in-pair { box-shadow: inset 4px 0 0 var(--pair-bg); }
.seat.in-pair.moved { box-shadow: inset 4px 0 0 var(--pair-bg); }
.seat.sel .rs-pair { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.due-swap { display: inline-flex; align-items: center; gap: .2em; margin-right: .6em; }
.rower-mark { display: inline-flex; align-items: center; gap: .2em; }
.w-name .rs-pair { font-size: .45em; vertical-align: middle; }
.verdict .rs-pair { vertical-align: middle; }
.chg { display: inline-flex; align-items: center; gap: .2em; }
.gl-names .rs-boat, .sz-boat .rs-boat, .fz-boat .rs-boat, .chip .rs-boat { vertical-align: middle; }
.chip .rs-boat { max-width: 100%; }
.started-chip .rs-boat { color: var(--text); }
.go-chip .rs-boat { font-weight: 700; }
.comp-label, .w-label { display: flex; flex-wrap: wrap; align-items: center; gap: .25em; }

/* the boat's size, big, in the boat lists */
.boat-size-badge { flex: 0 0 auto; min-width: 3.2em; padding: 2px 8px; border-radius: 8px; text-align: center; font-size: 1.2em; font-weight: 800; background: rgba(127, 127, 127, .16); font-variant-numeric: tabular-nums; }

/* the boat card's rows line up: name | size | rigging, fixed columns */
.boat-sum { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em 8em; align-items: center; column-gap: 10px; }
.boat-sum .boat-size-badge { justify-self: stretch; }

/* a piece in the history: the finish order, then its lineups in a fold-out of their own */
.piece-hist .hist-sub { margin: 10px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.piece-lineups { margin-top: 10px; border-top: 1px solid rgba(127, 127, 127, .25); padding-top: 8px; }
.piece-lineups > summary { cursor: pointer; padding: 4px 0; }
.piece-lineups[open] > summary { margin-bottom: 6px; }

/* Start and Finish lists (2.1.25): columns that line up from row to row —
   drag handle | colour bar + name (left-aligned) | class | time or status */
.sz-row { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) 8.5em; justify-content: stretch; align-items: center; column-gap: 8px; text-align: left; }
.sz-row > .grip { grid-column: 1; }
.sz-row > .sz-boat { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) 3.2em; align-items: center; column-gap: 10px; justify-items: start; min-width: 0; }
.sz-row > .sz-boat > strong { min-width: 0; max-width: 100%; overflow: hidden; }
.sz-row > .sz-boat .sz-type { justify-self: start; font-variant-numeric: tabular-nums; }
.sz-row > :last-child:not(.sz-boat):not(.grip) { grid-column: 3; justify-self: end; }
.finish-zone .sz-row .sz-boat { display: grid; }
@media (max-width: 560px) {
  /* phones: a slimmer colour bar and status column, so the names keep their room */
  .sz-row { grid-template-columns: 1.1em minmax(0, 1fr) 5.2em; column-gap: 6px; padding-left: .5rem; }
  .sz-row > .sz-boat { grid-template-columns: minmax(0, 1fr) 2.3em; column-gap: 6px; }
  .sz-row .rs-boat-dot { width: 1.4em; }
  .sz-row .sz-run { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
}

/* even spacing in the Start and Finish lists (2.1.26): the same padding and gaps on every row */
.sz-list { gap: 6px; }
.sz-row { min-height: 48px; padding: 6px 12px; column-gap: 12px; }
/* the name column has a set width, so the class sits just after the names, still in a straight line */
.sz-row > .sz-boat { column-gap: 14px; grid-template-columns: minmax(0, 15em) 3.2em; justify-content: start; }
.sz-row > .sz-boat .sz-type { font-size: .85rem; opacity: .9; font-weight: 600; }
.sz-row > .grip { justify-self: center; }
@media (max-width: 560px) {
  .sz-row { padding: 6px 8px; column-gap: 8px; }
  .sz-row > .sz-boat { column-gap: 8px; grid-template-columns: minmax(0, 1fr) 2.2em; }
  .sz-row .rs-boat-dot { width: 1.3em; margin-right: .55em; }
}

/* Boats in this session: the M / W / Mx squad chips stay on the row, and the
   row wraps rather than running off a narrow column (2.1.27). */
.sess-boat-row { flex-wrap: nowrap; }
.sess-boat-row > .grow { min-width: 0; overflow: hidden; }
.squad-toggle .squad-chip { min-width: 2.4em; padding: .25rem .5rem; }
/* The boat class stays in view while the gold medal table scrolls sideways to Women and Mixed. */
table.gmt-table td.gmt-class, table.gmt-table thead th[rowspan] { position: sticky; left: 0; z-index: 1; background: var(--surface); }

/* Results tables: boat, class and squad in their own columns, so they line up (2.1.28). */
table.results th.res-cls, table.results td.res-cls { width: 3.5em; white-space: nowrap; font-weight: 600; }
table.results th.res-sq, table.results td.res-sq { width: 3.5em; white-space: nowrap; }
table.results td.res-boat .rs-boat { vertical-align: middle; }

/* Guest team: Attending / Not here on each guest rower and boat (2.1.30). */
.guest-row { flex-wrap: wrap; row-gap: 6px; }
.guest-row > .grow { min-width: 8em; }
.guest-row .attend-toggle .tg { padding-left: .55rem; padding-right: .55rem; }
.guest-h .guest-allhere { margin-left: auto; font-weight: 600; }
.guest-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

/* Setup's own tabs: Session, Guest team, Gold medal times (2.1.34). */
.setup-parts { max-width: 520px; margin: 0; flex: 1 1 340px; }
.subtabs-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.subtabs-bar > .subtabs:first-child { flex: 1 1 300px; }
.setup-parts button { font-size: .9rem; padding: 0 .7rem; white-space: nowrap; }
@media (max-width: 560px) { .setup-parts button { font-size: .8rem; padding: 0 .4rem; } }

/* Compact Setup (2.1.35): one line per boat, the session's fields on one row, tighter lists. */
.sess-boat-row { min-height: 0; padding-top: 5px; padding-bottom: 5px; gap: 6px; }
.sess-boat-row .rs-boat-dot { width: 1.6em; margin-right: .5em; }
.sess-boat-row .btn-sm { min-height: 32px; padding: 0 .5rem; }
.sess-boat-row .squad-chip { min-height: 30px; }
.sess-boat-row .sb-x { min-width: 32px; }
.sb-key { margin: 6px 0 0; }
.boat-sum { min-height: 0; padding-top: 4px; padding-bottom: 4px; }
@media (min-width: 700px) { .sess-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr); } .sess-form .field.wide { grid-column: auto; } .sess-form .row.wide { grid-column: 1 / -1; } }
.sess-actions { flex-wrap: wrap; row-gap: 6px; }
/* Course and conditions on a session (3.0.31): Flow / Temp / Wind side by side */
.sess-info { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.sess-info-label { padding-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.sess-info .field { margin: 0; }
.sess-where { flex-basis: 100%; }
@media (max-width: 480px) { .sess-info { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sess-info-label { grid-column: 1 / -1; padding-bottom: 0; } }
/* A phone keeps the controls on a second line rather than crushing the name. */
@media (max-width: 560px) { .sess-boat-row { flex-wrap: wrap; row-gap: 4px; } .sess-boat-row > .grow { min-width: 10em; } }

/* Cards folded to one line once filled in (2.1.35). */
.done-card { padding-top: 10px; padding-bottom: 10px; }
.done-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.done-line h2 { margin: 0; font-size: 1rem; }
.done-tick { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--go-fill, #1f6f3f); color: var(--go, #3ad07a); font-weight: 900; font-size: .85rem; }
.done-sum { flex: 1 1 12em; min-width: 0; color: var(--muted); font-size: .9rem; }
.done-sum strong { color: var(--text); }
.done-boats { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; vertical-align: middle; }
.done-boats .rs-boat-dot { width: 1.2em; }
.done-new { margin-left: 8px; }
.done-btn { margin-left: auto; }
.setup-parts { max-width: 620px; }
.done-boats > * { flex: 0 0 auto; }
.done-boats .rs-boat { display: inline-flex; width: auto; }
.done-card .done-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }

.done-sum:has(.done-boats) { flex-basis: 100%; order: 5; }
.done-boats .rs-boat.small .rs-boat-dot { width: 1.2em; margin-right: .35em; }

/* Guest team and GMT tabs use the whole width (2.1.37). */
@media (min-width: 1000px) { .setup-grid.one, .tab-body .setup-grid.one { grid-template-columns: minmax(0, 1fr); } }
.guest-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 28px; }
@media (min-width: 900px) {
  .guest-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .guest-cols > .guest-block + .guest-block { margin-top: 0; border-top: 0; padding-top: 0; }
  /* a roomy row each: name, then Attending / Not here and the buttons on the same line */
  .guest-cols .guest-row { flex-wrap: nowrap; padding-top: 6px; padding-bottom: 6px; }
  .guest-cols .guest-row > .grow { min-width: 0; }
}
.guest-cols .guest-h { margin-top: 4px; }

/* Team chips on rowers and boats once a guest team races (2.1.37). */
.team-chip { display: inline-block; margin-left: .45em; padding: .08em .45em; border-radius: 999px; font-size: .68em; font-weight: 800; line-height: 1.35;
  vertical-align: middle; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); color: var(--text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.boat-head .team-chip { font-size: .72rem; }
.seat-name .team-chip { font-size: .66em; }
/* Guest boats: the name keeps its room; the controls wrap under it when needed. */
.guest-cols .guest-block:last-child .guest-row { flex-wrap: wrap; }
.guest-cols .guest-block:last-child .guest-row > .grow { min-width: 9em; }

/* Settings tab: saved seat races and reset (2.1.39). */
.saved-row { flex-wrap: wrap; row-gap: 6px; }
.saved-row > .grow { min-width: 12em; }
.reset-picks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; }

/* Five Setup tabs on a phone: two rows rather than running off the edge. */
@media (max-width: 560px) { .setup-parts { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Race and Results in small tabs (2.1.40): the lineup board has the full width,
   and the spares sit in columns across the bottom instead of one long list. */
.lineup-card .boats > .bench { grid-column: 1 / -1; }
.lineup-card .bench .seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 10px; }
.lineup-card .bench .seats > .bench-team, .lineup-card .bench .seats > .away, .lineup-card .bench .seats > p,
.lineup-card .bench .seats > .seat.empty { grid-column: 1 / -1; }
@media (max-width: 560px) { .lineup-card .bench .seats { grid-template-columns: minmax(0, 1fr); } }
/* Phone: four small tabs as two by two; the Results downloads small and side by side (2.1.40). */
@media (max-width: 560px) {
  .setup-parts:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-stack > .toolbar { gap: 6px; }
  .tab-stack > .toolbar > span:first-child { flex: 1 1 100%; font-size: .85rem; }
  .tab-stack > .toolbar > button { min-height: 36px; padding: 0 .7rem; font-size: .85rem; }
}
@media (max-width: 560px) { .tab-stack > .toolbar > .spacer { display: none; } .tab-stack > .toolbar > button { flex: 1 1 auto; } }
/* Finish order (2.1.42): each boat fills the row up to ✕, so the whole bar, name
   included, is one big handle to drag (or tap to switch). */
.finish-row .f-time { flex: 0 0 11em; }
.finish-row .chip { flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
.finish-row .chip .rs-boat { min-width: 0; }
.finish-row .chip > [data-since] { margin-left: auto; }
@media (max-width: 560px) { .finish-row .f-time { flex-basis: 7.2em; } .finish-row .f-time .small { font-size: .7rem; } }

/* Piece history: each size group's winner on its own line (2.1.43). */
.piece-hist summary .hist-firsts { flex: 1 1 100%; display: grid; gap: 4px; margin: 4px 0 2px; }
.hist-first { display: grid; grid-template-columns: 11em auto 1fr; align-items: center; gap: 8px; }
.hist-first:not(:has(.hist-first-g)) { grid-template-columns: auto 1fr; }
@media (max-width: 560px) { .hist-first { grid-template-columns: 7.5em auto 1fr; } }

/* Seat race table (2.1.44): each piece's boat in a column of its own, left-aligned so the boats line up. */
.switch-table th.c { text-align: center; }
.switch-table td.sw-time { padding-right: 6px; }
.switch-table td.sw-boat { text-align: left; padding-left: 0; white-space: nowrap; }
/* Team chips show the whole team name (2.1.45); only the tight spots (a boat
   card's heading, a seat on the lineup board) still shorten a very long one. */
.team-chip { max-width: none; }
.boat-head .team-chip, .seat-name .team-chip { max-width: 10em; }
.sess-boat-row > .grow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.sess-boat-row .team-chip { flex-shrink: 0; max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; text-align: left; }
.sess-boat-row > .grow { overflow: visible; }

/* Move to spares (2.1.47): the steps bar stays in view while the boats scroll on a laptop. */
.swap-banner .say-row { flex-wrap: wrap; gap: 8px; }
.swap-banner .to-spares { white-space: nowrap; }
@media (min-width: 1000px) { .lineup-card .swap-banner { position: sticky; top: 0; z-index: 6; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); } }

/* The steps bar keeps one height at every step (2.1.48): the boats never jump
   between the two taps of a double-tap. */
.swap-banner .say-row { flex-wrap: nowrap; min-height: 2.9em; }
.swap-banner .say { flex: 1 1 auto; min-width: 0; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.swap-banner .to-spares { flex: 0 0 auto; }
@media (max-width: 560px) { .swap-banner .say-row { flex-wrap: wrap; min-height: 5.4em; align-content: flex-start; } }

/* Start groups (2.1.49): a group's boats in three columns on a laptop, one per line on a phone. */
.sz-gline .gl-names { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 14px; flex: 1 1 auto; min-width: 0; align-items: center; }
.sz-gline .gl-boat { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sz-gline .gl-boat .rs-boat { min-width: 0; }
.sz-gline .gl-boat .sz-type { font-size: .8rem; opacity: .85; font-weight: 600; }
@media (min-width: 700px) { .sz-gline .gl-names.many { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Finish order (2.1.50): the class beside each boat's name; on a phone the boat
   takes a full line under the time, so its whole name shows. */
.chip .chip-type { font-size: .8rem; font-weight: 800; opacity: .85; padding: .05rem .35rem; border-radius: 6px; background: rgba(0, 0, 0, .18); }
@media (max-width: 560px) {
  .finish-row { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; column-gap: 8px; row-gap: 6px; align-items: center; }
  .finish-row .place { grid-column: 1; grid-row: 1; width: auto; }
  .finish-row .f-time { grid-column: 2; grid-row: 1; }
  .finish-row .del { grid-column: 3; grid-row: 1; }
  .finish-row .chip { grid-column: 1 / -1; grid-row: 2; width: 100%; }
}

/* Rigging (2.1.52): double-tap a boat on the board. */
.rig-sheet { max-width: 560px; }
.rig-name { font-size: 1.15rem; margin: 2px 0 8px; }
.rig-presets { flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rig-seats { display: flex; flex-direction: column; gap: 4px; }
.rig-seat { display: grid; grid-template-columns: 4.6em auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.rig-seat.off { box-shadow: 0 0 0 2px var(--warn) inset; }
.rig-label { font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.rig-sides { display: inline-flex; gap: 4px; }
.rig-side { min-height: 34px; padding: 0 .7rem; font-weight: 800; border-radius: 8px; }
.rig-side.side-p.on { background: var(--stop-fill, #8a2a2a); color: #fff; }
.rig-side.side-s.on { background: var(--go-fill, #1f6f3f); color: #fff; }
.rig-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rig-who.warn { color: var(--warn); }
.rig-bucket { align-self: center; min-height: 28px; padding: 0 .8rem; font-size: .78rem; font-weight: 800; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.rig-bucket.on { border-style: solid; border-color: #f08c00; color: #f08c00; background: rgba(240, 140, 0, .12); }
.rig-actions { margin-top: 12px; gap: 8px; }
.rig-chip { font-size: .7rem; font-weight: 800; padding: .1rem .45rem; border-radius: 999px; color: #f08c00; border: 1px solid #f08c00; white-space: nowrap; }
@media (max-width: 560px) { .rig-seat { grid-template-columns: 3.8em auto; } .rig-who { grid-column: 1 / -1; } .rig-side { padding: 0 .5rem; } }

/* 2.1.53: rows in the Start and Finish lists keep their own height (the list
   scrolls) instead of being squeezed until their text overlaps. */
.sz-list > * { flex-shrink: 0; }
.sz-gline .gl-count { display: none; }
/* A phone: a start group folds to one line (its boats run on, the count beside). */
@media (max-width: 560px) {
  .sz-gline .gl-names.many { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sz-gline .gl-names.many .gl-boat { display: inline; }
  .sz-gline .gl-names.many .gl-boat + .gl-boat::before { content: ' · '; opacity: .7; }
  .sz-gline .gl-names.many .sz-type { display: none; }
  .sz-gline .gl-names.many .rs-boat-dot { display: none; }
  .sz-gline .gl-count { display: inline-block; flex: 0 0 auto; font-size: .72rem; font-weight: 800; padding: .1rem .4rem; border-radius: 999px; background: rgba(0, 0, 0, .25); white-space: nowrap; }
}
/* Finish phone list: the place on the left, then the boat, then its time, on one line. */
.finish-zone .sz-row { grid-template-columns: 1.2em 2.9em minmax(0, 1fr) auto; }
.finish-zone .sz-row > .grip { grid-column: 1; }
.finish-zone .sz-row > .fz-place { grid-column: 2; min-width: 0; }
.finish-zone .sz-row > .sz-boat { grid-column: 3; }
.finish-zone .sz-row > .sz-run { grid-column: 4; justify-self: end; }
@media (max-width: 560px) { .finish-zone .sz-row { grid-template-columns: 1em 2.6em minmax(0, 1fr) auto; } }

/* Who moved (Results → Pieces), a box per switch, 3 columns on a laptop (2.1.53). */
.changes-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: .4rem 0; }
@media (min-width: 700px) { .changes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.changes-box { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface-2); }
.changes-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.changes-box .changes { margin: 0; padding-left: 1rem; }
.finish-zone .sz-row > :last-child.sz-run:not(.grip) { grid-column: 4; justify-self: end; }

/* Start phone after a piece (2.1.55): all boats finished, then Start a new race. */
.start-done { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; border-radius: 22px; background: #0f3d22; color: #fff; min-height: 0; }
.start-done .sd-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; font-weight: 800; opacity: .9; }
.start-done .sd-title { font-size: 1.8rem; font-weight: 900; text-align: center; margin: 4px 0; color: #69db7c; }
.start-done .sd-results { display: flex; flex-direction: column; gap: 8px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.start-done .sd-gh { font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .8; margin: 2px 0; }
.start-done .sd-row { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, .2); }
.start-done .sd-row.first { background: rgba(105, 219, 124, .25); }
.start-done .sd-place { font-weight: 900; }
.start-done .sd-time { font-weight: 800; }
.start-done .sd-go { min-height: 64px; font-size: 1.3rem; font-weight: 900; border-radius: 16px; }
.start-done .sd-next { text-align: center; margin: 0; color: rgba(255, 255, 255, .75); }

/* DNF / DNS from the coach's piece table (2.1.56). */
table.results td.out-td { white-space: nowrap; width: 1%; }
.out-x { color: var(--stop); font-weight: 900; min-width: 34px; }
.out-menu { display: inline-flex; gap: 4px; }
tr.st-dns td { color: var(--muted); }

/* Finish order editor (2.1.57): compact rows, two views, Save. */
.fo-modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.fo-modes button { border: 0; background: transparent; min-height: 32px; padding: 0 .6rem; font-size: .82rem; font-weight: 700; border-radius: 8px; color: var(--muted); }
.fo-modes button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.fo-list { display: flex; flex-direction: column; gap: 4px; }
.fo-list > * { flex-shrink: 0; }
.fo-row { display: grid; grid-template-columns: 1em 2.8em minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px;
  border-radius: 10px; background: var(--surface-2); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.fo-row .grip { opacity: .5; }
.fo-row .fo-place { font-weight: 900; }
.fo-row .fo-boat { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fo-row .fo-boat .rs-boat { min-width: 0; }
.fo-row .fo-time { font-weight: 800; }
.fo-row.sel { box-shadow: 0 0 0 2px var(--accent) inset; }
.fo-row.moved { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.fo-row.dragging { background: var(--surface); box-shadow: var(--shadow); }
.fo-row .del { min-height: 30px; }
.fo-row:not(:has(.del)) { grid-template-columns: 1em 2.8em minmax(0, 1fr) auto; }
.fo-group + .fo-group { margin-top: 10px; }
.fo-gh { font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .8; margin: 0 0 4px; }
.fo-save { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; padding: 8px 0 2px; background: var(--surface); }
.fo-save > span { margin-right: auto; color: var(--muted); }
.fo-save.dirty > span { color: var(--warn); font-weight: 700; }
.fo-save .btn-primary { min-height: 44px; padding: 0 1.4rem; font-weight: 900; }
/* 2.1.58: the finished screen on dark blue, like the rest of the app. */
.start-done { background: #0d2a4d; box-shadow: 0 0 0 2px #2f6fb5 inset; }
.start-done .sd-row { background: rgba(255, 255, 255, .06); }
.start-done .sd-row.first { background: rgba(105, 219, 124, .22); }

/* Seat races by boat size, one line each (2.1.59). */
.sr-size + .sr-size { margin-top: 12px; }
.sr-list { display: flex; flex-direction: column; gap: 4px; }
.sr-item { border-radius: 10px; background: var(--surface-2); }
.sr-line { display: grid; grid-template-columns: 3.2em minmax(0, 1.3fr) minmax(0, 2fr) 4.2em 1em; align-items: center; gap: 10px; width: 100%;
  min-height: 40px; padding: 4px 10px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.sr-line .sr-pieces { font-weight: 800; color: var(--muted); }
.sr-line .sr-boats { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.sr-line .sr-result { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-line .sr-win { color: var(--go); }
.sr-line .sr-by { text-align: right; font-weight: 800; }
.sr-line .sr-caret { color: var(--muted); }
.sr-item.open { box-shadow: 0 0 0 1px var(--line) inset; }
.sr-detail { padding: 0 10px 10px; }
@media (max-width: 700px) {
  .sr-line { grid-template-columns: 2.8em minmax(0, 1fr) 3.8em 1em; row-gap: 2px; }
  .sr-line .sr-boats { grid-column: 2; grid-row: 1; }
  .sr-line .sr-result { grid-column: 2 / span 2; grid-row: 2; white-space: normal; }
  .sr-line .sr-by { grid-column: 3; grid-row: 1; }
  .sr-line .sr-caret { grid-column: 4; grid-row: 1 / span 2; }
}
.sr-line .team-chip.ours { display: none; }

/* Results tab, compact (2.1.60). */
.rv-piece .rv-piece-head { margin: -2px 0 6px; }
.fo-row.ro { grid-template-columns: 2.8em minmax(0, 1fr) auto; cursor: default; touch-action: auto; }

/* Less height (2.1.60): boat sizes side by side when there is room. */
.fo-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 14px; align-items: start; }
.fo-group + .fo-group { margin-top: 0; }
.sr-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 12px 16px; align-items: start; }
.sr-size + .sr-size { margin-top: 0; }
@media (max-width: 560px) { .sr-sizes { grid-template-columns: minmax(0, 1fr); } .fo-groups { grid-template-columns: minmax(0, 1fr); } }
/* Class and crew filters. */
.rv-filters { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; }
.rv-filter { gap: 6px; flex-wrap: wrap; align-items: center; }

/* 2.1.60, tighter: size groups two across in a laptop column; shorter rows. */
.fo-groups { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.st-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px 16px; align-items: start; }
.st-sizes .size-block { min-width: 0; }
.st-sizes table td, .st-sizes table th { padding-top: .22rem; padding-bottom: .22rem; }
.results-view .fo-row, .rv-piece .fo-row { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
.results-view .sr-line { min-height: 34px; padding-top: 2px; padding-bottom: 2px; }
.sr-sizes { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.st-sizes .team-chip.ours { display: none; }
.st-sizes table td:nth-child(2) { white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .sr-sizes, .fo-groups, .st-sizes { grid-template-columns: minmax(0, 1fr); } }

/* Clock settle check on the Start and Finish phones (2.1.61). */
.fz-status.ready { background: rgba(0, 0, 0, .22); color: #fff; box-shadow: 0 0 0 1.5px #69db7c inset; font-weight: 800; }
.fz-status.ready::before { content: '● '; color: #69db7c; }
.fz-status.notready { background: #ffd43b; color: #1b1b1b; font-weight: 800; }
.fz-status.notready::before { content: '◌ '; }

/* 2.1.61: smooth scrolling in the finish lists. A swipe on a row scrolls; a
   finger moves a boat by its ⋮⋮ grip (a mouse still drags the whole row). */
.fo-row { touch-action: pan-y; }
.fo-row .grip, .finish-zone .sz-row .grip { touch-action: none; cursor: grab; display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 34px; margin: -4px 0 -4px -6px; border-radius: 8px; opacity: .8; font-weight: 900; letter-spacing: -2px; }
.fo-row .grip:active, .finish-zone .sz-row .grip:active { background: rgba(255, 255, 255, .12); }
.fo-row { grid-template-columns: 30px 2.8em minmax(0, 1fr) auto auto; }
.fo-row:not(:has(.del)) { grid-template-columns: 30px 2.8em minmax(0, 1fr) auto; }
.finish-zone .sz-row.dragok { touch-action: pan-y; }
.finish-zone .sz-row { grid-template-columns: 30px 2.9em minmax(0, 1fr) auto; }
@media (max-width: 560px) { .finish-zone .sz-row { grid-template-columns: 28px 2.6em minmax(0, 1fr) auto; } }

/* 2.1.64: racing, the clock locked: just the ms off, no Ready / Not ready */
.fz-status.held { background: rgba(0, 0, 0, .22); color: #fff; font-weight: 800; }
.clock-note { white-space: nowrap; }
/* 2.1.64: a bigger Save for the finish order, and bigger piece notes */
.fo-save { padding: 10px 0 4px; }
.fo-save > span { font-size: 1rem; }
.fo-save .btn-sm { min-height: 52px; padding: 0 1.2rem; font-size: 1.05rem; }
.fo-save .btn-primary { min-height: 60px; min-width: 170px; padding: 0 2.2rem; font-size: 1.3rem; font-weight: 900; border-radius: 12px; }
@media (max-width: 560px) { .fo-save .btn-primary { flex: 1; min-width: 0; } }
.piece-notes > span { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.piece-notes textarea { font-size: 1.15rem; line-height: 1.4; min-height: 72px; padding: 10px 12px; }
.piece-note-text { font-size: 1.1rem; line-height: 1.4; }
/* 2.1.65: finish order rows on a phone: room for the boat (colour, bow, team colour, name) */
.fo-row { grid-template-columns: 30px 2.3em minmax(0, 1fr) auto auto; column-gap: 6px; }
.fo-row:not(:has(.btn-danger)) { grid-template-columns: 30px 2.3em minmax(0, 1fr) auto; }
.fo-row.ro { grid-template-columns: 2.3em minmax(0, 1fr) auto; }
.fo-row .fo-boat { display: flex; align-items: center; gap: .3em; min-width: 0; }
.fo-row .fo-boat .chip-type { flex: 0 0 auto; }
.fo-row .btn-danger { min-width: 36px; padding: 0 .4rem; }
.fo-row .rs-boat-dot, .finish-zone .sz-row .rs-boat-dot, .sd-row .rs-boat-dot { margin-right: .35em; }
/* a long name goes onto a second line rather than being cut off */
.fo-row .rs-boat-name, .finish-zone .sz-row .rs-boat-name, .sd-row .rs-boat-name { white-space: normal; overflow-wrap: break-word; line-height: 1.15; min-width: min-content; }
/* seat race lines are narrow: a shorter colour bar leaves the whole name */
.sr-line .sr-boats .rs-boat-dot { width: 1.5em; margin-right: .35em; }
.sr-line .sr-boats .rs-boat-name.rs-team-ink { padding: .08em .35em; }
.sr-line .sr-boats .rs-boat { gap: .2em; }
/* 2.1.66: never let text overlap. On a narrow screen a finish order row puts
   the time (and ✕) on a second line under the boat, so the boat's colour,
   bow number and name always have the whole width. */
@media (max-width: 480px) {
  .fo-row:not(.ro) { grid-template-columns: 30px 2.3em minmax(0, 1fr) auto; grid-template-areas: "grip place boat boat" "grip place time del"; row-gap: 2px; }
  .fo-row:not(.ro) > .grip { grid-area: grip; align-self: center; }
  .fo-row:not(.ro) > .fo-place { grid-area: place; align-self: center; }
  .fo-row:not(.ro) > .fo-boat { grid-area: boat; }
  .fo-row:not(.ro) > .fo-time { grid-area: time; justify-self: start; }
  .fo-row:not(.ro) > .btn-danger { grid-area: del; justify-self: end; min-height: 30px; }
}
/* anything holding a boat tag keeps it inside: a name wraps or is cut short, never drawn over its neighbour */
.fo-boat, .sz-boat, .sd-boat, .sr-boats, .res-boat, .done-sum, .fold-sum { min-width: 0; overflow: hidden; }
.sr-line .sr-boats .rs-boat-dot { width: 1.1em; min-width: 1.1em; }
/* the seat race line on a phone: tighter columns so both boats' names fit */
@media (max-width: 560px) {
  .sr-line { grid-template-columns: 2.4em minmax(0, 1fr) 3.1em 1em; column-gap: 6px; padding-left: 8px; padding-right: 8px; }
}
/* Setup's boat list: the rigging column only takes room when it has words */
.boat-sum { grid-template-columns: minmax(0, 1fr) 4.5em minmax(0, max-content); }
.boat-sum > .grow { min-width: 0; overflow: hidden; }
.boat-sum > .muted.small:empty { display: none; }
@media (max-width: 560px) {
  .boat-sum { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .boat-sum > .muted.small { grid-column: 1 / -1; }
}
/* short team names (2.1.67): a chip never shrinks */
.team-chip { flex-shrink: 0; white-space: nowrap; }
/* 2.1.68: Boats in this session: drag to reorder, and the bow number counter */
.sess-boat-row .grip { touch-action: none; cursor: grab; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 32px; opacity: .8; font-weight: 900; letter-spacing: -2px; }
.sess-boat-row { touch-action: pan-y; }
.sess-boat-row .sb-drag { cursor: grab; user-select: none; -webkit-user-select: none; }
.sb-list.is-dragging .sess-boat-row:not(.dragging) { transition: transform .15s ease; }
.sb-list .sess-boat-row.dragging { position: relative; z-index: 3; background: var(--surface-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); border-radius: 10px; }
.bow-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; }
.bow-auto .bow-gap input { width: 4.2em; min-height: 34px; padding: 2px 6px; }
.bow-auto .bow-ranges { flex-basis: 100%; }
/* 2.1.69: the session bar: open, start or delete a session */
.sess-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.sess-bar .sess-pick { flex: 1 1 14em; min-width: 0; max-width: 30em; min-height: 40px; font-weight: 700; }
.toolbar .sess-bar { flex: 1 1 auto; margin: 0; }
details.new-session > summary.new-session-sum { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 800; cursor: pointer;
  background: var(--accent); color: #fff; list-style: none; }
details.new-session > summary.new-session-sum::-webkit-details-marker { display: none; }
details.new-session[open] > summary.new-session-sum { background: var(--surface-2); color: var(--text); }
.sess-bar .sess-pick { width: 100%; text-overflow: ellipsis; }
.toolbar .sess-bar { min-width: 0; max-width: 100%; }
@media (max-width: 560px) { .sess-bar .sess-pick { flex-basis: 100%; max-width: 100%; } .toolbar .sess-bar { flex-basis: 100%; } }
/* 2.1.70: Setup → Boats rigging rows */
.rig-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; }
.rig-row > .grow { min-width: 0; overflow: hidden; }
.rig-row .rig-now { white-space: nowrap; }
@media (max-width: 560px) {
  .rig-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .rig-row .rig-now { grid-column: 1; grid-row: 2; white-space: normal; }
  .rig-row .btn-sm { grid-column: 2; grid-row: 1 / span 2; }
}
/* 2.1.71: the Rowers card folds to one line */
.rowers-card > .card-head { flex-wrap: wrap; row-gap: 4px; }
.rowers-card > .card-head .fold-sum { flex: 1 1 auto; min-width: 0; }
.rowers-card.folded { padding-bottom: 10px; }
/* 2.1.71: on a phone the switch helper's words get a fixed four lines of
   their own (never cut off), with its buttons below; the bar's height stays
   the same at every step, so a double-tap never misses. */
@media (max-width: 560px) {
  .swap-banner .say-row { flex-wrap: wrap; min-height: 0; align-content: flex-start; }
  .swap-banner .say { display: block; flex: 1 1 100%; height: 5.3em; max-height: 5.3em; min-height: 5.3em; overflow: hidden; line-height: 1.3; }
}
/* 2.1.73: Finish phone list: a ✕ on each finish (Remove? to be sure), in its
   own column so every row's time lines up; "Next: <boat>" on FINISH. */
.finish-zone .sz-row { grid-template-columns: 30px 2.9em minmax(0, 1fr) auto 36px; }
@media (max-width: 560px) { .finish-zone .sz-row { grid-template-columns: 28px 2.6em minmax(0, 1fr) auto 34px; } }
.finish-zone .sz-row.fz-done > .fz-del.btn-sm { grid-column: 5; grid-row: 1; justify-self: end; min-width: 32px; min-height: 30px; padding: 0 .35rem; }
.finish-zone .sz-row.fz-done > .fz-del.btn-sm.armed { grid-column: 4 / span 2; justify-self: end; white-space: nowrap; z-index: 2; }
.finish-zone .sz-row > .sz-run { grid-row: 1; }
.finish-zone .sz-row > .fz-del.armed ~ .sz-run, .finish-zone .sz-row:has(.fz-del.armed) > .sz-run { visibility: hidden; }
.fz-nextup { font-size: 1.05rem; }
/* the boat cell in the Finish phone list: the tag first, the class after it, no empty column */
.finish-zone .sz-row .sz-boat { display: flex; align-items: center; gap: .3em; min-width: 0; }
.finish-zone .sz-row .sz-boat > strong { flex: 0 1 auto; min-width: 0; display: flex; }
.finish-zone .sz-row .sz-boat > .sz-type { flex: 0 0 auto; }
@media (max-width: 560px) {
  .finish-zone .sz-row { grid-template-columns: 22px 2.1em minmax(0, 1fr) auto 30px; column-gap: 4px; padding-left: 4px; padding-right: 4px; }
  .finish-zone .sz-row .grip { min-width: 22px; margin-left: 0; }
  .finish-zone .sz-row.fz-done > .fz-del.btn-sm { min-width: 28px; padding: 0 .25rem; }
  .finish-zone .sz-row .sz-run .sz-wait { display: none; }   /* the row's highlight and "Next:" on FINISH say it */
}
/* 2.1.74: before Piece 1 is raced the board only sets the first lineups: no seat race steps */
.swap-banner.initial .steps { display: none; }
/* 2.1.74: locked results, cancelled starts, boat editing, guest layout */
.fo-row.locked .grip, .finish-zone .sz-row.locked .grip, .finish-zone .sz-row.fz-cancel .grip { visibility: hidden; }
.fo-row.locked { cursor: default; touch-action: auto; }
.finish-zone .sz-row.locked { cursor: default; touch-action: auto; }
.fo-save.locked > span { color: var(--muted); font-weight: 700; }
.finish-zone .sz-row.fz-cancel { opacity: .6; }
.finish-zone .sz-row.fz-cancel .sz-boat { text-decoration: line-through; }
.rig-row .rig-btns { display: inline-flex; gap: 6px; }
@media (max-width: 560px) { .rig-row .rig-btns { grid-column: 2; grid-row: 1 / span 2; } .rig-row .btn-sm { grid-column: auto; grid-row: auto; } }
.boat-edit { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; margin: 4px 0; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface-2); }
.boat-edit .row { flex-wrap: wrap; gap: 6px 8px; }
.boat-edit .class-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.guest-stack { display: flex; flex-direction: column; gap: 10px; }
.guest-stack > .guest-block + .guest-block { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.guest-edit-row { align-items: center; gap: 10px; margin: 4px 0 8px; }
/* 2.1.75: the GMT card's "Totals are for ___ m" */
.gmt-dist { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gmt-dist input { width: 5.5em; min-height: 32px; padding: 2px 6px; }
/* 2.1.77: All results on the Results tab */
.all-pieces .ap-piece { padding: 6px 0 2px; border-top: 1px solid var(--line); }
.all-pieces .ap-piece:first-of-type { border-top: 0; }
.all-pieces .ap-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; }
.all-pieces .fo-row.ro { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
/* 2.1.78: add a boat's result by hand (Results tab) */
.fo-add { margin: 8px 0 2px; }
.fo-add.open { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.fo-add .row { flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fo-add select { flex: 1 1 12em; min-width: 0; min-height: 38px; }
.fo-add input { width: 7em; min-height: 38px; }
/* 2.1.78: what each result row shows (All results) */
.rv-show { margin: 0 0 6px; }
.rc-row { grid-template-columns: 2.3em minmax(0, 1fr) auto; align-items: start; }
.rc-row .fo-boat { flex-wrap: wrap; row-gap: 2px; }
.rc-row .rc-crew { flex-basis: 100%; white-space: normal; line-height: 1.2; }
.rc-bits { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 8px; max-width: 12em; text-align: right; }
.rc-bits .rc-time { font-weight: 800; }
.rc-bits .rc-behind { color: var(--muted); }
.rc-bits .rc-split, .rc-bits .rc-gmt { font-size: .82em; color: var(--muted); }
@media (max-width: 560px) { .rc-bits { max-width: 9em; } }
/* 2.1.80: the Results page: the finish order's groups one under the other (names never squeezed); All results as the coach's tables */
.rv-piece .fo-groups { grid-template-columns: minmax(0, 1fr); }
.all-pieces .ap-piece .table-wrap { margin-top: 4px; }
.all-pieces .ap-piece + .ap-piece { margin-top: 10px; }
table.results td.res-team { white-space: nowrap; }
/* 2.1.80: age groups */
.gmt-age { display: inline-flex; align-items: center; gap: 4px; }
.gmt-age select, .age-pick { min-height: 32px; padding: 2px 6px; font-size: .9rem; }
.sess-boat-row .age-pick { flex: 0 0 auto; max-width: 6.5em; }
/* 2.1.81: the Results tab's summary table and the Pieces tab's piece picker */
table.results.summary th.r, table.results.summary td.r { white-space: nowrap; }
table.results.summary .sum-time { font-weight: 400; color: var(--muted); font-size: .9em; }
.piece-pick { margin: 0 0 8px; }
.rv-group { margin: 0 0 4px; }
/* 3.0.2: the Summary's split and % GMT under each time */
table.results.summary .sum-more { font-size: .78em; color: var(--muted); font-weight: 400; white-space: nowrap; }
/* 3.0.4: Lineup setup / Switches toggle; add a boat's result from All results */
.board-mode { margin-right: 6px; }
.rv-add .form-grid { margin-top: 8px; }
.rv-add select, .rv-add input[type=text] { min-height: 38px; }
/* 3.0.9: the GMT card's tools: distance presets, template, CSV import, Google Sheet, active/all */
.gmt-tools { flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 8px; align-items: center; }
.gmt-tools .file-btn { cursor: pointer; }
.gmt-sheet { flex-wrap: wrap; gap: 6px 8px; margin: 0 0 8px; align-items: center; }
.gmt-sheet input { min-width: 16em; min-height: 38px; }
.gmt-sheet .small { flex-basis: 100%; }
.gmt-errors { color: var(--warn); margin: 0 0 8px; padding-left: 1.2em; }
.gmt-dist-pick { min-height: 32px; padding: 2px 6px; }
/* 3.0.73: Results › Pieces, the boats' SpeedCoach files along the piece */
.nk-card .nk-lead { margin: -2px 0 10px; }
.nk-group + .nk-group { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
table.nk-table th, table.nk-table td { white-space: nowrap; padding: .4rem .45rem; }
table.nk-table .nk-cell { line-height: 1.15; }
table.nk-table .nk-sub { display: block; font-size: .74em; color: var(--muted); font-weight: 400; }
/* the boat stays in view while a long piece's marks scroll sideways (phones) */
table.nk-table .nk-boatcol { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.nk-card .nk-key { margin: 4px 0 0; }
.nk-chart { margin: 10px 0 4px; }
.nk-chart figcaption { margin-bottom: 2px; }
.nk-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.nk-svg .nk-grid { stroke: var(--line); stroke-width: 1; }
.nk-svg .nk-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.nk-svg .nk-label { fill: var(--text); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.nk-svg .nk-ring { fill: none; stroke: var(--text); stroke-opacity: .28; stroke-width: 4.5; stroke-linejoin: round; stroke-linecap: round; }
.nk-svg .nk-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.nk-svg .nk-dot { stroke: var(--text); stroke-opacity: .4; stroke-width: 1; }
.nk-words { margin: 6px 0 8px; padding-left: 1.2em; }
.nk-words li + li { margin-top: 3px; }
.nk-boats { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.nk-boat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.nk-tools { flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.nk-tools .btn-sm { min-height: 32px; padding: .15rem .55rem; }
.nk-stale { display: inline-block; margin-top: 4px; padding: .2rem .55rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.nk-add { margin-top: 12px; }
.nk-add > .row { flex-wrap: wrap; gap: 6px 8px; }
.nk-add > p { margin: 6px 0 0; }
.nk-samples { margin-top: 8px; }
.nk-samples summary { cursor: pointer; color: var(--muted); }
.nk-samples .row { flex-wrap: wrap; gap: 6px 8px; }
.nk-files { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nk-file { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.nk-file.bad { border-color: var(--stop); }
.nk-file-head { font-weight: 600; margin-bottom: 4px; }
.nk-boat-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0; }
.nk-boat-pick select { min-height: 36px; max-width: 100%; }
.nk-found { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nk-piece { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.nk-piece input { width: 20px; height: 20px; min-height: 0; margin-top: 1px; flex: none; }
.nk-note { display: block; }
.nk-q { font-weight: 700; white-space: nowrap; }
.nk-q.good { color: var(--go); }
.nk-q.check { color: var(--warn); }
.nk-q.poor { color: var(--stop); }
.nk-swing { margin-top: 4px; }
