/* Athleten Tool – Gestaltung nach brand/CLAUDE.md
   Farben, Schriften, Abstände und Radien kommen ausschließlich aus brand/tokens/tokens.css.
   Hier werden nur Rollen kombiniert, keine neuen Farben definiert. */

:root {
  /* Ebenen im Kalender: bewusst ohne zusätzliche Bereichsfarben */
  --layer-to-bg: var(--primary);
  --layer-to-fg: var(--on-primary);
  --layer-ext-bg: var(--info);
  --layer-ext-fg: var(--top-weiss);
  --layer-wk-bg: var(--surface);
  --layer-wk-fg: var(--text);
  --layer-wk-border: var(--accent);
  --layer-dg-bg: var(--bg-muted);
  --layer-dg-fg: var(--text);
  --layer-dg-border: var(--text-muted);
  --header-bg: var(--top-graphit);
  --header-fg: var(--top-offwhite);
  --header-accent: var(--top-bronze-hell);
  --none: var(--top-n300);
  --shadow-panel: 0 24px 60px rgba(31, 30, 28, 0.28);
}
[data-theme="dark"] {
  --layer-ext-fg: var(--on-accent);
  --layer-wk-bg: var(--surface-2);
  --none: var(--accent-dim);
  --header-bg: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-muted); color: var(--text); font-family: var(--font-text); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Schrift */
.h1 { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.05; text-transform: uppercase; margin: 0 0 var(--space-1); }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0 0 var(--space-3); }
.h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.25; margin: var(--space-6) 0 var(--space-2); }
.lead { font-size: 18px; color: var(--text-muted); max-width: 62ch; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.neg { color: var(--bad); }
.prewrap { white-space: pre-wrap; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
small { display: block; font-family: var(--font-text); font-size: 13px; color: var(--text-muted); font-weight: 400; }
code { font-family: var(--font-mono); font-size: 15px; background: var(--top-b50); color: var(--top-graphit); padding: 2px var(--space-2); border-radius: var(--radius-control); }
.prose p { max-width: 68ch; }
.draft-note { color: var(--warn-text); font-weight: 600; }

/* Kopfleiste – immer dunkel, Logo negativ */
.topbar { background: var(--header-bg); color: var(--header-fg); border-bottom: 1px solid var(--top-bronze); padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: var(--space-3) var(--space-6); display: flex; align-items: center; gap: var(--space-8); }
.brand { display: flex; align-items: center; gap: var(--space-4); text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 20px; width: auto; display: block; }
.brand-app { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--header-accent); padding-left: var(--space-4); border-left: 1px solid rgba(243, 240, 234, .25); }
.testswitch label { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--header-accent); white-space: nowrap; }
.testswitch select { min-width: 190px; font: inherit; font-size: 14px; padding: 2px var(--space-2); border-radius: var(--radius-control); border: 1px solid var(--header-accent); background: transparent; color: inherit; }
.testswitch option { color: var(--text); background: var(--surface); }
.mainnav { display: flex; align-items: center; gap: var(--space-1); flex: 1; }
.mainnav > a { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--header-fg); opacity: .8; text-decoration: none; padding: var(--space-2) var(--space-3); }
.mainnav > a:hover { opacity: 1; color: var(--header-fg); }
.mainnav > a.is-active { opacity: 1; box-shadow: inset 0 -2px 0 var(--header-accent); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); font-size: 14px; }
.usermenu a, .usermenu .linkbtn { color: var(--header-fg); opacity: .75; white-space: nowrap; }
.usermenu a:hover, .usermenu .linkbtn:hover { opacity: 1; color: var(--header-fg); }
.usermenu-name { color: var(--header-fg); font-weight: 500; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(243, 240, 234, .35); color: var(--header-fg); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); font: 600 16px var(--font-display); }

/* Seite */
.page { max-width: 1280px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16); }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-6); }
.section { margin-top: var(--space-12); }
.narrow { max-width: 560px; margin: var(--space-6) auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
.col-main > * + *, .col-side > * + * { margin-top: var(--space-6); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.stack > * + * { margin-top: var(--space-4); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-6); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.card-head .h2, .card-head .h3 { margin: 0; }
.crumb { font-size: 14px; text-decoration: none; color: var(--text-muted); }
.crumb::before { content: '‹ '; }
.flash { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-6); border-radius: var(--radius-control); }
.alert { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--bad); padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); margin: 0 0 var(--space-4); }
.empty { background: var(--surface); border: 1px dashed var(--top-n300); border-radius: var(--radius-card); padding: var(--space-8); max-width: 640px; }
.empty.small { padding: var(--space-6); }
.footnote { font-size: 13px; color: var(--text-muted); max-width: 90ch; margin-top: var(--space-3); }

/* Formulare */
[hidden] { display: none !important; }
.field { display: flex; flex-direction: column; gap: var(--space-1); font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }
.field.grow { flex: 1; }
.inline-field { flex-direction: row; }
input[type=text], input[type=search], input[type=email], input[type=url], input[type=password], input[type=date], input[type=time], input[type=number], input:not([type]), select, textarea {
  font-family: var(--font-text); font-size: 16px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--top-n300);
  border-radius: var(--radius-field); padding: var(--space-2) var(--space-3); width: 100%; min-height: 44px;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { border-color: var(--border); background: var(--surface-2); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--text-muted); }
input[type=file] { font: 400 14px var(--font-text); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; }
.check input { margin-top: var(--space-1); width: 18px; height: 18px; accent-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: .01em;
  padding: var(--space-2) var(--space-4); min-height: 44px; border-radius: var(--radius-control); border: 1px solid var(--text); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { border-color: transparent; color: var(--accent); }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-wide { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkbtn.danger { color: var(--bad); }
form.inline { display: inline; }
details.more { margin-top: var(--space-4); }
details > summary { cursor: pointer; color: var(--accent); font-family: var(--font-display); font-weight: 600; }
details[open] > summary { margin-bottom: var(--space-3); }
.copyfield { font-family: var(--font-mono) !important; font-size: 12px !important; }
.copyfield.is-copied { border-color: var(--good); }

/* Ampel: Farbe nur mit Wort */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--none); flex-shrink: 0; }
.dot.s-green { background: var(--good); }
.dot.s-amber { background: var(--warn); }
.dot.s-red { background: var(--bad); }
.status-word { font-family: var(--font-display); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: var(--space-2); }
.status-word.s-green { color: var(--good); }
.status-word.s-amber { color: var(--warn-text); }
.status-word.s-red { color: var(--bad); }
.status-word.s-none { color: var(--text-muted); }
.band { display: inline-flex; gap: 2px; align-items: flex-end; vertical-align: middle; }
.band-day { display: block; width: 8px; height: 22px; border-radius: 1px; background: var(--none); }
.band-day.s-none { background: transparent; box-shadow: inset 0 0 0 1px var(--top-n300); }
.band-day.s-green { background: var(--good); }
.band-day.s-amber { background: var(--warn); }
.band-day.s-red { background: var(--bad); }
.band-day.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.band-wrap { display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-end; }
.band-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; list-style: none; padding: 0; margin: var(--space-3) 0 0; font-size: 13px; color: var(--text-muted); }
.band-legend li { display: flex; align-items: center; gap: var(--space-2); }
.band-legend .band-day { height: 12px; }

.tally { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tally li { display: flex; align-items: baseline; gap: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); font-size: 14px; color: var(--text-muted); }
.tally strong { font-family: var(--font-mono); font-weight: 600; font-size: 20px; color: var(--text); }
.tally .s-red { box-shadow: inset 3px 0 0 var(--bad); }
.tally .s-amber { box-shadow: inset 3px 0 0 var(--warn); }
.tally .s-green { box-shadow: inset 3px 0 0 var(--good); }
.tally .s-none { box-shadow: inset 3px 0 0 var(--none); }

/* Tabellen */
.tablewrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; } /* relative: versteckte Beschriftungen (sr-only) bleiben im Rahmen */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; }
thead th { font-family: var(--font-display); font-size: 14px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--top-n300); padding: var(--space-2) var(--space-3); white-space: nowrap; }
[data-theme="dark"] thead th { border-bottom-color: var(--border); }
tbody th, tbody td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.num { text-align: right; }
thead th.num { font-family: var(--font-display); }
table.compact tbody th, table.compact tbody td { padding: var(--space-2) var(--space-3); }
.tablewrap > .plain { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
tr.is-inactive { opacity: .55; }
tr.is-empty td, tr.is-empty th { color: var(--text-muted); }

table.team { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
table.team tbody th, table.team tbody td { vertical-align: middle; padding: var(--space-3) var(--space-4); }
table.team tbody tr:last-child > * { border-bottom: 0; }
table.team .who { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--text); }
table.team .who strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
table.team .who:hover strong { color: var(--accent); }
table.team tr.row-red > th { box-shadow: inset 3px 0 0 var(--bad); }
table.team tr.row-amber > th { box-shadow: inset 3px 0 0 var(--warn); }
table.team td.num strong { font-size: 18px; font-weight: 600; }
.col-band { width: 1%; white-space: nowrap; }

/* Ebenen */
.chip { display: inline-block; font-family: var(--font-display); font-size: 12px; font-weight: 600; line-height: 1; padding: var(--space-1) 6px; border-radius: var(--radius-control); vertical-align: 1px; white-space: nowrap; border: 1px solid transparent; }
.chip.layer-to, .swatch.layer-to { background: var(--layer-to-bg); color: var(--layer-to-fg); }
.chip.layer-extern, .swatch.layer-extern { background: var(--layer-ext-bg); color: var(--layer-ext-fg); }
.chip.layer-wettkampf, .swatch.layer-wettkampf { background: var(--layer-wk-bg); color: var(--layer-wk-fg); border: 2px solid var(--layer-wk-border); }
.chip.layer-diagnostik, .swatch.layer-diagnostik { background: var(--layer-dg-bg); color: var(--layer-dg-fg); border-color: var(--layer-dg-border); border-style: dashed; }
.chip.layer-eigen, .swatch.layer-eigen { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: var(--radius-control); flex-shrink: 0; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list.tight > li { padding: var(--space-2) 0; }
.list .coach, .import-row { display: flex; justify-content: space-between; gap: var(--space-3); align-items: flex-start; }
.agenda { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.agenda > li { display: grid; grid-template-columns: 88px 1fr; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.agenda > li:last-child { border-bottom: 0; }
.agenda-day { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.agenda ul { list-style: none; margin: 0; padding: 0; }
.agenda ul li + li { margin-top: var(--space-1); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }

/* Athletenkopf, Reiter */
.athlete-head { margin-bottom: var(--space-4); }
.athlete-name { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 40px; line-height: 1; margin: var(--space-1) 0 var(--space-2); }
.athlete-meta { margin: 0; color: var(--text-muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--top-n300); margin-bottom: var(--space-6); overflow-x: auto; }
[data-theme="dark"] .tabs { border-bottom-color: var(--border); }
.tabs a { font-family: var(--font-display); font-size: 17px; padding: var(--space-3) var(--space-4); text-decoration: none; color: var(--text-muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }

/* Statusleiste */
.statusbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.stat { padding: var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-label { font-family: var(--font-display); font-size: 14px; color: var(--text-muted); font-weight: 600; }
.stat-value { font-family: var(--font-mono); font-weight: 600; font-size: 30px; line-height: 1.15; }
.stat-value small { display: inline; font-family: var(--font-mono); font-size: 15px; }
.stat-sub { font-size: 14px; color: var(--text-muted); }
.stat-first.s-green { box-shadow: inset 3px 0 0 var(--good); }
.stat-first.s-amber { box-shadow: inset 3px 0 0 var(--warn); }
.stat-first.s-red { box-shadow: inset 3px 0 0 var(--bad); }
.chartbox { position: relative; height: 260px; }
.chartbox-tall { height: 480px; }

/* Verlauf: Kennzahlen über dem Zeitstrahl */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; }
.seg a { padding: var(--space-1) var(--space-3); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--border); }
.seg a.is-active { background: var(--primary); color: var(--on-primary); }
.seg button { padding: var(--space-1) var(--space-3); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); background: none; border: 0; cursor: pointer; min-height: 36px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.is-active { background: var(--primary); color: var(--on-primary); }
/* Messwerte: Zeitraum über dem Diagramm */
.mw-filter { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.mw-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .mw-filter .seg, .mw-filter .rc-range { width: 100%; } .mw-filter .seg button { flex: 1; padding: var(--space-1); font-size: 13px; } .mw-filter .rc-range label { flex: 1; min-width: 0; } .mw-filter .rc-range input[type=date] { width: 100%; min-width: 0; } }
.verlauf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-2) 0 var(--space-4); }
.verlauf-kpis div { display: flex; flex-direction: column-reverse; gap: 2px; }
.verlauf-kpis b { font-family: var(--font-mono); font-size: 28px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.verlauf-kpis b small { display: inline; font-family: var(--font-text); font-size: 13px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.verlauf-kpis span { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.verlauf-kpis em { font-style: normal; font-size: 13px; color: var(--text-muted); }

/* Gesundheitsprobleme */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list > li + li { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.health-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.health-state { font-family: var(--font-display); font-weight: 600; font-size: 12px; padding: 2px var(--space-2); border-radius: var(--radius-control); border: 1px solid var(--border); color: var(--text-muted); }
.health.is-open .health-state { border-color: var(--bad); color: var(--bad); }
.health-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; }
.health-steps li { display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-2); border-top: 3px solid var(--border); }
.health-steps li.done { border-top-color: var(--text); }
.health-steps span { font-size: 13px; color: var(--text-muted); }
.health-steps b { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.card.is-flagged { border-left: 3px solid var(--bad); }
small.flag { color: var(--bad); font-weight: 600; }
.row-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
/* In Tabellen bleibt die Zelle eine Tabellenzelle, sonst verrutschen die Trennlinien */
td.row-actions { display: table-cell; }
td.row-actions > * { display: inline-block; margin: 0 var(--space-3) var(--space-1) 0; }

/* Wellness-Check */
.wellness-form > * + * { margin-top: var(--space-4); }
.scale { border: 0; padding: 0; margin: 0; }
/* Jede Frage als eigener Block: Abstand und Linie zwischen den Fragen deutlich größer als innerhalb */
.wellness-form > .scale + .scale { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border); }
.wellness-form > .scale + :not(.scale) { margin-top: var(--space-8); }
.scale legend { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin-bottom: var(--space-2); padding: 0; float: left; width: 100%; }
.scale-row { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.scale-opt { position: relative; }
.scale-opt input { position: absolute; opacity: 0; inset: 0; }
.scale-opt span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1px solid var(--top-n300); border-radius: var(--radius-field); font-family: var(--font-mono); font-size: 20px; font-weight: 600; background: var(--surface); cursor: pointer; }
[data-theme="dark"] .scale-opt span { border-color: var(--border); background: var(--surface-2); }
.scale-opt input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.scale-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-top: var(--space-1); }

.srpe-row { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.srpe-what { flex-basis: 100%; display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.srpe-what small { display: inline; }
.srpe-row .field:first-of-type { width: 110px; }
.srpe-row .field.grow { min-width: 200px; }

/* Pläne */
.plans { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; gap: var(--space-3); }
.plan a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4) var(--space-6); text-decoration: none; color: var(--text); }
.plan a:hover { border-color: var(--accent); }
.plan strong { display: block; font-family: var(--font-display); font-size: 19px; }
.plan span { color: var(--text-muted); }
.plan .chip { margin-bottom: var(--space-2); }
.plans.is-past .plan a { opacity: .7; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-6); align-items: start; }
.plan-preview iframe, .plan-preview img { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--top-weiss); }
.plan-preview img { height: auto; }
.plan-preview { position: sticky; top: var(--space-4); }
.days { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.days select, .days input { min-height: 36px; padding: var(--space-1) var(--space-2); font-size: 15px; }
.days tbody th { white-space: nowrap; vertical-align: middle; font-family: var(--font-mono); font-weight: 500; font-size: 14px; }
.days tbody td { vertical-align: middle; padding: var(--space-1) var(--space-2); }
.days .time-in { width: 8.5em; font-family: var(--font-mono); }
.days .kw-row th { background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding: var(--space-1) var(--space-3); }
.days tr.is-weekend th { color: var(--text-muted); }
.days tr.is-hard th { box-shadow: inset 3px 0 0 var(--info); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg-muted) 70%, transparent); padding: var(--space-4) 0 var(--space-2); }
.w-unit { max-width: 90px; }
.map tr.is-text { color: var(--text-muted); }

/* Zugangsdaten */
.credentials { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-card); padding: var(--space-4) var(--space-6); margin-bottom: var(--space-6); max-width: 640px; }
.credentials dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0; }
.credentials dt { color: var(--text-muted); }
.credentials dd { margin: 0; font-weight: 600; }
.credentials .h3 { margin-top: 0; }

/* Login */
body.is-public .page { max-width: none; padding: 0; }
.login { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-brand { position: relative; overflow: hidden; background: var(--top-graphit); color: var(--top-offwhite); padding: var(--space-16); padding-top: max(var(--space-16), calc(env(safe-area-inset-top) + var(--space-6))); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-12); }
/* Linien wie auf der Webseite: feine senkrechte Haarlinien in Hellbronze, 18 Spalten */
.login-lines { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 5.55%, color-mix(in srgb, var(--top-bronze-hell) 9%, transparent) 5.55% calc(5.55% + 1px), transparent calc(5.55% + 1px) 11.11%); }
.login-brand > :not(.login-lines) { position: relative; }
.login-logo { width: min(420px, 90%); }
.login-claim { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.15; color: var(--top-offwhite); margin: 0; }
.login-claim span { display: block; text-wrap: balance; }
/* Claim (Markensatz, in jeder Sprache englisch): Pointe in Hellbronze */
.login-claim .login-claim-gold { color: var(--top-bronze-hell); }
.login-form { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); padding: var(--space-12) var(--space-6); background: var(--bg); }
.login-form form { width: 100%; max-width: 380px; }
.login-form .lang-switch { display: flex; gap: var(--space-4); justify-content: flex-start; }
.login-form .lang-switch button[disabled] { color: var(--text); text-decoration: none; font-weight: 600; cursor: default; }

/* Kalender */
.cal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.cal-side > * + * { margin-top: var(--space-4); }
.cal-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); }
.layers { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); padding: var(--space-3) var(--space-4); margin: 0; }
.layers legend { font-family: var(--font-display); font-weight: 600; font-size: 15px; padding: 0 var(--space-1); }
.layer-toggle { display: flex; align-items: center; gap: var(--space-2); font-size: 15px; padding: var(--space-1) 0; cursor: pointer; }
.layer-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.legend p { margin: 0 0 var(--space-2); }
.legend-planday { border: 2px solid var(--info); color: var(--info); padding: 0 var(--space-1); border-radius: var(--radius-control); font-weight: 600; }
.legend-check { font-weight: 700; }
.legend-warn { color: var(--top-weiss); background: var(--bad); border-radius: var(--radius-pill); display: inline-block; width: 16px; text-align: center; font-weight: 700; }

.fc { --fc-border-color: var(--border); --fc-today-bg-color: var(--top-b50); --fc-now-indicator-color: var(--bad); --fc-neutral-bg-color: var(--surface-2); --fc-page-bg-color: var(--surface); --fc-list-event-hover-bg-color: var(--surface-2); font-size: 14px; }
[data-theme="dark"] .fc { --fc-today-bg-color: var(--surface-2); }
.fc .fc-toolbar-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.fc .fc-button { font-family: var(--font-display); font-weight: 600; font-size: 15px; background: transparent; border: 1px solid var(--top-n300); color: var(--text); border-radius: var(--radius-control); box-shadow: none !important; text-transform: none; }
.fc .fc-button:hover { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fc .fc-button:disabled { opacity: .45; background: transparent; color: var(--text); }
.fc .fc-col-header-cell-cushion { font-family: var(--font-display); font-weight: 600; color: var(--text-muted); text-decoration: none; }
.fc .fc-daygrid-day-number { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-decoration: none; }
.fc .fc-daygrid-week-number, .fc .fc-timegrid-axis-cushion, .fc .fc-timegrid-slot-label-cushion { font-family: var(--font-mono); background: transparent; color: var(--text-muted); font-size: 12px; }
.fc-event { cursor: pointer; border-radius: var(--radius-control); }
.fc .fc-daygrid-event { padding: 1px var(--space-1); }
.fc .fc-event-time { font-family: var(--font-mono); font-weight: 500; }
.fc .ev-unit.layer-to { background: var(--layer-to-bg) !important; border-color: var(--layer-to-bg) !important; }
.fc .ev-unit.layer-to .fc-event-main, .fc .ev-unit.layer-to .fc-event-title, .fc .ev-unit.layer-to .fc-event-time { color: var(--layer-to-fg) !important; }
.fc .ev-unit.layer-extern { background: var(--layer-ext-bg) !important; border-color: var(--layer-ext-bg) !important; }
.fc .ev-unit.layer-extern .fc-event-main, .fc .ev-unit.layer-extern .fc-event-title, .fc .ev-unit.layer-extern .fc-event-time { color: var(--layer-ext-fg) !important; }
.fc .ev-unit.layer-wettkampf { background: var(--layer-wk-bg) !important; border: 2px solid var(--layer-wk-border) !important; }
.fc .ev-unit.layer-wettkampf .fc-event-main, .fc .ev-unit.layer-wettkampf .fc-event-title, .fc .ev-unit.layer-wettkampf .fc-event-time { color: var(--layer-wk-fg) !important; font-weight: 700; }
.fc .ev-unit.layer-diagnostik { background: var(--layer-dg-bg) !important; border: 1px dashed var(--layer-dg-border) !important; }
.fc .ev-unit.layer-diagnostik .fc-event-main, .fc .ev-unit.layer-diagnostik .fc-event-title, .fc .ev-unit.layer-diagnostik .fc-event-time { color: var(--layer-dg-fg) !important; }
.fc .fc-daygrid-dot-event .fc-daygrid-event-dot { display: none; }
.fc .ev-planday { background: var(--surface) !important; border: 1.5px solid var(--info) !important; }
.fc .ev-planday .fc-event-title, .fc .ev-planday .fc-event-main { color: var(--info) !important; font-weight: 600; }
.fc .ev-planday.is-hard { background: var(--info) !important; }
.fc .ev-planday.is-hard .fc-event-title, .fc .ev-planday.is-hard .fc-event-main { color: var(--layer-ext-fg) !important; }
.fc .ev-plan-range { background: var(--info) !important; opacity: .07; }
/* WHOOP-Training ohne Einheit: leise, gepunktet, ohne eigene Bereichsfarbe */
.fc .ev-workout { background: var(--surface) !important; border: 1px dotted var(--text-muted) !important; }
.fc .ev-workout .fc-event-main, .fc .ev-workout .fc-event-title, .fc .ev-workout .fc-event-time { color: var(--text-muted) !important; }
.whoop-box { border-top: 1px solid var(--border); margin-top: var(--space-3); padding-top: var(--space-2); }
.whoop-box p { margin: 0 0 var(--space-1); }
.whoop-assign { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-3) 0; }
.fc .has-srpe .fc-event-title::before, .fc .has-srpe .fc-list-event-title a::before { content: '✓ '; font-weight: 700; }
.fc .has-conflict { outline: 2px solid var(--bad); outline-offset: 1px; }
.fc .has-conflict .fc-event-title::before { content: '! '; font-weight: 700; }
.fc .has-conflict.has-srpe .fc-event-title::before { content: '! ✓ '; }
.fc .fc-list-event-dot { border-color: var(--text-muted); }
.fc .fc-list-event.layer-to .fc-list-event-dot { border-color: var(--layer-to-bg); }
.fc .fc-list-event.layer-extern .fc-list-event-dot, .fc .fc-list-event.ev-planday .fc-list-event-dot { border-color: var(--info); }
.fc .fc-list-event.layer-wettkampf .fc-list-event-dot { border-color: var(--accent); }
.fc .fc-list-day-cushion { background: var(--surface-2); font-family: var(--font-display); }
/* Listenansicht: keine Füllfarben, nur Punkt + Text */
.fc .fc-list-event.ev-unit, .fc .fc-list-event.ev-planday { background: transparent !important; border: 0 !important; outline: 0; }
.fc .fc-list-event.ev-unit td, .fc .fc-list-event.ev-planday td { color: var(--text) !important; font-weight: 400 !important; }
.fc .fc-list-event-time { font-family: var(--font-mono); font-size: 13px; }
.fc .fc-list-event:hover td { background: var(--surface-2); }
.fc-theme-standard .fc-list { border-color: var(--border); }

/* Dialoge */
.dialog { border: 1px solid var(--border); border-radius: var(--radius-panel); padding: var(--space-6); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); color: var(--text); box-shadow: var(--shadow-panel); }
/* Speichern und Löschen bleiben beim Scrollen im Dialog sichtbar */
.dialog .dialog-actions { position: sticky; bottom: calc(-1 * var(--space-6)); margin: 0 calc(-1 * var(--space-6)); padding: var(--space-3) var(--space-6) var(--space-6); background: var(--surface); border-top: 1px solid var(--border); z-index: 1; }
.dialog::backdrop { background: rgba(31, 30, 28, .5); }
.dialog-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.dialog-head .h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: space-between; gap: var(--space-3); }
#viewBody p { margin: 0 0 var(--space-2); }
#viewBody .btn { margin: var(--space-1) var(--space-2) var(--space-1) 0; }
#unitFile .btn { margin-right: var(--space-2); }

/* Online-Einheit und Wettkampf-Filter */
.join-list { list-style: none; padding: 0; margin: 0; }
.join-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.join-list li:last-child { border-bottom: 0; }
.layer-toggle.only-comp { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }

/* Mobil */
@media (max-width: 1000px) {
  .cols, .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .verlauf-kpis, .health-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chartbox-tall { height: 420px; }
  .plan-preview { position: static; }
  .plan-preview iframe { height: 60vh; }
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-side { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .cal-side > * + * { margin-top: 0; }
  .cal-side .layers, .cal-side .legend, .cal-side details { grid-column: 1 / -1; }
  body.role-athlete .cal-main { order: -1; }
  .comp-layout .cal-main { order: -1; }
}
@media (max-width: 720px) {
  .page { padding: var(--space-6) var(--space-4) var(--space-12); }
  .topbar-inner { padding: var(--space-3) var(--space-4); flex-wrap: wrap; gap: var(--space-3); }
  .brand-logo { height: 16px; }
  .brand-app { font-size: 16px; padding-left: var(--space-3); }
  .nav-toggle { display: block; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: var(--space-2); }
  .mainnav.is-open { display: flex; }
  .mainnav > a { padding: var(--space-3) var(--space-1); border-bottom: 1px solid rgba(243, 240, 234, .1); }
  .mainnav > a.is-active { box-shadow: inset 3px 0 0 var(--header-accent); padding-left: var(--space-3); }
  .usermenu { margin: var(--space-2) 0 0; flex-wrap: wrap; }
  .h1 { font-size: 28px; }
  .athlete-name { font-size: 32px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .band-day { width: 6px; height: 18px; }
  .band-wrap { align-items: flex-start; }
  .login { grid-template-columns: 1fr; }
  .login { min-height: 100vh; min-height: 100svh; grid-template-rows: auto 1fr; }
  .login-brand { padding: var(--space-6); padding-top: calc(env(safe-area-inset-top) + var(--space-6)); gap: var(--space-6); justify-content: flex-start; }
  .login-form { justify-content: flex-start; padding-top: var(--space-8); }
  .login-logo { width: min(300px, 78%); }
  /* Handy: zwei kurze Zeilen, keine ungünstigen Umbrüche */
  .login-claim { font-size: 20px; max-width: none; }
  .login-claim span { white-space: nowrap; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
  .card { padding: var(--space-4); }
  .cal-main { padding: var(--space-2); }
  .cal-side { grid-template-columns: 1fr; }
  .fc .fc-toolbar { flex-wrap: wrap; gap: var(--space-2); }
  .fc .fc-toolbar-title { font-size: 20px; }
  .agenda > li { grid-template-columns: 1fr; gap: 2px; }
  table.team .who strong { font-size: 16px; }
  /* Teamübersicht als Liste: Name, Wellness-Band, Heute, Belastung */
  table.team, table.team tbody, table.team tr, table.team tbody th, table.team tbody td { display: block; }
  table.team thead { display: none; }
  table.team tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--border); }
  table.team tbody tr:last-child { border-bottom: 0; }
  table.team tbody th, table.team tbody td { padding: 0; border: 0; }
  table.team tbody td.hide-sm { display: none; }
  table.team tbody th { grid-column: 1 / -1; }
  table.team .col-band { grid-column: 1 / -1; width: auto; }
  table.team td.num { text-align: left; }
  table.team td.num + td.num { text-align: right; }
  table.team tr.row-red, table.team tr.row-amber { box-shadow: inset 3px 0 0 var(--bad); }
  table.team tr.row-amber { box-shadow: inset 3px 0 0 var(--warn); }
  table.team tr > th { box-shadow: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Wettkämpfe */
.nowrap { white-space: nowrap; }
.comp-table tbody th a { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.comp-people { list-style: none; margin: 0; padding: 0; }
.comp-people li + li { margin-top: var(--space-1); }
.comp-table .status-word { display: flex; }
.comp-when { margin: var(--space-2) 0 0; display: flex; gap: var(--space-3); align-items: baseline; flex-wrap: wrap; }
.comp-when .mono { font-size: 18px; }
.comp-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.entry-row { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(120px, .9fr) minmax(140px, 1.2fr) minmax(150px, 1fr) minmax(140px, 1.2fr); gap: var(--space-3); align-items: end; padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.entry-row:last-child { border-bottom: 0; }
.entry-who { display: flex; flex-direction: column; gap: var(--space-1); align-self: center; }
.entry-actions { grid-column: 1 / -1; display: flex; gap: var(--space-4); align-items: center; }
.entry-row.is-readonly { grid-template-columns: minmax(140px, 1fr) 4fr; align-items: start; }
.entry-facts, .comp-facts { margin: 0; }
.entry-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.entry-facts dt, .comp-facts dt { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); }
.entry-facts dd, .comp-facts dd { margin: 0; }
.comp-facts > div { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.comp-facts > div:last-child { border-bottom: 0; }
.checklist { display: grid; gap: var(--space-2); max-height: 360px; overflow-y: auto; }
/* Zuweisen aus der Bibliothek: je Athlet eigener Tag und eigene Uhrzeit */
.as-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.as-list li { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem 8rem; gap: var(--space-2); align-items: center; }
@media (max-width: 520px) { .as-list li { grid-template-columns: 1fr 1fr; } .as-list li .check { grid-column: 1 / -1; } }
details.card > summary.h2 { color: var(--text); margin: 0; }
@media (max-width: 1000px) {
  .entry-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-who { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
  .entry-row.is-readonly { grid-template-columns: minmax(0, 1fr); }
  .entry-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Aktivität, Status und Änderungen (Paket 2) */
.activity { font-size: 13px; color: var(--text-muted); }
.activity.is-online { color: var(--good); font-weight: 600; }
.activity.is-online::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--good); margin-right: var(--space-1); vertical-align: 1px; }
.unit-counts span { display: block; white-space: nowrap; }
.changelog { list-style: none; margin: 0; padding: 0; }
.changelog li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.changelog li:last-child { border-bottom: 0; }
.changelog-when { font-size: 13px; color: var(--text-muted); padding-top: 2px; }
.changelog li.by-athlete { box-shadow: inset 3px 0 0 var(--accent); padding-left: var(--space-3); }
.fc .is-skipped .fc-event-title { text-decoration: line-through; }
.fc .is-skipped .fc-event-title::before, .fc .is-skipped .fc-list-event-title a::before { content: '✗ '; font-weight: 700; }
.fc .is-adjusted .fc-event-title::after, .fc .is-adjusted .fc-list-event-title a::after { content: ' ↻'; font-weight: 700; }
.unit-state { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.skip-form { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.skip-form .field { min-width: 160px; flex: 1; }
@media (max-width: 720px) {
  .changelog li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.srpe-row:has(+ .skip-inline) { border-bottom: 0; padding-bottom: var(--space-1); }
.skip-inline { margin: 0; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }

/* Periodisierung (Paket 3) */
.macro-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.macro-head .h2 { margin: 0; }
.macro-head p { margin: var(--space-1) 0 0; }
.macro-plans { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.macro-goals { margin-bottom: var(--space-4); }
.macro-goals .h3 { margin-top: 0; }
.macro-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.macro-grid { border-collapse: separate; border-spacing: 0; font-size: 14px; }
.macro-grid th, .macro-grid td { padding: var(--space-1); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; vertical-align: middle; min-width: 58px; white-space: nowrap; }
.macro-grid thead th { font-family: var(--font-display); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.macro-grid thead th small { display: block; font-size: 12px; }
.macro-grid .macro-label { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; min-width: 150px; padding: var(--space-1) var(--space-3); font-family: var(--font-display); font-weight: 600; }
.macro-grid thead .macro-label { z-index: 3; background: var(--surface-2); }
.macro-grid .is-current { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.macro-grid .row-group th, .macro-grid .row-group td { background: var(--surface-2); padding-top: var(--space-2); }
.macro-grid .row-ist th { font-weight: 500; color: var(--text-muted); }
.macro-grid .row-ist td { background: var(--surface-2); }
.macro-grid .row-phase td.has-phase { background: var(--bg-muted); font-family: var(--font-display); font-weight: 700; text-align: left; padding-left: var(--space-2); }
.macro-grid .row-comp a { font-family: var(--font-display); font-weight: 700; text-decoration: none; margin: 0 1px; color: var(--text); }
.macro-grid .row-comp .prio { min-width: 22px; height: 22px; font-size: 14px; }
.macro-grid select.cell { min-height: 32px; padding: 2px 4px; font-size: 14px; width: 62px; font-family: var(--font-mono); }
.macro-grid input.cell-text { min-height: 32px; padding: 2px 4px; font-size: 13px; width: 80px; }
.macro-grid .cell.is-saved { border-color: var(--good); }
.macro-grid .cell.is-error { border-color: var(--bad); }
.macro-grid small.dev { display: block; font-family: var(--font-display); font-weight: 600; font-size: 12px; color: var(--warn-text); }
.phase-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.phase-item:last-of-type { border-bottom: 0; }
.phase-head { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: 17px; }
.phase-areas { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); }
.phase-areas legend { font-family: var(--font-display); font-weight: 600; padding: 0 var(--space-1); }
.macro-grid .row-phase td.has-phase span { position: sticky; left: 160px; display: inline-block; }

/* Phasen klar unterscheidbar, keine Ampel und nichts, was mit Priorität A/B/C (rot, gelb, blau) verwechselt wird (TO 27.10.2026):
   Grundlage grün, spezifisch petrol, Wettkampf gold (Logo-Gold), Regeneration hellgrau – vier deutlich verschiedene Töne bzw. Helligkeiten */
:root { --phase-allgemein: var(--z2); --phase-spezifisch: var(--z1); --phase-wettkampf: var(--top-bronze-hell); --phase-regeneration: var(--top-n300); }
[data-theme="dark"] { --phase-regeneration: var(--top-n600); }
.phase-allgemein { --phase: var(--phase-allgemein); }
.phase-spezifisch { --phase: var(--phase-spezifisch); }
.phase-wettkampf { --phase: var(--phase-wettkampf); }
.phase-regeneration { --phase: var(--phase-regeneration); }
.phase-icon { display: inline-block; width: 14px; height: 14px; margin-right: var(--space-1); vertical-align: -2px; background: var(--phase); -webkit-mask: var(--phase-mask) center / contain no-repeat; mask: var(--phase-mask) center / contain no-repeat; }
.phase-allgemein { --phase-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.5' y='11' width='13' height='3.2' rx='1'/%3E%3Crect x='3.8' y='6.4' width='8.4' height='3.2' rx='1'/%3E%3Crect x='6.1' y='1.8' width='3.8' height='3.2' rx='1'/%3E%3C/svg%3E"); }
.phase-spezifisch { --phase-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 2.2a4.8 4.8 0 1 1 0 9.6 4.8 4.8 0 0 1 0-9.6z'/%3E%3Ccircle cx='8' cy='8' r='2.4'/%3E%3C/svg%3E"); }
.phase-wettkampf { --phase-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2.5' y='1' width='1.8' height='14' rx='.6'/%3E%3Cpath d='M5.2 1.8h8.6l-2.2 3.4 2.2 3.4H5.2z'/%3E%3C/svg%3E"); }
.phase-regeneration { --phase-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.6 1.2A7 7 0 1 0 14.9 11.5 5.6 5.6 0 0 1 10.6 1.2z'/%3E%3C/svg%3E"); }
.fc .fc-bg-event.ev-phase-range { background: none !important; opacity: 1 !important; box-shadow: inset 0 4px 0 var(--phase); }
.fc .fc-timegrid-col-bg .fc-bg-event.ev-phase-range { box-shadow: none; }
.fc .ev-phase { background: transparent !important; border: 0 !important; }
.fc .ev-phase .fc-event-main, .fc .ev-phase .fc-event-title { color: var(--text) !important; font-family: var(--font-display); font-weight: 700; }
.fc .ev-phase .fc-event-title::before, .fc .fc-list-event.ev-phase .fc-list-event-title a::before { content: ''; display: inline-block; width: 13px; height: 13px; margin-right: var(--space-1); vertical-align: -2px; background: var(--phase); -webkit-mask: var(--phase-mask) center / contain no-repeat; mask: var(--phase-mask) center / contain no-repeat; }
.fc .fc-list-event.ev-phase .fc-list-event-dot { border-color: var(--phase); }
.phase-legend { font-size: 14px; }
.phase-legend-title { font-family: var(--font-display); font-weight: 600; margin: 0 0 var(--space-2); }
.phase-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.phase-legend li { display: flex; align-items: center; }
.phase-bar { display: inline-block; width: 18px; height: 6px; background: var(--phase); margin-right: var(--space-2); border-radius: var(--radius-control); }
.macro-grid .row-phase td.has-phase { border-left: 2px solid var(--surface); box-shadow: inset 0 4px 0 var(--phase); padding-top: var(--space-2); }
.phase-head .phase-kind { display: inline; font-weight: 500; margin-left: var(--space-2); }
/* Phase neben der Kalenderwoche (Monat, Woche); Namenszeilen nur in der Liste */
.fc .fc-daygrid-event-harness:has(> .ev-phase) { display: none; }
.fc .fc-daygrid-week-number { display: inline-flex; align-items: center; gap: var(--space-2); background: transparent; color: var(--text-muted); }
.fc .wk-phase { display: inline-flex; align-items: center; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.fc .wk-phase .phase-icon { width: 12px; height: 12px; }
.fc .fc-timegrid-axis .wk-phase-name { display: none; }
.fc .fc-timegrid-axis .fc-timegrid-axis-cushion { display: inline-flex; align-items: center; gap: var(--space-1); }
.fc .fc-list-event.ev-phase td { background: var(--surface-2) !important; }
.fc .fc-daygrid-week-number { white-space: nowrap; max-width: calc(100% - 28px); overflow: hidden; }
.fc .fc-daygrid-week-number .wk-phase { min-width: 0; }
.fc .fc-daygrid-week-number .wk-phase-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.fc .fc-list-event.ev-phase .fc-list-event-dot { display: none; }
.fc .fc-list-event.ev-phase .fc-list-event-time { font-size: 0; }
.fc .fc-list-event.ev-phase .fc-list-event-time::after { content: 'Phase'; font-size: 13px; color: var(--text-muted); }

/* Nachrichten (Paket 4) */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: var(--space-1); border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: 12px; font-weight: 600; vertical-align: 1px; }
.mainnav .badge { background: var(--top-bronze-hell); color: var(--top-graphit); }
.thread-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.thread-list li + li { border-top: 1px solid var(--border); }
.thread-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); padding: var(--space-4); text-decoration: none; color: var(--text); }
.thread-list a:hover { background: var(--surface-2); }
.thread-who { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 17px; }
.thread-last { grid-column: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-when { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--text-muted); }
.has-unread .thread-last { font-weight: 600; }
.chat { max-width: 820px; }
.chat-log { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-4); }
.chat-day { align-self: center; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin: var(--space-3) 0 0; }
.msg { max-width: 80%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3) var(--space-4); }
.msg.is-mine { align-self: flex-end; background: var(--surface-2); }
.msg.is-important { border-left: 4px solid var(--accent); }
.msg-meta { font-size: 13px; color: var(--text-muted); margin: 0 0 var(--space-1); display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.msg-meta strong { color: var(--text); font-family: var(--font-display); font-size: 15px; }
.msg-flag { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.msg-unit { display: inline-block; font-size: 13px; margin-bottom: var(--space-1); }
.msg-body { margin: 0; font-size: 16px; }
.msg-receipt { margin: var(--space-1) 0 0; font-size: 12px; color: var(--warn-text); text-align: right; }
.msg-receipt.is-ok { color: var(--text-muted); }
.msg-del { text-align: right; font-size: 12px; margin-top: var(--space-1); }
.chat-form { position: sticky; bottom: 0; background: var(--bg-muted); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
[data-theme="dark"] .chat-form { background: var(--bg); }
.chat-options { display: flex; gap: var(--space-3) var(--space-4); align-items: flex-end; flex-wrap: wrap; margin-top: var(--space-2); }
.chat-options .btn { margin-left: auto; }
.important-popup { border-top: 6px solid var(--accent); max-width: 520px; }
.important-msg { border-bottom: 1px solid var(--border); padding-bottom: var(--space-3); }
.important-msg p { margin: 0; }
.feedback { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.feedback .h3 { margin: 0 0 var(--space-2); }
.feedback-item { background: var(--surface-2); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.feedback-item p { margin: 0; }
.feedback-form { display: flex; gap: var(--space-2); align-items: flex-end; }
.feedback-form textarea { flex: 1; }
.fc .ev-msg { margin-left: var(--space-1); font-weight: 700; }
@media (max-width: 720px) {
  .msg { max-width: 92%; }
  .chat-options .btn { margin-left: 0; width: 100%; }
}
.mainnav > a { display: inline-flex; align-items: center; white-space: nowrap; }
small.inline { display: inline; }
/* Kopfzeile auf dem Tablet im Querformat (ca. 1280 px): enger setzen, damit alles in eine Zeile passt */
@media (min-width: 1001px) and (max-width: 1400px) {
  .topbar-inner { gap: var(--space-4); padding-left: var(--space-4); padding-right: var(--space-4); }
  .mainnav > a { padding: var(--space-2); font-size: 16px; }
  .usermenu { gap: var(--space-3); }
  .testswitch select { max-width: 170px; }
}
@media (min-width: 1001px) and (max-width: 1200px) {
  .brand-app { display: none; }
  .mainnav > a { padding: var(--space-2) 6px; font-size: 15px; }
  .testswitch select { max-width: 140px; }
}

/* Bilder und Videos (Paket 5) */
.msg-media { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.media-item { margin: 0; }
.media-item img { display: block; max-width: 240px; max-height: 240px; border-radius: var(--radius-control); border: 1px solid var(--border); object-fit: cover; }
.media-item video { display: block; width: 100%; max-width: 420px; max-height: 360px; border-radius: var(--radius-control); background: var(--top-graphit); }
.media-item.is-video { flex: 1 1 280px; }
.media-item figcaption { font-size: 12px; color: var(--text-muted); margin-top: var(--space-1); }
.attach { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); }
.attach-btn { position: relative; overflow: hidden; cursor: pointer; }
.attach-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attach-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.upload-progress { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.upload-bar { flex: 1; height: 6px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.chat-head { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.gallery-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3); }
.gallery-item .msg-media { margin-top: 0; }
.gallery-item .media-item, .gallery-item .media-item img, .gallery-item .media-item video { max-width: 100%; width: 100%; }
.gallery-item p { margin: var(--space-2) 0 0; }
.feedback-form { flex-direction: column; align-items: stretch; }
.feedback-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.feedback-actions .btn[type=submit] { margin-left: auto; }
.feedback-item .media-item img { max-width: 160px; max-height: 160px; }
@media (max-width: 720px) {
  .chat-form { position: static; }
  .media-item img { max-width: 100%; }
}

/* Paket 6 ohne KI: Heute wichtig, Wochenrückblick, Gruppen, Textbausteine */
.attention { margin-bottom: var(--space-6); }
.attention .card-head .h2 { display: flex; align-items: center; gap: var(--space-2); }
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.attention-list li:last-child { border-bottom: 0; }
.attention-main { color: var(--text); text-decoration: none; }
.attention-main:hover strong { text-decoration: underline; }
.attention-main small { display: block; }
.attention-done .btn { min-height: 36px; padding: var(--space-1) var(--space-3); }
.attention-all { margin-top: var(--space-2); }
.group-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.chip-btn { font: 600 14px var(--font-display); border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-3); cursor: pointer; min-height: 32px; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.side-links { margin: 0 0 var(--space-4); font-family: var(--font-display); font-weight: 600; }
.template-item + .template-item, .group-item + .group-item { margin-top: var(--space-4); }
.template-item .h3, .group-item .h3 { margin-top: 0; }
.setting-row { display: flex; gap: var(--space-4); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.setting-row .field { min-width: 140px; }
.weekly-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.weekly-range { margin: 0; font-size: 18px; }
.weekly-nav { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.weekly { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-6); }
.weekly + .weekly { margin-top: var(--space-6); }
.weekly-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); }
.weekly-head .h2, .weekly-head p { margin: 0; }
.weekly-head p { margin-top: var(--space-1); }
.weekly-logo { height: 28px; }
.weekly-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
.weekly-stats > div { display: flex; flex-direction: column; border-left: 3px solid var(--border); padding-left: var(--space-3); }
.weekly-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.weekly-notes .status-word { min-width: 80px; }
.weekly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); margin-top: var(--space-4); }
.weekly .h3 { margin: var(--space-3) 0 var(--space-2); }
.weekly table { width: 100%; }
.weekly-units { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.weekly-units small { display: block; }
.unit-state-word { font-family: var(--font-display); font-weight: 600; font-size: 13px; margin-left: var(--space-2); color: var(--text-muted); }
.unit-state-word.state-ausgelassen { color: var(--warn-text); }
.unit-state-word.state-offen { color: var(--warn-text); }
.print-only { display: none; }
@media (max-width: 1000px) {
  .weekly-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekly-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .attention-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .attention-list li .status-word { grid-column: 1 / -1; }
  .weekly { padding: var(--space-4); }
}

/* Druck: A4 hoch, je Athlet eine Seite, immer hell */
@page { size: A4 portrait; margin: 12mm 12mm 14mm; }
@media print {
  [data-theme="dark"] { --bg: var(--top-weiss); --bg-muted: var(--top-weiss); --surface: var(--top-weiss); --surface-2: var(--top-n50); --text: var(--top-graphit); --text-muted: var(--top-n600); --border: var(--top-n200); --accent: var(--top-bronze); }
  body { background: var(--top-weiss); font-size: 10pt; }
  .topbar, .tabs, .athlete-head, .no-print, .flash, dialog { display: none !important; }
  .page { padding: 0; max-width: none; }
  .print-only { display: block; }
  .weekly { border: 0; border-radius: 0; padding: 0; break-after: page; }
  .weekly:last-of-type { break-after: auto; }
  .weekly + .weekly { margin-top: 0; }
  .weekly-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
  .weekly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .stat-value { font-size: 20pt; }
  .weekly table th, .weekly table td { padding: 2px var(--space-2); }
  .weekly section, .weekly-units li, .weekly tr { break-inside: avoid; }
  a { color: var(--text); text-decoration: none; }
}
@media print { .weekly .tablewrap { overflow: visible; } }
.weekly table th, .weekly table td { white-space: nowrap; }
@media print {
  .weekly .status-word { font-size: 9pt; }
  .weekly .h3 { margin: var(--space-2) 0 var(--space-1); }
  .weekly-stats { margin: var(--space-3) 0; }
}

/* Diagnostik-Plattform: Suchtreffer zum Übernehmen (Athletenübersicht, Neuer Athlet) */
.diag-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); max-height: 320px; overflow-y: auto; }
.diag-results > li { border-bottom: 1px solid var(--border); }
.diag-results > li:last-child { border-bottom: 0; }
.diag-results > li.muted { padding: var(--space-2) var(--space-3); }
.diag-results button { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); width: 100%; min-height: 44px; text-align: left;
  padding: var(--space-2) var(--space-3); background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.diag-results button:hover, .diag-results button:focus-visible { background: var(--surface-2); }
.diag-results button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.diag-results .mono { margin-left: auto; }
.diag-prefill { max-width: 560px; }
.diag-picked { display: flex; gap: var(--space-3); align-items: baseline; margin: 0; }

/* Erholung & Schlaf (Wearables): Zahl dominant, Bezeichnung lesbar, Begleitendes leise */
.rc-page > * + * { margin-top: var(--space-6); }
.rc-page > .rc-kpis { margin-top: var(--space-4); }
.rc-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.rc-filter { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.rc-range { display: inline-flex; align-items: center; gap: var(--space-2); }
.rc-range input[type=date] { font-family: var(--font-mono); font-size: 14px; padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); min-height: 36px; }
.rc-range .btn { min-height: 36px; padding: var(--space-1) var(--space-3); }
.rc-range.is-active input[type=date] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.rc-upload { display: flex; gap: var(--space-3); align-items: end; flex-wrap: wrap; margin: var(--space-3) 0 var(--space-2); }
.rc-upload .field { flex: 1 1 260px; margin: 0; }
.rc-meta { margin: 0; display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: baseline; }
.rc-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); }
.rc-kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); min-width: 0; }
.rc-kpi .stat-value { white-space: nowrap; font-size: 28px; }
.rc-kpi-clock .stat-value { font-size: 22px; }
.rc-page td.num { white-space: nowrap; }
.rc-kpi-recovery.s-green { box-shadow: inset 3px 0 0 var(--good); }
.rc-kpi-recovery.s-amber { box-shadow: inset 3px 0 0 var(--warn); }
.rc-kpi-recovery.s-red { box-shadow: inset 3px 0 0 var(--bad); }
.rc-split { display: flex; height: 6px; border-radius: var(--radius-pill); overflow: hidden; margin: var(--space-2) 0 var(--space-1); background: var(--bg-muted); }
.rc-split span { display: block; }
.rc-split-good { background: var(--good); }
.rc-split-warn { background: var(--warn); }
.rc-split-bad { background: var(--bad); }
.rc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-6); align-items: start; }
.rc-dl { margin: var(--space-4) 0 0; display: grid; gap: var(--space-2); }
.rc-dl div { display: flex; justify-content: space-between; gap: var(--space-3); border-bottom: 1px solid var(--border); padding-bottom: var(--space-2); }
.rc-dl dt { color: var(--text-muted); font-size: 14px; }
.rc-dl dd { margin: 0; font-weight: 600; white-space: nowrap; }
.rc-mini { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.rc-mini > div { display: flex; flex-direction: column; border-left: 3px solid var(--border); padding-left: var(--space-3); min-width: 0; }
.rc-num { font-family: var(--font-mono); font-weight: 600; font-size: 22px; line-height: 1.2; white-space: nowrap; }
.rc-num small, .rc-line small { display: inline; font-size: 13px; color: var(--text-muted); font-weight: 400; }
.rc-line { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-3); }
.rc-stages { display: flex; gap: 2px; margin-bottom: var(--space-4); border-radius: var(--radius-control); overflow: hidden; }
.rc-stage { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3); min-width: max-content; font-size: 13px; overflow: hidden; white-space: nowrap; }
.rc-stage b { font-family: var(--font-display); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.rc-stage-deep { background: var(--text); color: var(--bg); }
.rc-stage-rem { background: var(--info); color: var(--top-weiss); }
.rc-stage-light { background: var(--top-n300); color: var(--top-n900); }
.rc-stage-awake { background: var(--bg-muted); color: var(--text); }
.rc-zones { display: flex; height: 26px; gap: 2px; border-radius: var(--radius-control); overflow: hidden; margin-bottom: var(--space-1); }
.rc-zone { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; color: var(--top-weiss); min-width: 2px; }
.rc-z1 { background: var(--z1); } .rc-z2 { background: var(--z2); } .rc-z3 { background: var(--z3); } .rc-z4 { background: var(--z4); } .rc-z5 { background: var(--z5); }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rc-journal td .rc-diff { display: inline-block; min-width: 3ch; }
.rc-diffbar { display: inline-block; position: relative; width: 90px; height: 8px; background: var(--bg-muted); border-radius: var(--radius-pill); margin-left: var(--space-2); vertical-align: middle; }
.rc-diffbar span { position: absolute; top: 0; bottom: 0; background: var(--text-muted); border-radius: var(--radius-pill); }
.rc-diffbar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--text); }
@media (max-width: 1200px) {
  .rc-kpis, .rc-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .rc-grid, .cols-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .rc-kpis, .rc-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-kpi .stat-value { font-size: 24px; }
  .rc-stages { flex-wrap: wrap; }
  .rc-stage { flex: 1 1 40% !important; }
  .rc-kpi-clock .stat-value { font-size: 20px; }
  .rc-diffbar { display: none; }
}

/* Sicherheit: Passkeys, Authenticator-App, Notfall-Codes */
.sec > * + * { margin-top: var(--space-6); }
.sec-must { border-left: 3px solid var(--primary); }
.sec-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.sec-add { display: flex; gap: var(--space-3); align-items: end; flex-wrap: wrap; margin-top: var(--space-4); }
.sec-add .field { flex: 1 1 220px; margin: 0; }
.sec-app { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-top: var(--space-3); }
.sec-qr svg { width: 200px; height: 200px; display: block; background: var(--top-weiss); border-radius: var(--radius-control); }
.sec-secret { display: inline-block; padding: var(--space-1) var(--space-2); background: var(--bg-muted); border-radius: var(--radius-control); word-break: break-all; }
.sec-codelist { columns: 2; list-style: none; padding: 0; margin: var(--space-3) 0; font-size: 18px; line-height: 1.8; }
@media (max-width: 720px) { .sec-app { grid-template-columns: minmax(0, 1fr); } }
@media print { .sec > :not(.sec-codes) { display: none !important; } }

/* Einstellungen je Athlet */
.narrow-wide { max-width: 860px; }
.ast > * + * { margin-top: var(--space-6); }
.ast-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 200px; gap: var(--space-2) var(--space-4); align-items: end; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.ast-label { align-self: center; font-weight: 500; }
.ast-eff { grid-column: 1 / -1; }
.ast-row .field { margin: 0; }
.ast-seg { align-self: center; }
.ast-seg label { position: relative; padding: var(--space-2) var(--space-3); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; }
.ast-seg label + label { border-left: 1px solid var(--border); }
.ast-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ast-seg label:has(input:checked) { background: var(--primary); color: var(--on-primary); }
.ast-seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 720px) {
  .ast-row { grid-template-columns: minmax(0, 1fr); }
}

/* Wettkampf-Priorität: farbiges Kennzeichen, immer mit Buchstabe (Wort im Tooltip, in der Legende und bei Bedarf daneben) */
.prio { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--radius-control); font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 1; vertical-align: middle; color: var(--top-weiss); }
.prio-A { background: var(--bad); }
.prio-B { background: var(--warn); color: var(--top-graphit); }
.prio-C { background: var(--info); }
.prio-word { font-weight: 600; }
.fc-event-title .prio, .fc-event-main > .prio { flex: none; }
.fc .prio { height: 16px; min-width: 16px; font-size: 11px; padding: 0 3px; margin-right: 4px; }
.fc .ev-names { color: var(--text-muted); font-weight: 400; }
.fc-list-event.prio-ev-A .fc-list-event-dot { border-color: var(--bad) !important; }
.fc-list-event.prio-ev-B .fc-list-event-dot { border-color: var(--warn) !important; }
.fc-list-event.prio-ev-C .fc-list-event-dot { border-color: var(--info) !important; }
.fc-daygrid-event.prio-ev-A, .fc-timegrid-event.prio-ev-A { box-shadow: inset 4px 0 0 var(--bad); }
.fc-daygrid-event.prio-ev-B, .fc-timegrid-event.prio-ev-B { box-shadow: inset 4px 0 0 var(--warn); }
.fc-daygrid-event.prio-ev-C, .fc-timegrid-event.prio-ev-C { box-shadow: inset 4px 0 0 var(--info); }
@media print { .prio { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Handy-Ansicht (Vorschau im Geräterahmen) */
.pv { background: var(--top-n800); margin: 0; min-height: 100vh; }
.pv-bar { display: flex; gap: var(--space-3); align-items: center; justify-content: center; flex-wrap: wrap; padding: var(--space-3) var(--space-4); background: var(--top-graphit); }
.pv-bar .btn { background: var(--top-offwhite); color: var(--top-graphit); border-color: var(--top-offwhite); }
.pv-bar .seg { border-color: var(--top-n600); }
.pv-bar .seg a { color: var(--top-n300); }
.pv-bar .seg a.is-active { background: var(--top-offwhite); color: var(--top-graphit); }
.pv-stage { display: flex; justify-content: center; align-items: flex-start; padding: var(--space-4); overflow: hidden; }
.pv-device { box-sizing: content-box; border: 12px solid var(--top-graphit); border-radius: 44px; overflow: hidden; background: var(--top-weiss);
  box-shadow: 0 0 0 1px var(--top-n600), 0 24px 60px rgba(0, 0, 0, .45); transform-origin: top center; flex: none; }
.pv-device.is-tablet { border-radius: 24px; }
.pv-device iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Karte beim Verweilen mit der Maus (Kalender) */
.hc { position: absolute; z-index: 1000; width: 300px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 12px 32px rgba(31, 30, 28, .18); padding: var(--space-3) var(--space-4); font-size: 14px; }
.hc-head { display: flex; gap: var(--space-2); align-items: center; }
.hc-head strong { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.hc-when { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin: var(--space-1) 0 var(--space-2); }
.hc-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); margin: 0; }
.hc-rows dt { color: var(--text-muted); font-size: 13px; }
.hc-rows dd { margin: 0; }
.hc-text { margin: var(--space-2) 0 0; padding-top: var(--space-2); border-top: 1px solid var(--border); color: var(--text-muted); white-space: pre-line; }
.hc-link { display: inline-block; margin-top: var(--space-2); font-weight: 600; }

/* Menü oben rechts (Einstellungen, Sicherheit, Handy-Ansicht, Dunkel, Sprache, Abmelden) */
.um { position: relative; }
.um > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); color: var(--header-fg); font-weight: 500;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-control); white-space: nowrap; }
.um > summary::-webkit-details-marker { display: none; }
.um > summary:hover, .um[open] > summary { background: rgba(243, 240, 234, .1); }
.um-caret { font-size: 11px; opacity: .7; }
.um-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 900; min-width: 210px; display: flex; flex-direction: column; padding: var(--space-2) 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: 0 12px 32px rgba(31, 30, 28, .2); }
.um-panel > a, .um-panel > .linkbtn, .um-panel form .linkbtn { display: block; width: 100%; text-align: left; padding: var(--space-2) var(--space-4);
  color: var(--text) !important; opacity: 1 !important; text-decoration: none; font-size: 15px; }
.um-panel > a:hover, .um-panel .linkbtn:hover { background: var(--bg-muted); }
.um-panel form { margin: 0; }
.um-sep { border-top: 1px solid var(--border); margin-top: var(--space-2) !important; padding-top: var(--space-2); }
@media (max-width: 720px) {
  .um > summary { display: none; }
  .um-panel { position: static; min-width: 0; flex-direction: row; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: 0; background: none; border: 0; box-shadow: none; }
  .um-panel > a, .um-panel > .linkbtn, .um-panel form .linkbtn { padding: var(--space-1) 0; color: var(--header-fg) !important; opacity: .8 !important; text-decoration: underline; }
  .um-sep { border: 0; margin: 0 !important; padding: 0; }
}

/* Wettkämpfe: Filter Athlet und Disziplin */
.comp-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-4); }
.comp-filter .field { min-width: 200px; }
.comp-filter a.small { padding-bottom: var(--space-2); }
.dialog-wide { width: min(760px, calc(100vw - 32px)); }

/* Notizen: Kategorie als farbiger Rand (nur Tokens), Tags als gestrichelte Chips, Verlauf nach Monaten */
.note-cat-training { --note: var(--z1); }
.note-cat-wettkampf { --note: var(--top-bronze-hell); }
.note-cat-gesundheit { --note: var(--bad); }
.note-cat-ernaehrung { --note: var(--z2); }
.note-cat-regeneration { --note: var(--top-n400); }
.note-cat-motivation { --note: var(--z3); }
.note-cat-organisation { --note: var(--text-muted); }
.note-cat-sonstiges { --note: var(--border); }
.notes-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-6); align-items: start; }
.notes-layout.is-self { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.note-compose { position: sticky; top: var(--space-4); }
.note-chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.note-chips legend { font-family: var(--font-display); font-weight: 600; margin-bottom: var(--space-2); padding: 0; }
.note-chip { position: relative; cursor: pointer; }
.note-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.note-chip span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-3); border: 1px solid var(--border); border-left: 4px solid var(--note, var(--border));
  border-radius: var(--radius-control); font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); background: var(--surface); }
.note-chip.note-tag span { border-left-width: 1px; border-style: dashed; }
.note-chip input:checked + span { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.note-chip.note-tag input:checked + span { border-style: solid; }
.note-chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.note-newtag input { min-height: 32px; width: 150px; padding: 0 var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-control); font: 600 14px var(--font-display); background: var(--surface); color: var(--text); }
.note-opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); }
.note-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.note-filter .field { min-width: 150px; margin: 0; }
.note-filter .check { padding-bottom: var(--space-2); }
.note-month { font-family: var(--font-display); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: var(--space-6) 0 var(--space-2); }
.note { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--note); border-radius: var(--radius-control); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.note-catname { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.note-tagchip { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius-control); padding: 0 6px; text-decoration: none; }
.note-vis { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.note-text { margin: var(--space-2) 0; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.note-due { font-family: var(--font-display); font-weight: 600; font-size: 13px; }
.note-due.is-overdue { color: var(--bad); }
.note-due.is-today { color: var(--warn-text); }
.note-due.is-done { color: var(--text-muted); text-decoration: line-through; }
.note-actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); }
.note-actions form { display: inline; }
.note-actions a, .note-actions .linkbtn { font-size: 13px; }
.note-summary .note { margin-bottom: var(--space-2); }
@media (max-width: 960px) {
  .notes-layout { grid-template-columns: minmax(0, 1fr); }
  .note-compose { position: static; }
}
.tag-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.tag-admin li { display: flex; align-items: center; gap: var(--space-3); }
.tag-admin form { display: inline; }

/* Supplemente: Einnahmen heute zum Abhaken, Plan, Evidenz-Gruppe A–D als Kennzeichen */
.supp-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--space-6); align-items: start; }
.supp-layout > * { min-width: 0; }
.intake-list { list-style: none; margin: 0; padding: 0; }
.intake-list li { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.intake-list li:last-child { border-bottom: 0; }
.intake-list form { margin: 0; }
.intake-check { width: 36px; height: 36px; border-radius: var(--radius-pill); border: 2px solid var(--border); background: var(--surface); color: transparent; cursor: pointer; font-size: 18px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.intake-check:hover { border-color: var(--good); }
.is-taken .intake-check { background: var(--good); border-color: var(--good); color: var(--on-primary); }
.is-taken .intake-what { color: var(--text-muted); text-decoration: line-through; }
.intake-time { font-size: 15px; }
.intake-dose { color: var(--text-muted); margin-left: var(--space-1); }
.ais { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-control); font: 700 11px var(--font-display); vertical-align: 1px; border: 1px solid var(--border); color: var(--text); }
.ais-A { background: var(--good); border-color: var(--good); color: var(--on-primary); }
.ais-B { background: var(--surface-2); border-color: var(--good); color: var(--good); }
.ais-C { background: var(--surface-2); color: var(--text-muted); }
.ais-D { background: var(--bad); border-color: var(--bad); color: var(--on-primary); }
.supp-table th small, .supp-table td small { display: block; }
.supp-actions { white-space: nowrap; text-align: right; }
.supp-actions form { display: inline; margin-left: var(--space-2); }
.supp-past { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); }
.supp-past form { display: inline; margin-left: var(--space-2); }
.supp-hint { font-size: 14px; }
.supp-dose { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-3); align-items: end; }
.supp-dose .check { padding-bottom: var(--space-2); }
.supp-info { border-left: 3px solid var(--accent); padding: var(--space-1) var(--space-3); background: var(--surface-2); }
.supp-info p { margin: 0 0 var(--space-1); }
.supp-caution { color: var(--warn-text); }
.supp-catalog summary { cursor: pointer; }
.supp-cat-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); font-size: 14px; }
.supp-cat-list small { display: block; }
.push-box { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.push-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
@media (max-width: 960px) {
  .supp-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .supp-dose { grid-template-columns: 1fr 1fr; }
  .intake-list li { grid-template-columns: auto 48px minmax(0, 1fr); }
  .intake-slot { display: none; }
  /* Plan als Liste statt Tabelle */
  .supp-table thead { display: none; }
  .supp-table, .supp-table tbody, .supp-table tr, .supp-table th, .supp-table td { display: block; }
  .supp-table tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
  .supp-table th, .supp-table td { border: 0; padding: 0 var(--space-3); white-space: normal; }
  .supp-actions { text-align: left; padding-top: var(--space-2) !important; }
  .supp-actions form { margin-left: var(--space-3); }
}
.linkbtn.small { font-size: 13px; }

/* Saison-Assistent */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.wiz-step h2, .wiz-preview h2 { display: flex; align-items: center; gap: var(--space-2); margin-top: 0; }
.wiz-nr { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font: 700 15px var(--font-display); flex: none; }
.wiz-step .h4, .wiz-preview .h4 { margin: var(--space-4) 0 var(--space-2); }
.wiz-comps select, .wiz-comps input { min-height: 36px; }
.wiz-comps tr.is-off { opacity: .55; }
.wiz-comps th small { display: block; font-weight: 400; }
.num-input { width: 90px; }
.num-unit { display: inline-flex; align-items: center; gap: var(--space-2); }
.num-unit input { width: 90px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.wiz-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-2); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--space-2) var(--space-4); }
.wiz-actions { display: flex; justify-content: flex-end; }
.ev-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-control); font: 700 11px var(--font-display); border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-2); vertical-align: 1px; }
.ev-badge.ev-A { border-color: var(--good); color: var(--good); }
.ev-badge.ev-B { border-color: var(--info); color: var(--info); }
.phasebar { display: flex; gap: 2px; min-height: 44px; }
.phasebar-seg { display: flex; align-items: center; gap: var(--space-1); min-width: 0; padding: var(--space-2) var(--space-2); background: var(--surface-2); border-top: 6px solid var(--phase); font: 700 13px var(--font-display); overflow: hidden; }
.phasebar-seg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phasebar-seg .phase-icon { flex: none; }
.phasebar-dates { display: flex; justify-content: space-between; }
.wiz-warn { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.wiz-warn li { padding: var(--space-2) var(--space-3); background: var(--surface-2); border-left: 3px solid var(--border); }
.wiz-warn li.lvl-amber { border-left-color: var(--warn); }
.wiz-warn li.lvl-red { border-left-color: var(--bad); }
.wiz-events { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.wiz-events li { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.wiz-events li p { margin: var(--space-1) 0 0 28px; }
.wiz-events .check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.why { margin: var(--space-1) 0 0 28px; font-size: 13px; }
.wiz-warn .why { margin-left: 0; }
.why summary { cursor: pointer; color: var(--accent); }
.why p { margin: var(--space-1) 0 0; }
.wiz-weeks td, .wiz-weeks th { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.wiz-weeks tr td:first-child { border-left: 4px solid var(--phase); }
.wiz-final { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.wiz-preset { margin-left: auto; display: inline-flex; gap: var(--space-2); align-items: center; }
.wiz-preset .field { margin: 0; }
.preset-pick .field { margin: 0; min-width: 220px; }
.macro-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.macro-form summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.rules-table input { width: 90px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
form.inline { display: inline; margin-left: var(--space-2); }
@media (max-width: 720px) {
  .wiz-row { grid-template-columns: 1fr 1fr; }
  .wiz-row .field:first-child { grid-column: 1 / -1; }
  .phasebar-seg span { display: none; }
  .wiz-preset { margin-left: 0; }
}

/* Unterpunkte eines Bereichs beim Athleten (zweite Reiterzeile) */
.tabs:has(+ .subtabs) { margin-bottom: var(--space-3); }
.subtabs { display: flex; gap: var(--space-2); margin: 0 0 var(--space-6); overflow-x: auto; }
.subtabs a { font-family: var(--font-display); font-size: 15px; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text-muted);
  padding: var(--space-1) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); }
.subtabs a:hover { color: var(--text); border-color: var(--accent); }
.subtabs a.is-active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
@media print { .subtabs { display: none !important; } }
@media (max-width: 520px) {
  .tabs { gap: 0; }
  .tabs a { font-size: 14px; padding: var(--space-2) 6px; }
}

/* Leistungen: Bestleistungen als Kacheln (Wert dominant), Verlauf je Disziplin, Spielstatistik */
.pagehead-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--space-3); margin-bottom: var(--space-2); }
.pb-card { display: grid; gap: var(--space-1); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); text-decoration: none; color: var(--text); }
.pb-card:hover { border-color: var(--accent); }
.pb-disc { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.pb-value { font-family: var(--font-mono); font-size: 32px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.pb-flag { font-size: 14px; margin-left: 4px; color: var(--text-muted); }
.pb-meta { font-size: 13px; color: var(--text-muted); }
.pb-sb { font-size: 14px; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.pb-trend { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-muted); }
.pb-trend.is-up { color: var(--good); }
.pb-trend.is-down { color: var(--bad); }
.pb-badge { font: 700 11px var(--font-display); color: var(--on-accent); background: var(--accent); border-radius: var(--radius-control); padding: 1px 4px; vertical-align: 1px; }
.perf-disc { margin-top: var(--space-4); scroll-margin-top: var(--space-4); }
.perf-table tr.is-off { opacity: .5; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: var(--space-3); }
.kpi-tile { display: grid; gap: 2px; padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-control); }
.kpi-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.kpi-val { font-family: var(--font-mono); font-size: 26px; font-weight: 600; white-space: nowrap; }
.trend-besser { color: var(--good); font-weight: 600; }
.trend-schlechter { color: var(--bad); font-weight: 600; }
.entry-stats { grid-column: 1 / -1; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.stack-tight { display: grid; gap: var(--space-1); padding-left: 1.2em; margin: 0; }

/* WHOOP-Konto auf der Erholungsseite */
.whoop-card { margin-bottom: var(--space-4); }
.whoop-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); align-items: flex-start; }
.whoop-row .h3 { margin: 0 0 var(--space-1); }
.whoop-row p { margin: var(--space-1) 0 0; }
.whoop-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start; }
.whoop-actions form { margin: 0; }
/* Erholung · Heute: Wert außerhalb des eigenen Normalbereichs, Wochenstreifen */
.rc-kpi.rc-out .stat-sub { color: var(--text); font-weight: 600; }
.rc-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.rc-week li { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); min-width: 0; }
.rc-week li.s-green { box-shadow: inset 0 3px 0 var(--good); }
.rc-week li.s-amber { box-shadow: inset 0 3px 0 var(--warn); }
.rc-week li.s-red { box-shadow: inset 0 3px 0 var(--bad); }
.rc-week li.is-today { border-color: var(--primary); }
.rc-week-day { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.rc-week-day small { display: inline; font-weight: 400; color: var(--text-muted); font-size: 12px; }
@media (max-width: 720px) { .rc-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .rc-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rc-goal { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.rc-goal .small { font-family: var(--font-text); font-weight: 400; }
.rc-goal-edit { margin: 0 0 var(--space-3); }
.rc-goal-edit summary { cursor: pointer; font-size: 14px; color: var(--text-muted); }
.rc-goal-edit form { margin-top: var(--space-2); max-width: 520px; }
.rc-goal-edit .check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.input-short { width: 5.5em; font-family: var(--font-mono); padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); min-height: 36px; }

/* Datumswähler (nur mit Maus/Trackpad): echtes Datumsfeld unsichtbar, Textfeld TT.MM.JJJJ und Kalender im Markenstil */
.dp-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.dp-input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; cursor: pointer; }
.dp-pop { position: fixed; z-index: 1000; width: 304px; padding: var(--space-3); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-panel); box-shadow: var(--shadow-panel); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.dp-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.dp-nav { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-control); background: none; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.dp-nav:hover { border-color: var(--primary); }
.dp-grid { width: 100%; border-collapse: collapse; }
.dp-grid th { font-family: var(--font-display); font-weight: 600; font-size: 12px; color: var(--text-muted); padding: 2px 0 var(--space-1); text-align: center; }
.dp-grid td { padding: 1px; text-align: center; }
.dp-grid .dp-kw { font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--text-muted); width: 28px; border-right: 1px solid var(--border); }
.dp-day { width: 34px; height: 32px; border: 0; border-radius: var(--radius-control); background: none; color: var(--text); font-family: var(--font-mono); font-size: 14px; cursor: pointer; }
.dp-day:hover:not(:disabled) { background: var(--bg-muted); }
.dp-day.dp-we { color: var(--text-muted); }
.dp-day.dp-out { opacity: .45; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.dp-day.is-sel { background: var(--primary); color: var(--on-primary); }
.dp-day:disabled { opacity: .25; cursor: default; }
.dp-day:focus-visible, .dp-q:focus-visible, .dp-nav:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.dp-q { padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: none; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 13px; cursor: pointer; }
.dp-q:hover:not(:disabled) { border-color: var(--primary); }
.dp-q:disabled { opacity: .35; cursor: default; }
.dp-clear { margin-left: auto; color: var(--text-muted); }

/* Übungsdatenbank: Filterleiste, Kachelraster mit Bild, Übungsseite, Import-Vorschau */
.ex-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-6); }
.ex-filter .field { min-width: 170px; }
.ex-filter .ex-search { flex: 1 1 260px; }
.ex-filter .check, .ex-filter a.small { padding-bottom: var(--space-2); }
.ex-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.ex-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; color: var(--text); text-decoration: none; }
.ex-card:hover { border-color: var(--primary); }
.ex-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ex-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--top-weiss); border-bottom: 1px solid var(--border); }
.ex-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Ohne Bild: leises Bildsymbol statt Text */
.ex-devimg-detail { box-sizing: border-box; width: 100%; max-height: 220px; object-fit: contain; background: var(--top-weiss); border-radius: var(--radius-control); padding: var(--space-3); }
.ex-thumb { overflow: hidden; }
.ex-thumb img.ex-devimg { box-sizing: border-box; padding: var(--space-3); background: var(--top-weiss); }
.ex-noimg { display: grid; place-items: center; height: 100%; color: var(--border); background: var(--bg-muted); }
.ex-video { position: absolute; right: var(--space-2); bottom: var(--space-2); padding: 2px var(--space-2); border-radius: var(--radius-control); background: var(--top-graphit); color: var(--top-offwhite); font-size: 12px; }
.ex-name { padding: var(--space-3) var(--space-3) 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.ex-meta { padding: var(--space-1) var(--space-3) var(--space-3); font-size: 13px; color: var(--text-muted); }
.ex-fieldset { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3) var(--space-4); margin: 0; }
.ex-fieldset legend { font-family: var(--font-display); font-weight: 600; padding: 0 var(--space-1); }
.ex-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-1) var(--space-3); }
/* Mehrfachauswahl in Tabellen (Import-Vorschau): sieht aus wie ein Auswahlfeld, klappt Häkchen auf */
.msel { position: relative; min-width: 10rem; }
.msel > summary { list-style: none; cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-2) var(--space-6) var(--space-2) var(--space-3);
  background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18rem; position: relative; }
.msel > summary::-webkit-details-marker { display: none; }
.msel > summary::after { content: '▾'; position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.msel[open] > summary { border-color: var(--accent); }
/* Klappt in der Zeile auf (nicht schwebend), damit die scrollende Tabelle nichts abschneidet */
.msel-pop { margin-top: var(--space-1); min-width: 16rem; max-height: 320px; overflow-y: auto; display: grid; gap: var(--space-1);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); }
.msel-group { font-weight: 600; margin: var(--space-2) 0 0; text-align: left; }
.msel > summary { font-weight: 400; color: var(--text); text-align: left; }
.msel-pop .check { display: flex; align-items: center; gap: var(--space-2); justify-content: flex-start; text-align: left; width: auto; }
.msel-pop .check input { width: auto; margin: 0; flex: none; }
.msel-group:first-child { margin-top: 0; }
.ex-media { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.ex-media img, .ex-media video { width: 100%; border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--top-weiss); display: block; }
.ex-media-actions { display: flex; gap: var(--space-3); margin-top: var(--space-1); }
.ex-embed { border: 1px dashed var(--border); border-radius: var(--radius-control); padding: var(--space-4); text-align: center; }
.ex-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.ex-embed:has(iframe) { padding: 0; border: 0; }
.ex-device-video { margin-top: var(--space-3); }
.ex-device-video > p { margin-top: var(--space-2); }
.ex-import-form { max-width: 640px; }
.ex-import-form + .ex-import-form { margin-top: var(--space-6); }
.ex-import-head .dialog-actions { justify-content: flex-start; }
.dialog-actions > form.inline { margin-left: 0; }
.ex-import td { vertical-align: middle; }
.ex-import input, .ex-import select { width: 100%; min-width: 140px; }
.ex-import .msel-pop input[type=checkbox] { width: auto; min-width: 0; }
.ex-import td:nth-child(2) { min-width: 260px; }
.ex-import-img { width: 120px; height: 75px; object-fit: contain; background: var(--top-weiss); border: 1px solid var(--border); border-radius: var(--radius-control); display: block; }
.ex-import tr.is-dup td { background: var(--bg-muted); }
@media (max-width: 720px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .ex-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.ex-group { border-top: 1px solid var(--border); padding: var(--space-2) 0; }
.ex-group:first-of-type { border-top: 0; }
.ex-group summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); padding-bottom: var(--space-1); }

/* Einheit ansehen (Athlet am Handy) */
.ss-desc { max-width: 720px; margin-bottom: var(--space-4); }
.ss-progress { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); max-width: 720px; }
.ss-progress-bar { flex: 1; height: 6px; background: var(--bg-muted); border-radius: var(--radius-pill); overflow: hidden; }
.ss-progress-bar > span { display: block; height: 100%; background: var(--good); transition: width .2s; }
.ss-block { max-width: 720px; margin-bottom: var(--space-6); }
.ss-block-head { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-2); }
.ss-block-head .h3 { margin: 0; }
.ss-letter { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-control); background: var(--top-graphit); color: var(--top-weiss); font-family: var(--font-display); font-weight: 700; }
.ss-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ss-ex { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3); }
.ss-ex.is-done { border-color: var(--good); }
.ss-ex.is-done .ss-ex-name, .ss-ex.is-done .ss-sets { color: var(--text-muted); }
.ss-ex-main { display: flex; gap: var(--space-3); align-items: center; }
.ss-check { margin: 0; }
.ss-check-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--top-n300); background: var(--surface); color: transparent; font-size: 22px; font-weight: 700; cursor: pointer; }
.ss-check-btn[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--top-weiss); }
.ss-check-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ss-thumb { flex: none; width: 64px; height: 48px; display: grid; place-items: center; background: var(--top-weiss); border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; color: var(--text-muted); font-family: var(--font-display); font-weight: 700; }
.ss-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ss-ex-text { min-width: 0; }
.ss-ex-name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.ss-code { color: var(--text-muted); font-weight: 700; margin-right: var(--space-1); }
.ss-sets { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ss-more { margin-top: var(--space-2); }
.ss-more summary { cursor: pointer; color: var(--text-muted); font-size: 14px; }
.ss-more video { width: 100%; max-height: 360px; margin-top: var(--space-2); border-radius: var(--radius-control); background: var(--top-graphit); }
.ss-srpe { max-width: 720px; }

/* Baukasten (Trainer, Tablet quer) */
.sb-toolbar { display: flex; justify-content: flex-end; margin-bottom: var(--space-3); }
.sb { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.sb-block { min-width: 0; }
.sb-block-head select { max-width: 100%; }
.sb-block { padding: var(--space-4); }
.sb-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.sb-block-head select, .sb-block-head .sb-title { width: auto; }
.sb-title { flex: 1 1 180px; font-family: var(--font-display); font-weight: 600; }
.sb-params { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.sb-field { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 13px; color: var(--text-muted); }
.sb-field input { width: 72px; }
.sb-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.sb-icon { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.sb-icon:hover { color: var(--text); border-color: var(--top-n300); }
.sb-del:hover { color: var(--bad); border-color: var(--bad); }
.sb-ex { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.sb-ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sb-ex-name { font-family: var(--font-display); font-size: 16px; }
.sb-done { color: var(--good); }
.sb-short { flex: 0 1 220px; font-variant-numeric: tabular-nums; }
.sb-short[aria-invalid="true"] { border-color: var(--bad); }
.sb-summary:empty { display: none; }
.sb-sets { margin-top: var(--space-2); width: auto; }
.sb-sets th { font-size: 12px; color: var(--text-muted); font-weight: 600; text-align: left; padding: 2px 4px; }
.sb-sets td { padding: 2px 4px; }
.sb-sets input, .sb-sets select { padding: 4px 6px; min-height: 34px; font-variant-numeric: tabular-nums; }
.sb-sets .w-xs { width: 56px; } .sb-sets .w-sm { width: 76px; }
.sb-type { width: 52px; }
.sb-ex-foot { display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-2); }
.sb-note { flex: 1; }
.sb-add { position: relative; margin-top: var(--space-3); max-width: 480px; }
.sb-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: 0 12px 32px rgba(31, 30, 28, .18); max-height: 360px; overflow: auto; }
.sb-results li { display: flex; align-items: center; gap: var(--space-2); padding: 6px; border-radius: var(--radius-control); cursor: pointer; }
.sb-results li:hover, .sb-results li:focus { background: var(--bg-muted); outline: none; }
.sb-results img, .sb-noimg { width: 40px; height: 30px; object-fit: contain; flex: none; display: grid; place-items: center; background: var(--top-weiss); border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); font-weight: 700; }
.sb-addblock { margin-top: var(--space-4); }
.sb-insert select { width: auto; }
[data-sb-status].is-bad { color: var(--bad); }
.sb-tpl-title input { font-family: var(--font-display); font-size: 28px; font-weight: 700; }

/* Satzweise loggen */
.ls { width: 100%; margin-top: var(--space-3); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ls th { font-size: 12px; color: var(--text-muted); font-weight: 600; text-align: left; padding: 0 4px 2px; }
.ls td { padding: 3px 4px; vertical-align: middle; }
.ls-n { width: 24px; color: var(--text-muted); font-weight: 700; text-align: center; }
.ls-prev { width: 1%; white-space: nowrap; }
.ls-prev-btn { border: 0; background: var(--bg-muted); color: var(--text-muted); border-radius: var(--radius-control); padding: 6px 8px; font: inherit; font-size: 14px; cursor: pointer; min-height: 36px; }
.ls-in { width: 100%; min-width: 52px; max-width: 90px; min-height: 44px; padding: 6px 8px; font-size: 18px; font-weight: 600; text-align: center; }
.ls-in::placeholder { color: var(--top-n400); font-weight: 400; }
.ls-rpe { max-width: 60px; }
.ls-ok { width: 44px; height: 44px; border-radius: var(--radius-control); border: 2px solid var(--top-n300); background: var(--surface); color: var(--top-n400); font-size: 20px; font-weight: 700; cursor: pointer; }
.ls-row.is-logged .ls-ok { background: var(--good); border-color: var(--good); color: var(--top-weiss); }
.ls-row.is-logged .ls-in { background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.ls-add { margin-top: var(--space-1); }
.ls-timer { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--space-2);
  background: var(--top-graphit); color: var(--top-weiss); border-radius: var(--radius-pill); padding: 8px 10px 8px 18px; box-shadow: 0 12px 32px rgba(31, 30, 28, .2); }
.ls-timer-time { font-family: var(--font-display); font-size: 28px; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.ls-timer .btn { min-height: 36px; padding: 4px 10px; background: transparent; color: var(--top-weiss); border-color: var(--top-n600); }
.ls-timer.is-over { background: var(--good); }
.ls-timer-label { font-size: 13px; color: var(--top-n300); }
.ls-timer.is-over .ls-timer-label { color: var(--top-weiss); }
.ls-queue { position: sticky; top: var(--space-2); z-index: 20; display: inline-block; margin: 0 0 var(--space-3); background: var(--warn); color: var(--warn-text); padding: 4px 10px; border-radius: var(--radius-pill); }
.ls-queue[hidden] { display: none; }
.ss-swap { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.ss-note { margin-top: var(--space-2); }
.ss-feedback { max-width: 720px; margin-top: var(--space-6); }
main:has(.ls-timer:not([hidden])) { padding-bottom: 96px; }
.ls-pr { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); top: calc(var(--space-4) + env(safe-area-inset-top)); max-width: calc(100% - 32px);
  background: var(--top-bronze); color: var(--top-weiss); font-family: var(--font-display); font-weight: 700; padding: 10px 16px; border-radius: var(--radius-pill); box-shadow: 0 12px 32px rgba(31, 30, 28, .2); }
.ls-pr[hidden] { display: none; }
.mx-form { max-width: 960px; margin-bottom: var(--space-6); }
.mx-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr 1.4fr; gap: var(--space-3); }
.mx-ex { position: relative; }
.mx-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.mx-val { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.mx-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mx-entries li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
@media (max-width: 720px) { .mx-grid { grid-template-columns: 1fr 1fr; } .mx-ex { grid-column: 1 / -1; } }

/* Programme */
.pg-meta { margin-bottom: var(--space-4); }
.pg-meta summary { cursor: pointer; font-weight: 600; }
.pg-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-4); }
.pg-title { flex: 1 1 200px; }
.pg-grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 880px; }
.pg-grid th, .pg-grid td { border: 1px solid var(--border); vertical-align: top; padding: 6px; }
.pg-grid thead th { background: var(--bg-muted); font-size: 13px; }
.pg-grid tbody th { width: 48px; background: var(--bg-muted); font-family: var(--font-display); }
.pg-grid td { background: var(--surface); height: 72px; }
.pg-chip { position: relative; background: var(--bg-muted); border-left: 3px solid var(--top-graphit); border-radius: var(--radius-control); padding: 4px 22px 4px 6px; margin-bottom: 4px; display: flex; flex-direction: column; font-size: 13px; }
.pg-chip a { color: var(--text); text-decoration: none; }
.pg-edit { position: absolute; top: 2px; right: 2px; }
.pg-edit summary { list-style: none; cursor: pointer; padding: 0 4px; color: var(--text-muted); }
.pg-edit[open] form { position: absolute; z-index: 20; right: 0; top: 22px; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); box-shadow: 0 12px 32px rgba(31, 30, 28, .18); }
.pg-plus { width: 100%; border: 1px dashed var(--top-n300); background: transparent; color: var(--text-muted); border-radius: var(--radius-control); cursor: pointer; min-height: 28px; }
.pg-plus:hover { color: var(--text); border-color: var(--text); }
.pg-copy { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 var(--space-6); }
.pg-copy select { width: auto; }
.pg-bottom { margin-top: var(--space-4); }
.pg-end { margin-top: var(--space-4); }
.pr-grid { border-collapse: collapse; }
.pr-grid th, .pr-grid td { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: left; white-space: nowrap; }
.pr-grid tbody th { font-weight: 500; }
.pr-session th { background: var(--bg-muted); font-family: var(--font-display); padding-top: var(--space-2); }
.pr-cell { width: 150px; font-variant-numeric: tabular-nums; }
.pr-cell[aria-invalid="true"] { border-color: var(--bad); }
[data-pr-status].is-bad { color: var(--bad); }
.chip-warn { background: var(--warn); color: var(--warn-text); }

/* Auswertung Training */
.an-range { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.an-range a { text-decoration: none; }
.an-range .is-active { background: var(--top-graphit); color: var(--top-weiss); border-color: var(--top-graphit); }
.an-kpis { margin-bottom: var(--space-4); }
.an-sec { margin-bottom: var(--space-4); }
.an-table td, .an-hard td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-table tr.is-current th { font-weight: 700; }
.an-bar { display: inline-block; min-width: 44px; padding: 2px 6px; border-radius: 4px; text-align: right;
  background: linear-gradient(to right, color-mix(in srgb, var(--top-bronze) 28%, transparent) var(--w), transparent var(--w)); }
.an-chart { position: relative; height: 280px; }
.an-up { color: var(--good); } .an-down { color: var(--bad); }

/* Startseite Athlet: heutige Einheit */
.today-card { border-color: var(--top-graphit); }
.today-unit { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.today-unit:first-of-type { border-top: 0; }
.today-text { flex: 1; min-width: 0; }
.today-title { margin: 0 0 var(--space-1); font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.today-time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.today-btn { min-height: 48px; padding-inline: var(--space-4); white-space: nowrap; }
.today-unit .ss-progress { margin: 0; }
.today-unit.is-done .today-title { color: var(--text-muted); }
.pg-conflict { border-color: var(--warn); margin-bottom: var(--space-4); }
.pg-conflict-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }

/* Tagesform zur Einheit */
.rd { max-width: 720px; margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-left: 4px solid var(--warn); }
.rd-red { border-left-color: var(--bad); }
.rd-head { margin: 0 0 var(--space-2); }
.rd-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ex-more { display: flex; align-items: center; gap: var(--space-3); justify-content: center; margin: var(--space-6) 0; }

/* Wochenansicht am Handy: Wochentag über dem Tag, Monat weg, „Ganz-tägig“ darf umbrechen */
.fc .fc-timegrid-axis-cushion { white-space: normal; hyphens: manual; text-align: right; }
@media (max-width: 720px) {
  .fc .fc-timeGridWeek-view .fc-col-header-cell-cushion { display: flex; flex-direction: column; align-items: center; padding: var(--space-1) 0; line-height: 1.15; }
  .fc .fc-timeGridWeek-view .dh-mon { display: none; }
  .fc .fc-timeGridWeek-view .dh-wd { font-size: 12px; }
}

/* Großer Bildschirm (Mac): die Breite nutzen statt 1280 px; Formulare bleiben über .narrow schmal */
@media (min-width: 1400px) {
  .page, .topbar-inner { max-width: 2000px; }
  .cal-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .fc .fc-daygrid-event, .fc .fc-timegrid-event { font-size: 13px; }
}
/* Woche und 3 Tage am Handy: Uhrzeit weglassen (die Lage im Raster zeigt sie, Antippen die genaue Zeit), Titel umbrechen */
@media (max-width: 720px) {
  .fc .fc-timeGridWeek-view .fc-timegrid-event .fc-event-time { display: none; }
  .fc .fc-timeGridWeek-view .fc-timegrid-event .fc-event-main { padding: 1px 2px; }
  .fc .fc-timeGridWeek-view .fc-timegrid-event .fc-event-title { font-size: 11px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
  .fc .fc-timeGridWeek-view .fc-timegrid-event { border-width: 2px; }
  .fc .fc-timeGridThreeDay-view .fc-timegrid-event .fc-event-title { font-size: 12px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
  .fc .fc-timeGridThreeDay-view .fc-timegrid-event .fc-event-time { display: none; }
  .fc .fc-timeGridThreeDay-view .fc-timegrid-slot { height: 2.2em; }
}
