:root {
  color-scheme: light;
  --gold: #dfbf43; --gold-light: #fff9e4; --blue: #3182ed;
  --ink: #22262a; --muted: #626a73; --line: #e7e9ec; --bg: #f4f5f7; --green: #267359; --teal: #006b68;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--blue); }
a:focus-visible, summary:focus-visible, .table-wrap:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.shell { max-width: 1540px; margin: auto; padding: 0 32px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 17px; text-decoration: none; flex-shrink: 0; }
.kotk-mark { position: relative; width: 98px; height: 66px; overflow: hidden; display: block; }
.kotk-mark img { position: absolute; width: 142px; height: 142px; left: -22px; top: -38px; }
.brand-divider { height: 35px; width: 1px; background: #dce0e4; }
.yj-logo { width: 154px; height: auto; display: block; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: #aaaeb4; flex-shrink: 0; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px #26735910; }
.dot.warning { background: #b58018; box-shadow: 0 0 0 4px #b5801810; }
.tag { background: var(--gold-light); color: #6c5608; border: 1px solid #e7cf79; border-radius: 4px; padding: 2px 6px; font-size: 9px; font-weight: 750; letter-spacing: .6px; }
.admin-link { display: inline-flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid #d6e5fa; background: #f7faff; border-radius: 6px; text-decoration: none; font-size: 11px; font-weight: 600; white-space: nowrap; }
.admin-link:hover { background: #edf4ff; border-color: var(--blue); }
.intro { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1fr 310px; align-items: center; gap: 36px; min-height: 190px; margin-top: 24px; padding: 25px 32px; background: #d2bb52 url("/assets/hero-cycling.jpg") center 44% / cover; border-radius: 12px; }
.intro::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, #e8cb66f0 0%, #e8cb66da 36%, #536b452b 67%, #003f3d4d 100%); }
.eyebrow { font-size: 9px; font-weight: 750; letter-spacing: 1.8px; margin: 0 0 7px; color: #746010; }
.hero-copy { max-width: 650px; }
.hero-copy .eyebrow { color: #34300e; font-size: 9px; }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; letter-spacing: -1.3px; font-weight: 800; margin: 0; }
h1 span { color: #22262a; }
.subtitle { font-size: 11px; font-weight: 500; color: #363117; margin: 12px 0 0; }
.clock-card { background: #fffffff2; border: 1px solid #ffffffb0; border-radius: 9px; padding: 16px 22px; box-shadow: 0 8px 30px #00000016; }
.clock-card .eyebrow { margin-bottom: 4px; font-size: 8px; color: #69717a; }
.clock { font-size: 44px; line-height: 1.15; font-weight: 750; letter-spacing: -1.8px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; border-radius: 10px; overflow: hidden; background: #e6e8ea; margin-top: 13px; }
.progress div { height: 100%; background: var(--gold); width: 0; max-width: 100%; transition: width 1s; }
.clock-card > p:last-child { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 9px 0 0; }
.route-bar { display: flex; align-items: center; gap: 28px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 8px; margin-top: 14px; padding: 12px 20px; }
.route-title { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.route-icon { display: flex; align-items: center; justify-content: center; width: 33px; height: 33px; border-radius: 50%; color: var(--teal); background: #edf5f3; font-size: 24px; line-height: 1; }
.route-title .eyebrow { margin-bottom: 1px; font-size: 7px; letter-spacing: 1.3px; color: var(--teal); }
.route-title strong { font-size: 14px; letter-spacing: -.3px; }
.route-facts { display: flex; align-items: center; gap: 30px; margin: 0; }
.route-facts dt { font-size: 7px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.route-facts dd { font-size: 14px; font-weight: 750; margin: 1px 0 0; font-variant-numeric: tabular-nums; }
.route-lead-in { color: var(--muted); font-size: 10px; margin: 0 0 0 auto; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 14px; margin: 16px 0 26px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 15px 19px; }
.metric-total { background: var(--gold-light); border-color: #e8d795; }
.metric p { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1.3px; margin: 0 0 4px; }
.metric-total p { color: #715d15; }
.metrics strong { font-size: clamp(22px, 2.15vw, 30px); letter-spacing: -.75px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics small { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.content-grid { display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); gap: 24px; align-items: start; }
.board { min-width: 0; scroll-margin-top: 16px; }
.segments { min-width: 0; container-type: inline-size; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 43px; margin-bottom: 12px; }
.section-heading .eyebrow { font-size: 8px; margin-bottom: 3px; letter-spacing: 1.5px; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 750; letter-spacing: -.65px; margin: 0; }
.section-heading > span { color: var(--muted); font-size: 10px; text-align: right; margin-bottom: 2px; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead { background: #f8f9fa; }
th { padding: 11px 10px; font-size: 9px; font-weight: 700; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
td { padding: 12px 10px; border-top: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }
th:nth-child(4), th:nth-child(5), th:nth-child(6), td:nth-child(4), td:nth-child(5), td:nth-child(6) { text-align: right; }
td.rank { width: 32px; color: #767d85; text-align: center; padding-right: 3px; }
.rank-badge { display: inline-flex; width: 21px; height: 21px; justify-content: center; align-items: center; border-radius: 50%; font-size: 10px; }
tbody tr:first-child { background: #fffbee; }
tbody tr:first-child .rank-badge { color: #624d06; background: var(--gold); font-weight: 800; }
td.name { font-weight: 650; }
.team-name { display: flex; align-items: center; gap: 7px; white-space: normal; line-height: 1.3; }
.team-color { width: 4px; height: 18px; border-radius: 3px; display: inline-block; background: var(--gold); flex-shrink: 0; }
td.distance { font-size: 14px; font-weight: 750; letter-spacing: -.3px; }
td.gap { color: var(--muted); font-size: 10px; }
td.current-rider { font-size: 12px; font-weight: 550; white-space: normal; line-height: 1.4; min-width: 85px; }
td.name .status { margin: 5px 0 0 11px; font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; background: #f1f2f4; padding: 3px 6px; color: #5d646d; font-size: 8px; white-space: nowrap; }
.status::before { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: #9399a0; }
.status.online { color: #236247; background: #e9f5ed; }
.status.online::before { background: #328a61; }
.status.error, .status.stale { color: #825609; background: #fff3d9; }
.status.error::before, .status.stale::before { background: #b58018; }
.table-note, .rider-note { font-size: 10px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.rider-note { margin-top: 4px; }
.rider-note.warning { color: #825609; }
.segment-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.table-empty { color: var(--muted); text-align: left !important; white-space: normal; padding: 25px 18px; }
.segments h2 { font-size: 25px; }
.segment-grid { display: grid; gap: 18px; }
.segment-card, .empty { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.segment-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px; }
.segment-card h3 { color: var(--ink); font-size: 21px; line-height: 1.2; font-weight: 750; letter-spacing: -.45px; margin: 0; }
.segment-meta { margin: 6px 0 0; color: var(--teal); font-size: 11px; line-height: 1.5; font-weight: 550; }
.podium-label { flex-shrink: 0; background: var(--gold-light); color: #795e0a; border: 1px solid #eadb9d; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; }
.segment-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #f0f1f3; }
.segment-row:first-child { border-top: 0; }
.segment-row.podium-leader .segment-time { color: #907010; }
.segment-rank { display: inline-flex; width: 30px; height: 30px; justify-content: center; align-items: center; border-radius: 50%; color: #616975; background: #f1f3f5; font-size: 14px; font-weight: 750; }
.podium-leader .segment-rank { color: #634a00; background: var(--gold); }
.segment-person { min-width: 0; }
.segment-team { display: block; font-size: 15px; line-height: 1.3; font-weight: 750; overflow-wrap: anywhere; }
.segment-rider { display: block; margin-top: 3px; color: var(--teal); font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.segment-count { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.segment-time { font-size: 29px; line-height: 1.2; letter-spacing: -1px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.segment-remaining, .segment-attempts { border-top: 1px solid var(--line); margin-top: 6px; }
.segment-remaining summary, .segment-attempts summary { color: var(--teal); font-size: 12px; font-weight: 650; padding: 12px 0 2px; cursor: pointer; }
.segment-remaining[open] summary, .segment-attempts[open] summary { padding-bottom: 10px; }
.attempt-list { max-height: 370px; overflow: auto; overscroll-behavior: contain; }
.attempt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 15px; border-top: 1px solid var(--line); padding: 12px 0; }
.attempt-person { grid-row: span 2; min-width: 0; }
.attempt-person strong { display: block; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.attempt-person span { display: block; color: var(--teal); font-size: 14px; font-weight: 550; margin-top: 3px; overflow-wrap: anywhere; }
.attempt-time { text-align: right; font-size: 20px; letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.attempt-finish { text-align: right; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
@container (min-width: 640px) {
  .segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .segment-card:last-child:nth-child(odd) .segment-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .segment-card:last-child:nth-child(odd) .segment-podium .segment-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; border-top: 0; }
  .segment-card:last-child:nth-child(odd) .segment-podium .segment-time { grid-column: 2; }
}
.empty { color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-icon { width: 37px; height: 37px; border-radius: 50%; background: var(--gold-light); color: #90731c; display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink); font-size: 12px; font-weight: 650; }
.empty p { margin: 5px 0 0; }
.alert { margin: -10px 0 20px; background: #fff6dd; color: #795610; border: 1px solid #eedba9; border-radius: 8px; padding: 11px 14px; font-size: 11px; }
.publication-note { margin: -10px 0 20px; }
html[data-public-dashboard] .connection { max-width: 255px; }
footer { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid #e0e3e7; margin-top: 25px; padding: 16px 0 20px; font-size: 9px; color: var(--muted); }
footer strong { color: #424850; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }
@media (min-width: 1700px) {
  .shell { max-width: 1740px; padding: 0 44px; }
  .header-inner { min-height: 80px; }
  .intro { min-height: 180px; padding: 23px 38px; grid-template-columns: 1fr 350px; }
  h1 { font-size: 42px; } .clock { font-size: 50px; }
  .content-grid { grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); gap: 30px; }
  .metric { padding: 17px 24px; } .metrics strong { font-size: 36px; }
  th { font-size: 10px; } td, td.current-rider { font-size: 13px; }
  td.distance { font-size: 17px; } td.gap, .status { font-size: 10px; }
}
@media (max-width: 1200px) {
  .shell { padding: 0 22px; } .content-grid { gap: 18px; }
  th, td { padding-left: 8px; padding-right: 8px; } .intro { padding: 23px 27px; }
}
@media (max-width: 980px) {
  .route-bar { flex-wrap: wrap; gap: 16px 24px; }
  .content-grid { grid-template-columns: 1fr; }
  .segment-grid > .empty { grid-column: 1 / -1; } .segments { margin-top: 5px; }
  th, td { padding: 10px 12px; } .status { font-size: 9px; }
  .header-actions { gap: 13px; } .connection { font-size: 10px; }
  .intro { grid-template-columns: 1fr 280px; gap: 20px; } .clock { font-size: 40px; }
}
@media (max-width: 680px) {
  .shell { padding: 0 16px; } .header-inner { min-height: 76px; gap: 10px; align-items: center; }
  .brand { gap: 9px; } .kotk-mark { width: 61px; height: 49px; }
  .kotk-mark img { width: 106px; height: 106px; left: -22px; top: -27px; }
  .brand-divider { height: 29px; } .yj-logo { width: 105px; }
  .header-actions { align-items: flex-end; flex-direction: column-reverse; gap: 7px; }
  .admin-link { padding: 5px 8px; font-size: 9px; gap: 7px; } .connection { font-size: 8px; gap: 5px; }
  .dot { width: 5px; height: 5px; } .tag { font-size: 7px; padding: 1px 4px; }
  html[data-public-dashboard] .connection { max-width: 130px; }
  .intro { margin-top: 16px; grid-template-columns: 1fr; gap: 20px; padding: 24px; background-position: 63% center; }
  .intro::before { background: linear-gradient(110deg, #e8cb66f0 0%, #e8cb66b0 49%, #00675c26 100%); }
  .hero-copy .eyebrow { font-size: 8px; letter-spacing: 1.2px; } h1 { font-size: 36px; } .subtitle { font-size: 10px; }
  .clock-card { max-width: 100%; padding: 15px 19px; } .clock { font-size: 40px; }
  .route-bar { flex-wrap: wrap; gap: 13px 20px; padding: 13px 16px; margin-top: 12px; }
  .route-title { min-width: 100%; } .route-facts { gap: 22px; }
  .route-lead-in { margin-left: 0; font-size: 9px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 21px; }
  .metric { padding: 13px 15px; } .metric p { font-size: 7px; letter-spacing: .8px; }
  .metrics strong { font-size: 24px; } .metrics small { font-size: 9px; }
  .section-heading { gap: 8px; margin-bottom: 10px; } .section-heading > span { font-size: 8px; max-width: 98px; } h2 { font-size: 21px; }
  table { min-width: 570px; } td, th { padding: 10px 9px; }
  .segment-card { padding: 18px; } .segment-card h3 { font-size: 21px; }
  .segment-row { gap: 10px; } .segment-rider { font-size: 15px; }
  footer { font-size: 8px; flex-direction: column; gap: 4px; margin-top: 21px; } .alert { margin: -5px 0 16px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .progress div { transition: none; } }
