/* v2 – ein Stylesheet fuer alle Seiten. Mobile-first; Tablet ab 768px; Hoch/Quer global.
   Designs: [data-theme] auf <html> – Liste, Bilder und Stufen in lib/Themes.php (sparta = Standard).
   Alle Farben laufen ueber Tokens; ein Design ueberschreibt nur Tokens (+ wenige Feinheiten). */

/* ================= Tokens: Sparta (Standard) ================= */
:root {
  /* Hintergrund. Das Bild je Design (--bg-photo) setzt layout.php aus lib/Themes.php (Dateien in assets/bg/) */
  --bg: #070707;
  --bg-photo: none;
  --bg-overlay: linear-gradient(to bottom, rgba(0,0,0,.95) 0%, rgba(0,0,0,.8) 35%, rgba(0,0,0,.6) 70%, rgba(0,0,0,.42) 100%);

  --surface: rgba(16, 16, 16, 0.86);
  --surface-2: rgba(34, 34, 34, 0.92);
  --surface-3: #2c2c2c;
  --surface-solid: #141414;      /* fixe Tabellenkoepfe, Dialoge */
  --top-bg: rgba(0, 0, 0, .88);
  --nav-bg: rgba(8, 8, 8, .96);
  --input-bg: #151515;
  --key-bg: #2c2c2c;
  --key-active: #444;
  --line: rgba(255, 255, 255, 0.12);

  --text: #f4f1ec;
  --muted: #a9a39a;
  --dropped: #6f6a64;
  --accent: #d7141a;
  --accent-2: #ff3b30;
  --on-accent: #fff;
  --accent-soft: rgba(215, 20, 26, 0.18);
  --badge-text: #ffb3ae;
  --pts: #ffb3ae;                 /* Punktezahlen */
  --total-card-bg: #f4f1ec;
  --total-card-text: #000;
  --ok: #3fb950;
  --female: #e46aa6;
  --male: #4c9be8;

  --radius: 14px;
  --radius-sm: 9px;
  --tap: 48px;
  --gap: clamp(10px, 2.5vw, 18px);
  --font: Verdana, Geneva, "DejaVu Sans", system-ui, sans-serif;   /* wie das Original */
  --font-display: Impact, "Arial Narrow Bold", "Oswald", system-ui, sans-serif;
  --font-num: var(--font-display);
  --num-weight: 400;              /* Impact hat nur einen Schnitt */
  --font-figures: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;  /* Zahlen in Tabellen/Listen */
  --fig-weight: 600;
  --name-size: 1.2rem;
  --bottom-nav: 64px;
  color-scheme: dark;
}

/* ================= Design: Bronze (antik) ================= */
[data-theme="bronze"] {
  --bg: #120b06;
  --bg-overlay: linear-gradient(to bottom, rgba(18,11,6,.96) 0%, rgba(30,18,8,.84) 40%, rgba(40,24,10,.7) 75%, rgba(18,11,6,.62) 100%);
  --surface: rgba(32, 21, 12, 0.88);
  --surface-2: rgba(52, 35, 20, 0.92);
  --surface-3: #3d2a18;
  --surface-solid: #1d130b;
  --top-bg: rgba(18, 11, 6, .92);
  --nav-bg: rgba(18, 11, 6, .97);
  --input-bg: #1a110a;
  --key-bg: #3d2a18;
  --key-active: #57401f;
  --line: rgba(214, 170, 104, 0.2);
  --text: #f3e6cc;
  --muted: #bba584;
  --dropped: #75644c;
  --accent: #b9792c;
  --accent-2: #e0a54a;
  --on-accent: #1a1007;
  --accent-soft: rgba(192, 135, 58, 0.2);
  --badge-text: #f5d39a;
  --pts: #f0c27a;
  --total-card-bg: linear-gradient(135deg, #e7c88c, #b9792c);
  --total-card-text: #1a1007;
  --font-display: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-num: Georgia, "Times New Roman", serif;
  --num-weight: 700;
  --font-figures: Georgia, "Times New Roman", serif;
  --fig-weight: 700;
}
[data-theme="bronze"] h1 { letter-spacing: .1em; font-weight: 700; }
[data-theme="bronze"] .brand-mark { box-shadow: 0 0 0 2px #e7c88c inset; }
[data-theme="bronze"] .total-value { line-height: 1.15; }

/* ================= Design: Zorn (Glut, Aggressivitaet 3) ================= */
[data-theme="zorn"] {
  --bg: #0a0302;
  --bg-overlay: radial-gradient(ellipse 90% 60% at 50% 100%, rgba(255,60,10,.28), transparent 70%),
    linear-gradient(to bottom, rgba(10,3,2,.94) 0%, rgba(14,4,2,.72) 35%, rgba(20,5,2,.5) 70%, rgba(10,3,2,.36) 100%);
  --surface: rgba(20, 7, 4, 0.86);
  --surface-2: rgba(42, 14, 8, 0.92);
  --surface-3: #3a140a;
  --surface-solid: #170805;
  --top-bg: rgba(10, 3, 2, .9);
  --nav-bg: rgba(12, 4, 2, .97);
  --input-bg: #170805;
  --key-bg: #3a140a;
  --key-active: #5a1f0e;
  --line: rgba(255, 110, 50, 0.18);
  --text: #fff1e8;
  --muted: #c9a594;
  --dropped: #7a5d50;
  --accent: #ff4a12;
  --accent-2: #ff7a2e;
  --on-accent: #1a0602;
  --accent-soft: rgba(255, 74, 18, 0.2);
  --badge-text: #ffc2a0;
  --pts: #ffb07a;
  --total-card-bg: linear-gradient(135deg, #ffd7b8, #ff6a2a);
  --total-card-text: #1a0602;
}
[data-theme="zorn"] h1 { text-shadow: 0 0 18px rgba(255, 74, 18, .55); }

/* ================= Design: Eisen (kalter Stahl, Aggressivitaet 2) ================= */
[data-theme="eisen"] {
  --bg: #0b0d10;
  --bg-overlay: linear-gradient(to bottom, rgba(9,11,14,.95) 0%, rgba(14,18,22,.8) 40%, rgba(18,22,28,.62) 75%, rgba(9,11,14,.5) 100%);
  --surface: rgba(16, 19, 23, 0.87);
  --surface-2: rgba(30, 35, 41, 0.92);
  --surface-3: #262c33;
  --surface-solid: #12151a;
  --top-bg: rgba(9, 11, 14, .9);
  --nav-bg: rgba(10, 12, 15, .97);
  --input-bg: #12151a;
  --key-bg: #262c33;
  --key-active: #3a424c;
  --line: rgba(170, 185, 200, 0.16);
  --text: #eef1f4;
  --muted: #9aa4ae;
  --dropped: #626b74;
  --accent: #c8262c;
  --accent-2: #e2474c;
  --on-accent: #fff;
  --accent-soft: rgba(200, 38, 44, 0.18);
  --badge-text: #f2b1b3;
  --pts: #c9d3dc;
  --total-card-bg: linear-gradient(135deg, #e8edf2, #9aa6b2);
  --total-card-text: #0b0d10;
}

/* ================= Design: Sturm (Gewitter, Aggressivitaet 2) ================= */
[data-theme="sturm"] {
  --bg: #0b0814;
  --bg-overlay: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124,92,255,.18), transparent 70%),
    linear-gradient(to bottom, rgba(11,8,20,.95) 0%, rgba(14,10,28,.78) 38%, rgba(16,12,32,.58) 72%, rgba(11,8,20,.45) 100%);
  --surface: rgba(18, 14, 32, 0.86);
  --surface-2: rgba(34, 27, 58, 0.92);
  --surface-3: #2b2348;
  --surface-solid: #140f24;
  --top-bg: rgba(11, 8, 20, .9);
  --nav-bg: rgba(12, 9, 22, .97);
  --input-bg: #140f24;
  --key-bg: #2b2348;
  --key-active: #403568;
  --line: rgba(150, 130, 255, 0.18);
  --text: #eeeaff;
  --muted: #a9a2c8;
  --dropped: #6a6488;
  --accent: #7c5cff;
  --accent-2: #9d85ff;
  --on-accent: #fff;
  --accent-soft: rgba(124, 92, 255, 0.2);
  --badge-text: #cbbfff;
  --pts: #8fd3ff;
  --total-card-bg: linear-gradient(135deg, #8fd3ff, #7c5cff);
  --total-card-text: #0b0814;
}
[data-theme="sturm"] h1 { text-shadow: 0 0 16px rgba(143, 211, 255, .45); }

/* ================= Design: Morgenrot (Daemmerung, Aggressivitaet 1) ================= */
[data-theme="morgenrot"] {
  --bg: #0d1117;
  --bg-overlay: radial-gradient(ellipse 90% 55% at 50% 100%, rgba(255,138,61,.2), transparent 70%),
    linear-gradient(to bottom, rgba(13,17,23,.95) 0%, rgba(18,23,32,.78) 40%, rgba(22,26,34,.58) 75%, rgba(13,17,23,.46) 100%);
  --surface: rgba(17, 22, 30, 0.86);
  --surface-2: rgba(30, 37, 48, 0.92);
  --surface-3: #283140;
  --surface-solid: #141a23;
  --top-bg: rgba(13, 17, 23, .9);
  --nav-bg: rgba(13, 17, 23, .97);
  --input-bg: #141a23;
  --key-bg: #283140;
  --key-active: #3b4658;
  --line: rgba(255, 170, 110, 0.16);
  --text: #f4ece4;
  --muted: #a8a7a6;
  --dropped: #676b72;
  --accent: #ff8a3d;
  --accent-2: #ffa766;
  --on-accent: #1a0e05;
  --accent-soft: rgba(255, 138, 61, 0.18);
  --badge-text: #ffcfaa;
  --pts: #ffc08f;
  --total-card-bg: linear-gradient(135deg, #ffe2c4, #ff8a3d);
  --total-card-text: #1a0e05;
}

/* ================= Design: Blut (Weinrot, Aggressivitaet 3) ================= */
[data-theme="blut"] {
  --bg: #0c0304;
  --bg-overlay: linear-gradient(to bottom, rgba(12,3,4,.96) 0%, rgba(24,4,7,.78) 38%, rgba(32,4,8,.56) 72%, rgba(12,3,4,.42) 100%);
  --surface: rgba(22, 6, 8, 0.87);
  --surface-2: rgba(44, 10, 14, 0.92);
  --surface-3: #3d0d13;
  --surface-solid: #1a0507;
  --top-bg: rgba(12, 3, 4, .92);
  --nav-bg: rgba(14, 3, 5, .97);
  --input-bg: #1a0507;
  --key-bg: #3d0d13;
  --key-active: #5c1119;
  --line: rgba(220, 40, 60, 0.18);
  --text: #f6e9e9;
  --muted: #c09a9c;
  --dropped: #7a5a5c;
  --accent: #b3001b;
  --accent-2: #e01a35;
  --on-accent: #fff;
  --accent-soft: rgba(179, 0, 27, 0.22);
  --badge-text: #ffadb8;
  --pts: #ff7d8f;
  --total-card-bg: linear-gradient(135deg, #f2d6d6, #b3001b);
  --total-card-text: #1a0204;
}
[data-theme="blut"] h1 { text-shadow: 0 2px 14px rgba(179, 0, 27, .6); }

/* ================= Design: Gold (Ehrenhalle, Aggressivitaet 1) ================= */
[data-theme="gold"] {
  --bg: #0a0906;
  --bg-overlay: linear-gradient(to bottom, rgba(10,9,6,.96) 0%, rgba(16,14,9,.8) 40%, rgba(20,17,10,.6) 75%, rgba(10,9,6,.48) 100%);
  --surface: rgba(18, 16, 11, 0.88);
  --surface-2: rgba(34, 30, 20, 0.92);
  --surface-3: #2e2817;
  --surface-solid: #15130d;
  --top-bg: rgba(10, 9, 6, .92);
  --nav-bg: rgba(10, 9, 6, .97);
  --input-bg: #15130d;
  --key-bg: #2e2817;
  --key-active: #463c20;
  --line: rgba(212, 175, 55, 0.22);
  --text: #f5ecd2;
  --muted: #b5a983;
  --dropped: #6f6650;
  --accent: #d4af37;
  --accent-2: #f0cc5a;
  --on-accent: #1a1405;
  --accent-soft: rgba(212, 175, 55, 0.18);
  --badge-text: #f3dc8f;
  --pts: #f0cc5a;
  --total-card-bg: linear-gradient(135deg, #fff1b8, #d4af37 55%, #a07c1c);
  --total-card-text: #1a1405;
  --font-display: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
}
[data-theme="gold"] h1 { letter-spacing: .12em; font-weight: 700; color: #f0cc5a; }

/* ================= Design: Tierreich (Tier-Spartaner, Aggressivitaet 1) ================= */
[data-theme="tiere"] {
  --bg: #120d06;
  --bg-overlay: radial-gradient(ellipse 90% 55% at 50% 100%, rgba(232,163,60,.16), transparent 70%),
    linear-gradient(to bottom, rgba(18,13,6,.94) 0%, rgba(24,18,9,.76) 40%, rgba(28,21,10,.54) 75%, rgba(18,13,6,.42) 100%);
  --surface: rgba(24, 18, 10, 0.86);
  --surface-2: rgba(40, 31, 18, 0.92);
  --surface-3: #33281a;
  --surface-solid: #1a140b;
  --top-bg: rgba(18, 13, 6, .9);
  --nav-bg: rgba(18, 13, 6, .97);
  --input-bg: #1a140b;
  --key-bg: #33281a;
  --key-active: #4d3c22;
  --line: rgba(232, 163, 60, 0.22);
  --text: #f6ead0;
  --muted: #bfa982;
  --dropped: #75684f;
  --accent: #e8a33c;
  --accent-2: #ffc266;
  --on-accent: #1c1205;
  --accent-soft: rgba(232, 163, 60, 0.18);
  --badge-text: #ffd590;
  --pts: #ffc266;
  --total-card-bg: linear-gradient(135deg, #ffe3a8, #e8a33c 55%, #a8661a);
  --total-card-text: #1c1205;
}
[data-theme="tiere"] h1 { color: #ffc266; text-shadow: 0 2px 12px rgba(232, 163, 60, .35); }

/* ================= Design: Arena (hell) ================= */
[data-theme="arena"] {
  --bg: #f4f0e8;
  --bg-overlay: linear-gradient(to bottom, rgba(244,240,232,.97), rgba(244,240,232,.9));
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: #f6f2ea;
  --surface-3: #e8e2d6;
  --surface-solid: #ffffff;
  --top-bg: rgba(255, 255, 255, .95);
  --nav-bg: rgba(255, 255, 255, .98);
  --input-bg: #ffffff;
  --key-bg: #ece6da;
  --key-active: #d8d0c0;
  --line: rgba(0, 0, 0, 0.13);
  --text: #141414;
  --muted: #5e574d;
  --dropped: #8a8378;
  --accent: #b3121c;
  --accent-2: #d41e28;
  --on-accent: #fff;
  --accent-soft: rgba(179, 18, 28, 0.1);
  --badge-text: #8d0f17;
  --pts: #b3121c;
  --total-card-bg: #141414;
  --total-card-text: #fff;
  --tap: 52px;
  --ok: #1a7f37;
  color-scheme: light;
}
[data-theme="arena"] .card, [data-theme="arena"] .rank-card details,
[data-theme="arena"] .entry-panel, [data-theme="arena"] .event-item { box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ================= Design: Anzeigetafel (Beamer/TV) ================= */
[data-theme="scoreboard"] {
  --bg: #000;
  --bg-photo: none;
  --bg-overlay: none;
  --surface: #0b0b0b;
  --surface-2: #121212;
  --surface-3: #1d1d1d;
  --surface-solid: #050505;
  --top-bg: #000;
  --nav-bg: #000;
  --input-bg: #0b0b0b;
  --key-bg: #1a1a1a;
  --key-active: #333;
  --line: rgba(255, 176, 0, 0.2);
  --text: #f2f2f2;
  --muted: #8f8f8f;
  --dropped: #6e6e6e;
  --accent: #ffb000;
  --accent-2: #ffc640;
  --on-accent: #000;
  --accent-soft: rgba(255, 176, 0, 0.14);
  --badge-text: #ffcf66;
  --pts: #3ddc84;
  --total-card-bg: #000;
  --total-card-text: #ffb000;
  --radius: 4px;
  --radius-sm: 3px;
  --font-num: "Consolas", "Lucida Console", "Courier New", monospace;
  --font-display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --num-weight: 700;
  --font-figures: "Consolas", "Lucida Console", "Courier New", monospace;
  --fig-weight: 700;
}
[data-theme="scoreboard"] .total-card { border: 2px solid var(--accent); }
[data-theme="scoreboard"] .results-table td .p { font-size: 1.25rem; }
[data-theme="scoreboard"] .col-total { color: var(--accent); }
[data-theme="scoreboard"] .rank-total, [data-theme="scoreboard"] .total-value { color: var(--accent); letter-spacing: .03em; }

/* ================= Basis ================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 16px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg-overlay), var(--bg-photo) center center / cover no-repeat, var(--bg);
}
[data-theme="scoreboard"] body::before { background: var(--bg); }
/* Erfassen: kein Foto (lenkt beim Eintragen ab) - nur die Flaeche des Designs */
body.page-entry::before { background: var(--bg); }
/* Hochformat (Handy): Ausschnitt je Bild (--bg-x aus Themes::photoCss); "wechselnd" nutzt --bg-x2 bei data-bgflip=1 */
@media (orientation: portrait) {
  body::before { background-position: 0 0, var(--bg-x, 50%) 50%; }
  [data-bgflip="1"] body::before { background-position: 0 0, var(--bg-x2, var(--bg-x, 50%)) 50%; }
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font: 400 clamp(1.6rem, 5vw, 2.4rem)/1.1 var(--font-display); letter-spacing: .02em; text-transform: uppercase; }
h2 { font-size: 1.2rem; }
small { font-size: .78em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Kopf & Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gap);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--top-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* Logo = Praemie: eine leuchtende Pille "300 = Shirt", fuehrt zum 3D-Shirt */
.brand { display: flex; align-items: center; text-decoration: none; min-width: 0; flex-shrink: 0; }
.brand-shirt {
  position: relative; gap: 7px; height: 42px; padding: 0 14px 0 13px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, var(--accent) 0%, #ff7a1a 100%); color: #fff;
  font: 400 1.25rem/1 var(--font-display); letter-spacing: .03em;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18) inset, 0 0 18px rgba(255, 90, 20, .55);
  animation: shirt-glow 2.4s ease-in-out infinite;
}
.brand-shirt .brand-eq { opacity: .85; font-size: 1.05rem; }
.brand-shirt i { font-size: 1.4rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.brand-shirt:hover, .brand-shirt:focus-visible { color: #fff; filter: brightness(1.12); }
.brand-role {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  font: 700 .58rem var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2);
}
@keyframes shirt-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.18) inset, 0 0 12px rgba(255, 90, 20, .45); }
  50%      { box-shadow: 0 0 0 2px rgba(255,255,255,.28) inset, 0 0 26px rgba(255, 120, 30, .85); }
}
@media (prefers-reduced-motion: reduce) { .brand-shirt { animation: none; } }
.nav-top { display: none; }
@media (min-width: 768px) {
  .nav-top { min-width: 0; overflow-x: auto; scrollbar-width: none; }
}

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  text-decoration: none; font-size: .85rem; color: var(--muted); white-space: nowrap; cursor: pointer; list-style: none;
}
.tool-btn::-webkit-details-marker { display: none; }
.tool-btn:hover { color: var(--text); border-color: var(--muted); }

.theme-menu { position: relative; }
.theme-menu[open] .tool-btn { color: var(--text); border-color: var(--accent); }
.theme-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(300px, 86vw);
  display: grid; gap: 4px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-solid); box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.theme-list-title { margin: 2px 6px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.theme-list button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.theme-list button:hover, .theme-list button:focus-visible { background: var(--surface-2); }
.theme-list button[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-list b { display: block; font-size: .95rem; }
.theme-list small { color: var(--muted); }
.theme-list { max-height: calc(100dvh - 90px); overflow-y: auto; }
.theme-level { margin-left: 6px; font-size: .72rem; color: var(--accent-2); white-space: nowrap; }
.theme-level i + i { margin-left: 1px; }
.theme-level .is-off { opacity: .22; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: conic-gradient(var(--s1) 0 50%, var(--s2) 0 75%, var(--s3) 0); }

.nav-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg); border-top: 1px solid var(--line);
}
.nav-bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; font-size: .7rem; color: var(--muted);
}
.nav-bottom a i { font-size: 1.25rem; }
.nav-bottom a.is-active { color: var(--text); }
.nav-bottom a.is-active i { color: var(--accent-2); }
.nav-bottom a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Admin-Trainerbereich: 7 Reiter -> kleinere Beschriftung */
.nav-bottom:has(> a:nth-child(7)) a { font-size: .6rem; }
.nav-bottom:has(> a:nth-child(7)) a i { font-size: 1.1rem; }

.main { width: min(100%, 1400px); margin: 0 auto; padding: var(--gap); }
.page-results .main { width: 100%; max-width: none; }                     /* Tabelle nutzt die ganze Breite */
.page-results .results-table { width: 100%; min-width: 0; }
.results-narrow { width: min(100%, 980px); margin-inline: auto; }               /* Teamwertung/leer: mittig wie Event-Liste */
.results-wide { width: min(100%, 1400px); margin-inline: auto; }               /* Kompakt-Ansicht */
.results-narrow .ranking.team-ranking, .results-narrow .duel-head { max-width: none; }
.area-trainer.page-event .main, .area-trainer.page-formulas .main { max-width: 980px; }
.page-athlete .main { max-width: 820px; }                                  /* Disziplin und Werte nah beieinander */
.page-events .main, .page-contests .main { max-width: 980px; }

/* ---------- Goldener Schnitt: Inhaltsblock zwischen Kopfleiste und unterer Navigation ----------
   Nur der freie Restplatz wird verteilt: oben --golden-top, unten --golden-bottom (Anteile). Ist der Block hoeher
   als der sichtbare Bereich, schrumpfen die Abstandhalter auf 0 -> oben anschlagen und normal scrollen.
   body wird dafuer eine Flex-Spalte; der Hauptbereich fuellt den Rest unter der Kopfleiste (body hat unten
   schon Platz fuer die Navigation) - die Hoehe der Kopfleiste muss niemand kennen. */
:root { --golden-top: 382; --golden-bottom: 618; }
body:is(.page-results, .page-contests, .page-athlete, .page-events) { display: flex; flex-direction: column; }
:is(.page-results, .page-contests, .page-athlete, .page-events) .main { flex: 1 0 auto; display: flex; flex-direction: column; }
:is(.page-results, .page-contests, .page-athlete, .page-events) .main::before { content: ""; flex: var(--golden-top) 0 0; }
:is(.page-results, .page-contests, .page-athlete, .page-events) .main::after { content: ""; flex: var(--golden-bottom) 0 0; }
:is(.page-results, .page-contests, .page-athlete, .page-events) .main > * { flex: 0 0 auto; }
.area-login .main { max-width: 460px; }

/* ---------- Bausteine ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(14px, 3vw, 22px); margin-bottom: var(--gap);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card.empty { text-align: center; color: var(--muted); }
.card-error h1 { font-size: 1.4rem; color: var(--accent-2); }
.card-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), 0 10px 40px var(--accent-soft); }
.card-label { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.page-head { margin: 4px 0 var(--gap); }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); margin: 0; }
.meta-link { color: var(--muted); text-decoration: none; font-size: .85rem; }
.meta-link:hover { color: var(--text); }
.hint { color: var(--muted); font-size: .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-3); color: var(--text);
  font: 600 1rem var(--font); text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); }
.btn-danger { background: transparent; border-color: var(--accent-2); color: var(--accent-2); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: .88rem; }
.btn-icon { width: var(--tap); padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions-end { justify-content: flex-end; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--badge-text); font-size: .78rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pill-live { background: var(--accent); color: var(--on-accent); }
.sex { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.sex-w { background: rgba(228,106,166,.2); color: var(--female); }
.sex-m { background: rgba(76,155,232,.2); color: var(--male); }
/* Athletische Tests: Altersklasse des Turners (bestimmt die DTB-Tabelle) */
.ak-badge { display: inline-block; margin-left: .35em; padding: .05em .45em; border-radius: 999px; font-size: .72rem; font-weight: 700; vertical-align: middle; background: rgba(127,127,127,.18); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); min-height: var(--tap); padding: 0 12px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.select-lg { font-size: 1.15rem; font-weight: 700; text-align: center; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.form-grid .check, .check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; }
.type-desc { margin: -4px 0 0; font-size: .85rem; }
.mail-list { padding: 8px 12px; font-size: .85rem; resize: vertical; }
.edit-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.edit-box summary { cursor: pointer; color: var(--muted); min-height: 40px; display: flex; align-items: center; gap: 8px; }
.edit-box[open] summary { margin-bottom: 10px; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; padding: 0; margin: 0; }
.segmented legend { padding: 0 0 4px; font-size: .88rem; color: var(--muted); }
fieldset.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 0; gap: 8px; }
fieldset.segmented label { display: block; }
fieldset.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset.segmented span {
  display: grid; place-items: center; min-height: var(--tap); border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text); cursor: pointer;
}
fieldset.segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.segmented-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; text-decoration: none; color: var(--muted); }
.segmented-links a.is-active { background: var(--accent); color: var(--on-accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 100%; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: 600 .9rem var(--font); cursor: pointer;
}
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Event-Kopf ---------- */
/* Titel + Datum sind die Event-Auswahl (unsichtbares natives Select darueber), daneben die Wertung */
.event-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 16px; margin: 2px 0 var(--gap); }
.event-pick { position: relative; display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; cursor: pointer; }
.event-pick-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.event-pick h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.event-pick-caret { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent-2, var(--accent)); font-size: .8rem;
  transition: background .15s, color .15s, border-color .15s; }
.event-pick:hover .event-pick-caret, .event-pick:has(select:focus-visible) .event-pick-caret { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.event-pick:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
.event-pick-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); }
.event-pick-meta a { position: relative; z-index: 1; }
.event-pick select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.badge-hidden { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.badge-hidden i { margin-right: 4px; }
.event-item.is-unlisted .event-name { opacity: .6; }

/* ---------- Ergebnisse: Karten (Smartphone) ---------- */
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-card details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rank-card summary {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 14px; min-height: 64px; cursor: pointer; list-style: none;
}
.rank-card summary::-webkit-details-marker { display: none; }
/* Platzierung: ruhig, nur die ersten drei mit Akzent */
.rank {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--line); color: var(--muted); font: var(--fig-weight) 1rem var(--font-figures);
}
.rank-1, .rank-2, .rank-3 { border-color: var(--accent); color: var(--text); }
.rank-1 { background: var(--accent); color: var(--on-accent); }
.rank-name { font: 700 var(--name-size) var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-total { font: 400 1.7rem var(--font-num); }
.rank-total small { font: 600 .7rem var(--font); color: var(--muted); margin-left: 3px; }
.goal { color: var(--accent-2); }
/* Handicap je Event (lib/Handicap.php): "+20 %" / "−10 %" am Namen */
.hc-badge { display: inline-block; margin-left: .35em; padding: 0 .4em; border-radius: 999px; font: 700 .72rem/1.5 var(--font);
  vertical-align: middle; white-space: nowrap; border: 1px solid currentColor; }
.hc-plus { color: #5fc97a; }
.hc-minus { color: #e9a23b; }
.disc-list, .disc-rows { list-style: none; margin: 0; padding: 0 14px 12px; }
.disc-list li, .disc-rows li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.disc-val { text-align: right; white-space: nowrap; }
/* Werte untereinander: feste Spalte, Zahl rechtsbuendig, Einheit linksbuendig (Teamliste, Ranking-Karten, Einzelansicht) */
:is(.disc-list, .disc-rows) > li { grid-template-columns: minmax(0, 1fr) 8.6em 64px; }
:is(.disc-list, .disc-rows) > li > .disc-val { display: grid; grid-template-columns: minmax(0, 1fr) 4.4em; column-gap: .35em; align-items: baseline; font-variant-numeric: tabular-nums; }
:is(.disc-list, .disc-rows) > li > .disc-val small { text-align: left; }
.disc-pts { text-align: right; font-weight: var(--fig-weight); color: var(--pts); white-space: nowrap; font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
.disc-val small, .disc-pts small { color: var(--muted); font-weight: 400; font-family: var(--font); }
.is-dropped, .is-dropped .disc-pts { color: var(--dropped) !important; }
.is-dropped .disc-pts, .results-table td.is-dropped .p { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--muted); text-decoration-skip-ink: none; }
.disc-more { display: block !important; text-align: right; }
.disc-more a { color: var(--muted); text-decoration: none; }

/* ---------- Ergebnisse: Tabelle (Tablet/Desktop) ---------- */
.table-wrap { display: none; overflow: auto; max-height: calc(100dvh - 220px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.recalc-table-wrap, [data-recalc-result] .table-wrap { display: block; }
.results-table, .recalc-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.results-table th, .results-table td, .recalc-table th, .recalc-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.results-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-solid); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em;
  cursor: pointer; vertical-align: bottom; min-width: 96px; max-width: 150px; white-space: normal;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; font-size: .74rem;
}
.results-table thead th small { display: block; color: var(--muted); text-transform: none; font-weight: 400; }
.results-table thead th[aria-sort]::after { content: " ▾"; color: var(--accent-2); }
.results-table thead th[aria-sort=ascending]::after { content: " ▴"; }
.results-table th.is-extra { color: var(--muted); font-style: italic; }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface-solid); text-align: left !important; }
thead .sticky-col { z-index: 3; }
.results-table tbody th a { text-decoration: none; font: 700 1.08rem var(--font); }
.rank-sm { display: inline-block; min-width: 2.2em; color: var(--muted); font-family: var(--font-figures); font-weight: var(--fig-weight); }
.col-total { font: 700 1.2rem var(--font-figures); font-variant-numeric: tabular-nums; background: var(--accent-soft); }
/* Disziplin-Zelle: Leistung mit Einheit | Punkte nebeneinander, beide rechtsbuendig (Kommas stehen untereinander) */
.results-table td .vp { display: inline-grid; grid-template-columns: minmax(5.2em, auto) 2.6em; gap: 10px; align-items: baseline; }
.results-table td .v { text-align: right; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.results-table td .v small { margin-left: 3px; font-size: .72rem; }
.results-table td .p { text-align: right; color: var(--pts); font-weight: var(--fig-weight); font-family: var(--font-figures); font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.results-table td.is-dropped .p { color: var(--dropped); }
.results-table tr.is-empty { opacity: .45; }
.results-table tbody tr:hover td, .results-table tbody tr:hover th { background-color: var(--accent-soft); }
.recalc-table td.up { color: var(--ok); } .recalc-table td.down { color: var(--accent-2); }
.ok-line { color: var(--ok); }

/* ---------- Athlet ---------- */
.athlete-nav, .station-nav { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); gap: 8px; margin-bottom: var(--gap); }
.total-card { text-align: center; background: var(--total-card-bg); color: var(--total-card-text); border-radius: var(--radius); padding: 14px; margin-bottom: var(--gap); }
.total-value { font: 400 clamp(3rem, 14vw, 5.5rem)/1 var(--font-num); }
.total-label { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.goal-bar { height: 10px; border-radius: 999px; background: rgba(127,127,127,.25); overflow: hidden; margin: 10px auto 4px; max-width: 420px; }
.goal-bar span { display: block; height: 100%; background: var(--accent); }
.goal-label { font-size: .85rem; }
.disc-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; }
.disc-rows li:first-child { border-top: 0; }
.disc-rows li { font-size: 1.1rem; padding: 12px 0; }
.disc-rows .disc-pts { min-width: 70px; }
.disc-rows .is-missing { color: var(--muted); }

/* ---------- Event-Listen ---------- */
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.event-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date badge" "name name"; gap: 4px 10px;
  align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; min-height: 64px;
}
a.event-item:hover { border-color: var(--muted); }
.event-item.is-selected { border-color: var(--accent); }
.event-date { grid-area: date; color: var(--muted); font-size: .85rem; }
.event-name { grid-area: name; font-weight: 700; }
.event-item .badge { grid-area: badge; justify-self: end; }
.event-item .badges { grid-area: badge; justify-self: end; display: inline-flex; gap: 6px; }
.event-item .chev { display: none; }
/* Altersgruppe AK16- / AK17+: neutral, beide gleich */
.badge-ak { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 2px 9px; }
.audience-chips { margin-bottom: 12px; }
.event-list-admin .event-item { grid-template-areas: "date badge" "name name" "actions actions"; }
.row-actions { grid-area: actions; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* ---------- Wertung / Formeln ---------- */
.contest summary { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; cursor: pointer; list-style: none; min-height: 52px; }
.contest summary::-webkit-details-marker { display: none; }
.contest[open] summary .chev { transform: rotate(180deg); }
.contest-no { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 400 1.3rem var(--font-num); }
.contest-title { font-weight: 700; font-size: 1.05rem; }
.contest-title small { display: block; color: var(--muted); font-weight: 400; }
.group-title { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
.formula-list { display: grid; gap: 8px; }
.formula { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.formula h4 { margin: 0 0 2px; font-size: 1rem; }
.formula h4 small { color: var(--muted); font-weight: 400; }
.formula-words { margin: 0; color: var(--pts); }
.examples { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.examples b { color: var(--text); }
.formula-w { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: .9rem; }

/* Formeln bearbeiten: Smartphone = Kopfzeile, a|b|c nebeneinander, Vorschau, Button */
.formula-edit { border-top: 1px solid var(--line); padding: 10px 0; }
.formula-edit h4 { margin-bottom: 6px; }
.formula-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 6px 0; }
.formula-name { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.formula-row label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; color: var(--muted); }
.formula-row input { min-height: 42px; text-align: right; }
.formula-preview, .formula-row .btn { grid-column: 1 / -1; }
.formula-preview [data-words] { color: var(--pts); }
.formula-row.is-dirty { background: var(--accent-soft); border-radius: var(--radius-sm); }

/* ---------- Teilnehmer ---------- */
.athlete-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.athlete-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.athlete-row[data-member="1"] { border-color: var(--ok); }
.athlete-row.is-moved { animation: moved 1.2s ease-out; }
@keyframes moved { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.member-title { font-size: .9rem; }
.member-title + .athlete-list:empty::after { content: '–'; color: var(--muted); padding: 6px 12px; }
/* Hinweis: Teilnahme gilt nur fuer das aktuelle Event */
.event-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 12px 14px;
  border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface); font-size: 1rem;
}
.event-scope > i { color: var(--accent); font-size: 1.2rem; }
.event-scope > span { flex: 1 1 auto; }
.athlete-main { all: unset; cursor: pointer; display: grid; gap: 2px; padding: 8px 0; min-height: 44px; }
.athlete-name { font-weight: 700; font-size: 1.05rem; }
.athlete-name small { color: var(--muted); font-weight: 400; }
.athlete-meta { color: var(--muted); font-size: .85rem; }
.switch { position: relative; width: 58px; height: 34px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; min-height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(23px); }

/* ---------- Dialoge (Bottom-Sheet) ---------- */
dialog.sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 18px; overflow-x: hidden;
  border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: var(--surface-solid); color: var(--text);
}
dialog.sheet::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }

/* ---------- Erfassung ---------- */
.athlete-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: var(--gap); scrollbar-width: thin; }
.chip-athlete {
  flex: 0 0 auto; display: grid; gap: 2px; min-width: 96px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .95rem; font-weight: 700;
}
.chip-athlete b { font: var(--fig-weight) 1.05rem var(--font-figures); color: var(--muted); }
.chip-athlete.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-athlete.is-active b { color: var(--on-accent); }
.entry-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(12px, 3vw, 20px); }
.entry-athlete { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.entry-total b { font: 400 2rem var(--font-num); }
.station-info { color: var(--muted); margin: 0 0 12px; }
.station-info b { color: var(--text); }
/* DTB-Ausschnitt direkt im Stationskopf, antippen = gross */
.station-ref { display: grid; gap: 8px; justify-items: center; margin: 0 0 14px; }
.station-ref a { display: block; max-width: 900px; width: 100%; background: #fff; border-radius: 8px; padding: 4px; cursor: zoom-in; }
.station-ref img { display: block; width: 100%; height: auto; max-height: 34dvh; object-fit: contain; }
.station-ref:has(a + a) img { max-height: 24dvh; }
dialog.img-zoom { padding: 0; border: 0; background: #fff; max-width: 98vw; max-height: 96dvh; border-radius: 10px; cursor: zoom-out; overflow: auto; }
dialog.img-zoom::backdrop { background: rgba(0, 0, 0, .8); }
dialog.img-zoom img { display: block; width: min(98vw, 1600px); height: auto; }
@media (orientation: landscape) { dialog.img-zoom img { width: auto; max-width: 98vw; height: 94dvh; object-fit: contain; } }
/* Stationsuebersicht: Kacheln mit Fortschritt, Tippen oeffnet die Station */
.station-overview { margin: 0 0 12px; }
.station-overview > summary { cursor: pointer; color: var(--muted); padding: 6px 0; list-style-position: inside; }
.station-overview > summary small { margin-left: 6px; }
.station-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; max-height: 60dvh; overflow-y: auto; }
.station-tile {
  display: grid; grid-template-rows: auto 1fr auto; gap: 4px; padding: 6px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--line); color: var(--text); text-decoration: none; font-size: .9rem;
}
.station-tile:hover, .station-tile:focus-visible { border-color: var(--muted); }
.station-tile.is-complete { border-left-color: var(--ok); }
.station-tile.is-current { outline: 2px solid var(--accent); outline-offset: -1px; }
.station-tile.is-empty { opacity: .45; }
.st-img { display: block; height: 64px; background: #fff; border-radius: 4px; overflow: hidden; }
.st-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.st-name { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.st-code { color: var(--accent-2); }
.st-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .8rem; }
.station-tile.is-complete .st-progress { color: var(--ok); font-weight: 700; }
/* Ergebnisse: "Noch offen" je AK – fehlende Stationen (gestrichelt) und angefangene (Akzent links) */
/* eingeklappt (details); Kachel = Knopf, oeffnet den Dialog der Station (views/public/results.php $discInfo) */
.open-stations { margin: 14px 0 6px; }
.open-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; font-size: 1rem; font-weight: 700; cursor: pointer; list-style: none; width: fit-content; }
.open-title::-webkit-details-marker { display: none; }
.open-title small { font-weight: 400; font-size: .85rem; }
.open-chev { font-size: .75rem; color: var(--muted); transition: transform .15s; }
.open-stations[open] .open-chev { transform: rotate(180deg); }
.open-title:hover small, .open-title:hover .open-chev { color: var(--text); }
.open-stations .station-tiles { max-height: none; overflow: visible; }
.open-stations button.station-tile { width: 100%; margin: 0; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; align-content: start; }
/* Dialog einer Station mit Original-Uebung (DTB-Ausschnitt): breiter, Bilder auf weissem Grund */
dialog.sheet-wide { max-width: 100%; }
@media (min-width: 768px) { dialog.sheet-info.sheet-wide { width: min(900px, calc(100% - 32px)); max-width: 900px; } }
.info-img { display: block; background: #fff; border-radius: 8px; padding: 4px; cursor: zoom-in; }
.info-img + .info-img { margin-top: 8px; }
.info-img img { display: block; width: 100%; height: auto; max-height: 60dvh; object-fit: contain; }
.sheet-info .btn-primary { margin-top: 4px; }
.station-tile.is-missing { border-style: dashed; border-left-style: solid; }
.station-tile.is-partial { border-left-color: var(--accent-2); }
.station-tile.is-partial .st-progress { color: var(--accent-2); font-weight: 700; }
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.entry-group { margin-top: 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
.entry-row {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto 74px; gap: 10px; align-items: center;
  min-height: 60px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.entry-row:hover, .entry-row:focus-visible { border-color: var(--muted); }
.entry-name { font-weight: 700; display: grid; }
.entry-name small { color: var(--muted); font-weight: 400; }
.entry-val, .entry-pts { text-align: right; white-space: nowrap; }
.entry-val b, .entry-pts b { font: var(--fig-weight) 1.2rem var(--font-figures); font-variant-numeric: tabular-nums; }
.entry-pts b { color: var(--pts); }
.entry-val small, .entry-pts small { color: var(--muted); }
.entry-row:not(.has-value) b { color: var(--muted); }
.entry-row.has-value { border-left: 4px solid var(--ok); }
.entry-row.is-saving { opacity: .6; }
.entry-row.is-saved { border-color: var(--ok); background: rgba(63,185,80,.14); }
.entry-row.is-error { border-color: var(--accent-2); background: var(--accent-soft); }

.sheet-entry { padding: 14px; }
.pad { display: grid; gap: 12px; }
.pad-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.pad-head > div { min-width: 0; }
.pad-who { text-align: center; }
.pad-head h2 { margin: 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-head [data-pad-prev], .pad-head [data-pad-next-row] { width: 52px; font-size: 1.1rem; }
.pad-head [data-pad-prev]:disabled, .pad-head [data-pad-next-row]:disabled { opacity: .3; }
.pad-head .btn-close { margin-left: 4px; }
.pad-head p { margin: 2px 0 0; font-size: .88rem; }
.pad-display { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; background: var(--input-bg); border-radius: var(--radius); padding: 10px 16px; border: 1px solid var(--line); }
.pad-display:focus { outline: none; }
.pad-value { font: 400 clamp(2.6rem, 12vw, 4.6rem)/1 var(--font-num); text-align: right; overflow: hidden; }
.pad-unit { padding: 0 0 8px 10px; color: var(--muted); }
.pad-points { grid-column: 1 / -1; text-align: right; color: var(--muted); }
.pad-points b { color: var(--pts); font-size: 1.35rem; font-family: var(--font-figures); font-weight: var(--fig-weight); }
.pad-timer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; }
/* Athletische Tests: Ausschnitt aus den DTB-Unterlagen (weiss hinterlegt, im Hochformat klein) */
/* Athletische Tests: Felder, Stufen-Tasten, Seiten, Abzuege */
.pad-fields { display: grid; gap: 8px; }
.pad-fields[hidden] { display: none; }
.at-row { display: grid; gap: 4px; }
.at-lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.at-grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.at-grades .at-chip { min-height: 46px; font-size: 1.15rem; font-weight: 700; }
.at-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.at-chip { min-height: 38px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-bg); color: inherit; font: inherit; font-size: .9rem; cursor: pointer; }
.at-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.at-flag.is-on { background: #8a5a00; border-color: #d18b00; color: #fff; }
.at-flags { padding-top: 2px; }
.at-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.at-field { display: grid; gap: 2px; text-align: left; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-bg); color: inherit; font: inherit; cursor: pointer; }
.at-field span { font-size: .78rem; color: var(--muted); line-height: 1.2; }
.at-field b { font-size: 1.15rem; }
.at-field.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.at-override span { font-style: italic; }
.at-override.is-set b { color: var(--accent); }
.sheet-entry.is-choice .pad-keys { display: none; }
.at-rule { margin: 2px 0; font-size: .85rem; }
.pad-ref { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: .9rem; }
.pad-ref[hidden] { display: none; }
.pad-ref-toggle { display: none; }
.pad-ref a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.pad-ref img { display: none; }   /* Hochformat: nur Link, Bild oeffnet gross */
.timer-out { text-align: center; font: 400 2rem var(--font-num); }
.btn-timer { min-height: 52px; font-size: 1.05rem; background: #1d3b8f; border-color: #1d3b8f; color: #fff; }
.btn-timer[data-timer-stop]:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pad-timer .check { grid-column: 1 / -1; justify-content: center; font-size: .85rem; color: var(--muted); }
/* Athlet-Erfassung: Ton & Ansagen (gleiche Einstellungen wie die Messkarte) */
.pad-sound { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; }
.pad-sound > details[open] { flex-basis: 100%; display: grid; justify-items: center; gap: 6px; }
.pad-sound > details > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 36px; height: 32px; border-radius: 8px; color: var(--muted); }
.pad-sound > details > summary::-webkit-details-marker { display: none; }
.pad-sound > details[open] > summary { background: var(--surface-2); color: var(--text); }
.pad-sound-opts { width: 100%; box-sizing: border-box; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.pad-sound-opts .check { grid-column: 1 / -1; justify-content: flex-start; }
.pad-sound-opts select { width: 100%; }
.pad-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pad-keys button {
  min-height: clamp(46px, 6.6dvh, 74px); border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--key-bg); color: var(--text); font: 600 1.6rem var(--font); cursor: pointer; touch-action: manipulation;
}
.pad-keys button:active { background: var(--key-active); }
.pad-keys [data-step] { font-size: 1.1rem; background: var(--surface-2); }
.pad-actions {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.4fr); gap: 8px;
  position: sticky; bottom: -14px; margin: 0 -14px -14px; padding: 10px 14px 14px; background: var(--surface-solid); border-top: 1px solid var(--line);
}
.pad-actions .btn { padding: 0 6px; gap: 4px; }
.pad-actions [data-pad-next] { min-height: 56px; font-size: 1.05rem; }

/* Laufende Stoppuhr: der ganze Bildschirm ist "Stopp" */
.pad-stop {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 6px;
  background: var(--accent); color: var(--on-accent, #fff); cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.pad-stop[hidden] { display: none; }
.pad-stop output { font: 400 clamp(4rem, 22vw, 9rem)/1 var(--font-num); font-variant-numeric: tabular-nums; }
.pad-stop b { font: 800 clamp(2rem, 9vw, 3.5rem)/1 var(--font); letter-spacing: .08em; }
.pad-stop > span { opacity: .8; font-size: .95rem; }
.pad-stop:active { filter: brightness(.9); }

/* Offline-Puffer */
.entry-row.is-pending { border-color: #d29922; border-left: 4px solid #d29922; background: rgba(210,153,34,.14); }
.entry-row.is-pending [data-val]::after { content: " •"; color: #d29922; }
.pending-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid #d29922; background: rgba(210,153,34,.18); color: var(--text); font: 600 .85rem var(--font); cursor: pointer;
}
.pending-badge[hidden] { display: none; }

/* ---------- Messkarte (Station): Stoppuhr / Countdown / Lauf / Zaehler ---------- */
.timer-card { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.timer-card.is-running { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tc-toggle {
  all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 8px 14px; cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem;
}
.tc-toggle small { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.tc-caret { margin-left: auto; transition: transform .2s; }
.timer-card.is-collapsed .tc-caret { transform: rotate(-90deg); }
.tc-body { display: grid; gap: 12px; padding: 0 14px 14px; }
.tc-body[hidden] { display: none; }
.tc-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.tc-mode button {
  all: unset; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; color: var(--muted);
}
.tc-mode button.is-active { background: var(--accent); color: var(--on-accent); }
.tc-mode button:disabled { cursor: default; opacity: .6; }
.tc-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-presets .chip { min-height: 40px; }
.tc-clock { text-align: center; padding: 4px 0; }
.tc-clock output { display: block; font: 400 clamp(3.6rem, 15vw, 7.5rem)/1 var(--font-num); font-variant-numeric: tabular-nums; }
.tc-clock > span { color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
.timer-card.is-running .tc-clock output { color: var(--text); }
.tc-controls { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: 8px; }
.tc-start { min-height: 64px; font-size: 1.35rem; touch-action: manipulation; }
.tc-start.is-stop { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tc-controls [data-tc-reset] { min-height: 64px; }
/* Takt der Zeitansage + Anfeuer-Spruch */
.tc-boost { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.tc-boost[hidden] { display: none; }
.tc-step button {
  all: unset; display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; cursor: pointer; color: var(--muted);
  font-variant-numeric: tabular-nums; touch-action: manipulation;
}
.tc-step button.is-active { background: var(--accent); color: var(--on-accent); }
.tc-mot { flex: 1 1 140px; min-height: 48px; touch-action: manipulation; }
.tc-names { display: contents; }
.tc-motname { flex: 1 1 120px; min-height: 48px; touch-action: manipulation; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-stop .tc-boost { margin-top: 18px; justify-content: center; cursor: default; }
.pad-stop .tc-step { border-color: rgba(255,255,255,.5); }
.pad-stop .tc-step button { color: inherit; }
.pad-stop .tc-step button.is-active { background: rgba(255,255,255,.92); color: var(--accent); }
.pad-stop .tc-mot { flex: 0 1 auto; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); color: inherit; }
.tc-hint { margin: 0; color: var(--muted); font-size: .92rem; text-align: center; }
.tc-hint b { color: var(--text); }
.tc-laps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tc-laps:empty { display: none; }
.tc-laps-label { color: var(--muted); font-size: .85rem; }
.tc-laps .chip.is-used { opacity: .5; text-decoration: line-through; }

.tc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tc-tiles.is-heat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tc-tile {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 84px; padding: 10px 8px;
  border-radius: var(--radius-sm); background: var(--surface); border: 2px solid var(--line); text-align: center; cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, background .15s;
}
.tc-tile.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.tc-tiles.is-heat .tc-tile { min-height: clamp(130px, 22dvh, 220px); }
.tc-tile.is-running { border-color: #3b6fe0; background: rgba(59,111,224,.16); }
.tc-tile.is-finished { border-color: var(--ok); background: rgba(63,185,80,.16); }
.tc-name { font-weight: 700; font-size: 1.05rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tiles.is-heat .tc-name { font-size: 1.3rem; }
.tc-val { font: var(--fig-weight) 1.25rem var(--font-figures); font-variant-numeric: tabular-nums; }
.tc-val small { font: 400 .75rem var(--font); color: var(--muted); }
.tc-tiles.is-heat .tc-val { font-size: 2.2rem; }
.tc-count { font: 400 clamp(3rem, 9vw, 4.5rem)/1 var(--font-num); }
.tc-running { color: #7aa2ff; animation: tc-pulse 1s ease-in-out infinite; }
@keyframes tc-pulse { 50% { opacity: .45; } }
.tc-sub { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.tc-err { color: var(--accent-2); }
.tc-minus, .tc-undo {
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: 600 .85rem var(--font); cursor: pointer; touch-action: manipulation;
}
.tc-tile.is-bump { animation: tc-bump .18s ease-out; }
@keyframes tc-bump { 0% { transform: scale(.96); background: var(--accent-soft); } 100% { transform: scale(1); } }
.tc-opts summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.tc-opts[open] { display: grid; gap: 10px; }
.tc-voice-pick { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.tc-voice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
/* Laufende Zeiten: jede Ziffer gleich breit (die Anzeige-Schrift hat keine Tabellenziffern) */
.dg { display: inline-block; width: 1ch; text-align: center; }
.dg-sep { display: inline-block; }
.tc-clock.is-word output { font-size: clamp(2.4rem, 10vw, 4.5rem); padding: .35em 0; }
.pad-timer .pad-lap { grid-column: 1 / -1; min-height: 48px; border-color: #3b6fe0; }
.pad-timer .pad-lap[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tc-running, .tc-tile.is-bump { animation: none; } }

/* ---------- Anmeldung ---------- */
.login-card { margin-top: 8vh; text-align: center; }
.login-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 2rem; }
.login-form { text-align: left; grid-template-columns: 1fr !important; }
.login-error { color: var(--accent-2); margin: 0; }
.trainer-link.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-nav) + 16px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; max-width: 92vw;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--accent-2); color: #fff; }
.toast-warn { background: #d29922; color: #111; }

/* Kleine Smartphones: Werkzeuge im Kopf nur als Icon */
@media (max-width: 379px) {
  .pad-actions .btn i { display: none; }
  .pad-actions .btn { font-size: .92rem; }
}
@media (max-width: 479px) {
  .classic-toggle span { display: none; }
  .trainer-link span { display: none; }
  .brand-text { font-size: .9rem; }
}

/* =========================================================
   Tablet & groesser
   ========================================================= */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .nav-bottom { display: none; }
  .nav-top { display: flex; gap: 4px; margin-left: 18px; }
  .nav-top a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
    text-decoration: none; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .82rem; letter-spacing: .04em;
  }
  .nav-top a:hover { color: var(--text); background: var(--accent-soft); }
  .nav-top a.is-active { color: var(--on-accent); background: var(--accent); }
  .toast { bottom: 24px; }

  .ranking { display: none; }
  .table-wrap { display: block; }
  /* Ergebnistabelle: nur so breit wie der Inhalt (max. 100 %), mittig; Titel und Umschalter buendig darueber */
  .results-fit { width: fit-content; max-width: 100%; margin-inline: auto; }
  .page-results .results-table { width: auto; }

  .event-item { grid-template-columns: 120px minmax(0, 1fr) auto 20px; grid-template-areas: "date name badge chev"; }
  .event-item .chev { display: block; grid-area: chev; color: var(--muted); }
  .event-list-admin .event-item { grid-template-columns: 110px minmax(0, 1fr) auto auto; grid-template-areas: "date name badge actions"; }

  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid > .type-desc, .form-grid > h2, .form-grid > .check, .form-grid > .segmented, .form-grid > .actions,
  .form-grid > button, .form-grid > p { grid-column: 1 / -1; }
  .form-grid > .segmented.seg-field { grid-column: auto; }
  .form-inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .form-inline > button { grid-column: auto; }

  .formula-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

  .athlete-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .entry-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .entry-group { grid-column: 1 / -1; }
  dialog.sheet { width: min(560px, calc(100% - 32px)); margin: auto; border-radius: 18px; }
}

@media (min-width: 1000px) {
  .formula-row { grid-template-columns: minmax(150px, 1fr) repeat(3, 100px) minmax(200px, 1.4fr) auto; }
  .formula-name, .formula-preview, .formula-row .btn { grid-column: auto; }
}

/* Tablet hoch: Kopfzeile kompakt (nur Logo, Werkzeuge als Icon) */
@media (min-width: 768px) and (max-width: 1199px) {
  .brand-text { display: none; }
  .brand { flex-shrink: 0; }
  .nav-top { margin-left: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-top a { padding: 0 11px; }
  .classic-toggle span { display: none; }
}

/* Schmale Tablets: Navigation nur mit Icons */
@media (min-width: 768px) and (max-width: 919px) {
  .nav-top a span { display: none; }
  .nav-top a { padding: 0 14px; }
}

/* Tablet quer / Desktop: Ziffernfeld neben der Anzeige */
@media (min-width: 900px) and (orientation: landscape) {
  dialog.sheet-entry { width: min(96vw, 900px); }
  .pad { grid-template-columns: 1fr 1fr; grid-template-areas: "head head" "display keys" "fields keys" "timer keys" "ref keys" "actions keys"; align-items: start; }
  .pad-fields { grid-area: fields; }
  .sheet-entry.is-choice .pad { grid-template-areas: "head head" "display fields" "timer fields" "ref fields" "actions fields"; }
  .pad .pad-head { grid-area: head; }
  .pad-ref { grid-area: ref; flex-direction: column; flex-wrap: nowrap; }
  .pad-ref a { display: block; background: #fff; border-radius: 8px; padding: 4px; }
  .pad-ref a span { display: none; }
  .pad-ref img { display: block; max-width: 100%; max-height: 42dvh; width: auto; height: auto; margin: 0 auto; }
  .pad-ref:has(a + a) img { max-height: 27dvh; }   /* zwei Bilder (1b rw / 1c vw) untereinander */
  /* DTB-Ausschnitt gross: ueber die ganze Breite der Karte (antippen oder Knopf, zurueck genauso) */
  .pad-ref { position: relative; }
  .pad-ref a { cursor: zoom-in; }
  .pad-ref-toggle { display: grid; place-items: center; position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
  .sheet-entry.ref-wide .pad { grid-template-areas: "head head" "display keys" "fields keys" "timer keys" "actions keys" "ref ref"; }
  .sheet-entry.ref-wide.is-choice .pad { grid-template-areas: "head head" "display fields" "timer fields" "actions fields" "ref ref"; }
  .sheet-entry.ref-wide .pad-ref a { cursor: zoom-out; }
  .sheet-entry.ref-wide .pad-ref img { width: 100%; max-height: none; }
  .pad-display { grid-area: display; }
  .pad-timer { grid-area: timer; }
  .pad-keys { grid-area: keys; }
  .pad-actions { grid-area: actions; position: static; margin: 0; padding: 10px 0 0; border-top: 0; }
}

/* Smartphone quer: kompaktere Hoehen */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --bottom-nav: 50px; }
  .nav-bottom a span { display: none; }
  dialog.sheet-entry { width: 96vw; max-height: 96dvh; margin: auto; border-radius: 18px; }
  .pad { grid-template-columns: 1fr 1.2fr; grid-template-areas: "head keys" "display keys" "timer keys" "actions keys"; }
  .pad-ref { display: none; }   /* zu wenig Hoehe */
  .pad-fields { grid-column: 1; }
  .pad .pad-head { grid-area: head; } .pad-display { grid-area: display; } .pad-timer { grid-area: timer; }
  .pad-keys { grid-area: keys; } .pad-actions { grid-area: actions; position: static; margin: 0; padding: 6px 0 0; border-top: 0; }
  .pad-keys button { min-height: 44px; font-size: 1.2rem; }
  .pad-value { font-size: 2.6rem; }
  /* Anzeigetafel: kleinerer Titel, Tabelle fast bildschirmhoch (Seite scrollt den Kopf weg) */
  .event-pick h1 { font-size: 1.5rem; }
  .event-pick-caret { width: 28px; height: 28px; }
  .table-wrap { max-height: calc(100dvh - 76px); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =========================================================
   Konten, Athleten-Bereich, Sichtbarkeit (2026-11-03)
   ========================================================= */
.account-link span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.account-link.is-on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
/* Sichtbarkeits-Level 0/1/2 als Ziffer im Kreis (Kopfzeile + Sichtbarkeitsseite) */
.level-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  font-weight: 800; font-size: .85rem; line-height: 1; font-style: normal;
  color: var(--text); background: var(--surface-3); border: 1px solid var(--line); }
.account-link.is-on .level-dot { color: #111; background: #fff; border-color: #fff; margin-left: -6px; }
.account-link.is-on { padding-left: 8px; }
.level-dot-lg { width: 32px; height: 32px; font-size: 1.1rem; }
.vis-option .level-dot { grid-row: span 2; }
.vis-option.is-active .level-dot { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.theme-classic { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); border-top: 1px solid var(--line); margin-top: 4px; }
.theme-classic:hover { background: var(--surface-2); }
/* Sprach-Umschalter (gleiches Menue wie die Designs) */
.lang-btn { padding: 0 10px; gap: 5px; }
.lang-btn span { font-size: .74rem; font-weight: 700; letter-spacing: .04em; }
.lang-list { width: min(220px, 86vw); }
.lang-list a { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 10px 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--surface-2); }
.lang-list a[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.lang-list a b { font-size: .8rem; letter-spacing: .04em; color: var(--muted); }
/* schmale Handys: die Kopfleiste darf nicht breiter als der Bildschirm werden */
.topbar-tools { min-width: 0; }
.topbar-tools .account-link { flex: 0 1 auto; min-width: 40px; overflow: hidden; }
.account-link span { min-width: 0; }
@media (max-width: 380px) { .lang-btn i { display: none; } }
@media (max-width: 350px) { .account-link:not(.is-on) span { display: none; } }
/* ukrainische/russische Disziplin-Namen sind laenger: Spalten etwas breiter statt sechs Zeilen Kopf */
html[lang="uk"] .results-table thead th, html[lang="ru"] .results-table thead th { min-width: 118px; }
.theme-classic small { display: block; color: var(--muted); }
.swatch-classic { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.banner { display: flex; gap: 10px; align-items: center; text-decoration: none; border-color: var(--accent); }
.login-tabs { margin: 4px 0 14px; }
.login-alt { margin-top: 16px; color: var(--muted); }
.login-alt a { color: var(--text); }
.pill-ok { background: rgba(63,185,80,.18); color: var(--ok); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 var(--gap); scrollbar-width: none; }
.subtabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 600; }
.subtabs a.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vis-options { display: grid; gap: 8px; }
.vis-option { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 32px 1fr; gap: 2px 10px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.vis-option i { grid-row: span 2; font-size: 1.3rem; color: var(--muted); }
.vis-option small { color: var(--muted); }
.vis-option.is-active { border-color: var(--accent); background: var(--accent-soft); }
.vis-option .vis-now { grid-column: -2; color: var(--text); font-weight: 600; }
.vis-option.is-active i { color: var(--accent-2); }
.vis-row { grid-template-areas: "date sel" "name name"; }
.vis-select { grid-area: sel; width: auto; min-height: 40px; justify-self: end; }
.vis-icon { color: var(--muted); font-size: .8em; margin-left: 6px; }
.is-self { color: var(--accent-2) !important; }
.anon-name { color: var(--muted); font-style: italic; }
.athlete-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: -6px 0 12px; }
.best-list { list-style: none; margin: 0; padding: 0; }
.best-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 64px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.best-list li:first-child { border-top: 0; }
.best-name { font-weight: 700; display: grid; }
.best-name small { color: var(--muted); font-weight: 400; }
.best-spark { color: var(--accent-2); line-height: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.tile { display: grid; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.tile i { font-size: 1.6rem; color: var(--accent-2); }
.tile small { color: var(--muted); }
.tile:hover { border-color: var(--accent); }
.status-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.staff-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-scroll { overflow-x: auto; }
.info-legacy table { color: var(--text) !important; width: 100%; }
.shirt-claim { margin: 4px 0 6px; font: 400 1.25rem/1.25 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.shirt-claim i, .shirt-claim b { color: var(--accent); }
.shirt-stage {
  position: relative; height: min(72dvh, 820px); border-radius: var(--radius); overflow: hidden; touch-action: none;
  background: radial-gradient(ellipse 70% 45% at 50% 92%, rgba(210, 20, 10, .55), rgba(60, 0, 0, .25) 55%, transparent 75%), #050505;
}
.shirt-stage canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.shirt-stage canvas:active { cursor: grabbing; }
.shirt-fallback { padding: 24px; color: var(--muted); }
.shirt-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.shirt-controls [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.shirt-controls .ico-sword { width: 1.1em; height: 1.1em; vertical-align: -.18em; }
.shirt-controls [data-shirt-sword]:not(.is-used) { animation: sword-call 2.4s ease-in-out infinite; }
@keyframes sword-call { 50% { box-shadow: 0 0 0 4px rgba(210, 20, 10, .35); } }
.shirt-stage.is-sword canvas, .shirt-stage.is-sword canvas:active { cursor: none; }
.shirt-stage.is-spear canvas, .shirt-stage.is-spear canvas:active { cursor: crosshair; }
.shirt-stage.is-torch canvas, .shirt-stage.is-torch canvas:active { cursor: none; }
.shirt-weapons { margin-top: -4px; }
/* Hinweis zum Schwert: klebt unter der Kopfleiste (sword3d.js setzt top), damit er auch am Handy sichtbar bleibt,
   wenn die Buehne nach oben aus dem Bild gescrollt ist */
.shirt-hint {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 15; margin: 0; padding: 6px 12px;
  max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis;
  border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .85rem; white-space: nowrap; pointer-events: none;
}
.shirt-legacy { margin-top: 8px; }
.shirt-legacy summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.shirt-frame iframe { width: 100%; height: min(78dvh, 900px); border: 0; border-radius: var(--radius); background: #000; }
.athlete-row.has-access { grid-template-columns: auto minmax(0, 1fr) auto; }
/* ---------- Athleten ohne Event (views/trainer/people.php) ---------- */
.people-tabs { margin: 0 0 14px; }
.people-list .athlete-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.pick { position: relative; width: 30px; height: 30px; flex: none; }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; min-height: 0; }
.pick span { position: absolute; inset: 0; border: 2px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.pick input:checked + span { background: var(--accent); border-color: var(--accent); }
.pick input:checked + span::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--on-accent); font-weight: 700; }
.athlete-row.is-picked { border-color: var(--accent); }
.btn-danger-soft { color: var(--accent-2); }
.row-btns { display: flex; gap: 6px; }
.staff-list li.is-off { opacity: .55; }
.lock-note p { margin: 0; }
/* Sichter: Schalter im Konto-Menue (wie ein Menue-Link) */
.account-form { margin: 0; }
.account-form button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); }
.account-form button:hover, .account-form button:focus-visible { background: var(--surface-2); }
.account-form .fa-toggle-on { color: var(--ok); }
.lock-note i { color: var(--accent-2); margin-right: 6px; }
.row-btns:empty { display: none; }
/* Admin-Test "Als Athlet ansehen" (layout.php) */
.viewas-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
  padding: 6px 12px; background: #7a4dd8; color: #fff; font-size: .92rem; }
.viewas-bar .btn { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.5); color: #fff; }
.merge-bar { position: sticky; top: 70px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 12px;
  border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface-solid); }
.merge-bar > span { flex: 1 1 auto; }
.dup-card h2 { font-size: 1.1rem; margin: 0 0 8px; }
.dup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dup-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dup-list li:last-child { border-bottom: 0; }
.merge-log summary { cursor: pointer; font-weight: 700; }
.merge-box { display: grid; gap: 12px; }
.merge-pick { display: grid; gap: 8px; }
.merge-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.merge-pick label:has(input:checked) { border-color: var(--ok); }
.merge-pick input { width: 22px; height: 22px; min-height: 0; flex: none; }
.merge-pick label small { display: none; }
.merge-pick label:has(input:checked) small { display: inline; color: var(--ok); }
.merge-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.merge-table th, .merge-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.merge-table th:first-child, .merge-table td:first-child { text-align: left; }
.merge-table .win { color: var(--ok); font-weight: 700; }
.merge-table .lose { color: var(--muted); text-decoration: line-through; }
.access-btn { color: var(--muted); }
.access-btn.state-active { color: var(--ok); border-color: var(--ok); }
.access-btn.state-invited { color: #f0a020; border-color: #f0a020; }
.access-box { display: grid; gap: 12px; }
.code-big { display: block; text-align: center; font: 400 3.4rem/1.1 var(--font-figures); letter-spacing: .3em; padding: 10px;
  border-radius: var(--radius); background: var(--input-bg); border: 2px dashed var(--accent); }
.page-me .main, .page-login .main { max-width: 820px; }
.area-public.page-login .main { max-width: 480px; }
@media (min-width: 768px) {
  .vis-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vis-options-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vis-option { grid-template-columns: 1fr; text-align: center; }
  .vis-option i { grid-row: auto; font-size: 1.6rem; }
  .vis-option .level-dot { grid-row: auto; justify-self: center; }
  .vis-row { grid-template-columns: 120px minmax(0, 1fr) auto; grid-template-areas: "date name sel"; }
}
/* Bestleistungen auf dem Handy: Name oben, darunter Verlauf | Wert | Punkte */
@media (max-width: 599px) {
  .best-list li { grid-template-columns: minmax(0, 1fr) auto 64px; grid-template-areas: "name name name" "spark val pts"; row-gap: 4px; }
  .best-name { grid-area: name; }
  .best-spark { grid-area: spark; }
  .best-list .disc-val { grid-area: val; }
  .best-list .disc-pts { grid-area: pts; }
}

/* Pruef-Befunde 03.11.2026 */
@media (max-width: 600px) {
  .theme-menu { position: static; }
  .theme-list { right: 12px; left: auto; width: min(300px, calc(100vw - 24px)); }
  .subtabs a:not(.is-active) span { display: none; }
  .info-legacy table, .info-legacy tbody, .info-legacy tr, .info-legacy td { display: block; width: auto !important; height: auto !important; }
  .info-legacy td:empty { display: none; }
  .info-legacy * { max-width: 100%; }
}
.access-head { display: flex; justify-content: space-between; gap: 10px; }
[data-theme="arena"] .pill-ok { background: rgba(26,127,55,.12); }

/* Trainer -> System: Hintergrundbild je Design */
.bg-theme { border-top: 1px solid var(--line); padding: 8px 0; }
.bg-theme summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.bg-theme summary::-webkit-details-marker { display: none; }
.bg-theme summary img { width: 96px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.bg-theme summary small { display: block; color: var(--muted); }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.bg-tile { all: unset; box-sizing: border-box; cursor: pointer; border-radius: var(--radius-sm); border: 2px solid transparent; padding: 2px; text-align: center; }
.bg-tile img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.bg-tile small { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.bg-tile:hover, .bg-tile:focus-visible { border-color: var(--line); }
.bg-tile.is-on { border-color: var(--accent); }
.bg-tile.is-on small { color: var(--text); font-weight: 700; }
.bg-tile { position: relative; }
.bg-tile .bg-nr { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.bg-theme-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.bg-theme-head .muted { flex: 1 1 200px; margin: 0; }
.bg-strip { display: flex; gap: 4px; }
.bg-theme summary .bg-strip img { width: 54px; }
.bg-mode { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
/* Ausschnitt auf dem Handy: Rahmen = sichtbarer Hochformat-Streifen (ca. 30 % der Bildbreite) */
.bg-pos .bg-frame { position: relative; display: block; border-radius: 6px; overflow: hidden; }
.bg-pos .bg-frame img { border-radius: 0; filter: brightness(.4); }
.bg-pos .bg-frame i { position: absolute; top: 0; bottom: 0; width: 30%; left: calc(var(--x) * .7%); border: 2px solid var(--accent);
  background: var(--src) no-repeat; background-size: 333.3% 100%; background-position: calc(var(--x) * 1%) 0; }
.bg-pos .bg-frame i + i { display: none; }
.bg-pos .is-alt .bg-frame i + i { display: block; border-style: dashed; }
.theme-tile-swatch { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; }
.theme-default { font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; margin-left: 6px; color: var(--muted); vertical-align: 2px; }

/* T-Shirt: Auswahl der Detailstufe */
.shirt-quality { gap: 6px; padding-right: 6px; }
.shirt-quality select { all: unset; cursor: pointer; font: inherit; color: inherit; padding-right: 4px; }
.shirt-quality select option { color: #111; }

/* =========================================================
   Datenschutz im Profil, eigenes Training, Summen, Highscores (v035-v037, 2026-11-10)
   ========================================================= */
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head-row h2 { margin: 0; }
.privacy-card h3 { font-size: 1rem; margin: 18px 0 2px; }
.privacy-card h3:first-of-type { margin-top: 6px; }
.privacy-card .vis-options { margin-top: 8px; }
.sheet-info { max-width: 640px; }
/* Unumkehrbares bestaetigen (app.js confirmDanger): Text, Haken, roter Knopf */
.sheet-danger { max-width: 520px; padding: 20px; }
.sheet-danger h2 { margin: 0 0 10px; }
.sheet-danger h2 i { color: var(--accent-2); }
.sheet-danger .check { margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.sheet-info h3 { font-size: 1rem; margin: 16px 0 4px; color: var(--accent-2); }
.sheet-info p, .sheet-info li, .sheet-info dd { color: var(--text); line-height: 1.45; }
.info-head { grid-template-columns: minmax(0, 1fr) auto; }
.info-head h2 { margin: 0; }
.info-list { margin: 0; }
.info-list dt { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 10px; }
.info-list dd { margin: 2px 0 0 32px; }
@media (min-width: 768px) { dialog.sheet-info { margin: auto; border-radius: 18px; } }

/* Eigenes Training */
.training-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.training-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 72px; gap: 10px; align-items: center;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.training-row .training-input { text-align: right; font: var(--fig-weight) 1.15rem var(--font-figures); padding: 0 10px; }
.training-row .disc-pts { text-align: right; white-space: nowrap; }
.training-row .disc-pts b { color: var(--pts); font: var(--fig-weight) 1.1rem var(--font-figures); }
.training-row.has-value { border-left: 4px solid var(--ok); }
.training-row.is-dropped .disc-pts b { text-decoration: line-through; color: var(--muted); }
.training-row.is-saving { opacity: .6; }
.training-row.is-saved { border-color: var(--ok); background: rgba(63,185,80,.14); }
.training-row.is-error { border-color: var(--accent-2); background: var(--accent-soft); }
.training-head .goal-label { margin-top: 4px; }
.training-sets li { grid-template-columns: minmax(0, 1fr) auto 72px; }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.set-chip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); font: var(--fig-weight) 1rem var(--font-figures); }
.set-chip i { font-size: .75em; color: var(--muted); }
.set-chip:hover, .set-chip:focus-visible { border-color: var(--accent-2); }
@media (max-width: 599px) {
  .training-sets li { grid-template-columns: minmax(0, 1fr) 72px; grid-template-areas: "name pts" "sets sets"; }
  .training-sets .best-name { grid-area: name; }
  .training-sets .set-chips { grid-area: sets; justify-content: flex-start; }
  .training-sets .disc-pts { grid-area: pts; }
}

/* Summen + Bestleistungen aus dem Training */
.seg-period a { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.sum-list li { grid-template-columns: minmax(0, 1fr) auto; }
.sum-list .disc-val, .sum-list .disc-pts { text-align: right; white-space: nowrap; font: var(--fig-weight) 1.15rem var(--font-figures); }
.sum-list .sum-points { border-top: 2px solid var(--line); }
.sum-foot { margin: 10px 0 0; }
.badge-training { gap: 5px; background: rgba(63,185,80,.18); color: var(--ok); font-size: .72rem; vertical-align: middle; }
.best-training .best-name > span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 599px) {
  .sum-list li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: none; }
  .sum-list .best-name, .sum-list .disc-val, .sum-list .disc-pts { grid-area: auto; }
}

/* Highscores */
.hs-filter { display: grid; gap: 14px; }
.hs-filter > label, .hs-seg legend { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.hs-filter select { font-size: 1rem; }
.hs-seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.hs-seg legend { padding: 0 0 4px; }
/* zusammenhaengende Knopfleiste: ein Rahmen, gewaehlter Teil gefuellt */
.seg-bar { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input-bg); }
.seg-bar label { flex: 1 1 auto; }
.seg-bar input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-bar span {
  display: grid; place-items: center; min-height: calc(var(--tap) - 8px); padding: 0 14px; white-space: nowrap;
  border-radius: calc(var(--radius-sm) - 3px); color: var(--muted); font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.seg-bar span:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.seg-bar input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg-bar input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 1px; }
/* Rang | Name | Teilnahmen | Ø | Summe – Kopfzeile und Zeilen teilen dasselbe Raster */
.hs-list { list-style: none; margin: 0; padding: 0; }
.hs-head, .hs-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 4.5rem 5.5rem 6.5rem 1.75rem; gap: 10px; align-items: center; }
.hs-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.hs-list li:first-child { border-top: 0; }
.hs-head { padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.hs-col { text-align: right; white-space: nowrap; color: var(--muted); text-decoration: none; font-weight: 700; }
.hs-col:hover { color: var(--text); }
.hs-col small { font-size: .9em; text-transform: none; letter-spacing: 0; font-weight: 400; }
.hs-col.is-sort { color: var(--accent-2); }
.hs-rank { font: var(--fig-weight) 1.2rem var(--font-figures); color: var(--muted); text-align: right; }
.hs-list li:nth-child(-n+3) .hs-rank { color: var(--accent-2); }
.hs-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-name .vis-icon { margin-left: 4px; }
.hs-val { text-align: right; white-space: nowrap; font: var(--fig-weight) 1rem var(--font-figures); color: var(--muted); }
.hs-val.is-sort { font-size: 1.25rem; color: var(--text); }
/* Ansicht "Details": zwei Zusatzspalten (breit), auf schmalen Schirmen als zweite Zeile unter dem Namen.
   Die Zellen stehen immer im HTML; der Umschalter (Pfeile, dreht sich) im Tabellenkopf setzt .hs-ext an der Karte. */
.hs-card:not(.hs-ext) .hs-c-best, .hs-card:not(.hs-ext) .hs-c-extra { display: none; }
.hs-x-toggle { justify-self: end; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: var(--muted); text-decoration: none; font-size: .85rem; transition: color .15s, background .15s; }
.hs-x-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.hs-x-toggle span { display: none; }
.hs-x-toggle i { transition: transform .25s ease; }
.hs-ext .hs-x-toggle { color: var(--accent-2); }
.hs-ext .hs-x-toggle i { transform: rotate(180deg); }
/* Detail-Zellen fahren beim Aufklappen kurz ein */
@keyframes hs-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.hs-ext .hs-c-best, .hs-ext .hs-c-extra { animation: hs-in .18s ease-out; }
@media (prefers-reduced-motion: reduce) { .hs-ext .hs-c-best, .hs-ext .hs-c-extra { animation: none; } .hs-x-toggle i { transition: none; } }
.page-head h1 .btn-info { font-size: 1.1rem; vertical-align: middle; color: var(--muted); border-color: transparent; background: none; box-shadow: none; }
.page-head h1 .btn-info:hover { color: var(--accent-2); }
.page-head h1 .pill { font-size: .8rem; vertical-align: middle; font-family: var(--font-figures); letter-spacing: 0; }
.hs-c-best { overflow: hidden; text-overflow: ellipsis; }
.hs-list .hs-c-best { font-size: .95rem; }
.hs-list .hs-c-extra small { color: var(--muted); font-size: .75em; }
@media (min-width: 900px) {
  .hs-ext .hs-head, .hs-ext .hs-list li { grid-template-columns: 44px minmax(0, 1fr) 4.5rem 5.5rem 6.5rem minmax(7rem, 15rem) 8.5rem 1.75rem; }
  .hs-list .hs-c-extra small { display: none; }
}
@media (max-width: 899px) {
  .hs-ext .hs-head .hs-c-best, .hs-ext .hs-head .hs-c-extra { display: none; }
  .hs-ext .hs-list li { row-gap: 2px; }
  .hs-ext .hs-list .hs-c-best, .hs-ext .hs-list .hs-c-extra { grid-row: 2; font-size: .8rem; white-space: nowrap; }
  .hs-ext .hs-list .hs-c-best { grid-column: 2 / 4; text-align: left; }
  .hs-ext .hs-list .hs-c-extra { grid-column: 4 / 6; }
  .hs-ext .hs-list .hs-c-best.is-sort, .hs-ext .hs-list .hs-c-extra.is-sort { font-size: .85rem; color: var(--accent-2); }
  .hs-ext .hs-list [data-l]::before { content: attr(data-l) ": "; font-weight: 400; color: var(--muted); }
}
@media (max-width: 560px) {
  .hs-head, .hs-list li { grid-template-columns: 26px minmax(0, 1fr) 2.2rem 3.4rem 4rem 1.5rem; gap: 6px; }
  .hs-head { font-size: .7rem; letter-spacing: 0; }
  .hs-col small { display: none; }
  .hs-rank { font-size: 1rem; }
  .hs-val { font-size: .9rem; }
  .hs-val.is-sort { font-size: 1.05rem; }
}
.hs-list .is-self-row { background: var(--accent-soft); border-radius: var(--radius-sm); }
.hs-self { font-weight: 700; margin-top: 10px; }
.small-note { font-size: .85rem; }
@media (min-width: 900px) { .hs-filter { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; } }
@media (max-width: 420px) { .seg-bar span { padding: 0 8px; } }
#datenschutz, #summen { scroll-margin-top: 84px; }
.vis-option .vis-default { font-weight: 400; color: var(--muted); font-size: .85em; }

/* Statistik-Diagramm (v035): gestapelte Saeulen Events/Training. Farben gegen Farbschwaeche geprueft (dataviz-Validator). */
:root { --chart-events: #3987e5; --chart-training: #199e70; --chart-h: 180px; }
[data-theme="arena"] { --chart-events: #2a78d6; --chart-training: #1baf7a; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chart-metric select { width: auto; max-width: 62vw; min-height: 38px; font-size: .9rem; }
.chart-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 4px 0 10px; }
.chart-legend { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-events { background: var(--chart-events); }
.sw-training { background: var(--chart-training); }
.chart-readout { font-size: .85rem; min-height: 1.3em; }
.chart { --axis-w: 40px; }
.chart-plot { position: relative; height: var(--chart-h); margin-left: var(--axis-w); border-bottom: 1px solid var(--line); }
.chart-grid span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.chart-grid span:first-child { border-top: 0; }
.chart-grid i { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); font: 400 .72rem var(--font); font-style: normal; color: var(--muted); white-space: nowrap; }
.chart-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.chart-col { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; height: 100%; cursor: default; outline: none; border-radius: 4px; }
.chart-col { --hl: color-mix(in srgb, var(--text) 8%, transparent); }
.chart-col:hover, .chart-col:focus-visible { background: linear-gradient(to right, transparent calc(50% - 22px), var(--hl) calc(50% - 22px), var(--hl) calc(50% + 22px), transparent calc(50% + 22px)); }
.chart-col .seg { display: block; width: min(70%, 28px); min-height: 2px; flex: none; }
.chart-col .seg:last-child { border-radius: 4px 4px 0 0; }
.seg-events { background: var(--chart-events); }
.seg-training { background: var(--chart-training); }
.chart-x { margin-left: var(--axis-w); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); font-size: .72rem; color: var(--muted); padding-top: 4px; }
.chart-x span { text-align: center; white-space: nowrap; overflow: visible; }
@media (max-width: 599px) { .chart { --axis-w: 32px; } :root { --chart-h: 150px; } .chart-readout { flex-basis: 100%; min-height: 2.6em; } }
@media (forced-colors: active) { .seg-training { background: repeating-linear-gradient(45deg, CanvasText 0 2px, Canvas 2px 5px); } .seg-events { background: CanvasText; } }

/* Sichtung (v077, lib/Scout.php): Uebersicht, Kennzahlen, Verlauf "Ø je Station" je Test, Tests je AK */
.page-scout .main { max-width: 1060px; }
.scout-wrap { overflow-x: auto; }
.scout-table { width: 100%; min-width: 0; }
.scout-table thead th { position: static; min-width: 0; max-width: none; background: transparent; white-space: nowrap; overflow-wrap: normal; hyphens: manual; }
.scout-table .pill { white-space: nowrap; }
/* uk/ru: die Mindestbreite der Kopfzellen aus der Ergebnistabelle wuerde die Liste unnoetig breit machen */
html[lang="uk"] .scout-table thead th, html[lang="ru"] .scout-table thead th { min-width: 0; }
/* Trainingsgruppe (lib/ScoutGroups.php): Filter oben, Auswahl bzw. Badge je Athlet */
.sc-toolbar { align-items: stretch; }
/* Zeile 1: Suche + "AK zusammen" (rechts); Zeile 2: Gruppenfilter in voller Breite – nebeneinander passt es nicht */
.sc-toolbar .search { flex: 1 1 120px; }
.sc-groupfilter { flex: 1 1 100%; }
.sc-groupfilter .seg-bar { width: fit-content; max-width: 100%; flex-wrap: wrap; }
.sc-groupfilter .seg-bar small { margin-left: 5px; font-weight: 400; opacity: .75; font-family: var(--font-figures); }
.scout-table tr.is-filtered { display: none; }
/* Bloecke je AK (Scout::byAk): eine Kopfzeile je Block; "AK zusammen" steht rechts in der Werkzeugzeile (assets/scout.js) */
.sc-akmode { flex: 0 0 auto; }
/* Wertung AT | Pflicht | TGL | Index (Scout::modes): alle Varianten in der Tabelle, sichtbar nur die gewaehlte (assets/scout.js) */
.sc-modes { flex: 0 0 auto; }
.sc-modes .seg-bar { height: 100%; }
.sc-modes .seg-bar span { display: flex; align-items: center; height: 100%; }
.scout-table .sc-m { display: none; }
[data-scout][data-mode="at"] .scout-table .sc-m-at, [data-scout][data-mode="pflicht"] .scout-table .sc-m-pflicht,
[data-scout][data-mode="tgl"] .scout-table .sc-m-tgl, [data-scout][data-mode="index"] .scout-table .sc-m-index { display: table-cell; }
.sc-akmode .seg-bar { height: 100%; }
.sc-akmode .seg-bar span { display: flex; align-items: center; gap: 7px; height: 100%; }
.scout-table thead th[data-scout-sort] { cursor: pointer; }
/* etwas schmalere Zellen: mit der Spalte Gruppe passte die Tabelle sonst nicht ganz in die Karte */
.scout-table th, .scout-table td { padding-left: 9px; padding-right: 9px; }
.scout-table .sc-ak-row th { padding: 20px 9px 7px; text-align: left; border-bottom: 2px solid var(--line); font: 700 1.02rem var(--font); letter-spacing: .02em; }
.scout-table tbody tr.sc-ak-row:hover th { background-color: transparent; }
.scout-table .sc-ak-row small { margin-left: 6px; color: var(--muted); font: 400 .82rem var(--font-figures); }
.sc-group-sel { width: auto; max-width: 13.5rem; min-height: 36px; padding: 2px 8px; font-size: .88rem; }
.scout-table .sc-group-sel { max-width: 10.5rem; background-color: transparent; border-color: transparent; }
.scout-table .sc-group-sel:hover, .scout-table .sc-group-sel:focus { border-color: var(--line); background-color: var(--input-bg); }
.scout-table .sc-c-group { white-space: nowrap; }
.sc-g { background: transparent; border: 1px solid var(--line); color: var(--text); }
.sc-g-out { border-style: dashed; color: var(--muted); }
.sc-auto { margin-left: 6px; font-size: .72rem; color: var(--muted); }
.sc-profile-group { display: inline-flex; align-items: center; }
@media (max-width: 767px) {
  .sc-groupfilter .seg-bar { width: auto; }
  .sc-akmode .seg-bar span { padding: 0 10px; font-size: .88rem; }
  .sc-groupfilter .seg-bar span { min-height: 36px; padding: 0 10px; font-size: .88rem; }
  .scout-table .sc-c-group .sc-group-sel { max-width: 9.5rem; }
}
.scout-table .sticky-col { position: static; background: transparent; }
.scout-table td { font-variant-numeric: tabular-nums; }
.scout-table tbody:not([data-scout-ak]):not([data-scout-all]) tr:last-child > * { border-bottom: 0; }
.scout-table .sc-num { font: var(--fig-weight) 1.15rem var(--font-figures); color: var(--pts); white-space: nowrap; }
/* Mini-Verlauf neben dem Leistungswert (views/public/scout.php $spark) und ganze Zeile als Link (assets/scout.js) */
.sc-lvl { display: inline-block; min-width: 2.1em; }
.sc-spark { display: inline-block; width: 52px; height: 20px; margin-left: 7px; vertical-align: middle; color: var(--chart-events); line-height: 0; }
.sc-spark svg { width: 100%; height: 100%; overflow: visible; }
.scout-table tr[data-href] { cursor: pointer; }
.scout-table tr[data-href]:hover .sticky-col a { text-decoration: underline; text-underline-offset: 3px; }
.sc-name-ico { margin-left: 4px; font-size: .72em; color: var(--accent); opacity: 0; transition: opacity .12s; }
.scout-table .sc-go { width: 1.6em; padding-left: 0; text-align: right; color: var(--muted); }
.sc-go i { transition: transform .12s, color .12s; }
.scout-table tr[data-href]:hover .sc-go i { color: var(--accent); transform: translateX(3px); }
.scout-table tr[data-href]:hover .sc-name-ico { opacity: 1; }
.sc-ak-table tbody th { font-weight: 700; }
.sc-trend { white-space: nowrap; font-family: var(--font-figures); font-weight: var(--fig-weight); }
.sc-trend i { margin-right: 2px; font-size: .85em; color: var(--muted); }
.sc-up i { color: var(--ok); }
.sc-down i { color: var(--accent-2); }
.sc-links { justify-content: flex-start; margin: 6px 0 0; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kpi-main { border-color: var(--accent); }
.kpi-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-value { font: var(--fig-weight) 1.9rem/1.15 var(--font-figures); font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .5em; font-weight: 400; color: var(--muted); }
.kpi-note { font-size: .8rem; color: var(--muted); }
.sc-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sc-line polyline { stroke: var(--chart-events); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sc-yearline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
/* Messpunkt: 28 px Trefferflaeche, 10 px Punkt mit 2 px Ring in Flaechenfarbe; Teiltest = hohl */
.sc-pt { position: absolute; display: grid; place-items: center; width: 28px; height: 28px; margin: 0 0 -14px -14px; border-radius: 50%; }
.sc-pt::before, .sc-dot { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--chart-events); box-shadow: 0 0 0 2px var(--surface-solid); transition: transform .12s; }
.sc-pt.is-part::before, .sc-dot.is-part { background: var(--surface-solid); box-shadow: inset 0 0 0 2px var(--chart-events), 0 0 0 2px var(--surface-solid); }
.sc-pt:hover::before, .sc-pt:focus-visible::before { transform: scale(1.5); }
.sc-dot { display: inline-block; }
.sc-years { position: relative; height: 1.5em; margin: 4px 0 0 var(--axis-w); font-size: .72rem; color: var(--muted); }
.sc-years span { position: absolute; overflow: hidden; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
/* importierte Wettkaempfe (v078, lib/Comps.php): eckige Marke in der zweiten Diagrammfarbe, Tabellen je Regelsystem */
.sc-pt.is-official::before, .sc-dot.is-official { border-radius: 2px; background: var(--chart-training); }
.badge-official { gap: 5px; background: transparent; border: 1px solid var(--line); color: var(--text); }
.sc-comp-table .sc-c-name { text-align: left; white-space: normal; min-width: 9rem; font-weight: 600; }
.sc-comp-table th, .sc-comp-table td { padding: 8px 8px; }
.sc-comp-table tr:target > * { background: var(--accent-soft); }
.sc-comp-table tr[id] { scroll-margin-top: 84px; }
.sc-detail-row td { padding-top: 0; text-align: left; white-space: normal; }
.sc-detail-row summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.sc-stations { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2px 18px; }
.sc-stations li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.sc-stations b { font-family: var(--font-figures); font-weight: var(--fig-weight); }
/* Import-Seite (views/public/import.php) */
.page-import .main { max-width: 1180px; }
.imp-drop { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--input-bg); transition: border-color .15s, background .15s; }
.imp-drop > i { font-size: 2rem; color: var(--muted); }
.imp-drop:hover, .imp-drop.is-over, .imp-drop:focus-within { border-color: var(--accent); }
.imp-drop.is-over { background: var(--accent-soft); }
.imp-drop[data-state=busy] > i { animation: imp-pulse 1s ease-in-out infinite; }
.imp-drop[data-state=ok] small { color: var(--ok); }
.imp-drop[data-state=error] small { color: var(--accent-2); font-weight: 600; }
.imp-drop[data-state=warn] small { color: var(--accent-2); }
@keyframes imp-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .imp-drop[data-state=busy] > i { animation: none; } }
.imp-textbox { margin-top: 10px; }
.imp-textbox > summary { cursor: pointer; color: var(--muted); font-size: .88rem; padding: 4px 0; }
.imp-text { width: 100%; margin-top: 6px; font: .82rem/1.35 ui-monospace, Consolas, monospace; resize: vertical; }
.imp-meta { margin-top: 12px; }
.imp-meta-2 { margin: 0 0 10px; }
.imp-h { margin: 18px 0 6px; font-size: 1.05rem; }
.imp-table th, .imp-table td { padding: 6px 8px; }
.imp-table .imp-c-name { text-align: left; white-space: normal; min-width: 12rem; font-weight: 600; }
.imp-table .imp-c-name span { display: block; }
.imp-table .imp-c-usr select { min-width: 11rem; max-width: 16rem; min-height: 38px; font-size: .9rem; }
.imp-table .imp-c-st { text-align: left; white-space: normal; }
.imp-alias { margin-top: 4px; min-height: 32px; padding: 2px 8px; font-size: .82rem; }
/* "Neu anlegen": Name des neuen Athleten unter dem Auswahlfeld */
.imp-new { display: block; max-width: 16rem; }
.imp-new[hidden] { display: none; }
.imp-new input { width: 100%; }
.imp-new small { display: block; margin-top: 2px; text-align: left; }
.imp-row.is-off > :not(:first-child):not(.imp-c-usr) { opacity: .5; }
@media (min-width: 768px) { .imp-meta-2 { grid-template-columns: minmax(0, 1fr) 12rem; } }
.scout-list .event-item .badges { flex-wrap: wrap; justify-content: flex-end; }
.scout-list .event-date { white-space: nowrap; }
/* Hinweis "aeltere Wertung" (ContestTypes 'legacy'): im Event-Kopf ein Knopf mit Erklaerung, in Listen ein Badge */
button.badge-legacy { font-family: inherit; cursor: pointer; }
button.badge-legacy:hover { color: var(--text); border-color: var(--muted); }
.event-pick-meta button { position: relative; z-index: 1; }
@media (max-width: 767px) { .event-list .badge-legacy span { display: none; } .event-list .badge-legacy i { margin-right: 0; } }
.scout-list .badge-hidden i { margin-right: 0; }
@media (min-width: 768px) { .scout-list .event-item { grid-template-columns: max-content minmax(0, 1fr) auto 20px; column-gap: 14px; } }
.badge-avg { font-family: var(--font-figures); font-weight: var(--fig-weight); font-size: .9rem; color: var(--text); }
.event-item.is-other { opacity: .6; }
@media (max-width: 767px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scout-table .sc-wide, [data-scout] .scout-table .sc-m.sc-wide { display: none; }
  .sc-modes .seg-bar span { padding: 0 10px; font-size: .88rem; }
  .scout-table th, .scout-table td { padding: 8px 6px; }
  .scout-table .sc-ak-row th { padding: 16px 6px 6px; }
  .sc-spark { width: 44px; height: 18px; margin-left: 5px; }
  .sc-name-ico { display: none; }
  .scout-list .event-item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "date" "name" "badge"; }
  .scout-list .event-item .badges { justify-self: start; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .sc-pt::before, .sc-go i, .sc-name-ico { transition: none; } }

/* Konto-Menue oben rechts (v037): gleiches Muster wie Design-/Sprachmenue */
.account-menu > summary { list-style: none; }
.account-caret { font-size: .7em; opacity: .8; margin-left: -2px; }
.topbar-tools .account-menu { flex: 0 1 auto; min-width: 0; }
.account-menu > .account-link { max-width: 100%; }
.account-list { width: min(270px, 90vw); gap: 2px; }
.account-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: .95rem; }
.account-list a i { width: 18px; text-align: center; color: var(--muted); }
.account-list a:hover, .account-list a:focus-visible { background: var(--surface-2); }
.account-list .account-logout { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 4px; padding-top: 2px; }
.account-who { display: grid; gap: 2px; margin: 2px 10px 6px; }
.account-who small { color: var(--muted); font-size: .8rem; }
@media (max-width: 350px) { .account-caret { display: none; } }

/* ---------- Teams (Teamwettkampf, lib/Teams.php) ---------- */
.ranking.team-ranking { display: grid; max-width: 760px; }
.team-dot { display: inline-block; width: .75em; height: .75em; border-radius: 50%; background: var(--team, var(--accent)); vertical-align: baseline; flex: none; }
.team-ranking .rank-card details { border-left: 5px solid var(--team, var(--accent)); }
.team-ranking .rank-name { white-space: normal; }
.team-line { display: block; font: 400 .82rem var(--font); color: var(--muted); white-space: normal; }
.team-match { display: block; text-align: right; margin: 0 !important; }
.team-won { color: var(--team, var(--accent)); font-size: .8em; }
.disc-name small { display: block; color: var(--muted); font-size: .8rem; }
.result-view-row { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.result-view { margin: 0; }
/* (i) je Disziplin (Formel, Berechnung): klein neben dem Namen */
.disc-i .btn-info { min-height: 0; min-width: 0; width: auto; height: auto; padding: 1px 4px; margin-left: 2px; font-size: .78rem; vertical-align: 1px; border: 0; background: transparent; }
.disc-i .btn-info i { opacity: .7; }
.sheet-info code { font-size: .95rem; white-space: normal; }
/* Teamwertung "Vergleich": je Disziplin die Teams nebeneinander (views/partials/team-results.php) */
.team-cmp-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.team-cmp { border-collapse: separate; border-spacing: 0; width: 100%; }
.team-cmp th, .team-cmp td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.team-cmp thead th { position: sticky; top: 0; background: var(--surface-solid); font-size: .95rem; white-space: nowrap; border-bottom: 3px solid var(--team, var(--line)); }
.team-cmp thead th small { display: block; color: var(--muted); font-size: .74rem; font-weight: 400; }
.team-cmp .tc-disc { text-align: left; font-weight: 600; }
.team-cmp thead .tc-disc { border-bottom-color: var(--line); vertical-align: bottom; }
.tc-pts { display: block; color: var(--pts); font-family: var(--font-figures); font-weight: var(--fig-weight); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tc-by { display: block; color: var(--muted); font-size: .76rem; }
.team-cmp td.is-best { background: color-mix(in srgb, var(--team, var(--accent)) 16%, transparent); box-shadow: inset 3px 0 0 var(--team, var(--accent)); }
.team-cmp td.is-dropped .tc-pts { color: var(--dropped); text-decoration: line-through; }
.team-cmp .tc-none { color: var(--muted); }
.team-cmp tfoot th, .team-cmp tfoot td { border-bottom: 0; border-top: 2px solid var(--line); }
.tc-total { display: block; font-family: var(--font-figures); font-weight: var(--fig-weight); font-size: 1.6rem; }
.result-view-row { flex-wrap: wrap; }
.result-opts { display: flex; gap: 6px; margin-left: auto; }                 /* Umschalter rechts */
.segmented-sm a { min-height: 36px; padding: 0 12px; font-size: .88rem; }
@media (max-width: 767px) { .opt-label { display: none; } }
/* AK 7/8: Station gilt fuer diesen Turner nicht (andere AK) - abgedunkelt, ohne Strich */
.results-table td.is-na { background: repeating-linear-gradient(135deg, rgba(0,0,0,.42) 0 6px, rgba(0,0,0,.3) 6px 12px); }
.result-group + .result-group { margin-top: calc(var(--gap) * 1.5); }
/* Titel eines AK-Blocks: gut lesbar ueber der Tabelle (die allgemeine .group-title ist dafuer zu klein) */
.result-group-title { margin: 0 0 10px; font-size: 1.45rem; line-height: 1.15; letter-spacing: .04em; }
.result-group-title small { margin-left: 8px; font-size: .62em; font-weight: 600; letter-spacing: .08em; }
@media (max-width: 600px) { .result-group-title { font-size: 1.25rem; } }
/* Kompakt: je Athlet eine Karte mit umbrechenden Stations-Kacheln */
.rc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rc-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.rc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.rc-name a, .rc-name .anon-name { font: 700 1.08rem var(--font); text-decoration: none; }
.rc-total { margin-left: auto; font-family: var(--font-figures); font-weight: var(--fig-weight); font-size: 1.3rem; color: var(--pts); white-space: nowrap; }
.rc-total small { font-size: .7rem; color: var(--muted); font-family: var(--font); font-weight: 400; }
.rc-cells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.rc-cells li { display: grid; gap: 2px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.rc-disc { font-size: .74rem; color: var(--muted); line-height: 1.25; }
.rc-vals { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.rc-vals .v { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-vals .v small { margin-left: 2px; font-size: .7rem; }
.rc-vals .p { margin-left: auto; color: var(--pts); font-family: var(--font-figures); font-weight: var(--fig-weight); font-size: 1.05rem; }
.rc-cells li.is-missing { opacity: .5; }
.rc-cells li.is-dropped .p { color: var(--dropped); text-decoration: line-through; }
.duel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 760px; margin: 0 0 12px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.duel-team { font-weight: 700; overflow-wrap: anywhere; }
.duel-team:last-child { text-align: right; }
.duel-score { font: 400 1.9rem var(--font-num); white-space: nowrap; }
.team-modes { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-bottom: 12px; }
.team-card { border: 1px solid var(--line); border-top: 5px solid var(--team, var(--accent)); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.team-rename { display: flex; align-items: center; gap: 8px; }
.team-rename input { flex: 1; min-width: 0; font-weight: 700; }
.team-members { list-style: none; margin: 8px 0; padding: 0; }
.team-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.team-add { display: flex; gap: 8px; }
.team-add select { flex: 1; min-width: 0; }
.entry-team { color: var(--team, var(--accent)); }
.entry-list li.is-dimmed .entry-row { opacity: .5; }
.entry-group .team-dot { margin-right: 4px; }

/* Umschalter Oeffentlich | Admin/Trainer/Judge in der Kopfzeile (layout.php, $viewSwitch): zwei Teile in einer Pille,
   die aktive Ansicht ist gefuellt. Schmal: nur Symbole. */
.view-switch { flex: none; display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--input-bg); }
.view-switch a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.view-switch a[href]:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.view-switch a.is-active { background: var(--accent); color: var(--on-accent); cursor: default; }
@media (max-width: 1399px) {
  .view-switch a { padding: 0 10px; }
  .view-switch a span { display: none; }
}
/* Platz fuer den Umschalter im oeffentlichen Bereich (Tablet/Laptop): Navigation zeigt nur beim aktiven Punkt die
   Beschriftung – wie im Trainer-Bereich mit Event-Auswahl. Ohne das lief die Kopfzeile fuer Admin/Trainer ueber. */
@media (min-width: 768px) and (max-width: 1899px) {
  .area-public .topbar:has(.view-switch) .nav-top a:not(.is-active) span { display: none; }
  .area-public .topbar:has(.view-switch) .nav-top a:not(.is-active) { padding: 0 12px; }
}
/* Sechs und mehr Reiter (Sichter: Sichtung + Import): ebenfalls nur der aktive Punkt mit Beschriftung, sonst wird das Konto verdraengt */
@media (min-width: 768px) and (max-width: 1399px) {
  .area-public .nav-top:has(> a:nth-child(6)) a:not(.is-active) span { display: none; }
  .area-public .nav-top:has(> a:nth-child(6)) a:not(.is-active) { padding: 0 12px; }
}
@media (max-width: 600px) {
  .view-switch a { min-height: 30px; padding: 0 8px; }
  /* Platz: die Rolle steht im Umschalter, das Konto zeigt nur das Symbol */
  .topbar-tools:has(.view-switch) .account-link.is-on > span, .topbar-tools:has(.view-switch) .account-link .account-caret { display: none; }
  /* Trainer-Bereich: nur der Wechsel zur oeffentlichen Ansicht (die Rolle steht unter dem Logo), damit die Event-Auswahl lesbar bleibt */
  .area-trainer .view-switch a.is-active { display: none; }
}
@media (max-width: 379px) {
  .view-switch a.is-active { display: none; }
  .topbar-tools:has(.view-switch) { gap: 4px; }
}
/* Event-Auswahl in der Kopfzeile (Menue wie Design/Sprache; partials/topbar-event.php) */
.topbar-tools:has(.topbar-event) { flex: 1 1 auto; justify-content: flex-end; }
.topbar-event { flex: 0 1 300px; min-width: 0; }
.event-btn { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 12px 0 14px; color: var(--text); }
.event-btn > .fa-calendar-check { color: var(--accent-2); }
.event-btn-text { display: grid; min-width: 0; flex: 1; line-height: 1.15; text-align: left; }
.event-btn-text b, .event-btn-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-btn-text b { font-size: .84rem; font-weight: 600; }
.event-btn-text small { font-size: .7rem; color: var(--muted); }
.event-btn .account-caret { margin-left: auto; }
.event-list-menu { width: min(400px, 92vw); gap: 0; padding: 8px 6px; }
.event-list-menu .theme-list-title small { text-transform: none; letter-spacing: 0; }
.event-filter { min-height: 38px; margin: 2px 4px 6px; width: auto; border-radius: 999px; padding: 0 14px; font-size: .9rem; }
.event-year { position: sticky; top: -8px; z-index: 1; margin: 6px 0 2px; padding: 4px 10px; font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; color: var(--muted); background: var(--surface-solid); }
.event-opts a {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  min-height: 40px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.event-opts a:hover, .event-opts a:focus-visible { background: var(--surface-2); }
.event-opts a[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.event-opt-date { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.event-opt-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-opts a:hover .event-opt-name { white-space: normal; }
.event-opt-tags { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.event-opt-tags .pill { font-size: .66rem; }
.event-opts [hidden] { display: none; }
.event-none { margin: 8px 10px; color: var(--muted); font-size: .9rem; }
/* Oeffentlich nur, wo Platz ist (Handy/Tablet: Auswahl im Seitenkopf der Ergebnisse) */
.area-public .topbar-event { display: none; }
@media (min-width: 1200px) { .area-public .topbar-event { display: block; } }
/* Platz fuer die Auswahl: Navigation zeigt nur beim aktiven Punkt die Beschriftung (Rest: Icon + Tooltip) */
@media (min-width: 768px) and (max-width: 1599px) {
  .area-trainer .topbar:has(.topbar-event) .nav-top a:not(.is-active) span { display: none; }
  .area-trainer .topbar:has(.topbar-event) .nav-top a:not(.is-active) { padding: 0 12px; }
}
@media (min-width: 768px) { .topbar:has(.topbar-event) .nav-top { flex-shrink: 0; } }
@media (max-width: 600px) {
  .topbar:has(.topbar-event) { gap: 8px; }
  .event-btn > .fa-calendar-check, .event-btn-text small { display: none; }
  .event-btn { padding: 0 10px 0 14px; }
}

/* ---------- Sichtung: Entwicklung AK 7-9 (views/public/scout-dev.php, v094) ----------
   Je Jahr und AK: Punkt am Ø, helles Band bis zum Bestwert, Strich am Bestwert. AK-Farben = Diagramm-Slots 1-3
   (geprueft: CVD und Kontrast gegen die dunkle Flaeche; arena mit den hellen Stufen). */
:root { --ak7: #3987e5; --ak8: #d95926; --ak9: #199e70; }
[data-theme="arena"] { --ak7: #2a78d6; --ak8: #eb6834; --ak9: #1baf7a; }
.dv-ak7 { --c: var(--ak7); } .dv-ak8 { --c: var(--ak8); } .dv-ak9 { --c: var(--ak9); }
.dv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.dv-head h1 { margin: 0; }
.dv-head .sc-links { flex-basis: 100%; }
.dv-sw { background: var(--c); }
.dv-root[data-view="lines"] .dv-panels, .dv-root[data-view="panels"] .dv-lines { display: none; }
.dv-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dv-svg polyline { stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* Marke: 24 px breite Trefferflaeche, 6 px Luft ober- und unterhalb (padding), Band 6 px breit */
.dv-m { position: absolute; box-sizing: content-box; width: 24px; padding: 6px 0; margin: 0 0 -6px -12px; outline: none; border-radius: 6px;
  background: linear-gradient(to right, transparent 9px, color-mix(in srgb, var(--c) 38%, transparent) 9px 15px, transparent 15px) content-box; }
.dv-m::before { content: ""; position: absolute; left: 50%; bottom: 6px; width: 10px; height: 10px; transform: translate(-50%, 50%); border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 2px var(--surface-solid); transition: transform .12s; }
.dv-m::after { content: ""; position: absolute; left: 50%; top: 6px; width: 14px; height: 2px; transform: translate(-50%, -50%); border-radius: 1px; background: var(--c); }
.dv-m:hover::before, .dv-m:focus-visible::before { transform: translate(-50%, 50%) scale(1.5); }
.dv-m:focus-visible { box-shadow: 0 0 0 2px var(--accent-2); }
.dv-key { position: relative; display: inline-block; width: 12px; height: 16px;
  background: linear-gradient(to right, transparent 4px, color-mix(in srgb, var(--muted) 45%, transparent) 4px 8px, transparent 8px); }
.dv-key::before { content: ""; position: absolute; left: 1px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dv-key::after { content: ""; position: absolute; left: 0; top: -1px; width: 12px; height: 2px; background: var(--muted); }
.dv-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.dv-panel { --chart-h: 160px; }
.dv-panel-title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: .9rem; }
.dv-panel-title .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dv-none { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: .85rem; }
.dv-table { margin-top: 12px; }
.dv-table summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.dv-table th small { display: block; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
@media (max-width: 599px) { .dv-panels { grid-template-columns: minmax(0, 1fr); } .dv-panel { --chart-h: 130px; } }
@media (prefers-reduced-motion: reduce) { .dv-m::before { transition: none; } }

/* ---------- Kraftprogramme (views/public/strength*.php, assets/strength.js, v095) ---------- */
.page-strength .main { max-width: 980px; }
.page-strength .main:has(.st-ex-table, .st-view-table) { max-width: 1400px; }   /* Uebungen + Programm-Ansicht: lange Namen ohne Querscrollen */
/* Kraft-Tabellen: volle Breite statt max-content (Ergebnistabellen), damit lange Uebungsnamen umbrechen */
.st-ex-table, .st-view-table, .anim-table { width: 100%; }
.st-head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.st-head-grid { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); align-items: end; }
.st-head-grid .st-f-name { grid-column: 1; }
.st-head-grid .st-f-note { grid-column: 1 / span 3; }
.st-head-grid .st-f-share { grid-column: 4; align-self: center; font-size: .88rem; }
.st-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.st-item { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.st-item-head { display: flex; align-items: center; gap: 10px; }
.st-item-head select { flex: 1 1 auto; min-width: 0; }
.st-pos { flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-weight: 700; font-size: .85rem; }
.st-item-work { flex: none; display: grid; justify-items: end; line-height: 1.1; min-width: 3.2em; }
.st-item-work b { font-family: var(--font-figures); font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.st-item-work small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.st-tools { flex: none; display: flex; }
.st-tools .btn-icon { width: 34px; min-height: 34px; }
.st-item-body { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; }
.st-modes { flex: none; }
.st-modes span { padding: 6px 10px; font-size: .85rem; }
.st-nf { display: grid; gap: 2px; font-size: .78rem; color: var(--muted); }
.st-nf[hidden] { display: none; }
.st-nf input { width: 5.2em; }
.st-vals { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.st-val { display: grid; gap: 2px; justify-items: center; font-size: .7rem; color: var(--muted); }
.st-val input { width: 3.6em; text-align: center; padding-left: 4px; padding-right: 4px; font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
.st-val input[readonly] { background: transparent; border-color: transparent; color: var(--text); }
.st-unit { color: var(--muted); font-size: .8rem; padding-bottom: 10px; }
.st-add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Summenleiste: bleibt unten stehen (ueber der Handy-Navigation) */
.st-bar { position: sticky; bottom: 10px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: var(--gap);
  padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface-solid); box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.st-sum { display: grid; line-height: 1.15; }
.st-sum b { font: var(--fig-weight) 1.45rem/1.1 var(--font-figures); font-variant-numeric: tabular-nums; }
.st-sum small { font-size: .74rem; }
.st-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.st-ex-table .st-c-name, .st-view-table .st-c-name { text-align: left; white-space: normal; min-width: 9rem; }
.st-view-table .st-c-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.st-view-table tfoot td, .st-view-table tfoot th { border-top: 1px solid var(--line); }
.st-actions { white-space: nowrap; text-align: right; }
.st-actions .btn-icon { width: 36px; min-height: 36px; }
.st-actions .is-on { color: var(--accent-2); }
.st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-kpi-small { font-size: 1.3rem; }
@media (max-width: 767px) {
  .st-bar { bottom: calc(var(--bottom-nav) + 8px + env(safe-area-inset-bottom)); }
}
@media (max-width: 599px) {
  .st-head-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-head-grid .st-f-name, .st-head-grid .st-f-note, .st-head-grid .st-f-share { grid-column: 1 / -1; }
  .st-tools .btn-icon { width: 30px; }
  .st-item-head { flex-wrap: wrap; }
  .st-item-head select { order: 5; flex-basis: 100%; }
  .st-item-work { margin-left: auto; }
  .st-kpis { grid-template-columns: minmax(0, 1fr); }
}

/* Meine Trainings: Loeschen direkt in der Liste (v096) */
.tr-row { display: flex; align-items: center; gap: 6px; }
.tr-row .event-item { flex: 1 1 auto; min-width: 0; }
.tr-row .tr-del { flex: none; color: var(--muted); }
.tr-row .tr-del:hover { color: var(--accent-2); }
/* Uebungs-Dialog (Kraftprogramme): Kopf, Vorschlag, Name und Einheit ueber die ganze Breite */
[data-st-ex-form] > .pad-head { grid-template-columns: minmax(0, 1fr) auto; }
[data-st-ex-form] > .pad-head, [data-st-ex-form] > .st-wide { grid-column: 1 / -1; }
[data-st-ex-form] .seg-bar span { white-space: normal; }

/* ---------- Kraftprogramme: Schwierigkeit (Sparta-Helme), Regler, Start, Training abhaken, Druck (v097) ---------- */
.hm-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hm-row { display: inline-flex; align-items: center; gap: 3px; line-height: 0; }
.hm { width: 30px; height: 30px; flex: none; }
.hm-sm .hm { width: 16px; height: 16px; }
.hm-sm { gap: 1px; margin-right: 4px; }
.hm-bg { fill: color-mix(in srgb, var(--muted) 30%, transparent); }
.hm-fg { fill: var(--accent); }
.hm.is-half .hm-fg { clip-path: inset(0 50% 0 0); }
.hm.is-empty .hm-fg { display: none; }
.st-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-kpi-level .hm-row { margin: 4px 0 2px; }
.st-kpi-level .kpi-note b { color: var(--text); }
.st-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.st-adjust > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.st-adjust > summary::-webkit-details-marker { display: none; }
.st-adjust > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.st-adjust[open] > summary::after { transform: rotate(180deg); }
.st-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; margin-top: 14px; }
.st-range { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.st-range output { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }
.st-range input[type=range] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.st-adj-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.st-sliders .small-note { grid-column: 1 / -1; margin: 0; }
.print-only { display: none; }
/* Training aus einem Kraftprogramm: je Runde die Uebungen zum Abhaken */
.pg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pg-set { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto 3.4em; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .15s, background .15s; }
.pg-set.is-done { border-color: color-mix(in srgb, var(--chart-training) 70%, transparent); background: color-mix(in srgb, var(--chart-training) 14%, var(--surface-2)); }
.pg-set.is-error { border-color: var(--accent-2); }
.pg-set.is-saving { opacity: .7; }
.pg-check { position: relative; display: grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.pg-check input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.pg-check span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--muted); color: transparent; transition: background .12s, border-color .12s; }
.pg-check input:checked + span { background: var(--chart-training); border-color: var(--chart-training); color: #fff; }
.pg-check input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.pg-name { font-weight: 700; min-width: 0; }
.pg-name small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.pg-val { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.pg-val input { width: 4.4em; text-align: center; font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
.pg-set.is-changed .pg-val input { border-color: var(--accent-2); }
.pg-work { text-align: right; font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-sliders { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-set { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .pg-work { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pg-set, .pg-check span, .st-adjust > summary::after { transition: none; } }

/* ---------- Drucken / PDF (bisher nur Kraftprogramme): nur der Inhalt, hell, Helme rot ---------- */
@media print {
  @page { size: A4 portrait; margin: 14mm 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }
  :root { --text: #000; --muted: #555; --line: #bbb; --surface: #fff; --surface-2: #fff; --surface-solid: #fff; }
  .topbar, .nav-top, .nav-bottom, .toast, .no-print, .st-head-actions, .btn-info, .sheet { display: none !important; }
  body { padding: 0 !important; }
  .main { max-width: none !important; width: 100% !important; padding: 0 !important; }
  .print-only { display: inline; }
  .card, .kpi { background: #fff !important; border: 1px solid #bbb !important; box-shadow: none !important; backdrop-filter: none !important; break-inside: avoid; }
  .page-head h1 { color: #000; text-shadow: none; }
  .hm-row, .hm, .kpi-main { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hm-fg { fill: #c8102e; }
  .hm-bg { fill: #ddd; }
  .scout-wrap { overflow: visible !important; }
  .st-view-table { width: 100%; border-collapse: collapse; }
  .st-view-table th, .st-view-table td { border: 1px solid #999; color: #000; padding: 6px 8px; }
  .st-view-table tr { break-inside: avoid; }
  .st-view-table td.st-r::after { content: "  \2610"; font-size: 1.15em; }
  .muted, small { color: #444 !important; }
}

/* Aktiv im Turnzentrum (Trainer-Listen, v098): Knopf je Zeile, Inaktive gedaempft */
.active-btn { color: var(--ok); }
.active-btn.is-off { color: var(--muted); }
.athlete-row[data-active="0"] .athlete-name { opacity: .65; }
.badge-inactive { gap: 5px; }
.badge-inactive small { font-weight: 400; opacity: .8; }

/* Strichmaennchen-Animation je Kraftuebung (views/partials/figure.php, assets/figure3d.js, Migration 22) */
.fig-btn.btn-icon { width: 32px; min-height: 32px; height: 32px; padding: 0; vertical-align: middle; color: #8fb6ff; font-size: .95rem; }
.fig-btn:hover, .fig-btn:focus-visible { color: #cfe0ff; }
.pg-name .fig-btn { margin: -6px 0 -6px 2px; }
dialog.fig-sheet { width: min(560px, calc(100% - 24px)); }
.fig-sheet > .pad-head { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 10px; }
.fig-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: min(70vh, 560px); margin: 0 auto; border-radius: var(--radius-sm); overflow: hidden; background: #0a1020; }
.fig-stage canvas, .st-fig-preview canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.fig-stage canvas:active, .st-fig-preview canvas:active { cursor: grabbing; }
.fig-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 0; font-size: .85rem; }
.st-fig { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 12px; margin: 0; min-width: 0; }
.st-fig legend { padding: 0 6px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.st-fig-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.st-fig-tools label.btn { cursor: pointer; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.st-fig-drop { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 6px; transition: border-color .15s, background .15s; }
.st-fig-drop.is-over { border-color: #8fb6ff; background: rgba(80, 130, 220, .12); }
.st-fig-drop textarea { width: 100%; min-height: 64px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.st-fig-preview { width: 100%; aspect-ratio: 4 / 3; max-height: 280px; margin-top: 6px; border-radius: var(--radius-sm); overflow: hidden; background: #0a1020; }
.st-fig-msg { margin: 6px 0 0; font-size: .82rem; color: var(--muted); min-height: 1em; }
.st-fig-msg.is-error { color: #ff8a80; }
@media (min-width: 1000px) {   /* Desktop: Uebungs-Dialog breiter, Vorlage links, Vorschau rechts */
  dialog:is(#st-ex-sheet, #anim-sheet):has([data-fe]) { width: min(980px, calc(100% - 48px)); }
  .st-fig-drop:has(.st-fig-preview:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; align-items: stretch; }
  .st-fig-drop:has(.st-fig-preview:not([hidden])) textarea { min-height: 340px; height: 100%; }
  .st-fig-drop .st-fig-preview { margin-top: 0; max-height: none; aspect-ratio: auto; min-height: 340px; }
}
/* Stichworte zur Ausfuehrung unter der Figur (Vorlage "stichworte") */
.fig-cues { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.fig-cues li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(80, 130, 220, .16);
  border: 1px solid rgba(143, 182, 255, .35); color: #dbe7ff; font-weight: 700; font-size: .95rem; }
.fig-cues li::before { content: "\2713"; color: #8fb6ff; font-weight: 900; }
.fig-cues[hidden] { display: none; }
/* Trainer: Animationen aller Uebungen (views/trainer/anims.php) */
.badge-ok { background: rgba(63, 185, 80, .16); color: #8fe39b; }
.anim-admin .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.anim-admin .toolbar .search { flex: 1 1 260px; }
.anim-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 8px; font-size: 1.1rem; }
.anim-table .anim-group th { text-align: left; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 16px; }
.anim-table td:nth-child(2) { width: 170px; white-space: nowrap; }
.anim-table .st-actions { width: 130px; text-align: right; }
.anim-table .st-c-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
[data-anim-form] > .pad-head { grid-template-columns: minmax(0, 1fr) auto; }
[data-anim-form] > * { grid-column: 1 / -1; }
.fig-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.fig-name .fig-btn { margin: -6px 0; }
.fig-link { margin: 0 0 6px; }
.pad-who-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pad-who-row h2 { min-width: 0; }
.pad-who-row .fig-btn { flex: 0 0 auto; }
/* Wertung zur Animation (assets/figure-score.js): Chips + aufklappbare Formel */
.fig-score { margin: 10px 0 0; }
.fig-score[hidden] { display: none; }
.fig-score-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.fig-score-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 200, 80, .12);
  border: 1px solid rgba(255, 200, 80, .35); color: #ffe2a6; font-weight: 700; font-size: .9rem; }
.fig-score-chips li i { color: #ffc850; }
.fig-score-more { margin-top: 8px; font-size: .88rem; }
.fig-score-more summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.fig-score-more code { display: inline-block; margin: 6px 0 2px; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .07); font-size: .95rem; }
.fig-score-more p { margin: 4px 0 0; color: var(--muted); }
.anim-admin .toolbar select { flex: 0 1 340px; min-width: 0; }
/* Kraft-Pille neben "300 = Shirt" (views/layout.php): gleiche Form, Stahl -> Bronze, ruhiger Glow */
.brand-kraft {
  gap: 8px; height: 42px; margin-left: 8px; padding: 0 15px 0 13px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, #34465f 0%, #6b6f78 48%, #b8894a 100%); color: #fff;
  font: 400 1.18rem/1 var(--font-display); letter-spacing: .05em; text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(255,255,255,.16) inset, 0 0 14px rgba(184, 137, 74, .45);
  animation: kraft-glow 3.6s ease-in-out infinite;
}
.brand-kraft i { font-size: 1.25rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.brand-kraft:hover, .brand-kraft:focus-visible { color: #fff; filter: brightness(1.15); }
.brand-kraft.is-active { box-shadow: 0 0 0 2px rgba(255,255,255,.7) inset, 0 0 18px rgba(214, 170, 100, .75); }
@keyframes kraft-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.16) inset, 0 0 10px rgba(184, 137, 74, .35); }
  50%      { box-shadow: 0 0 0 2px rgba(255,255,255,.24) inset, 0 0 20px rgba(214, 170, 100, .7); }
}
.brand-kraft.is-active { animation: none; }
@media (prefers-reduced-motion: reduce) { .brand-kraft { animation: none; } }
@media (max-width: 479px) {   /* Handy: nur die Hantel */
  .brand-kraft { width: 42px; padding: 0; justify-content: center; margin-left: 6px; }
  .brand-kraft-text { display: none; }
}
/* Animation prominent: eigene Spalte (Programm-Ansicht, Uebungen) bzw. Knopf in der Abhakliste (views/partials/figure.php fig_cta) */
.fig-cta { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, #1d3d6e 0%, #2f6fd0 100%); border: 1px solid rgba(143, 182, 255, .55); color: #eef4ff; font-weight: 700; font-size: .9rem;
  box-shadow: 0 0 12px rgba(80, 140, 255, .28); }
.fig-cta i { font-size: 1.05rem; color: #cfe0ff; }
.fig-cta:hover, .fig-cta:focus-visible { filter: brightness(1.18); color: #fff; }
.st-c-anim { width: 1%; white-space: nowrap; text-align: center; }
.pg-fig:empty { display: none; }
@media (max-width: 599px) {   /* Handy: nur das Symbol */
  .fig-cta { width: 42px; padding: 0; justify-content: center; }
  .fig-cta span { display: none; }
}
@media print { .st-c-anim { display: none; } }
.st-view-table thead th, .st-ex-table thead th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
/* Klick aufs 3D-Bild = Abspielen/Pause: kurzes Symbol mittig (assets/figure3d.js) */
.st-fig-preview { position: relative; }
.fig-flash { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(10, 16, 32, .55); color: #fff; font-size: 1.6rem; opacity: 0; pointer-events: none; }
.fig-flash.is-on { animation: fig-flash .6s ease-out; }
@keyframes fig-flash { 0% { opacity: .95; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .fig-flash.is-on { animation: none; } }

/* ---------- Erfassen-Fokus (layout.php $focus, trainer/entry.php) ----------
   Beim Eintragen nur: Zurueck zum Menue · grosses Event-Menue · Athlet|Station. Keine Navigation, Pillen, Design, Konto. */
body.is-focus { padding-bottom: env(safe-area-inset-bottom); }
.topbar-focus { gap: 8px; }
.focus-exit { flex: none; color: var(--text); }
.topbar-focus .topbar-event, .topbar-focus .event-btn.is-static { flex: 1 1 auto; min-width: 0; max-width: 640px; margin-inline: auto; }
.topbar-focus .event-btn { min-height: 46px; border-color: var(--accent); }
.topbar-focus .event-btn > .fa-calendar-check, .topbar-focus .event-btn-text small { display: revert; }
.topbar-focus .event-btn-text b { font-size: 1rem; }
.topbar-focus .event-btn-text small { display: block; }
.topbar-focus .event-btn.is-static { cursor: default; }
/* Liste unter der ganzen Kopfzeile, mittig (backdrop-filter macht die Kopfzeile zum Bezug fuer position: fixed) */
.topbar-focus .event-list-menu { position: fixed; top: calc(100% + 6px); left: 8px; right: 8px; width: auto; max-width: 520px; margin-inline: auto;
  max-height: calc(100dvh - 90px); }
.topbar-focus .event-opts a { min-height: 46px; }
.focus-mode { flex: none; border-radius: 999px; }
.focus-mode a { gap: 6px; min-height: 44px; padding: 0 14px; }
.entry-head { margin: 0 0 10px; }
.entry-head p { margin: 0; font-size: .9rem; }
/* AK deutlich: eigene Farbe je AK (Erfassen, Uebung, Kacheln) */
.ak-badge[data-ak] { color: #fff; background: #5b6472; }
.ak-badge[data-ak="7"] { background: #2563eb; }
.ak-badge[data-ak="8"] { background: #d97706; }
.ak-badge[data-ak="9"] { background: #16a34a; }
.ak-badge[data-ak="10"] { background: #9333ea; }
.ak-badge[data-ak="11"] { background: #0d9488; }
.ak-badge[data-ak="12"] { background: #db2777; }
.ak-badge[data-ak="13"] { background: #b45309; }
.ak-badge[data-ak="14"] { background: #dc2626; }
.ak-badge-lg { margin-left: 0; padding: .2em .6em; font-size: .95rem; letter-spacing: .02em; }
.entry-athlete .ak-badge[data-ak] { font-size: .85rem; padding: .15em .55em; }
.tc-ak .ak-badge { margin-left: 0; font-size: .75rem; }
@media (max-width: 600px) {
  .focus-exit span, .focus-mode a span { display: none; }
  .focus-exit { padding: 0; width: 44px; }
  .focus-mode a { padding: 0 12px; }
  .topbar-focus .event-btn { padding: 0 10px 0 12px; }
  .topbar-focus .event-btn > .fa-calendar-check { display: none; }
  .topbar-focus .event-btn-text b { font-size: .92rem; }
}

/* ---------- Erfassen am Tablet (trainer/entry.php): Station = Messkarte + Kacheln, Uebung = DTB-Vorgaben ----------
   Ziel iPad hoch (810x1000) und quer (1080x740): die Seite scrollt nicht, nur Kachelfeld bzw. Liste intern. */
.station-nav.has-extra { grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap) auto; }
/* Auswahl linksbuendig (zentriert wirkt die lange Liste unruhig) */
.station-nav .select-lg { text-align: left; text-align-last: left; padding-left: 14px; }
.station-nav .select-lg option { text-align: left; }
[data-station-grid-toggle].is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
/* Alle Stationen als Kacheln (Station/Uebung): ersetzt den Inhalt, bis eine Station gewaehlt ist */
.station-grid { margin: 0 0 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); align-content: start; overscroll-behavior: contain; }
.station-grid[hidden] { display: none; }
.station-grid .st-img { height: 84px; }
.station-grid .st-img img { object-fit: contain; object-position: center; }
.entry-panel.is-grid > :not(.station-nav):not(.station-grid) { display: none !important; }
.station-nav { margin-bottom: 10px; }
.station-extra { display: flex; gap: 6px; align-items: center; }
.station-extra .fig-btn { width: var(--tap); height: var(--tap); }
.station-thumb {
  display: grid; place-items: center; width: 72px; height: var(--tap); border-radius: var(--radius-sm); overflow: hidden;
  background: #fff; border: 1px solid var(--line); color: #333; text-decoration: none;
}
.station-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.entry-list-data { display: none !important; }   /* Datenquelle; sichtbar sind die Kacheln */
/* Messkarte kompakt */
.entry-station .timer-card { margin: 0; display: flex; flex-direction: column; border: 0; background: none; box-shadow: none; }
.entry-station .timer-card.is-running { box-shadow: none; }
.entry-station .tc-body { flex: none; padding: 0 0 10px; gap: 8px; }
.entry-station .tc-top { flex-wrap: nowrap; gap: 8px; }
.entry-station .tc-mode { flex: none; }
.entry-station .tc-presets { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.entry-station .tc-presets .chip { flex: none; }
.tc-more { position: relative; flex: none; }
.tc-more > summary { list-style: none; padding: 0; color: var(--text); }
.tc-more > summary::-webkit-details-marker { display: none; }
.tc-more[open] > summary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.tc-more-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(460px, calc(100vw - 32px));
  display: grid; gap: 10px; padding: 14px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0,0,0,.55);
}
.tc-help { margin: 0; color: var(--muted); font-size: .9rem; }
.tc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px; align-items: center; }
.entry-station .tc-clock { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 0; }
.entry-station .tc-clock output { display: inline-block; font-size: clamp(2.6rem, 8vw, 4.2rem); }
.entry-station .tc-clock > span { font-size: .75rem; }
.entry-station .tc-start, .entry-station .tc-controls [data-tc-reset] { min-height: 56px; }
.timer-card:not(.is-running) .tc-boost-run { display: none; }
.tc-hint:empty { display: none; }
@media (max-width: 700px) { .entry-station .tc-mode span { display: none; } .tc-row { grid-template-columns: minmax(0, 1fr); } }
/* Kacheln: Tipp = eintragen, Haken oben rechts = Auswahl fuer den gemeinsamen Start */
.entry-station .tc-tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); align-content: start; padding: 2px; overscroll-behavior: contain;
}
.entry-station .tc-tiles.is-heat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tc-tile { min-height: 96px; }
.tc-tiles:not(.is-heat) .tc-tile { justify-items: start; text-align: left; padding: 10px 12px; }
.tc-tiles:not(.is-heat) .tc-name { padding-right: 30px; }
.tc-tiles:not(.is-heat) .tc-sub { justify-content: flex-start; }
.tc-pick { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.tc-pick i {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center;
  font-size: .75rem; color: transparent; background: var(--surface-2);
}
.tc-tile.is-selected .tc-pick i { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.tc-ak { color: var(--muted); font-size: .8rem; line-height: 1.2; }
.tc-tile.has-team { border-left: 5px solid var(--team); }
.tc-tile.is-dimmed { opacity: .5; }
.tc-team { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); }
/* Uebung: je Variante (AK) Titel, Vorgabe, DTB-Ausschnitt; antippen = gross */
.ex-blocks { display: grid; gap: 12px; }
.ex-block { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 4px; min-height: 0; }
.ex-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 1.05rem; }
.ex-desc { margin: 0; display: grid; color: var(--muted); font-size: .9rem; }
.ex-desc b { color: var(--text); }
.ex-imgs { display: grid; gap: 6px; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
.ex-imgs a { display: block; min-height: 0; background: #fff; border-radius: 8px; padding: 4px; cursor: zoom-in; }
.ex-imgs img { display: block; width: 100%; height: auto; max-height: 60dvh; object-fit: contain; }
/* Feste Hoehe (nicht auf sehr niedrigen Bildschirmen, z. B. Handy quer): Seite steht, innen scrollt nur Liste/Kachelfeld */
@media (min-height: 560px) {
  body.is-focus { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  body.is-focus > .main { flex: 1 1 auto; min-height: 0; width: min(100%, 1400px); display: flex; flex-direction: column;
    padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.is-focus > .main > .main-block { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.is-focus .main-block > :not(.entry-panel),
  body.is-focus .entry-panel > :not(.entry-list):not(.timer-card):not(.ex-blocks):not(.station-grid) { flex: none; }
  body.is-focus .entry-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.is-focus .entry-panel > .entry-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
  body.is-focus .entry-panel > .actions { margin-top: 10px; }
  .entry-station .timer-card { flex: 1 1 auto; min-height: 0; }
  .entry-station .tc-tiles { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .station-grid { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
  .ex-blocks { flex: 1 1 auto; min-height: 0; grid-template-rows: repeat(var(--n, 1), minmax(0, 1fr)); }
  .ex-imgs a { display: flex; justify-content: center; }
  .ex-imgs img { width: 100%; height: 100%; max-height: none; }
}
@media (min-height: 560px) and (orientation: landscape) {
  .ex-blocks { grid-template-rows: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

/* Kinder-Ansicht "Leistungen" (?p=me-perf, v115) */
.perf-note { display: flex; align-items: center; gap: .4rem; margin: .25rem 0 .75rem; }
.perf-note .btn-info { flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; }
.kid-privacy { padding: .6rem .8rem; border-radius: var(--radius, 10px); border: 1px solid var(--accent); }
/* Erfassen je Athlet: eine Zeile je Station – Symbolbild (richtige Lage) · Code · Titel · Zusatz | Wert | Pkt */
/* rechts: Wert ueber Punkten (eine Spalte), damit der Titel Platz hat; Punkte-Stationen nur Punkte */
.entry-row-line { grid-template-columns: minmax(0, 1fr) 70px; grid-template-rows: auto auto; column-gap: 8px; row-gap: 0; min-height: 48px; padding: 3px 10px 3px 6px; }
.entry-row-line .entry-name { grid-row: 1 / 3; }
.entry-row-line .entry-val { grid-column: 2; grid-row: 1; align-self: end; line-height: 1.15; }
.entry-row-line .entry-pts { grid-column: 2; grid-row: 2; align-self: start; line-height: 1.15; }
.entry-row-line.is-points .entry-pts { grid-row: 1 / 3; align-self: center; }
.entry-row.is-points .entry-val { display: none; }
.entry-row-line .entry-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.entry-thumb { flex: none; width: 46px; height: 38px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.entry-code {
  flex: none; min-width: 2.3em; padding: .1em .35em; border-radius: 6px; text-align: center;
  background: var(--surface); color: var(--accent-2); font-size: .85rem;
}
.entry-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.entry-title small { color: var(--muted); font-weight: 400; font-size: .82rem; }
.entry-row-line .entry-val b, .entry-row-line .entry-pts b { font-size: 1.05rem; }
.entry-row-line.is-points .entry-pts b { font-size: 1.2rem; }
/* Station: Kopfzeile je AK (AK 8 · 2b Spagat …) */
.tc-akhead { color: var(--text); text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 700; margin-top: 6px; }
.tc-akhead:first-child { margin-top: 0; }
.entry-list:has(.entry-row-line) { gap: 5px; }

/* Stufen-Regler im Vollbild (#fig-sheet.is-full, assets/figure-regler.js): Farbstufen 10..0 (Punkte), Buehne | Panel */
:root { --lv-10: #22c55e; --lv-8: #84cc16; --lv-6: #eab308; --lv-4: #f97316; --lv-2: #ef4444; --lv-0: #f05252; }
[data-theme="arena"] { --lv-10: #15803d; --lv-8: #4d7c0f; --lv-6: #a16207; --lv-4: #c2410c; --lv-2: #b91c1c; --lv-0: #991b1b; }
/* Buehne ist immer dunkel: Strahlen/Labels mit hellen Stufenfarben (figure-regler.js liest sie hier aus) */
.fig-stage { --lv-10: #22c55e; --lv-8: #84cc16; --lv-6: #eab308; --lv-4: #f97316; --lv-2: #ef4444; --lv-0: #ff5a5a; }
.fig-tools, .fig-test { display: none; }
.fig-regler[hidden] { display: none; }
dialog.sheet.fig-sheet.is-full[open] {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; overflow: hidden;
  display: grid; grid-template: "head head" auto "stage panel" minmax(0, 1fr) / minmax(0, 1fr) min(380px, 38vw); gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.fig-sheet.is-full > .pad-head { grid-area: head; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px; margin: 0; min-width: 0; }
.fig-sheet.is-full .fig-test { display: inline-block; vertical-align: middle; font-size: .7rem; }
.fig-sheet.is-full .fig-tools { display: flex; align-items: center; gap: 2px; }
.fig-tools .btn-icon { width: 40px; min-height: 40px; height: 40px; }
.fig-tools [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-2); }
/* Darstellung Strichmaennchen / Koerper m/w (views/partials/figure.php, rechts in der Leiste unter dem Bild) */
.fig-body { margin-left: auto; display: inline-flex; gap: 2px; }
.fig-body .btn-icon { width: 34px; min-height: 34px; height: 34px; }
.fig-body [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-2); }
@media (max-width: 420px) {   /* Handy: Titel bekommt mehr Platz */
  .fig-sheet.is-full .fig-tools { gap: 0; }
  .fig-tools .btn-icon { width: 34px; min-height: 34px; height: 34px; }
}
.fig-sheet.is-full .fig-stage { grid-area: stage; width: 100%; height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; touch-action: none; }
.fig-sheet.is-full .fig-regler { grid-area: panel; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; }
.fig-sheet.is-full :is(.fig-cues, .fig-score, .fig-bar) { display: none; }
@media (max-aspect-ratio: 1/1) {
  dialog.sheet.fig-sheet.is-full[open] { grid-template: "head" auto "stage" 52dvh "panel" minmax(0, 1fr) / minmax(0, 1fr); gap: 8px; }
}
.fig-regler { display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.fc-info { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.fc-info[hidden], .fc-flags[hidden], .fc-chip[hidden] { display: none; }
.fc-points { --lv-c: var(--lv-10); padding: 10px 12px; border: 1px solid var(--line); border-left: 6px solid var(--lv-c); border-radius: var(--radius-sm); background: var(--surface-2); }
.fc-pts { display: block; font: var(--num-weight) 2.3rem/1.05 var(--font-num); color: var(--lv-c); }
.fc-by { margin: 4px 0 0; color: var(--muted); }
.fc-by:empty { display: none; }
.fc-flags { list-style: none; margin: 4px 0 0; padding: 0; color: var(--lv-0); font-weight: 700; }
.fc-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--lv-c, var(--line)); border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--lv-c, transparent) 20%, transparent); color: var(--text); }
.fc-warn { --lv-c: var(--lv-4); margin-top: 6px; }
.fc-row { --lv-c: var(--line); min-width: 0; padding: 8px 10px 4px; border: 1px solid var(--line); border-left: 4px solid var(--lv-c); border-radius: var(--radius-sm); background: var(--surface); }
.fc-row.is-limit { border-color: var(--lv-c); border-left-width: 6px; box-shadow: inset 0 0 0 1px var(--lv-c); }
.fc-list { display: flex; flex-direction: column; gap: 8px; }
.fc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.fc-name { font-weight: 700; }
.fc-val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-fig { display: block; min-height: 1.1em; color: var(--muted); font-size: .78rem; }
.fig-regler input[type=range] { display: block; width: 100%; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--lv-c); cursor: pointer; touch-action: pan-y; }
.fc-stufe.is-free input[type=range] { opacity: .45; }
.fc-stufe.is-free .fc-val { color: var(--muted); font-style: italic; }
/* Schwellen-Striche unter dem Regler; 10px Rand = halbe Daumenbreite */
.fc-marks { position: relative; height: 8px; margin: -12px 10px 6px; pointer-events: none; }
.fc-marks span { position: absolute; top: 0; width: 3px; height: 100%; border-radius: 2px; transform: translateX(-50%); }
.fc-ticks { display: flex; justify-content: space-between; margin-top: -6px; padding: 0 4px; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.fc-switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.fc-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.fc-table caption { padding-bottom: 4px; color: var(--muted); font-weight: 700; text-align: left; }
.fc-table th, .fc-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.fc-table th { width: 2.6em; font-variant-numeric: tabular-nums; }
.fc-table tr { cursor: pointer; }
.fc-table tr.is-cur { background: color-mix(in srgb, var(--lv-c, var(--accent)) 18%, transparent); box-shadow: inset 4px 0 0 var(--lv-c, var(--accent)); }
.fc-table tr.is-cur th { color: var(--text); }
.fc-table tr:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.fc-ak { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fc-ak select { width: auto; }
/* DTB-Bild als Bild im Bild (oben links), Antippen vergroessert */
.fig-ref { position: absolute; left: 8px; top: 8px; z-index: 2; width: 38%; max-width: 420px; margin: 0; padding: 4px; border-radius: 8px; background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5); cursor: zoom-in; }
.fig-ref img { display: block; width: 100%; height: auto; max-height: 38vh; object-fit: contain; }
.fig-ref.is-big { bottom: 8px; display: grid; place-items: center; width: calc(100% - 16px); max-width: none; cursor: zoom-out; }
.fig-ref.is-big img { width: auto; max-width: 100%; max-height: 100%; }
.fig-ref[hidden] { display: none; }
/* Winkel-Labels der Ueberlagerung (assets/figure3d.js setOverlay) */
.fig-ang { z-index: 1; padding: 2px 7px; border: 1px solid var(--ang-c, #fff); border-radius: 999px; background: rgba(10, 16, 32, .8); color: #fff;
  font: 700 .8rem/1.2 var(--font-figures); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig-ang[hidden] { display: none; }
.badge-regler { gap: 5px; margin-left: 4px; }
/* Spreizen im Eingabefeld: 1 Spreizwinkel (mit Punkten) · 2 Haltezeit; oben "Direkt Punkte" */
.at-sub { display: block; margin: 4px 0 2px; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.at-direct .at-chips { flex-wrap: nowrap; gap: 4px; }
.at-direct .at-chip { flex: 1 1 0; min-width: 0; padding: 4px 0; justify-content: center; text-align: center; font-weight: 700; }
