
:root {
  --deep: #071f19;
  --deep-2: #0d2d24;
  --forest: #164b3a;
  --forest-2: #22664f;
  --paper: #f5f1e7;
  --paper-2: #fbfaf6;
  --white: #ffffff;
  --ink: #17231e;
  --muted: #66746d;
  --line: #d9ded8;
  --gold: #c89b45;
  --gold-light: #ecd39d;
  --red: #c74444;
  --green: #2d7a52;
  --shadow: 0 18px 50px rgba(8, 31, 25, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, iframe { max-width: 100%; }
::selection { background: var(--gold-light); color: var(--deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 200;
  transform: translateY(-150%);
  background: var(--gold);
  color: var(--deep);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--gold-light);
  font: 15px Georgia, serif;
  letter-spacing: 0.04em;
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(18px, 3.5vw, 60px);
  background: var(--deep);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { min-width: 230px; display: inline-flex; align-items: center; gap: 12px; font-family: Georgia, serif; font-size: 20px; }
.nav { height: 100%; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2.4vw, 38px); flex: 1; }
.nav a { height: 100%; display: inline-flex; align-items: center; gap: 7px; position: relative; color: #c8d2cd; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); transform: scaleX(0); transition: transform .2s ease; }
.nav a:hover, .nav a.active { color: white; }
.nav a.active::after { transform: scaleX(1); }
.live-mini, .live-pill i, .pulse { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255, 90, 90, .45); animation: pulse 1.5s infinite; }
.header-tools { min-width: 230px; margin-left: auto; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #4f665d; border-radius: 999px; padding: 9px 12px; color: #e4ebe7; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.search-trigger { width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: white; font-size: 24px; line-height: 1; transition: background .2s ease; }
.search-trigger:hover { background: rgba(255,255,255,.1); }
.admin-link { height: 38px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--gold); color: var(--gold-light); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.menu-button { display: none; }
.header-search { position: absolute; right: 3.5vw; top: 72px; width: min(450px, calc(100vw - 36px)); padding: 18px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--gold); box-shadow: 0 18px 45px rgba(3,21,16,.3); }
.header-search label { display: block; margin-bottom: 9px; color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.header-search > div { display: flex; }
.header-search input { height: 45px; min-width: 0; flex: 1; border: 1px solid var(--line); padding: 0 12px; background: white; }
.header-search button { height: 45px; border: 0; padding: 0 17px; background: var(--forest); color: white; font-size: 11px; font-weight: 800; }
.header-search button:disabled { opacity: .5; }

.hero { height: min(720px, calc(100vh - 72px)); min-height: 590px; position: relative; overflow: hidden; background: var(--deep); color: white; }
.hero-photo { position: absolute; inset: 0; background: url('../images/hero-race.png') center 42% / cover no-repeat; animation: heroZoom 13s ease-out both; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,29,24,.98) 0%, rgba(4,29,24,.86) 35%, rgba(4,29,24,.28) 76%, rgba(4,29,24,.12) 100%), linear-gradient(0deg, rgba(4,29,24,.62), transparent 45%); }
.hero-copy { position: relative; z-index: 1; max-width: 710px; padding: clamp(80px, 10vh, 120px) clamp(24px, 7vw, 110px); }
.overline { margin: 0 0 17px; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.overline.gold { color: var(--gold); }
.live-text { color: #d75a5a; }
.hero h1, .page-heading h1 { margin: 0; font: clamp(52px, 6.3vw, 88px)/.96 Georgia, serif; letter-spacing: -.045em; }
.hero h1 em, .page-heading h1 em { color: var(--gold-light); font-weight: 400; }
.hero-copy > p:not(.overline) { max-width: 610px; margin: 28px 0 0; color: #d1dcd7; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; }
.button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid transparent; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.button.primary { background: var(--gold); color: var(--deep); }
.button.secondary { border-color: #6c8279; color: white; }
.button:hover { transform: translateY(-1px); }

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper-2); border-bottom: 1px solid var(--line); }
.trust-strip div { min-height: 100px; display: flex; flex-direction: column; justify-content: center; padding: 22px clamp(18px, 3vw, 42px); border-right: 1px solid var(--line); }
.trust-strip div:last-child { border-right: 0; }
.trust-strip b { color: var(--forest); font: 19px Georgia, serif; }
.trust-strip span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.data-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(440px, .85fr); gap: 20px; padding: 28px clamp(18px, 3.5vw, 60px); }
.race-card, .leaders-card, .database-card, .contest-grid article, .learn-grid article { background: var(--paper-2); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.race-card:hover, .leaders-card:hover, .contest-grid article:hover, .learn-grid article:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c7cfc8; }
.card-kicker { min-height: 49px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--forest); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.card-kicker span { display: inline-flex; align-items: center; gap: 9px; }
.card-kicker small { color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.preview-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.race-title { min-height: 115px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.race-title h2 { margin: 0; color: var(--forest); font: 28px Georgia, serif; }
.race-title h2 em { margin-left: 7px; color: var(--muted); font: 13px Arial, sans-serif; }
.post { min-width: 76px; padding-left: 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.post strong { color: var(--forest); font: 27px Georgia, serif; }
.post small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.race-facts { display: grid; grid-template-columns: repeat(4, 1fr); padding: 11px 18px; background: #eef1eb; border-block: 1px solid var(--line); }
.race-facts span { border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.race-facts span:last-child { border-right: 0; }
.runner-table .tr { min-height: 46px; padding: 0 14px; display: grid; grid-template-columns: 38px minmax(130px, 1.35fr) minmax(110px, .9fr) 45px; align-items: center; border-bottom: 1px solid var(--line); font-size: 11px; }
.runner-table .tr.th { min-height: 34px; color: var(--muted); background: #faf8f2; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.runner-table .tr strong { color: var(--forest); }
.cloth { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #777; color: white; font-size: 10px; }
.c1 { background: #d92f2f; } .c2 { background: #eee; color: #222; } .c3 { background: #3368b2; } .c4 { background: #f0d447; color: #222; } .c5 { background: #2e8a4c; }
.card-actions { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-actions a { color: var(--forest); font-size: 10px; font-weight: 800; }
.card-actions .watch-button { padding: 11px 13px; background: var(--forest); color: white; }
.tabs { display: flex; gap: 3px; }
.tabs button { border: 0; padding: 7px 9px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; }
.tabs button.selected { background: var(--forest); color: white; }
.lr { min-height: 50px; padding: 0 14px; display: grid; grid-template-columns: 46px minmax(120px, 1fr) 55px 55px 100px; align-items: center; border-bottom: 1px solid var(--line); font-size: 11px; }
.lr.lh { min-height: 34px; background: #faf8f2; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lr strong { color: var(--forest); }
.money { color: #7a5a18; text-align: right; }
.card-link { min-height: 58px; padding: 0 18px; display: flex; align-items: center; color: var(--forest); font-size: 10px; font-weight: 800; }

.feature-band { display: grid; grid-template-columns: 1.2fr repeat(3, .8fr); background: var(--deep); color: white; }
.feature-band > div { padding: 58px clamp(25px, 4vw, 60px); }
.feature-band h2 { margin: 0; font: clamp(31px, 3vw, 46px)/1.05 Georgia, serif; }
.feature-tile { min-height: 260px; padding: 44px 30px; display: flex; flex-direction: column; justify-content: flex-end; border-left: 1px solid #28443a; transition: background .2s ease; }
.feature-tile:hover { background: #11372c; }
.feature-tile > span { margin-bottom: auto; color: var(--gold); font-size: 11px; }
.feature-tile b { font: 25px Georgia, serif; }
.feature-tile small { margin-top: 9px; color: #aebdb6; font-size: 11px; line-height: 1.55; }

footer { padding: 34px clamp(18px, 3.5vw, 60px); display: grid; grid-template-columns: auto 1fr auto; gap: 18px 40px; align-items: center; background: #061812; color: #c2cec8; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: white; font-family: Georgia, serif; }
footer p { color: #94a59d; font-size: 12px; }
footer > div:nth-of-type(2) { display: flex; justify-content: flex-end; gap: 20px; }
footer > div:nth-of-type(2) a { font-size: 10px; font-weight: 800; }
footer small { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid #20362d; color: #71847b; font-size: 9px; }

.inner { min-height: calc(100vh - 72px); padding: 68px clamp(18px, 5vw, 82px) 80px; }
.page-heading { max-width: 860px; margin-bottom: 38px; }
.page-heading.split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.page-heading h1 { color: var(--forest); font-size: clamp(48px, 5.7vw, 78px); }
.page-heading > p:not(.overline), .page-heading > div > p:not(.overline) { max-width: 680px; margin: 20px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.source-badge { display: inline-flex; align-items: center; width: fit-content; padding: 7px 10px; border-radius: 999px; background: #e9dfc8; color: #755a1d; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.source-badge.live { background: #dceee4; color: #22633f; }
.source-badge.loading { animation: pulseFade 1.2s infinite; }
.search-panel { display: grid; grid-template-columns: 1fr 220px; gap: 12px; margin-bottom: 16px; padding: 18px; background: var(--deep); }
.search-panel label { color: var(--gold-light); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-panel input, .search-panel select { width: 100%; height: 46px; margin-top: 8px; border: 1px solid #455e55; padding: 0 13px; background: white; color: var(--ink); text-transform: none; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; background: var(--paper-2); border: 1px solid var(--line); }
.stat-strip div { min-height: 92px; padding: 20px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.stat-strip div:first-child { border-left: 0; }
.stat-strip b { color: var(--forest); font: 25px Georgia, serif; }
.stat-strip span { margin-top: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.results-bar { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.results-bar b { color: var(--forest); }
.db-row { min-height: 64px; padding: 0 18px; display: grid; grid-template-columns: 65px minmax(180px, 1.5fr) 80px 80px 90px 130px; align-items: center; border-bottom: 1px solid var(--line); font-size: 12px; }
.db-row.db-head { min-height: 38px; background: var(--deep); color: white; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.db-row:not(.db-head):hover { background: #fbf5e9; }
.db-row > span:nth-child(2) { display: flex; flex-direction: column; }
.db-row strong { color: var(--forest); font-size: 13px; }
.db-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state > span { width: 50px; height: 50px; margin: auto; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 24px; }
.empty-state h2 { margin: 16px 0 7px; color: var(--forest); font: 28px Georgia, serif; }
.empty-state p { color: var(--muted); }
.empty-state button { border: 0; background: transparent; color: var(--forest); font-weight: 800; text-decoration: underline; }

.track-chips { margin: -10px 0 20px; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; }
.track-chips button { flex: none; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 10px; font-weight: 800; }
.track-chips button.on { background: var(--forest); border-color: var(--forest); color: white; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.updates { margin-top: 20px; padding: 24px; background: var(--paper-2); border: 1px solid var(--line); }
.updates-head { display: flex; align-items: center; justify-content: space-between; }
.updates-head h2 { margin: 0 0 14px; color: var(--forest); font: 28px Georgia, serif; }
.updates-head small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.updates > div:not(.updates-head) { min-height: 54px; display: grid; grid-template-columns: 90px 110px 1fr; align-items: center; gap: 8px; border-top: 1px solid var(--line); font-size: 11px; }
.updates > div.pinned { border-left: 3px solid var(--gold); padding-left: 12px; background: #fffaf0; }
.updates time { color: var(--muted); font-size: 9px; }
.updates b { color: var(--forest); text-transform: capitalize; }
.updates-empty { padding: 24px 12px; margin: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.schedule { align-self: start; background: var(--deep); color: white; }
.schedule .card-kicker { color: var(--gold-light); border-color: #28443a; }
.schedule a { min-height: 92px; padding: 18px; display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid #28443a; }
.schedule a b { color: white; font: 20px Georgia, serif; }
.schedule a span { grid-column: 1; margin-top: 6px; color: #9fb0a8; font-size: 10px; line-height: 1.5; }
.schedule a strong { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--gold); }

.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.learn-grid article { min-height: 260px; padding: 26px; display: flex; flex-direction: column; }
.learn-grid article.featured { border-color: var(--gold); box-shadow: inset 0 4px 0 var(--gold); }
.learn-grid article > span { color: var(--gold); font: 25px Georgia, serif; }
.learn-grid article > p:first-of-type { margin: 30px 0 10px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.learn-grid h2 { margin: 0; color: var(--forest); font: 25px Georgia, serif; }
.learn-grid h2 + p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.learn-grid button { margin-top: auto; border: 0; padding: 0; background: transparent; color: var(--forest); font-size: 10px; font-weight: 800; text-align: left; }
.lesson-reader { margin-top: 18px; padding: 32px; display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 30px; align-items: center; background: var(--deep); border: 1px solid var(--gold); color: white; }
.lesson-reader h2 { margin: 8px 0; font: 32px Georgia, serif; }
.lesson-reader > div > p:last-child { color: #b7c3bd; line-height: 1.6; }
.lesson-reader ol { margin: 0; padding: 0; list-style: none; }
.lesson-reader li { padding: 10px 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #27463d; font-size: 13px; }
.lesson-reader li span { width: 24px; height: 24px; display: grid; place-items: center; flex: none; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 10px; }
.lesson-reader > a { padding: 13px 16px; background: var(--gold); color: var(--deep); font-size: 11px; font-weight: 800; white-space: nowrap; }
.glossary { margin-top: 18px; padding: 30px; display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 28px; background: var(--paper-2); border: 1px solid var(--line); }
.glossary h2 { margin: 0; color: var(--forest); font: 28px Georgia, serif; }
.glossary > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.glossary > b { color: #745715; font: 20px Georgia, serif; }

.notice { margin-bottom: 18px; padding: 16px 18px; display: flex; gap: 20px; background: #fff5d9; border: 1px solid #e2c985; color: #66501e; font-size: 11px; }
.notice b { flex: none; text-transform: uppercase; letter-spacing: .06em; }
.contest-alert { margin-bottom: 14px; padding: 13px 16px; border-left: 3px solid var(--gold); background: var(--paper-2); color: var(--forest); font-size: 12px; }
.contest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contest-grid article { min-height: 320px; padding: 27px; display: flex; flex-direction: column; }
.contest-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.contest-top span { color: #7b5b18; }
.contest-grid h2 { margin: 46px 0 10px; color: var(--forest); font: 29px Georgia, serif; }
.contest-grid p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.contest-grid time { margin-top: auto; color: var(--forest); font-size: 10px; font-weight: 800; }
.contest-grid button { min-height: 45px; margin-top: 18px; border: 0; background: var(--forest); color: white; font-size: 10px; font-weight: 800; }
.contest-grid button:disabled { background: #82958c; }
.standings { max-width: 750px; margin: 22px auto 0; padding: 27px; background: var(--paper-2); border: 1px solid var(--line); }
.standings h2 { margin: 0 0 15px; color: var(--forest); font: 28px Georgia, serif; }
.standings div { min-height: 44px; display: grid; grid-template-columns: 45px 1fr auto; align-items: center; border-top: 1px solid var(--line); font-size: 11px; }
.standings div > b { color: var(--gold); }
.standings strong { color: var(--forest); }

.watch-page { min-height: calc(100vh - 72px); background: var(--deep); }
.video-stage { height: min(68vh, 690px); min-height: 500px; position: relative; overflow: hidden; background: #02100c; }
.youtube-frame { width: 100%; height: 100%; border: 0; }
.video-bg { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,22,17,.95), rgba(3,22,17,.45)), url('../images/hero-race.png') center / cover; filter: saturate(.6); }
.video-overlay { position: absolute; left: clamp(20px, 7vw, 100px); right: 40px; bottom: clamp(50px, 9vh, 95px); color: white; }
.video-overlay h1 { margin: 22px 0 8px; font: clamp(48px, 6vw, 84px)/1 Georgia, serif; }
.video-overlay p { color: #c0cec7; }
.video-placeholder { display: inline-flex; margin-top: 20px; padding: 11px 14px; border: 1px solid var(--gold); color: #ead19c; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stream-list { display: grid; grid-template-columns: 1.1fr repeat(3, 1fr); gap: 12px; padding: 24px clamp(18px, 4vw, 60px); background: var(--paper); }
.stream-list > div { padding: 12px 10px; }
.stream-list h2 { margin: 0; color: var(--forest); font: 31px Georgia, serif; }
.stream-list button { min-height: 120px; padding: 17px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: var(--paper-2); text-align: left; }
.stream-list button.active { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.stream-list button > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.stream-list strong { margin-top: 20px; color: var(--forest); font: 18px Georgia, serif; }
.stream-list small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.stream-note { padding: 0 clamp(18px, 4vw, 60px) 28px; background: var(--paper); color: var(--muted); font-size: 9px; line-height: 1.6; }

/* Administrator portal */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); background: #edf0eb; }
.admin-sidebar { min-height: 100vh; padding: 24px 18px; display: flex; flex-direction: column; background: var(--deep); color: white; position: sticky; top: 0; height: 100vh; }
.admin-sidebar .brand { min-width: 0; margin: 0 7px 28px; }
.admin-sidebar > p { margin: 0 10px 12px; color: #71877d; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar nav button { min-height: 48px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid transparent; background: transparent; color: #bdcbc5; font-size: 11px; text-align: left; }
.admin-sidebar nav button:hover { background: rgba(255,255,255,.04); color: white; }
.admin-sidebar nav button.active { border-color: #456157; border-left: 3px solid var(--gold); background: #102f26; color: white; }
.admin-sidebar nav i { padding: 4px 6px; border-radius: 999px; font-style: normal; font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.access-write { background: #244c3d; color: #c7e8d8; }
.access-read { background: #313e39; color: #9caaa4; }
.admin-sidebar .back { margin-top: auto; padding: 14px 10px; border-top: 1px solid #294239; color: #9fb0a8; font-size: 10px; font-weight: 700; }
.admin-main { min-width: 0; padding: 34px clamp(24px, 4vw, 64px) 64px; }
.admin-header { min-height: 70px; margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.admin-header small { color: var(--gold); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.admin-header h1 { margin: 7px 0 0; color: var(--forest); font: clamp(34px, 4vw, 50px) Georgia, serif; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-user > span { display: flex; flex-direction: column; align-items: flex-end; }
.admin-user span b { color: var(--forest); font-size: 11px; }
.admin-user span small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.admin-user > strong { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: white; font-size: 11px; }
.admin-message { min-height: 48px; margin-bottom: 18px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #bed4c7; background: #e3f0e7; color: #285b40; font-size: 11px; }
.admin-message.error { border-color: #e1bcbc; background: #f7e4e4; color: #8d3030; }
.admin-message.info { border-color: #dccb9d; background: #fff6dc; color: #6d5418; }
.admin-message > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.65); font-weight: 900; }
.admin-message button { margin-left: auto; border: 0; background: transparent; color: currentColor; font-size: 19px; }
.admin-loading { margin-bottom: 16px; padding: 11px 13px; background: #e2e7e3; color: var(--muted); font-size: 10px; animation: pulseFade 1.2s infinite; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stats article { min-height: 135px; padding: 21px; display: flex; flex-direction: column; background: white; border: 1px solid #d6ddd7; }
.admin-stats article > span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.admin-stats article > b { margin-top: 20px; color: var(--forest); font: 32px Georgia, serif; }
.admin-stats article > small { margin-top: auto; color: #7e8b84; font-size: 9px; line-height: 1.45; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 15px; margin-top: 15px; }
.admin-grid > section, .system-panel, .admin-form, .workspace-main, .workspace-side, .record-list, .quick-actions { background: white; border: 1px solid #d6ddd7; }
.admin-grid > section { padding: 27px; }
.panel-head, .workspace-heading, .record-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-head h2, .workspace-heading h2, .record-list h2, .workspace-side h2, .quick-actions h2 { margin: 0; color: var(--forest); font: 27px Georgia, serif; }
.activity { min-height: 65px; display: flex; align-items: center; gap: 14px; border-top: 1px solid #e0e5e1; }
.activity:first-of-type { margin-top: 15px; }
.ok { width: 21px; height: 21px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #dceee4; }
.ok::after { content: "✓"; color: #28704a; font-size: 10px; font-weight: 900; }
.activity span { display: flex; flex-direction: column; }
.activity b { color: var(--forest); font-size: 11px; }
.activity small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.system-panel { padding: 27px; }
.system-panel h2 { margin: 0 0 18px; color: var(--forest); font: 27px Georgia, serif; }
.system-panel > div { padding: 13px 0; display: flex; flex-direction: column; border-top: 1px solid #e0e5e1; }
.system-panel span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.system-panel b { margin-top: 5px; color: var(--forest); font-size: 11px; word-break: break-word; }
.system-panel p { color: var(--muted); font-size: 10px; line-height: 1.55; }
.admin-signout { min-height: 42px; margin-top: 15px; display: flex; align-items: center; justify-content: center; background: var(--deep); color: white; font-size: 10px; font-weight: 800; }
.quick-actions { margin-top: 15px; padding: 24px; display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); gap: 8px; align-items: stretch; }
.quick-actions > div { padding: 12px; }
.quick-actions button { min-height: 100px; padding: 15px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid #dde3de; background: #f8faf7; text-align: left; }
.quick-actions button:hover { border-color: var(--gold); background: #fffaf0; }
.quick-actions button span { color: var(--forest); font-size: 10px; font-weight: 800; }
.quick-actions button small { margin-top: 7px; color: var(--muted); font-size: 8px; }
.quick-actions button b { margin-top: auto; color: var(--gold); }
.admin-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr); gap: 15px; }
.workspace-main, .workspace-side, .admin-form, .record-list { padding: 28px; }
.workspace-main > p, .admin-form > p, .form-help { color: var(--muted); font-size: 11px; line-height: 1.65; }
.admin-status { display: inline-flex; width: fit-content; padding: 6px 8px; border-radius: 999px; background: #e7ece8; color: #5f6d65; font-size: 7px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.status-ready, .status-completed, .status-live, .status-published, .status-edit-access { background: #dceee4; color: #21603e; }
.status-ended, .status-read-only, .status-draft { background: #e6e9e7; color: #68736d; }
.status-completed-with-warnings, .status-upcoming, .status-pinned, .status-super-admin-only { background: #fff0c9; color: #735719; }
.status-scratch, .status-delay { background: #f5dddd; color: #953c3c; }
.status-result, .status-track, .status-update { background: #e3ebf5; color: #365d83; }
.file-drop { min-height: 165px; margin: 22px 0; padding: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #b9c7be; background: #f9fbf8; color: var(--forest); text-align: center; cursor: pointer; }
.file-drop:hover { border-color: var(--gold); background: #fffaf1; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop .file-icon { width: 38px; height: 38px; margin-bottom: 10px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 20px; }
.file-drop b { font: 20px Georgia, serif; }
.file-drop > span:last-child { margin-top: 8px; color: var(--muted); font-size: 9px; }
.import-summary { display: flex; gap: 7px; margin-bottom: 10px; }
.import-summary span { padding: 7px 9px; border: 1px solid #dce2de; background: #f7f9f6; color: var(--muted); font-size: 8px; }
.import-summary b { color: var(--forest); }
.import-preview { max-width: 100%; overflow-x: auto; border: 1px solid #d8dfda; background: white; }
.import-preview .preview-label { padding: 10px; background: #f0f3ef; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.import-preview > div:not(.preview-label) { min-width: 700px; display: grid; grid-template-columns: repeat(8, minmax(85px, 1fr)); }
.import-preview > div:nth-child(2) { background: var(--forest); color: white; }
.import-preview span { padding: 8px; border-right: 1px solid #d8dfda; border-bottom: 1px solid #d8dfda; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.admin-primary, .admin-secondary { min-height: 44px; padding: 0 20px; border: 0; font-size: 10px; font-weight: 800; }
.admin-primary { background: var(--forest); color: white; }
.admin-secondary { border: 1px solid #bdc8c1; background: white; color: var(--forest); }
.admin-primary:disabled, .admin-secondary:disabled { opacity: .45; }
.permission-note { border-left: 3px solid var(--gold); padding-left: 12px; }
.workspace-side h2 { margin-bottom: 15px; }
.import-item { padding: 14px 0; border-top: 1px solid #dce2de; }
.import-item > div { display: flex; justify-content: space-between; gap: 8px; }
.import-item b, .import-item span, .import-item small { display: block; }
.import-item b { color: var(--forest); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.import-item > span { margin: 5px 0; color: var(--muted); font-size: 9px; }
.import-item small { color: #809087; font-size: 8px; }
.admin-empty { min-height: 130px; padding: 24px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #c8d1cb; color: var(--muted); text-align: center; }
.admin-empty b { color: var(--forest); font: 18px Georgia, serif; }
.admin-empty span { max-width: 240px; margin-top: 7px; font-size: 9px; line-height: 1.5; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 15px; align-items: start; }
.admin-form label { display: block; margin: 15px 0; color: #66746c; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; position: relative; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; margin-top: 7px; border: 1px solid #bdc8c1; background: #fafcf9; padding: 11px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.admin-form input, .admin-form select { min-height: 43px; }
.admin-form textarea { min-height: 120px; resize: vertical; }
.admin-form input:disabled, .admin-form select:disabled, .admin-form textarea:disabled { background: #ecefeb; color: #8b9690; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.admin-form .check { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; }
.admin-form .check input { width: auto; min-height: 0; margin: 0; }
.field-counter { position: absolute; right: 8px; bottom: 7px; color: #8a9690; font-size: 7px; }
.policy-callout, .role-explainer { margin: 16px 0; padding: 14px; display: flex; flex-direction: column; border-left: 3px solid var(--gold); background: #fff8e7; }
.policy-callout b, .role-explainer b { color: #6e5418; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.policy-callout span, .role-explainer span { margin-top: 5px; color: #756640; font-size: 9px; line-height: 1.55; }
.record-list { max-height: calc(100vh - 150px); overflow: auto; }
.record-list-head { margin-bottom: 12px; }
.record-list-head > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #edf2ee; color: var(--forest); font-size: 9px; font-weight: 800; }
.record-list article { padding: 17px 0; border-top: 1px solid #dde3de; }
.record-list article > div:first-child { display: flex; align-items: center; gap: 6px; }
.record-list h3 { margin: 11px 0 6px; color: var(--forest); font: 18px Georgia, serif; }
.record-list p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.record-list article footer { margin-top: 12px; padding: 0; display: flex; grid-template-columns: none; justify-content: space-between; gap: 10px; background: transparent; color: inherit; }
.record-list article footer time { color: #849089; font-size: 8px; }
.record-list article footer button { border: 0; background: transparent; color: #9b3f3f; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.record-count { margin-left: auto; color: var(--muted); font-size: 8px; }
.admin-person { padding: 13px 0; display: grid; grid-template-columns: 37px 1fr auto; gap: 10px; align-items: center; border-top: 1px solid #dce2de; }
.admin-person > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: white; font-size: 9px; }
.admin-person > div { min-width: 0; display: flex; flex-direction: column; }
.admin-person b { color: var(--forest); font-size: 10px; }
.admin-person small { margin-top: 3px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; }
.admin-person em { margin-top: 4px; color: #765b1c; font-size: 7px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.admin-person button { border: 0; background: transparent; color: #9b3f3f; font-size: 8px; font-weight: 800; }
.admin-denied { min-height: 100vh; padding: 25px; display: grid; place-items: center; background: var(--deep); color: white; }
.admin-denied > div { max-width: 560px; padding: 50px; border: 1px solid #486157; text-align: center; }
.admin-denied span { width: 60px; height: 60px; margin: 0 auto 20px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; }
.admin-denied h1 { font: 39px Georgia, serif; }
.admin-denied p { color: #b4c2bb; line-height: 1.6; }
.admin-denied a { margin-top: 15px; padding: 13px 18px; display: inline-block; background: var(--gold); color: var(--deep); font-weight: 800; }

@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(255,77,77,0); } }
@keyframes pulseFade { 50% { opacity: .45; } }
@keyframes heroZoom { from { transform: scale(1.035); } to { transform: scale(1.01); } }

@media (max-width: 1120px) {
  .brand { min-width: auto; }
  .brand > span { display: none; }
  .header-tools { min-width: auto; }
  .data-grid, .live-layout { grid-template-columns: 1fr; }
  .feature-band { grid-template-columns: 1fr 1fr; }
  .feature-band > div { grid-column: 1 / -1; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .trust-strip div:nth-child(2) { border-right: 0; }
  .trust-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .contest-grid, .learn-grid { grid-template-columns: 1fr 1fr; }
  .stream-list { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr 1fr; }
  .quick-actions > div { grid-column: 1 / -1; }
  .admin-workspace, .admin-split { grid-template-columns: 1fr; }
  .record-list { max-height: none; }
  .lesson-reader { grid-template-columns: 1fr 1fr; }
  .lesson-reader > a { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 760px) {
  .site-header { height: 64px; padding: 0 15px; gap: 8px; }
  .mark { width: 38px; height: 38px; }
  .menu-button { margin-left: auto; padding: 8px 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #667b72; background: transparent; color: white; font-size: 9px; font-weight: 800; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; height: auto; padding: 10px; flex-direction: column; align-items: stretch; gap: 0; background: var(--deep); box-shadow: 0 18px 35px rgba(0,0,0,.28); }
  .nav.open { display: flex; }
  .nav a { height: auto; padding: 14px; }
  .nav a::after { left: 14px; right: auto; width: 30px; }
  .header-tools { margin-left: 0; }
  .live-pill { display: none; }
  .admin-link { padding: 0 9px; }
  .search-trigger { width: 34px; height: 34px; }
  .header-search { position: fixed; left: 12px; right: 12px; top: 63px; width: auto; }
  .hero { height: 610px; min-height: 610px; }
  .hero-shade { background: linear-gradient(90deg, rgba(4,29,24,.98), rgba(4,29,24,.62)); }
  .hero-copy { padding: 76px 20px 50px; }
  .hero h1, .page-heading h1 { font-size: 44px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip div { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--line); }
  .data-grid { padding: 14px; }
  .race-title { align-items: flex-start; }
  .race-title h2 em { display: block; margin: 5px 0 0; }
  .race-facts { grid-template-columns: 1fr 1fr; gap: 7px; }
  .race-facts span { padding: 5px; border: 0; }
  .runner-table .tr { padding: 0 8px; grid-template-columns: 34px 1.3fr .9fr 38px; font-size: 10px; }
  .lr { grid-template-columns: 35px 1fr 45px 45px 80px; font-size: 9px; }
  .feature-band { grid-template-columns: 1fr; }
  .feature-band > div { grid-column: auto; padding: 40px 20px; }
  .feature-tile { min-height: 210px; border-left: 0; border-top: 1px solid #28443a; }
  footer { grid-template-columns: 1fr; }
  footer > div:nth-of-type(2) { justify-content: flex-start; flex-wrap: wrap; }
  footer small { grid-column: 1; }
  .inner { padding: 42px 16px 60px; }
  .page-heading.split { align-items: flex-start; flex-direction: column; gap: 16px; }
  .search-panel { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip div:nth-child(3) { border-left: 0; }
  .db-row { grid-template-columns: 50px 1.5fr 45px 45px; }
  .db-row > :nth-child(5), .db-row > :nth-child(6) { display: none; }
  .results-bar { align-items: flex-start; gap: 8px; }
  .results-bar > span { max-width: 68%; }
  .learn-grid, .contest-grid { grid-template-columns: 1fr; }
  .lesson-reader { grid-template-columns: 1fr; padding: 24px 20px; }
  .lesson-reader > a { grid-column: auto; }
  .glossary { grid-template-columns: 1fr; }
  .notice { flex-direction: column; gap: 5px; }
  .video-stage { height: 480px; min-height: 480px; }
  .video-overlay { left: 20px; right: 20px; }
  .video-overlay h1 { font-size: 42px; }
  .stream-list { grid-template-columns: 1fr; padding: 22px 16px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { min-height: 0; height: auto; padding: 9px 10px; position: sticky; top: 0; z-index: 90; flex-direction: row; align-items: center; overflow-x: auto; }
  .admin-sidebar .brand, .admin-sidebar > p, .admin-sidebar .back { display: none; }
  .admin-sidebar nav { flex-direction: row; gap: 5px; }
  .admin-sidebar nav button { min-height: 39px; flex: 0 0 auto; padding: 0 10px; border: 1px solid transparent; }
  .admin-sidebar nav button.active { border: 1px solid var(--gold); }
  .admin-sidebar nav i { display: none; }
  .admin-main { padding: 20px 14px 50px; }
  .admin-header { align-items: flex-start; }
  .admin-user > span { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; padding: 17px; }
  .form-grid, .form-grid.two { grid-template-columns: 1fr; gap: 0; }
  .workspace-main, .workspace-side, .admin-form, .record-list { padding: 19px; }
  .admin-denied > div { padding: 30px 18px; }
  .admin-denied h1 { font-size: 31px; }
}

@media (max-width: 460px) {
  .admin-link { display: none; }
  .card-actions { align-items: stretch; flex-direction: column; padding-block: 13px; }
  .card-actions a { min-height: 38px; display: flex; align-items: center; justify-content: center; }
  .tabs button { padding-inline: 6px; font-size: 8px; }
  .admin-stats, .quick-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Browser installer */
.installer-shell {
  min-height: 100vh;
  padding: clamp(24px, 5vw, 70px) 18px 30px;
  background:
    radial-gradient(circle at 15% 8%, rgba(200,155,69,.18), transparent 27%),
    linear-gradient(145deg, #061812 0%, #0b2a21 55%, #071f19 100%);
  color: var(--ink);
}
.installer-card {
  width: min(920px, 100%);
  margin: 0 auto;
  background: var(--paper-2);
  border: 1px solid rgba(236,211,157,.48);
  box-shadow: 0 28px 90px rgba(0,0,0,.34);
}
.installer-header { padding: clamp(30px, 5vw, 54px); background: var(--deep); color: white; border-bottom: 4px solid var(--gold); }
.installer-brand { display: inline-flex; align-items: center; gap: 12px; color: white; font-family: Georgia, serif; }
.installer-brand > span { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font-size: 14px; }
.installer-brand b { font-size: 21px; font-weight: 400; }
.installer-step { margin-top: 42px; color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.installer-header h1 { margin: 12px 0 15px; font: clamp(40px, 6vw, 66px)/1 Georgia, serif; letter-spacing: -.035em; }
.installer-header p { max-width: 680px; margin: 0; color: #c7d3cd; font-size: 15px; line-height: 1.7; }
.installer-loading { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--forest); }
.installer-loading i { width: 36px; height: 36px; border: 3px solid #d8ded9; border-top-color: var(--gold); border-radius: 50%; animation: installerSpin .8s linear infinite; }
.installer-loading span { font-size: 12px; font-weight: 800; }
.installer-form { display: grid; }
.installer-section { padding: clamp(27px, 4vw, 42px) clamp(24px, 5vw, 54px); border-bottom: 1px solid var(--line); }
.installer-section:last-child { border-bottom: 0; }
.installer-section-title { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.installer-section-title > span { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: white; font-size: 11px; font-weight: 900; }
.installer-section-title h2 { margin: 1px 0 5px; color: var(--forest); font: 25px Georgia, serif; }
.installer-section-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.installer-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.installer-checks > div { min-height: 78px; padding: 15px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: white; }
.installer-checks i { width: 25px; height: 25px; flex: none; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 900; }
.installer-checks .pass i { background: #e2f1e8; color: var(--green); }
.installer-checks .fail i { background: #f8e5e5; color: var(--red); }
.installer-checks span { display: flex; flex-direction: column; }
.installer-checks b { color: var(--forest); font-size: 11px; }
.installer-checks small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.installer-help { margin-top: 14px; padding: 16px; border-left: 4px solid var(--gold); background: #fff8e7; display: grid; gap: 7px; }
.installer-help b { color: #735519; font-size: 12px; }
.installer-help code { width: fit-content; padding: 5px 8px; background: #efe4c8; color: #584216; font-size: 11px; }
.installer-help p { margin: 0; color: #6d6250; font-size: 11px; line-height: 1.5; }
.installer-signin { margin-top: 15px; min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; background: var(--forest); color: white; font-size: 11px; font-weight: 900; }
.installer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.installer-fields label { display: flex; flex-direction: column; gap: 7px; }
.installer-fields label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.installer-fields label > span { color: var(--forest); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.installer-fields input { min-height: 47px; padding: 0 13px; border: 1px solid #cfd7d1; background: white; color: var(--ink); }
.installer-fields input:read-only { background: #eef1ed; color: var(--muted); }
.installer-fields input:disabled { opacity: .7; }
.installer-fields small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.installer-option, .installer-confirm { margin-top: 20px; padding: 15px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: white; }
.installer-option input, .installer-confirm input { width: 18px; height: 18px; flex: none; accent-color: var(--forest); }
.installer-option span { display: flex; flex-direction: column; }
.installer-option b { color: var(--forest); font-size: 11px; }
.installer-option small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.installer-confirm span { color: #405149; font-size: 11px; line-height: 1.55; }
.installer-section.final { background: #f2f0e8; }
.installer-primary, .installer-secondary { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; font-size: 11px; font-weight: 900; }
.installer-primary { background: var(--gold); color: var(--deep); }
.installer-secondary { border-color: #b9c3bc; background: white; color: var(--forest); }
.install-button { width: 100%; margin-top: 16px; border: 0; }
.install-button:disabled { opacity: .48; }
.installer-fineprint { margin: 11px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.installer-error { margin-top: 15px; padding: 15px; display: flex; flex-direction: column; gap: 5px; border: 1px solid #e1b5b5; background: #fff0f0; color: #7b2d2d; }
.installer-error b { font-size: 11px; }
.installer-error span { font-size: 10px; line-height: 1.5; }
.installer-error button { width: fit-content; margin-top: 7px; padding: 8px 11px; border: 0; background: #7b2d2d; color: white; font-size: 10px; font-weight: 800; }
.installer-complete { padding: clamp(40px, 7vw, 70px); text-align: center; }
.complete-mark { width: 68px; height: 68px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: #e3f2e9; color: var(--green); font-size: 30px; }
.installer-complete h2 { margin: 0; color: var(--forest); font: 36px Georgia, serif; }
.installer-complete > p { max-width: 570px; margin: 14px auto 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.installer-actions { margin-top: 28px; display: flex; justify-content: center; gap: 10px; }
.installer-complete aside { max-width: 590px; margin: 30px auto 0; padding: 16px; display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); background: #f5f3eb; text-align: left; }
.installer-complete aside b { color: var(--forest); font-size: 11px; }
.installer-complete aside span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.installer-footer { margin: 20px auto 0; padding: 0; display: block; background: transparent; color: #9fb0a8; font-size: 9px; text-align: center; letter-spacing: .06em; }
@keyframes installerSpin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .installer-shell { padding: 0; }
  .installer-card { border: 0; }
  .installer-header { padding: 28px 22px 34px; }
  .installer-step { margin-top: 32px; }
  .installer-header h1 { font-size: 42px; }
  .installer-section { padding: 28px 20px; }
  .installer-checks, .installer-fields { grid-template-columns: 1fr; }
  .installer-fields label:last-child:nth-child(odd) { grid-column: auto; }
  .installer-actions { flex-direction: column; }
  .installer-footer { padding: 18px; margin: 0; background: #061812; }
}

/* PHP release adaptations */
[hidden] { display: none !important; }
.track-chips a { flex: none; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 10px; font-weight: 800; }
.track-chips a.on { background: var(--forest); border-color: var(--forest); color: white; }
.search-panel { align-items: end; }
.search-panel > button { min-height: 48px; border: 0; }
.lesson-reader { display: block; }
.lesson-panel { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 30px; align-items: center; }
.lesson-panel > div > p:last-child { color: #b7c3bd; line-height: 1.6; }
.lesson-panel > a { padding: 13px 16px; background: var(--gold); color: var(--deep); font-size: 11px; font-weight: 800; white-space: nowrap; }
.stream-panel { position: absolute; inset: 0; }
.stream-panel .youtube-frame { position: absolute; inset: 0; }
.contest-entry-form { margin-top: 16px; display: grid; gap: 9px; }
.contest-entry-form label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.contest-entry-form input { width: 100%; min-height: 40px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); background: white; color: var(--ink); }
.contest-entry-form button { margin-top: 2px; }
.contest-alert.success { border-color: var(--green); background: #e8f4ed; }
.contest-alert.error { border-color: var(--red); background: #f8e7e7; color: #842d2d; }
.admin-sidebar nav a { min-height: 48px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid transparent; background: transparent; color: #bdcbc5; font-size: 11px; text-align: left; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.04); color: white; }
.admin-sidebar nav a.active { border-color: #456157; border-left: 3px solid var(--gold); background: #102f26; color: white; }
.quick-actions > a { min-height: 100px; padding: 15px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid #dde3de; background: #f8faf7; text-align: left; }
.quick-actions > a:hover { border-color: var(--gold); background: #fffaf0; }
.quick-actions > a span { color: var(--forest); font-size: 10px; font-weight: 800; }
.quick-actions > a small { margin-top: 7px; color: var(--muted); font-size: 8px; }
.quick-actions > a b { margin-top: auto; color: var(--gold); }
.admin-signout { width: 100%; border: 0; }
.check-row { display: flex !important; align-items: center; gap: 9px; text-transform: none !important; letter-spacing: 0 !important; }
.check-row input { width: auto !important; min-height: 0 !important; margin: 0 !important; }
.record-list article footer form, .admin-person form { margin: 0; }
.workspace-side > .system-panel { border: 0; padding: 0; }
.admin-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 8%, rgba(200,155,69,.18), transparent 27%), linear-gradient(145deg, #061812, #0b2a21 55%, #071f19); }
.admin-login-card { width: min(520px, 100%); padding: clamp(28px, 6vw, 54px); border: 1px solid rgba(236,211,157,.48); background: var(--paper-2); box-shadow: 0 28px 90px rgba(0,0,0,.34); }
.admin-login-card .installer-brand { color: var(--forest); }
.admin-login-card .installer-brand > span { color: var(--gold); }
.admin-login-card .overline { margin-top: 36px; }
.admin-login-card h1 { margin: 0; color: var(--forest); font: clamp(36px, 6vw, 54px)/1 Georgia, serif; letter-spacing: -.03em; }
.admin-login-card > p:not(.overline) { color: var(--muted); font-size: 12px; line-height: 1.65; }
.admin-login-card form { display: grid; gap: 14px; margin-top: 25px; }
.admin-login-card label { color: var(--forest); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.admin-login-card input { width: 100%; min-height: 48px; margin-top: 7px; padding: 0 13px; border: 1px solid #c9d1cb; background: white; }
.admin-login-card .admin-primary { margin-top: 7px; }
.admin-login-back { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 10px; font-weight: 800; }

@media (max-width: 760px) {
  .lesson-panel { grid-template-columns: 1fr; }
  .lesson-panel > a { justify-self: start; }
  .admin-sidebar nav a { min-height: 39px; flex: 0 0 auto; padding: 0 10px; }
  .admin-sidebar nav a.active { border: 1px solid var(--gold); }
}
.search-panel { grid-template-columns: minmax(0, 1fr) 220px auto; }
.contest-entry-form > small { color: var(--muted); font-size: 8px; line-height: 1.45; }
@media (max-width: 760px) { .search-panel { grid-template-columns: 1fr; } }
