/* MTB Zeitmessung - gemeinsames Stylesheet.
   Farbwelt und Masse stammen aus dem Prototyp mtb_rennen_timer.html. */

:root {
  --bg:        #f5f5f3;
  --card:      #ffffff;
  --text:      #1a1a18;
  --muted:     #888888;
  --muted-2:   #aaaaaa;
  --line:      #e0dfd8;
  --line-2:    #cccccc;
  --accent:    #0F6E56;
  --accent-bg: #e8f5f0;
  --blue:      #2f6fd0;
  --blue-dk:   #1f579f;
  --blue-bg:   #e9f1ff;
  --warn:      #d9a300;
  --warn-dk:   #9a7400;
  --warn-bg:   #fff8e6;
  --danger:    #cc0000;
  --danger-ln: #ee8888;
  --danger-bg: #fff0f0;
  --brand:     #FF5100;      /* nur Sponsorenmarke, nie UI-Akzent */
  --radius:    12px;
  --mono:      'SF Mono', 'Consolas', 'DejaVu Sans Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-dk); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0 0 .8rem; }

.wrap      { max-width: 1180px; margin: 0 auto; padding: 0 16px 64px; }
.wrap-slim { max-width: 620px; }
.wrap-wide { max-width: 1600px; }

/* ------------------------------------------------------------------ Kopf */
.topbar {
  background: var(--card);
  border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 9px 16px;
  display: flex; align-items: center; gap: 10px 14px;
}
.topbar-wide .topbar-in { max-width: 1600px; }

.brand {
  font-weight: 600; font-size: 16px; display: flex; align-items: baseline; gap: 9px;
  min-width: 0; flex: 1 1 0; overflow: hidden;
}
.brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.navlink {
  color: var(--text); text-decoration: none; font-size: 14px;
  padding: 6px 11px; border-radius: 8px; white-space: nowrap;
}
.navlink:hover  { background: var(--bg); }
.navlink.active { background: var(--text); color: #fff; }

.navextra { display: flex; align-items: center; gap: 7px; flex: 0 1 auto; min-width: 0; }

/* Klappmenue - erst unterhalb der Umbruchbreite sichtbar */
.navtoggle {
  display: none; flex: 0 0 auto;
  width: 40px; height: 36px; padding: 0;
  border: 0.5px solid var(--line-2); border-radius: 9px;
  background: #fff; cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.navtoggle span, .navtoggle::before, .navtoggle::after {
  position: absolute; left: 11px; width: 18px; height: 2px; border-radius: 1px;
  background: var(--text); transition: transform .18s, opacity .18s;
}
.navtoggle span   { top: 17px; }
.navtoggle::before { content: ''; top: 11px; }
.navtoggle::after  { content: ''; top: 23px; }
.navtoggle[aria-expanded="true"] span    { opacity: 0; }
.navtoggle[aria-expanded="true"]::before { transform: translateY(6px) rotate(45deg); }
.navtoggle[aria-expanded="true"]::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .navtoggle { display: block; }
  .topnav {
    position: absolute; top: 100%; right: 10px; left: 10px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card); border: 0.5px solid var(--line);
    border-radius: 11px; padding: 6px;
    box-shadow: 0 10px 32px -12px rgba(26,26,24,.35);
    max-height: min(70vh, 520px); overflow-y: auto;
    display: none;
  }
  .topbar.nav-open .topnav { display: flex; }
  .topnav .navlink { padding: 11px 13px; border-radius: 8px; font-size: 15px; }
  .topnav .navlink + .navlink { border-top: 0.5px solid var(--line); }
  .topbar-in { position: relative; }
}

/* Ganz schmal: Uhr und Warteschlange bekommen eine eigene Zeile und bleiben
   dadurch immer lesbar, statt in der Kopfzeile zerquetscht zu werden. */
@media (max-width: 560px) {
  .topbar-in { flex-wrap: wrap; }
  .brand { flex: 1 1 0; font-size: 15px; }
  .brand small { font-size: 11px; }
  .navextra { order: 3; flex: 1 0 100%; }
  .navextra > * { flex: 1 1 0; justify-content: center; min-width: 0; }
}

/* ------------------------------------------------------------------ Karten */
.card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-tight { padding: 12px 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
@media (max-width: 640px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .grid3 .card { padding: 10px 11px; }
}
.row   { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.muted  { color: var(--muted); }
.small  { font-size: 12px; }
.mono   { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ Formular */
label.field { display: block; margin: 0 0 12px; }

/* Felderzeile: mehrere Eingaben nebeneinander statt untereinander.
   Stand bisher nur in capture.css - die Adminseiten laden die nicht, also
   liefen dort alle Formulare mit dieser Klasse senkrecht auseinander. */
.fsplit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fsplit label.field { flex: 0 0 auto; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* Alle Eingabearten, die im Programm vorkommen - sonst faellt eine einzelne
   auf die Standarddarstellung des Browsers zurueck und sieht neben den anderen
   fremd aus (so geschehen mit type=email auf der Anmeldeseite). */
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=search], input[type=email], input[type=tel],
input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; font-size: 15px; font-family: inherit;
  color: var(--text); background: #fff;
  border: 0.5px solid var(--line-2); border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue);
}
input[readonly] { background: var(--bg); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 15px; font-size: 14px; font-family: inherit; font-weight: 500;
  border: 0.5px solid var(--line-2); border-radius: 8px;
  background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-success { color: var(--accent); border-color: var(--accent); }
.btn-success:hover:not(:disabled) { background: var(--accent-bg); }
.btn-danger  { color: var(--danger); border-color: var(--danger-ln); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ------------------------------------------------------------------ Meldungen */
.msg { border-radius: 8px; padding: 10px 13px; margin: 0 0 14px; font-size: 14px; border: 0.5px solid; }
.msg-ok   { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.msg-err  { background: var(--danger-bg); border-color: var(--danger-ln); color: var(--danger); }
.msg-warn { background: var(--warn-bg);   border-color: var(--warn);     color: var(--warn-dk); }
.msg-info { background: var(--blue-bg);   border-color: #b9d6f2;         color: var(--blue-dk); }

/* ------------------------------------------------------------------ Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 0.5px solid var(--line); }
td { padding: 8px 10px; border-bottom: 0.5px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Startlisten-Stil: farbiger Kopf in Streckenfarbe, Zebra in derselben Farbe */
.sl-table {
  border-collapse: separate; border-spacing: 0;
  border-radius: 8px; overflow: hidden; border: 0.5px solid var(--line);
}
.sl-table th { border-bottom: none; font-weight: 500; font-size: 12px; }
.sl-table th:first-child { border-top-left-radius: 8px; }
.sl-table th:last-child  { border-top-right-radius: 8px; }
.sl-table td { border-bottom: none; }

/* ------------------------------------------------------------------ Startnummern */
.plate-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.plate-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.block-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.bl-item { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.bl-dot  { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ Ergebnisse */
.fastest-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--blue-bg); border: 0.5px solid #b9d6f2;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 1.2rem;
}
.fl-time { font-size: 22px; font-weight: 600; color: #1457a8; font-family: var(--mono); }
.fastest-lap-note { font-size: 12px; color: #1457a8; margin: -2px 0 8px; }
.split-fastest { color: var(--accent); font-weight: 600; }
.lap-splits { font-size: 11px; color: #999; font-family: var(--mono); }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px;
  background: var(--bg); color: var(--muted);
}
.badge-dnf  { background: var(--danger-bg); color: var(--danger); }
.badge-live { background: var(--accent-bg); color: var(--accent); }
.rank-1 td { font-weight: 600; }

.cat-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line);
}
.cat-head h2 { margin: 0; }
.cat-head .meta { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ Fusszeile */
.pubfoot {
  margin-top: 40px; padding: 16px 16px 28px;
  border-top: 0.5px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.pubfoot-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.pubfoot-links a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.pubfoot-links a:hover { color: var(--text); text-decoration: underline; }

.sponsor { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.sponsor a {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: 12px;
}
/* Die Wortmarke erbt currentColor, das orange "S" traegt eine feste Farbe.
   width/height stehen im SVG selbst - ohne intrinsische Groesse kann ein
   eingebettetes SVG in einer Flex-Zeile auf 300x150 aufgehen und den
   danebenstehenden Text hinausschieben. */
.sponsor svg { height: 22px; width: 120px; display: block; color: var(--text); flex: 0 0 auto; }
.sponsor .sponsor-text { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sponsor a:hover .sponsor-text { color: var(--text); }
.sponsor a:hover svg { color: #000; }

/* ------------------------------------------------------------------ Ladezustand */
.skeleton { color: var(--muted-2); font-size: 14px; padding: 24px 0; text-align: center; }

@media (max-width: 640px) {
  .wrap { padding: 0 11px 56px; }
  .grid2 { gap: 11px; }
  .card { padding: 13px 13px; border-radius: 10px; }
  h1 { font-size: 19px; }
  .topbar-in { padding: 8px 11px; gap: 8px; }
  .brand { font-size: 15px; }
  table { font-size: 13px; }
  th, td { padding: 7px 7px; }
}

/* ------------------------------------------------------------------ Kurzmeldung */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(14px);
  bottom: 96px; z-index: 90; max-width: min(92vw, 560px);
  background: #1a1a18; color: #fff; padding: 10px 16px; border-radius: 9px;
  font-size: 13.5px; line-height: 1.35; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok   { background: #0b5a46; }
.toast.warn { background: #8a6500; }
.toast.bad  { background: #9b1c1c; }

/* ------------------------------------------------------------------ Öffentlich */
.pub-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }
.pub-head h1 { margin: 0; }
.pub-status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pub-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pub-status.off .dot { background: var(--danger); }
.pub-status.off { color: var(--danger); }

.ticker { display: flex; flex-direction: column; gap: 0; }
.tick-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 2px;
  border-bottom: 0.5px solid var(--line); font-size: 14px;
}
.tick-row:last-child { border-bottom: none; }
.tick-row.fresh { animation: tickin .6s; }
@keyframes tickin { from { background: var(--accent-bg); } to { background: transparent; } }
.tick-num  { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums;
             min-width: 46px; display: flex; align-items: center; }
.tick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick-cat  { font-size: 11.5px; color: var(--muted); }
.tick-time { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.tick-rank { font-size: 11px; color: var(--muted); min-width: 26px; text-align: right; }

.cat-block { margin-bottom: 8px; border: 0.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.cat-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  user-select: none; font-weight: 500; flex-wrap: wrap;
}
.cat-bar .cb-meta { font-size: 11.5px; font-weight: 400; opacity: .82; }
.cat-bar .cb-caret { margin-left: auto; opacity: .7; transition: transform .15s; }
.cat-block.open .cb-caret { transform: rotate(90deg); }
.cat-body { display: none; }
.cat-block.open .cat-body { display: block; }
.cat-body table { font-size: 13.5px; }
.cat-body td, .cat-body th { padding: 7px 10px; }

.res-time { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-gap  { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.res-rank { font-variant-numeric: tabular-nums; font-weight: 600; width: 34px; }
.res-note { color: var(--muted); font-size: 12px; }

.filterrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

/* ------------------------------------------------------------------ Filter-Chips
   Standen frueher nur in capture.css - die Startliste, die Live-Seite und zwei
   Adminreiter laden die nicht, dort waren die Chips also voellig ungestaltet und
   der gewaehlte Filter nicht zu erkennen. Dieselbe Falle wie bei .fsplit. */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; margin: 0 6px 6px 0; border-radius: 999px;
  border: 0.5px solid var(--line-2); background: #fff; color: var(--text);
  font-size: 13px; font-family: inherit; cursor: pointer; user-select: none;
}
.chip:hover { background: var(--bg); }
.chip .cdot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* Gewaehlt: ohne eigene Farbe dunkel, mit Streckenfarbe in eben dieser Farbe.
   Heller Schleier plus kraeftiger Rand statt weisser Schrift auf Vollfarbe -
   auf Gelb (#d8b400) und Orange (#e0821e) waere Weiss kaum zu lesen. */
.chip.on {
  background: var(--text); color: #fff; border-color: var(--text); font-weight: 500;
}
.chip.on .cdot { outline: 1.5px solid rgba(255,255,255,.85); outline-offset: 1px; }

.chip.on[style*="--km"] {
  background: var(--km-bg); color: var(--text);
  border-color: var(--km-color); box-shadow: inset 0 0 0 1px var(--km-color);
}
.chip.on[style*="--km"] .cdot { outline: 1.5px solid #fff; outline-offset: 1px; }

.startlist-table td:first-child, .startlist-table th:first-child { white-space: nowrap; }

.pub-notice { font-size: 12px; color: var(--warn-dk); background: var(--warn-bg);
              border: 0.5px solid var(--warn); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ Kennzahlen */
.stat .stat-n { font-size: 30px; font-weight: 600; line-height: 1.12; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .stat .stat-n { font-size: 25px; }
  /* Der Beisatz bleibt auch auf dem Handy stehen. Frueher war er hier
     ausgeblendet - "auf dem Handy zaehlt die Zahl". Das war falsch gedacht:
     ohne ihn ist "Im Ziel" oder "Noch keine Durchfahrt" nicht eindeutig, und
     genau dort, wo wenig Platz ist, braucht man die Erklaerung am meisten. */
  .stat .stat-sub { font-size: 11px; line-height: 1.25; }
}

/* --------------------------------------------------- Anmeldetisch (Reiter Teilnehmer)
   Grosse Zeilen statt achtspaltiger Tabelle: am Handy des Helfers darf nichts
   waagerecht scrollen, und der Barbetrag muss ins Auge springen. */
.su-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-bottom: 0.5px solid var(--line);
  color: inherit; text-decoration: none;
}
.su-row:hover { background: var(--bg); }
.su-row:last-child { border-bottom: none; }
.su-main { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.su-main .cdot { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
                 margin-right: 7px; vertical-align: baseline; }
.su-sub { display: block; margin-top: 2px; }
.su-bar {
  flex: 0 0 auto; background: var(--danger); color: #fff;
  font-size: 14px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  white-space: nowrap;
}
.su-betrag {
  font-size: 19px; font-weight: 700; color: var(--danger);
  white-space: nowrap;
}

/* Die vergebene Startnummer, bildschirmfuellend - bleibt bis Klick oder ESC. */
.done-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 20, 15, .88);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.done-box { text-align: center; color: #fff; padding: 20px; }
.done-dot .plate-dot { width: 30px; height: 30px; border-radius: 8px; }
.done-num {
  font-family: 'SF Mono', 'Consolas', ui-monospace, monospace;
  font-size: clamp(90px, 30vw, 220px); font-weight: 700; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.done-name { font-size: clamp(20px, 5vw, 34px); font-weight: 600; margin-top: 4px; }
.done-info { font-size: clamp(14px, 3.5vw, 20px); color: rgba(255,255,255,.75); margin-top: 6px; }
.done-hint { margin-top: 22px; color: rgba(255,255,255,.55); }

/* ------------------------------------------------------- Druckknoepfe
   Alle Knoepfe, die eine PDF fuer den Druck erzeugen, tragen dasselbe
   Druckersymbol (druck_icon() in lib/view.php) und heben sich farblich ab. */
.btn-druck {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 600;
}
.btn-druck:hover:not(:disabled) { background: #0c5a46; border-color: #0c5a46; color: #fff; }
.btn-druck svg { width: 1.05em; height: 1.05em; flex: 0 0 auto; }

/* ------------------------------------------- Ein Kopf fuer die ganze Liste
   Start- und Ergebnisliste tragen die Spaltenueberschriften (Nr., Name, ...)
   nur EINMAL ganz oben; die Klassenkaesten darunter behalten nur ihren
   farbigen Balken. Damit die Spalten ueber alle Kaesten hinweg fluchten,
   bekommen Kopf und alle Tabellen dieselben festen Spaltenbreiten. */
.cols-head { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cols-head th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 10px 6px; border: none; background: transparent;
  /* Ein Wort wie RUECKSTAND darf nicht breiter sein als seine schmale
     Spalte - sonst schiebt es auf dem Handy die ganze Seite ins Seitliche. */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cols-head th.num { text-align: right; }
.tbl-fix { table-layout: fixed; width: 100%; }
.tbl-fix td { overflow-wrap: break-word; }

/* Spaltenbreiten der Ergebnisliste - als Klassen, damit die Handy-Stufe sie
   umdefinieren kann (Inline-Breiten an <col> kaeme keine Media-Query bei). */
col.c-pl   { width: 44px; }
col.c-nr   { width: 66px; }
col.c-club { width: 26%; }
col.c-rd   { width: 40px; }
col.c-zeit { width: 92px; }
col.c-gap  { width: 88px; }

@media (max-width: 640px) {
  /* Auf dem Handy gehoert der Platz dem NAMEN: die Zahlenspalten ruecken
     zusammen, der Verein weicht ganz - sonst bricht der Name buchstabenweise
     um (einbuchstabige Spalte, nachgesehen im Ernstfall). Die Zellen bleiben
     im Baum (display:none wuerde bei table-layout:fixed die Spalten
     verschieben), sie werden nur auf Breite null geklappt. */
  col.c-pl   { width: 30px; }
  col.c-nr   { width: 46px; }
  col.c-club { width: 0; }
  col.c-rd   { width: 26px; }
  col.c-zeit { width: 78px; }
  col.c-gap  { width: 64px; }
  .td-club { padding: 0 !important; overflow: hidden; white-space: nowrap; }
  .cols-head th { font-size: 10.5px; letter-spacing: .02em; padding-left: 7px; padding-right: 4px; }
}

/* ------------------------------------------------- Rennarchiv (rennen.php) */
/* Kachel ist ein DIV; der Hauptlink deckt sie per ::after komplett ab
   (Stretched Link), der Gesamtwertungs-Verweis liegt mit z-index darueber -
   ein <a> im <a> waere ungueltig und klickte unberechenbar. */
.renn-kachel { position: relative; padding: 16px 18px; transition: border-color .15s; }
.renn-kachel:hover { border-color: var(--accent); }
.rk-name { font-size: 19px; font-weight: 700; margin: 4px 0 2px; }
.rk-dots { margin-top: 10px; display: flex; gap: 5px; }
.rk-dots .cdot { width: 12px; height: 12px; border-radius: 4px; }
.rk-cta { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap;
          font-weight: 600; font-size: 14px; }
.rk-cta a { color: var(--accent); text-decoration: none; }
.rk-cta a:hover { text-decoration: underline; }
a.rk-haupt::after { content: ''; position: absolute; inset: 0; }
a.rk-neben { position: relative; z-index: 1; }

/* Leistungsuebersicht auf der Landing Page */
.lst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 16px 22px; }

/* ------------------------------------------------ Rennen-Assistent */
.wizsteps { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 16px; }
.wstep { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px;
         border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
         color: var(--muted); text-decoration: none; background: var(--card); }
.wstep i { font-style: normal; width: 20px; height: 20px; border-radius: 50%;
           background: var(--line); color: var(--text); font-size: 12px; font-weight: 700;
           display: inline-flex; align-items: center; justify-content: center; }
.wstep.akt { border-color: var(--accent); color: var(--text); font-weight: 600; }
.wstep.akt i, .wstep.ok i { background: var(--accent); color: #fff; }
.wstep.ok { color: var(--text); }
.wkarte { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line);
          border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.wkarte:hover, .wkarte.gewaehlt { border-color: var(--accent); }
.wkarte input { margin-top: 4px; }
fieldset.wstrecke { border: 1px solid var(--line); border-radius: 10px;
                    padding: 10px 14px 12px; margin-bottom: 12px; }
fieldset.wstrecke legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
