:root {
  color-scheme: dark;
  --bg: #071b27;
  --bg2: #0b2431;
  --panel: #102f3f;
  --panel2: #14394a;
  --line: #285061;
  --text: #f1f9fb;
  --muted: #a0bdc8;
  --soft: #94b4c0;
  --aqua: #43e1cf;
  --aqua-dark: #073a3b;
  --blue: #8edaff;
  --orange: #ffb46e;
  --danger: #ff8d91;
  --shadow: 0 12px 32px rgba(0, 9, 16, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(ellipse 80% 30% at 15% -5%, #164b5f 0%, transparent 75%), var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 2px;
}
input, select {
  width: 100%;
  color: var(--text);
  background: #0b2837;
  border: 1px solid #356073;
  border-radius: 11px;
  height: 44px;
  padding: 0 12px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #7498a7; }
input:focus, select:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(67, 225, 207, .12); outline: none; }
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand strong, .live-clock strong, .next-sendoff strong, .swimmer-name, .relay-next strong {
  font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif;
}
h1 { font-size: clamp(32px, 5.3vw, 54px); line-height: 1.07; letter-spacing: -.045em; margin-bottom: 13px; }
h2 { font-size: 20px; letter-spacing: -.02em; }
h3 { font-size: 17px; }
p { line-height: 1.5; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 74px;
  padding: 0 max(24px, calc((100vw - 1216px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(7, 27, 39, .94);
  border-bottom: 1px solid rgba(76, 133, 152, .26);
  backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 11px; align-items: center; flex: 0 0 auto; }
.brand strong { display: block; font-size: 21px; letter-spacing: -.04em; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .19em; font-weight: 800; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--aqua);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  transform: rotate(-4deg);
}
.brand-mark span { width: 3px; height: 18px; border-radius: 99px; background: #06414a; transform: rotate(22deg); }
.brand-mark span:nth-child(2) { height: 23px; }
.desktop-nav { display: flex; align-items: center; gap: 5px; background: #0c2b3a; border: 1px solid #214a5a; border-radius: 14px; padding: 4px; }
.nav-link { border: 0; color: var(--muted); background: none; border-radius: 10px; padding: 10px 18px; font-weight: 800; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.nav-link:hover { color: var(--text); background: #163b4b; }
.nav-link.active { color: #062a33; background: var(--aqua); }
.nav-icon { font-size: 17px; line-height: 1; }
.header-status { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #688c99; }
.status-dot.live { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 180, 110, .16); }
.main { width: min(1216px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 100px; min-height: calc(100vh - 74px); }
.page { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-heading { margin-bottom: 28px; }
.section-heading p, .live-top p { color: var(--muted); margin-bottom: 0; max-width: 620px; }
.eyebrow { color: var(--aqua); letter-spacing: .16em; font-size: 11px; font-weight: 800; margin-bottom: 14px; }
.panel, .lane-card { background: linear-gradient(145deg, var(--panel), #0e2a39); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(275px, 1fr); gap: 16px; }
.set-panel, .tip-panel { padding: 25px; }
.panel-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; }
.panel-heading h2 { margin: 0 0 3px; }
.panel-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.step { display: inline-grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; color: var(--aqua); border: 1px solid #377787; background: #123c4a; font-weight: 800; font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .015em; }
.distance-note { background: #092735; border: 1px solid #254a59; border-radius: 11px; padding: 10px 13px; margin-top: 17px; color: var(--muted); font-size: 13px; }
.distance-note strong { color: var(--aqua); }
.tip-panel { position: relative; overflow: hidden; }
.tip-panel:after { content: ''; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: rgba(60, 199, 203, .055); right: -100px; top: -100px; }
.tip-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #417689; background: #19465a; color: var(--blue); border-radius: 12px; font-size: 23px; margin-bottom: 17px; }
.tip-panel h2 { margin-bottom: 7px; }
.tip-panel p { color: var(--muted); font-size: 13px; max-width: 340px; }
.tip-foot { color: var(--aqua); font-size: 12px; font-weight: 800; margin-top: 23px; }
.lane-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 25px 0 14px; }
.lane-heading > div:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 11px; min-width: 0; }
.lane-heading h2 { margin: 0; }
.lane-heading p { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 0; }
.all-lane-settings { margin: -2px 0 16px; overflow: hidden; }
.all-lane-settings > summary { min-height: 52px; padding: 10px 17px; display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; touch-action: manipulation; font-size: 13px; font-weight: 800; }
.all-lane-settings > summary::-webkit-details-marker { display: none; }
.all-lane-settings > summary small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; }
.all-lane-settings > summary::after { content: '⌄'; color: var(--aqua); font-size: 19px; line-height: 1; transition: transform .15s; }
.all-lane-settings[open] > summary::after { transform: rotate(180deg); }
.all-lane-settings > summary:focus-visible { outline: 3px solid var(--aqua); outline-offset: -3px; }
.all-lane-settings-body { border-top: 1px solid var(--line); padding: 15px 17px 17px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: end; }
.all-lane-settings-body .field { max-width: 300px; }
.all-lane-settings-body p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.btn { min-height: 44px; border-radius: 11px; padding: 10px 15px; font-size: 13px; font-weight: 800; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.btn-primary { background: var(--aqua); color: #062e34; box-shadow: 0 7px 22px rgba(67, 225, 207, .16); }
.btn-primary:hover:not(:disabled) { background: #79f1e4; }
.btn-subtle { color: var(--text); background: #173d4d; border-color: #3b6676; }
.btn-subtle:hover:not(:disabled) { background: #205064; }
.btn-danger { color: #35161d; background: var(--danger); }
.btn-danger:hover { background: #ffa9ab; }
.btn-danger-outline { color: var(--danger); background: transparent; border-color: #a45665; }
.btn-large { min-height: 54px; padding: 13px 22px; font-size: 15px; }
.btn-small { min-height: 42px; padding: 9px 12px; font-size: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setup-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setup-lane { padding: 20px; }
.lane-title-row { display: flex; align-items: end; gap: 11px; margin-bottom: 17px; }
.lane-badge { display: grid; place-items: center; flex: 0 0 auto; min-width: 44px; height: 44px; border-radius: 12px; background: #1d5865; color: var(--aqua); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 23px; }
.lane-name { flex: 1; }
.lane-name input { max-width: 125px; }
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; color: var(--muted); border: 1px solid transparent; background: none; border-radius: 10px; font-size: 24px; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover { background: #214a5a; color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }
.lane-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lane-fields input { text-align: center; font-weight: 800; }
.roster-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #2d5363; margin-top: 17px; padding-top: 15px; margin-bottom: 10px; }
.roster-heading span { font-size: 13px; font-weight: 800; }
.roster-heading small { color: var(--soft); font-size: 12px; white-space: nowrap; }
.roster-list { display: grid; gap: 7px; }
.roster-row { display: flex; align-items: center; gap: 8px; }
.order { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; background: #245163; color: var(--blue); font-weight: 800; font-size: 11px; }
.roster-row input { min-width: 0; flex: 1; height: 44px; }
.stagger-label { flex: 0 0 auto; color: var(--soft); font-size: 12px; font-weight: 800; }
.text-btn { border: 0; padding: 6px 0; background: none; color: var(--aqua); font-size: 12px; font-weight: 800; }
.text-btn:hover { color: #a0f6ed; }
.setup-lane > .text-btn { margin-top: 10px; }
.lane-overrides { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.lane-overrides input { text-align: center; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 18px 0; border-top: 1px solid #275064; }
.setup-footer div { font-size: 13px; }
.setup-footer span { color: var(--muted); }
.start-now { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 19px 22px; margin-bottom: 18px; border-color: #3d978f; background: linear-gradient(135deg, #17494d, #123646); }
.start-now strong, .start-now span { display: block; }
.start-now strong { font-family: 'Space Grotesk', sans-serif; font-size: 20px; }
.start-now span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.start-now .start-kicker { color: var(--aqua); font-size: 11px; font-weight: 900; letter-spacing: .14em; margin: 0 0 5px; }
.start-now .btn span { color: inherit; font-size: inherit; margin: 0; }
.roster-row .order { width: 32px; }
.lane-sendoff { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; gap: 8px; padding: 11px 13px; border-radius: 11px; background: #0b2937; border: 1px solid #31596a; }
.lane-sendoff input { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.lane-add-swimmer { width: 100%; margin-top: 12px; }
.set-details { margin-top: 18px; overflow: hidden; }
.set-details summary, .lane-advanced summary { cursor: pointer; list-style: none; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); font-size: 14px; font-weight: 800; }
.set-details summary::-webkit-details-marker, .lane-advanced summary::-webkit-details-marker { display: none; }
.set-details summary::after, .lane-advanced summary::after { content: '⌄'; color: var(--aqua); font-size: 20px; line-height: 1; transition: transform .15s; }
.set-details[open] summary::after, .lane-advanced[open] summary::after { transform: rotate(180deg); }
.set-details summary { padding: 14px 18px; flex-wrap: wrap; }
.set-details summary small { color: var(--muted); font-size: 12px; font-weight: 700; flex: 1 1 auto; text-align: right; }
.set-details-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.lane-advanced { margin-top: 14px; border-top: 1px solid var(--line); }
.lane-advanced summary { padding: 5px 0; color: var(--muted); font-size: 13px; }
.lane-advanced > .field-grid { margin-top: 12px; }
.program-panel { padding: 23px; margin-bottom: 17px; border-color: #387580; background: linear-gradient(150deg, #143a47, #0f2d3c); }
.program-title { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 18px; }
.program-title > div { min-width: 0; }
.program-title .eyebrow { display: block; margin-bottom: 5px; }
.program-title h2 { margin: 0; font-size: 22px; }
.program-title > small { color: var(--soft); font-size: 12px; font-weight: 700; }
.program-text-field textarea, .lane-set-field textarea { display: block; width: 100%; min-height: 104px; padding: 12px 13px; border: 1px solid #47778a; border-radius: 11px; background: #092936; color: var(--text); font: 600 16px/1.45 'DM Sans', system-ui, -apple-system, sans-serif; letter-spacing: .01em; resize: vertical; overflow-wrap: anywhere; }
.program-text-field textarea::placeholder, .lane-set-field textarea::placeholder { color: #91aeb9; opacity: 1; }
.program-text-field textarea:focus, .lane-set-field textarea:focus { outline: 3px solid rgba(67, 225, 207, .5); outline-offset: 1px; border-color: var(--aqua); }
.program-text-field textarea[aria-invalid="true"], .lane-set-field textarea[aria-invalid="true"] { border-color: var(--danger); }
.program-example { margin: 8px 0 18px; color: var(--soft); font-size: 12px; line-height: 1.35; }
.program-fields { display: grid; grid-template-columns: minmax(100px, 130px) minmax(100px, 130px) minmax(200px, 1fr); gap: 11px; align-items: end; }
.program-fields select, .program-fields input { min-width: 0; }
.program-preview { display: grid; gap: 8px; margin-top: 18px; padding-top: 17px; border-top: 1px solid #3a6675; }
.program-totals { color: var(--aqua); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.program-row { display: grid; grid-template-columns: minmax(82px, 118px) minmax(0, 1fr); align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #376578; border-left: 3px solid var(--aqua); border-radius: 10px; background: #0b2d3b; }
.program-row.program-rest { border-color: #8b704e; border-left-color: var(--orange); background: #302f2c; }
.program-row.program-rest strong { color: var(--orange); }
.program-row strong { color: var(--text); font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif; font-size: 15px; font-variant-numeric: tabular-nums; }
.program-row span { color: var(--muted); font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.program-help { display: block; color: var(--soft); font-size: 12px; line-height: 1.45; margin-top: 5px; }
.program-empty, .program-error { display: block; padding: 12px 13px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.program-empty { color: var(--muted); border: 1px dashed #477283; background: #0b2b39; }
.program-error { color: #ffd4d6; border: 1px solid #b86671; background: #4a2b36; }
.program-more { min-width: 0; }
.program-more[open] { display: grid; gap: 8px; }
.program-more > summary, .syntax-help > summary { display: flex; align-items: center; min-height: 44px; list-style: none; cursor: pointer; color: var(--aqua); font-size: 12px; font-weight: 800; touch-action: manipulation; }
.program-more > summary::-webkit-details-marker, .syntax-help > summary::-webkit-details-marker { display: none; }
.program-more > summary::after, .syntax-help > summary::after { content: '⌄'; margin-left: 7px; font-size: 18px; line-height: 1; transition: transform .15s ease; }
.program-more[open] > summary::after, .syntax-help[open] > summary::after { transform: rotate(180deg); }
.program-more > summary:focus-visible, .syntax-help > summary:focus-visible { outline: 3px solid var(--aqua); outline-offset: -3px; border-radius: 7px; }
.import-review { display: grid; gap: 12px; }
.import-summary { display: grid; gap: 3px; padding: 2px 0 4px; }
.import-summary strong { color: var(--aqua); font: 700 18px/1.2 'Space Grotesk', 'DM Sans', system-ui, sans-serif; }
.import-summary span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.import-section { min-width: 0; overflow: hidden; border: 1px solid #376578; border-radius: 12px; background: #0b2d3b; }
.import-section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; padding: 11px 13px; background: #174556; }
.import-section-head strong { font: 700 15px/1.2 'Space Grotesk', 'DM Sans', system-ui, sans-serif; }
.import-section-head span, .import-section-manual { color: var(--soft); font-size: 11px; }
.import-section-manual { display: block; padding: 7px 13px 0; color: #ffd8a3; }
.import-section-note { margin: 8px 13px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.import-step { padding: 9px 13px; border-top: 1px solid #295568; }
.import-step > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.import-step strong { color: var(--text); font: 700 14px/1.25 'Space Grotesk', 'DM Sans', system-ui, sans-serif; }
.import-step span { flex: 0 0 auto; color: var(--aqua); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.import-step p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.import-step.import-manual { background: #302f2c; }
.import-step.import-manual span { color: var(--orange); }
.import-warning { padding: 10px 12px; border: 1px solid #9b7854; border-radius: 9px; background: #372f2d; color: #ffe4c4; font-size: 12px; line-height: 1.4; }
.import-action { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 2px; }
.import-action small { flex: 1 1 170px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.import-original summary { min-height: 42px; display: flex; align-items: center; color: var(--aqua); font-size: 12px; font-weight: 700; cursor: pointer; }
.import-original pre { max-height: 230px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 11px; border: 1px solid #376578; border-radius: 9px; background: #082633; color: var(--muted); font: 12px/1.5 'DM Sans', system-ui, sans-serif; }
.workout-live { margin: 0 0 18px; padding: 16px; border-color: #3b7a80; background: linear-gradient(150deg, #123c48, #102d3b); }
.workout-live-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.workout-live-top h2 { margin: 3px 0 0; font-size: 19px; }
.workout-live-clock { color: var(--aqua); font-size: 11px; font-weight: 800; text-align: right; }
.workout-live-status { display: grid; gap: 4px; margin-top: 14px; }
.workout-live-status > strong { font: 700 16px/1.25 'Space Grotesk', 'DM Sans', system-ui, sans-serif; }
.workout-live-status > span, .workout-live-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.workout-live-note { margin-top: 3px; color: var(--soft); }
.workout-live-primary { margin-top: 12px; }
.workout-live-primary .btn { min-height: 44px; }
.workout-auto { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; gap: 10px; margin-top: 14px; padding: 8px 11px; border: 1px solid #417282; border-radius: 9px; background: #0c2e3c; color: var(--text); text-align: left; font: 700 12px/1.35 'DM Sans', system-ui, sans-serif; cursor: pointer; }
.workout-auto strong { min-width: 42px; padding: 4px 8px; border-radius: 30px; background: #314b57; color: var(--muted); text-align: center; }
.workout-auto[aria-pressed="true"] strong { background: #1c635e; color: #c5fff2; }
.workout-jump { margin-top: 8px; border-top: 1px solid #376578; }
.workout-jump summary { display: flex; align-items: center; min-height: 44px; color: var(--aqua); font-size: 12px; font-weight: 800; cursor: pointer; }
.workout-section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.program-section-btn { display: grid; gap: 4px; padding: 11px; border: 1px solid #437684; border-radius: 9px; background: #0a2b38; color: var(--text); text-align: left; cursor: pointer; }
.program-section-btn span { font-size: 13px; font-weight: 800; }
.program-section-btn small { color: var(--aqua); font-size: 11px; }
.workout-jump p { margin: 8px 0 1px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.workout-auto:focus-visible, .workout-jump summary:focus-visible, .program-section-btn:focus-visible, .import-original summary:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.syntax-help { margin: -9px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.syntax-help > summary { width: fit-content; }
.syntax-help > :not(summary) { margin: 5px 0 10px; }
.syntax-help code { color: var(--text); overflow-wrap: anywhere; }
.lane-set-field { margin-top: 16px; }
.lane-set-field textarea { min-height: 96px; font-size: 15px; }
.lane-set-note { display: block; margin-top: 8px; color: var(--soft); font-size: 12px; line-height: 1.4; }
.lane-program-preview { display: grid; gap: 7px; margin-top: 12px; }
.lane-program-preview:empty { display: none; }
.lane-program-preview .program-row { grid-template-columns: minmax(74px, 105px) minmax(0, 1fr); padding: 10px 11px; }
.manage-set-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; background: #0b2b39; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.relay-intro { display: flex; gap: 16px; padding: 23px; align-items: center; }
.relay-intro .tip-symbol { flex: 0 0 auto; margin: 0; }
.relay-intro h2 { margin: 0 0 4px; }
.relay-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.active-banner { background: #4a382e; border: 1px solid #b98053; border-radius: 12px; padding: 12px 14px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #ffe6cf; font-size: 13px; }
.active-banner .btn { color: #2a1c12; background: var(--orange); }
.storage-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid #e58e8e; border-radius: 12px; background: #492d36; color: #ffe4e4; }
.storage-banner strong, .storage-banner span { display: block; font-size: 12px; }
.storage-banner span { color: #f8c8cb; margin-top: 2px; }
.storage-banner .btn { color: #421b23; background: #ffb7b8; flex: 0 0 auto; }
.live-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.live-top h1 { margin-bottom: 0; }
.live-eyebrow { color: var(--orange); display: flex; align-items: center; gap: 9px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(255, 180, 110, .16); animation: breathe 1.8s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 9px rgba(255, 180, 110, .05); } }
.live-clock { text-align: right; padding-bottom: 4px; white-space: nowrap; }
.live-clock small, .next-sendoff small { display: block; color: var(--soft); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.live-clock strong { display: block; font-size: clamp(30px, 4vw, 50px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.08; }
.live-toolbar { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 17px; }
.btn-end { color: #ffd1d2; background: transparent; border-color: #9b5b66; }
.btn-end:hover { background: #49303c; }
.deck-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; }
.deck-actions > div { min-width: 0; }
.deck-actions strong, .deck-actions small { display: block; }
.deck-actions strong { font-size: 16px; line-height: 1.25; }
.deck-actions small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.deck-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.live-all-lane-settings { margin: -3px 0 13px; }
.live-all-lane-settings > summary { min-height: 46px; padding-top: 7px; padding-bottom: 7px; }
.capture-board { margin-bottom: 10px; }
.capture-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.capture-heading h2 { margin: 0 0 2px; font-size: 19px; }
.capture-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.capture-heading > span { color: var(--aqua); font-size: 10px; font-weight: 900; letter-spacing: .1em; white-space: nowrap; }
.capture-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.capture-grid.single { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
.quick-lane { background: #123443; border: 1px solid #3a6879; border-radius: 15px; padding: 11px; min-width: 0; }
.quick-lane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 45px; padding: 0 1px 9px; }
.quick-lane-head > div { min-width: 0; }
.quick-lane-head strong { display: block; color: var(--text); font-family: 'Space Grotesk', 'DM Sans', system-ui, sans-serif; font-size: 17px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-lane-head small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 2px; }
.quick-lane-next { flex: 0 0 auto; min-height: 44px; padding: 0 8px; border: 0; border-radius: 9px; background: #1a4555; color: var(--aqua); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.quick-lane-next:hover { background: #235366; }
.quick-swimmers { display: grid; gap: 8px; }
.quick-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 7px; }
.quick-touch { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 13px; border-radius: 10px; border: 0; color: #062f35; background: var(--aqua); text-align: left; touch-action: manipulation; box-shadow: 0 4px 12px rgba(67, 225, 207, .13); }
.quick-copy { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.quick-touch-word { flex: 0 0 auto; border-radius: 8px; padding: 7px 9px; color: #06363a; background: rgba(5, 67, 68, .1); font-size: 12px; font-weight: 900; letter-spacing: .025em; }
.quick-manage { min-width: 48px; min-height: 64px; border: 1px solid #5a8a9a; border-radius: 10px; background: #214d5e; color: var(--text); font-size: 23px; }
.quick-send, .quick-skip { grid-column: 1 / -1; min-height: 44px; border: 1px solid #8e7455; background: #3c382e; color: #ffd198; text-align: center; border-radius: 9px; padding: 9px 12px; font-size: 12px; font-weight: 800; }
.quick-skip { border-color: #4c7483; background: #173d4d; color: var(--blue); }
.quick-lane-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick-add, .quick-settings { width: 100%; min-height: 44px; border: 1px solid #578696; border-radius: 9px; color: var(--aqua); background: #173d4d; font-size: 12px; font-weight: 800; }
.quick-settings { color: var(--muted); background: transparent; }
.quick-touch:active:not(:disabled) { transform: scale(.98); }
.quick-touch:disabled { color: #c0d4d7; background: #2a5360; box-shadow: none; opacity: 1; }
.quick-touch:disabled .quick-touch-word { color: #d4e0e2; background: rgba(9, 34, 42, .22); }
.quick-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 900; }
.quick-progress { display: block; min-width: 0; font-size: 12px; font-weight: 700; line-height: 1.25; }
.lane-switcher { position: sticky; top: 74px; z-index: 20; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 11px 0 14px; margin-bottom: 3px; background: rgba(7, 27, 39, .95); backdrop-filter: blur(14px); }
.lane-switcher::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; border-radius: 100px; padding: 9px 15px; background: #143745; border: 1px solid #335d6c; color: var(--muted); font-size: 12px; font-weight: 800; }
.chip.selected { background: var(--aqua); color: #063338; border-color: var(--aqua); }
.live-lanes, .relay-live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.live-lanes.focused { grid-template-columns: minmax(0, 760px); }
.lane-card { overflow: hidden; }
.lane-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid #2b5363; background: rgba(26, 68, 82, .36); }
.lane-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lane-number { display: grid; place-items: center; flex: 0 0 auto; min-width: 42px; height: 42px; padding: 0 7px; border-radius: 12px; background: #1f6370; color: var(--aqua); font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.lane-identity h2 { margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-identity small { color: var(--muted); display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-sendoff { text-align: right; flex: 0 0 auto; }
.next-sendoff strong { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.live-swimmers { padding: 10px; display: grid; gap: 9px; }
.lane-card-actions { display: flex; gap: 8px; padding: 2px 0 4px; }
.lane-card-actions .btn { flex: 1; }
.swimmer-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; background: #0a2634; border: 1px solid #2a5161; border-radius: 13px; padding: 11px; min-height: 105px; }
.swimmer-card.inactive { background: #0b2633; }
.swimmer-copy { min-width: 0; align-self: center; }
.swimmer-name { font-size: 17px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swimmer-progress { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 3px; }
.swimmer-status { color: var(--aqua); font-size: 12px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.inactive .swimmer-status { color: var(--muted); }
.last-split { color: var(--soft); font-size: 12px; margin-top: 4px; }
.last-split strong { color: var(--text); font-variant-numeric: tabular-nums; }
.swimmer-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.touch-btn { width: 104px; height: 64px; background: var(--aqua); color: #06353b; border: none; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(67, 225, 207, .15); touch-action: manipulation; }
.touch-btn:active:not(:disabled), .relay-touch:active:not(:disabled) { transform: scale(.96); }
.touch-btn span { font-weight: 900; font-size: 13px; letter-spacing: .025em; }
.touch-btn small { font-weight: 800; font-size: 10px; margin-top: 1px; }
.details-btn { min-height: 44px; border: 1px solid #436f80; border-radius: 9px; background: #173d4d; color: var(--blue); padding: 7px 9px; font-size: 12px; font-weight: 800; line-height: 1.2; }
.details-btn:hover { background: #205064; }
.details-btn.full { margin: 11px 15px 14px; width: calc(100% - 30px); text-align: left; }
.live-footnote { margin-top: 17px; color: var(--soft); font-size: 11px; line-height: 1.4; }
.relay-next { padding: 20px 17px 16px; }
.relay-next small { display: block; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.relay-next strong { display: block; font-size: 25px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relay-touch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% - 32px); min-height: 70px; margin: 0 16px; padding: 13px 17px; border-radius: 12px; border: 0; color: #342316; background: var(--orange); touch-action: manipulation; }
.relay-touch span { font-size: 16px; font-weight: 900; }
.relay-touch small { font-size: 12px; font-weight: 800; }
.relay-leg-list { margin: 18px 16px 0; border-top: 1px solid #2c5464; }
.relay-leg { display: flex; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid #254c5b; font-size: 12px; }
.relay-leg.current { color: var(--orange); }
.leg-number { color: var(--soft); width: 19px; }
.leg-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relay-leg strong { font-variant-numeric: tabular-nums; }
.results-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.results-data-tools { margin: -2px 0 16px; }
.results-data-tools summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; font-weight: 800; }
.results-data-tools summary::-webkit-details-marker { display: none; }
.results-data-tools summary::after { content: '⌄'; color: var(--aqua); font-size: 18px; margin-left: 7px; transition: transform .15s; }
.results-data-tools[open] summary::after { transform: rotate(180deg); }
.results-data-tools .results-tools { margin: 6px 0 0; }
.import-label { cursor: pointer; }
.empty-state { padding: 52px 24px; text-align: center; }
.empty-symbol { font-size: 46px; color: var(--aqua); margin-bottom: 8px; }
.empty-state h2 { margin-bottom: 5px; }
.empty-state p { color: var(--muted); font-size: 13px; }
.history-list { display: grid; gap: 12px; }
.history-card { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.history-type { color: var(--aqua); font-size: 10px; letter-spacing: .12em; font-weight: 800; }
.history-card h2 { margin: 5px 0 3px; }
.history-card p { color: var(--muted); margin: 0; font-size: 12px; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.results-actions { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.result-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.result-lane { padding: 19px; }
.result-lane h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #315a69; }
.result-lane h2 small { color: var(--aqua); font: 800 11px 'DM Sans', sans-serif; }
.result-swimmer { padding: 9px 0 11px; border-bottom: 1px solid #27505f; }
.result-swimmer:last-child { border-bottom: 0; }
.result-swimmer-head { display: flex; align-items: center; justify-content: space-between; }
.result-swimmer-head strong { font-size: 14px; }
.round-list { padding-top: 4px; }
.round-row { display: flex; align-items: center; gap: 9px; min-height: 44px; color: var(--muted); font-size: 12px; }
.round-row span:first-child { flex: 1; min-width: 0; color: var(--text); }
.round-row strong { color: var(--aqua); font-variant-numeric: tabular-nums; }
.round-row .details-btn { flex: 0 0 auto; }
.results-list { display: grid; gap: 10px; max-width: 920px; }
.result-person.panel { min-width: 0; overflow: hidden; }
.result-person > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 17px;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
}
.result-person > summary::-webkit-details-marker,
.result-block > summary::-webkit-details-marker { display: none; }
.result-person > summary:focus-visible,
.result-block > summary:focus-visible { outline: 3px solid var(--aqua); outline-offset: -3px; }
.result-person > summary::after,
.result-block > summary::after {
  content: '⌄';
  flex: none;
  color: var(--aqua);
  font-size: 22px;
  line-height: 1;
  transition: transform .15s ease;
}
.result-person[open] > summary::after,
.result-block[open] > summary::after { transform: rotate(180deg); }
.result-person[open] > summary { border-bottom: 1px solid var(--line); }
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; }
.result-summary-main { min-width: 0; }
.result-summary-main strong,
.result-summary-main h2 { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.25; letter-spacing: -.015em; }
.result-summary-side { min-width: 0; max-width: 48%; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--aqua); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-summary-side strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 17px; line-height: 1.2; }
.result-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.3; font-weight: 650; }
.result-person > .result-block,
.result-person > .result-time-row { margin-left: 16px; margin-right: 16px; }
.result-person > .result-time-row { width: calc(100% - 32px); }
.result-block { min-width: 0; border-bottom: 1px solid #2a5161; }
.result-block:last-child { border-bottom: 0; }
.result-block > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; align-content: center; min-height: 50px; padding: 8px 2px; list-style: none; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 800; touch-action: manipulation; }
.result-block > summary > :first-child { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.result-block > summary .result-group-meta { grid-column: 1; margin-left: 0; }
.result-block > summary::after { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-left: 0; font-size: 18px; }
.result-block[open] > summary { color: var(--aqua); }
.result-group-meta { margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.result-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-top: 1px solid #23495a;
  text-align: left;
  touch-action: manipulation;
}
.result-time-row:hover { background: rgba(67, 225, 207, .07); }
.result-time-row:active { background: rgba(67, 225, 207, .12); }
.result-row-left { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.result-row-left small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; font-weight: 600; }
.result-row-time { color: var(--aqua); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-time-row:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--aqua); outline-offset: -3px; border-radius: 8px; }
.reset-zone { max-width: 920px; margin-top: 26px; padding: 15px 17px; border: 1px solid #664650; border-radius: 14px; background: rgba(255, 141, 145, .055); }
.reset-zone > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--danger); font-size: 13px; font-weight: 800; list-style: none; }
.reset-zone > summary::-webkit-details-marker { display: none; }
.reset-zone > summary::after { content: '⌄'; margin-left: auto; font-size: 18px; }
.reset-zone[open] > summary::after { transform: rotate(180deg); }
.reset-zone > summary:focus-visible { outline: 3px solid var(--danger); outline-offset: -3px; }
.reset-zone h2, .reset-zone h3 { margin: 0 0 6px; font-size: 15px; }
.reset-zone p { color: var(--muted); font-size: 12px; margin: 4px 0 14px; }
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(1, 13, 19, .75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(620px, 100%); max-height: min(92dvh, 860px); overflow-y: auto; overscroll-behavior: contain; background: #123545; border: 1px solid #477487; border-radius: 18px; padding: 21px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: -21px -21px 12px; padding: 11px 16px; background: #123545; border-bottom: 1px solid #345e70; }
.modal-head .eyebrow { margin-bottom: 5px; }
.modal h2 { margin-bottom: 15px; }
.modal h2 small { display: block; color: var(--muted); font: 700 12px 'DM Sans', sans-serif; margin-top: 4px; }
.modal > .field { margin-bottom: 15px; }
.manage-group { padding: 17px 0; border-top: 1px solid #3b6575; }
.manage-group h3 { font-size: 14px; margin-bottom: 10px; }
.manage-group p { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
.manage-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 15px; }
.upcoming-leg { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 44px); gap: 6px; align-items: center; margin-bottom: 7px; }
.upcoming-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.upcoming-leg .mini-btn { height: 44px; }
.detail-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.detail-summary > div { min-width: 0; background: #0b2b39; border: 1px solid #2d5869; border-radius: 10px; padding: 11px; }
.detail-summary small, .touch-stat small { display: block; color: var(--soft); font-size: 11px; letter-spacing: .05em; font-weight: 800; }
.detail-summary strong { display: block; margin-top: 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correction-block { border-top: 1px solid #3b6575; padding-top: 18px; margin-top: 18px; }
.correction-block h3 { margin-bottom: 3px; }
.correction-block h3 small { color: var(--muted); font: 700 11px 'DM Sans', sans-serif; }
.correction-block p { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.correction-row { display: flex; align-items: end; gap: 9px; }
.correction-row .field { flex: 1; }
.touch-edit-row { display: grid; grid-template-columns: 24px 65px minmax(0, 1fr) 48px 44px; align-items: end; gap: 6px; border-bottom: 1px solid #285363; padding: 9px 0; }
.touch-index { display: grid; place-items: center; width: 23px; height: 23px; align-self: center; border-radius: 7px; background: #245264; color: var(--aqua); font-size: 11px; font-weight: 800; }
.touch-stat strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.touch-edit-row .field input { height: 44px; min-width: 0; padding: 0 6px; }
.mini-btn { min-width: 44px; min-height: 44px; border: 1px solid #4b7c8b; border-radius: 8px; color: var(--blue); background: #1b4555; font-size: 11px; font-weight: 800; }
.mini-btn.danger { color: var(--danger); font-size: 19px; }
.add-missed { display: flex; align-items: end; gap: 9px; margin-top: 17px; }
.add-missed .field { flex: 1; }
.quiet { color: var(--soft); font-size: 12px; }
.relay-edit-row { display: grid; grid-template-columns: 24px minmax(80px, 1fr) 62px 92px 48px 44px; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid #295262; }
.relay-edit-row input { height: 44px; min-width: 0; font-size: 12px; }
.relay-edit-split { color: var(--aqua); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.confirm-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(1, 13, 19, .78); backdrop-filter: blur(7px); }
.confirm-sheet { width: min(400px, 100%); padding: 25px; border: 1px solid #548092; border-radius: 19px; background: #133746; box-shadow: 0 30px 80px rgba(0, 0, 0, .43); }
.confirm-symbol { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border-radius: 10px; color: var(--orange); background: #554232; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; }
.confirm-sheet h2 { margin-bottom: 7px; }
.confirm-sheet p { color: var(--muted); font-size: 13px; }
.confirm-actions { display: flex; gap: 8px; justify-content: end; margin-top: 22px; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: 24px; transform: translate(-50%, 14px); width: max-content; max-width: calc(100vw - 32px); pointer-events: none; background: var(--text); color: #0a303b; border-radius: 10px; padding: 11px 16px; font-size: 12px; font-weight: 800; opacity: 0; transition: opacity .2s, transform .2s; box-shadow: 0 14px 35px rgba(0, 0, 0, .3); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .header-status { display: none; }
  .main { padding-top: 33px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .tip-panel { display: none; }
  .setup-lanes { grid-template-columns: minmax(0, 1fr); }
  .capture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .app-header { height: 62px; padding: 0 16px; }
  .desktop-nav { display: none; }
  .header-status { display: flex; font-size: 11px; }
  .main { width: calc(100% - 28px); padding: 23px 0 calc(100px + env(safe-area-inset-bottom)); min-height: calc(100vh - 62px); }
  .main:has(.live-page) { padding-top: 16px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(8, 31, 43, .97); backdrop-filter: blur(16px); border-top: 1px solid #356071; }
  .bottom-nav .nav-link { flex-direction: column; gap: 2px; border-radius: 0; padding: 7px 0 5px; font-size: 10px; }
  .bottom-nav .nav-link.active { color: var(--aqua); background: #143949; box-shadow: inset 0 2px var(--aqua); }
  .bottom-nav .nav-icon { font-size: 19px; }
  .section-heading { margin-bottom: 18px; }
  .section-heading p { font-size: 14px; }
  .program-panel { padding: 17px; margin-bottom: 15px; }
  .program-title { margin-bottom: 15px; }
  .program-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .program-split { grid-column: 1 / -1; }
  .program-text-field textarea { min-height: 112px; }
  .program-preview { margin-top: 15px; padding-top: 14px; }
  .program-row, .lane-program-preview .program-row { display: flex; flex-direction: column; align-items: start; gap: 3px; }
  .program-row strong { font-size: 16px; }
  .program-row span { font-size: 12px; }
  .lane-set-field textarea { min-height: 108px; }
  .set-panel { padding: 17px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lane-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lane-fields .field > span { font-size: 12px; }
  .lane-fields input { padding: 0 8px; font-size: 14px; }
  .setup-lane { padding: 16px; }
  .lane-heading { margin-top: 21px; }
  .lane-heading h2 { font-size: 18px; }
  .all-lane-settings-body { grid-template-columns: minmax(0, 1fr); }
  .all-lane-settings-body .field { max-width: none; }
  .all-lane-settings-body .btn { width: 100%; }
  .relay-setup .lane-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .relay-setup .lane-heading .inline-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relay-setup .lane-heading .inline-actions .btn { width: 100%; min-height: 44px; }
  .setup-footer { flex-direction: column; align-items: stretch; }
  .setup-footer .btn { width: 100%; }
  .start-now { padding: 16px; }
  .start-now .btn { flex: 0 0 auto; }
  .live-top { align-items: center; }
  .live-top h1 { font-size: 31px; }
  .live-eyebrow { margin-bottom: 7px; font-size: 10px; }
  .live-clock { margin: 0; padding: 0; }
  .live-clock strong { font-size: 28px; }
  .live-toolbar { margin: 12px 0 15px; }
  .live-toolbar .btn { min-height: 44px; }
  .deck-actions strong { font-size: 15px; }
  .deck-actions .btn { min-width: 74px; }
  .capture-grid, .capture-grid.single { grid-template-columns: minmax(0, 1fr); max-width: none; gap: 11px; }
  .lane-switcher { top: 62px; }
  .quick-touch, .quick-manage { min-height: 66px; }
  .quick-lane { padding: 11px; }
  .quick-touch-word { font-size: 12px; }
  .quick-lane-footer > button { min-height: 44px; }
  .live-lanes, .live-lanes.focused, .relay-live-grid, .result-lanes { grid-template-columns: minmax(0, 1fr); }
  .swimmer-card { grid-template-columns: minmax(0, 1fr) 110px; }
  .touch-btn { width: 100%; }
  .relay-touch small { font-size: 12px; text-align: right; }
  .results-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-tools .btn { min-width: 0; padding: 9px 7px; font-size: 12px; }
  .results-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
  .results-actions > .btn { justify-self: start; }
  .results-actions .inline-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-actions .inline-actions .btn { min-width: 0; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .modal-overlay { align-items: end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 90dvh; width: 100%; padding: 19px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal-head { margin: -19px -16px 12px; padding: 10px 16px 6px; }
  .history-card { align-items: stretch; flex-direction: column; }
  .history-actions .btn { flex: 1; }
  .storage-banner { align-items: stretch; flex-direction: column; }
  .storage-banner .btn { align-self: start; }
}
@media (max-width: 400px) {
  .brand small { display: none; }
  .brand strong { font-size: 18px; }
  .brand-mark { width: 34px; height: 34px; }
  .program-panel { padding: 15px; }
  .program-title h2 { font-size: 20px; }
  .program-title > small { display: none; }
  .program-fields { gap: 8px; }
  .program-row { padding: 10px 11px; }
  .program-example { margin-bottom: 15px; }
  .header-status { font-size: 10px; }
  .lane-heading { align-items: start; }
  .lane-heading .inline-actions { justify-content: end; }
  .lane-heading .inline-actions .btn { min-height: 44px; padding: 8px; font-size: 11px; }
  .swimmer-card { grid-template-columns: minmax(0, 1fr) 106px; }
  .touch-btn { width: 100%; }
  .start-now { flex-direction: column; align-items: stretch; }
  .deck-actions { align-items: center; }
  .relay-edit-row { grid-template-columns: 24px minmax(0, 1fr) 44px 44px; gap: 5px; }
  .relay-edit-row > :nth-child(3) { grid-column: 3 / 5; grid-row: 1; text-align: right; }
  .relay-edit-row > :nth-child(4) { grid-column: 2; grid-row: 2; }
  .relay-edit-row > :nth-child(5) { grid-column: 3; grid-row: 2; }
  .relay-edit-row > :nth-child(6) { grid-column: 4; grid-row: 2; }
  .relay-edit-row input { padding: 0 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
