/* ==========================================================================
   IseCup Rennplan v2 – Styles
   Tokens abgeleitet von wsap-hamburg.de (globals.css @theme): Marineblau als
   Primärfarbe, ein Akzentblau, helle Slate-Flächen, Inter, Radien 8/12/16/999.
   Mobile-first; ab 1024 px Desktop-Layout mit Top-Navigation und Seitenleiste.
   ========================================================================== */

:root {
  --primary: #001e2a;
  --primary-light: #003347;
  --primary-dark: #00111a;
  --accent: #0077b6;
  --accent-light: #00a8e8;
  --accent-dark: #005a8c;
  --accent-soft: rgba(0, 119, 182, 0.1);
  --accent-ring: rgba(0, 119, 182, 0.12);
  --surface: #f8fafc;
  --surface-dark: #e2e8f0;
  --surface-darker: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --text-on-dark: #f1f5f9;
  --white: #ffffff;
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 30, 42, 0.06);
  --shadow-live: 0 0 0 4px var(--accent-ring), 0 12px 28px -14px rgba(0, 30, 42, 0.35);
  --shadow-lg: 0 30px 60px -30px rgba(0, 30, 42, 0.35);

  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 300ms;

  --topbar-h: 0px; /* keine Kopfzeile mehr – Toolbar klebt oben */
  --tabbar-h: 76px;
  --container: 1280px;
  --gutter: 16px;
}

/* ---------- Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 132px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-dark);
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
mark {
  background: rgba(0, 168, 232, 0.28);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent);
  color: var(--white);
}
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.muted {
  color: var(--text-muted);
  font-weight: 400;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip:focus {
  left: 8px;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgba(0, 30, 42, 0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
}
.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  min-width: 0;
}
.brand:hover {
  color: var(--white);
}
.brand__mark {
  flex-shrink: 0;
  transition: transform var(--fast) var(--ease);
}
.brand:hover .brand__mark {
  transform: scale(1.05);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand__sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}
.topnav {
  display: none;
  align-items: center;
  gap: 4px;
}
.topnav a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--fast), color var(--fast);
}
.topnav a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
.topnav a.is-active {
  color: var(--white);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--accent-light);
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.livepill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.livepill .dot {
  background: var(--white);
  width: 8px;
  height: 8px;
}
.updated {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sitelink {
  display: none;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}
.sitelink:hover {
  color: var(--white);
}

/* ---------- Puls-Punkt ---------- */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  flex-shrink: 0;
}
.dot--white {
  background: var(--white);
  width: 7px;
  height: 7px;
}
.dot--pulse {
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 168, 232, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 168, 232, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 168, 232, 0);
  }
}

/* ---------- Status / Laden ---------- */
.status[hidden] {
  display: none;
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px auto 0;
  max-width: var(--container);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.status--error {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: var(--radius);
  margin-left: var(--gutter);
  margin-right: var(--gutter);
  max-width: calc(var(--container) - 2 * var(--gutter));
}
.status--warn {
  color: var(--warn);
}
.status .btn {
  margin-left: auto;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface-dark);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Hero (Zeitplan) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: var(--text-on-dark);
}
.hero__waves {
  position: absolute;
  right: -60px;
  bottom: -50px;
  width: 420px;
  height: 200px;
  opacity: 0.3;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  padding: 14px 0;
}
.hero__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__row .btn {
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
}
.hero__row .btn svg {
  flex-shrink: 0;
}
.btn__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
}
.eyebrow--dark {
  background: rgba(0, 168, 232, 0.15);
  color: var(--accent-light);
}
.hero__title {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--white);
}
.hero__title .accent {
  color: var(--accent-light);
}
.hero__sub {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
}
.stats {
  display: flex;
  gap: 28px;
  padding-top: 4px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent-light);
}
.stat__label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}
.hero__cta {
  padding-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 0;
  transition: background var(--fast) var(--ease), color var(--fast), box-shadow var(--fast);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(0, 30, 42, 0.1);
}
.btn--primary:hover {
  background: var(--accent-dark);
  color: var(--white);
}
.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn--secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.btn--light {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn--light:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}
.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--surface-dark);
  color: var(--text);
}
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--fast), color var(--fast);
}
.iconbtn:hover {
  background: var(--surface);
  color: var(--accent);
}

/* ---------- Toolbar (Chips + Suche) ---------- */
.toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--surface-dark);
}
.toolbar__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips[hidden] {
  display: none;
}
.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--surface-dark);
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chip--active,
.chip--active:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px; /* verhindert Auto-Zoom auf iOS */
  color: var(--text);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search__clear {
  border: 0;
  background: var(--surface-dark);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.search--dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}
.search--dark input {
  color: var(--white);
}
.search--dark input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.search--dark:focus-within {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.25);
}

/* ---------- Zeitplan: Layout, Gruppen, Rennkarten ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-top: 16px;
  padding-bottom: 32px;
}
.sidebar {
  display: none;
}
.races {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.group {
  scroll-margin-top: calc(var(--topbar-h) + 132px);
}
.group__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 12px;
}
.group__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.group__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
}
.group__time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.group__desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}
.group__races {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.race {
  background: var(--white);
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: calc(var(--topbar-h) + 132px);
  transition: box-shadow var(--fast) var(--ease), border-color var(--fast);
}
.race--live {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-live);
  padding: 11px 13px 13px;
}
.race--done {
  border-color: var(--surface-dark);
}
.race.is-highlighted {
  box-shadow: 0 0 0 4px rgba(0, 168, 232, 0.35), var(--shadow-sm);
}
.race__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.race__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.race__nr {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.race__status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.race__status--done {
  color: var(--text-muted);
}
.race__status--open {
  color: var(--primary);
  font-weight: 700;
}
.race__status--live {
  gap: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 10px;
}
.race__cols,
.row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 64px 40px;
  gap: 10px;
  align-items: center;
}
.race__cols {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.race__cols span:nth-child(3) {
  text-align: right;
}
.race__cols span:nth-child(4) {
  text-align: center;
}
.race__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row__lane {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}
.row__team {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.row__link,
.row__placeholder {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.row__link {
  color: var(--text);
}
.row__link:hover {
  color: var(--accent);
}
.row__placeholder {
  color: var(--text-faint);
  font-weight: 500;
  font-style: italic;
}
.row__sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__remark {
  color: var(--warn);
}
.row__time {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  white-space: nowrap;
}
.row__time--open {
  color: var(--text-faint);
}
.row__place {
  height: 28px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
}
.row__place--first {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.row__place--open {
  border-style: dashed;
  border-color: var(--surface-darker);
  color: var(--text-faint);
  font-weight: 500;
}
.race__note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tag--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  white-space: nowrap;
}
.badge--sm {
  font-size: 10px;
  padding: 3px 8px;
}
.empty {
  margin-top: 8px;
  padding: 24px 18px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--surface-darker);
  border-radius: var(--radius);
  background: var(--white);
}
.hint {
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- Seitenleiste (Desktop) ---------- */
.side__card {
  background: var(--white);
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.side__card--dark {
  background: var(--primary);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-lg);
}
.side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side__h {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.side__meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.side__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.side__clock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}
.side__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}
.side__title:hover {
  color: var(--accent-light);
}
.side__rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side__row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.side__lane {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--white);
}
.side__team {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side__team a {
  color: var(--white);
}
.side__team a:hover {
  color: var(--accent-light);
}
.side__state {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}
.side__next {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.side__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Rangliste ---------- */
.pagehead {
  background: var(--primary);
  color: var(--text-on-dark);
}
.pagehead .container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.pagehead__title {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
}
.pagehead__sub {
  margin-top: -6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}
.pagehead__sub:empty {
  display: none;
}
.content {
  padding-top: 16px;
  padding-bottom: 32px;
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.seg__btn {
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--fast), color var(--fast);
}
.seg__btn:hover {
  color: var(--white);
}
.seg__btn--active,
.seg__btn--active:hover {
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
}
.card {
  background: var(--white);
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.list {
  overflow: hidden;
  margin-bottom: 12px;
}
.list__head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 80px;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.list__head span:last-child {
  text-align: right;
}
.rank__row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  color: var(--text);
}
.rank__row--full {
  grid-template-columns: 40px minmax(0, 1fr) 80px;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-dark);
  transition: background var(--fast);
}
.rank__row--full:last-child {
  border-bottom: 0;
}
.rank__row--full:hover {
  background: var(--surface);
  color: var(--text);
}
.rank__row--lead {
  background: rgba(0, 119, 182, 0.05);
}
.rank__pos {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--surface-dark);
  color: var(--primary);
}
.rank--compact .rank__pos {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
}
.rank__pos--1 {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  font-weight: 800;
}
.rank__pos--2,
.rank__pos--3 {
  background: var(--accent-ring);
  border-color: transparent;
  color: var(--accent-dark);
  font-weight: 800;
}
.rank__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rank__team {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.rank--compact .rank__team {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rank--compact .rank__team {
  font-size: 14px;
}
.rank__row--lead .rank__team {
  font-weight: 700;
}
.rank__meta {
  font-size: 12px;
  color: var(--text-muted);
}
.rank__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.rank__time {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.rank--compact .rank__time {
  font-size: 14px;
}
.rank__row--lead .rank__time {
  font-weight: 800;
}
.rank__delta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.rank__delta--lead {
  color: var(--accent);
}

/* ---------- Teams ---------- */
.teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team {
  background: var(--white);
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.team[open] {
  border-color: var(--surface-darker);
}
.team__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  min-height: 64px;
}
.team__summary::-webkit-details-marker {
  display: none;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-dark);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--fast), color var(--fast);
}
.avatar--dark {
  background: var(--primary);
  color: var(--white);
}
.team__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.team__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}
.team__meta--live {
  color: var(--accent);
  font-weight: 600;
}
.team__meta--live .dot {
  background: var(--accent);
  width: 7px;
  height: 7px;
}
.team__badges {
  display: none;
  gap: 6px;
  flex-shrink: 0;
}
.team__chev {
  color: var(--text-muted);
  display: flex;
  transition: transform var(--fast) var(--ease);
}
.team[open] .team__chev {
  transform: rotate(180deg);
}
.team__body {
  border-top: 1px solid var(--surface-dark);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.team__cols,
.trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 64px 36px;
  gap: 8px;
  align-items: center;
}
.team__cols {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.team__cols span:nth-child(2),
.team__cols span:nth-child(4) {
  text-align: center;
}
.team__cols span:nth-child(3) {
  text-align: right;
}
.team__rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trow {
  min-height: 40px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
}
.trow--next {
  background: rgba(0, 119, 182, 0.05);
}
.trow--live {
  background: var(--accent-soft);
}
.trow__race {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  color: var(--text);
}
.trow__race:hover .trow__name {
  color: var(--accent);
}
.trow__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.trow--next .trow__name,
.trow--live .trow__name {
  color: var(--accent);
}
.trow__sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trow__lane {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.trow__time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}
.trow .row__place {
  min-width: 36px;
}
.team__best {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Info ---------- */
.info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.info__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
}
.info__facts {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info__facts strong {
  color: var(--primary);
  font-weight: 600;
}
.docs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.doc {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--surface-dark);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast) var(--ease);
}
.doc:hover {
  border-color: rgba(0, 119, 182, 0.3);
  box-shadow: 0 4px 12px -6px rgba(0, 30, 42, 0.25);
  transform: translateY(-1px);
  color: var(--accent);
}
.doc > svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--fast) var(--ease);
}
.doc:hover > svg {
  transform: translateX(3px);
  color: var(--accent);
}
.doc__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.doc__title {
  font-size: 15px;
  font-weight: 600;
}
.doc__note {
  font-size: 12px;
  color: var(--text-muted);
}
.docs--compact .doc {
  padding: 8px 0;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--surface-dark);
}
.docs--compact .doc:last-child {
  border-bottom: 0;
}
.docs--compact .doc:hover {
  transform: none;
}
.docs--compact .doc__icon {
  width: 40px;
  height: 40px;
}
.docs--compact .doc__title {
  font-size: 14px;
}
.steps {
  padding: 6px 14px;
}
.step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-dark);
}
.step:last-child {
  border-bottom: 0;
}
.step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.step__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.step__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.step__items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}
.step__items strong {
  color: var(--text);
  font-weight: 600;
}
.org {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.org__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.org__logo {
  flex-shrink: 0;
  display: flex;
}
.org__name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}
.org__desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.org__address {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.org__address > * {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.org__address svg {
  color: var(--accent);
  flex-shrink: 0;
}
.org__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Fußzeile + Tab-Leiste ---------- */
.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.footer__links {
  display: flex;
  gap: 16px;
}
.footer a {
  color: rgba(255, 255, 255, 0.7);
}
.footer a:hover {
  color: var(--white);
}
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--primary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  transition: color var(--fast), background var(--fast);
}
.tabbar a:hover {
  color: var(--white);
}
.tabbar a.is-active {
  color: var(--accent-light);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
  .hero__inner {
    padding: 16px 0;
  }
  .hero__title {
    font-size: 42px;
  }
  .hero__sub {
    font-size: 17px;
  }
  .stat__value {
    font-size: 30px;
  }
  .toolbar__inner {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .chips {
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .search {
    flex: 1;
  }
  .group__races {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .team__badges {
    display: flex;
  }
  .docs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .pagehead .container {
    padding-top: 28px;
    padding-bottom: 24px;
  }
  .pagehead__title {
    font-size: 34px;
  }
  .seg {
    max-width: 420px;
  }
  .search--dark {
    max-width: 420px;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
  }
  .tabbar {
    grid-template-columns: repeat(4, minmax(0, 180px));
    justify-content: center;
  }
  .hero__inner {
    padding: 18px 0;
  }
  .hero__title {
    font-size: 56px;
    letter-spacing: -0.02em;
  }
  .hero__waves {
    width: 800px;
    height: 300px;
    right: -80px;
    bottom: -60px;
  }
  .stats {
    gap: 40px;
  }
  html {
    scroll-padding-top: calc(var(--topbar-h) + 84px);
  }
  .group,
  .race {
    scroll-margin-top: calc(var(--topbar-h) + 84px);
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    padding-top: 32px;
    padding-bottom: 48px;
    align-items: start;
  }
  .sidebar {
    display: block;
    position: sticky;
    top: 93px; /* unter der Toolbar */
    max-height: calc(100vh - 101px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding-bottom: 8px;
  }
  .sidebar .docs {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar__inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .group__title {
    font-size: 22px;
  }
  .race {
    padding: 14px 16px 16px;
  }
  .race--live {
    padding: 13px 15px 15px;
  }
  .content {
    padding-top: 24px;
    padding-bottom: 48px;
    max-width: 880px;
  }
  .docs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Bewegung reduzieren / Drucken ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .dot--pulse,
  .spinner {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
@media print {
  .topbar,
  .toolbar,
  .tabbar,
  .sidebar,
  .hero__cta,
  .iconbtn {
    display: none !important;
  }
  body {
    padding: 0;
    background: #fff;
  }
  .race,
  .team,
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .hero,
  .pagehead {
    background: #fff;
    color: #000;
  }
  .hero__title,
  .pagehead__title {
    color: #000;
  }
}
