:root {
  color-scheme: light;
  --ink: #17272d;
  --muted: #718087;
  --line: #dce3e2;
  --canvas: #eef1ef;
  --paper: #fbfcfa;
  --dark: #142329;
  --dark-soft: #1e3037;
  --orange: #ee6a3b;
  --orange-dark: #bb4722;
  --mint: #3e8e7b;
  --mint-pale: #e2f1ec;
  --amber-pale: #fff1e9;
  --input: #fff6df;
  --shadow: 0 12px 36px rgba(23, 39, 45, .07);
  font-family: "Segoe UI", "Arial", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.45; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(238, 106, 59, .5); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 clamp(20px, 4vw, 60px); background: var(--dark); color: #fff; display: flex; align-items: center; gap: 35px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 196px; color: inherit; text-decoration: none; }
.org-logo { display: block; width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid #3a484d; border-radius: 50%; background: #fff; object-fit: contain; }
.brand strong { display: block; font-size: 15px; letter-spacing: .13em; line-height: 1.2; }
.brand small { display: block; margin-top: 3px; color: #a5b4b7; font-size: 9px; letter-spacing: .19em; }
.brand-mark { width: 28px; height: 28px; display: flex; align-items: flex-end; gap: 3px; transform: skew(-18deg); }
.brand-mark span { display: block; width: 6px; background: var(--orange); border-radius: 1px 1px 0 0; }
.brand-mark span:nth-child(1) { height: 12px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 28px; opacity: .8; }
.event-control { display: flex; flex-direction: column; gap: 2px; padding-left: 25px; border-left: 1px solid #33454b; min-width: 240px; }
.event-control label { color: #a5b4b7; font-size: 10px; }
.event-control input { width: 220px; padding: 0; border: 0; background: transparent; color: white; font-size: 15px; font-weight: 650; }
.event-control input:focus { outline: 0; border-bottom: 1px solid var(--orange); }
.top-actions { display: flex; gap: 8px; margin-left: auto; }
.button { border: 0; border-radius: 7px; min-height: 40px; padding: 0 14px; font-weight: 650; cursor: pointer; transition: background .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button-quiet { display: inline-flex; align-items: center; gap: 8px; background: #263940; color: #f0f3f2; }
.button-quiet:hover { background: #354a51; }
.button-demo { background: var(--orange); color: #fff; }
.button-demo:hover { background: #d9562a; }
.button-demo[aria-pressed="true"] { background: #bf4a28; }
.button-demo:disabled, .button-quiet:disabled { cursor: not-allowed; opacity: .45; }
.button-quiet svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
main { padding: 35px clamp(18px, 4vw, 60px) 56px; max-width: 1720px; margin: auto; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 27px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(62, 142, 123, .12); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 39px); letter-spacing: -.045em; line-height: 1.08; font-weight: 760; }
.intro-copy { max-width: 620px; margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.stats-strip { display: flex; min-width: 380px; align-items: stretch; border: 1px solid #d6ddda; border-radius: 9px; background: rgba(255,255,255,.48); }
.stat { min-width: 120px; padding: 11px 18px; border-right: 1px solid #d6ddda; }
.stat:last-child { border-right: 0; }
.stat span { display: block; color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin-top: 2px; font-size: 21px; font-variant-numeric: tabular-nums; }
.stat-leader strong { color: var(--orange-dark); }
.workspace { display: grid; grid-template-columns: minmax(365px, 435px) minmax(0, 1fr); gap: 20px; align-items: start; }
.demo-banner { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; padding: 11px 14px; border: 1px solid #efc29d; border-radius: 7px; background: #fff4eb; color: #774326; }
.demo-mark { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 5px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; }
.demo-banner strong { display: block; font-size: 11px; }
.demo-banner p { margin: 1px 0 0; color: #92674e; font-size: 10px; }
.demo-banner .button-demo-light { margin-left: auto; border: 1px solid #e7b18c; background: transparent; color: #9b4a28; font-size: 11px; }
.demo-banner .button-demo-light:hover { background: #ffeadb; }
.demo-mode .entry-panel { opacity: .7; }
.panel { border: 1px solid #e0e5e3; border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.entry-panel { padding: 23px 23px 20px; }
.panel-heading, .standings-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-heading { margin-bottom: 21px; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.input-mark { display: inline-flex; align-items: center; gap: 6px; color: #946b29; background: #fcf2db; padding: 5px 8px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.input-mark span { height: 7px; width: 7px; border-radius: 2px; background: #d1a446; }
.field-grid { display: grid; gap: 13px 12px; }
.identity-grid { grid-template-columns: 110px minmax(0, 1fr); }
.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #495a60; font-size: 11px; font-weight: 650; }
.field-wide { grid-column: 1 / -1; }
.field input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d6dfdc; border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; }
.field input::placeholder { color: #a2acae; }
.unit-input { position: relative; }
.unit-input input { padding-right: 37px; }
.unit-input b { position: absolute; top: 11px; right: 11px; color: #859296; font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid #ebefed; }
.section-heading h3 { margin: 0; font-size: 12px; font-weight: 750; }
.section-heading > span { color: #879396; font-size: 10px; }
.checkpoint-title { align-items: flex-end; margin-bottom: 12px; }
.checkpoint-title p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.score-key { color: var(--orange-dark) !important; font-weight: 750; }
.checkpoint-list { display: grid; gap: 8px; }
.checkpoint { min-width: 0; margin: 0; padding: 9px 10px 8px; border: 1px solid #e1e7e4; border-radius: 7px; background: #f8faf8; }
.checkpoint legend { display: flex; width: 100%; align-items: center; gap: 7px; padding: 0; font-size: 11px; font-weight: 750; }
.checkpoint-number { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--dark); color: #fff; font-size: 10px; }
.checkpoint-value { margin-left: auto; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.check-row { display: flex; min-height: 33px; align-items: center; justify-content: space-between; gap: 10px; padding-left: 26px; color: #58676c; font-size: 10px; }
.check-row + .check-row { border-top: 1px solid #ebefed; }
.choice-group { display: inline-flex; gap: 3px; padding: 2px; border: 1px solid #dfe5e2; border-radius: 5px; background: #eef2ef; }
.choice-group button { min-width: 39px; padding: 4px 7px; border: 0; border-radius: 3px; background: transparent; color: #718087; font-size: 10px; font-weight: 700; cursor: pointer; }
.choice-group button[aria-pressed="true"][data-value="Yes"] { background: var(--mint); color: #fff; }
.choice-group button[aria-pressed="true"][data-value="No"] { background: var(--orange); color: #fff; }
.form-feedback { min-height: 18px; margin-top: 8px; color: var(--orange-dark); font-size: 11px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.button-primary { display: inline-flex; flex: 1; align-items: center; justify-content: space-between; background: var(--orange); color: #fff; padding: 0 14px; }
.button-primary:hover { background: #d9562a; }
.button-primary span:last-child { font-size: 20px; font-weight: 400; }
.hidden { display: none !important; }
.standings-panel { min-width: 0; padding: 23px; }
.standings-heading { margin-bottom: 19px; }
.search-box { display: flex; width: min(240px, 42%); height: 36px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #dce3e0; border-radius: 5px; background: #fff; }
.search-box svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #839195; stroke-width: 1.7; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-box input:focus-visible { outline: 0; }
.leader-banner { display: flex; min-height: 77px; align-items: center; gap: 13px; margin-bottom: 20px; padding: 13px 17px; overflow: hidden; border-radius: 7px; background: var(--dark); color: #fff; }
.leader-flag { display: grid; width: 30px; height: 30px; flex: 0 0 auto; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 4px; transform: skew(-8deg); }
.leader-flag span:nth-child(1), .leader-flag span:nth-child(4) { background: #eef0ea; }
.leader-flag span:nth-child(2), .leader-flag span:nth-child(3) { background: var(--orange); }
.leader-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.leader-copy span { color: #aab9bb; font-size: 10px; }
.leader-copy strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.leader-result { display: flex; align-items: baseline; gap: 6px; margin-left: auto; white-space: nowrap; }
.leader-result strong { color: #ffc08f; font-size: 24px; font-variant-numeric: tabular-nums; }
.leader-result span { color: #aab9bb; font-size: 10px; }
.table-wrap { position: relative; min-height: 180px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead th { padding: 9px 9px; border-bottom: 1px solid #cfd8d5; color: #7b898b; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
tbody td { padding: 12px 9px; border-bottom: 1px solid #ebefed; font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #f7f9f7; }
tbody tr:last-child td { border-bottom: 0; }
.position { width: 39px; color: #718087; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.rank-first { color: var(--orange-dark); }
.competitor-main { display: flex; align-items: center; gap: 8px; }
.bib-chip { display: inline-grid; min-width: 27px; height: 24px; place-items: center; padding: 0 5px; border: 1px solid #d8e0dd; border-radius: 4px; background: #f5f7f5; color: #536267; font-size: 10px; font-weight: 750; }
.competitor-name { min-width: 0; }
.competitor-name strong { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.competitor-name span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.competitor-name small { display: block; max-width: 260px; margin-top: 2px; overflow: hidden; color: #829092; font-size: 8px; text-overflow: ellipsis; }
.number-cell { font-variant-numeric: tabular-nums; }
.time-score { color: var(--orange-dark); font-variant-numeric: tabular-nums; }
.check-total { color: #3d796c; font-variant-numeric: tabular-nums; }
.final-score { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.incomplete-tag { display: inline-flex; padding: 4px 6px; border-radius: 4px; background: #f1f3f1; color: #758184; font-size: 9px; font-weight: 700; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.icon-button { display: inline-grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #879397; cursor: pointer; }
.icon-button:hover { background: #e9eeeb; color: var(--ink); }
.icon-button:disabled { cursor: not-allowed; opacity: .45; }
.icon-button.delete:hover { background: #fff0eb; color: var(--orange-dark); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { display: none; min-height: 175px; align-items: center; justify-content: center; flex-direction: column; padding: 24px; color: var(--muted); text-align: center; }
.empty-state.show { display: flex; }
.empty-route { display: grid; width: 35px; height: 35px; margin-bottom: 9px; place-items: center; border-radius: 50%; background: #edf2ef; color: var(--mint); font-size: 19px; }
.empty-state strong { color: #47575c; font-size: 12px; }
.empty-state p { max-width: 290px; margin: 5px 0 0; font-size: 11px; }
.table-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 15px; border-top: 1px solid #ebefed; color: #8a9698; font-size: 10px; }
.rules-note { display: flex; gap: 10px; padding: 12px; border: 1px solid #dfe9e4; border-radius: 6px; background: #f5f9f6; }
.rules-symbol { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #dcece5; color: #43806f; font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.rules-note strong { color: #526461; font-size: 10px; }
.rules-note p { max-width: 670px; margin: 3px 0 0; color: #758582; font-size: 10px; line-height: 1.5; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px)); padding: 11px 15px; border-radius: 6px; background: var(--dark); color: #fff; box-shadow: 0 10px 35px rgba(0,0,0,.2); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 1440px) {
  .workspace { grid-template-columns: 455px minmax(0, 1fr); gap: 24px; }
  .entry-panel, .standings-panel { padding: 26px; }
  tbody td { padding-top: 14px; padding-bottom: 14px; }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); gap: 14px; }
  .entry-panel, .standings-panel { padding: 18px; }
  .stats-strip { min-width: 320px; }
  .stat { min-width: 100px; padding: 10px 13px; }
}
@media (max-width: 820px) {
  .topbar { height: auto; min-height: 70px; padding: 13px 20px; gap: 15px; flex-wrap: wrap; }
  .brand { min-width: 190px; }
  .event-control { min-width: 0; padding-left: 16px; }
  .event-control input { width: min(220px, 38vw); }
  .top-actions { margin-left: auto; }
  main { padding-top: 25px; }
  .intro-row { align-items: flex-start; flex-direction: column; gap: 18px; }
  .stats-strip { width: 100%; min-width: 0; }
  .stat { flex: 1; }
  .workspace { grid-template-columns: 1fr; }
  .entry-panel { order: 1; }
  .standings-panel { order: 2; }
}
@media (max-width: 520px) {
  .topbar { gap: 10px; }
  .brand { min-width: 0; flex: 1; }
  .event-control { order: 3; width: 100%; padding: 8px 0 0; border-top: 1px solid #33454b; border-left: 0; }
  .event-control input { width: 100%; }
  .top-actions { gap: 5px; }
  .top-actions .button { min-height: 36px; padding: 0 9px; }
  .top-actions .button span { font-size: 11px; }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; }
  .demo-banner .button-demo-light { width: 100%; margin: 2px 0 0 39px; }
  main { padding: 22px 12px 35px; }
  h1 { font-size: 32px; }
  .intro-copy { font-size: 12px; }
  .stat { min-width: 0; padding: 9px 10px; }
  .stat strong { font-size: 18px; }
  .panel { border-radius: 8px; }
  .entry-panel, .standings-panel { padding: 15px 13px; }
  .identity-grid { grid-template-columns: 92px minmax(0,1fr); }
  .standings-heading { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
  .leader-banner { padding: 11px; }
  .leader-copy strong { max-width: 180px; font-size: 13px; }
  .table-foot { flex-direction: column; gap: 3px; }
  .table-wrap { margin: 0 -5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Full-width rally control layout guided by the Imagen UI concept. */
main { max-width: 1780px; padding-top: 29px; }
.workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.entry-panel, .standings-panel { padding: 21px 23px; }
.panel-heading { margin-bottom: 17px; }
.entrant-picker { margin: 0 0 14px; }
.field select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #ccd7d4; border-radius: 5px; background: #f8faf8; color: var(--ink); font-size: 13px; font-weight: 600; }
.identity-grid { grid-template-columns: minmax(120px, .8fr) minmax(220px, 1.5fr) repeat(2, minmax(180px, 1.2fr)); gap: 12px; }
.identity-grid .field:nth-child(2) { grid-column: span 3; }
.field-wide { grid-column: span 2; }
.identity-grid .field:nth-child(7) { grid-column: span 2; }
.field-grid.two-col { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field-grid.two-col .field { grid-column: span 2; }
.section-heading { margin-top: 17px; margin-bottom: 9px; padding-top: 13px; }
.checkpoint-title { margin-bottom: 11px; }
.checkpoint-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.checkpoint { padding: 12px 13px 9px; background: #fbfcfa; }
.checkpoint legend { font-size: 12px; }
.check-row { min-height: 37px; font-size: 11px; }
.form-actions { max-width: 420px; margin-top: 10px; }
.standings-panel { padding-top: 22px; }
.standings-heading { margin-bottom: 13px; }
.table-wrap { min-height: 120px; }
table { min-width: 1150px; }
thead th { padding-top: 11px; padding-bottom: 11px; background: #f2f5f3; }
tbody td { padding-top: 11px; padding-bottom: 11px; }
.competitor-name strong { max-width: 250px; font-size: 12px; }
.competitor-name span { max-width: 280px; font-size: 9px; }
.competitor-name small { max-width: 280px; font-size: 9px; }
.position { font-size: 13px; }
.final-score { color: var(--orange-dark); font-size: 14px; }
.leader-banner { min-height: 66px; margin-bottom: 15px; }
.table-foot { padding-top: 12px; }

@media (max-width: 1080px) {
  .identity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .identity-grid .field:nth-child(2) { grid-column: span 3; }
}
@media (max-width: 820px) {
  .identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .identity-grid .field:nth-child(2) { grid-column: span 1; }
  .identity-grid .field:nth-child(7) { grid-column: span 2; }
  .checkpoint-list { grid-template-columns: 1fr; }
  .checkpoint { padding: 10px 12px; }
  table { min-width: 1000px; }
}
@media (max-width: 520px) {
  .entry-panel, .standings-panel { padding: 15px 13px; }
  .identity-grid { grid-template-columns: minmax(84px, .8fr) minmax(0, 1.2fr); gap: 11px; }
  .identity-grid .field:nth-child(2) { grid-column: span 1; }
  .identity-grid .field-wide, .identity-grid .field:nth-child(7) { grid-column: span 2; }
  .field-grid.two-col { grid-template-columns: 1fr 1fr; }
  .field-grid.two-col .field { grid-column: span 1; }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; }
  .demo-banner .button-demo-light { width: 100%; margin: 2px 0 0 39px; }
}

/* Imagen standings reference: event header, score entry band, demo strip, then results. */
:root {
  --ink: #18232c;
  --muted: #67747e;
  --line: #cbd3da;
  --canvas: #f1f3f5;
  --paper: #ffffff;
  --dark: #25282c;
  --dark-soft: #333a42;
  --orange: #f16b00;
  --orange-dark: #c95000;
  --mint: #309b58;
  --mint-pale: #e4f3e8;
  --amber-pale: #fff0e5;
  --shadow: 0 2px 8px rgba(30, 42, 51, .06);
}
body { background: #f1f3f5; }
.topbar { height: 52px; min-height: 52px; padding: 0 22px; gap: 24px; background: #25282c; }
.brand { min-width: 228px; gap: 9px; }
.org-logo { width: 36px; height: 36px; flex-basis: 36px; border: 0; }
.brand strong { font-size: 20px; letter-spacing: .055em; }
.brand small { display: none; }
.event-control { min-width: 0; padding-left: 24px; border-left-color: #51565d; }
.event-control label { display: none; }
.event-control input { width: clamp(190px, 24vw, 320px); height: 36px; font-size: 17px; font-weight: 600; }
.top-actions .button { min-height: 34px; border-radius: 4px; padding: 0 14px; font-size: 14px; }
.top-actions .button-demo { background: #f16b00; color: #fff; }
main { max-width: 1740px; padding: 14px 10px 30px; }
.intro-row { min-height: 68px; align-items: center; margin-bottom: 10px; padding: 0 12px; }
.intro-row .eyebrow, .intro-copy { display: none; }
.intro-row h1 { font-size: clamp(30px, 3vw, 38px); letter-spacing: -.045em; }
.stats-strip { min-width: 0; gap: 22px; border: 0; background: transparent; }
.stat { display: flex; width: clamp(180px, 18vw, 265px); min-width: 0; align-items: center; gap: 12px; padding: 9px 15px; border: 1px solid #cbd3da; border-radius: 5px; background: #f8f9fa; }
.stat:last-child { border-right: 1px solid #cbd3da; }
.stat svg { width: 25px; height: 25px; flex: 0 0 auto; fill: none; stroke: #46515a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat span { font-size: 12px; font-weight: 650; }
.stat strong { margin: 0; font-size: 24px; line-height: 1.1; }
.stat > div { display: flex; flex-direction: column; gap: 2px; }
.stat-leader strong { color: var(--ink); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.entry-panel { padding: 0; overflow: visible; border: 1px solid #c5cdd4; border-radius: 5px; box-shadow: none; }
.panel-heading { min-height: 43px; margin: 0; padding: 8px 18px; border-bottom: 1px solid #d1d8de; background: #e8ebef; }
.panel-heading h2 { font-size: 19px; }
.entrant-picker { display: flex; width: min(360px, 38vw); margin: 0; }
.entrant-picker select { height: 34px; background: #fff; font-size: 12px; }
#competitorForm { padding: 9px 19px 11px; }
.race-entry-grid { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(175px, 1.5fr) repeat(2, minmax(140px, 1.25fr)) repeat(4, minmax(100px, .95fr)); gap: 8px 10px; margin: 0 10px; }
.field { gap: 4px; color: #28333b; font-size: 11px; font-weight: 700; }
.field input, .field select { height: 33px; padding: 0 9px; border-color: #c8d0d7; border-radius: 4px; background: #fff; font-size: 13px; }
.unit-input b { top: 9px; right: 9px; font-size: 10px; }
.entrant-extras { margin-top: 3px; color: #5b6871; font-size: 9px; line-height: 1.2; }
.entrant-extras summary { width: fit-content; cursor: pointer; }
.entrant-extras summary:hover { color: var(--orange-dark); }
.extras-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 9px; }
.scoring-row { display: grid; grid-template-columns: 142px repeat(3, minmax(0, 1fr)) 136px; align-items: stretch; gap: 0; margin-top: 9px; padding-top: 7px; border-top: 1px solid #cfd6dc; }
.checkpoint-intro { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 12px 0 2px; }
.checkpoint-intro h3 { margin: 0; color: #222b33; font-size: 15px; line-height: 1.18; }
.checkpoint-intro span { color: #67747e; font-size: 10px; }
.checkpoint { min-width: 0; padding: 2px 12px 3px; border: 0; border-right: 1px solid #cfd6dc; border-radius: 0; background: transparent; }
.checkpoint[data-point="3"] { border-right: 0; }
.checkpoint legend { margin-bottom: 4px; font-size: 11px; }
.checkpoint-number { display: none; }
.checkpoint-value { display: none; }
.check-row { min-height: 31px; padding-left: 0; color: #343e45; font-size: 10px; }
.choice-group { padding: 2px; border-color: #cbd3d9; border-radius: 4px; background: #f3f5f6; }
.choice-group button { min-width: 45px; padding: 5px 8px; background: #fff; color: #45515a; font-size: 10px; }
.choice-group button span { margin-right: 2px; font-size: 11px; font-weight: 850; }
.choice-group button[aria-pressed="true"][data-value="Yes"] { background: #e4f3e8; color: #267842; box-shadow: inset 0 0 0 1px #82c394; }
.choice-group button[aria-pressed="true"][data-value="No"] { background: #fff0e8; color: #b44620; box-shadow: inset 0 0 0 1px #e7a58c; }
.score-submit { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding-left: 12px; border-left: 1px solid #cfd6dc; }
.score-preview { display: flex; flex-direction: column; gap: 3px; color: #343e45; font-size: 10px; font-weight: 700; }
.score-preview strong { display: block; padding: 6px 8px; border: 1px solid #cbd3d9; border-radius: 4px; background: #f6f7f8; font-size: 21px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.button-primary { min-height: 34px; justify-content: center; border-radius: 4px; background: #f16b00; font-size: 12px; }
.button-primary span:last-child { font-size: 12px; font-weight: 700; }
.button-primary:hover { background: #d95f00; }
.form-actions { min-height: 0; margin: 0; }
.form-feedback { min-height: 0; margin-top: 3px; font-size: 10px; }
.form-feedback:not(:empty) { min-height: 14px; }
.standings-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.standings-heading { justify-content: flex-end; min-height: 57px; margin: 0; }
.results-tools { display: flex; align-items: center; gap: 10px; }
.search-box { display: none; }
.button-export { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; border: 1px solid #c7d0d6; border-radius: 4px; background: #fff; color: #253039; font-size: 11px; }
.button-export:hover { background: #f1f4f5; }
.button-export svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.leader-banner { display: none; }
.table-wrap { min-height: 120px; overflow-x: auto; border: 1px solid #c8d0d7; border-radius: 4px; background: #fff; }
table { width: 100%; min-width: 1280px; table-layout: fixed; border-collapse: collapse; }
thead th { padding: 7px 6px; border-bottom: 1px solid #4b535b; background: #30373e; color: #fff; font-size: 12px; letter-spacing: .015em; text-align: center; white-space: normal; line-height: 1.2; }
thead th.score-head { background: #f16b00; }
thead th:nth-child(1) { width: 3.4%; }
thead th:nth-child(2) { width: 5%; }
thead th:nth-child(3) { width: 10%; }
thead th:nth-child(4), thead th:nth-child(5) { width: 8.5%; }
thead th:nth-child(6) { width: 7.5%; }
thead th:nth-child(7) { width: 7%; }
thead th:nth-child(8), thead th:nth-child(9) { width: 6%; }
thead th:nth-child(10) { width: 6.5%; }
thead th:nth-child(11), thead th:nth-child(12) { width: 5%; }
thead th:nth-child(13) { width: 6%; }
thead th:nth-child(14) { width: 5.5%; }
thead th:nth-child(15) { width: 4%; }
thead th:nth-child(16) { width: 6.1%; }
tbody tr { height: 28px; cursor: pointer; }
tbody tr:nth-child(odd) { background: #f5f6f7; }
tbody tr:nth-child(even) { background: #fff; }
tbody tr:hover { background: #edf3f5; }
tbody tr:focus-visible { outline: 2px solid #f16b00; outline-offset: -2px; }
tbody td { max-width: 0; padding: 4px 6px; overflow: hidden; border-bottom: 1px solid #e0e4e7; color: #27313a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.position { width: auto; padding: 3px; border-radius: 3px; color: #37434a; font-size: 11px; text-align: center; }
.position.rank-first { background: #f16b00; color: #fff; }
.number-cell { text-align: center; font-variant-numeric: tabular-nums; }
.person-cell { font-weight: 600; }
.check-pill { display: inline-block; min-width: 40px; padding: 3px 6px; border-radius: 10px; background: #e2f2e7; color: #2f7643; font-size: 10px; font-weight: 700; text-align: center; }
.final-score { background: #fff0e2; color: #252c32; font-size: 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.time-score, .check-total { text-align: center; font-variant-numeric: tabular-nums; }
.time-score { color: #303840; font-weight: 650; }
.row-actions { justify-content: center; }
.icon-button { width: 24px; height: 24px; }
.table-foot { display: none; }
.rules-note { display: none; }
.empty-state { min-height: 150px; }
.demo-banner { min-height: 54px; margin: 15px 0 12px; padding: 8px 16px; border-color: #f0d0b7; border-radius: 4px; background: #fff0e5; }
.demo-mark { width: 22px; height: 22px; background: transparent; color: #df6200; font-size: 16px; }
.demo-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-message { display: flex; align-items: baseline; gap: 8px; }
.demo-message strong { white-space: nowrap; color: #82421a; font-size: 11px; }
.demo-message p { color: #303a40; font-size: 10px; }
.demo-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.demo-action-label { color: #202a32; font-size: 11px; white-space: nowrap; }
.demo-banner .button-demo-light, .button-reset { min-height: 30px; margin: 0; padding: 0 10px; border: 1px solid #d5c7bd; border-radius: 4px; background: #fff; color: #333c43; font-size: 10px; }
.demo-banner .button-demo-light:hover, .button-reset:hover { background: #f8e7dc; }
.button-reset { font-weight: 750; }
.demo-mode .entry-panel { opacity: 1; }

/* Public event view: results stay visible while scoring controls require organizer access. */
body:not(.is-admin) .entry-panel { display: none; }
.top-actions { display: flex; gap: 8px; align-items: center; }
#organizerButton { border: 1px solid #687078; background: transparent; color: #fff; }
#organizerButton:hover { background: #3a4148; }
.organizer-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid #d6dce1; border-radius: 12px; box-shadow: 0 22px 70px #10192040; }
.organizer-dialog::backdrop { background: #10192099; backdrop-filter: blur(3px); }
.organizer-dialog form { display: grid; gap: 12px; padding: 28px; }
.organizer-dialog h2 { margin: 0; color: #1b2730; font-size: 23px; }
.organizer-dialog p { margin: 0; color: #55616a; font-size: 15px; }
.organizer-dialog p.eyebrow { color: #bf5100; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.organizer-dialog label { margin-top: 8px; color: #26323a; font-size: 14px; font-weight: 700; }
.organizer-dialog input { height: 44px; padding: 0 12px; border: 1px solid #b9c3cb; border-radius: 6px; font: inherit; }
.login-error { min-height: 20px; color: #b42318; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions .button-primary { padding: 0 16px; }

@media (max-width: 1120px) {
  .race-entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-strip { gap: 8px; }
  .stat { width: 170px; padding: 8px 10px; }
}
@media (max-width: 820px) {
  .topbar { min-height: 58px; height: auto; padding: 6px 14px; gap: 12px; }
  .brand { min-width: 190px; }
  .event-control { padding-left: 13px; }
  .intro-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .stats-strip { width: 100%; }
  .stat { width: auto; flex: 1; }
  .race-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scoring-row { grid-template-columns: 1fr; gap: 8px; }
  .checkpoint-intro { padding: 4px 0; }
  .checkpoint-intro h3 br { display: none; }
  .checkpoint-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-submit { flex-direction: row; align-items: flex-end; justify-content: flex-end; padding: 10px 0 0; border-top: 1px solid #cfd6dc; border-left: 0; }
  .score-preview { width: 125px; }
  .demo-banner { flex-wrap: wrap; }
  .demo-actions { width: 100%; margin-left: 34px; }
  .demo-message { flex-direction: column; gap: 0; }
}
@media (max-width: 540px) {
  main { padding: 12px 8px 24px; }
  .topbar { align-items: center; }
  .brand { min-width: 0; }
  .event-control { min-width: 0; width: 100%; order: 3; padding: 5px 0 0; border-top: 1px solid #51565d; border-left: 0; }
  .event-control input { width: 100%; }
  .intro-row h1 { font-size: 28px; }
  .stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
  .stat { align-items: flex-start; flex-direction: column; gap: 3px; padding: 7px; }
  .stat svg { width: 18px; height: 18px; }
  .stat strong { font-size: 17px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .entrant-picker { width: 100%; }
  #competitorForm { padding: 10px; }
  .race-entry-grid, .extras-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .race-entry-grid .field:nth-child(2), .race-entry-grid .field:nth-child(3), .race-entry-grid .field:nth-child(4) { grid-column: span 2; }
  .checkpoint-list { grid-template-columns: 1fr; }
  .checkpoint { padding: 7px 4px; border-left: 0; border-top: 1px solid #cfd6dc; }
  .checkpoint:first-child { border-top: 0; }
  .demo-actions { flex-direction: column; margin: 0 0 0 34px; }
  .demo-actions .button { width: 100%; }
  .standings-heading { justify-content: stretch; }
  .results-tools { width: 100%; flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  table { min-width: 1400px; }
}
