* { box-sizing: border-box; }

:root {
  color-scheme: light dark;
  --page: #f1f5f4;
  --card: #ffffff;
  --ink: #182525;
  --muted: #647472;
  --line: #dbe4e1;
  --accent: #087f72;
  --accent-soft: #e1f2ee;
  --gold: #ffd400;
  --silver: #d9e2ef;
  --bronze: #ff9a3c;
  --fast: #2fa66a;
  --slow: #d9483b;
  --shadow: 0 12px 34px rgb(22 48 44 / 6%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111918;
    --card: #1b2523;
    --ink: #edf5f2;
    --muted: #a2b3ae;
    --line: #34433f;
    --accent: #68d6c2;
    --accent-soft: #203b36;
    --gold: #ffd400;
    --silver: #d9e2ef;
    --bronze: #ff9a3c;
    --fast: #5bd08e;
    --slow: #ff756a;
    --shadow: 0 14px 36px rgb(0 0 0 / 22%);
  }
}

html { min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #4baea2; outline-offset: 3px; }
.app-shell { width: min(100%, 560px); margin: 0 auto; display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero-card { padding: 20px 20px 16px; }
.eyebrow, .series-label, .section-kicker, .sort-label { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .035em; }
.eyebrow { text-transform: uppercase; }
.race-date { margin: 5px 0 0; color: var(--ink); font-size: 16px; font-weight: 750; line-height: 1.3; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 15px; }
.race-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: clamp(28px, 7.6vw, 38px); }
.race-title-word { white-space: nowrap; }
.course-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--page), var(--card) 28%); font-family: system-ui, sans-serif; letter-spacing: 0; }
.course-toggle button { min-width: 48px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 800; cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.course-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.course-toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: "Arial Narrow", "Roboto Condensed", Impact, system-ui, sans-serif; font-size: clamp(35px, 9vw, 47px); line-height: 1; letter-spacing: -.045em; font-weight: 900; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.conditions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.condition { min-width: 0; display: flex; align-items: center; gap: 5px; padding: 7px 7px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card), var(--page) 35%); }
.condition-icon { color: #d9483b; font-size: 20px; font-weight: 900; line-height: 1; }
.wind-icon { color: #3582d0; }
.condition b, .condition small { display: block; }
.condition b { white-space: nowrap; }
.condition b { font-size: 12px; line-height: 1.2; }
.condition small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.15; }
.view-tabs { display: grid; grid-template-columns: 1fr 1.25fr .75fr .8fr; gap: 4px; padding: 4px; border-radius: 13px; background: color-mix(in srgb, var(--page), var(--card) 28%); }
.view-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.view-tabs button[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 2px 8px rgb(0 0 0 / 8%); }
.view-caption { min-height: 18px; margin: 10px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.card:not(.hero-card) { padding: 17px 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-heading > div { display: flex; align-items: baseline; gap: 8px; }
.section-kicker, .sort-label { font-size: 10px; }
.sort-label { text-align: right; }
.podium-card { transition: opacity .3s ease; }
.versus-card[hidden] { display: none; }
.podium-card .podium-heading { margin-bottom: 18px; }
.podium-card .section-kicker { color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 10px; min-height: 190px; }
.podium-place { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: end; text-align: center; animation: podium-in .3s ease both; }
.podium-place.place-1 { min-height: 184px; }
.podium-place.place-2 { min-height: 160px; }
.podium-place.place-3 { min-height: 140px; }
.podium-place.place-1 { grid-column: 2; }
.podium-place.place-2 { grid-column: 1; }
.podium-place.place-3 { grid-column: 3; }
.trophy { width: 46px; height: 46px; margin-bottom: 7px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 13%)); }
.podium-name { max-width: 100%; padding: 0 2px; border: 0; background: none; color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1.2; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--muted), transparent 25%); text-underline-offset: 2px; cursor: pointer; overflow-wrap: anywhere; }
.podium-value { margin: 5px 0 10px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 650; }
.podium-block { width: 100%; height: 42px; border-radius: 12px 12px 4px 4px; }
.place-1 .podium-block { height: 63px; background: var(--gold); }
.place-2 .podium-block { height: 47px; background: var(--silver); }
.place-3 .podium-block { height: 35px; background: var(--bronze); }
.podium-winners { display: flex; flex: 1; flex-direction: column; justify-content: end; align-items: center; gap: 5px; }
.podium-winner { display: flex; flex-direction: column; align-items: center; }
.results-card { overflow: hidden; }
.list-heading { padding: 0 2px; }
.results-table-wrap { margin: 0 -3px; }
.results-table { width: 100%; }
.table-header, .result-row { display: grid; align-items: center; grid-template-columns: 44px minmax(0, 1fr) 72px 40px; column-gap: 4px; }
.table-header.points-layout, .result-row.points-layout { grid-template-columns: 44px minmax(0, 1fr) 52px 52px 46px; }
.table-header { min-height: 32px; padding: 0 2px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; }
.table-header > span:first-child { text-align: center; }
.table-header > span:not(:nth-child(2)) { text-align: right; }
.table-body { position: relative; }
.result-row { height: 44px; min-height: 44px; padding: 0 2px; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 38%); font-size: 13px; transition: transform 1.2s cubic-bezier(.2,.8,.2,1), height .22s ease, padding .22s ease, opacity .22s ease, background-color .18s ease; }
.result-row:last-child { border-bottom: 0; }
.result-row.is-hidden { height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; pointer-events: none; border: 0; }
.result-row.tint-1 { background: color-mix(in srgb, var(--gold) 16%, var(--card)); }
.result-row.tint-2 { background: color-mix(in srgb, var(--silver) 26%, var(--card)); }
.result-row.tint-3 { background: color-mix(in srgb, var(--bronze) 15%, var(--card)); }
.rank-cell { display: flex; justify-content: center; align-items: center; min-width: 0; font-family: "Arial Narrow", Impact, system-ui, sans-serif; font-size: 17px; font-weight: 900; }
.rank-trophy { width: 21px; height: 22px; }
.name-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-button { max-width: 100%; overflow: hidden; padding: 5px 0; border: 0; background: none; color: var(--ink); font-size: inherit; font-weight: 680; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.value-cell { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.hcp-cell, .races-cell { color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.no-time { color: var(--muted); font-family: inherit; font-size: 11px; font-style: italic; }
.list-footnote { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.definitions-card { margin-bottom: 2px; }
.definition-group + .definition-group { margin-top: 12px; }
.definition-group h3 { margin: 0 0 5px; font-size: 12px; }
.definition-group ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.definition-group li + li { margin-top: 3px; }
.page-footer { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 0 4px; color: var(--muted); font-size: 10px; }
.footer-credit { padding-top: 2px; }
.page-footer a { color: inherit; }
.editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px !important; }
.editor-copy { min-width: 0; display: grid; gap: 3px; }
.editor-copy strong { font-size: 12px; }
.editor-copy span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.editor-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; }
.traffic-card { display: grid; gap: 13px; }
.traffic-card[hidden] { display: none; }
.traffic-card .section-heading { align-items: center; flex-wrap: wrap; margin: 0; }
.traffic-range-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.traffic-range-label select { min-height: 34px; padding: 5px 24px 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }
.traffic-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.traffic-metrics article { display: grid; gap: 3px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--page), var(--card) 45%); }
.traffic-metrics article > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.traffic-metrics article strong { overflow: hidden; font-size: clamp(17px, 5vw, 23px); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.traffic-metrics article small { color: var(--muted); font-size: 9px; line-height: 1.35; }
#traffic-change.is-positive { color: var(--accent); }
#traffic-change.is-negative { color: var(--slow); }
.traffic-status { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.traffic-subsection { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 12px; }
.traffic-subheading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.traffic-subheading h3 { margin: 0; font-size: 11px; }
.traffic-subheading > span { color: var(--muted); font-size: 9px; }
.traffic-chart { display: grid; grid-template-columns: repeat(var(--traffic-days, 30), minmax(2px, 1fr)); align-items: end; gap: 2px; height: 116px; overflow: hidden; margin: 0; padding: 8px 0 0; border-bottom: 1px solid var(--line); list-style: none; }
.traffic-chart li { display: flex; align-items: end; height: 100%; min-width: 0; }
.traffic-chart li span { display: block; width: 100%; height: var(--bar-height); min-height: 0; border-radius: 3px 3px 0 0; background: var(--accent); }
.traffic-chart li span.is-zero { height: 1px; background: var(--line); }
.traffic-chart-axis { display: flex; justify-content: space-between; gap: 5px; padding-top: 5px; color: var(--muted); font-size: 8px; }
.traffic-breakdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.traffic-breakdown { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.traffic-breakdown li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.traffic-breakdown li > span:last-child { display: flex; gap: 7px; color: var(--ink); font-variant-numeric: tabular-nums; }
.traffic-breakdown small { min-width: 28px; color: var(--muted); text-align: right; }
.traffic-details summary { width: fit-content; color: var(--accent); font-size: 10px; font-weight: 750; cursor: pointer; }
.traffic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.traffic-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--page), var(--card) 35%); font-size: 10px; }
.traffic-list li strong { font-variant-numeric: tabular-nums; }
.traffic-privacy-note { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.traffic-card button:disabled { opacity: .55; cursor: wait; }
.primary-button, .secondary-button { min-height: 39px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 750; cursor: pointer; }
.primary-button { background: var(--accent); color: #fff; }
.secondary-button { border-color: var(--line); background: var(--card); color: var(--ink); }
.small-button { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.notice-banner { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 11px; line-height: 1.45; }
.paddler-dialog { position: fixed; inset: auto 0 0; width: min(100%, 560px); max-width: none; max-height: min(86dvh, 780px); margin: 0 auto; padding: 12px 18px max(20px, env(safe-area-inset-bottom)); overflow: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -18px 60px rgb(0 0 0 / 19%); transform: translateY(24px); opacity: 0; transition: transform .25s ease, opacity .25s ease, display .25s allow-discrete; }
.race-picker-dialog { position: fixed; inset: auto 0 0; width: min(100%, 560px); max-width: none; max-height: min(76dvh, 620px); margin: 0 auto; padding: 12px 18px max(20px, env(safe-area-inset-bottom)); overflow: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -18px 60px rgb(0 0 0 / 19%); }
.race-picker-dialog::backdrop { background: rgb(0 0 0 / 42%); }
.race-picker-dialog .sheet-header { margin-bottom: 8px; }
.race-picker-dialog .sheet-header h2 { font-size: 20px; }
.race-picker-explainer { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.race-picker-list { display: grid; gap: 7px; }
.race-picker-list button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.race-picker-list button span:first-child { font-size: 12px; font-weight: 750; }
.race-picker-list button span:last-child { color: var(--muted); font-size: 10px; }
.race-picker-list button:hover { border-color: var(--accent); background: var(--accent-soft); }
.paddler-dialog[open] { transform: translateY(0); opacity: 1; }
.paddler-dialog::backdrop { background: rgb(0 0 0 / 42%); }
.entry-dialog { position: fixed; inset: 0 0 0 auto; width: min(100%, 620px); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; padding: max(14px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); overflow: auto; border: 0; border-left: 1px solid var(--line); background: var(--card); color: var(--ink); box-shadow: -18px 0 60px rgb(0 0 0 / 19%); transform: translateX(24px); opacity: 0; transition: transform .25s ease, opacity .25s ease, display .25s allow-discrete; }
.entry-dialog[open] { transform: translateX(0); opacity: 1; }
.entry-dialog::backdrop { background: rgb(0 0 0 / 42%); }
@starting-style { .entry-dialog[open] { transform: translateX(24px); opacity: 0; } }
.entry-dialog .sheet-header { margin-bottom: 13px; }
.entry-intro { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.entry-draft-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 10px; }
.entry-draft-tools span { flex: 1; }
.entry-draft-tools button { min-height: 30px; padding: 5px 8px; font-size: 10px; }
.entry-top-fields { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.entry-top-fields label, .add-paddler-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.entry-top-fields input, .entry-row input, .entry-row select, .add-paddler-row input { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; }
.planned-races-field { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.planned-races-field input { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; }
.planned-races-field small { font-size: 9px; font-weight: 400; line-height: 1.4; }
.tide-entry { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--page), var(--card) 45%); }
.tide-entry h3 { margin: 0 0 8px; font-size: 12px; }
.tide-location-picker { display: grid; gap: 5px; margin: 10px 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.tide-location-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.tide-location-search input, .tide-location-coordinates input { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 11px; }
.tide-location-picker p { margin: 0; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.4; }
.tide-location-results { display: grid; gap: 5px; max-height: 160px; overflow: auto; }
.tide-location-results button { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: left; font: inherit; font-size: 10px; cursor: pointer; }
.tide-location-coordinates summary { width: fit-content; cursor: pointer; font-size: 9px; font-weight: 600; }
.tide-location-coordinates > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding-top: 6px; }
.tide-location-coordinates label { display: grid; gap: 4px; font-size: 9px; font-weight: 600; }
.tide-entry-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.tide-entry-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.tide-entry-fields input, .tide-entry-fields select { width: 100%; min-height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 10px; }
.tide-entry p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.weather-entry { margin: 13px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--page), var(--card) 45%); }
.weather-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.weather-entry h3, .entry-list-heading h3, .add-paddler-row h3 { margin: 0; font-size: 12px; }
.weather-entry p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.weather-entry .weather-source { margin-top: 8px; font-size: 9px; }
.weather-result { margin-top: 9px; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.45; }
.entry-list-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 7px; }
.entry-list-heading span { color: var(--muted); font-size: 10px; }
.entry-list { display: grid; gap: 7px; }
.entry-row { padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; }
.entry-row-start { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entry-row-name { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.started-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.started-toggle input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
.entry-row-fields { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: end; gap: 7px; margin-top: 8px; }
.entry-row-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.entry-row-fields input, .entry-row-fields select { min-height: 35px; font-size: 11px; }
.entry-row-fields .no-time-toggle { display: flex; align-items: center; gap: 4px; padding: 0 1px 9px; white-space: nowrap; }
.no-time-toggle input { width: 15px; height: 15px; min-height: 15px; accent-color: var(--accent); }
.entry-row.is-not-started .entry-row-fields { display: none; }
.add-paddler-row { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.add-paddler-row > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 6px; }
.save-row { position: sticky; bottom: calc(-1 * max(20px, env(safe-area-inset-bottom))); display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px -18px calc(-1 * max(20px, env(safe-area-inset-bottom))); padding: 11px 18px max(15px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.save-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.35; }
.save-row button { flex: 0 0 auto; }
@starting-style { .paddler-dialog[open] { transform: translateY(24px); opacity: 0; } }
.dialog-backdrop { position: fixed; inset: 0; z-index: 10; background: rgb(0 0 0 / 42%); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.dialog-backdrop.visible { opacity: 1; pointer-events: auto; }
.sheet-grabber { width: 38px; height: 4px; margin: 0 auto 12px; border-radius: 99px; background: var(--line); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.sheet-header h2 { margin-top: 3px; font-size: 23px; }
.close-button { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; }
.sheet-content { display: grid; gap: 16px; }
.profile-section { min-width: 0; }
.profile-section h3 { margin: 0 0 8px; font-size: 13px; }
.form-line { display: flex; align-items: center; gap: 9px; }
.form-track { position: relative; flex: 1; height: 12px; overflow: hidden; border-radius: 99px; background: var(--line); }
.form-zero { position: absolute; z-index: 1; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--muted); opacity: .7; }
.form-fill { position: absolute; top: 0; bottom: 0; min-width: 0; border-radius: inherit; background: var(--accent); }
.form-scale { display: flex; justify-content: space-between; margin: 4px 92px 0 0; color: var(--muted); font-size: 9px; }
.form-value { min-width: 84px; font-size: 12px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.muted-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.history-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.history-table th, .history-table td { padding: 7px 5px; border-bottom: 1px solid var(--line); text-align: right; }
.history-table th:first-child, .history-table td:first-child { text-align: left; }
.history-table th { color: var(--muted); font-size: 10px; }
.history-race { display: block; font-weight: 700; }
.history-actual { display: block; margin-top: 2px; font-size: .8em; font-weight: 400; opacity: .7; }
.history-hcp { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-box { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--page), var(--card) 45%); }
.detail-box span { display: block; color: var(--muted); font-size: 10px; }
.detail-box strong { display: block; margin-top: 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.points-summary { display: flex; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.points-summary span { color: var(--muted); font-size: 11px; }
.points-summary strong { display: block; margin-top: 3px; font-size: 17px; }
.data-note { padding: 9px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 11px; line-height: 1.45; }

@keyframes podium-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 400px) {
  body { padding-right: 9px; padding-left: 9px; }
  .hero-card { padding: 17px 14px 14px; }
  .conditions { gap: 4px; }
  .condition { min-width: 74px; padding: 6px 6px; }
  .condition-icon { font-size: 17px; }
  .condition small { font-size: 8px; }
  .view-tabs { grid-template-columns: 1fr 1.18fr .68fr .74fr; }
  .view-tabs button { font-size: 11px; }
  .card:not(.hero-card) { padding-right: 12px; padding-left: 12px; }
  .table-header, .result-row { column-gap: 2px; }
  .table-header.points-layout, .result-row.points-layout { grid-template-columns: 38px minmax(0, 1fr) 46px 46px 39px; }
  .table-header:not(.points-layout), .result-row:not(.points-layout) { grid-template-columns: 38px minmax(0, 1fr) 68px 35px; }
  .value-cell { font-size: 11px; }
  .name-button { font-size: 12px; }
  .editor-tools { align-items: flex-start; flex-direction: column; }
  .entry-dialog { padding-right: 12px; padding-left: 12px; }
  .tide-entry-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-row-fields { grid-template-columns: 82px minmax(0, 1fr) auto; gap: 5px; }
  .entry-row-fields label { font-size: 8px; }
  .entry-row-fields input, .entry-row-fields select { padding-right: 5px; padding-left: 5px; font-size: 10px; }
  .save-row { margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.podium-card .podium-heading { margin-bottom: 8px; }
.podium-card .view-caption, .versus-card .view-caption { min-height: 0; margin: 0 0 16px; }

/* Condensed podium card: leaves more room for the racers list below */
.card.podium-card { padding: 12px 14px 14px; }
.podium-card .podium-heading { margin-bottom: 2px; }
.podium-card .section-kicker { font-size: 19px; }
.podium-card .view-caption { margin: 0 0 8px; font-size: 12px; }
.podium { min-height: 0; gap: 8px; }
.podium-place.place-1, .podium-place.place-2, .podium-place.place-3 { min-height: 0; }
.trophy { width: 32px; height: 32px; margin-bottom: 3px; }
.podium-name { font-size: 14px; }
.podium-value { margin: 2px 0 5px; font-size: 14px; }
.podium-block { height: 22px; }
.place-1 .podium-block { height: 38px; }
.place-2 .podium-block { height: 29px; }
.place-3 .podium-block { height: 22px; }

.admin-remove { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.danger-button { border-color: #b3261e; color: #b3261e; }

/* Fill from a whiteboard photo (admin entry form) */
.paste-import { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card), var(--page) 40%); }
.paste-import summary { cursor: pointer; font-size: 13px; font-weight: 800; }
.paste-import textarea { display: block; width: 100%; min-height: 110px; margin: 10px 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; }
.paste-import .secondary-button { margin-top: 8px; }
.paste-review { display: grid; gap: 8px; margin-top: 10px; }
.paste-row { padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.paste-row.has-problem { border-color: #b3261e; box-shadow: 0 0 0 2px rgb(179 38 30 / 18%); }
.paste-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.paste-row-top select { flex: 1 1 150px; min-width: 0; min-height: 36px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; }
.paste-row-fields { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 8px; margin-top: 8px; }
.paste-row-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.paste-row-fields input[type="number"], .paste-row-fields input[type="text"] { width: 100%; min-height: 36px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; }
.paste-row-fields .started-toggle { display: flex; align-items: center; gap: 5px; min-height: 36px; font-size: 12px; color: var(--ink); }
.paste-warning { margin: 7px 0 0; color: #b3261e; font-size: 11px; line-height: 1.4; }
