/* =====================================================================
   Ligamanager – Stylesheet
   Aufbau: 1 Grundwerte · 2 Basis · 3 Grundgerüst (Seitenleiste, Ticker) · 4 Bausteine
   (Knopf, Karte, Kachel, Plakette, Reiter, Tabelle, Formular, Hinweis) · 5 Seiten
   Regeln: Abstände nur aus dem Raster (--s-*), Radien --r / --r-lg, Bedienelemente --h / --h-sm hoch.
   ===================================================================== */

/* ---------- 1 Grundwerte ---------- */
:root {
  color-scheme: dark;              /* dunkle Auswahlfelder, Datums- und Farbwähler, Scrollbalken */
  --bg: #121418;
  --surface: #1c1f25;
  --surface-2: #242830;            /* Eingabefelder, erhöhte Flächen */
  --text: #e9ebef;
  --muted: #9aa1ad;
  --accent: #5865f2;
  --accent-text: #ffffff;
  --border: #2c3038;
  --border-strong: #3a3f49;
  --error: #ef5350;
  --warning: #f9a825;
  --success: #43a047;
  --success-text: #81c784;
  --league: var(--accent);
  --league-text: var(--accent-text);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --r: 8px; --r-lg: 12px; --r-pill: 999px;
  --h: 40px; --h-sm: 32px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 16px rgba(0, 0, 0, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --text: #1c1f24;
  --muted: #5b6270;
  --border: #dfe2e8;
  --border-strong: #c9cdd6;
  --error: #c62828;
  --success: #2e7d32;
  --success-text: #2e7d32;
  --shadow: 0 1px 2px rgba(20, 24, 32, .06), 0 4px 16px rgba(20, 24, 32, .06);
}

/* ---------- 2 Basis ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
a { color: color-mix(in srgb, var(--league, var(--accent)) 70%, var(--text)); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.eyebrow { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow a { color: inherit; }
.brand { font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.page-title { margin: 0 0 var(--s-4); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: var(--s-2) 0; display: flex; gap: var(--s-3); align-items: center; }
:focus-visible { outline: 2px solid var(--league, var(--accent)); outline-offset: 2px; }

main { max-width: 1200px; margin: var(--s-6) auto; padding: 0 var(--s-4); }

/* ---------- 3 Grundgerüst: Seitenleiste, mobiler Kopf, Ticker ---------- */
body.app { --side-w: 248px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
body.app.with-servers { --side-w: 320px; }                      /* Icon-Spalte 72 px + Kanal-Spalte 248 px */
.content { min-width: 0; }
.content main { margin: var(--s-5) auto var(--s-6); }
.mobile-bar { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex;
  background: var(--surface); border-right: 1px solid var(--border);
}
.community-icon-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.community-icon-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 12px;
                          background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }

/* Fahrerplakette oben in der Seitenleiste: Name + Rating je Simulation */
.driver-plate { display: flex; flex-direction: column; gap: 4px; padding: var(--s-2); border: 1px solid var(--border);
                border-top: 3px solid var(--community-1, var(--accent)); border-radius: var(--r); background: var(--surface-2); }
.plate-head { display: flex; gap: var(--s-2); align-items: center; font-weight: 700; line-height: 1.25; min-width: 0; }
.plate-head img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.plate-name { overflow-wrap: anywhere; }
.plate-row { display: grid; grid-template-columns: 3.2em auto auto 1fr; align-items: center; gap: 6px; padding: 2px 4px;
             border-radius: 4px; font-size: .78rem; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.plate-row:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.plate-sim { font-size: .66rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.plate-elo { font-weight: 700; }
.plate-place { justify-self: end; color: var(--muted); font-size: .72rem; }
.plate-empty { display: block; color: var(--muted); font-size: .75rem; line-height: 1.35; }
:root[data-theme="light"] .plate-head img { background: var(--logo-bg); border-radius: 6px; padding: 2px 4px; }
.side-user { display: flex; gap: var(--s-3); align-items: center; padding: 0 var(--s-2); font-weight: 600; line-height: 1.3; }
.side-user img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.side-login { text-align: center; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: var(--s-2); min-height: 34px; padding: 0 var(--s-3); border-radius: var(--r);
              color: var(--text); text-decoration: none; font-size: .92rem; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"] { background: color-mix(in srgb, var(--league, var(--accent)) 18%, transparent); font-weight: 600; }
.side-sim { margin: var(--s-3) var(--s-3) 0; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-tba, .sim-title .side-tba { display: inline-block; margin-left: var(--s-1); padding: 0 5px; border: 1px solid var(--border); border-radius: 4px;
                                  font-size: .68rem; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 400; }
.side-league { margin-top: 2px; }
.side-league summary { display: flex; align-items: center; gap: var(--s-2); min-height: 38px; padding: 0 var(--s-3); cursor: pointer;
                       font-weight: 700; list-style: none; border-radius: var(--r); }
.side-league summary:hover { background: var(--surface-2); }
.side-league summary::-webkit-details-marker { display: none; }
.side-league summary::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: .8rem; }
.side-league[open] summary::after { content: "▾"; }
.side-league summary img { width: 40px; height: 22px; object-fit: contain; flex: none; }
.side-signups { margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-signups.is-full { color: var(--error); }
.side-league summary:has(.side-signups)::after { margin-left: var(--s-2); }
.side-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--league); margin: 0 14px; flex: none; }
.side-league a { padding-left: 60px; border-left: 3px solid transparent; border-radius: 0 var(--r) var(--r) 0; }
.side-league a[aria-current="page"] { border-left-color: var(--league); }
.side-nav a.side-cta { color: var(--league); font-weight: 700; }
.side-nav a.side-restricted::after { content: "🔒"; font-size: .7em; opacity: .55; margin-left: 2px; }
.side-bottom { margin-top: auto; }
.side-counters { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); padding: 0 var(--s-2); color: var(--muted); font-size: .75rem; }
.online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #2ecc71;
              box-shadow: 0 0 0 3px rgba(46, 204, 113, .2); vertical-align: middle; }
.stat-online b .online-dot { width: 10px; height: 10px; margin-right: 8px; }
.site-counters { margin-bottom: var(--s-4); }
.side-legal { padding: 0 var(--s-2); color: var(--muted); font-size: .75rem; }
.side-legal a { color: var(--muted); }
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--warning); color: #1c1f24;
             font-size: .72rem; font-weight: 700; text-align: center; margin-left: auto; }

/* Kopf oben angepinnt: Demo-Balken (falls Demo) und Newsticker gemeinsam, damit nichts untereinander rutscht */
.top-stack { position: sticky; top: 0; z-index: 30; }
.top-stack > .demo-bar, .top-stack > .ticker { position: relative; top: auto; }
/* Newsticker („Liga-Twitter“) */
.ticker { display: flex; align-items: center; gap: var(--s-3); height: 44px; padding: 0 var(--s-3); background: var(--surface);
          border-bottom: 1px solid var(--border); overflow: visible; position: sticky; top: 0; z-index: 30; }
.ticker-label { flex: none; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
                padding: 3px 8px; border-radius: 6px; background: var(--error); color: #fff; }
/* LIVE-Anzeige oben rechts (templates/_live.html) */
.live-slot { flex: none; position: relative; }
.live-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
                     border-radius: 999px; background: #e5263b; color: #fff; font-weight: 800; font-size: .75rem; letter-spacing: .08em; }
.live-menu summary::-webkit-details-marker { display: none; }
.live-menu summary b { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 0 6px; font-size: .7rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(340px, calc(100vw - 32px));
             padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
             box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.live-list .eyebrow { padding: var(--s-1) var(--s-2) var(--s-2); }
.live-item { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r); color: var(--text); text-decoration: none; }
.live-item:hover { background: var(--surface-2); }
.live-logo { width: 40px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--logo-bg, var(--surface-2));
             font-size: .7rem; font-weight: 800; color: var(--league, var(--accent)); overflow: hidden; }
.live-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.live-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.live-text b, .live-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-platform { flex: none; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.live-youtube { background: #ff0033; }
.live-twitch { background: #9146ff; }
.stream-links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-3); }
.stream-links .button { gap: 6px; }
.button.stream-youtube, .button.stream-youtube:hover { background: #ff0033; border-color: #ff0033; color: #fff; }
.button.stream-twitch, .button.stream-twitch:hover { background: #9146ff; border-color: #9146ff; color: #fff; }
.stream-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: .68rem;
              font-weight: 700; border: 1px solid var(--border); color: var(--muted); }
.stream-tag.is-live { background: #e5263b; border-color: #e5263b; color: #fff; letter-spacing: .06em; }
.stream-tag .live-dot { width: 6px; height: 6px; }
.ticker-window { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker var(--ticker-duration, 60s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0 14px 0 0; }
.tweet { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 4px 12px 4px 4px; font-size: .86rem;
         border: 1px solid var(--border); border-left: 3px solid var(--league); border-radius: var(--r-pill); background: var(--bg); }
.tweet a, .tweet span { color: var(--text); text-decoration: none; }
.tweet a:hover { text-decoration: underline; }
.tweet-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; background: var(--surface); }
.tweet-dot { display: inline-grid; place-items: center; background: var(--league); color: var(--league-text, #fff) !important; font-weight: 700; font-size: .75rem; }
.tweet .tweet-handle { color: var(--muted); font-weight: 600; font-size: .8rem; }
.tweet .tweet-time { color: var(--muted); font-size: .75rem; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-window { overflow-x: auto; mask-image: none; }
  .ticker-track { animation: none; }
  .ticker-list[aria-hidden="true"] { display: none; }
}

/* ---------- 4 Bausteine ---------- */

/* Knopf: .button (Hauptaktion, Ligafarbe) · .button-secondary · .button-ghost · .button-danger · Größe .button-small */
.button, .link-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--h); padding: 0 var(--s-4); border-radius: var(--r); border: 1px solid transparent;
  background: var(--league, var(--accent)); color: var(--league-text, var(--accent-text));
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer; transition: filter .15s, background .15s, border-color .15s;
}
.button:hover { filter: brightness(1.1); text-decoration: none; }
.button:disabled, .link-button:disabled { opacity: .5; cursor: not-allowed; }
.button-secondary, .season-links .button {
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
.button-secondary:hover, .season-links .button:hover { filter: none; border-color: var(--league, var(--accent)); }
.button-ghost { background: transparent; color: var(--text); border-color: transparent; }
.button-ghost:hover { filter: none; background: var(--surface-2); }
.button-danger { background: var(--error); color: #fff; }
.button-discord { background: #5865F2; color: #fff; }
.button-small, .link-button, .season-links .button { height: var(--h-sm); padding: 0 var(--s-3); font-size: .84rem; }
.button-block { width: 100%; }
/* Nebenaktion in Listen und Tabellen (zurückziehen, absagen …): schlichter kleiner Knopf, rot = zerstörend */
.link-button { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.link-button:hover { background: color-mix(in srgb, var(--error) 12%, transparent); }
.link-button.neutral { color: var(--text); border-color: var(--border-strong); }
.link-button.neutral:hover { background: var(--surface-2); }
.button-row, .dash-actions, .welcome-actions, .guide-actions, .claim-box { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.button-row form, .guide-actions form, .claim-box form, .release-box form, .start-action form { margin: 0; }

/* Karte */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--s-4); }
.card h1 { margin-top: 0; }
.card h2 { margin: 0 0 var(--s-3); font-size: 1.15rem; }
.card h3 { margin: var(--s-5) 0 var(--s-2); font-size: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-3); }
.card-head h1, .card-head h2 { margin: 0; }

/* Kachel (Startseite, Admin-Übersicht): feste Bereiche, gleiche Höhe in einer Reihe */
.tile-grid, .dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); align-items: stretch; }
.tile-grid .card + .card, .dash-grid .card + .card { margin-top: 0; }
.card.tile { display: flex; flex-direction: column; gap: var(--s-4); padding: 0; overflow: hidden; }
.tile-head { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4) var(--s-4) 0;
             border-top: 4px solid var(--league); margin-top: -1px; padding-top: calc(var(--s-4) + 4px); }
.tile-logo { flex: none; width: 88px; height: 48px; display: grid; place-items: center; border-radius: var(--r);
             background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.tile-logo img { width: 80px; height: 40px; object-fit: contain; }
.tile-logo span { font-weight: 800; font-size: .95rem; color: var(--league); letter-spacing: .02em; }
.tile-title { min-width: 0; }
.tile-title h2 { margin: 0; font-size: 1.05rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.tile-title .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-2) var(--s-3); margin: 0; padding: 0 var(--s-4); font-size: .9rem; }
.tile-facts dt { color: var(--muted); font-size: .82rem; padding-top: 1px; white-space: nowrap; }
.tile-facts dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-actions { margin-top: auto; padding: var(--s-4); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, transparent);
                display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.tile-actions .button { width: 100%; }
.tile-actions .tile-primary { grid-column: 1 / -1; }

/* Plakette (Status), Etikett, Farbfeld */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: .75rem; font-weight: 700;
         border: 1px solid var(--border-strong); vertical-align: middle; white-space: nowrap; }
.badge-official { background: var(--success); border-color: var(--success); color: #fff; }
.badge-provisional { background: var(--warning); border-color: var(--warning); color: #1c1f24; }
.badge-danger { background: var(--error); border-color: var(--error); color: #fff; }
.tag { display: inline-flex; align-items: center; height: 20px; margin-left: var(--s-1); padding: 0 6px; border-radius: 5px; font-size: .72rem; font-weight: 600;
       background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.tag-penalty { color: var(--error); border-color: var(--error); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }

/* Reiter: scrollen waagerecht statt umzubrechen */
.tabs { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s-3); border-radius: var(--r);
          color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--league); color: var(--league-text, #fff); font-weight: 600; }
.tabs a.tab-cta { background: color-mix(in srgb, var(--league) 15%, transparent); font-weight: 600; }

/* Tabelle */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s-2)); padding: 0 var(--s-2); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: var(--s-2) var(--s-2); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; vertical-align: middle; }
/* Textzellen dürfen umbrechen, damit keine Tabelle breiter als ihre Karte wird (keine Scrollleiste für Knöpfe);
   Überschriften, Zahlen und reine Zahlenraster (.keep-table) bleiben einzeilig */
table.data:not(.keep-table) td { white-space: normal; }
table.data td.num, table.data td.nowrap { white-space: nowrap; }
td.entry-actions { width: 1%; }
table.data th { color: var(--muted); font-weight: 700; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
table.data th a { color: inherit; text-decoration: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--league) 6%, transparent); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tr.dim td { color: var(--muted); }
table.data td.dropped { text-decoration: line-through; color: var(--muted); }
table.data td.fastest { color: #b36ad6; font-weight: 700; }
table.data td.wrap { white-space: normal; }
table.data td.forfeited { color: var(--muted); font-size: .8rem; }
table.data.compact td, table.data.compact th { padding: var(--s-1) 6px; }
table.data tr.withdrawn td { text-decoration: line-through; }
table.data tr.withdrawn td:last-child { text-decoration: none; }
/* eigene Zeile des eingeloggten Fahrers in der Farbe der Serie */
table.data tr.me td { background: color-mix(in srgb, var(--league, var(--accent)) 22%, transparent); font-weight: 600; }
table.data tr.me td:first-child { box-shadow: inset 4px 0 0 var(--league, var(--accent)); }
table.data tr.me.dim td { opacity: 1; }
td.entry-actions { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); white-space: normal; min-width: 200px; }
td.entry-actions form { display: inline; }
td.nowrap-actions { display: flex; gap: var(--s-2); align-items: center; }
td.reason { max-width: 420px; }

/* Formular: ein Stil für alle Eingabefelder */
input[type=text], input[type=number], input[type=url], input[type=search], input[type=email], input[type=datetime-local],
input[type=date], input[type=time], input:not([type]), select, textarea {
  height: var(--h); padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .93rem; max-width: 100%;
}
textarea { height: auto; min-height: 96px; padding: var(--s-2) var(--s-3); line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--league, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--league, var(--accent)) 25%, transparent); }
input[type=file] { font: inherit; font-size: .88rem; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { height: var(--h-sm); margin-right: var(--s-3); padding: 0 var(--s-3); border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--league, var(--accent)); flex: none; }
label.check { display: flex; gap: var(--s-2); align-items: flex-start; }
label.check input { margin-top: 3px; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-4); margin-bottom: var(--s-4); }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; }
.form-grid label.check { flex-direction: row; align-items: center; gap: var(--s-2); font-weight: 400; align-self: end; min-height: var(--h); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid small { font-weight: 400; }
fieldset.choice { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; gap: 6px; margin: 0; }
fieldset.choice legend { font-weight: 600; font-size: .88rem; padding: 0 var(--s-1); }
fieldset.choice label.check { align-self: auto; min-height: 0; }
input.filter, .copy-field input { width: 100%; margin-bottom: var(--s-3); }
.copy-field { display: flex; gap: var(--s-2); align-items: flex-start; }
.color-field { display: flex; gap: 6px; }
.color-field input[type=color] { width: var(--h); height: var(--h); padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2); }
.color-field input[type=text] { flex: 1; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: 0; }
/* Mitgliederliste: volle Zellen dürfen umbrechen, Aktionen untereinander (sonst scrollt die Tabelle seitlich) */
table#members td { white-space: normal; }
table#members td:first-child { min-width: 200px; }
td.member-actions { width: 260px; min-width: 200px; }
td.member-actions > form + form { margin-top: var(--s-2); }
td.member-actions .inline-form { display: flex; width: 100%; }
td.member-actions .inline-form select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
.inline-form select { height: var(--h-sm); max-width: 320px; }
.upload-form { display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-start; margin: var(--s-3) 0; }
.upload-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.sticky-save { position: sticky; bottom: 0; padding: var(--s-3) 0; background: linear-gradient(transparent, var(--bg) 40%); margin-top: var(--s-4); }

/* Hinweise */
.flash { padding: var(--s-3) var(--s-4); border-radius: var(--r); margin-bottom: var(--s-4); border: 1px solid var(--border); background: var(--surface); }
.flash-error { border-color: var(--error); color: var(--error); background: color-mix(in srgb, var(--error) 8%, var(--surface)); }
.flash-success { border-color: var(--success); color: var(--success-text); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.notice { padding: var(--s-3) var(--s-4); border-radius: var(--r); background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 70%, transparent); }

/* Kennzahlen */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.stat { border: 1px solid var(--border); border-top: 3px solid var(--league, var(--accent)); border-radius: var(--r); padding: var(--s-3); background: var(--surface-2); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat b small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.stat > span { font-size: .8rem; color: var(--muted); }   /* nur die Beschriftung, nicht Plaketten in der Zahl */
.fill-bar { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.fill-bar span { display: block; height: 100%; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s-4); margin: 0 0 var(--s-4); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- 5 Seiten ---------- */

/* Startseite */
.landing { max-width: 640px; }
.sim-title { margin: var(--s-5) 0 var(--s-3); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Liga-Seiten (öffentlich) */
.league { --league: var(--accent); --league-text: var(--accent-text); }
.league-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3);
               margin-bottom: var(--s-4); padding-bottom: var(--s-3); border-bottom: 3px solid var(--league); }
.league-head h1 { margin: 0; font-size: 1.5rem; }
.brand-line { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
img.league-logo { height: 52px; max-width: 150px; object-fit: contain; flex: none; }
img.league-logo.small { height: 28px; max-width: 80px; }
img.logo-preview { max-height: 100px; max-width: 260px; object-fit: contain; }
.event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.class-title { border-left: 4px solid var(--class, var(--league)); padding-left: var(--s-2); margin: var(--s-5) 0 var(--s-2); }
.card > .class-title:first-child { margin-top: 0; }
.car { display: inline-flex; align-items: center; gap: var(--s-2); }
img.livery { width: 64px; height: 36px; object-fit: contain; flex: none; }
img.track-thumb { width: 96px; height: 36px; object-fit: cover; border-radius: 6px; display: block; }
img.track-banner { max-width: none; width: calc(100% + 2 * var(--s-5)); margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-4); max-height: 240px;
                   object-fit: cover; border-radius: var(--r-lg) var(--r-lg) 0 0; display: block; }
img.track-preview { width: 230px; height: 80px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); }
.image-field { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-start; justify-content: space-between; }
.session-tabs { display: flex; gap: var(--s-2); margin: var(--s-1) 0 var(--s-3); }
.session-tabs button { display: inline-flex; align-items: baseline; gap: 6px; height: var(--h); padding: 0 var(--s-4); border: 1px solid var(--border-strong);
  border-radius: var(--r); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.session-tabs button b { font-size: 1.1rem; }
.session-tabs button span { font-size: .85rem; color: var(--muted); }
.session-tabs button[aria-selected="true"] { background: var(--league); border-color: var(--league); color: var(--league-text, #fff); }
.session-tabs button[aria-selected="true"] span { color: var(--league-text, #fff); opacity: .85; }
.session-panel > h3 { margin-top: var(--s-1); }
ol.decisions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.decision { border: 1px solid var(--border); border-left: 4px solid var(--error); border-radius: var(--r); padding: var(--s-3) var(--s-4); }
.decision-warning { border-left-color: var(--warning); }
.decision-none { border-left-color: var(--muted); }
.decision-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); }
.decision-penalty { font-weight: 700; color: var(--error); white-space: nowrap; }
.decision-warning .decision-penalty { color: #c68a00; }
.decision-none .decision-penalty { color: var(--muted); }
.decision-meta { margin-left: auto; }
.decision-reason { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }

/* Begrüßungsseite und Text-Editor */
.welcome { display: flex; flex-direction: column; gap: var(--s-4); }
.welcome .card + .card { margin-top: 0; }
img.poster { width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: var(--r-lg); display: block; background: var(--surface); border: 1px solid var(--border); }
.rich-text { line-height: 1.6; overflow-wrap: anywhere; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text h1 { font-size: 1.8rem; margin: .6em 0 .3em; }
.rich-text h2 { font-size: 1.4rem; margin: .6em 0 .3em; }
.rich-text h3 { font-size: 1.15rem; margin: .6em 0 .3em; }
.rich-text blockquote { margin: .6em 0; padding: 4px 14px; border-left: 4px solid var(--league, var(--accent)); color: var(--muted); }
.rich-text hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
.rich-text a { color: var(--league, var(--accent)); }
img.poster-preview { max-height: 160px; max-width: 280px; object-fit: contain; border-radius: var(--r); border: 1px solid var(--border); }
.welcome-edit h3 { margin-top: var(--s-2); }
.rich { border: 1px solid var(--border-strong); border-radius: var(--r); overflow: visible; margin-top: var(--s-1); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px solid var(--border);
                background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; position: sticky; top: 0; z-index: 5; }
.rich-toolbar select { height: 30px; padding: 0 6px; font-size: .85rem; }
.rich-toolbar button, .rich-color { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px;
                                    background: var(--surface); color: var(--text); cursor: pointer; font: inherit; display: inline-grid; place-items: center; }
.rich-toolbar button:hover, .rich-color:hover { border-color: var(--accent); }
.rich-group { display: inline-flex; gap: 2px; }
.rich-color { position: relative; font-weight: 700; color: #e53935; }
.rich-mark { color: var(--warning); }
.rich-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.rich-emoji-wrap { position: relative; }
.rich-emojis { position: absolute; top: 34px; left: 0; z-index: 10; width: 290px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
               padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.rich-emojis[hidden] { display: none; }
.rich-emojis button { border: 0; background: none; font-size: 1.2rem; padding: 2px; }
.rich-editor { min-height: 260px; padding: 14px 16px; background: var(--surface); outline: none; border-radius: 0 0 var(--r) var(--r); }
.rich-editor:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.rich + .muted, .rich > p.muted { padding: 0 var(--s-3); }

/* Anmeldung */
.step h2 { display: flex; align-items: center; gap: var(--s-3); }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--league); color: var(--league-text, #fff); font-size: .88rem; flex: none; }
.known { font-size: 1.02rem; }
.profile-check { display: flex; gap: var(--s-2); }
.profile-check input { flex: 1; }
.profile-result { margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r); border: 1px solid var(--border); display: flex; gap: var(--s-3); align-items: center; }
.profile-result img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.profile-result.ok { border-color: var(--success); }
.profile-result.error { border-color: var(--error); color: var(--error); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-3); }
.choice { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: var(--s-3) var(--s-4); border: 1px solid var(--border);
          border-left: 5px solid var(--class, var(--league)); border-radius: var(--r); background: var(--surface-2); color: var(--text);
          font: inherit; cursor: pointer; text-align: left; }
.choice.selected, .car-card.pick.selected, .mode-choice:has(input:checked) { outline: 2px solid var(--league); background: color-mix(in srgb, var(--league) 10%, transparent); }
.choice:disabled, .car-card.pick:disabled { opacity: .4; cursor: not-allowed; }
.mode-choice { flex-direction: column; }
.mode-choice input { margin-bottom: var(--s-1); }
.car-group h3 { display: flex; gap: var(--s-3); align-items: baseline; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); }
.car-card { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-2); border: 1px solid var(--border);
            border-radius: var(--r); cursor: pointer; text-align: center; font-size: .85rem; position: relative; background: var(--surface-2); }
.car-card input[type=checkbox] { position: absolute; top: var(--s-2); left: var(--s-2); }
.car-card img { width: 100%; max-width: 160px; aspect-ratio: 16 / 9; object-fit: contain; }
.car-card:has(input:checked) { border-color: var(--league); background: color-mix(in srgb, var(--league) 8%, transparent); }
.car-card:has(input:not(:checked)) img { opacity: .35; filter: grayscale(1); }
.car-card.pick { color: var(--text); font: inherit; }
.my-entry { display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-3); }
.my-entry img { width: 260px; max-width: 100%; height: auto; object-fit: contain; border-radius: var(--r); }
.big-number { font-size: 2rem; font-weight: 800; color: var(--league); line-height: 1; }
.forfeit-warning { margin-top: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r); border: 1px solid var(--error); background: color-mix(in srgb, var(--error) 8%, transparent); }
.forfeit-warning label.check { font-weight: 600; margin-top: 6px; }
.guest-events { margin-top: var(--s-4); display: flex; flex-direction: column; gap: 6px; }
.guest-list li { justify-content: space-between; border-bottom: 1px solid var(--border); }
.real-name { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-4); font-weight: 600; font-size: .88rem; }
.real-name input { width: 100%; max-width: 420px; }
.real-name small { font-weight: 400; }
.livery-upload { margin-top: var(--s-4); display: grid; gap: 6px; }
.livery-upload > label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; }
.livery-current { display: flex; align-items: center; gap: var(--s-3); margin-top: 6px; flex-wrap: wrap; }
.livery-current img { width: 240px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); }

/* Verwaltung */
.admin-league + .admin-league { margin-top: var(--s-5); }
.season-links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.season-hero h2 { margin: 2px 0 0; }
.season-list li { padding: var(--s-3) 0; border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; gap: var(--s-1); }
.season-list li:last-child { border-bottom: 0; }
.new-season { margin-top: var(--s-3); }
.new-season summary, details > summary { cursor: pointer; font-weight: 600; }
.new-season summary { padding: 6px 0; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px var(--s-4); max-height: 360px; overflow-y: auto;
             border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-2) var(--s-3); }
.checklist label.check { align-items: baseline; padding: 3px 0; }
.checklist label.selected { font-weight: 600; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-bottom: var(--s-4); }
.points-grid label { display: flex; flex-direction: column; font-size: .75rem; color: var(--muted); }
.points-grid input { width: 100%; height: var(--h-sm); padding: 0 6px; text-align: right; }
.strike-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.strike-rule { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-2); }
.strike-rule label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .8rem; color: var(--muted); }
.strike-rule input, .strike-rule select { width: 100%; height: var(--h-sm); }
.entries-filter { max-width: 260px; margin: 0; }
.member { display: flex; gap: var(--s-2); align-items: center; }
.member > span { min-width: 0; overflow-wrap: anywhere; }          /* lange Discord-Namen ohne Leerzeichen umbrechen */
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; }
ol.steps li { padding: 3px 0; }
ol.steps li.done::marker { content: "✓  "; color: var(--success); }
.upload-list li { flex-wrap: wrap; border-bottom: 1px solid var(--border); padding: var(--s-2) 0; }
.upload-item { justify-content: space-between; }

/* Einrichtungs-Assistent */
.guide { border: 1px solid var(--border); border-left: 4px solid var(--league, var(--accent)); border-radius: var(--r-lg); background: var(--surface);
         padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); box-shadow: var(--shadow); }
.guide-steps { display: flex; gap: var(--s-1); list-style: none; margin: 0 0 var(--s-3); padding: 0; flex-wrap: wrap; }
.guide-steps li { flex: 1 1 0; min-width: 44px; }
.guide-steps a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .72rem; text-align: center; }
.guide-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); font-weight: 700; font-size: .8rem; background: var(--bg); }
.guide-steps li.done .guide-dot { background: var(--league, var(--accent)); border-color: var(--league, var(--accent)); color: var(--league-text, #fff); }
.guide-steps li.current .guide-dot { border-color: var(--league, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--league, var(--accent)) 30%, transparent); }
.guide-steps li.current a { color: var(--text); font-weight: 700; }
.guide-body { display: flex; gap: var(--s-4); justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.guide-body h2 { margin: 2px 0 var(--s-1); }
.guide-body p { margin: 0; max-width: 60ch; }
.guide-eyebrow { font-size: .78rem; color: var(--muted); }
.setup-checklist .progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-bottom: var(--s-3); }
.setup-checklist .progress span { display: block; height: 100%; background: var(--league, var(--accent)); }
.checklist-steps { display: flex; flex-wrap: wrap; gap: 6px var(--s-4); list-style: none; padding: 0; margin: 0 0 var(--s-3); font-size: .88rem; }
.checklist-steps a { color: var(--muted); text-decoration: none; }
.checklist-steps li.done a { color: var(--text); }
.start-list li { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.start-list li:last-child { border-bottom: 0; }
.start-check { font-size: 1.3rem; }
.start-text { flex: 1; }

/* Rennleitung und Tickets */
.release-box { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
.steward-todo { border-left: 4px solid var(--warning); }
.steward-todo li { gap: var(--s-3); }
.penalty-types { flex-direction: row; flex-wrap: wrap; gap: 6px var(--s-4); }
.quick-row { display: flex; gap: 6px; align-items: center; }
.quick-row input { width: 90px; }
.decision-form textarea { width: 100%; }
.decision-form > .muted { margin-left: var(--s-3); }
.sanction-box { border-left: 4px solid var(--error); }
.protest-box { border-left: 4px solid var(--warning); }
.ticket-form textarea, .ticket-form select { width: 100%; }
.ticket-form > label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: var(--s-3); }
.ticket-form > label.check { flex-direction: row; align-items: flex-start; font-weight: 400; }
.ticket-list { display: flex; flex-direction: column; gap: var(--s-3); }
.ticket { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--r); padding: var(--s-3) var(--s-4); }
.ticket-open { border-left-color: var(--warning); }
.ticket-accepted { border-left-color: var(--success); }
.ticket-rejected { border-left-color: var(--muted); }
.ticket header { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.ticket-text { white-space: pre-wrap; margin: var(--s-2) 0; }
.steward-answer { margin-top: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r); background: var(--surface-2); }
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.workspace .card + .card { margin-top: 0; }
.ticket-pane { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.queue { position: sticky; top: 56px; max-height: calc(100vh - 84px); overflow-y: auto; padding: var(--s-3); }
.queue-tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-3); }
.queue-tabs a { flex: 1; text-align: center; padding: 6px; border-radius: var(--r); color: var(--text); text-decoration: none; font-size: .88rem; }
.queue-tabs a[aria-current="page"] { background: var(--league); color: var(--league-text, #fff); }
.queue-tabs .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: color-mix(in srgb, currentColor 18%, transparent); font-size: .75rem; }
.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.queue-item { display: flex; flex-direction: column; gap: 2px; padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); text-decoration: none; }
.queue-item:hover { border-color: var(--league); }
.queue-item.active { border-color: var(--league); background: color-mix(in srgb, var(--league) 10%, transparent); }
.queue-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.queue-who { font-size: .9rem; }
.new-dot { margin-left: auto; }
.ticket-head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: flex-start; flex-wrap: wrap; }
.ticket-head h2 { margin: 0; }
.decision-tabs { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.decision-tabs[open] > summary { margin-bottom: var(--s-3); }
.chat-messages { display: flex; flex-direction: column; gap: var(--s-2); max-height: 420px; overflow-y: auto; padding: var(--s-1); margin-bottom: var(--s-3); }
.chat-msg { max-width: 80%; padding: var(--s-2) var(--s-3); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); }
.chat-msg.own { align-self: flex-end; background: color-mix(in srgb, var(--league, var(--accent)) 14%, transparent); border-color: transparent; }
.chat-msg.steward .chat-meta { color: var(--league, var(--accent)); }
.chat-meta { font-size: .75rem; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: var(--s-2); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; min-height: var(--h); }

/* Fahrer-Rating */
.rating-badge { display: inline-flex; gap: var(--s-1); align-items: center; margin-left: 6px; font-size: .75rem; text-decoration: none; vertical-align: middle; }
.rating-badge .elo { color: var(--muted); font-variant-numeric: tabular-nums; }
.grade { display: inline-block; min-width: 2.1em; padding: 0 5px; border-radius: 4px; font-weight: 700; font-size: .78rem; text-align: center; color: #111; }
.grade-A { background: #43a047; color: #fff; }
.grade-B { background: #9ccc65; }
.grade-C { background: #ffb300; }
.grade-D { background: #e53935; color: #fff; }
.delta { font-size: .75rem; margin-left: 2px; }
.delta.up { color: var(--success-text); }
.delta.down { color: var(--error); }
.rating-help { margin-bottom: var(--s-3); }
.rating-help p { margin: 6px 0; max-width: 80ch; }

/* Rechtliches */
.legal h2 { margin-top: 1.4em; font-size: 1.05rem; }
.legal h2:first-child { margin-top: 0; }

/* ---------- Handy ---------- */
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 1fr; }
  .queue { position: static; max-height: 300px; }
}
@media (max-width: 860px) {
  body.app { display: block; }
  .mobile-bar { display: flex; align-items: center; gap: var(--s-3); height: 52px; padding: 0 var(--s-4); background: var(--surface);
                border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .menu-button { width: 40px; height: 40px; font-size: 1.3rem; background: none; border: 0; color: var(--text); cursor: pointer; border-radius: var(--r); }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0, 0, 0, .35); }
  .sidebar.open { transform: none; }
  .top-stack { top: 52px; }
  .content main { margin: var(--s-4) auto var(--s-5); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.35rem; }
  main { padding: 0 var(--s-3); }
  .card { padding: var(--s-4); border-radius: var(--r); }
  img.track-banner { width: calc(100% + 2 * var(--s-4)); margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-3); border-radius: var(--r) var(--r) 0 0; }
  .hide-sm { display: none; }
  .league-head { align-items: flex-start; }
  .league-head h1 { font-size: 1.2rem; }
  .league-head > .button, .league-head > a.button { width: 100%; }
  img.league-logo { height: 36px; max-width: 96px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
  .tile-grid, .dash-grid { grid-template-columns: 1fr; }
  .card-head > .button-row, .card-head > span { width: 100%; }
  .card-head > .button-row .button, .card-head > span .button { flex: 1; }
  .guide-label { display: none; }
  .chat-msg { max-width: 92%; }
  table.data th, table.data td { padding: 6px; }
  td.entry-actions { min-width: 160px; }
}
.admin-guild + .admin-guild { margin-top: var(--s-6); }
.admin-guild > .card-head { margin-bottom: var(--s-4); }
.tile-title h2 a { color: inherit; text-decoration: none; }
.form-grid > *, .form-grid label { min-width: 0; }
.form-grid input:not([type=checkbox]):not([type=radio]):not([type=color]), .form-grid select, .form-grid textarea { width: 100%; }
table.data a { text-decoration: none; }
table.data a:hover { text-decoration: underline; }
.steward-todo li { flex-wrap: wrap; }
@media (max-width: 640px) {
  .welcome-actions .button { flex: 1 1 100%; }
}
/* Liga-Logos sind meist für dunklen Hintergrund gemacht: im hellen Design auf dunkler Fläche zeigen */
:root { --logo-bg: #1a1d23; }
.tile-logo { background: var(--logo-bg); border-color: transparent; }
:root[data-theme="light"] img.league-logo, :root[data-theme="light"] .side-league summary img,
:root[data-theme="light"] .tweet-avatar, :root[data-theme="light"] .side-user img { background: var(--logo-bg); border-radius: 6px; padding: 2px 4px; }

/* ---------- Ranglisten im Kachel-Stil (Meisterschaft, Ergebnis, Qualifying, Starter, Rating, Kalender) ----------
   <div class="ranking" style="--cols: …; --cols-sm: …"> mit .rank-head und .rank-row (je eine Zelle pro Spalte).
   --class am .rank-row färbt den Streifen links (Multiclass), .podium-1/2/3 Gold/Silber/Bronze. */
.ranking { display: flex; flex-direction: column; gap: 6px; }
.rank-head, .rank-row { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: var(--s-3); padding: 0 var(--s-3); }
.rank-head { min-height: 28px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rank-head a { color: inherit; text-decoration: none; }
.rank-row { min-height: 52px; padding-top: 6px; padding-bottom: 6px; background: var(--surface-2); border: 1px solid var(--border);
            border-left: 4px solid var(--class, var(--league)); border-radius: var(--r); color: var(--text); text-decoration: none;
            transition: border-color .15s, background .15s; }
a.rank-row:hover, .rank-row:hover { border-color: color-mix(in srgb, var(--league) 45%, var(--border)); border-left-color: var(--class, var(--league)); }
.rank-row.dim { opacity: .6; }
.rank-row.me { background: color-mix(in srgb, var(--league) 18%, var(--surface-2)); border-color: var(--league); }
.rank-row.me .rank-name { color: var(--text); }
.rank-num, .rank-head .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-center { text-align: center; }
.rank-pos { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface);
            border: 1px solid var(--border-strong); font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }
.rank-pos.empty { background: none; border-color: transparent; color: var(--muted); }
.podium-1 .rank-pos { background: #ffd54a; border-color: #ffd54a; color: #1c1f24; }
.podium-2 .rank-pos { background: #cfd4dc; border-color: #cfd4dc; color: #1c1f24; }
.podium-3 .rank-pos { background: #d8955a; border-color: #d8955a; color: #1c1f24; }
.rank-driver { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.rank-driver img { width: 64px; height: 36px; object-fit: contain; flex: none; }
.rank-driver > span { display: flex; flex-direction: column; min-width: 0; }
.rank-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta b { color: var(--text); font-weight: 700; }
.rank-cell { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-cell.strong { color: var(--text); font-weight: 600; }
.rank-cell.dropped { text-decoration: line-through; }
.rank-cell.fastest { color: #b36ad6; font-weight: 700; }
.rank-total { text-align: right; font-weight: 800; font-size: 1.15rem; color: var(--league); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-total .tag { font-size: .68rem; }
.rank-extra { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: flex-end; }
.rank-group + .rank-group { margin-top: var(--s-5); }
.rank-group > .class-title { margin-top: 0; }
@media (max-width: 640px) {
  .rank-head, .rank-row { grid-template-columns: var(--cols-sm, var(--cols)); column-gap: var(--s-2); padding: 0 var(--s-2); }
  .rank-row { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .rank-pos { width: 30px; height: 30px; font-size: .85rem; }
  .rank-driver img { width: 44px; height: 26px; }
  .rank-total { font-size: 1rem; }
}
@media (max-width: 640px) {
  .card .ranking { margin: 0 calc(-1 * var(--s-3)); }
  .rank-cell { font-size: .8rem; }
  .rank-meta { font-size: .72rem; }
  .rank-name { font-size: .92rem; }
}
/* Markenlogo des Herstellers, transparent; .on-dark (aufgehellt) im Dark Mode, .on-light im Light Mode */
.brand-chip { display: inline-flex; align-items: center; height: 16px; margin-right: var(--s-1); vertical-align: middle; flex: none; }
.brand-chip img, .rank-driver .brand-chip img { width: auto; height: 14px; max-width: 48px; object-fit: contain; }
.rank-meta .brand-chip { margin-top: -2px; }
.brand-chip .on-light, :root[data-theme="light"] .brand-chip .on-dark { display: none; }
:root[data-theme="light"] .brand-chip .on-light { display: inline; }
.my-entry-actions { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); }

/* Betrieb (nur Betreiber) */
.operator { max-width: 1100px; }
.operator-server.is-pending { border-color: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.operator-title { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.operator-title h2 { margin: 0; }
.operator-icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; object-fit: cover;
                 background: var(--surface-2); font-weight: 800; color: var(--muted); }
.operator-facts { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-1) var(--s-3); margin: 0 0 var(--s-3); font-size: .9rem; }
.operator-facts dt { color: var(--muted); }
.operator-facts dd { margin: 0; }
@media (max-width: 640px) { .operator-facts { grid-template-columns: 1fr; } .operator-facts dd { margin-bottom: var(--s-2); } }

/* Werbung (eigene Anzeigen, gekennzeichnet) */
.content-body.has-rail { display: grid; grid-template-columns: minmax(0, 1fr); }
.content-body.has-rail > main { width: 100%; min-width: 0; }   /* auto-Ränder würden das Rasterelement sonst auf Inhaltsbreite schrumpfen */
.ad-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-rail { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--s-3);
           padding: 0 var(--s-4) var(--s-6); }
.ad-rail .ad-label { flex-basis: 100%; text-align: center; }
.ad-slot { display: block; width: 300px; max-width: 100%; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border);
           background: var(--surface); }
.ad-slot img { display: block; width: 100%; height: auto; }
.ad-slot:hover { border-color: var(--league, var(--accent)); }
@media (min-width: 1400px) {
  .content-body.has-rail { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); padding-right: var(--s-5); }
  .ad-rail { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; position: sticky; top: 64px;
             align-self: start; padding: var(--s-5) 0 0; }
  .ad-rail .ad-label { text-align: left; }
}
.ad-thumb { width: 88px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ad-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ad-preview { grid-column: span 1; align-self: end; }
.ad-preview img { max-width: 220px; max-height: 140px; border-radius: var(--r); border: 1px solid var(--border); }
.danger-zone { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.ad-request { padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.ad-request:first-of-type { border-top: 0; }
.ad-request p { margin: var(--s-2) 0 0; white-space: pre-line; }
@media (max-width: 640px) { .ad-thumb { width: 60px; height: 36px; } }
.ad-card { width: 300px; max-width: 100%; display: flex; flex-direction: column; gap: var(--s-2); }
.ad-card .ad-slot { width: 100%; }
.ad-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); font-size: .8rem; }
.ad-promo-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-code { font: inherit; font-weight: 800; letter-spacing: .06em; padding: 2px 10px; border-radius: 6px; cursor: pointer;
           border: 1px dashed var(--league, var(--accent)); background: color-mix(in srgb, var(--league, var(--accent)) 12%, transparent);
           color: var(--text); user-select: all; }
.ad-code:hover { background: color-mix(in srgb, var(--league, var(--accent)) 22%, transparent); }
.ad-code.copied::after { content: " ✓"; }
.ad-promo-text { flex-basis: 100%; color: var(--muted); }
.table-sponsor { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); }
.table-sponsor a { display: flex; align-items: center; height: 36px; color: var(--text); text-decoration: none; }
.table-sponsor img { max-height: 36px; max-width: 160px; width: auto; object-fit: contain; }
.sponsor-item { display: inline-flex; align-items: center; gap: var(--s-2); }
.sponsor-item .ad-promo-text { flex-basis: auto; }
.sponsor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: calc(-1 * var(--s-2)) 0 var(--s-4);
               padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.sponsor-bar a { display: flex; align-items: center; height: 40px; }
.sponsor-bar img { max-height: 40px; max-width: 160px; width: auto; object-fit: contain; }
.sponsor-bar a:hover img { opacity: .8; }

/* Handy: Datentabellen als Karten – jede Zeile ein Kästchen, Beschriftung aus dem Tabellenkopf (data-label per Skript) */
@media (max-width: 640px) {
  .table-wrap:has(> table.data:not(.keep-table)) { overflow-x: visible; margin: 0; padding: 0; }
  table.data:not(.keep-table), table.data:not(.keep-table) tbody { display: block; width: 100%; }
  table.data:not(.keep-table) thead { display: none; }
  table.data:not(.keep-table) tr { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); padding: var(--s-2) var(--s-3);
                                   margin-bottom: var(--s-2); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
  table.data:not(.keep-table) td { display: block; padding: 2px 0; border: 0; white-space: normal; text-align: left; min-width: 0; max-width: 100%; }
  table.data:not(.keep-table) td:empty { display: none; }
  table.data:not(.keep-table) td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: .65rem;
                                   font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  table.data:not(.keep-table) td:first-child, table.data:not(.keep-table) td.card-full { flex-basis: 100%; }
  table.data:not(.keep-table) td.entry-actions, table.data:not(.keep-table) td.member-actions { flex-basis: 100%; width: auto; min-width: 0; }
  table.data:not(.keep-table) td.num { text-align: left; }
}

/* Betrieb → Sicherung: Schlüssel einmal anzeigen */
.backup-key { border-color: var(--warning); }
.stat b .badge { font-size: .85rem; vertical-align: middle; }
.stat b .badge-provisional { color: #1c1f24; }
td.entry-actions.nowrap { flex-wrap: nowrap; }
.key-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin: var(--s-3) 0; padding: var(--s-3);
           border: 1px dashed var(--warning); border-radius: var(--r); background: var(--surface-2); }
.key-box code { font-size: 1rem; font-weight: 700; letter-spacing: .02em; overflow-wrap: anywhere; user-select: all; }

/* Kommentatorenbörse (templates/commentators/) */
.commentators { max-width: 1100px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: .75rem; font-weight: 700;
        background: color-mix(in srgb, var(--league, var(--accent)) 18%, transparent); color: var(--text); }
.chip-muted { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.chip-money { background: color-mix(in srgb, var(--success) 22%, transparent); }
.chip-direct { background: color-mix(in srgb, var(--warning) 30%, transparent); }
.stars { color: var(--border-strong); letter-spacing: 1px; margin-right: 4px; }
.stars .on { color: #f5b400; }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-4); }
.filter-bar label { min-width: 200px; }
.c-card { display: flex; flex-direction: column; gap: var(--s-3); color: var(--text); text-decoration: none; }
.c-card:hover { border-color: var(--league, var(--accent)); }
.c-card.has-accent { border-top: 4px solid var(--league); }
.c-card.has-accent .c-avatar { box-shadow: 0 0 0 3px var(--league); }
.c-accent .c-profile-head { border-top: 4px solid var(--league, var(--border)); }
.c-accent .c-profile-head .c-avatar { box-shadow: 0 0 0 4px var(--league, transparent); }
.guide-price { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); }
.c-avatar-edit { display: flex; align-items: center; gap: var(--s-3); }
.c-head { display: flex; align-items: center; gap: var(--s-3); }
.c-head h2 { margin: 0; font-size: 1.1rem; }
.c-avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
            background: var(--surface-2); font-weight: 800; color: var(--muted); }
.c-avatar img { width: 100%; height: 100%; object-fit: cover; }
.c-avatar:has(img) { background: transparent; }
.c-avatar.big { width: 84px; height: 84px; font-size: 1.4rem; }
.c-stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; }
.c-stats b { font-size: 1.3rem; margin-right: 4px; }
.c-stats span { font-size: .8rem; color: var(--muted); }
.c-profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.c-profile-head h1, .c-profile-head h2 { margin: 0 0 var(--s-1); }
.c-links { margin-top: var(--s-2); }
.c-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-4); margin: var(--s-4) 0; }
.c-columns .card { margin: 0; }
.c-checklist { list-style: none; padding: 0; margin: 0 0 var(--s-3); }
.c-checklist li { padding: 2px 0; }
.c-bio { white-space: pre-line; line-height: 1.6; }
.c-rating { padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.c-rating:first-of-type { border-top: 0; }
.c-rating p { margin: var(--s-1) 0 0; }
.gig-card { display: flex; gap: var(--s-4); align-items: center; color: var(--text); text-decoration: none; border-left: 4px solid var(--league, var(--accent)); }
.gig-card:hover { border-color: var(--league, var(--accent)); }
.gig-card h2 { margin: 2px 0 var(--s-2); font-size: 1.1rem; }
.gig-logo { width: 88px; height: 56px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--logo-bg, var(--surface-2));
            font-weight: 800; color: var(--league, var(--accent)); overflow: hidden; }
.gig-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gig-body { min-width: 0; }
.gig-work { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: var(--s-4); align-items: start; margin-top: var(--s-4); }
.gig-work .card { margin: 0; }
.applicant { padding: var(--s-2); border-radius: var(--r); }
.applicant + .applicant { margin-top: var(--s-1); }
.applicant.is-selected { background: color-mix(in srgb, var(--league, var(--accent)) 12%, transparent); }
.applicant-head { display: flex; align-items: center; gap: var(--s-3); color: var(--text); text-decoration: none; }
.applicant-head > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.operator .applicant { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); border-bottom: 1px solid var(--border); border-radius: 0; }
.c-chat { margin-top: var(--s-4); }
.c-chat-log { display: flex; flex-direction: column; gap: var(--s-2); max-height: 420px; overflow-y: auto; padding: var(--s-2) 0; }
.c-msg { max-width: 85%; padding: var(--s-2) var(--s-3); border-radius: var(--r); background: var(--surface-2); }
.c-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--league, var(--accent)) 16%, var(--surface-2)); }
.c-msg-body { white-space: pre-line; }
.c-chat-form { display: flex; gap: var(--s-2); align-items: flex-end; margin-top: var(--s-2); }
.c-chat-form textarea { flex: 1; }
@media (max-width: 800px) { .gig-work { grid-template-columns: 1fr; } .gig-card { flex-direction: column; align-items: flex-start; } }

/* Heller Modus: Text in Ligafarbe abdunkeln (helle Ligafarben wie Gelb wären auf Weiß kaum lesbar) */
:root[data-theme="light"] .rank-total, :root[data-theme="light"] .side-nav a.side-cta, :root[data-theme="light"] .big-number {
  color: color-mix(in srgb, var(--league, var(--accent)) 60%, #000); }
:root[data-theme="light"] .decision-warning .decision-penalty { color: #8a6100; }

/* Boxentafel (aktive Serien aller Communities) */
.pitboard { max-width: 1200px; }
.pit-tile { border-top: 4px solid var(--league, var(--accent)); }
.pit-community { display: flex; align-items: center; gap: 6px; }
.pit-community img { width: 18px; height: 18px; border-radius: 50%; }
.pit-chips { margin: 0 0 var(--s-2); }
.button.pit-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
select.suggested { border-color: var(--warning); }
.channel-category select { max-width: 420px; }
.pit-tile .tile-facts dd { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* Hilfe und Anleitungen (templates/help/) */
.help { max-width: 980px; }
.help-head { margin-bottom: var(--s-3); }
.help-head h1 { margin: 0; }
.help-tabs { margin-bottom: var(--s-4); }
.help .card { margin-bottom: var(--s-4); }
.help-section, .help-role { scroll-margin-top: 72px; }
.help-section h2, .help-role h2 { margin-top: 0; }
.help-section h3 { margin: var(--s-4) 0 var(--s-2); font-size: 1rem; }
.help-section p, .help-section li, .help-role li, .help-intro p { line-height: 1.6; }
.help-section ul, .help-role ul { padding-left: 1.2em; }
.help-section li + li, .help-role li + li { margin-top: var(--s-1); }
.help code { font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); overflow-wrap: anywhere; }
.help-toc ol { columns: 2 220px; column-gap: var(--s-5); margin: var(--s-2) 0 0; padding-left: 1.4em; }
.help-toc li { break-inside: avoid; padding: 2px 0; }
.help-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
.help-quick .card { margin: 0; display: flex; flex-direction: column; }
.help-quick .card > .button { margin-top: auto; align-self: flex-start; }
.help-steps { list-style: none; counter-reset: step; padding: 0; margin: var(--s-3) 0; }
.help-steps > li { counter-increment: step; position: relative; padding-left: 38px; min-height: 26px; }
.help-steps > li + li { margin-top: var(--s-3); }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
                           display: grid; place-items: center; font-size: .8rem; font-weight: 800;
                           background: var(--league, var(--accent)); color: var(--league-text, #fff); }
.help-table { display: grid; gap: 1px; margin: var(--s-3) 0; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--border); }
.help-table > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--surface); line-height: 1.55; }
.help-faq dt { font-weight: 700; margin-top: var(--s-3); }
.help-faq dt:first-child { margin-top: 0; }
.help-faq dd { margin: var(--s-1) 0 0; line-height: 1.6; color: var(--muted); }
.help .notice { margin: var(--s-3) 0 0; }
.help-shot { margin: var(--s-3) 0 var(--s-4); }
.help-shot img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--border);
                 box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.help-shot a:hover img { border-color: var(--league, var(--accent)); }
.help-shot figcaption { margin-top: var(--s-1); font-size: .78rem; color: var(--muted); }
@media (max-width: 640px) {
  .help-table > div { grid-template-columns: 1fr; gap: 2px; }
}
.show-sm { display: none; }
.overlay-list { display: flex; flex-direction: column; gap: 6px; }
.overlay-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2);
                padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-left: 4px solid var(--league);
                border-radius: var(--r); background: var(--surface-2); }
@media (max-width: 640px) { .show-sm { display: inline; } }

/* Teams */
.team-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); background: var(--logo-bg);
             overflow: hidden; flex: none; }
.team-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.team-logo span { font-weight: 800; font-size: .85rem; color: var(--league); }
.team-logo.big { width: 72px; height: 72px; }
.team-logo.big span { font-size: 1.2rem; }
.team-card { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); }
.team-card h2 { margin: 2px 0; }
.team-invite { border-left: 4px solid var(--league); }
.take-over { margin-top: var(--s-3); }
.member-chip { display: inline-flex; align-items: center; gap: 2px; margin: 2px 6px 2px 0; padding: 2px 4px 2px 10px; border-radius: var(--r-pill);
               background: var(--surface); border: 1px solid var(--border); font-size: .82rem; color: var(--text); }
.member-chip form { display: inline; }
.chip-remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.chip-remove:hover { color: var(--error); }
@media (max-width: 640px) { .team-logo { width: 36px; height: 36px; } }
.rank-total { min-width: 0; }
.rank-total .small { display: block; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; font-size: .7rem; font-weight: 600; }

/* Teilnahme je Rennen (Rennseite) */
.attendance-card > h3 { margin-top: 0; }
.attendance-counts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.att { display: inline-flex; align-items: center; gap: 4px; padding: 2px var(--s-2); border-radius: var(--r-pill);
       background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .85rem; }
.attendance-me { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3);
                 padding: var(--s-3); border-radius: var(--r); background: var(--surface-2); }
.attendance-buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.button.att-button-yes[aria-pressed="true"] { background: var(--success); border-color: var(--success); color: #fff; }
.attendance-names { margin-top: var(--s-3); }
.attendance-names summary { cursor: pointer; font-weight: 600; }
.attendance-names h4 { margin: var(--s-3) 0 var(--s-1); }

/* Streckenrekorde */
.record-filter label { min-width: 0; flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.record-filter select { width: 100%; }
.record-meta .brand-chip { margin-right: 4px; }
.tabs-hint { display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s-3); white-space: nowrap; flex: none; }
.record-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
               min-height: 220px; margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-4); padding: var(--s-5);
               border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; color: #fff; background: #111; isolation: isolate; }
.record-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.record-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
                       background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.05) 100%); }
.record-hero.no-image { background: linear-gradient(135deg, var(--league, var(--accent)), #111 80%); }
.record-hero-text { min-width: 0; }
.record-hero .eyebrow { color: rgba(255,255,255,.8); }
.record-hero h2 { margin: 2px 0 0; font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.15; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.record-hero-layout { font-weight: 600; color: rgba(255,255,255,.9); }
.record-hero-best { display: flex; flex-direction: column; align-items: flex-end; padding: var(--s-2) var(--s-3); border-radius: var(--r);
                    background: rgba(0,0,0,.45); border-left: 4px solid var(--league, var(--accent)); backdrop-filter: blur(4px); }
.record-hero-best b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.record-hero-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.8); }
@media (max-width: 640px) {
  .record-hero { min-height: 170px; margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-3); padding: var(--s-4); border-radius: var(--r) var(--r) 0 0; }
  .record-hero-best { align-items: flex-start; }
}
.setup-steps li { margin-bottom: var(--s-3); }
.tile-facts dd.tile-badges { white-space: normal; display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; }
.onboarding-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3); margin: var(--s-3) 0; }
.onboarding-path { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.onboarding-path h3 { margin-top: 0; }

/* Schiebeschalter (Checkbox mit role=switch) */
label.switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: var(--r-pill);
  background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin-top: 1px;
}
label.switch input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
label.switch input[type=checkbox]:checked { background: var(--league, var(--accent)); }
label.switch input[type=checkbox]:checked::after { transform: translateX(16px); }
label.switch input[type=checkbox]:focus-visible { outline: 2px solid var(--league, var(--accent)); outline-offset: 2px; }

/* ------------------------------------------------------------------
   Web-Chat je Serie (templates/chat/)
   ------------------------------------------------------------------ */
.chat-card { padding-bottom: var(--s-3); }
.chat-app { position: relative; display: flex; flex-direction: column; height: min(72vh, 780px); min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-2) 0; border-top: 1px solid var(--border); }
.chat-list { display: flex; flex-direction: column; }
.chat-empty { text-align: center; padding: var(--s-6) var(--s-4); }
.chat-older { align-self: center; margin: var(--s-2) 0 var(--s-3); background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--r-pill); padding: 4px 14px; cursor: pointer; font-size: .85rem; }
.chat-older:hover { color: var(--text); border-color: var(--border-strong); }
.chat-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--s-3);
  padding: 6px var(--s-3) 2px; margin-top: var(--s-2); border-radius: var(--r); }
.chat-row.grouped { margin-top: 0; padding-top: 1px; }
.chat-row.grouped .chat-main { grid-column: 2; }
.chat-row:hover { background: var(--surface-2); }
.chat-row:target { background: color-mix(in srgb, var(--league, var(--accent)) 14%, transparent); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-avatar-empty { display: grid; place-items: center; background: var(--league, var(--accent)); color: var(--league-text, #fff);
  font-weight: 700; text-transform: uppercase; }
.chat-main { min-width: 0; }
.chat-head { display: flex; align-items: baseline; gap: var(--s-2); line-height: 1.3; }
.chat-author { font-weight: 600; }
.chat-row.own .chat-author { color: var(--league, var(--accent)); }
.chat-head time { color: var(--muted); font-size: .75rem; }
.chat-text { line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.chat-text code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: .9em; }
.chat-text a { word-break: break-all; }
.chat-edited { color: var(--muted); font-size: .72rem; }
.chat-emoji { width: 1.375em; height: 1.375em; vertical-align: -.3em; object-fit: contain; }
.chat-jumbo { font-size: 2.2rem; line-height: 1.2; }
.chat-jumbo .chat-emoji { width: 48px; height: 48px; }
.spoiler { background: var(--border-strong); color: transparent; border-radius: 3px; cursor: pointer; transition: all .15s; }
.spoiler:hover, .spoiler:focus { background: var(--surface-2); color: inherit; }
.chat-media { display: block; margin-top: 4px; max-width: min(420px, 100%); }
.chat-media img { display: block; max-width: 100%; max-height: 320px; border-radius: var(--r); object-fit: contain; }
.chat-reply-ref { display: flex; gap: 6px; align-items: baseline; font-size: .8rem; color: var(--muted); text-decoration: none;
  min-width: 0; margin-bottom: 2px; }
.chat-reply-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-ref:hover { color: var(--text); }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-reaction { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; min-height: 26px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: .85rem; }
.chat-reaction.mine { border-color: var(--league, var(--accent)); background: color-mix(in srgb, var(--league, var(--accent)) 18%, var(--surface-2)); }
.chat-reaction .chat-emoji { width: 18px; height: 18px; vertical-align: -4px; }
.chat-tools { position: absolute; top: -14px; right: var(--s-3); display: none; gap: 2px; padding: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.chat-row:hover .chat-tools, .chat-row:focus-within .chat-tools { display: flex; }
.chat-tools button, .chat-icon-button { background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px;
  min-width: 32px; height: 32px; font-size: 1rem; display: inline-grid; place-items: center; }
.chat-tools button:hover, .chat-icon-button:hover { background: var(--surface-2); color: var(--text); }
.chat-row.deleted .chat-text { font-size: .9rem; }
.chat-jump { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); border: 0; cursor: pointer;
  background: var(--league, var(--accent)); color: var(--league-text, #fff); padding: 6px 14px; border-radius: var(--r-pill);
  box-shadow: var(--shadow); font-weight: 600; }
.chat-composer { border-top: 1px solid var(--border); padding-top: var(--s-2); }
.chat-context, .chat-attachment { display: flex; align-items: center; gap: var(--s-2); font-size: .85rem; color: var(--muted);
  background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; padding: 6px var(--s-3); }
.chat-context span, .chat-attachment span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-context button, .chat-attachment button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }
.chat-attachment img { height: 48px; max-width: 96px; object-fit: cover; border-radius: 6px; }
.chat-input-row { display: flex; align-items: flex-end; gap: var(--s-1); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r); padding: 4px; }
.chat-input-row textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; min-height: 32px;
  max-height: 200px; padding: 6px 4px; line-height: 1.4; color: var(--text); font: inherit; }
.chat-input-row textarea:focus { outline: none; }
.chat-input-row:focus-within { border-color: var(--league, var(--accent)); }
.chat-gif-button { font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.chat-icon-button { position: relative; }
.chat-send { min-height: 32px; height: 32px; padding: 0 14px; }
.chat-hint { margin: 4px 0 0; }
.chat-picker, .chat-react-bar { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); }
.chat-picker { right: 0; bottom: 96px; width: min(360px, 100%); max-height: 340px; overflow-y: auto; padding: var(--s-2); }
.chat-picker-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: var(--s-2) 4px 4px; }
.chat-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; }
.chat-picker-grid button { height: 36px; border: 0; background: none; border-radius: 6px; font-size: 1.35rem; cursor: pointer; padding: 0; }
.chat-picker-grid button:hover { background: var(--surface-2); }
.chat-picker-grid img { width: 28px; height: 28px; object-fit: contain; }
.chat-gif-picker input { width: 100%; margin-bottom: var(--s-2); }
.chat-gif-grid { columns: 2; column-gap: 6px; }
.chat-gif-grid button { display: block; width: 100%; margin-bottom: 6px; border: 0; padding: 0; background: var(--surface-2);
  border-radius: 6px; overflow: hidden; cursor: pointer; break-inside: avoid; }
.chat-gif-grid img { display: block; width: 100%; }
.chat-picker-credit { text-align: right; margin-top: 4px; }
.chat-react-bar { display: flex; gap: 2px; padding: 4px; }
.chat-react-bar button { border: 0; background: none; font-size: 1.2rem; width: 34px; height: 34px; border-radius: 6px; cursor: pointer; color: var(--text); }
.chat-react-bar button:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .chat-app { height: calc(100dvh - 190px); min-height: 360px; }
  .chat-row { grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--s-2); padding-inline: var(--s-2); }
  .chat-avatar { width: 32px; height: 32px; }
  .chat-hint { display: none; }
  .chat-jump { bottom: 70px; }
  .chat-picker { bottom: 60px; }
  .chat-row.own .chat-tools, .chat-row .chat-tools { right: var(--s-2); }
}
/* Touch: Werkzeuge erst nach Antippen der Nachricht (wie Discord mobil) */
@media (hover: none) {
  .chat-row:hover { background: none; }
  .chat-row .chat-tools, .chat-row:focus-within .chat-tools { display: none; }
  .chat-row.show-tools { background: var(--surface-2); }
  .chat-row.show-tools .chat-tools { display: flex; position: static; grid-column: 2; justify-self: start; margin-top: 4px; }
  .chat-tools button { min-width: 40px; height: 36px; }
}

.chat-new-divider { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-3) var(--s-3) 0; color: var(--error);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chat-new-divider::before { content: ""; flex: 1; border-top: 1px solid var(--error); }
.chat-new-divider span { background: var(--error); color: #fff; padding: 1px 6px; border-radius: 4px; }
.chat-row.grouped.after-divider { margin-top: var(--s-1); }
.side-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--error); flex: none; margin-left: -2px; }

/* Mitgliederliste im Chat (wie Discord) */
.chat-app { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: var(--s-3); }
.voice-bar { grid-column: 1; grid-row: 1; }
.chat-scroll { grid-column: 1; grid-row: 2; }
.chat-composer { grid-column: 1; grid-row: 3; }
.chat-members { grid-column: 2; grid-row: 1 / 4; overflow-y: auto; border-top: 1px solid var(--border);
  border-left: 1px solid var(--border); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3); }
.chat-members-toggle { display: none; }
.chat-members-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: var(--s-3) 0 var(--s-1); }
.chat-members-title:first-child { margin-top: var(--s-1); }
.chat-members-list { list-style: none; margin: 0; padding: 0; }
.chat-member { display: flex; align-items: center; gap: var(--s-2); padding: 4px 6px; border-radius: 6px; min-width: 0; }
.chat-member:hover { background: var(--surface-2); }
.chat-members-list.offline .chat-member { opacity: .45; }
.chat-member-avatar { position: relative; flex: none; width: 30px; height: 30px; }
.chat-member-avatar img, .chat-member-avatar > span { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.chat-member-avatar > span { display: grid; place-items: center; background: var(--league, var(--accent)); color: var(--league-text, #fff);
  font-weight: 700; font-size: .8rem; text-transform: uppercase; }
.chat-online-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: #23a55a; border: 3px solid var(--surface); }
.chat-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.chat-member.me .chat-member-name { font-weight: 600; }
.chat-member-role { flex: none; font-size: .65rem; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chat-member-role.role-admin { color: var(--league, var(--accent)); border-color: currentColor; }
@media (max-width: 900px) {
  .chat-app { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .chat-members { grid-column: auto; grid-row: auto; position: absolute; z-index: 15; top: 0; right: 0; bottom: 0; width: min(260px, 85%);
    background: var(--surface); box-shadow: var(--shadow); border-radius: var(--r) 0 0 var(--r); display: none; }
  .chat-app.members-open .chat-members { display: block; }
  .chat-members-toggle { display: inline-flex; align-items: center; gap: 4px; position: absolute; z-index: 16; top: 6px; right: 6px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-pill);
    padding: 3px 10px; font-size: .85rem; cursor: pointer; box-shadow: var(--shadow); }
}

/* Community-Banner oben links (statt „Ligamanager“) */
.brand.brand-banner { display: block; padding-top: 2px; padding-bottom: 2px; }
.brand.brand-banner img { display: block; max-width: 100%; max-height: 64px; object-fit: contain; object-position: left center; }
/* Seitenleiste: Banner über die volle Breite (hebt das Seiten-Padding auf), Höhe ergibt sich aus dem Bild */
.mobile-bar .brand.brand-banner img { max-height: 34px; max-width: 200px; }
.community-brand { padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.community-brand summary { cursor: pointer; display: flex; gap: var(--s-2); align-items: baseline; flex-wrap: wrap; }
.community-brand-body { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.community-brand-preview { width: 248px; max-width: 100%; padding: var(--s-3) var(--s-4); background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: var(--r); }
.community-brand-preview img { display: block; max-width: 100%; max-height: 64px; object-fit: contain; }

/* Sprachraum-Leiste oben im Chat */
.voice-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.voice-bar.voice-joined { border-color: #23a55a; box-shadow: inset 3px 0 0 #23a55a; }
.voice-title { font-weight: 700; white-space: nowrap; }
.voice-people { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.voice-person { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); font-size: .82rem; max-width: 180px; }
.voice-person img, .voice-person > span { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none;
  box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s; }
.voice-person > span { display: grid; place-items: center; background: var(--league, var(--accent)); color: var(--league-text, #fff);
  font-weight: 700; text-transform: uppercase; font-size: .75rem; }
.voice-person.speaking img, .voice-person.speaking > span { box-shadow: 0 0 0 2px #23a55a, 0 0 8px #23a55a; }
.voice-person b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-person i { font-style: normal; font-size: .75rem; }
.voice-person.muted b { color: var(--muted); }
.voice-status { flex-basis: 100%; order: 5; }
.voice-status:empty { display: none; }
.voice-actions { display: flex; gap: var(--s-2); margin-left: auto; }
.voice-actions [data-voice-mute].active { background: var(--error); color: #fff; }
.chat-member-voice { flex: none; font-size: .8rem; }
@media (max-width: 900px) {
  .voice-bar { padding-right: 70px; }            /* Platz für den 👥-Knopf */
  .voice-person b { display: none; }
  .voice-person { padding-right: 2px; }
}

/* ------------------------------------------------------------------
   Community-Akzentfarben (--community-1 → --community-2): nur schmale Linien, Ligafarben bleiben unberührt
   ------------------------------------------------------------------ */
/* Dezent: eine durchgehende Farbkante ganz oben über die volle Breite (Seitenleiste + Inhalt) – keine Rahmen */
body.has-community::before { content: ""; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; height: 4px;
  pointer-events: none; background: linear-gradient(90deg, var(--community-1), var(--community-2)); }
/* Vorschau in der Verwaltung */
.community-swatch { display: inline-block; width: 44px; height: 8px; border-radius: 4px; align-self: center;
  background: linear-gradient(90deg, var(--community-1), var(--community-2)); }
.community-colors { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.community-colors > label { display: grid; gap: 4px; font-size: .85rem; }
.community-preview { display: grid; gap: var(--s-2); width: min(280px, 100%); }
.community-preview-line { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--community-1), var(--community-2)); }
.community-preview-box { padding: 9px 10px 6px; font-size: .8rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--community-1), var(--community-2)) top / 100% 4px no-repeat, var(--surface); }

/* Gefahrenbereich (Liga löschen) */
.danger-zone { border-color: color-mix(in srgb, var(--error) 55%, var(--border)); }
.danger-zone h2 { color: var(--error); }
.danger-zone .inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.danger-zone label { display: grid; gap: 4px; font-size: .9rem; }

/* Ticket-Hinweise: eigene Kategorie-Auswahl direkt über dem Kanalfeld */
.channel-own-category { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--border-strong); border-radius: var(--r); }
.channel-field { display: grid; gap: 6px; align-content: start; }
.channel-other-category { display: grid; gap: 4px; }
.channel-other-category label.check { min-height: 0; font-size: .82rem; color: var(--muted); align-self: start; }
.channel-other-category select { width: 100%; }

/* Download-Menü (Meisterschaft, Rennergebnis): HTML, PNG, JPEG */
.download-menu { position: relative; flex: none; }
.download-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--h-sm); padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.download-menu summary::-webkit-details-marker { display: none; }
.download-menu summary:hover, .download-menu[open] summary { border-color: var(--league, var(--accent)); }
.download-options { position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; min-width: 240px; display: grid; gap: 2px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.download-options a { display: grid; grid-template-columns: 24px auto; column-gap: 8px; align-items: center; padding: 8px 10px;
  border-radius: var(--r); color: var(--text); text-decoration: none; }
.download-options a:hover { background: var(--surface-2); }
.download-options small { grid-column: 2; color: var(--muted); font-size: .78rem; }
.event-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
@media (max-width: 640px) { .event-head { flex-wrap: wrap; } .event-head > div:first-child { min-width: 0; flex: 1 1 100%; }
  .event-head-side { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* Rückfrage-Popup (z.B. Saison archivieren → Fahrer-Rolle entfernen?) */
.confirm-dialog { max-width: min(460px, calc(100vw - 32px)); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r);
                  background: var(--surface); color: var(--text); }
.confirm-dialog::backdrop { background: rgb(0 0 0 / .55); }
.confirm-dialog h3 { margin-top: 0; }

/* Formular in Schritten (z.B. Sponsor anlegen) */
.form-step { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-5) 0 var(--s-3); font-size: 1.05rem; }
.form-step:first-of-type { margin-top: 0; }
.form-step span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
                  background: var(--league, var(--accent)); color: var(--league-text, var(--accent-text)); font-size: .85rem; font-weight: 800; }
.form-more { margin: var(--s-5) 0 var(--s-4); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-3) var(--s-4); }
.form-more summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.form-more[open] summary { margin-bottom: var(--s-3); }
.discord-master { margin: var(--s-3) 0; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.paddock-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); padding: var(--s-3);
                  border: 1px solid var(--border); border-left: 4px solid var(--league, var(--accent)); border-radius: var(--r); background: var(--surface-2); }
.paddock-status p { margin: 0; flex-basis: 100%; }
/* Handy: Reiter umbrechen statt seitlich wischen – alle Reiter sind sofort sichtbar */
@media (max-width: 640px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tabs a { height: 32px; padding: 0 var(--s-2); }
}
.series-list { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: var(--s-1) 0 0 28px; }

/* Logos der Simulationen (hell/dunkel) und Mini-Symbol in der linken Leiste */
.sim-logo { display: inline-flex; align-items: center; vertical-align: middle; }
.sim-logo img { display: block; width: auto; max-width: 260px; object-fit: contain; }
.sim-logo-xs img { height: 14px; max-width: 110px; }
.sim-logo-sm img { height: 20px; max-width: 150px; }
.sim-logo-md img { height: 28px; }
.sim-logo .on-light, :root[data-theme="light"] .sim-logo .on-dark,
.sim-icon .on-light, :root[data-theme="light"] .sim-icon .on-dark { display: none; }
:root[data-theme="light"] .sim-logo .on-light, :root[data-theme="light"] .sim-icon .on-light { display: block; }
.sim-beta { margin-left: 6px; font-size: .72rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); vertical-align: middle; }
.sim-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 18px; margin-right: 6px; flex: none; }
.sim-icon img { max-width: 30px; max-height: 18px; width: auto; height: auto; }
.side-sim { display: flex; align-items: center; }
.sim-title { display: flex; align-items: center; gap: var(--s-1); }
.tabs a.sim-tab, .tabs:has(.sim-tab) a { padding: 0 var(--s-3); border: 2px solid transparent; }
/* Simulation gewählt: Rahmen in ihrer Farbe statt voller Füllung (Logos bleiben gut lesbar); „Alle“ daneben genauso */
.tabs a.sim-tab[aria-current="page"], .tabs:has(.sim-tab) a[aria-current="page"] { background: color-mix(in srgb, var(--league) 10%, transparent); color: var(--text);
  border-color: var(--league); }
.tabs a.sim-tab:hover:not([aria-current="page"]) { border-color: color-mix(in srgb, var(--league) 40%, transparent); }
.chips .sim-logo, .chips .sim-beta { margin-right: var(--s-2); }

/* Simulation im Profil abgewählt: Liga ausgegraut, nicht klickbar */
.side-league-off { opacity: .4; cursor: not-allowed; }
.side-league-off-row { display: flex; align-items: center; gap: var(--s-2); min-height: 38px; padding: 0 var(--s-3); font-weight: 700; }
.side-league-off-row img { height: 18px; width: auto; max-width: 44px; object-fit: contain; }
.tile-off { opacity: .45; filter: grayscale(.8); }
.tile-off a:not(.off-link) { pointer-events: none; }
.tile-off .off-link { pointer-events: auto; }
.sim-pick { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; }
.sim-pick-item { display: inline-flex; align-items: center; gap: var(--s-2); }
.sim-pick .button-row { flex-basis: 100%; }

/* Bilder mit eigener Variante je Design (z.B. helles Sponsorlogo → dunkle Fassung im hellen Design) */
.theme-light-only, :root[data-theme="light"] .theme-dark-only { display: none !important; }
:root[data-theme="light"] .theme-light-only { display: inline-block !important; }
:root[data-theme="light"] .ad-slot .theme-light-only { display: block !important; }

/* Changelog: Fenster nach Versionssprung und Seite „Neuigkeiten“ */
.news-dialog { max-width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; }
.news-list { margin: var(--s-2) 0 var(--s-4); padding-left: 1.2em; line-height: 1.5; }
.news-list li + li { margin-top: 4px; }
.release-entry + .release-entry { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); }

/* Ersatzfahrer und Nicht-Teilnahme */
.badge-reserve { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.inactive-box { border-left-color: var(--error); }
.inactive-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); flex-basis: 100%; }
.inactive-row > span { flex: 1 1 240px; }
.inactive-row form { margin: 0; }

/* Galerie */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); }
.photo-tile { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.photo-open { display: block; padding: 0; border: 0; background: var(--surface-2); border-radius: var(--r); overflow: hidden; cursor: zoom-in; }
.photo-open img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s; }
.photo-open:hover img { transform: scale(1.03); }
/* 9:16 (hochkant): ganz zeigen, im 16:9-Rahmen auf unscharfem Hintergrund aus demselben Bild */
.photo-open { position: relative; }
.photo-open.portrait::before { content: ""; position: absolute; inset: -20px; background: var(--photo-bg) center / cover;
                               filter: blur(18px) brightness(.55); }
.photo-open.portrait img { position: relative; object-fit: contain; }
.photo-open.portrait:hover img { transform: none; }
.photo-tile figcaption { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.photo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: .8rem; }
.photo-title { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.photo-vote { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border-radius: 999px;
              border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: .85rem; cursor: pointer; }
.photo-vote.voted { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.photo-vote.static { cursor: default; }
.photo-cell form { display: flex; align-items: center; gap: var(--s-2); margin-top: 4px; }
.photo-votes-left { margin: 0 0 var(--s-3); }
.photo-copyright { margin: var(--s-4) 0 0; }
.photo-group { border-top: 3px solid var(--c-accent, var(--border)); }
.photo-author { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text); text-decoration: none; }
.photo-author.big h1 { margin: 0; }
.photo-week { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s-4); align-items: start; }
.photo-week-main img { width: 100%; aspect-ratio: 16 / 9; max-height: 420px; object-fit: cover; }
.photo-week-last img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.photo-week p { margin: 6px 0 0; }
.photo-lightbox { max-width: min(1400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: var(--s-2); border: 1px solid var(--border);
                  border-radius: var(--r); background: var(--surface); color: var(--text); }
.photo-lightbox::backdrop { background: rgb(0 0 0 / .85); }
.photo-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 140px); margin: 0 auto; object-fit: contain; }
.photo-lightbox form { display: flex; justify-content: flex-end; margin: 0; }
@media (max-width: 640px) {
  .photo-week { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Sponsoren-Rolle (/sponsoring) */
.sponsor-head { display: inline-flex; align-items: center; gap: var(--s-3); min-width: 0; }
.sponsor-head h2 { margin: 0; }
.sponsor-logo { display: block; max-width: 120px; max-height: 56px; object-fit: contain; padding: 6px; border-radius: var(--r);
                background: var(--surface-2); border: 1px solid var(--border); }
.sponsor-logo.small { max-width: 72px; max-height: 32px; padding: 3px; }
.sponsoring .ticket-form fieldset .check { align-items: baseline; }

/* Sterne-Eingabe (Fahrer bewerten Kommentatoren): Radios rückwärts, Hover füllt nach links */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; border: 0; padding: 0; margin: 4px 0; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.6rem; line-height: 1; color: var(--border); cursor: pointer; transition: color .12s, transform .12s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f5b301; }
.star-input label:hover { transform: scale(1.15); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.c-rate-form { display: grid; gap: var(--s-2); }

/* Aktivitäts-Rating (/fahrerwertung/aktivitaet) */
.flames { letter-spacing: -2px; white-space: nowrap; }
.flames.big { font-size: 1.5rem; }
.flames.big span { opacity: .18; filter: grayscale(1); transition: opacity .3s, filter .3s; }
.flames.big span.on { opacity: 1; filter: none; }
.activity-score { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); margin-bottom: var(--s-4); }
.activity-points b { display: block; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.activity-points span { color: var(--muted); font-size: .85rem; }
.activity-level { display: grid; gap: 4px; }
.activity-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-2); margin-bottom: var(--s-3); }

/* Aufbau-Animationen: Inhalte gleiten kurz und gestaffelt herein (nur ohne „Bewegung reduzieren“) */
@keyframes lm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lm-pop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .app main > * { animation: lm-fade .22s ease-out both; }
  .app main :is(.card, .tile, .stat, .photo-tile, .admin-guild > .card-head) { animation: lm-rise .38s cubic-bezier(.2, .7, .2, 1) both; }
  .app main :is(.card, .tile, .stat, .photo-tile):nth-child(2) { animation-delay: .04s; }
  .app main :is(.card, .tile, .stat, .photo-tile):nth-child(3) { animation-delay: .08s; }
  .app main :is(.card, .tile, .stat, .photo-tile):nth-child(4) { animation-delay: .12s; }
  .app main :is(.card, .tile, .stat, .photo-tile):nth-child(5) { animation-delay: .16s; }
  .app main :is(.card, .tile, .stat, .photo-tile):nth-child(n+6) { animation-delay: .2s; }
  .app main .rank-row { animation: lm-rise .32s cubic-bezier(.2, .7, .2, 1) both; }
  .app main .rank-row:nth-child(2) { animation-delay: .03s; }
  .app main .rank-row:nth-child(3) { animation-delay: .06s; }
  .app main .rank-row:nth-child(4) { animation-delay: .09s; }
  .app main .rank-row:nth-child(5) { animation-delay: .12s; }
  .app main .rank-row:nth-child(6) { animation-delay: .15s; }
  .app main .rank-row:nth-child(7) { animation-delay: .18s; }
  .app main .rank-row:nth-child(8) { animation-delay: .21s; }
  .app main .rank-row:nth-child(9) { animation-delay: .24s; }
  .app main .rank-row:nth-child(n+10) { animation-delay: .27s; }
  .app main :is(.podium-1, .podium-2, .podium-3) .rank-pos { animation: lm-pop .4s .25s cubic-bezier(.3, 1.6, .5, 1) both; }
  .app .flash, .app .notice { animation: lm-pop .3s ease-out both; }
  .app .flames.big span.on { animation: lm-pop .35s cubic-bezier(.3, 1.6, .5, 1) both; }
  .app .flames.big span.on:nth-child(2) { animation-delay: .08s; }
  .app .flames.big span.on:nth-child(3) { animation-delay: .16s; }
  .app .flames.big span.on:nth-child(4) { animation-delay: .24s; }
  .app .flames.big span.on:nth-child(5) { animation-delay: .32s; }
}

/* Community-Umschalter in der Verwaltung (Admin in mehreren Communities) */
.community-switch { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 4px; margin-bottom: var(--s-4); scrollbar-width: thin; }
.community-switch a { flex: none; display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--h); padding: 0 var(--s-3);
                      border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
                      text-decoration: none; font-weight: 600; transition: border-color .15s, background .15s, transform .15s; }
.community-switch a:hover { border-color: var(--accent); transform: translateY(-1px); }
.community-switch a[aria-current="page"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.community-switch img, .community-initial { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.community-initial { display: inline-grid; place-items: center; background: var(--surface-2); font-size: .75rem; }
.community-switch small { color: var(--muted); font-weight: 400; }


/* ------------------------------------------------------------------
   Seitenleiste im Stil von Discord (_sidebar.html): Icon-Spalte (Communities) + Kanal-Spalte mit festem Kopf,
   scrollbarer Mitte und festem Benutzerbereich unten
   ------------------------------------------------------------------ */
.server-rail { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0;
  overflow-y: auto; scrollbar-width: none; background: color-mix(in srgb, var(--bg) 82%, #000); }
:root[data-theme="light"] .server-rail { background: color-mix(in srgb, var(--bg) 88%, #8a93a6); }
.server-rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; display: grid; place-items: center; width: 72px; padding: 0; border: 0; background: none;
  cursor: pointer; color: var(--text); text-decoration: none; }
.rail-icon { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 50%;
  background: var(--surface); font-size: 1.25rem; transition: border-radius .18s ease, background .18s ease, transform .18s ease; }
.rail-icon img { width: 100%; height: 100%; object-fit: cover; }
.rail-initials { font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.rail-item:not(.rail-home) .rail-icon:has(.rail-initials) { background: color-mix(in srgb, var(--rail-color, var(--accent)) 35%, var(--surface)); }
.rail-item:hover .rail-icon, .rail-item.active .rail-icon { border-radius: 16px; }
.rail-item:hover .rail-icon:has(.rail-initials), .rail-item.active .rail-icon:has(.rail-initials) { background: var(--rail-color, var(--accent)); color: #fff; }
.rail-item:active .rail-icon { transform: translateY(1px); }
.rail-item:focus-visible { outline: none; }
.rail-item:focus-visible .rail-icon { box-shadow: 0 0 0 2px var(--accent); }
/* Pille links: Punkt = ungelesen, halb = Hover, voll = gewählt */
.rail-item::before { content: ""; position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transform: translateY(-50%); transition: height .18s ease; }
.rail-item.unread::before { height: 8px; }
.rail-item:hover::before { height: 20px; }
.rail-item.active::before { height: 40px; }
.rail-badge { position: absolute; right: 10px; bottom: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--error); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 82%, #000); }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--border-strong); flex: none; }
.rail-action .rail-icon { background: var(--surface); color: var(--success); }
.rail-action:hover .rail-icon { background: var(--success); }

.channel-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-panel[hidden] { display: none; }
.side-top { flex: none; border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.has-community .side-top, .side-panel[style*="--community-1"] .side-top { border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--community-1), var(--community-2)) 1; }
.side-title { display: flex; align-items: center; height: 52px; padding: 0 var(--s-4); font-weight: 800; font-size: 1.02rem;
  color: var(--text); text-decoration: none; }
.side-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-banner { display: block; }
.side-banner img { display: block; width: 100%; height: auto; max-height: 120px; object-fit: cover; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s-2) var(--s-2) var(--s-3); scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent; }
.side-scroll.side-nav { flex: 1; }
.side-spacer { flex: 1 0 var(--s-3); }
.side-info { display: grid; gap: var(--s-2); margin-top: var(--s-3); padding: var(--s-3) var(--s-2) 0; border-top: 1px solid var(--border); }
.side-info .side-legal a[aria-current="page"] { color: var(--text); }
.side-nav a { min-height: 34px; }

/* Benutzerbereich unten (wie in Discord): Avatar, Name, Kurz-Rating; Klick klappt alle Ratings nach oben auf */
.side-foot { flex: none; display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 6px 8px;
  background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-top: 1px solid var(--border); position: relative; }
.side-foot .side-login { flex: 1; }
.user-panel { flex: 1; min-width: 0; }
.user-panel > summary { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r); cursor: pointer; list-style: none; }
.user-panel > summary::-webkit-details-marker { display: none; }
.user-panel > summary:hover, .user-panel[open] > summary { background: var(--surface-2); }
.user-avatar { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; }
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-avatar:has(img) { background: transparent; }        /* Profilbild mit transparentem Hintergrund, Farbe nur für den Buchstaben */
.user-status { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.user-names { display: grid; min-width: 0; line-height: 1.2; }
.user-names b, .user-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-names b { font-size: .88rem; }
.user-names small { color: var(--muted); font-size: .72rem; }
.user-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 60; padding: var(--s-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.user-panel[open] .user-pop { animation: lm-pop .16s ease-out both; }
.user-pop-links { display: flex; justify-content: space-between; gap: var(--s-2); margin-top: 6px; padding: 6px 4px 0; border-top: 1px solid var(--border); font-size: .8rem; }
.user-pop-links a { color: var(--muted); }
.user-actions { display: flex; gap: 2px; flex: none; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r);
  background: none; color: var(--muted); font-size: .95rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button:disabled { opacity: .3; cursor: default; background: none; }
.lang-button { font-size: .72rem; letter-spacing: .04em; }

/* „Nächste Rennen“: aufklappbar unten links am Inhalt, neben der Seitenleiste */
.next-races { max-width: 100%; }
.next-races > summary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; list-style: none;
  font-weight: 700; font-size: .88rem; user-select: none; transition: border-color .15s, transform .15s; }
.next-races > summary::-webkit-details-marker { display: none; }
.next-races > summary:hover { border-color: var(--accent); transform: translateY(-1px); }
.next-races[open] > summary { border-radius: 0 0 var(--r-lg) var(--r-lg); border-top-color: transparent; box-shadow: none; }
.nr-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--surface-2); font-size: .75rem; line-height: 22px; text-align: center; }
.nr-pending { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--warning); color: #1c1f24; font-size: .75rem; line-height: 22px; text-align: center; }
.next-races[open] { display: flex; flex-direction: column-reverse; }
.nr-body { width: 316px; max-width: 100%; padding: var(--s-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow); }
.next-races[open] .nr-body { animation: lm-rise .2s ease-out both; }
.nr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-2); }
.nr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.nr-wd { text-align: center; font-size: .66rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; padding-bottom: 2px; }
.nr-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 40px; padding: 3px 1px;
  border-radius: 6px; background: var(--surface-2); font-size: .72rem; }
.nr-day.other { background: none; opacity: .35; }
.nr-day.past .nr-num { color: var(--muted); }
.nr-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.nr-day.today .nr-num { color: var(--accent); font-weight: 800; }
.nr-num { line-height: 1; font-variant-numeric: tabular-nums; }
.nr-race { display: grid; place-items: center; width: 34px; height: 20px; border-radius: 5px; background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--nr-ring, var(--border-strong)); transition: transform .12s; }
.nr-race:hover { transform: scale(1.12); z-index: 1; }
.nr-race img { max-width: 30px; max-height: 16px; object-fit: contain; }
.nr-short { font-size: .58rem; font-weight: 800; color: var(--league); letter-spacing: .02em; }
.nr-race.att-yes, .nr-key.att-yes { --nr-ring: var(--success); }
.nr-race.att-no, .nr-key.att-no { --nr-ring: var(--error); }
.nr-race.att-no { opacity: .55; }
.nr-race.att-pending, .nr-key.att-pending { --nr-ring: var(--warning); }
.nr-more { font-size: .6rem; color: var(--muted); }
.nr-legend { display: flex; align-items: center; gap: 6px; margin: var(--s-2) 0 0; color: var(--muted); }
.nr-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--nr-ring); margin-left: 6px; }
.nr-key:first-child { margin-left: 0; }
.content { padding-bottom: 56px; }                          /* Platz für „Nächste Rennen“ */

@media (max-width: 860px) {
  body.app.with-servers, body.app { --side-w: 0px; }
  .sidebar { width: 280px; height: 100dvh; }
  .sidebar.with-rail { width: min(340px, 92vw); }
}
@media (prefers-reduced-motion: reduce) {
  .rail-icon, .rail-item::before, .nr-race { transition: none; }
}
.side-nav .side-info a { display: inline; min-height: 0; padding: 0; border-radius: 0; background: none; font-weight: 400; }
.side-nav .side-info a:hover { background: none; color: var(--text); }
/* Kalender: Umschalter Fahrer/Kommentator, Kommentar-Termine mit Akzentrahmen */
.nr-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; margin-bottom: var(--s-2); border-radius: var(--r);
  background: var(--surface-2); }
.nr-switch button { height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 700; font-size: .8rem; cursor: pointer; }
.nr-switch button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nr-mode[hidden] { display: none; }
.nr-race.att-commentary, .nr-key.att-commentary { --nr-ring: #b388ff; }
.nr-gigs { background: color-mix(in srgb, #b388ff 25%, var(--surface-2)); }

/* Special Events: Stern, Gold, ganz oben (Seitenleiste, Startseite, Boxentafel, Eventseite) */
:root { --special: #f5b301; }
.side-special { margin-bottom: var(--s-2); padding-bottom: var(--s-2); border-bottom: 1px solid var(--border); }
.side-special .side-sim { color: var(--special); margin-top: var(--s-1); }
.side-nav a.side-special-item { min-height: 44px; padding: 4px 8px; gap: 8px; border-radius: var(--r);
  background: linear-gradient(90deg, color-mix(in srgb, var(--special) 16%, transparent), transparent 80%);
  border-left: 3px solid var(--special); }
.side-nav a.side-special-item:hover { background: color-mix(in srgb, var(--special) 22%, transparent); }
.side-special-item img { width: 36px; height: 20px; object-fit: contain; flex: none; }
.side-star { width: 36px; text-align: center; color: var(--special); font-size: 1.1rem; flex: none; }
.side-special-text { display: grid; min-width: 0; line-height: 1.2; }
.side-special-text b, .side-special-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-special-text small { color: var(--muted); font-size: .72rem; }
.side-special-state { margin-left: auto; color: var(--success); font-weight: 800; }
.rail-star { position: absolute; right: 10px; top: -4px; display: grid; place-items: center; width: 18px; height: 18px;
  border-radius: 50%; background: var(--special); color: #1c1f24; font-size: .7rem; font-weight: 900;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 82%, #000); }
.special-events { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); }
.special-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center;
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--special) 60%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--special) 16%, transparent), transparent 55%), var(--surface); }
.special-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--special), var(--league, var(--accent))); }
.special-star { font-size: 2.4rem; line-height: 1; color: var(--special); text-shadow: 0 0 18px color-mix(in srgb, var(--special) 60%, transparent); }
.special-main h2 { margin: 2px 0 4px; }
.special-main h2 a { color: var(--text); text-decoration: none; }
.special-facts { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); margin: 0 0 4px; }
.special-actions { display: grid; gap: var(--s-2); justify-items: end; }
.special-notice { border-color: color-mix(in srgb, var(--special) 70%, transparent); background: color-mix(in srgb, var(--special) 12%, transparent); margin-bottom: var(--s-4); }
@media (prefers-reduced-motion: no-preference) {
  .special-star { animation: lm-pop .5s .15s cubic-bezier(.3, 1.6, .5, 1) both, special-glow 3s 1s ease-in-out infinite; }
  @keyframes special-glow { 50% { text-shadow: 0 0 28px color-mix(in srgb, var(--special) 90%, transparent); } }
}
@media (max-width: 640px) {
  .special-card { grid-template-columns: auto minmax(0, 1fr); }
  .special-actions { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; }
}

/* Fehlermeldungen */
.bug-row { padding: var(--s-2) 0; border-bottom: 1px solid var(--border); }
.bug-row:last-child { border-bottom: 0; }
.bug-row .card-head { margin: 0; }
.bug-card.dim { opacity: .7; }
.bug-shot { display: block; max-width: min(480px, 100%); max-height: 320px; object-fit: contain; border-radius: var(--r); border: 1px solid var(--border); margin: var(--s-2) 0; }
.planned-card { border-left: 3px solid #78909c; }

/* Demo-Community: Balken oben mit Ansicht-Umschalter, gesperrte Felder */
.demo-bar { position: sticky; top: 0; z-index: 35; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4);
  padding: 8px var(--s-4); background: linear-gradient(90deg, color-mix(in srgb, #f5b301 22%, var(--surface)), var(--surface));
  border-bottom: 1px solid color-mix(in srgb, #f5b301 50%, var(--border)); font-size: .88rem; }
.demo-bar form { margin: 0; }
@media (max-width: 640px) { .demo-bar { padding: 6px var(--s-3); } .demo-bar-label .muted { display: none; } }
.demo-bar-roles { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--surface-2); }
.demo-bar-roles button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.demo-bar-roles button[aria-current="true"] { background: #f5b301; color: #1c1f24; }
.demo-bar-roles button:hover:not([aria-current="true"]) { color: var(--text); }
.demo-leave { margin-left: auto; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r); background: none; color: var(--text); cursor: pointer; }
.demo-mode main :is(input, select, textarea, button):disabled { cursor: not-allowed; opacity: .6; }
.demo-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3); }
.demo-role { display: grid; gap: var(--s-2); align-content: start; text-align: center; }
.demo-role h2 { margin: 0; }
.demo-role .button { justify-self: center; }
.demo-role-icon { font-size: 2.2rem; }

/* Fahrer-Rating: Kopf mit festem Aufbau – Titel links, Simulationen rechts (scrollen statt umbrechen),
   Elo/Safety/Aktivität immer in der zweiten Zeile; am Handy Simulationen unter dem Titel */
.league-head.rating-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.rating-head .rating-sims { justify-self: end; max-width: 100%; }
.rating-head .rating-modes { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .league-head.rating-head { grid-template-columns: minmax(0, 1fr); }
  .rating-head .rating-sims { justify-self: start; }
}
/* Sponsor-Produkte */
.product-list { display: grid; gap: var(--s-2); }
.product-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-2);
  border: 1px solid var(--border); border-radius: var(--r); }
.product-row.is-editing { border-color: var(--accent); }
.product-text { display: grid; gap: 2px; min-width: 0; }
.product-actions { display: flex; align-items: center; gap: var(--s-2); }
.product-actions form { margin: 0; }
@media (max-width: 640px) { .product-row { grid-template-columns: auto minmax(0, 1fr); } .product-actions { grid-column: 1 / -1; } }

/* „Nächste Rennen“ und „Wer ist online?“ wie Discord-Embeds: Akzentkante OBEN in den Farben der Community */
.next-races > summary, .dock-embed > summary { position: relative; overflow: hidden; }
.next-races > summary::before, .dock-embed > summary::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--embed-1, var(--accent)), var(--embed-2, var(--accent))); }
.next-races[open] > summary::before, .dock-embed[open] > summary::before { display: none; }
.nr-body, .dock-body { position: relative; overflow: hidden; padding-top: calc(var(--s-3) + 3px); }
.nr-body::before, .dock-body::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--embed-1, var(--accent)), var(--embed-2, var(--accent))); }
/* Karte „Nächstes Rennen“ behält die Kante links (wie ein Discord-Embed im Chat) */
.nr-embed { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); margin-bottom: var(--s-3);
  padding: 10px 12px 10px 16px; border-radius: 4px; background: color-mix(in srgb, var(--bg) 55%, var(--surface-2)); overflow: hidden; }
.nr-embed::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--embed-1), var(--embed-2)); }
.nr-embed-author { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--text); }
.nr-embed-author img { max-width: 32px; max-height: 16px; object-fit: contain; }
.nr-embed-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-embed-title { margin: 4px 0 6px; font-weight: 700; font-size: .9rem; line-height: 1.3; }
.nr-embed-title a { color: #00a8fc; text-decoration: none; }         /* Link-Blau wie Discord-Embed-Titel */
.nr-embed-title a:hover { text-decoration: underline; }
:root[data-theme="light"] .nr-embed-title a { color: #006ce7; }
.nr-embed-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px 10px; font-size: .74rem; }
.nr-embed-fields div { display: grid; gap: 1px; min-width: 0; }
.nr-embed-fields b { font-size: .7rem; }
.nr-embed-fields span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.nr-state.att-yes { color: var(--success-text); }
.nr-state.att-no { color: var(--error); }
.nr-state.att-pending { color: var(--warning); }
.nr-state.att-commentary { color: #b388ff; }
.nr-embed-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; align-self: start; }


/* „Wer ist online?“ (Dock unten links, über dem Kalender) – höchstens so hoch wie der Kalender ohne „Nächstes Rennen“ */
.dock-embed > summary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; list-style: none;
  font-weight: 700; font-size: .88rem; user-select: none; transition: border-color .15s, transform .15s; }
.dock-embed > summary::-webkit-details-marker { display: none; }
.dock-embed > summary:hover { border-color: var(--embed-1, var(--accent)); transform: translateY(-1px); }
.dock-embed[open] { display: flex; flex-direction: column-reverse; }
.dock-embed[open] > summary { border-radius: 0 0 var(--r-lg) var(--r-lg); border-top-color: transparent; box-shadow: none; }
.dock-body { width: 316px; max-width: 100%; padding-left: var(--s-3); padding-right: var(--s-3); padding-bottom: var(--s-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow); }
.dock-embed[open] .dock-body { animation: lm-rise .2s ease-out both; }
.online-head { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s-2); font-size: .82rem; }
.online-head img { width: 18px; height: 18px; border-radius: 5px; }
.online-list { list-style: none; margin: 0; padding: 0 2px 0 0; display: grid; gap: 2px;
  max-height: calc(5 * 34px + 4 * 2px); overflow-y: auto; scrollbar-width: none; scroll-snap-type: y mandatory; flex: 1; min-width: 0; }
.online-list::-webkit-scrollbar { display: none; }
.online-list li { scroll-snap-align: start; }
.online-scroller { display: flex; gap: 6px; }                                        /* Liste (max. 5) + Blätterknöpfe */
.online-scroll { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; flex: none; }
.online-scroll button { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--text); font-size: .7rem; cursor: pointer; }
.online-scroll button:hover:not(:disabled) { border-color: var(--embed-1, var(--accent)); }
.online-scroll button:disabled { opacity: .35; cursor: default; }
.online-more { font-size: .7rem; font-weight: 700; color: var(--muted); }
.online-list li { display: flex; align-items: center; gap: 8px; height: 34px; box-sizing: border-box; padding: 4px 6px; border-radius: var(--r); font-size: .85rem; }
.online-list li:hover { background: var(--surface-2); }
.online-list li.me .online-name { font-weight: 700; }
.online-avatar { position: relative; display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--surface-2); font-size: .72rem; font-weight: 700; }
.online-avatar:has(img) { background: transparent; }
.online-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.online-avatar .user-status { width: 9px; height: 9px; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px var(--surface); }
.online-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kalender: gewähltes Rennen hervorgehoben, Zu-/Absage in der Vorschau */
.nr-race.selected { box-shadow: 0 0 0 2px var(--nr-ring, var(--border-strong)), 0 0 0 4px color-mix(in srgb, var(--text) 35%, transparent); }
.nr-attend { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; }
.nr-attend .button { flex: 1; }
.nr-attend-note { margin: 6px 0 0; font-size: .72rem; color: var(--muted); }

/* Top-3-Badges (Chat hinter dem Namen, Fahrerprofil) */
.top-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 7px; height: 19px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; white-space: nowrap; vertical-align: middle; border: 1px solid; cursor: default; }
.top-badge.rank-1 { color: #f5c542; border-color: color-mix(in srgb, #f5c542 55%, transparent); background: color-mix(in srgb, #f5c542 12%, transparent); }
.top-badge.rank-2 { color: #c9d1db; border-color: color-mix(in srgb, #c9d1db 50%, transparent); background: color-mix(in srgb, #c9d1db 10%, transparent); }
.top-badge.rank-3 { color: #e0965c; border-color: color-mix(in srgb, #e0965c 55%, transparent); background: color-mix(in srgb, #e0965c 12%, transparent); }
:root[data-theme="light"] .top-badge.rank-1 { color: #9a6b00; }
:root[data-theme="light"] .top-badge.rank-2 { color: #5b6270; }
:root[data-theme="light"] .top-badge.rank-3 { color: #9a4f17; }
.top-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.top-badges .top-badge { margin-left: 0; height: 22px; font-size: .74rem; }


/* ------------------------------------------------------------------
   Unten links/rechts (Wunsch Thomas): „Nächste Rennen“ fährt seitlich aus der Seitenleiste – Lasche („Wulst“) mit
   Pfeil am rechten Rand der Leiste; „Wer ist online?“ unten rechts, klappt nach oben auf.
   ------------------------------------------------------------------ */
.dock { display: contents; }
.next-races { position: fixed; z-index: 31; left: var(--side-w); bottom: 12px; max-width: none; }
.next-races[open] { display: block; }
.next-races > summary { position: absolute; left: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; width: 40px; height: auto; min-height: 136px; padding: 14px 0; border-radius: 0 14px 14px 0;
  border: 1px solid var(--border); border-left: 0; background: var(--surface); box-shadow: 4px 2px 12px rgba(0, 0, 0, .25);
  font-size: .9rem; transition: left .25s cubic-bezier(.2, .7, .2, 1), background .15s; }
.next-races > summary:hover { transform: none; background: var(--surface-2); }
.next-races[open] > summary { left: 316px; border-radius: 0 12px 12px 0; border: 1px solid var(--border); border-left: 0;
  box-shadow: 4px 2px 12px rgba(0, 0, 0, .25); }
.next-races > summary::before { left: auto; right: 0; top: 0; bottom: 0; width: 3px; height: auto;   /* Akzent an der Laschenkante */
  background: linear-gradient(var(--embed-1, var(--accent)), var(--embed-2, var(--accent))); }
.next-races[open] > summary::before { display: block; }
.nr-tab-icon { font-size: 1rem; line-height: 1; }
.nr-tab-arrow { font-size: 1.1rem; font-weight: 800; line-height: 1; color: var(--muted); transition: transform .25s; }
.next-races[open] .nr-tab-arrow { transform: rotate(180deg); }
.next-races > summary .nr-count, .next-races > summary .nr-pending { min-width: 20px; height: 20px; padding: 0 4px; font-size: .68rem; line-height: 20px; }
.next-races > summary .nr-gigs { font-size: .6rem; padding: 0 3px; }
.next-races .nr-body { width: 316px; max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: none;
  border-left: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: 6px 4px 18px rgba(0, 0, 0, .3); }
.next-races .nr-body::-webkit-scrollbar { display: none; }
.next-races[open] .nr-body { animation: nr-slide .25s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes nr-slide { from { transform: translateX(-100%); opacity: .4; } to { transform: none; opacity: 1; } }
/* Schublade fährt hinter der Seitenleiste heraus und wieder hinein (Wunsch Thomas) */
@media (min-width: 861px) { .sidebar { z-index: 32; } }
.next-races > summary { z-index: 1; }                                /* Lasche immer vor dem Fenster */
.next-races.closing > summary { left: 0; transition: left .22s cubic-bezier(.4, 0, .8, .3); }   /* im Takt mit dem Fenster */
.next-races.closing .nr-body { animation: nr-slide-in .22s cubic-bezier(.4, 0, .8, .3) both; }
@keyframes nr-slide-in { from { transform: none; opacity: 1; } to { transform: translateX(-100%); opacity: .4; } }

.online-embed { position: fixed; z-index: 31; right: 12px; bottom: 12px; width: 316px; max-width: calc(100vw - 24px); }
.online-embed > summary { display: flex; width: 100%; box-sizing: border-box; }
.online-embed > summary > span:not([class]) { flex: 1; }
.online-embed .dock-body { width: 100%; box-sizing: border-box; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.online-embed[open] > summary { border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (prefers-reduced-motion: reduce) { .next-races > summary, .nr-tab-arrow { transition: none; } .next-races[open] .nr-body, .next-races.closing .nr-body { animation: none; } }

/* Livery-Designer: Portfolio */
.livery-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.livery-thumbs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.livery-portfolio { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-2); }
.livery-portfolio img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r); transition: transform .15s; }
.livery-portfolio a:hover img { transform: scale(1.02); }
.livery-portfolio-edit { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.livery-portfolio-edit label { display: grid; gap: 4px; justify-items: start; font-size: .8rem; }
.livery-portfolio-edit img { width: 140px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }

/* ------------------------------------------------------------------
   Handy, Klapphandy innen und Tablet hochkant (bis 860 px): „Nächste Rennen“ und „Wer ist online?“ als kleine
   Knöpfe oben rechts in der Menüleiste, Fenster klappen darunter auf – nichts liegt mehr über dem Inhalt.
   Desktop bleibt unverändert (nur innerhalb dieser Media-Query).
   ------------------------------------------------------------------ */
@media (max-width: 860px) {
  .dock { display: flex; position: fixed; z-index: 41; top: 6px; right: 8px; gap: 6px; align-items: center; }
  .content { padding-bottom: 0; }
  .next-races, .online-embed { position: static; width: auto; max-width: none; }
  .next-races[open], .dock-embed[open] { display: block; }
  .next-races > summary, .next-races[open] > summary, .next-races.closing > summary,
  .dock-embed > summary, .dock-embed[open] > summary {
    position: relative; left: auto; bottom: auto; display: inline-flex; flex-direction: row; align-items: center; gap: 5px;
    width: auto; height: 38px; min-height: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-pill);
    background: var(--surface-2); box-shadow: none; transition: none; font-size: .85rem; }
  .next-races[open] > summary, .dock-embed[open] > summary { border-color: var(--embed-1, var(--accent)); }
  .next-races > summary::before, .dock-embed > summary::before, .nr-tab-arrow { display: none; }
  .online-embed > summary > span:not([class]) { display: none; }        /* nur Punkt und Zahl */
  .online-embed > summary { width: auto; }
  .next-races .nr-body, .online-embed .dock-body {
    position: fixed; top: 56px; right: 8px; left: auto; width: min(380px, calc(100vw - 16px)); max-height: calc(100dvh - 68px);
    overflow-y: auto; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--r-lg);
    background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
  .next-races[open] .nr-body, .dock-embed[open] .dock-body { animation: lm-drop .18s ease-out both; }
  .next-races.closing .nr-body { animation: lm-lift .18s ease-in both; }
  .mobile-bar .brand { max-width: calc(100vw - 210px); overflow: hidden; }
}
@keyframes lm-drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lm-lift { from { transform: none; opacity: 1; } to { transform: translateY(-8px); opacity: 0; } }

/* Sehr schmale Handys (Klapphandy außen, 344–420 px): lange Knopftexte umbrechen statt über den Rand zu ragen */
@media (max-width: 420px) {
  .button, .link-button { white-space: normal; height: auto; min-height: var(--h); padding-top: 6px; padding-bottom: 6px;
                          line-height: 1.2; text-align: center; }
  .button-small, .link-button, .season-links .button { min-height: var(--h-sm); }
  .upload-form label { max-width: 100%; }
  .upload-form input[type=file] { width: 100%; }
}

/* Betrieb → Nutzer */
.people-search { max-width: 360px; margin-bottom: var(--s-4); }
.people-ratings { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.people-ratings span { white-space: nowrap; }
@media (max-width: 420px) { .people-ratings > span { white-space: normal; } }   /* schmale Handys: Rating darf umbrechen */

/* Tipp-Figur „Mr. Pitwall“ (templates/_tips.html): kommt unten ins Bild, links vom „Wer ist online?“-Fenster */
.pitwall { position: fixed; z-index: 29; right: 344px; bottom: 0; display: flex; align-items: flex-end; gap: 4px;
  transform: translateY(110%); transition: transform .55s cubic-bezier(.2, .9, .3, 1.15); pointer-events: none; }
.pitwall.show { transform: none; }
.pitwall.peek { transform: translateY(calc(100% - 66px)); }           /* Pause: Cap, Brille und Augen schauen raus */
.pitwall.peek .pitwall-bubble { display: none; }
.pitwall.peek .pitwall-figure { cursor: pointer; }
.pitwall.peek .pitwall-figure:hover { transform: translateY(-6px); }
.pitwall-figure { transition: transform .2s; }
.pitwall > * { pointer-events: auto; }
.pitwall-figure { width: 104px; height: 130px; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.pitwall-bubble { position: relative; width: 300px; margin-bottom: 70px; padding: 10px 12px 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); 
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4); font-size: .86rem; line-height: 1.4; }
.pitwall-bubble::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, var(--embed-1, #f5b301), var(--embed-2, #f5b301)); }   /* Akzent in Community-Farben */
.pitwall-bubble::after { content: ""; position: absolute; right: -9px; bottom: 18px; width: 16px; height: 16px;
  background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transform: rotate(-45deg); }
.pitwall-name { font-weight: 800; font-size: .78rem; letter-spacing: .02em; margin-bottom: 4px; padding-right: 22px; }
.pitwall-text { margin: 0 0 6px; }
.pitwall-text a { font-weight: 700; white-space: nowrap; }
.pitwall-close { position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.pitwall-close:hover { background: var(--surface-2); color: var(--text); }
.pitwall-nav { display: flex; align-items: center; gap: 4px; }
.pitwall-nav button { width: 30px; height: 26px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--text); font-size: 1rem; font-weight: 800; line-height: 1; cursor: pointer; }
.pitwall-nav button:hover { border-color: var(--embed-1, #f5b301); }
.pitwall-off { margin-left: auto; font-size: .72rem; color: var(--muted); }
@media (max-width: 860px) {
  .pitwall { right: 4px; left: 8px; justify-content: flex-end; }
  .pitwall-figure { width: 74px; height: 92px; }
  .pitwall-bubble { width: auto; max-width: 300px; flex: 1 1 auto; margin-bottom: 48px; font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) { .pitwall { transition: none; } }
/* Spiele ohne Logo-Datei (Profile von Fotografen/Livery-Designern): Name als Chip */
.sim-logo-text { display: inline-flex; align-items: center; width: auto; padding: 1px 8px; border: 1px solid var(--border);
  border-radius: var(--r-pill); background: var(--surface-2); font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.6; }
.sim-logo-xs.sim-logo-text { font-size: .66rem; padding: 0 6px; }

/* Wetterkachel (LMU) auf dem Streckenbild: oben rechts, halbtransparent */
.track-banner-wrap { position: relative; display: flow-root; --bleed: var(--s-5); }   /* flow-root: Bildrand verschiebt den Rahmen nicht */
.track-banner-wrap .weather-tile { position: absolute; top: calc(-1 * var(--bleed) + 10px); right: calc(-1 * var(--bleed) + 10px); }
.weather-tile { display: inline-flex; flex-direction: column; gap: 3px; padding: 7px 10px; border-radius: 10px;
  background: rgba(16, 18, 22, .78); color: #fff; backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .15);
  font-size: .8rem; line-height: 1.3; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.weather-time-row { font-weight: 700; }
.weather-slots { display: flex; align-items: center; gap: 4px; }
.weather-slots b { width: 14px; font-size: .68rem; color: #f5b301; }
.weather-slot-cell { display: inline-flex; flex-direction: column; align-items: center; width: 30px; line-height: 1.15; }
.weather-slot-cell small { font-size: .62rem; color: #cfd8dc; min-height: .72rem; }
.weather-slot-cell small:last-child { color: #ffcc80; }
.weather-inline { margin-bottom: var(--s-3); }
.nr-thumb-wrap { position: relative; align-self: start; flex: none; }
.weather-tile-compact { position: absolute; top: 46px; right: -4px; flex-direction: row; align-items: center; gap: 4px;
  padding: 3px 6px; font-size: .68rem; white-space: nowrap; }
.nr-thumb-wrap > .weather-tile-compact:only-child { position: static; }
.weather-tile-compact .weather-slot-cell { width: 15px; }
.weather-tile-compact .weather-slots b { display: none; }
.weather-fields { display: grid; gap: var(--s-2); }
.weather-row { display: grid; grid-template-columns: 110px repeat(5, minmax(0, 1fr)); gap: var(--s-2); align-items: start; }
.weather-row-head { display: grid; gap: 6px; align-content: start; padding-top: 18px; }
.weather-row-head .button { white-space: normal; height: auto; min-height: var(--h-sm); padding: 4px 8px; font-size: .74rem; }
.weather-slot { display: grid; gap: 4px; min-width: 0; }
.weather-nums { display: flex; gap: 4px; }
.weather-nums label { display: flex; flex-direction: row; align-items: center; gap: 2px; min-width: 0; flex: 1; font-size: .8rem; font-weight: 400; }
.weather-nums input { width: 100%; min-width: 0; height: var(--h-sm); padding: 0 4px; text-align: right; }
.weather-nums span { color: var(--muted); font-size: .72rem; }
.weather-time { max-width: 260px; }
@media (max-width: 860px) {
  .track-banner-wrap { --bleed: var(--s-4); }
  .weather-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-row-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 0; }
}

/* Ko-fi-Link unten in der Seitenleiste (neben Hilfe & Anleitungen) */
.side-legal .side-kofi { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.side-kofi svg { width: 24px; height: 19px; flex: none; transition: transform .15s; }
.side-kofi:hover svg { transform: scale(1.12); }

.pit-seats.is-full { color: var(--error); font-weight: 700; }      /* Boxentafel: Feld voll (wie in der Leiste) */

/* Trainings-Leaderboard: Überschrift je Klasse mit Farbpunkt */
.training-class { display: flex; align-items: center; gap: 8px; margin: var(--s-4) 0 var(--s-2); }
.class-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Trainings-Leaderboard: alle Klassentabellen mit gleichen Spalten, Zeiten mit Ziffern gleicher Breite */
.training-table { table-layout: fixed; width: 100%; }
.training-table .c-pos { width: 56px; } .training-table .c-driver { width: 30%; } .training-table .c-car { width: auto; }
.training-table .c-time { width: 96px; } .training-table .c-gap { width: 88px; } .training-table .c-when { width: 110px; }
.training-table td, .training-table th { overflow: hidden; text-overflow: ellipsis; }
.training-table .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
@media (max-width: 640px) { .training-table .c-when { width: 0; } .training-table .c-car { width: 0; }
  .training-table td:nth-child(3), .training-table th:nth-child(3) { display: none; } .training-table .c-driver { width: auto; } }
/* Lämpchen: Trainingsserver live / offline */
.training-light { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; }
.training-light .live-lamp { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.training-light.is-live .live-lamp { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, .25), 0 0 8px #2ecc71; animation: lamp-pulse 1.6s ease-in-out infinite; }
.training-light.is-off .live-lamp { background: #e74c3c; box-shadow: 0 0 0 3px rgba(231, 76, 60, .2); }
@keyframes lamp-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .training-light.is-live .live-lamp { animation: none; } }
.training-now { margin-left: 6px; font-weight: 700; color: #2ecc71; }
.training-car { display: flex; align-items: center; gap: 8px; min-width: 0; } .training-car > span { overflow: hidden; text-overflow: ellipsis; }

/* Testumgebung: unübersehbarer Balken oben */
.testumgebung-bar { position: fixed; z-index: 100; top: 0; left: 0; right: 0; padding: 3px 12px; text-align: center;
  background: repeating-linear-gradient(45deg, #b71c1c 0 14px, #c62828 14px 28px); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.testumgebung-bar ~ * { }
body:has(.testumgebung-bar) { padding-top: 22px; }

/* Konto → Für Stream-Grafiken: Fahrerfoto neben dem Upload */
.stream-photo { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-3); }
.stream-photo img { width: 120px; height: auto; border-radius: 8px;
  background: repeating-conic-gradient(var(--border, #ccc) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.stream-photo label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; flex: 1 1 240px; min-width: 0; }
.stream-photo label.check { flex-direction: row; font-weight: 400; flex-basis: 100%; }

/* Einrichtungs-Popup (Liga, Saison, Einzelevent): legt sich über die Verwaltungsseite, Inhalt bleibt die echte Seite */
.wizard-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(8, 10, 14, .62); backdrop-filter: blur(2px); }
.wizard { position: fixed; z-index: 901; inset: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  margin: 0 auto; max-width: 960px; display: flex; flex-direction: column; background: var(--bg, #121418);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); overflow: hidden; }
body.wizard-open { overflow: hidden; }
.wizard-head { position: relative; padding: var(--s-4) var(--s-5) var(--s-3); border-bottom: 1px solid var(--border);
  background: var(--surface); border-top: 4px solid var(--league, var(--accent)); }
.wizard-head h2 { margin: 2px 0 4px; text-wrap: balance; }
.wizard-eyebrow { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.wizard-hint { margin: 0; max-width: 70ch; }
.wizard-close { position: absolute; top: var(--s-3); right: var(--s-3); margin: 0; }
.wizard-steps { display: flex; gap: 4px; list-style: none; margin: 0 40px var(--s-3) 0; padding: 0; }
.wizard-steps li { flex: 1 1 0; min-width: 0; }
.wizard-steps a, .wizard-steps li > span { display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: .75rem; padding-top: 6px; border-top: 3px solid var(--border); }
.wizard-steps li.done a, .wizard-steps li.done > span { border-top-color: var(--league, var(--accent)); }
.wizard-steps li.current > span { border-top-color: var(--league, var(--accent)); color: var(--text); font-weight: 700; }
.wizard-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); font-size: .75rem; font-variant-numeric: tabular-nums; }
.wizard-steps li.done .wizard-dot, .wizard-steps li.current .wizard-dot { background: var(--league, var(--accent)); color: #fff; }
.wizard-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.wizard-body { flex: 1 1 auto; overflow: auto; padding: var(--s-4) var(--s-5); min-height: 0; }
.wizard-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); background: var(--surface); }
.wizard-foot form { margin: 0; }
.wizard-unsaved { margin: 0; color: var(--warning, #e0a100); font-size: .875rem; flex: 1 1 200px; }
/* Im Popup nur, was zum Schritt gehört */
.wizard .tabs, .wizard [data-wizard-hide], .wizard .help-head .eyebrow { display: none !important; }
@media (max-width: 640px) {
  .wizard { inset: 0; border-radius: 0; }
  .wizard-label { display: none; }
  .wizard-head, .wizard-body, .wizard-foot { padding-left: 16px; padding-right: 16px; }
}

/* ⓘ mit ausführlicher Erklärung: Maus drüber, Tastatur-Fokus oder Tippen */
.info-tip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px;
  border-radius: 50%; border: 1.5px solid currentColor; color: var(--muted); font: italic 700 11px/1 Georgia, serif;
  cursor: help; vertical-align: 1px; flex: none; }
.info-tip:hover, .info-tip:focus-visible, .info-tip.open { color: var(--league, var(--accent)); outline: none; }
label > .info-tip { display: inline-grid; }
.label-line { display: inline-flex; align-items: center; gap: 2px; }
.tip-pop { position: fixed; z-index: 950; width: max-content; max-width: min(340px, calc(100vw - 32px));
  padding: 10px 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow); font-size: .85rem; line-height: 1.45; pointer-events: none; }


/* Drag & Drop für Datei-Felder (static/js/dropzone.js) */
.dropzone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 88px; margin-top: 4px;
  padding: 16px; border: 2px dashed var(--border); border-radius: var(--r-lg); background: var(--surface-2);
  color: var(--muted); font-weight: 500; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); color: var(--text); }
.dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color: var(--text); }
.dropzone.is-wrong { border-color: var(--danger, #da373c); color: var(--danger, #da373c); }
.dropzone.has-files { min-height: 60px; }
.dropzone-face { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.dropzone-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface);
  font-size: 16px; color: var(--accent); }
.dropzone-text { font-size: .9rem; }
.dropzone > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.dropzone-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; border-radius: var(--r);
  background: var(--surface-2); font-size: .85rem; font-weight: 400; }
.dropzone-list img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; flex: none; background: var(--surface); }
.dropzone-file { width: 56px; text-align: center; font-size: 20px; flex: none; }
.dropzone-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dropzone-size { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .dropzone { transition: none; } }


/* Galerie: Bildausschnitt wählen (16:9 bzw. 9:16), z.B. für 21:9-Screenshots */
.crop-dialog { width: min(960px, calc(100vw - 32px)); max-width: none; padding: 20px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); color: var(--text); }
.crop-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.crop-dialog h3 { margin: 0 0 4px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: #000;
  cursor: grab; touch-action: none; user-select: none; outline-offset: 3px; margin: 8px auto 12px; }
.crop-stage.is-portrait { aspect-ratio: 9 / 16; width: auto; height: min(62vh, 640px); }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
              linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.crop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.crop-zoom { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.crop-zoom input { width: 180px; }
.crop-orient { display: flex; gap: 6px; }


/* Kontaktformular: Falle für Bots (für Menschen unsichtbar) */
.contact-trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
