@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Trainingsstatus: anstehende und absolvierte Einheiten klar getrennt. */
.training-list-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.training-list-section {
  min-width: 0;
  padding: 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.training-list-section--upcoming {
  border-top: 0.25rem solid #f58220;
}

.training-list-section--completed {
  border-top: 0.25rem solid #00633e;
}

.training-list-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.training-list-section-head h3 {
  margin: 0.15rem 0 0;
}

.training-list-count {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.65rem;
  border-radius: 999rem;
  background: #00633e;
  color: #ffffff;
  font-weight: 800;
}

.training-list-section--upcoming .training-list-count {
  background: #f58220;
}

.training-list-section .session-list {
  margin: 0;
}

.training-list-section .session-list li.past a {
  opacity: 0.88;
}

.training-list-item > a {
  flex: 1;
  min-width: 0;
}

.training-list-actions {
  flex: 0 0 auto;
}

[data-theme="dark"] .training-list-section {
  background: #0d251b;
  border-color: #2e4b3d;
}

@media (max-width: 900px) {
  .training-list-sections {
    grid-template-columns: 1fr;
  }

  .training-list-section {
    padding: 0.9rem;
  }

  .training-list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .training-list-actions .btn {
    width: 100%;
  }
}
@font-face {
  font-family: 'Monoton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/monoton-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --text: #111111;
  --muted: #6b7280;
  --primary: rgb(232, 161, 77);
  --primary-hover: #f0b968;
  --primary-light: rgba(232, 161, 77, 0.15);
  --cta: #004b2b;
  --cta-dark: #003a20;
  --accent: rgb(0, 128, 0);
  --success: rgb(0, 128, 0);
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #3b82f6;
  --border: rgba(0, 0, 0, 0.08);
  --border-input: #d1d5db;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Monoton', cursive;
  --court-bg: #f5e6c8;
  --court-line: #7a4a1a;
  --court-lane: rgba(232, 161, 77, 0.3);
  --court-backboard: #333;
  --court-rim: #cc3300;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: rgb(232, 161, 77);
  --primary-hover: #f0b968;
  --primary-light: rgba(232, 161, 77, 0.2);
  --cta: rgb(232, 161, 77);
  --cta-dark: #f0b968;
  --accent: #4ade80;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;
  --border: #334155;
  --border-input: var(--border);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  --court-bg: #3d2f1e;
  --court-line: #8a6640;
  --court-lane: rgba(138, 102, 64, 0.25);
  --court-backboard: #a0a0a0;
  --court-rim: #e05533;
}

.court-floor { fill: var(--court-bg); stroke: var(--court-line); }
.court-line { stroke: var(--court-line); }
.court-lane { fill: var(--court-lane); stroke: var(--court-line); }
.court-backboard { stroke: var(--court-backboard); }
.court-rim { stroke: var(--court-rim); }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.topbar {
  background: var(--surface);
  padding:
    calc(12px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    12px
    calc(16px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cta);
  min-width: 0;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--cta);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .brand-logo { height: 26px; }
  .brand-text { font-size: 14px; }
  .brand { gap: 6px; }
}

.topbar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.theme-toggle:hover { background: var(--surface-2); }

.hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topbar nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .topbar nav {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a { flex: none; width: 100%; }
}

.topbar nav a {
  color: var(--cta);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  background: var(--surface-2);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.topbar nav a:hover { background: var(--primary-light); }

.topbar nav a.active {
  background: var(--cta);
  color: white;
}

main {
  padding:
    16px
    calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
  max-width: 900px;
  margin: 0 auto;
}

h2 { margin: 0 0 16px 0; font-size: 22px; font-weight: 700; color: var(--cta); }
h3 { margin: 28px 0 10px 0; font-size: 16px; color: var(--text); font-weight: 600; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-head .head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.section-head .head-left h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-head a.btn { text-decoration: none; }

.head-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.head-menu {
  position: relative;
}

.head-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.head-menu > summary::-webkit-details-marker { display: none; }
.head-menu > summary::marker { content: ''; }

.head-menu[open] > summary { background: var(--surface-2); }

.head-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.head-menu-panel .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.toggle input { width: 18px; height: 18px; }

.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--cta); border-color: var(--cta); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--cta-dark); border-color: var(--cta-dark); }
.btn.cta { background: var(--cta); border-color: var(--cta); color: white; }
.btn.cta:hover:not(:disabled) { background: var(--cta-dark); border-color: var(--cta-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn.danger:hover:not(:disabled) { background: #b91c1c; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.big { padding: 16px 24px; font-size: 18px; }

.player-form, .setup-form {
  background: var(--surface);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 140px;
}

.form-row label.grow { flex: 2; }

.form-row input {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.form-row input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
}

.tab.active { color: var(--cta); border-bottom-color: var(--primary); font-weight: 600; }

.player-list, .select-list, .session-list, .runner-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-list li, .session-list li {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.player-list .info, .session-list .info { flex: 1; min-width: 0; }
.player-list .name { font-weight: 600; }
.player-list .meta, .session-list .meta { font-size: 13px; color: var(--muted); }

.player-list .actions, .session-list .actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.select-list li {
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border);
}

.select-list li.selected { background: var(--primary-light); border-color: var(--primary); }
.select-list input[type="checkbox"] { width: 18px; height: 18px; }

.select-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.select-head h3 { margin: 0; }

.test-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 8px;
}
.test-type-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.test-type-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.test-type-opt input[type="radio"] { margin-top: 3px; }
.test-type-opt .tt-name { font-weight: 700; font-size: 15px; }
.test-type-opt .tt-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 600px) {
  .test-type-row { grid-template-columns: 1fr; }
}

.rest-indicator {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(232, 161, 77, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  display: none;
  text-align: center;
}
.rest-indicator.active { display: block; }
[data-theme="dark"] .rest-indicator { background: rgba(232, 161, 77, 0.22); }

.start-countdown {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: 'Monoton', 'Inter', sans-serif;
  font-size: clamp(140px, 35vw, 280px);
  font-weight: 400;
  letter-spacing: 0.05em;
  z-index: 1000;
  pointer-events: none;
  animation: countdown-pop 0.4s ease-out;
}
.start-countdown.final {
  color: var(--primary);
  font-size: clamp(80px, 18vw, 160px);
  animation: countdown-final 0.8s ease-out forwards;
}
@keyframes countdown-pop {
  from { transform: scale(1.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes countdown-final {
  0% { transform: scale(0.8); opacity: 0; }
  30% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .start-countdown { animation: none; }
  .start-countdown.final { animation: none; opacity: 1; transform: none; }
}

.session-list a {
  color: var(--text);
  text-decoration: none;
  display: block;
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.session-list a:hover { background: var(--surface-2); }

.empty { color: var(--muted); text-align: center; padding: 40px 20px; }
.empty-icon { display: block; margin: 0 auto 12px; width: 40px; height: 40px; opacity: 0.45; color: var(--muted); }
.empty-headline { font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.empty-body { font-size: 14px; margin: 0 0 16px; }
.empty .btn { margin-top: 8px; }
.empty--field { padding: 24px 16px; }
.empty--field .empty-icon { width: 32px; height: 32px; margin-bottom: 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

.test-run { text-align: center; }

.test-display {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.level-box, .shuttle-box, .speed-box {
  background: var(--surface);
  padding: 16px 20px;
  border-radius: 12px;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.level-box { background: var(--primary); border-color: var(--primary); }

.level-box .label, .shuttle-box .label, .speed-box .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.level-box .label { color: rgba(255,255,255,0.9); }
.level-box .value { font-size: 56px; font-weight: 700; color: white; line-height: 1; font-family: var(--font-display); letter-spacing: 2px; }
.shuttle-box .value, .speed-box .value { font-size: 32px; font-weight: 700; }

.progress {
  background: var(--surface-2);
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 8px 0;
  border: 1px solid var(--border);
}

.progress .bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.05s linear;
}

.next-beep { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

.test-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.runner-list {
  text-align: left;
}

.runner-list li {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.runner-list.out li { opacity: 0.55; }
.runner-list .name { font-weight: 600; font-size: 16px; flex: 1; }
.runner-list .result { font-size: 14px; color: var(--muted); }

.runner-list .out-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-width: 80px;
}

.runner-list .out-btn:hover { background: #b91c1c; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-top: 12px;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.table-scroll > table.results {
  margin-top: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  min-width: 540px;
}

table.results th, table.results td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.results th {
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table.results tr:last-child td { border-bottom: none; }

.chart-wrap {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap .axis { stroke: var(--border); stroke-width: 1; }
.chart-wrap .axis-label { fill: var(--muted); font-size: 11px; }
.chart-wrap .line { fill: none; stroke: var(--cta); stroke-width: 2.5; }
.chart-wrap .dot { fill: var(--primary); stroke: var(--cta); stroke-width: 1.5; }
.chart-wrap .dot-label { fill: var(--text); font-size: 11px; }

.player-list .info { cursor: pointer; }
.player-list .info:hover .name { color: var(--cta); }

.block-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.block-label textarea {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.block-label textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.att-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.att-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
  font-weight: 500;
}

.att-chip.ok { background: rgba(0, 128, 0, 0.12); color: #065f46; }
.att-chip.bad { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.att-chip.warn { background: rgba(232, 161, 77, 0.18); color: #92400e; }
.att-chip.muted-chip { color: var(--muted); }

[data-theme="dark"] .att-chip.ok { background: rgba(34, 197, 94, 0.22); color: #86efac; }
[data-theme="dark"] .att-chip.bad { background: rgba(248, 113, 113, 0.22); color: #fca5a5; }
[data-theme="dark"] .att-chip.warn { background: rgba(232, 161, 77, 0.28); color: #fcd9a8; }

.rating-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.rating-chip.tier-1 { background: #e5e7eb; color: #374151; }
.rating-chip.tier-2 { background: #fde68a; color: #713f12; }
.rating-chip.tier-3 { background: #fbbf24; color: #451a03; }
.rating-chip.tier-4 { background: #34d399; color: #064e3b; }
.rating-chip.tier-5 { background: #3b82f6; color: #ffffff; }
.rating-chip.tier-6 { background: #7c3aed; color: #ffffff; }

[data-theme="dark"] .rating-chip.tier-1 { background: #374151; color: #e5e7eb; }
[data-theme="dark"] .rating-chip.tier-2 { background: #92400e; color: #fde68a; }
[data-theme="dark"] .rating-chip.tier-3 { background: #b45309; color: #fef3c7; }
[data-theme="dark"] .rating-chip.tier-4 { background: #065f46; color: #a7f3d0; }
[data-theme="dark"] .rating-chip.tier-5 { background: #1d4ed8; color: #dbeafe; }
[data-theme="dark"] .rating-chip.tier-6 { background: #5b21b6; color: #ddd6fe; }

.heatmap-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 14px;
}
.heatmap-controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.shot-spot-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.spot-status { font-size: 12px; }
.shot-spot-editor {
  margin: 8px 0 16px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.shot-spot-editor .court { max-width: 320px; margin: 0 auto; display: block; cursor: crosshair; }
.spot-editor-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
}
.spot-editor-controls input[type="range"] { width: 140px; vertical-align: middle; }

.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 20px;
  text-decoration: none;
  background: transparent;
  transition: background 0.15s;
}
.settings-btn:hover { background: var(--surface-2); }

.settings-spots { display: flex; flex-direction: column; gap: 12px; }
.spot-cat-list { display: flex; flex-wrap: wrap; gap: 6px; }
.spot-cat-tab {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.spot-cat-tab:hover { background: var(--surface-2); }
.spot-cat-tab.has-spot { border-color: var(--primary); }
.spot-cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.settings-spots .court { max-width: 380px; margin: 0 auto; display: block; cursor: crosshair; }

.attendance-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-card {
  background: var(--surface);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.att-card.status-pending { border-left-color: var(--border); opacity: 0.85; }
.att-card.status-present { border-left-color: var(--accent); opacity: 1; }
.att-card.status-absent { border-left-color: var(--danger); }
.att-card.status-excused { border-left-color: var(--warning); }
.att-card.status-injured { border-left-color: var(--info); }

.att-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.att-head .name { font-weight: 600; font-size: 16px; }

.late-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.late-box.disabled { opacity: 0.4; cursor: not-allowed; }
.late-box input { width: 18px; height: 18px; }

.status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.status-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-input);
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  --status-color: var(--muted);
}

.status-btn[data-status="present"] { --status-color: var(--accent); }
.status-btn[data-status="absent"]  { --status-color: var(--danger); }
.status-btn[data-status="excused"] { --status-color: var(--warning); }
.status-btn[data-status="injured"] { --status-color: var(--info); }

.status-btn .status-dot {
  color: var(--status-color);
  font-weight: 700;
}

.status-btn:hover { background: var(--surface-2); }

.status-btn.active {
  background: var(--status-color);
  border-color: var(--status-color);
  color: white;
}

.status-btn.active .status-dot { color: white; }

.att-note {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

@media (max-width: 420px) {
  .status-row { grid-template-columns: repeat(2, 1fr); }
  .status-btn { font-size: 13px; padding: 10px 4px; }
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  font-family: inherit;
}

.search-input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-list a {
  display: block;
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.notes-list a:hover { background: var(--surface-2); }
.notes-list .name { font-weight: 600; margin-bottom: 4px; }
.notes-list .meta { font-size: 13px; color: var(--muted); }

.note-title {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.note-title:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.note-body {
  width: 100%;
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.note-body:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.note-tactic-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.note-tactic-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.note-tactic-preview .btn { align-self: flex-start; }
.note-tactic-raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}
.note-tactic-raw summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.note-tactic-raw pre {
  margin: 8px 0 0 0;
  padding: 12px;
  background: var(--bg, #0000000a);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  overflow-x: auto;
  max-height: 240px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.dash-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.dash-big {
  font-size: 36px;
  font-weight: 700;
  color: var(--cta);
  line-height: 1;
  font-family: var(--font-display);
  letter-spacing: 1px;
}

.dash-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.dash-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.ranking {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking li {
  display: grid;
  grid-template-columns: 28px 1fr 100px auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}

.ranking.compact li {
  grid-template-columns: 28px 1fr auto;
  padding: 6px 12px;
  font-size: 13px;
}

.ranking li.rank-empty {
  display: block;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.rank-pos {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
  text-align: center;
}

.rank-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-name:hover { color: var(--cta); }

.rank-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.rank-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.rank-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}

.cat-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.cat-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cat-name { font-weight: 700; color: var(--cta); }

.trend-block {
  margin-bottom: 16px;
}

.trend-head {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media print {
  @page { size: A4; margin: 14mm 12mm; }

  body, html {
    background: white !important;
    color: black !important;
    font-family: 'Inter', system-ui, sans-serif;
  }

  .topbar, .section-head .btn, .section-head a.btn,
  [data-action="print-report"], main > .view > .section-head > div:last-child,
  .subnav, .map-controls, [data-role="court-hit"] {
    display: none !important;
  }

  .court-floor { fill: white !important; stroke: #333 !important; }
  .court-line { stroke: #333 !important; }
  .court-lane { fill: rgba(0, 0, 0, 0.06) !important; stroke: #333 !important; }
  .court-backboard { stroke: #111 !important; }
  .court-rim { stroke: #444 !important; }
  .rank-fill { background: repeating-linear-gradient(45deg, #666 0, #666 2px, transparent 2px, transparent 6px) !important; }

  main {
    max-width: 100%;
    padding: 0;
  }

  .view { padding: 0; }

  .section-head {
    border-bottom: 2px solid #004b2b;
    padding-bottom: 8px;
    margin-bottom: 14px;
  }

  .section-head .head-left h2 {
    color: #004b2b !important;
    font-size: 24px !important;
  }

  h3 {
    color: #004b2b !important;
    margin-top: 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
  }

  .dash-card, .cat-block, .trend-block, .chart-wrap, table.results {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .dash-big {
    color: #004b2b !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
  }

  .dash-label, .dash-sub, .muted, .muted-chip {
    color: #555 !important;
  }

  .att-chip {
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ddd;
  }

  .att-chip.ok { background: #e6f4ea !important; color: #1b5e20 !important; }
  .att-chip.bad { background: #fce8e6 !important; color: #b71c1c !important; }
  .att-chip.warn { background: #fff4e0 !important; color: #8a4d00 !important; }

  .chart-wrap .line { stroke: #004b2b !important; }
  .chart-wrap .dot { fill: rgb(232, 161, 77) !important; stroke: #004b2b !important; }
  .chart-wrap .axis-label { fill: #555 !important; }

  table.results th { background: #f0f0f0 !important; color: #555 !important; }
  table.results td, table.results th { border-color: #ddd !important; }

  .brand, .topbar-actions { display: none !important; }

  /* Print header on first page */
  body::before {
    content: "TSV Lindau Basketball – Spieler-Bericht";
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #004b2b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
  }
}

/* =========================================================
   COURTHUB · FREIGEGEBENE VORSCHAU
   Finale Kaskade: hält Dashboard und App-Shell deckungsgleich
   mit der freigegebenen Desktop-/Mobile-Ansicht.
   ========================================================= */

.dashboard-view {
  width: min(100%, 68rem);
  color: #102019;
}

.dashboard-view .coach-hero {
  position: relative;
  min-height: 18rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: center;
  gap: 2rem;
  margin: 0 0 1.25rem;
  padding: 1.75rem 1.25rem 2rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #102019;
}

.dashboard-view .coach-hero::after {
  display: none;
}

.dashboard-view .coach-hero-copy,
.dashboard-view .coach-hero-actions {
  position: relative;
  z-index: 2;
}

.dashboard-view .coach-eyebrow {
  margin-bottom: 0.75rem;
  color: #e76f00;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-view .coach-hero h2 {
  max-width: 40rem;
  margin: 0;
  color: #003f29;
  font-size: clamp(2.8rem, 4.4vw, 4rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-transform: none;
}

.dashboard-view .coach-hero-actions {
  display: flex;
  align-items: stretch;
  align-self: auto;
  flex-direction: row;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dashboard-view .hero-action {
  width: auto;
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 1.3rem;
  border: 0.1rem solid #004b2b;
  border-radius: 0.5rem;
  background: transparent;
  color: #102019;
  box-shadow: none;
  font-size: 0.95rem;
  text-decoration: none;
  backdrop-filter: none;
}

.dashboard-view .hero-action:hover {
  border-color: #e97812;
  background: #ffffff;
  transform: translateY(-0.1rem);
}

.dashboard-view .hero-action > span {
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
}

.dashboard-view .hero-action > strong {
  width: auto;
  height: auto;
  display: inline;
  flex: 0 1 auto;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  line-height: 1.2;
}

.dashboard-view .hero-action-primary,
.dashboard-view .hero-action-primary:hover {
  border-color: #e97812;
  background: linear-gradient(180deg, #f89b36 0%, #ed7b18 100%);
  color: #ffffff;
  box-shadow: 0 0.5rem 1rem #df721626;
}

.dashboard-view .coach-status-row,
.dashboard-view .hero-install {
  display: none !important;
}

.dashboard-view .coach-hero-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #003f29;
}

.dashboard-view .coach-hero-visual svg {
  width: min(100%, 23rem);
  height: auto;
  overflow: visible;
}

.dashboard-view .hero-court-lines {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.25rem;
}

.dashboard-view .hero-play-accent {
  color: #ed7b18;
  stroke: #ed7b18;
  stroke-width: 0.3rem;
}

.dashboard-view .hero-markers {
  fill: none;
  stroke: currentColor;
}

.dashboard-view .hero-ball {
  fill: #ed7b18;
  stroke: #ffffff;
  stroke-width: 0.22rem;
}

.dashboard-view .hero-ball path {
  fill: none;
  stroke: #ffffff;
}

.dashboard-view .preview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0 0 1rem;
  padding: 0;
  overflow: visible;
}

.dashboard-view .preview-kpi-card {
  min-width: 0;
  min-height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
  border: 0.0625rem solid #10201917;
  border-radius: 0.8rem;
  background: #ffffff;
  box-shadow: 0 0.25rem 0.75rem #10201914;
  text-align: center;
}

.dashboard-view .preview-kpi-card::after {
  display: none;
}

.dashboard-view .preview-kpi-card:hover {
  border-color: #e8a14d66;
  box-shadow: 0 0.65rem 1.5rem #10201917;
  transform: translateY(-0.15rem);
}

.dashboard-view .preview-kpi-card .dash-label {
  margin: 0 0 0.6rem;
  color: #102019;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-view .preview-kpi-card .dash-icon {
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 2.45rem;
  fill: none;
  stroke: #004b2b;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-view .preview-kpi-card .dash-big {
  max-width: 100%;
  margin-top: 0.4rem;
  color: #102019;
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.dashboard-view .preview-kpi-card .dash-big-copy {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-view .preview-kpi-card .dash-sub {
  max-width: 100%;
  margin-top: 0.25rem;
  overflow: hidden;
  color: #67736d;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-view .next-training-panel {
  margin: 0 0 1.15rem;
  padding: 1.15rem;
  border: 0.0625rem solid #10201917;
  border-radius: 0.8rem;
  background: #ffffff;
  box-shadow: 0 0.25rem 0.75rem #10201914;
}

.dashboard-view .next-training-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.dashboard-view .next-training-panel h3 {
  margin: 0;
  color: #102019;
  font-size: 1.15rem;
}

.dashboard-view .next-training-agenda {
  overflow: hidden;
  border: 0.0625rem solid #10201917;
  border-radius: 0.65rem;
}

.dashboard-view .agenda-row {
  min-height: 3.15rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto 1rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 0.0625rem solid #10201917;
  color: #102019;
  text-decoration: none;
}

.dashboard-view .agenda-row:last-child {
  border-bottom: 0;
}

.dashboard-view .agenda-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-view .agenda-row-copy strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-view .agenda-row-copy small,
.dashboard-view .agenda-empty span {
  color: #67736d;
  font-size: 0.7rem;
}

.dashboard-view .agenda-row time {
  color: #102019;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-view .agenda-row-icon,
.dashboard-view .agenda-arrow {
  color: #004b2b;
}

.dashboard-view .agenda-icon-0,
.dashboard-view .agenda-icon-2 {
  color: #ed7b18;
}

@media (min-width: 901px) {
  :root {
    --rail-width: 15.25rem;
  }

  .topbar {
    width: var(--rail-width);
    padding: 1.4rem 1rem 1.25rem;
    gap: 0.9rem;
    border: 0 !important;
    background: linear-gradient(165deg, #005c3a 0%, #004b2b 58%, #00341f 100%);
    box-shadow: 0.55rem 0 2rem #001b1024;
  }

  .topbar::after,
  .topbar .brand-copy,
  .topbar .topbar-actions,
  .topbar .nav-section-label,
  .topbar nav a[data-nav="games"],
  .topbar nav a[data-nav="drills"],
  .topbar nav a[data-nav="notes"],
  .topbar nav a[data-nav="history"],
  .topbar nav .club-link {
    display: none;
  }

  .topbar-head {
    align-items: center;
    flex-direction: column;
    gap: 0;
  }

  .topbar .brand {
    width: 100%;
    justify-content: center;
  }

  .topbar .brand-mark {
    width: 7rem;
    height: 7rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .topbar .brand-logo {
    width: 7rem;
    height: 7rem;
    object-fit: contain;
    border-radius: 0;
  }

  .topbar nav {
    margin-top: 0.25rem;
    gap: 0.25rem;
    overflow: visible;
  }

  .topbar nav a {
    min-height: 3rem;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 0.55rem;
    color: #ffffff;
    font-size: 0.9rem;
  }

  .topbar nav a[data-nav="dashboard"] { order: 1; }
  .topbar nav a[data-nav="training"] { order: 2; }
  .topbar nav a[data-nav="players"] { order: 3; }
  .topbar nav a[data-nav="setup"] { order: 4; }
  .topbar nav a[data-nav="schedule"] { order: 5; }
  .topbar nav a[data-nav="tactics"] { order: 6; }
  .topbar nav a[data-nav="account"] { order: 7; }

  .topbar nav a:hover,
  .topbar nav a.active {
    border: 0 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .topbar .nav-icon,
  .topbar nav a.active .nav-icon {
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    color: #ffffff;
    font-size: 1.1rem;
  }

  main {
    margin-left: var(--rail-width);
    padding: 1.75rem max(2rem, calc((100vw - var(--rail-width) - 72rem) / 2)) 4rem;
  }
}

@media (max-width: 900px) {
  :root {
    --rail-width: 0rem;
  }

  body {
    padding-bottom: calc(4.8rem + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    inset: 0;
    width: 100%;
    min-height: calc(5rem + env(safe-area-inset-top));
    padding:
      calc(0.25rem + env(safe-area-inset-top))
      calc(1rem + env(safe-area-inset-right))
      0.25rem
      calc(1rem + env(safe-area-inset-left));
    overflow: visible;
    border: 0;
    background: linear-gradient(150deg, #005c3a 0%, #003c25 100%);
    box-shadow: 0 0.35rem 1.25rem #001b1026;
  }

  .topbar::after,
  .topbar .brand-copy,
  .topbar-actions .install-btn,
  .topbar-actions .theme-toggle,
  .topbar-actions .settings-btn {
    display: none !important;
  }

  .topbar-head {
    width: 100%;
    align-items: center;
    flex-direction: row;
  }

  .topbar .brand {
    flex: 1;
  }

  .topbar .brand-mark,
  .topbar .brand-logo {
    width: 4.65rem;
    height: 4.65rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .topbar .brand-logo {
    object-fit: contain;
  }

  .topbar-actions {
    width: auto;
  }

  .topbar .hamburger {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    border: 0;
    background: transparent;
  }

  .topbar .hamburger span {
    background: #ffffff;
  }

  .topbar nav {
    inset:
      calc(5rem + env(safe-area-inset-top))
      0
      calc(4.8rem + env(safe-area-inset-bottom));
  }

  main {
    margin-left: 0;
    padding:
      0.65rem
      calc(0.8rem + env(safe-area-inset-right))
      calc(1.5rem + env(safe-area-inset-bottom))
      calc(0.8rem + env(safe-area-inset-left));
  }

  .dashboard-view .coach-hero {
    min-height: 20.5rem;
    display: block;
    margin-bottom: 0.65rem;
    padding: 0.95rem 0.2rem 0.35rem;
  }

  .dashboard-view .coach-hero-copy {
    position: relative;
    z-index: 2;
  }

  .dashboard-view .coach-eyebrow {
    margin-bottom: 0.55rem;
    font-size: 0.66rem;
  }

  .dashboard-view .coach-hero h2 {
    width: 66%;
    font-size: clamp(1.9rem, 9vw, 2.55rem);
    line-height: 1.06;
  }

  .dashboard-view .coach-hero-visual {
    position: absolute;
    top: 0.9rem;
    right: -0.4rem;
    width: 44%;
  }

  .dashboard-view .coach-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 2.1rem;
  }

  .dashboard-view .hero-action {
    width: 100%;
    min-height: 3rem;
  }

  .dashboard-view .preview-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.7rem;
  }

  .dashboard-view .preview-kpi-card {
    min-height: 8.2rem;
    padding: 0.7rem 0.4rem;
  }

  .dashboard-view .preview-kpi-card .dash-label {
    margin-bottom: 0.3rem;
    font-size: 0.65rem;
  }

  .dashboard-view .preview-kpi-card .dash-icon {
    width: 1.9rem;
    height: 1.9rem;
    flex-basis: 1.9rem;
  }

  .dashboard-view .preview-kpi-card .dash-big {
    font-size: 1.25rem;
  }

  .dashboard-view .preview-kpi-card .dash-big-copy {
    width: 100%;
    font-size: 0.78rem;
  }

  .dashboard-view .next-training-panel {
    margin-bottom: 0.75rem;
    padding: 0.7rem;
  }

  .dashboard-view .next-training-panel-head .section-kicker {
    display: none;
  }

  .dashboard-view .next-training-panel h3 {
    font-size: 1rem;
  }

  .dashboard-view .agenda-row {
    min-height: 3rem;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto 0.7rem;
    gap: 0.45rem;
    padding: 0.45rem 0.5rem;
  }

  .dashboard-view .agenda-row-copy strong {
    font-size: 0.72rem;
  }

  .dashboard-view .agenda-row-copy small {
    display: none;
  }

  .dashboard-view .agenda-row time {
    font-size: 0.67rem;
  }

  .mobile-dock {
    min-height: calc(4.55rem + env(safe-area-inset-bottom));
    padding:
      0.3rem
      max(0.25rem, env(safe-area-inset-right))
      calc(0.3rem + env(safe-area-inset-bottom))
      max(0.25rem, env(safe-area-inset-left));
    border-top: 0;
    background: linear-gradient(150deg, #005c3af5 0%, #003c25fa 100%);
  }

  .mobile-dock a {
    min-height: 3.4rem;
    gap: 0.1rem;
    padding: 0.25rem 0.1rem;
    border-radius: 0.7rem;
    color: #ffffff;
  }

  .mobile-dock a > span {
    color: currentColor;
    font-size: 1.1rem;
  }

  .mobile-dock small {
    overflow: hidden;
    font-size: 0.56rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dock a.active {
    background: transparent;
    color: #f58220;
  }

  .mobile-dock .mobile-dock-main,
  .mobile-dock .mobile-dock-main.active {
    width: 4rem;
    height: 4rem;
    min-height: 4rem;
    margin: -1rem auto 0;
    border: 0.18rem solid #ffffff;
    border-radius: 50%;
    background: #ed7b18;
    color: #ffffff;
    box-shadow: 0 0.65rem 1.4rem #001b1045;
  }
}

/* CourtHub 3.1: Auswertung, Darstellung und klickbare Dashboard-Karten. */
.preview-kpi-card {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.preview-kpi-card:focus-visible {
  outline: 0.1875rem solid #e8a14d;
  outline-offset: 0.1875rem;
}

.appearance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 0.0625rem solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.appearance-card h3 {
  margin: 0;
}

.appearance-card p {
  max-width: 42rem;
  margin: 0.4rem 0 0;
}

.theme-choice {
  min-width: 20rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.3rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-2);
}

.theme-choice button {
  min-height: 2.65rem;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.theme-choice button.active {
  background: #004b2b;
  color: #ffffff;
  box-shadow: 0 0.25rem 0.75rem #1020191f;
}

.reports-view {
  width: min(100%, 78rem);
}

.reports-head .muted {
  margin: 0.45rem 0 0;
}

.report-filter-bar {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.report-filter-bar label {
  min-width: 12rem;
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-filter-bar select {
  width: 100%;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}

.report-as-of {
  margin-left: auto;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.report-summary-card,
.report-team-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.report-summary-card > span,
.report-team-tile > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-summary-card strong,
.report-team-tile strong {
  margin-top: 0.45rem;
  overflow: hidden;
  color: var(--cta);
  font-size: 1.65rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-summary-card small,
.report-team-tile small {
  margin-top: 0.3rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-coverage {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 0.25rem solid #e8a14d;
  border-radius: 0.7rem;
  background: var(--surface-2);
  font-size: 0.75rem;
}

.report-coverage strong {
  margin-right: 0.3rem;
}

.report-coverage span {
  padding: 0.3rem 0.55rem;
  border-radius: 999rem;
  background: var(--surface);
  color: var(--muted);
}

.report-panel {
  margin: 1rem 0;
  padding: 1.15rem;
  border: 0.0625rem solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.report-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.report-panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.report-team-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
}

.report-team-tile {
  background: var(--surface-2);
  box-shadow: none;
}

.report-team-tile strong {
  font-size: 1.35rem;
}

.report-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.report-category-grid article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.55rem;
  padding: 0.7rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.report-category-grid span {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-category-grid strong {
  color: var(--cta);
  font-size: 0.85rem;
}

.report-category-grid small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.report-table-scroll {
  border: 0.0625rem solid var(--border);
  border-radius: 0.8rem;
}

.report-player-table {
  min-width: 74rem;
}

.report-player-table th,
.report-player-table td {
  padding: 0.65rem 0.55rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

.report-player-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 10rem;
  background: var(--surface);
}

.report-player-table td:first-child a {
  color: var(--text);
  text-decoration: none;
}

.report-player-table td:first-child small,
.report-player-table td small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.63rem;
}

.report-cell-main {
  color: var(--text);
}

.report-player-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.report-player-card {
  min-width: 0;
  padding: 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-2);
}

.report-player-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-player-card header div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.report-player-card header a {
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-player-card header small {
  color: var(--muted);
  font-size: 0.7rem;
}

.report-attendance-badge {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  border-radius: 999rem;
  background: #004b2b17;
  color: var(--cta);
  font-size: 0.65rem;
  font-weight: 800;
}

.report-player-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.report-player-quick > span {
  min-width: 0;
  padding: 0.55rem;
  border-radius: 0.6rem;
  background: var(--surface);
}

.report-player-quick small,
.report-player-quick strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-player-quick small {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.report-player-quick strong {
  margin-top: 0.2rem;
  color: var(--cta);
  font-size: 1rem;
}

.report-shot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-shot-chips > span {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.1rem 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.6rem;
  background: var(--surface);
  font-size: 0.68rem;
}

.report-shot-chips > span strong {
  color: var(--cta);
}

.report-shot-chips > span small {
  grid-column: 1 / -1;
  color: var(--muted);
}

[data-theme="dark"] .dashboard-view {
  color: #f6f4ef;
}

[data-theme="dark"] .dashboard-view .coach-hero,
[data-theme="dark"] .dashboard-view .coach-hero h2,
[data-theme="dark"] .dashboard-view .coach-hero-visual {
  color: #f6f4ef;
}

[data-theme="dark"] .dashboard-view .preview-kpi-card,
[data-theme="dark"] .dashboard-view .next-training-panel,
[data-theme="dark"] .dashboard-view .next-training-agenda {
  border-color: #ffffff1f;
  background: #0e2119;
}

[data-theme="dark"] .dashboard-view .preview-kpi-card .dash-label,
[data-theme="dark"] .dashboard-view .preview-kpi-card .dash-big,
[data-theme="dark"] .dashboard-view .next-training-panel h3,
[data-theme="dark"] .dashboard-view .agenda-row,
[data-theme="dark"] .dashboard-view .agenda-row time,
[data-theme="dark"] .dashboard-view .agenda-arrow,
[data-theme="dark"] .alerts-card,
[data-theme="dark"] .alert-row,
[data-theme="dark"] .coach-briefing,
[data-theme="dark"] .coach-briefing h3,
[data-theme="dark"] .coach-briefing-grid strong,
[data-theme="dark"] .coach-briefing-list li,
[data-theme="dark"] .form-of-week,
[data-theme="dark"] .form-of-week h3 {
  color: #f6f4ef;
}

[data-theme="dark"] .dashboard-view .preview-kpi-card .dash-icon {
  stroke: #e8a14d;
}

[data-theme="dark"] .dashboard-view .preview-kpi-card .dash-sub,
[data-theme="dark"] .dashboard-view .agenda-row-copy small {
  color: #a8b8b0;
}

[data-theme="dark"] .dashboard-view .hero-action-secondary {
  border-color: #f6f4ef;
  color: #f6f4ef;
}

[data-theme="dark"] .dashboard-view .hero-action-secondary:hover {
  background: #153126;
}

[data-theme="dark"] .report-attendance-badge {
  background: #e8a14d24;
  color: #f5c487;
}

[data-theme="dark"] .theme-choice button.active {
  background: #e8a14d;
  color: #102019;
}

@media (min-width: 901px) {
  .topbar nav a[data-nav="reports"] { order: 4; }
  .topbar nav a[data-nav="setup"] { order: 5; }
  .topbar nav a[data-nav="schedule"] { order: 6; }
  .topbar nav a[data-nav="tactics"] { order: 7; }
  .topbar nav a[data-nav="account"] { order: 8; }
}

@media (max-width: 900px) {
  .appearance-card {
    align-items: stretch;
    flex-direction: column;
    gap: 0.9rem;
  }

  .theme-choice {
    width: 100%;
    min-width: 0;
  }

  .reports-head {
    align-items: stretch;
  }

  .reports-head .head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-filter-bar label {
    min-width: 0;
  }

  .report-as-of {
    margin-left: 0;
    padding: 0.2rem;
  }

  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary-card:last-child {
    grid-column: 1 / -1;
  }

  .report-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-player-cards {
    grid-template-columns: 1fr;
  }

  .report-panel {
    padding: 0.8rem;
  }
}

@media (max-width: 420px) {
  .report-player-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary-card strong {
    font-size: 1.4rem;
  }
}

@media (max-width: 390px) {
  .dashboard-view .coach-hero {
    min-height: 19.5rem;
  }

  .dashboard-view .coach-hero h2 {
    font-size: 1.85rem;
  }

  .dashboard-view .hero-action {
    min-height: 2.85rem;
  }

  .dashboard-view .preview-kpi-card {
    min-height: 7.7rem;
  }
}

@media print {
  .dashboard-view .coach-hero {
    display: none;
  }
}

/* =========================================================
   COURTHUB · PREVIEW-GETREUES DASHBOARD
   Referenz: freigegebene Desktop- und Mobile-Vorschau
   ========================================================= */

@media (min-width: 901px) {
  :root { --rail-width: 15.5rem; }

  .topbar {
    padding: 2rem 1.5rem 1.5rem;
    border-right-width: 0;
    background:
      radial-gradient(circle at 20% 8%, #ffffff12 0, transparent 12rem),
      linear-gradient(165deg, #005c3a 0%, #004b2b 58%, #00341f 100%);
  }

  .brand-mark {
    width: 5.25rem;
    height: 5.25rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .brand-logo {
    width: 5.25rem;
    height: 5.25rem;
    border-radius: 0;
  }

  .brand-copy { display: none; }
  .topbar-actions { display: none; }
  .topbar nav { margin-top: 0.5rem; }
  .topbar nav a { min-height: 3rem; }

  main {
    padding: 1.5rem max(2rem, calc((100vw - var(--rail-width) - 80rem) / 2)) 4rem;
  }
}

.dashboard-view {
  width: min(100%, 78rem);
}

.dashboard-view .coach-hero {
  min-height: 18rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 2.25rem 2rem 1.75rem;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.dashboard-view .coach-hero::after { display: none; }

.dashboard-view .coach-hero-copy {
  align-self: center;
}

.dashboard-view .coach-eyebrow {
  margin-bottom: 0.75rem;
  color: #df7216;
  font-size: 0.75rem;
  letter-spacing: 0.11em;
}

.dashboard-view .coach-hero h2 {
  max-width: 42rem;
  color: #004b2b;
  font-size: clamp(2.75rem, 4.7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-transform: none;
}

[data-theme="dark"] .dashboard-view .coach-hero h2 {
  color: #f6f4ef;
}

.dashboard-view .coach-hero-actions {
  display: flex;
  align-items: stretch;
  flex-direction: row;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.dashboard-view .hero-action {
  width: auto;
  min-height: 3.25rem;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 1.35rem;
  border: 0.1rem solid #004b2b;
  border-radius: 0.5rem;
  background: transparent;
  color: #102019;
  box-shadow: none;
  backdrop-filter: none;
}

.dashboard-view .hero-action > span {
  color: inherit;
  font-size: 1.15rem;
}

.dashboard-view .hero-action > strong {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-size: 0.95rem;
}

.dashboard-view .hero-action-primary {
  border-color: #ef7d18;
  background: linear-gradient(180deg, #f49a3c 0%, #ed7b18 100%);
  color: #ffffff;
  box-shadow: 0 0.5rem 1rem #df721626;
}

.dashboard-view .hero-action-secondary:hover {
  border-color: #ef7d18;
  background: #ffffff;
  transform: translateY(-0.1rem);
}

[data-theme="dark"] .dashboard-view .hero-action-secondary {
  border-color: #f6f4ef;
  color: #f6f4ef;
}

.dashboard-view .coach-status-row {
  margin-top: 1rem;
}

.dashboard-view .connection-chip,
.dashboard-view .today-chip {
  border-color: #004b2b1f;
  background: #ffffffb3;
  color: #52625a;
}

[data-theme="dark"] .dashboard-view .connection-chip,
[data-theme="dark"] .dashboard-view .today-chip {
  border-color: #ffffff1f;
  background: #ffffff0d;
  color: #c3cec8;
}

.coach-hero-visual {
  display: grid;
  place-items: center;
  color: #003d28;
}

.coach-hero-visual svg {
  width: min(100%, 23rem);
  height: auto;
  overflow: visible;
}

.hero-court-lines { stroke-width: 0.25rem; }
.hero-play-accent { color: #ef7d18; stroke-width: 0.3rem; }
.hero-ball { fill: #ef7d18; stroke: #ffffff; stroke-width: 0.22rem; }
.hero-ball path { fill: none; }

[data-theme="dark"] .coach-hero-visual { color: #f6f4ef; }

.dashboard-view .hero-install {
  position: absolute;
  right: 0;
  bottom: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.preview-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.1rem;
  overflow: visible;
  padding: 0;
}

.preview-kpi-card {
  min-width: 0;
  min-height: 10.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.1rem;
  border: 0.0625rem solid #10201917;
  border-top: 0.0625rem solid #10201917;
  border-radius: 0.85rem;
  background: var(--surface);
  box-shadow: 0 0.25rem 0.75rem #10201914;
  text-align: center;
}

.preview-kpi-card::after { display: none; }

.preview-kpi-card:hover {
  border-color: #e8a14d66;
  box-shadow: 0 0.65rem 1.5rem #10201917;
  transform: translateY(-0.15rem);
}

.preview-kpi-card .dash-label {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.dash-icon {
  width: 2.45rem;
  height: 2.45rem;
  fill: none;
  stroke: #004b2b;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .dash-icon { stroke: #e8a14d; }

.preview-kpi-card .dash-big {
  margin-top: 0.45rem;
  color: #102019;
  font-family: var(--font-body);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

[data-theme="dark"] .preview-kpi-card .dash-big { color: #f6f4ef; }

.preview-kpi-card .dash-big-copy {
  max-width: 100%;
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-kpi-card .dash-sub {
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

.next-training-panel {
  margin-bottom: 1.25rem;
  padding: 1.2rem;
  border: 0.0625rem solid #10201917;
  border-radius: 0.85rem;
  background: var(--surface);
  box-shadow: 0 0.25rem 0.75rem #10201914;
}

.next-training-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.next-training-panel-head .section-kicker {
  margin-bottom: 0.15rem;
  color: #df7216;
}

.next-training-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
}

.next-training-agenda {
  overflow: hidden;
  border: 0.0625rem solid var(--border);
  border-radius: 0.7rem;
}

.agenda-row {
  min-height: 3.3rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto 1rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 0.0625rem solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background 0.18s ease;
}

.agenda-row:last-child { border-bottom: 0; }
.agenda-row:hover { background: #e8a14d12; }

.agenda-row-icon {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  color: #004b2b;
  font-size: 0.75rem;
  font-weight: 900;
}

.agenda-icon-0,
.agenda-icon-2 { color: #ef7d18; }

.agenda-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.agenda-row-copy strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-row-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-row time {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.agenda-arrow {
  color: #004b2b;
  font-size: 1.35rem;
}

.agenda-empty {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem;
  text-align: center;
}

.agenda-empty span {
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-tools {
  margin: 0 0 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.dashboard-tools summary {
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.9rem 0.9rem;
}

.next-game-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.8rem 1rem;
  border: 0.0625rem solid #004b2b24;
  border-radius: 0.75rem;
  background: #004b2b;
  color: #ffffff;
  text-decoration: none;
}

.next-game-strip span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.next-game-strip small {
  color: #ffffffa8;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.next-game-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-game-strip > span:last-child {
  flex: 0 0 auto;
  color: #f4b568;
  font-size: 0.75rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .topbar {
    min-height: calc(5.25rem + env(safe-area-inset-top));
    padding:
      calc(0.35rem + env(safe-area-inset-top))
      calc(0.9rem + env(safe-area-inset-right))
      0.35rem
      calc(0.9rem + env(safe-area-inset-left));
  }

  .topbar-head { width: 100%; }
  .brand { flex: 1; }
  .brand-mark {
    width: 4.35rem;
    height: 4.35rem;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }
  .brand-logo {
    width: 4.35rem;
    height: 4.35rem;
    border-radius: 0;
  }
  .brand-copy { display: none; }
  .topbar-actions { display: flex; justify-content: flex-end; }
  .topbar-actions .install-btn,
  .topbar-actions .theme-toggle,
  .topbar-actions .settings-btn { display: none !important; }
  .hamburger {
    display: flex;
    border: 0;
    background: transparent;
  }
  .hamburger span { background: #ffffff; }

  .topbar nav {
    inset:
      calc(5.25rem + env(safe-area-inset-top))
      0
      calc(4.75rem + env(safe-area-inset-bottom));
  }

  main {
    padding:
      0.65rem
      calc(0.8rem + env(safe-area-inset-right))
      calc(2rem + env(safe-area-inset-bottom))
      calc(0.8rem + env(safe-area-inset-left));
  }

  .dashboard-view .coach-hero {
    min-height: 22rem;
    display: block;
    margin-bottom: 0.8rem;
    padding: 1.35rem 0.3rem 0.5rem;
  }

  .dashboard-view .coach-hero-copy {
    position: relative;
    z-index: 2;
  }

  .dashboard-view .coach-eyebrow {
    margin-bottom: 0.65rem;
    font-size: 0.66rem;
  }

  .dashboard-view .coach-hero h2 {
    width: 63%;
    font-size: clamp(2rem, 9.5vw, 3.1rem);
    line-height: 1.04;
  }

  .coach-hero-visual {
    position: absolute;
    top: 1.2rem;
    right: -0.4rem;
    width: 43%;
  }

  .dashboard-view .coach-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 2rem;
  }

  .dashboard-view .hero-action {
    width: 100%;
    min-height: 3rem;
  }

  .dashboard-view .coach-status-row { display: none; }
  .dashboard-view .hero-install { display: none !important; }

  .preview-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    overflow: visible;
  }

  .preview-kpi-card {
    min-width: 0;
    min-height: 8.4rem;
    padding: 0.75rem 0.45rem;
  }

  .preview-kpi-card .dash-label {
    margin-bottom: 0.35rem;
    font-size: 0.65rem;
  }

  .dash-icon {
    width: 1.9rem;
    height: 1.9rem;
  }

  .preview-kpi-card .dash-big {
    font-size: 1.3rem;
  }

  .preview-kpi-card .dash-big-copy {
    width: 100%;
    font-size: 0.8rem;
  }

  .next-training-panel {
    margin-bottom: 0.8rem;
    padding: 0.7rem;
  }

  .next-training-panel-head { margin-bottom: 0.45rem; }
  .next-training-panel-head .section-kicker { display: none; }
  .next-training-panel h3 { font-size: 1rem; }
  .next-training-panel-head .btn { min-height: 2rem; }

  .agenda-row {
    min-height: 3rem;
    grid-template-columns: 1.6rem minmax(0, 1fr) auto 0.75rem;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
  }

  .agenda-row-icon {
    width: 1.45rem;
    height: 1.45rem;
    font-size: 0.6rem;
  }

  .agenda-row-copy strong { font-size: 0.73rem; }
  .agenda-row-copy small { display: none; }
  .agenda-row time { font-size: 0.67rem; }

  .dashboard-tools { margin-bottom: 0.75rem; }
  .next-game-strip { margin-bottom: 0.8rem; }

  .mobile-dock a:nth-child(1) > span,
  .mobile-dock a:nth-child(2) > span,
  .mobile-dock a:nth-child(4) > span,
  .mobile-dock a:nth-child(5) > span {
    color: currentColor;
  }
}

@media (max-width: 390px) {
  .dashboard-view .coach-hero { min-height: 20.5rem; }
  .dashboard-view .coach-hero h2 { font-size: 1.9rem; }
  .dashboard-view .hero-action { min-height: 2.8rem; }
  .preview-kpi-card { min-height: 7.75rem; }
}

.team-members-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 0.0625rem solid #d8e3dc;
  border-radius: 1rem;
  background: #ffffff;
}

.team-members-list {
  display: grid;
  gap: 0.625rem;
  margin-top: 1rem;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem;
  border-radius: 0.75rem;
  background: #f2f7f4;
}

.team-member-row > div {
  display: grid;
  gap: 0.1875rem;
}

.team-member-row span {
  color: #5a6b62;
  font-size: 0.8125rem;
}

.team-member-row select {
  width: auto;
  min-width: 10.5rem;
}

.member-role-badge {
  padding: 0.375rem 0.625rem;
  border-radius: 999rem;
  color: #004b2b !important;
  background: #dcece3;
  font-weight: 800;
}

@media (max-width: 640px) {
  .team-member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .team-member-row select {
    width: 100%;
  }
}

/* Trainer workflow: Briefing, Entwicklung, QR-Check-in und Spiele */
.coach-briefing,
.development-panel,
.checkin-card,
.atlas-panel,
.boxscore-panel {
  margin: 24px 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.coach-briefing-head,
.development-head,
.atlas-head,
.game-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.coach-briefing h3,
.development-panel h3,
.atlas-panel h3,
.boxscore-panel h3,
.game-detail h3 { margin: 3px 0 0; }

.coach-briefing-grid,
.plan-load-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.coach-briefing-grid > div,
.plan-load-grid > div,
.plan-duration {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

.coach-briefing-grid span,
.plan-load-grid span { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.coach-briefing-grid strong,
.plan-load-grid strong { display: block; margin-top: 5px; font-size: .95rem; }
.coach-briefing-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.coach-briefing-list li { padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--border); background: var(--surface-2); }
.coach-briefing-list .briefing-warn { border-left-color: var(--warning); }
.coach-briefing-list .briefing-ok { border-left-color: var(--success); }
.coach-briefing-list .briefing-info { border-left-color: var(--primary); }

.goal-form { margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.goal-list { display: grid; gap: 14px; margin-top: 18px; }
.goal-card { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.goal-card.is-done { opacity: .78; }
.goal-card-head { display: flex; justify-content: space-between; gap: 12px; }
.goal-card h4 { margin: 0 0 4px; }
.goal-progress-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 14px; }
.goal-progress-row input { width: 100%; accent-color: var(--cta); }
.goal-progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--border); }
.goal-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cta)); }
.goal-feedback { display: grid; gap: 6px; margin: 14px 0; padding: 0; list-style: none; }
.goal-feedback li { padding: 9px 10px; border-radius: 9px; background: var(--surface); font-size: .9rem; }
.goal-feedback li span { margin-right: 8px; color: var(--muted); font-size: .72rem; }
.goal-feedback-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.goal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

.plan-duration { display: block; margin: 0; }
.plan-duration > span:last-child { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.plan-duration input { width: 68px; padding: 4px 6px; }
.plan-progress { height: 8px; margin: -6px 0 15px; border-radius: 999px; overflow: hidden; background: var(--border); }
.plan-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cta), var(--primary)); }
.plan-over { color: var(--danger); }
.plan-drill[draggable="true"] { cursor: grab; }
.plan-drill.dragging { opacity: .45; border-color: var(--primary); }
.plan-drag { color: var(--muted); font-weight: 900; letter-spacing: -2px; user-select: none; }
.intensity-chip { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.intensity-low { color: #177245; background: #dff6e9; }
.intensity-medium { color: #915c00; background: #fff0cd; }
.intensity-high { color: #a52323; background: #ffe0df; }

.checkin-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; }
.checkin-card h3 { margin: 3px 0 8px; }
.checkin-qr { display: grid; justify-items: center; gap: 8px; }
.checkin-qr img { width: 180px; height: 180px; border-radius: 12px; background: #fff; padding: 6px; }
.checkin-submissions { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--border); }
.checkin-submissions ul { display: grid; gap: 6px; padding: 0; list-style: none; }
.checkin-submissions li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }

.public-checkin-mode .topbar,
.public-checkin-mode .mobile-dock { display: none !important; }
.public-checkin-mode main { margin: 0; padding: 0; max-width: none; }
.checkin-public { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 24px; padding: 24px; background: radial-gradient(circle at 80% 10%, rgba(232,161,77,.2), transparent 36%), linear-gradient(145deg, #001d11, #004b2b); }
.checkin-public-brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.checkin-public-brand img { width: 68px; max-height: 82px; object-fit: contain; }
.checkin-public-brand span { color: #e8a14d; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.checkin-public-brand h2 { margin: 2px 0 0; }
.checkin-public-card { width: min(100%, 460px); padding: 28px; border-radius: 22px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.checkin-public-card form { display: grid; gap: 18px; margin-top: 20px; }
.checkin-public-card select { width: 100%; margin-top: 8px; }
.checkin-privacy { margin: 16px 0 0; font-size: .8rem; }
.checkin-success { text-align: center; }
.checkin-success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: var(--success); font-size: 2rem; }
.checkin-error { color: var(--danger); }
.checkin-spinner { width: 42px; height: 42px; margin: 0 auto; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: checkin-spin .8s linear infinite; }
@keyframes checkin-spin { to { transform: rotate(360deg); } }

.games-toolbar { display: flex; gap: 10px; margin: 20px 0; }
.games-toolbar input,
.games-toolbar select { width: 100%; }
.games-layout { display: grid; grid-template-columns: minmax(230px, .38fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.game-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; max-height: 72vh; overflow: auto; }
.game-list-card { display: grid; width: 100%; gap: 5px; padding: 14px; text-align: left; color: inherit; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; }
.game-list-card:hover,
.game-list-card.active { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.game-team { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.game-list-meta { color: var(--muted); font-size: .82rem; }
.game-detail { min-width: 0; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.game-detail-head h3 span { color: var(--primary); }
.game-observation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.game-observation-grid label { font-size: .8rem; font-weight: 700; }
.game-observation-grid textarea { width: 100%; margin-top: 6px; }
.atlas-panel { background: linear-gradient(145deg, var(--surface), var(--surface-2)); }
.atlas-connect { display: flex; align-items: end; gap: 8px; margin-top: 14px; }
.atlas-connect input { width: 100%; margin-top: 5px; }
.atlas-summary { padding: 14px; border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: var(--surface-2); line-height: 1.55; }
.atlas-analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.atlas-analysis-grid > div { padding: 12px; border-radius: 12px; background: var(--surface); }
.atlas-analysis-grid ul { margin: 8px 0 0; padding-left: 18px; }
.atlas-provenance { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.atlas-provenance span { padding: 4px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .7rem; }
.atlas-stat-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.atlas-stat-strip span { display: grid; justify-items: center; padding: 10px 6px; border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .68rem; font-weight: 800; }
.atlas-stat-strip strong { color: var(--text); font-size: 1.15rem; }
.atlas-mapping-warning { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--warning) 12%, transparent); font-size: .82rem; }
.atlas-linked { display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 999px; background: var(--primary-light); color: var(--cta); font-size: .58rem; font-weight: 900; text-transform: uppercase; }
.game-boxscore input { min-width: 58px; width: 68px; padding: 6px; }
.game-boxscore input[type="text"] { min-width: 160px; width: 100%; }
.stat-pair { display: inline-flex; align-items: center; gap: 3px; }
.stat-pair input { min-width: 48px; width: 48px; }
.stat-pair i { color: var(--muted); font-style: normal; }
.game-next-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* Kampfgericht: Jugend-Heimspiele mit fairer Herren-Einteilung. */
.tablecrew-view {
  display: grid;
  gap: 1.25rem;
}

.tablecrew-head {
  margin-bottom: 0;
}

.tablecrew-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.tablecrew-kpis > div {
  min-width: 0;
  padding: 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tablecrew-kpis span,
.tablecrew-kpis strong {
  display: block;
}

.tablecrew-kpis span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.tablecrew-kpis strong {
  margin-top: 0.35rem;
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.tablecrew-kpis .has-warning {
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.tablecrew-roster-panel,
.tablecrew-plan-panel,
.tablecrew-workload-panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 0.0625rem solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-head.compact {
  margin-bottom: 1rem;
}

.section-head.compact h3 {
  margin: 0.15rem 0 0;
}

.tablecrew-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.tablecrew-roster-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-2);
}

.tablecrew-player {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.tablecrew-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tablecrew-player span {
  color: var(--muted);
  font-size: 0.75rem;
}

.tablecrew-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.tablecrew-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #00633e;
}

.tablecrew-license {
  padding: 0.35rem 0.5rem;
  border-radius: 999rem;
  color: #ffffff;
  background: #666666;
}

.tablecrew-games {
  display: grid;
  gap: 0.85rem;
}

.tablecrew-game-card {
  overflow: hidden;
  border: 0.0625rem solid var(--border);
  border-radius: 1rem;
  background: var(--surface-2);
}

.tablecrew-game-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.tablecrew-game-head h4 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1.05rem;
}

.tablecrew-game-head h4 span {
  color: var(--primary);
}

.tablecrew-game-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tablecrew-game-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tablecrew-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 0.0625rem solid var(--border);
}

.tablecrew-role {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0.85rem;
  border-right: 0.0625rem solid var(--border);
}

.tablecrew-role:last-child {
  border-right: 0;
}

.tablecrew-role > span {
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.tablecrew-role > span b {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999rem;
  color: #ffffff;
  background: #666666;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.tablecrew-role select {
  width: 100%;
  min-width: 0;
  background: var(--surface);
}

.tablecrew-role--laptop {
  box-shadow: inset 0 0.25rem 0 #666666;
}

.tablecrew-role--shot {
  box-shadow: inset 0 0.25rem 0 #0bafc7;
}

.tablecrew-role--score {
  box-shadow: inset 0 0.25rem 0 #63a91f;
}

.tablecrew-workload tr.is-disabled {
  opacity: 0.5;
}

.tablecrew-workload th:not(:first-child),
.tablecrew-workload td:not(:first-child) {
  text-align: center;
}

.tablecrew-view .auth-status[data-status="error"] {
  color: var(--danger);
}

.tablecrew-view .auth-status[data-status="ok"] {
  color: var(--success);
}

/* Offizieller Spielplan und KI-Saisonplanung. */
.schedule-source {
  margin-bottom: 1rem;
}

.schedule-source summary {
  cursor: pointer;
  list-style-position: outside;
}

.schedule-source[open] summary {
  margin-bottom: 1rem;
}

.season-ai-panel {
  display: grid;
  gap: 1rem;
}

.season-ai-panel .section-head {
  margin-bottom: 0;
}

.season-plan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.season-plan-summary > div {
  min-width: 0;
  padding: 0.9rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-2);
}

.season-plan-summary span,
.season-plan-summary strong {
  display: block;
}

.season-plan-summary span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.season-plan-summary strong {
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.season-coach-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.season-coach-inputs textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.season-source-note {
  margin: 0;
  font-size: 0.75rem;
}

.friday-variant-box {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border: 0.0625rem solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.friday-variant-box strong,
.friday-variant-box p {
  display: block;
  margin: 0.2rem 0 0;
}

@media (max-width: 900px) {
  .coach-briefing-grid,
  .plan-load-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .games-layout { grid-template-columns: 1fr; }
  .game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .game-observation-grid,
  .atlas-analysis-grid { grid-template-columns: 1fr; }
  .tablecrew-roster { grid-template-columns: 1fr; }
  .season-plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .coach-briefing-head,
  .development-head,
  .atlas-head,
  .game-detail-head { flex-direction: column; }
  .checkin-card { grid-template-columns: 1fr; }
  .checkin-qr { grid-column: 1; }
  .goal-feedback-form,
  .games-toolbar { grid-template-columns: 1fr; display: grid; }
  .game-list { grid-template-columns: 1fr; }
  .atlas-connect { align-items: stretch; flex-direction: column; }
  .atlas-stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-next-actions { flex-direction: column; }
  .tablecrew-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tablecrew-head,
  .tablecrew-game-head,
  .section-head.compact { align-items: stretch; flex-direction: column; }
  .tablecrew-head .head-actions,
  .section-head.compact .head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tablecrew-head .head-actions .btn,
  .section-head.compact .head-actions .btn { width: 100%; }
  .tablecrew-role-grid { grid-template-columns: 1fr; }
  .tablecrew-role { border-right: 0; border-bottom: 0.0625rem solid var(--border); }
  .tablecrew-role:last-child { border-bottom: 0; }
  .tablecrew-roster-row { grid-template-columns: 1fr 1fr; }
  .tablecrew-player { grid-column: 1 / -1; }
  .season-coach-inputs { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .tablecrew-kpis { grid-template-columns: 1fr; }
  .tablecrew-head .head-actions,
  .section-head.compact .head-actions { grid-template-columns: 1fr; }
  .season-plan-summary { grid-template-columns: 1fr; }
}

/* Konto, Rollen und Team-Synchronisierung */
.account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1.75rem;
  border: 0.0625rem solid #ffffff1f;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 0%, #e8a14d33 0, transparent 14rem),
    linear-gradient(145deg, #005d36 0%, #003a20 100%);
  box-shadow: var(--shadow);
  color: #ffffff;
}

.account-hero h3 {
  margin: 0 0 0.5rem;
  color: #ffffff;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
}

.account-hero p {
  max-width: 48rem;
  margin: 0;
  color: #ffffffad;
}

.sync-indicator {
  min-width: 12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border: 0.0625rem solid #ffffff24;
  border-radius: 999rem;
  background: #ffffff12;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(0.75rem);
}

.sync-indicator i {
  width: 0.625rem;
  height: 0.625rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a8b8b0;
  box-shadow: 0 0 0 0.25rem #ffffff12;
}

.sync-indicator[data-status="synced"] i { background: #4ade80; }
.sync-indicator[data-status="syncing"] i,
.sync-indicator[data-status="pending"] i { background: #e8a14d; animation: sync-pulse 1s ease-in-out infinite; }
.sync-indicator[data-status="offline"] i,
.sync-indicator[data-status="error"] i { background: #f87171; }

@keyframes sync-pulse {
  50% { transform: scale(1.35); box-shadow: 0 0 0 0.5rem #e8a14d1f; }
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.auth-card,
.account-session {
  position: relative;
  padding: 1.5rem;
  overflow: hidden;
  border: 0.0625rem solid var(--border);
  border-top: 0.25rem solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.auth-card .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-card-number {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  color: var(--primary-light);
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
}

.auth-status {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.account-profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-avatar {
  width: 4.5rem;
  height: 4.5rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, #e8a14d, #f5bd79);
  color: #003a20;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 0.75rem 1.75rem #e8a14d33;
}

.account-role {
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-profile-card h3 {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.account-details > div {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.account-details span {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-details strong {
  overflow: hidden;
  font-size: 0.875rem;
  text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .account-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-indicator { min-width: 0; }
  .auth-grid { grid-template-columns: 1fr; }
  .account-details { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sync-indicator i { animation: none !important; }
}

.timer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.timer-display {
  font-family: var(--font-body);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--cta);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.timer-display.done {
  color: var(--primary);
  animation: pulse 0.5s ease-in-out 5;
}

.timer-state {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.timer-state.running { color: var(--accent); }
.timer-state.finished { color: var(--primary); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.timer-custom {
  width: 70px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  text-align: center;
}

.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.wd-btn {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.wd-btn.active {
  background: var(--cta);
  border-color: var(--cta);
  color: white;
}

.wd-btn:hover { transform: scale(1.05); }

.plan-box {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.plan-head {
  font-weight: 700;
  color: var(--cta);
  margin-bottom: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-box p { margin: 0 0 6px 0; }

.plan-drills {
  list-style: decimal;
  padding-left: 20px;
  margin: 8px 0 0 0;
}

.plan-drills li {
  margin-bottom: 8px;
  display: block;
}

.drill-name { font-weight: 600; }

.plan-drills .btn { margin-top: 4px; }

.plan-drill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-drill-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.plan-drill-controls {
  list-style: none;
  margin-left: -20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.plan-drill-hint {
  list-style: none;
  margin-left: -20px;
  font-size: 13px;
}

.drill-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.drill-filters .search-input { flex: 1; min-width: 180px; margin-bottom: 0; }

.drill-filters select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.drill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drill-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.12s;
}

.drill-item > a {
  display: block;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
}

.drill-item:hover { background: var(--primary-light); }

.drill-item .name { font-weight: 600; margin-bottom: 2px; }
.drill-item .meta { font-size: 13px; color: var(--text-muted); }
.drill-item .meta.muted { font-size: 12px; margin-top: 4px; }

.drill-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.drill-pick .info { flex: 1; min-width: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0; }

.modal-body {
  padding: 14px 18px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.drill-import-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.drill-import-list { list-style: none; padding: 0; margin: 0; }
.drill-import-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.drill-import-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.drill-import-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.drill-import-item:last-child { border-bottom: none; }

.tactics-steps {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.tactics-steps-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.step-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.step-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.step-duration-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.step-duration-label input {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.tactics-playback {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 4px 0 8px;
  flex-wrap: wrap;
}
.tactics-playback [data-role="playback-status"] { margin-left: auto; font-size: 13px; }

.tactics-ai-text {
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  max-height: 50vh;
  overflow-y: auto;
}

.gif-speed-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}
.gif-speed-options label {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.tactics-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 6px 0;
}

.tactics-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.tactics-tool .tool-icon { font-size: 15px; line-height: 1; }
.tactics-tool:hover { background: var(--primary-light); }
.tactics-tool.active {
  background: var(--cta);
  color: var(--cta-text, #fff);
  border-color: var(--cta);
}
.tactics-tool:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 480px) {
  .tactics-toolbar { gap: 8px; }
  .tactics-toolbar .tool-label { display: none; }
  .tactics-tool {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    flex: 1 1 44px;
  }
  .tactics-tool .tool-icon { font-size: 18px; }
}

.tactics-court { touch-action: none; cursor: crosshair; }
.tactics-court .tactics-token.offense circle, .tactics-preview-court .tactics-token.offense circle {
  fill: var(--primary);
  stroke: var(--cta);
  stroke-width: 2;
}
.tactics-court .tactics-token text, .tactics-preview-court .tactics-token text {
  fill: #fff;
  font-weight: 700;
  font-size: 11px;
  user-select: none;
  pointer-events: none;
}

.tactics-library {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.tactics-library label, .tactics-context label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.tactics-library input, .tactics-library select, .tactics-context input, .tactics-context select { min-width: 0; box-sizing: border-box; width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.tactics-context { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 8px 0; padding: 10px; border: 1px solid var(--border); border-left: 4px solid var(--cta); border-radius: 8px; background: var(--surface-2); }
.tactics-context strong { min-width: 110px; }
.tactics-player-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tactics-player-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); }
.tactics-player-step { max-width: 650px; margin: 12px auto; }
.tactics-preview-court { display: block; width: 100%; height: auto; }
.tactics-court .tactics-token.defense rect, .tactics-preview-court .tactics-token.defense rect { fill: #2e6eaa; stroke: #123a61; stroke-width: 2; }
.tactics-court .tactics-token.selected > :first-child, .tactics-court .tactics-ball.selected circle { stroke: #111; stroke-width: 4; }
.tactics-court .tactics-ball circle, .tactics-preview-court .tactics-ball {
  fill: #e67e22;
  stroke: #7a3f11;
  stroke-width: 1.5;
}
.tactics-court .tactics-arrow {
  stroke-width: 3;
  fill: none;
}
.tactics-court .tactics-arrow.run, .tactics-preview-court .tactics-arrow.run { stroke: var(--cta); }
.tactics-court .tactics-arrow.pass, .tactics-preview-court .tactics-arrow.pass {
  stroke: var(--primary);
  stroke-dasharray: 6 4;
}
.tactics-court .tactics-arrow.dribble, .tactics-preview-court .tactics-arrow.dribble { stroke: #7b4ea3; stroke-dasharray: 3 5; }
.tactics-court .tactics-arrow.screen, .tactics-preview-court .tactics-arrow.screen { stroke: #4d5968; stroke-width: 5; }
.tactics-court .tactics-arrow.closeout, .tactics-preview-court .tactics-arrow.closeout { stroke: #2e6eaa; stroke-dasharray: 10 3; }
.tactics-court .tactics-arrow.rotation, .tactics-preview-court .tactics-arrow.rotation { stroke: #8c4a20; stroke-dasharray: 8 4 2 4; }
.tactics-court .tactics-zone, .tactics-preview-court .tactics-zone { fill: rgba(46, 110, 170, .16); stroke: #2e6eaa; stroke-width: 2; }
.tactics-court .tactics-zone.selected { stroke: #111; stroke-width: 4; }
.tactics-court .tactics-cone, .tactics-preview-court .tactics-cone { fill: #e8a14d; stroke: #7a4a1a; stroke-width: 1.5; }
.tactics-court .tactics-preview { fill: var(--cta); }
.tactics-court .tactics-text {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3;
  stroke-linejoin: round;
}

.tactics-legend {
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 740px) { .tactics-library { grid-template-columns: 1fr 1fr; } }

.ai-summary-text {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 12px;
}

.ai-summary-fallback {
  display: flex;
  justify-content: flex-start;
  margin: 8px 0 12px 0;
}
.ai-summary-fallback.hidden { display: none; }

@media (max-width: 520px) {
  .modal-backdrop { padding: 16px 8px; align-items: flex-end; }
  .modal { max-height: 85vh; }
}


.subnav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: var(--topbar-height, 110px);
  z-index: 5;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 20px), transparent 100%);
          mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 20px), transparent 100%);
}

.subnav[data-scroll-end="true"] {
  -webkit-mask-image: none;
          mask-image: none;
}

.subnav::-webkit-scrollbar { display: none; }

.subnav-btn {
  flex: 1;
  min-width: max-content;
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}

.subnav-btn:hover { color: var(--text); background: var(--surface-2); }

.subnav-btn.active {
  background: var(--cta);
  color: white;
}

.pane.hidden { display: none; }

.player-notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.pn-card.status-pending { border-left-color: var(--border); }
.pn-card.status-present { border-left-color: var(--accent); }
.pn-card.status-absent { border-left-color: var(--danger); }
.pn-card.status-excused { border-left-color: var(--warning); }
.pn-card.status-injured { border-left-color: var(--info); }

.att-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.pn-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pn-head .name { font-weight: 600; font-size: 16px; }

.pn-text {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}

.pn-text:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

[data-theme="dark"] .pn-text { border-color: var(--border); }

.list-section-head {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 4px 4px 4px !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
  display: block !important;
  list-style: none;
}

.list-section-head.past { color: var(--muted); margin-top: 12px; }

.session-list li.past a { opacity: 0.7; }
.session-list li.past .name { font-weight: 500; }

@media (max-width: 600px) {
  .subnav-btn { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 480px) {
  .ranking li { grid-template-columns: 24px 1fr 60px auto; gap: 6px; font-size: 13px; }
  .dash-big { font-size: 30px; }
}

.ft-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.ft-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ft-card {
  background: var(--surface);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.ft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ft-head .name { font-weight: 600; font-size: 16px; }

.ft-pct {
  font-variant-numeric: tabular-nums;
  background: var(--primary-light);
  color: var(--cta);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.ft-row {
  display: grid;
  grid-template-columns: minmax(56px, auto) 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.ft-label {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ft-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-input);
  font-size: 20px;
  font-weight: 600;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  height: 44px;
  user-select: none;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ft-btn:active { background: var(--surface-2); }
.ft-btn.plus { background: var(--primary); border-color: var(--primary); color: white; }
.ft-btn.plus:active { background: var(--primary-hover); }

.ft-input {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 100%;
  height: 44px;
  -moz-appearance: textfield;
  font-family: inherit;
}

.ft-input::-webkit-outer-spin-button,
.ft-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ft-input:focus { outline: 2px solid var(--primary); }

.fit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.fit-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
}
.fit-grid input {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  height: 44px;
  font-family: inherit;
  -moz-appearance: textfield;
  touch-action: manipulation;
}
@media (max-width: 380px) {
  .fit-grid { grid-template-columns: 1fr; }
}
.fit-grid input::-webkit-outer-spin-button,
.fit-grid input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fit-grid input:focus { outline: 2px solid var(--primary); }
[data-theme="dark"] .fit-grid input { border-color: var(--border); }

.shot-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px 0;
}

.shot-tab {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
}

.shot-tab:hover { background: var(--surface-2); }

.shot-tab.active {
  background: var(--cta);
  border-color: var(--cta);
  color: white;
}

.shot-tab.add {
  background: transparent;
  border: 1px dashed var(--border-input);
  color: var(--muted);
}

.shot-tab-del {
  font-size: 16px;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
  padding: 0 2px;
  border-radius: 4px;
}

.shot-tab-del:hover { opacity: 1; background: rgba(0,0,0,0.1); }

.shot-add-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.shot-add-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.shot-suggestion {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
}

.shot-suggestion:hover { background: var(--primary-light); border-color: var(--primary); color: var(--cta); }

.shot-add-input {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.shot-add-input input {
  flex: 1;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}

.shot-add-input input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.muted-label { color: var(--muted); font-size: 12px; margin-right: 4px; font-weight: 600; }

.map-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 10px;
}

.map-controls select {
  background: var(--surface);
  border: 1px solid var(--border-input);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  margin-top: 4px;
}

.map-mode {
  display: flex;
  gap: 4px;
}

.court-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
  max-width: 500px;
  margin: 0 auto;
}

.court {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

[data-role="court-hit"] { cursor: crosshair; }

.map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
}

[data-theme="dark"] .shot-add-input input { border-color: var(--border); }

@media (max-width: 500px) {
  .level-box .value { font-size: 44px; }
  .shuttle-box .value, .speed-box .value { font-size: 24px; }
  .btn.big { padding: 14px 18px; font-size: 16px; }
}

@media (max-width: 600px) {
  main {
    padding:
      14px
      calc(12px + env(safe-area-inset-right))
      calc(14px + env(safe-area-inset-bottom))
      calc(12px + env(safe-area-inset-left));
  }
  h2 { font-size: 20px; }
  h3 { margin-top: 22px; }

  /* iOS Safari zoomt auf <16px Inputs beim Fokus rein */
  .form-row input,
  .search-input,
  .note-title,
  .note-body,
  .block-label textarea,
  .att-note,
  .ft-input,
  .timer-custom,
  .shot-add-input input,
  .fit-grid input { font-size: 16px; }

  .section-head { gap: 6px; row-gap: 8px; }
  .section-head > div { display: flex; flex-wrap: wrap; gap: 6px; }
  .section-head .btn,
  .section-head .btn.small { padding: 7px 10px; font-size: 12px; }

  table.results th,
  table.results td { padding: 8px 10px; font-size: 13px; }
  table.results th { font-size: 11px; letter-spacing: 0.3px; }

  .form-row { gap: 8px; }
  .form-row label { min-width: 120px; }

  .heatmap-controls { gap: 12px; font-size: 13px; }
  .heatmap-controls label { min-height: 32px; }

  .player-list li,
  .session-list li,
  .session-list a { padding: 12px 14px; }
  .player-list .name,
  .runner-list .name,
  .rank-name { overflow-wrap: anywhere; }

  .att-card { padding: 12px; }
  .ft-card { padding: 12px; }

  .dash-grid { gap: 10px; }
  .dash-card { padding: 14px; }
  .dash-big { font-size: 30px; }

  .cat-block { padding: 10px 12px; }
  .trend-block { margin-bottom: 12px; }
}

@media (max-width: 420px) {
  h2 { font-size: 18px; }
  .section-head .btn,
  .section-head .btn.small { padding: 6px 8px; font-size: 11px; }
  .ranking li { padding: 8px 10px; }
}

.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;
}

.season-select {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.season-select select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   Team-Wurfquote-Card (Training-Übersicht)
   ============================================================ */

.team-quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin: 16px 0 20px;
  box-shadow: var(--shadow-sm);
}

.team-quote-card:empty { display: none; }

.team-quote-empty {
  margin: 4px 0 0;
  font-size: 14px;
}

.team-quote-head { display: block; }

.team-quote-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.team-quote-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.team-quote-big {
  font-size: 32px;
  font-weight: 700;
  color: var(--cta);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.team-quote-sub {
  font-size: 15px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.quote-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.quote-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

.quote-chip-name { font-weight: 600; }
.quote-chip-frac { color: var(--muted); font-size: 12px; }
.quote-chip-pct { font-weight: 700; }

.quote-chip-best {
  background: rgba(0, 128, 0, 0.12);
  color: #065f46;
}
.quote-chip-best .quote-chip-frac { color: #065f46; opacity: 0.75; }

.quote-chip-worst {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}
.quote-chip-worst .quote-chip-frac { color: #b91c1c; opacity: 0.75; }

[data-theme="dark"] .quote-chip-best {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}
[data-theme="dark"] .quote-chip-best .quote-chip-frac { color: #86efac; opacity: 0.75; }

[data-theme="dark"] .quote-chip-worst {
  background: rgba(248, 113, 113, 0.22);
  color: #fca5a5;
}
[data-theme="dark"] .quote-chip-worst .quote-chip-frac { color: #fca5a5; opacity: 0.75; }

.team-quote-ft {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.team-quote-ft-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}

.team-quote-ft-frac {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.team-quote-ft-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--cta);
}

/* Delta-Badge (grün/rot/grau Trend) */
.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta-up { background: rgba(0, 128, 0, 0.14); color: #065f46; }
.delta-down { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.delta-flat { background: var(--surface-2); color: var(--muted); }

[data-theme="dark"] .delta-up { background: rgba(34, 197, 94, 0.22); color: #86efac; }
[data-theme="dark"] .delta-down { background: rgba(248, 113, 113, 0.22); color: #fca5a5; }

/* ============================================================
   Trainings-Liste: Trend-Ampel-Badge (Feature 2)
   ============================================================ */

.trend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: help;
}

.trend-badge.trend-up { background: rgba(0, 128, 0, 0.14); color: #065f46; }
.trend-badge.trend-down { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.trend-badge.trend-flat { background: var(--surface-2); color: var(--muted); }

[data-theme="dark"] .trend-badge.trend-up { background: rgba(34, 197, 94, 0.25); color: #86efac; }
[data-theme="dark"] .trend-badge.trend-down { background: rgba(248, 113, 113, 0.25); color: #fca5a5; }

/* ============================================================
   Team-Heatmap im Training (Feature 3)
   ============================================================ */

.training-heatmap { margin: 8px 0 20px; }
.section-subhead {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

/* ============================================================
   Streak-Kachel (Feature 4)
   ============================================================ */

.streak-tile:empty { display: none; }

.streak-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 18px;
  align-items: baseline;
}

.streak-head {
  grid-column: 1 / -1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.streak-current {
  grid-column: 1;
  grid-row: 2;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.streak-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--cta);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.streak-unit { font-size: 18px; margin-left: 4px; }

.streak-hot .streak-num { color: var(--primary); }

.streak-sub {
  grid-column: 2;
  grid-row: 2;
  font-size: 13px;
  color: var(--muted);
}

.streak-meta {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.streak-meta strong { color: var(--text); font-weight: 600; }

.streak-flame {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-light);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   FT-Sparkline in Spielerliste (Feature 5)
   ============================================================ */

.player-spark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.ft-sparkline {
  display: block;
  width: 80px;
  height: 20px;
  overflow: visible;
}

@media (max-width: 480px) {
  .player-spark { display: none; }
}

/* ============================================================
   Positions-Stats auf Dashboard (Feature 6)
   ============================================================ */

.pos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
}
.pos-head h3 { margin: 0; }
.pos-sort-label select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  min-height: 36px;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pos-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.pos-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pos-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--cta);
}

.pos-card-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.pos-card-metrics {
  margin: 0;
  display: grid;
  gap: 10px;
}

.pos-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
}

.pos-metric dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  font-weight: 600;
  grid-column: 1;
  grid-row: 1;
}

.pos-metric dd {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  grid-column: 2;
  grid-row: 1;
  font-variant-numeric: tabular-nums;
}

.pos-metric-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.pos-metric-val.muted { color: var(--muted); font-weight: 500; }

.pos-metric-sub {
  font-size: 11px;
  color: var(--muted);
}

.pos-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.pos-bar-fill {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 180ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .pos-bar-fill { transition: none; }
}

/* ============================================================
   Form der Woche (Feature 7)
   ============================================================ */

.form-of-week { margin: 8px 0 20px; }
.form-of-week.hidden { display: none; }

.form-of-week-head {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.form-of-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.form-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease-out, border-color 150ms ease-out;
}

.form-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.form-card:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .form-card { transition: none; }
  .form-card:hover { transform: none; }
}

.form-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.form-card-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-pos-chip {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.form-card-delta {
  font-size: 26px;
  font-weight: 700;
  color: var(--cta);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.form-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.toast-host {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
  max-width: 90vw;
}

.toast .toast-action {
  background: none;
  border: none;
  color: var(--cta);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
}

.toast .toast-action:hover { background: var(--primary-light); }
.toast .toast-action:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

.sprint-stopwatch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sprint-stopwatch .timer-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.sprint-hint {
  margin: 0;
  font-size: 12px;
  text-align: center;
}

.sprint-list .sprint-card {
  cursor: default;
  transition: background 0.15s ease, border-left-color 0.15s ease;
}
.sprint-list.capturing .sprint-card {
  cursor: pointer;
  border-left-color: var(--cta);
}
.sprint-list.capturing .sprint-card:hover,
.sprint-list.capturing .sprint-card:active {
  background: var(--primary-light);
}
.sprint-card.flash {
  animation: sprint-flash 0.6s ease-out;
}
@keyframes sprint-flash {
  0%   { background: var(--primary-light); border-left-color: var(--cta); }
  100% { background: transparent; }
}

.sprint-head { align-items: baseline; }
.sprint-stats {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sprint-best {
  background: var(--primary-light);
  color: var(--cta);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.sprint-avg { font-size: 12px; }

.sprint-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 28px;
  align-items: center;
}
.sprint-time {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3px 4px 3px 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.sprint-time-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
  border-radius: 50%;
}
.sprint-time-del:hover {
  color: var(--danger);
  background: rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .sprint-card.flash { animation: none; }
}

.plan-summary-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.plan-summary-field > span {
  font-size: 12px;
  color: var(--muted);
}
.plan-summary-field textarea {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.plan-drill-actions .btn.active {
  background: var(--cta);
  border-color: var(--cta);
  color: white;
}

.plan-drill-desc {
  margin-top: 4px;
  font-size: 13px;
}

.plan-drill-edit {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-drill-edit.hidden { display: none; }
.plan-drill-edit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.plan-drill-edit input,
.plan-drill-edit textarea {
  background: var(--surface);
  border: 1px solid var(--border-input);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.plan-drill-edit textarea { resize: vertical; }
.plan-drill-edit [data-action="edit-close"] { align-self: flex-end; }

/* ============================================================
   Fitness-Bilanz + Sprint-Bilanz (Uebersichts-Tab)
   ============================================================ */

.fitness-bilanz,
.sprint-bilanz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 0 0 20px;
  box-shadow: var(--shadow-sm);
}

.fitness-bilanz.hidden,
.sprint-bilanz.hidden { display: none; }

.fitness-metric-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.fitness-metric {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fitness-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.fitness-metric-label {
  font-weight: 600;
  font-size: 14px;
}

.fitness-metric-count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.fitness-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.fitness-metric-best { font-weight: 600; }
.fitness-metric-avg { color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  vertical-align: 1px;
}

.tag-best {
  background: rgba(0, 128, 0, 0.14);
  color: #065f46;
}

[data-theme="dark"] .tag-best {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.fitness-trend-wrap {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.fitness-trend-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.fitness-trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitness-trend {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 13px;
}

.fitness-trend-name {
  font-weight: 600;
  min-width: 80px;
}

.fitness-trend-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.delta-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta-chip.delta-up { background: rgba(0, 128, 0, 0.14); color: #065f46; }
.delta-chip.delta-down { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
[data-theme="dark"] .delta-chip.delta-up { background: rgba(34, 197, 94, 0.22); color: #86efac; }
[data-theme="dark"] .delta-chip.delta-down { background: rgba(248, 113, 113, 0.22); color: #fca5a5; }

.sprint-bilanz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Spieler-Stats-Modal (Klick auf Spielername in Anwesenheit)
   ============================================================ */

.name-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}
.name-btn:hover,
.name-btn:focus {
  color: var(--cta);
  border-bottom-color: var(--cta);
  outline: none;
}

.player-stats-modal {
  max-width: 520px;
}

.ps-subtitle {
  font-size: 13px;
  margin-bottom: 12px;
}

.ps-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ps-block {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.ps-block-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.ps-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.ps-row-label {
  min-width: 110px;
  font-weight: 600;
}

.ps-small {
  font-size: 12px;
}

/* ============================================================
   Alerts-Karte (Dashboard)
   ============================================================ */

.phase-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
}
.phase-banner.hidden { display: none; }
.phase-banner-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.phase-banner-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.phase-banner-focus {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.phase-banner-days {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.phase-banner-bar-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.phase-banner-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.phase-banner-goals {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.phase-banner-goals.hidden { display: none; }
.phase-banner-goals li {
  font-size: 13px;
  padding-left: 14px;
  position: relative;
  color: var(--text-muted);
}
.phase-banner-goals li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
}
.phase-banner-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.alerts-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  margin: 16px 0 18px;
  box-shadow: var(--shadow-sm);
}

.alerts-card.hidden { display: none; }

.alerts-head {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 3px solid var(--border);
  background: var(--surface-2);
}

.alert-row a {
  color: inherit;
  text-decoration: none;
}

.alert-row a:hover {
  text-decoration: underline;
}

.alert-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.alert-warn {
  border-left-color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}

.alert-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .alert-warn {
  background: rgba(245, 158, 11, 0.14);
}

[data-theme="dark"] .alert-info {
  background: rgba(96, 165, 250, 0.14);
}

/* ============================================================
   Trainings-Template-Picker
   ============================================================ */

.template-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.template-item .info {
  flex: 1;
  min-width: 0;
}

.template-item .name {
  font-weight: 600;
  font-size: 14px;
}

.template-item .meta {
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================
   COURTHUB · APP SHELL 2026
   Visuelle Brücke zur Vereinswebsite, mobile-first PWA
   ========================================================= */

:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --text: #102019;
  --muted: #67736d;
  --primary: #e8a14d;
  --primary-hover: #f0b968;
  --primary-light: #e8a14d24;
  --cta: #004b2b;
  --cta-dark: #003a20;
  --accent: #008000;
  --border: #10201914;
  --border-input: #10201924;
  --shadow-sm: 0 0.25rem 1rem #1020190f;
  --shadow: 0 1rem 2.5rem #10201914;
  --shadow-lg: 0 1.5rem 4rem #10201924;
  --rail-width: 17.5rem;
  --radius-xs: 0.625rem;
  --radius-sm: 0.875rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.75rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #07140f;
  --surface: #0e2119;
  --surface-2: #153126;
  --text: #f6f4ef;
  --muted: #a8b8b0;
  --primary: #e8a14d;
  --primary-hover: #f0b968;
  --primary-light: #e8a14d2e;
  --cta: #e8a14d;
  --cta-dark: #f0b968;
  --accent: #4ade80;
  --border: #ffffff17;
  --border-input: #ffffff29;
  --shadow-sm: 0 0.25rem 1rem #00000033;
  --shadow: 0 1rem 2.5rem #00000047;
  --shadow-lg: 0 1.5rem 4rem #00000066;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 92% 4%, #e8a14d18 0, transparent 24rem),
    radial-gradient(circle at 28% 96%, #004b2b12 0, transparent 34rem),
    var(--bg);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  min-height: 100dvh;
  padding:
    calc(1.5rem + env(safe-area-inset-top))
    1.25rem
    calc(1.25rem + env(safe-area-inset-bottom));
  gap: 1.75rem;
  z-index: 100;
  overflow: hidden;
  border: 0;
  border-right: 0.1875rem solid var(--primary);
  border-radius: 0;
  background:
    radial-gradient(circle at 10% 0%, #ffffff14 0, transparent 16rem),
    linear-gradient(165deg, #005d36 0%, #004b2b 44%, #002f1b 100%);
  box-shadow: 0.75rem 0 3rem #001b1038;
}

.topbar::after {
  content: "1850";
  position: absolute;
  right: -0.875rem;
  bottom: 1rem;
  z-index: -1;
  color: #ffffff0a;
  font-family: var(--font-display);
  font-size: 4.75rem;
  letter-spacing: 0.15em;
  transform: rotate(-90deg) translateX(100%);
  transform-origin: right bottom;
}

.topbar-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 1rem;
}

.brand {
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 1rem;
  background: var(--primary);
  box-shadow: 0 0.75rem 1.75rem #00000033;
  transform: rotate(-3deg);
}

.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  border-radius: 0.75rem;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-kicker {
  color: #ffffffa8;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-text {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.topbar-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 0.375rem;
}

.theme-toggle,
.settings-btn,
.hamburger,
.install-btn {
  min-width: 2.75rem;
  height: 2.75rem;
  border: 0.0625rem solid #ffffff26;
  border-radius: 0.875rem;
  background: #ffffff10;
  color: #ffffff;
  box-shadow: none;
  backdrop-filter: blur(1rem);
}

.theme-toggle:hover,
.settings-btn:hover,
.hamburger:hover,
.install-btn:hover {
  border-color: #e8a14d99;
  background: #e8a14d24;
}

.install-btn {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
}

.topbar nav {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #e8a14d66 transparent;
}

.topbar nav a {
  min-height: 2.875rem;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 0.0625rem solid transparent;
  border-radius: 0.875rem;
  background: transparent;
  color: #ffffffc7;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s var(--ease-out);
}

.topbar nav a:hover {
  border-color: #ffffff12;
  background: #ffffff12;
  color: #ffffff;
  transform: translateX(0.1875rem);
}

.topbar nav a.active {
  border-color: #e8a14d66;
  background: linear-gradient(90deg, #e8a14d 0%, #efb56f 100%);
  color: #102019;
  box-shadow: 0 0.75rem 1.5rem #001f1247;
}

.nav-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.625rem;
  background: #ffffff0d;
  font-size: 1rem;
  line-height: 1;
}

.topbar nav a.active .nav-icon {
  background: #004b2b14;
}

.nav-section-label {
  margin: 0.75rem 0.75rem 0.25rem;
  color: #ffffff66;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.topbar nav .club-link {
  margin-top: auto;
  border-color: #e8a14d4d;
  color: #f5c487;
}

main {
  max-width: none;
  min-height: 100dvh;
  margin-left: var(--rail-width);
  padding:
    2.5rem
    max(2rem, calc((100vw - var(--rail-width) - 90rem) / 2))
    4rem;
}

.view {
  width: min(100%, 90rem);
  margin: 0 auto;
  animation: view-enter 0.45s var(--ease-out) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-dock {
  display: none;
}

.coach-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(15rem, 0.6fr);
  gap: 2rem;
  min-height: 20rem;
  margin-bottom: 2rem;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  overflow: hidden;
  border: 0.0625rem solid #ffffff1f;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, transparent 0 66%, #e8a14d1f 66% 68%, transparent 68%),
    radial-gradient(circle at 82% 20%, #e8a14d3d 0, transparent 16rem),
    linear-gradient(145deg, #00603a 0%, #004b2b 48%, #002f1b 100%);
  box-shadow: 0 2rem 5rem #00341e33;
  color: #ffffff;
}

.coach-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(-45deg, transparent, transparent 3.75rem, #ffffff08 3.75rem, #ffffff08 3.875rem);
}

.coach-hero-copy,
.coach-hero-actions {
  position: relative;
  z-index: 2;
}

.coach-hero-copy {
  align-self: center;
}

.coach-eyebrow,
.section-kicker,
.dialog-kicker {
  display: block;
  margin-bottom: 0.625rem;
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.coach-hero h2 {
  max-width: 48rem;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.25rem, 5.2vw, 4.75rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.coach-hero h2 span {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.coach-hero-copy > p {
  max-width: 39rem;
  margin: 1.25rem 0 0;
  color: #ffffffbd;
  font-size: 1rem;
  line-height: 1.65;
}

.coach-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.connection-chip,
.today-chip {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 0.0625rem solid #ffffff1f;
  border-radius: 999rem;
  background: #ffffff10;
  color: #ffffffc7;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(0.75rem);
}

.connection-chip i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0.25rem #4ade8024;
}

.connection-chip.offline i {
  background: var(--primary);
  box-shadow: 0 0 0 0.25rem #e8a14d24;
}

.coach-hero-actions {
  display: flex;
  align-self: center;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-action {
  width: 100%;
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border: 0.0625rem solid #ffffff2e;
  border-radius: 1rem;
  background: #ffffff10;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(1rem);
  transition: transform 0.25s var(--ease-out), background 0.25s ease, border-color 0.25s ease;
}

.hero-action strong {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.6875rem;
  background: #ffffff14;
  font-size: 1rem;
}

.hero-action:hover {
  border-color: #e8a14d80;
  background: #ffffff1c;
  transform: translateX(0.25rem);
}

.hero-action-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #102019;
}

.hero-action-primary strong {
  background: #004b2b1f;
}

.hero-install {
  cursor: pointer;
}

.coach-hero-number {
  position: absolute;
  right: -0.5rem;
  bottom: -1.25rem;
  z-index: 0;
  color: #ffffff08;
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 10rem);
  letter-spacing: 0.06em;
  user-select: none;
}

.section-title-block {
  min-width: 0;
}

.section-title-block .section-kicker {
  margin-bottom: 0.25rem;
  color: var(--muted);
}

.section-title-block h2 {
  margin: 0;
}

h2 {
  color: var(--cta);
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.035em;
}

h3 {
  margin-top: 2.25rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.section-head {
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 0.0625rem solid var(--border);
}

.section-head > div:last-child,
.head-actions,
.form-actions {
  gap: 0.5rem;
}

.btn {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 999rem;
  background: var(--surface);
  box-shadow: 0 0.25rem 0.75rem #1020190a;
  font-size: 0.8125rem;
  font-weight: 800;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  box-shadow: 0 0.75rem 1.5rem #10201917;
  transform: translateY(-0.125rem);
}

.btn.primary,
.btn.cta {
  border-color: #004b2b;
  background: #004b2b;
  color: #ffffff;
}

[data-theme="dark"] .btn.primary,
[data-theme="dark"] .btn.cta {
  border-color: var(--primary);
  background: var(--primary);
  color: #102019;
}

.btn.small {
  min-height: 2.25rem;
  padding: 0.4375rem 0.75rem;
  font-size: 0.75rem;
}

input,
select,
textarea,
.search-input {
  min-height: 2.75rem;
  border-radius: 0.75rem !important;
  accent-color: var(--primary);
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus {
  outline: 0;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 0.25rem var(--primary-light);
}

.dash-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-card {
  position: relative;
  min-height: 10rem;
  padding: 1.375rem;
  overflow: hidden;
  border: 0.0625rem solid var(--border);
  border-top: 0.25rem solid var(--primary);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, transparent 70%, var(--primary-light) 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}

.dash-card:hover {
  border-color: #e8a14d66;
  box-shadow: var(--shadow);
  transform: translateY(-0.25rem);
}

.dash-label {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dash-big {
  margin-top: 0.75rem;
  color: var(--cta);
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.055em;
}

[data-theme="dark"] .dash-big,
[data-theme="dark"] h2 {
  color: var(--primary);
}

.dash-sub {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.player-form,
.setup-form,
.phase-banner,
.alerts-card,
.form-of-week,
.chart-wrap,
.table-scroll,
.court-wrap,
.notes-list li,
.drill-list li,
.training-item,
.schedule-card,
.settings-spots,
.player-list li,
.session-list li,
.runner-list li {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.player-list,
.session-list,
.notes-list,
.drill-list {
  gap: 0.75rem;
}

.player-list li,
.session-list li,
.runner-list li {
  min-height: 4.75rem;
  padding: 1rem 1.125rem;
  border-left: 0.25rem solid transparent;
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease;
}

.player-list li:hover,
.session-list li:hover,
.runner-list li:hover {
  border-left-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateX(0.25rem);
}

.tabs,
.subnav {
  gap: 0.375rem;
  padding: 0.375rem;
  border: 0.0625rem solid var(--border);
  border-radius: 999rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tab,
.subnav-btn {
  min-height: 2.5rem;
  padding: 0.5rem 0.875rem;
  border: 0;
  border-radius: 999rem;
}

.tab.active,
.subnav-btn.active {
  border: 0;
  background: var(--primary);
  color: #102019;
  box-shadow: 0 0.375rem 1rem #e8a14d38;
}

.empty {
  margin: 1rem 0;
  border: 0.0625rem dashed var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.install-dialog {
  width: min(calc(100% - 2rem), 32rem);
  padding: 0;
  overflow: hidden;
  border: 0.0625rem solid #ffffff26;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.install-dialog::backdrop {
  background: #001b10b8;
  backdrop-filter: blur(0.5rem);
}

.install-dialog-card {
  padding: 2rem;
  background: var(--surface);
}

.install-dialog h2 {
  margin-bottom: 1rem;
}

.install-dialog ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text);
}

.install-dialog li {
  margin: 0.625rem 0;
}

@media (max-width: 1100px) {
  :root { --rail-width: 15.5rem; }
  .brand-kicker { display: none; }
  .install-label { display: none; }
  .install-btn { width: 2.75rem; padding: 0; }
  .coach-hero { grid-template-columns: minmax(0, 1.2fr) minmax(13rem, 0.8fr); }
}

@media (max-width: 900px) {
  :root { --rail-width: 0rem; }

  body {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }

  body.nav-open {
    overflow: hidden;
  }

  .topbar {
    position: sticky;
    inset: 0;
    width: 100%;
    min-height: auto;
    padding:
      calc(0.625rem + env(safe-area-inset-top))
      calc(0.75rem + env(safe-area-inset-right))
      0.625rem
      calc(0.75rem + env(safe-area-inset-left));
    overflow: visible;
    border: 0;
    border-bottom: 0.1875rem solid var(--primary);
    box-shadow: 0 0.5rem 2rem #001b1047;
  }

  .topbar::after { display: none; }
  .topbar-head { align-items: center; flex-direction: row; }
  .topbar-actions { width: auto; }
  .brand-mark { width: 2.75rem; height: 2.75rem; border-radius: 0.875rem; }
  .brand-logo { width: 2.25rem; height: 2.25rem; }
  .brand-kicker { display: block; }
  .brand-text { font-size: 0.9375rem; }
  .hamburger { display: none; }

  .topbar nav {
    position: fixed;
    inset:
      calc(4.25rem + env(safe-area-inset-top))
      0
      calc(4.75rem + env(safe-area-inset-bottom));
    display: none;
    width: 100%;
    padding: 1.25rem max(1rem, calc((100vw - 36rem) / 2));
    overflow-y: auto;
    border: 0;
    background:
      radial-gradient(circle at 90% 10%, #e8a14d2b 0, transparent 15rem),
      linear-gradient(160deg, #005d36 0%, #003d23 100%);
    box-shadow: none;
  }

  .topbar nav.open {
    display: flex;
    animation: mobile-menu-in 0.3s var(--ease-out) both;
  }

  @keyframes mobile-menu-in {
    from { opacity: 0; transform: translateY(-0.75rem); }
    to { opacity: 1; transform: translateY(0); }
  }

  .topbar nav a {
    width: 100%;
    min-height: 3.25rem;
    color: #ffffffd1;
  }

  .topbar nav .club-link {
    margin-top: 0.75rem;
  }

  main {
    margin-left: 0;
    padding:
      1rem
      calc(1rem + env(safe-area-inset-right))
      calc(2rem + env(safe-area-inset-bottom))
      calc(1rem + env(safe-area-inset-left));
  }

  .mobile-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    min-height: calc(4.5rem + env(safe-area-inset-bottom));
    padding:
      0.375rem
      max(0.375rem, env(safe-area-inset-right))
      calc(0.375rem + env(safe-area-inset-bottom))
      max(0.375rem, env(safe-area-inset-left));
    border-top: 0.125rem solid var(--primary);
    background: #003b22f5;
    box-shadow: 0 -0.75rem 2rem #001b1038;
    backdrop-filter: blur(1.25rem);
  }

  .mobile-dock a,
  .mobile-dock button {
    min-width: 0;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.375rem 0.25rem;
    border: 0;
    border-radius: 0.875rem;
    background: transparent;
    color: #ffffff9e;
    font-family: inherit;
    text-decoration: none;
  }

  .mobile-dock a > span,
  .mobile-dock button > span {
    font-size: 1.125rem;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-dock small {
    font-size: 0.625rem;
    font-weight: 800;
  }

  .mobile-dock a.active,
  .mobile-dock button[aria-expanded="true"] {
    background: #ffffff12;
    color: var(--primary);
  }

  .mobile-dock .mobile-dock-main {
    width: 4rem;
    height: 4rem;
    min-height: 4rem;
    margin: -1rem auto 0;
    border: 0.25rem solid #003b22;
    border-radius: 1.375rem;
    background: var(--primary);
    color: #102019;
    box-shadow: 0 0.75rem 1.75rem #00000047;
  }

  .mobile-dock .mobile-dock-main.active {
    background: #f5bd79;
    color: #003b22;
  }

  .coach-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 0;
    padding: 1.75rem;
  }

  .coach-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-action {
    min-height: 3.5rem;
  }

  .dash-grid {
    grid-template-columns: repeat(3, minmax(10rem, 1fr));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.125rem 0 1rem;
  }

  .dash-card {
    min-width: 10rem;
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  .brand-kicker { display: none; }
  .brand-text { font-size: 0.8125rem; }
  .brand-copy { max-width: 9.5rem; }
  .install-label { display: none; }
  .install-btn { width: 2.75rem; padding: 0; }

  .coach-hero {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 1.375rem;
  }

  .coach-hero h2 {
    font-size: clamp(2rem, 11vw, 3.25rem);
  }

  .coach-hero-copy > p {
    font-size: 0.875rem;
  }

  .coach-hero-actions {
    grid-template-columns: 1fr;
  }

  .coach-hero-number {
    right: -0.25rem;
    bottom: -0.5rem;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head > div:last-child {
    width: 100%;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
  }

  .section-head > div:last-child > * {
    flex: 0 0 auto;
  }

  .dash-big {
    font-size: 2.75rem;
  }

  .player-list li:hover,
  .session-list li:hover,
  .runner-list li:hover,
  .btn:hover,
  .hero-action:hover {
    transform: none;
  }
}

@media (max-width: 390px) {
  .theme-toggle,
  .settings-btn,
  .install-btn {
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .brand-mark {
    width: 2.5rem;
    height: 2.5rem;
  }

  .brand-logo {
    width: 2rem;
    height: 2rem;
  }

  .brand-text {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .view,
  .topbar nav.open { animation: none; }
  .topbar nav a,
  .dash-card,
  .hero-action,
  .btn,
  .player-list li,
  .session-list li,
  .runner-list li { transition: none; }
}

@media print {
  .mobile-dock,
  .coach-hero,
  .install-dialog {
    display: none !important;
  }

  main {
    margin-left: 0;
    padding: 0;
  }
}

/* CourtHub Preview: verbindliche App-Shell-Kaskade am Dateiende. */
@media (min-width: 901px) {
  :root {
    --rail-width: 15.25rem;
  }

  .topbar {
    width: var(--rail-width);
    padding: 1.4rem 1rem 1.25rem;
    gap: 0.9rem;
    border: 0 !important;
    background: linear-gradient(165deg, #005c3a 0%, #004b2b 58%, #00341f 100%);
    box-shadow: 0.55rem 0 2rem #001b1024;
  }

  .topbar nav a:hover,
  .topbar nav a.active {
    border: 0 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
  }

  main {
    margin-left: var(--rail-width);
    padding: 1.75rem max(2rem, calc((100vw - var(--rail-width) - 72rem) / 2)) 4rem;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    inset: 0;
    width: 100%;
    min-height: calc(5rem + env(safe-area-inset-top));
    padding:
      calc(0.25rem + env(safe-area-inset-top))
      calc(1rem + env(safe-area-inset-right))
      0.25rem
      calc(1rem + env(safe-area-inset-left));
    border: 0 !important;
    background: linear-gradient(150deg, #005c3a 0%, #003c25 100%);
  }

  main {
    margin-left: 0;
    padding:
      0.65rem
      calc(0.8rem + env(safe-area-inset-right))
      calc(1.5rem + env(safe-area-inset-bottom))
      calc(0.8rem + env(safe-area-inset-left));
  }

  .mobile-dock {
    min-height: calc(4.55rem + env(safe-area-inset-bottom));
    padding:
      0.3rem
      max(0.25rem, env(safe-area-inset-right))
      calc(0.3rem + env(safe-area-inset-bottom))
      max(0.25rem, env(safe-area-inset-left));
    border: 0 !important;
    background: linear-gradient(150deg, #005c3af5 0%, #003c25fa 100%);
  }

  .mobile-dock a,
  .mobile-dock button {
    min-height: 3.4rem;
    gap: 0.1rem;
    padding: 0.25rem 0.1rem;
    border-radius: 0.7rem;
    color: #ffffff;
  }

  .mobile-dock a.active {
    background: transparent;
    color: #f58220;
  }

  .mobile-dock .mobile-dock-main,
  .mobile-dock .mobile-dock-main.active {
    width: 4rem;
    height: 4rem;
    min-height: 4rem;
    margin: -1rem auto 0;
    border: 0.18rem solid #ffffff;
    border-radius: 50%;
    background: #ed7b18;
    color: #ffffff;
    box-shadow: 0 0.65rem 1.4rem #001b1045;
  }
}

/* Mobile PWA shell: stabil am sichtbaren Geräte-Viewport, ohne Zoom oder
   Betriebssystem-Gesten zu blockieren. Diese Kaskade bleibt bewusst zuletzt. */
:root {
  --app-viewport-height: 100dvh;
  --mobile-dock-height: 4.55rem;
}

html {
  min-height: 100%;
  min-height: var(--app-viewport-height);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: var(--app-viewport-height);
  overflow-x: clip;
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(var(--mobile-dock-height) + env(safe-area-inset-bottom));
  }

  .mobile-dock {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    width: 100%;
    max-width: none;
    margin: 0;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    isolation: isolate;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
