:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #66615f;
  --paper: #fbfbfa;
  --line: #d8d5d0;
  --panel: #ffffff;
  --accent: #b91c1c;
  --accent-2: #0f766e;
  --gold: #a16207;
  --good: #166534;
  --warn: #a16207;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand { font-weight: 800; text-decoration: none; letter-spacing: 0; }
.navlinks { display: flex; gap: 16px; flex-wrap: wrap; }
.navlinks a { color: var(--muted); text-decoration: none; font-weight: 700; }
.navlinks a:hover { color: var(--accent); }

.page { padding: clamp(16px, 4vw, 40px); }

.hero-band, .prompter-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 24px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 6vw, 4.75rem); line-height: .95; margin-bottom: 8px; }
h2 { font-size: 1.35rem; margin-bottom: 14px; }
h3 { font-size: 1rem; margin-bottom: 10px; }
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 900; letter-spacing: 0; text-transform: uppercase; margin-bottom: 8px; }
.muted, .empty { color: var(--muted); }
.error { color: var(--accent); font-weight: 800; }
.notice { border-left: 4px solid var(--accent-2); padding: 10px 12px; background: #eefdf9; }

.layout-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.main-column, .side-column { display: grid; gap: 20px; }

.panel, .auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 3vw, 24px);
}

.auth-panel { max-width: 460px; margin: 8vh auto; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.event-list, .class-tabs, .button-row, .driver-results { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.event-pill, .tab, .button, button {
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.event-pill { display: grid; gap: 2px; min-width: 180px; }
.event-pill span { color: var(--muted); font-size: .85rem; }
.event-pill.active, .tab.active, button:hover, .button:hover { background: var(--ink); color: #fff; }
.secondary { border-color: var(--line); color: var(--muted); background: #fff; }

.searchbar { min-width: min(420px, 100%); }
label { display: grid; gap: 7px; font-weight: 800; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.form-stack { display: grid; gap: 14px; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
}

textarea { resize: vertical; line-height: 1.45; }
.focus-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.text-link { color: var(--accent); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.compact-hero h1 { font-size: clamp(2rem, 5vw, 4rem); }
.check-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.check-label input { width: auto; min-height: 0; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: 0; }

.item-card, .signal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.item-card p, .signal p { margin: 6px 0 0; color: var(--muted); }
.signal { border-left: 5px solid var(--accent-2); }
.signal.warning { border-left-color: var(--warn); }
.signal.success { border-left-color: var(--good); }
.signal span { display: block; color: var(--muted); font-size: .78rem; margin-top: 8px; text-transform: uppercase; letter-spacing: 0; }
.alert-panel { border-top: 4px solid var(--accent); }

.prompter { display: grid; gap: 34px; max-width: 1180px; margin: 0 auto; }
.prompter article {
  border-bottom: 2px solid var(--line);
  padding-bottom: 34px;
}
.prompter h2 { font-size: clamp(2rem, 5vw, 4.5rem); line-height: 1; margin-bottom: 16px; }
.prompter p { font-size: clamp(1.5rem, 3.5vw, 2.8rem); line-height: 1.35; }
.prompter-tools { align-items: end; }

@media (max-width: 900px) {
  .hero-band, .prompter-head, .layout-grid, .admin-grid, .split { grid-template-columns: 1fr; display: grid; }
  .topbar { align-items: start; flex-direction: column; }
  .inline-form { align-items: stretch; flex-direction: column; }
}
