/*
 * fit: App-eigene Styles auf Basis von design-system/tokens.css (Issue #7).
 *
 * Diese Datei definiert KEINE eigenen Farb-/Abstands-/Radius-Werte - alles kommt aus den
 * Custom Properties in tokens.css (muss vor dieser Datei verlinkt sein, siehe views/layout.tsx).
 * Ausnahme: ein paar Geometrie-Werte, die in design-system/components/*.md als exakte Pixelmaße
 * vorgegeben sind (z. B. 24-px-Icon, 8-px-Punkt, 56-px-Kopfzeile) - das sind UX-Spec-Werte, keine
 * frei erfundenen.
 *
 * /static/fonts/InterVariable-0de8d82c80.woff2 wird beim Ausliefern durch lib/assets.ts auf den aktuellen (gehashten)
 * Inter-Dateinamen ersetzt (apps/web/src/static/fonts/InterVariable-<hash>.woff2).
 */

@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/InterVariable-0de8d82c80.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0100-02AF, U+0131, U+0152-0153, U+02BB-02BC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--leading-normal);
  -webkit-text-size-adjust: 100%;
}

h1 {
  font-size: var(--font-size-xl);
  line-height: var(--leading-snug);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-2);
}

p {
  margin: 0 0 var(--space-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
}

form {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.xs {
  font-size: var(--font-size-xs);
}

.sm {
  font-size: var(--font-size-sm);
}

.num {
  font-variant-numeric: var(--font-numeric);
}

/* /_komponenten (Sichtpruef-Seite, Issue #7 Schritt 5) */
h2.section {
  font-size: var(--font-size-lg);
  line-height: var(--leading-snug);
  margin: var(--space-10) 0 var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

/* Erste Sektionsueberschrift einer Seite braucht keinen oberen Rand/Abstand (z.B. Training-Screen,
   Issue #23 - keine Inline-styles, deshalb eine eigene Regel statt eines style=""-Overrides). */
h2.section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.stack > * + * {
  margin-top: var(--space-3);
}

@media (min-width: 768px) {
  .split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    align-items: start;
  }

  .split > * + * {
    margin-top: 0;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  margin: -1px;
  padding: 0;
}

/* Fokus (design-system/components/README.md): jedes interaktive Element bekommt bei
   :focus-visible diesen Ring, nie `outline: none` ohne Ersatz. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100%;
  z-index: var(--z-toast);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus-visible {
  top: var(--space-2);
}

/* ========== Layout-Grundgeruest ========== */

main {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Shell (eingeloggte Seiten: Heute/Woche/Training/Einstellungen, views/shell.tsx) */

.shell-header {
  padding: var(--space-6) var(--space-4) var(--space-2);
  max-width: var(--content-max);
  margin: 0 auto;
}

.shell-header .date {
  font-size: var(--font-size-sm);
  color: var(--muted);
  margin: 0 0 var(--space-1);
  text-transform: capitalize;
}

.shell-header h1 {
  margin: 0;
}

.shell-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--tabbar-height) + env(safe-area-inset-bottom) + var(--space-6));
}

@media (min-width: 768px) {
  .shell-header,
  .shell-content {
    padding-top: calc(56px + var(--space-6));
  }

  .shell-content {
    padding-bottom: var(--space-8);
  }
}

/* ========== Buttons (design-system/components/formular-buttons.md) ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-lg);
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--font-size-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: var(--font-weight-semibold);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  border-color: var(--line-strong);
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: var(--line);
}

.btn-ghost {
  padding: 0 var(--space-3);
}

.btn-danger {
  border-color: var(--status-bad);
  color: var(--status-bad);
}

.btn[disabled] {
  background: var(--card);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

.btn-compact {
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.icon-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--font-size-md);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
}

/* ========== Formularfelder (formular-buttons.md) ========== */

.field + .field {
  margin-top: var(--space-5);
}

.field label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-1);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
  width: 100%;
  height: var(--touch-lg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-md);
  padding: 0 var(--space-3);
}

.field input::placeholder {
  color: var(--muted);
}

.field input[aria-invalid="true"] {
  border: 2px solid var(--status-bad);
}

.help {
  font-size: var(--font-size-xs);
  color: var(--muted);
  margin-top: var(--space-1);
}

.error {
  font-size: var(--font-size-sm);
  color: var(--status-bad);
  margin-top: var(--space-1);
}

fieldset {
  border: 0;
  margin: var(--space-5) 0 0;
  padding: 0;
}

legend {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: 0;
  margin-bottom: var(--space-1);
}

label.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  cursor: pointer;
  font-size: var(--font-size-md);
  border-radius: var(--radius-md);
}

label.check input {
  appearance: none;
  margin: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: none;
}

label.check input:checked {
  background: var(--text);
  border-color: var(--text);
}

label.check input:checked::after {
  content: "\2713";
  color: var(--bg);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
}

.err-summary {
  background: var(--status-bad-bg);
  border-left: 3px solid var(--status-bad);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
}

.err-summary ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-5);
}

/* ========== Quellen-Chip (README.md): "Oura"/"Garmin" ========== */

.chip {
  display: inline-block;
  font-size: var(--font-size-xs);
  line-height: var(--leading-snug);
  color: var(--source-fg);
  border: 1px solid var(--source-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-right: var(--space-1);
}

.label-caps {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status-Farben als Klassen statt inline style="" (CSP: style-src 'self' ohne unsafe-inline
   erlaubt keine Inline-Style-Attribute, siehe middleware/security-headers.ts). Je Status-Wert aus
   tokens.css eine Text- und eine Punkt-Klasse. */
.c-good {
  color: var(--status-good);
}
.c-ok {
  color: var(--status-ok);
}
.c-warn {
  color: var(--status-warn);
}
.c-bad {
  color: var(--status-bad);
}
.c-future {
  color: var(--status-future);
}
.c-unplanned {
  color: var(--status-unplanned);
}

.dot-good {
  background: var(--status-good);
}
.dot-ok {
  background: var(--status-ok);
}
.dot-warn {
  background: var(--status-warn);
}
.dot-bad {
  background: var(--status-bad);
}
.dot-future {
  background: var(--status-future);
}
.dot-unplanned {
  background: var(--status-unplanned);
}
.dot-muted {
  background: var(--muted);
}

.kicker-heute {
  color: var(--accent);
}

.arrow-neutral {
  color: var(--text);
}

.section-gap {
  margin-top: var(--space-3);
}

/* ========== Kachel (kachel.md) ========== */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.tile h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  line-height: var(--leading-snug);
  margin: 0;
}

.tile .value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  font-variant-numeric: var(--font-numeric);
  white-space: nowrap;
}

.tile .unit {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--muted);
}

.tile .value2 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: var(--font-numeric);
}

.tile .status {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.tile .foot {
  font-size: var(--font-size-xs);
  color: var(--muted);
  line-height: var(--leading-snug);
  margin-top: auto;
}

.tile .foot a {
  color: var(--text);
  text-decoration: underline;
}

/* HRV-Band (kachel.md: "SVG, Hoehe 8 px") - SVG statt CSS-Prozent-Positionierung, weil
   Geometrie-Attribute (x1/x2/stroke-width) nicht unter CSP style-src fallen, anders als ein
   inline style="left:...;width:...". Rand/Marker als Linie mit stroke-linecap:round (nicht
   <circle>), damit preserveAspectRatio="none" keine Ellipse daraus macht (dieselbe Technik wie
   die Sparkline-Punkt-Markierung, sparkline.md). */
.band-svg {
  display: block;
  width: 100%;
  height: 8px;
  margin: var(--space-2) 0;
}

@media (min-width: 768px) {
  .tile {
    padding: var(--space-4);
  }

  .tile .value {
    font-size: var(--font-size-2xl);
  }
}

/* ========== Sparkline (sparkline.md) ========== */

.spark-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.spark-head h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.spark-head .avg {
  margin-left: auto;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: var(--font-numeric);
}

.spark {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: var(--space-2);
}

.axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--muted);
  font-variant-numeric: var(--font-numeric);
}

@media (min-width: 768px) {
  .spark {
    height: 64px;
  }
}

/* ========== Session-Karte (session-karte.md) ========== */

.session {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.session h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-snug);
  margin: 0;
}

.session .btn {
  margin-top: var(--space-2);
}

/* ========== Wochentags-Karte (wochentag-karte.md) ========== */

.week {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.day {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  min-height: 64px;
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--space-2);
  background: var(--card);
}

.day .d {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.day .pct {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: var(--font-numeric);
  text-align: right;
}

.day .title {
  font-size: var(--font-size-sm);
  grid-column: 1 / -1;
}

.day .st {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  grid-column: 1 / -1;
}

.day .bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--line);
  overflow: hidden;
  margin-top: var(--space-1);
}

.day .bar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.today-tag {
  display: block;
  color: var(--accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-right: var(--space-1);
}

.planned {
  border: 1px solid var(--line-strong);
}

.is-today {
  border: 2px solid var(--accent);
}

.s-good {
  background: var(--status-good-bg);
}
.s-good .c {
  color: var(--status-good);
}

.s-ok {
  background: var(--status-ok-bg);
}
.s-ok .c {
  color: var(--status-ok);
}

.s-bad {
  background: var(--status-bad-bg);
}
.s-bad .c {
  color: var(--status-bad);
}

.s-future {
  background: var(--status-future-bg);
  border: 1px dashed var(--status-future);
}
.s-future .c {
  color: var(--status-future);
}

.s-unplanned {
  background: var(--status-unplanned-bg);
}
.s-unplanned .c {
  color: var(--status-unplanned);
}

.s-rest {
  background: var(--card);
  border: 1px solid var(--line);
}

.sums {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  font-variant-numeric: var(--font-numeric);
}

.sums th,
.sums td {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.sums tr:last-child td {
  border-bottom: 0;
}

.sums th:first-child,
.sums td:first-child {
  text-align: left;
}

.sums th {
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

@media (min-width: 768px) {
  .week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .day {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-width: 0;
    hyphens: auto;
    overflow-wrap: break-word;
  }

  .day .pct {
    text-align: left;
  }
}

/* Woche-Screen (Issue #26): Vor/Zurueck-Navigation + Tagesdetails (<details>, kein JS noetig). */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.week-nav-label {
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.week li > details {
  margin-top: var(--space-1);
}

.week li > details summary {
  font-size: var(--font-size-xs);
  color: var(--muted);
  cursor: pointer;
}

.day-details {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

/* ========== Autosave-Status + Toast (toast-autosave.md) ========== */

.autosave {
  font-size: var(--font-size-xs);
  white-space: nowrap;
  font-variant-numeric: var(--font-numeric);
}

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + var(--space-4));
  z-index: var(--z-toast);
  display: flex;
  justify-content: center;
  padding: 0 var(--space-4);
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  width: min(100%, var(--content-narrow));
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast.ok::before {
  background: var(--status-good);
}

.toast.bad::before {
  background: var(--status-bad);
}

.toast p {
  flex: 1;
  margin: 0;
}

.toast .btn {
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  color: var(--accent);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.island-demo .btn-row {
  margin-top: var(--space-3);
}

/* ========== Tab-Navigation (tab-navigation.md) ========== */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-tabbar);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: var(--content-max);
}

/* biome-ignore lint/style/noDescendingSpecificity: anderer Kontext als .tile .foot a (Kachel-Fusszeile), keine echte Kollision */
.tabbar a {
  height: var(--tabbar-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  position: relative;
  transition: color var(--duration-fast) var(--ease-standard);
}

.tabbar a:hover {
  color: var(--text);
}

.tabbar a:active {
  background: var(--line);
  color: var(--text);
}

.tabbar a:focus-visible {
  outline-offset: -4px;
}

.tabbar a[aria-current="page"] {
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.tabbar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--text);
}

/* biome-ignore lint/style/noDescendingSpecificity: anderer Kontext als .day .bar svg (Wochenbalken), keine echte Kollision */
.tabbar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ab 768px: Leiste oben statt unten (tab-navigation.md). `position: fixed` statt `sticky`, damit
   die Leiste unabhaengig von der DOM-Reihenfolge (nach <main>, siehe A11y-Hinweis dort) immer
   sichtbar bleibt - mit `sticky` wuerde sie erst nach dem Durchscrollen von <main> "einrasten". */
@media (min-width: 768px) {
  .tabbar {
    left: 0;
    right: 0;
    bottom: auto;
    top: 0;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
  }

  .tabbar ul {
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    gap: var(--space-8);
  }

  .tabbar a {
    height: 56px;
    flex-direction: row;
    gap: var(--space-2);
  }

  .tabbar a[aria-current="page"]::before {
    top: auto;
    bottom: 0;
  }
}

/* ========== Logger (Issue #23: satzzeile.md, superset-gruppe.md, vorschlags-bubble.md,
   toast-autosave.md) ========== */

.logger {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-8);
}

.logger-header {
  position: sticky;
  top: 0;
  z-index: var(--z-tabbar);
  background: var(--bg);
  padding: var(--space-4) 0 var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
}

.logger-back {
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-min);
}

.logger-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logger-main {
  padding-bottom: var(--space-8);
}

/* ---------- Superset-Gruppe (superset-gruppe.md) ---------- */

.superset {
  border: 0;
  margin: 0;
  padding: var(--space-3);
}

.superset-head {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0;
}

.superset-item {
  border-left: 2px solid var(--line-strong);
  padding-left: var(--space-3);
  margin-top: var(--space-3);
}

.superset-item:first-child {
  margin-top: var(--space-2);
}

.ex-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-4) 0 0;
}

.exercise-card {
  padding: var(--space-3);
}

.ex-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.ex-head h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.ex-history-link {
  font-size: var(--font-size-sm);
  color: var(--text);
  text-decoration: none;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  flex: none;
}

.ex-history-link:hover {
  text-decoration: underline;
}

.ex-note {
  margin: var(--space-1) 0 0;
}

.ex-actions {
  margin-top: var(--space-2);
}

/* ---------- Satzzeile (satzzeile.md) ---------- */

.satz-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--muted);
  margin-top: var(--space-3);
  padding-right: calc(48px + var(--space-2));
}

.satz-head span {
  flex: 1 1 0;
  text-align: center;
}

.satz-head span:first-child {
  flex: 0 0 28px;
}

.satzzeile {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: var(--touch-lg);
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
}

.satzzeile.is-done {
  background: var(--status-good-bg);
}

.satz-nr {
  flex: 0 0 28px;
  min-height: var(--touch-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--muted);
}

.satzzeile.is-done .satz-nr {
  color: var(--text);
}

.satz-field-wrap {
  flex: 1 1 0;
  min-width: 0;
}

.satz-input {
  width: 100%;
  height: var(--touch-lg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  padding: 0 var(--space-2);
}

.satz-input::placeholder {
  color: var(--muted);
}

.satz-input[aria-invalid="true"] {
  border: 2px solid var(--status-bad);
}

.satz-input.is-accepted {
  border-color: var(--accent);
  transition: border-color var(--duration-base) var(--ease-standard);
}

.satz-input-sm {
  flex: 0 0 56px;
  width: 56px;
  padding: 0 var(--space-1);
}

.satz-err {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--status-bad);
  margin-top: var(--space-1);
}

.satz-check {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--on-status);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.satzzeile.is-done .satz-check {
  background: var(--status-good);
  border-color: var(--status-good);
  transform: scale(1.02);
}

.satz-remove {
  flex: 0 0 44px;
}

/* ---------- Vorschlags-Bubble (vorschlags-bubble.md) ---------- */

.suggestion {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-top: var(--space-3);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

.suggestion-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.suggestion-headline {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.suggestion-arrow {
  color: var(--accent);
}

.suggestion-accepted {
  margin-top: var(--space-3);
}

/* ---------- Abschluss-Formular ---------- */

.logger-end {
  margin-top: var(--space-6);
}

/* ========== Training-Liste (Issue #23) ========== */

.training-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.training-row .btn {
  margin-top: var(--space-2);
}

/* ========== Uebungsverlauf-Chart (Issue #24) ========== */

.hist-chart {
  display: block;
  width: 100%;
  height: 120px;
}

.hist-legend {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--muted);
}

.hist-legend-swatch {
  width: 24px;
  height: 6px;
  vertical-align: middle;
  margin-right: var(--space-1);
}

.hist-table {
  margin-top: var(--space-2);
}

@media (min-width: 768px) {
  .hist-chart {
    height: 160px;
  }
}
