/*
 * Kontoseite (`/konto`, `/en/account`).
 *
 * Oben die Bühne wie in der App: dunkel in beiden Themes, ihre Fläche ein
 * gerader Verlauf in der Farbe des Bereichs, der Name des Bereichs als Plakat
 * in Barlow Condensed, darunter die Bereiche als Reiter. Der Grund darunter
 * setzt die Farbe der Bühne fort und läuft in den Seitengrund aus; die Kacheln
 * liegen durchscheinend darauf (DESIGN.md 0.12 „Board“). Ruhig: eine
 * Akzentfarbe für die Hauptaktion und den Fortschritt; Makro- und
 * Mahlzeitfarben nur neben ihrem Namen.
 */

.page-account {
  --area-top: var(--wash-calm-top);
  --area-bottom: var(--wash-calm-bottom);
  --board: var(--board-calm);
  background: var(--bg);
}
.page-account[data-area="training"] {
  --area-top: var(--wash-training-top);
  --area-bottom: var(--wash-training-bottom);
  --board: var(--board-training);
}
.page-account[data-area="nutrition"] {
  --area-top: var(--wash-nutrition-top);
  --area-bottom: var(--wash-nutrition-bottom);
  --board: var(--board-nutrition);
}
.page-account[data-area="learn"] {
  --area-top: var(--wash-focus-top);
  --area-bottom: var(--wash-focus-bottom);
  --board: var(--board-focus);
}
.page-account[data-area="settings"] {
  --area-top: var(--wash-profile-top);
  --area-bottom: var(--wash-profile-bottom);
  --board: var(--board-profile);
}
/* Beim Laden und beim Anmelden steht rechts heller Grund unter dem Kopf. */
.page-account:not([data-area]) .site-head,
.page-account[data-area="auth"] .site-head {
  background: var(--s-bg);
  box-shadow: 0 1px 0 var(--s-line);
}

.acct {
  min-height: 70vh;
}
.acct-boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 70vh;
  padding: calc(var(--head-h) + 40px) var(--gutter) 40px;
  color: var(--text-muted);
  background: var(--s-bg);
}
.acct-boot + noscript .acct-boot {
  min-height: 0;
  padding-top: 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Bühne mit Plakat und Reitern                                         */
/* ------------------------------------------------------------------ */

.acct-stage {
  position: relative;
  /* Fläche der Bühne: gerader Verlauf von oben nach unten (DESIGN.md §3, v6.27). */
  background: linear-gradient(180deg, var(--area-top), var(--area-bottom));
  color: var(--s-text);
  padding: calc(var(--head-h) + clamp(28px, 5vw, 56px)) var(--gutter) 0;
}
.acct-stage-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}
.acct-kicker {
  min-height: 1.6em;
  color: var(--s-muted);
  font-size: 1.0625rem;
}
.acct-poster {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 7.5vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  /* Platz für Umlaute über der Zeile (AGENTS.md, Barlow) */
  padding-top: 0.14em;
  margin-top: 2px;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.acct-lead {
  max-width: 56ch;
  margin-top: 12px;
  color: var(--s-muted);
}
.acct-lead:empty {
  display: none;
}
.acct-poster[data-long] {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 0.95;
}
.acct-tabs {
  margin: clamp(24px, 4vw, 40px) calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.acct-tabs::-webkit-scrollbar {
  display: none;
}
.acct-tabs ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 0 14px;
  list-style: none;
  width: max-content;
}
.acct-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--s-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition:
    color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}
.acct-tabs a:hover {
  color: var(--s-text);
}
.acct-tabs a[aria-current="page"] {
  background: var(--stage-tile);
  color: var(--s-text);
}
.acct-tabs .icon {
  width: 18px;
  height: 18px;
}
/* Schmal: alle fünf Bereiche sichtbar, Symbol über dem Namen wie im Dock der App. */
@media (max-width: 600px) {
  .acct-tabs {
    margin-left: calc(-1 * var(--gutter) + 6px);
    margin-right: calc(-1 * var(--gutter) + 6px);
    padding: 0;
    overflow: visible;
  }
  .acct-tabs ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: auto;
    gap: 2px;
    padding-bottom: 10px;
  }
  .acct-tabs a {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 56px;
    padding: 6px 2px;
    font-size: 0.75rem;
    text-align: center;
  }
  .acct-tabs span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ------------------------------------------------------------------ */
/* Inhalt                                                               */
/* ------------------------------------------------------------------ */

.acct-board {
  background: linear-gradient(180deg, var(--board) 0, var(--bg) 640px);
}
.acct-view {
  /* Auf dem Board sind Flächen durchscheinende Kacheln ohne Schatten, Bedienflächen `control`. */
  --surface: var(--board-surface);
  --fill: var(--control);
  --shadow-rested: none;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) var(--gutter) clamp(64px, 9vw, 112px);
  outline: none;
}

/* Laden: Kacheln in der Form der Ansicht. */
.skeleton-strip,
.skeleton-tile {
  border-radius: var(--radius-tile);
  background: var(--board-surface);
}
.skeleton-strip {
  height: 124px;
  margin-bottom: clamp(16px, 2vw, 24px);
}
.skeleton-tile {
  height: 260px;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton-strip,
  .skeleton-tile {
    animation: pulse 1.2s var(--ease-in-out) infinite alternate;
  }
}
@keyframes pulse {
  from {
    opacity: 0.5;
  }
}
.acct-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: var(--text-muted);
}
.acct-error {
  display: grid;
  gap: 16px;
  justify-items: start;
  max-width: 560px;
}

/* Erscheinen: kurzes Hochgleiten der obersten Teile, einmal je Ansicht. */
@media (prefers-reduced-motion: no-preference) {
  .acct-view.is-entering > * > *,
  .acct-view.is-entering .grid > * {
    animation: rise 0.55s var(--ease-out) both;
  }
  .acct-view.is-entering .grid > *:nth-child(2) {
    animation-delay: 60ms;
  }
  .acct-view.is-entering .grid > *:nth-child(3) {
    animation-delay: 120ms;
  }
  .acct-view.is-entering .grid > *:nth-child(4) {
    animation-delay: 180ms;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.grid--split {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.panel--wide {
  grid-column: 1 / -1;
}
@media (max-width: 860px) {
  .grid,
  .grid--split {
    grid-template-columns: minmax(0, 1fr);
  }
}
.stack {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}
.stack-sm {
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-tile);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--shadow-rested);
  min-width: 0;
}
.panel h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 18px;
}
.panel-head p {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.panel-sub {
  margin: 24px 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.muted {
  color: var(--text-muted);
}
.empty {
  color: var(--text-muted);
  padding: 8px 0;
}
.empty--panel {
  padding: 20px 24px;
  border-radius: var(--radius-tile);
  background: var(--surface);
}
.num {
  font-variant-numeric: tabular-nums;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover {
  color: var(--text);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  flex: none;
}
.icon-button.is-off {
  opacity: 0.35;
}
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 600 0.9375rem/1.3 var(--font-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
.btn--block {
  width: 100%;
}
.btn[aria-busy="true"] {
  cursor: progress;
}
.btn[aria-busy="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.notice--error {
  background: var(--danger-subtle);
  color: var(--danger-strong);
}
.notice--ok {
  background: var(--success-subtle);
  color: var(--success-strong);
}
.notice-icon {
  margin-top: 2px;
}

/* Fortschrittsbalken: Breite über --p (0 bis 1), wächst sanft. */
.progress {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--board-track);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 0.7s var(--ease-out);
}
@media (prefers-reduced-motion: no-preference) {
  .progress > span {
    animation: grow-x 0.9s var(--ease-out) both;
  }
}
@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}
.progress--thin {
  height: 5px;
  margin-top: 10px;
}

/* ------------------------------------------------------------------ */
/* Kennzahlen                                                           */
/* ------------------------------------------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: clamp(16px, 2vw, 24px);
  background: var(--surface);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-rested);
}
.metric {
  padding: clamp(16px, 2.2vw, 24px);
  min-width: 0;
}
.metrics .metric + .metric {
  border-left: 1px solid var(--border);
}
@media (max-width: 720px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics .metric:nth-child(3) {
    border-left: 0;
  }
  .metrics .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}
.metrics--compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.metrics--compact .metric:nth-child(n) {
  border-top: 0;
}
.metric-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.metric-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 4px;
}
.metric-value .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 1;
  padding-top: 0.1em;
  letter-spacing: 0.005em;
}
.metric-value--lg .num {
  font-size: clamp(2.75rem, 5vw, 3.5rem);
}
.metric-value--xl .num {
  font-size: clamp(3.25rem, 7vw, 4.5rem);
}
.metric-unit {
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.metric-foot {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.delta {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Diagramme                                                            */
/* ------------------------------------------------------------------ */

.chart {
  margin: 0;
  position: relative;
}
/* Zeile über dem Diagramm: der Wert unter dem Zeiger, sonst der aktuelle. */
.chart-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-height: 1.6em;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.chart-readout strong {
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
}
.chart-plot {
  position: relative;
  height: var(--h, 160px);
}
/* Kachel, deren Diagramm die Höhe der Nachbarkachel mitnimmt. */
.panel--fill {
  display: flex;
  flex-direction: column;
}
.panel--fill .chart {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.panel--fill .chart-plot {
  flex: 1;
  height: auto;
  min-height: var(--h, 160px);
}
.overview .grid {
  align-items: stretch;
}
.chart-cols {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: clamp(3px, 0.8vw, 8px);
  height: 100%;
}
.chart-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 100%;
  border-radius: 8px;
  transition: background-color 0.15s var(--ease-out);
}
.chart-col.is-active {
  background: var(--board-fill);
}
.chart-bar {
  display: block;
  width: 100%;
  height: calc(var(--v) * 100%);
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: var(--heat-2);
  transform-origin: 50% 100%;
}
.chart-bar[hidden] {
  display: none;
}
.chart-bar.is-over {
  background: var(--heat-3);
}
.chart-bar.is-current {
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .chart-bar {
    animation: grow-y 0.8s var(--ease-out) both;
  }
}
@keyframes grow-y {
  from {
    transform: scaleY(0);
  }
}
.chart-goal {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  border-top: 1.5px dashed var(--board-outline);
  pointer-events: none;
}
.chart-goal span {
  position: absolute;
  right: 0;
  bottom: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.chart-axis {
  display: grid;
  gap: clamp(3px, 0.8vw, 8px);
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.chart-axis span {
  white-space: nowrap;
  overflow: hidden;
}

/* Linie */
.line-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}
.line-plot {
  position: relative;
  touch-action: pan-y;
  cursor: crosshair;
}
.line-plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* Die Kurve deckt sich von links auf (Strich-Animation verträgt die gestreckte Zeichenfläche nicht). */
@media (prefers-reduced-motion: no-preference) {
  .line-plot svg {
    animation: reveal 1.1s var(--ease-out) both;
  }
}
@keyframes reveal {
  from {
    clip-path: inset(-8px 100% -8px -8px);
  }
  to {
    clip-path: inset(-8px);
  }
}
.line-area {
  fill: var(--accent);
  opacity: 0.1;
}
.line-point,
.line-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}
.line-point {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  opacity: 0.55;
}
.line-dot {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  outline: 4px solid color-mix(in srgb, var(--accent) 24%, transparent);
  transition:
    left 0.12s var(--ease-out),
    top 0.12s var(--ease-out);
}
.line-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 2ch;
  padding: 2px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.line-axis {
  grid-column: 1;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Aktivitätsraster: eine Spalte je Woche, vier Stufen nach Dauer. */
.heat-grid {
  display: grid;
  grid-template-columns: 26px repeat(12, minmax(0, 1fr));
  gap: clamp(3px, 0.6vw, 6px);
  max-width: 560px;
}
.heat-days,
.heat-week {
  display: grid;
  grid-template-rows: 16px repeat(7, minmax(0, 1fr));
  gap: clamp(3px, 0.6vw, 6px);
}
.heat-days {
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1;
}
.heat-days span {
  align-self: center;
}
.heat-month {
  height: 16px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 16px;
  white-space: nowrap;
}
.heat-cell {
  display: block;
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--board-track);
}
.heat-1 {
  background: var(--heat-1);
}
.heat-2 {
  background: var(--heat-2);
}
.heat-3 {
  background: var(--heat-3);
}
.heat-4 {
  background: var(--heat-4);
}
.heat-cell.is-future {
  opacity: 0.4;
}
.heat-cell.is-today {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}
.heat-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.heat-readout {
  color: var(--text);
  font-weight: 600;
}
.heat-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.heat-legend .heat-cell {
  width: 12px;
  border-radius: 3px;
}
.heat-legend span:first-child {
  margin-right: 4px;
}
.heat-legend span:last-child {
  margin-left: 4px;
}

/* ------------------------------------------------------------------ */
/* Listen                                                               */
/* ------------------------------------------------------------------ */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rows li + li {
  border-top: 1px solid var(--border);
}
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 4px;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  transition: background-color 0.2s var(--ease-out);
}
.row:hover {
  background: var(--fill);
}
.row-date {
  display: grid;
  justify-items: center;
  width: 48px;
  flex: none;
  line-height: 1;
}
.row-day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  padding-top: 0.1em;
  font-variant-numeric: tabular-nums;
}
.row-month {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.row-chevron {
  color: var(--text-muted);
}
.more {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}
.more:empty {
  display: none;
}

/* Tabellen */
.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}
.records,
.sets {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.records th,
.records td,
.sets th,
.sets td {
  padding: 10px 4px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.records thead th,
.sets thead th {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.records tbody th {
  font-weight: 600;
}
.records td,
.records thead th:not(:first-child),
.sets td:not(:first-child),
.sets thead th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.records tbody tr:last-child > *,
.sets tbody tr:last-child > * {
  border-bottom: 0;
}
.num--strong {
  font-weight: 600;
}

/* Ein Training */
.session .metrics {
  margin-top: 8px;
}
.session-notes {
  margin-bottom: 20px;
  color: var(--text-muted);
  max-width: 70ch;
}
.exercises {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.exercise-name {
  margin-bottom: 8px;
}
.set-tag {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--fill);
  font-weight: 600;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.set--warmup .set-tag {
  background: var(--set-warmup-subtle);
  color: var(--set-warmup);
}
.set--drop .set-tag {
  background: var(--set-drop-subtle);
  color: var(--set-drop);
}
.set--failure .set-tag {
  background: var(--danger-subtle);
  color: var(--danger-strong);
}

/* ------------------------------------------------------------------ */
/* Gewicht                                                              */
/* ------------------------------------------------------------------ */

.weight-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.input-unit {
  position: relative;
  flex: 1 1 140px;
}
.input-unit input,
.explain-input,
.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 52px 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font: 400 1.0625rem/1.4 var(--font-text);
  transition:
    border-color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}
.field input,
.explain-input {
  padding-right: 14px;
}
.input-unit input:focus,
.explain-input:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.input-unit span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.weight-status:not(:empty) {
  margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Ernährung                                                            */
/* ------------------------------------------------------------------ */

.day-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 420px;
  margin-bottom: clamp(16px, 2vw, 24px);
}
.day-switch-label {
  display: grid;
  text-align: center;
  line-height: 1.3;
}
.day-switch-label span {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.day-head {
  display: grid;
  gap: 24px;
}
.kcal .muted {
  margin-top: 4px;
}
.kcal .is-over {
  color: var(--danger);
}
.progress--kcal {
  margin-top: 14px;
  height: 10px;
}
.progress--kcal.is-over > span {
  background: var(--danger-muted);
}
.macros {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 520px) {
  .macros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.macro-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.macro-value {
  margin-top: 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.macro-value span {
  color: var(--text-muted);
  font-weight: 400;
}
.macro--protein .progress > span {
  background: var(--macro-protein);
}
.macro--carbs .progress > span {
  background: var(--macro-carbs);
}
.macro--fat .progress > span {
  background: var(--macro-fat);
}
.progress--water > span {
  background: var(--badge-water);
}
.meal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.meal-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.meal-head p {
  color: var(--text-muted);
}
.meal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--badge-snack);
}
.meal--breakfast .meal-dot {
  background: var(--badge-breakfast);
}
.meal--lunch .meal-dot {
  background: var(--badge-lunch);
}
.meal--dinner .meal-dot {
  background: var(--badge-dinner);
}
.foods {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.foods li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 4.5em;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}
.food-name {
  display: grid;
  min-width: 0;
}
.food-brand,
.food-qty {
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.food-kcal {
  text-align: right;
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Lernen                                                               */
/* ------------------------------------------------------------------ */

.learn {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}
.group-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.path-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(16px, 2vw, 24px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.path-card {
  display: grid;
  gap: 12px;
  height: 100%;
  padding: clamp(18px, 2.4vw, 26px);
  border-radius: var(--radius-tile);
  background: var(--surface);
  box-shadow: var(--shadow-rested);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}
.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}
.path-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.path-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1;
  padding-top: 0.12em;
  text-transform: uppercase;
}
.path-summary {
  color: var(--text-muted);
}
.path-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-subtle);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
}
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 60ch;
  margin-top: 16px;
}
.note .icon {
  margin-top: 3px;
}
.learn-path-name {
  font-weight: 600;
  margin-bottom: 10px;
}
.panel--learn .progress {
  margin-bottom: 8px;
}
.panel--learn .btn {
  margin-top: 16px;
}

/* Neues Thema */
.topic-form {
  display: grid;
  gap: 18px;
  max-width: 640px;
  margin-top: 16px;
}
.topic-form h3 {
  font-size: 1.0625rem;
}
.topic-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.topic-form legend {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}
.topic-form .btn {
  justify-self: start;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--fill);
  font-weight: 600;
  font-size: 0.9375rem;
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}
.chip input:checked + span {
  background: var(--accent);
  color: var(--text-on-accent);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Ein Pfad */
.path-intro {
  display: grid;
  gap: 16px;
  justify-items: start;
  max-width: 640px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.path-intro .lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}
.path-intro .progress {
  width: 100%;
}
.chapter + .chapter {
  margin-top: clamp(28px, 4vw, 44px);
}
.chapter-head {
  max-width: 640px;
  margin-bottom: 14px;
}
.chapter-num {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.chapter-head h2 {
  font-size: 1.375rem;
  margin: 2px 0 4px;
}
.lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
  background: var(--surface);
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-rested);
}
.lesson + .lesson {
  border-top: 1px solid var(--border);
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px clamp(14px, 2vw, 20px);
  color: inherit;
  text-decoration: none;
}
a.lesson-row:hover .lesson-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.lesson--locked .lesson-row {
  color: var(--text-muted);
}
.lesson-state {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  background: var(--fill);
  font-weight: 600;
  font-size: 0.875rem;
}
.lesson-state .icon {
  width: 16px;
  height: 16px;
}
.lesson-state--done {
  background: var(--success-subtle);
  color: var(--success-strong);
}
.lesson-state--next {
  background: var(--accent);
  color: var(--text-on-accent);
}
.lesson-title {
  flex: 1;
  font-weight: 600;
  min-width: 0;
}
.lesson-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.lesson-go {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ */
/* Lektions-Player                                                      */
/* ------------------------------------------------------------------ */

.player {
  max-width: 720px;
  margin: 0 auto;
}
.player-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.progress--lesson {
  flex: 1;
  height: 10px;
}
.progress--lesson > span {
  animation: none;
}
.card-stage {
  min-height: 320px;
}
.lcard {
  display: grid;
  gap: 18px;
  outline: none;
}
@media (prefers-reduced-motion: no-preference) {
  .lcard.is-in {
    animation: card-in 0.45s var(--ease-out) both;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lcard.is-in {
    animation: fade 0.2s linear both;
  }
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.card-title,
.card-prompt {
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
}
.card-body {
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 62ch;
  white-space: pre-line;
}
.hint {
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.options {
  display: grid;
  gap: 10px;
}
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-rested);
  color: var(--text);
  font: 400 1.0625rem/1.4 var(--font-text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out),
    transform 0.15s var(--ease-out);
}
.option:hover:not(:disabled) {
  border-color: var(--border-strong);
}
.option:active:not(:disabled) {
  transform: scale(0.99);
}
.option:disabled {
  cursor: default;
}
.option-key {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--fill);
  font-weight: 600;
  font-size: 0.875rem;
  flex: none;
}
.option.is-right,
.chip-word.is-right {
  border-color: var(--success);
  background: var(--success-subtle);
}
.option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-subtle);
}
.option--match[aria-pressed="true"] {
  border-color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .option--match.is-wrong {
    animation: shake 0.4s var(--ease-out);
  }
}
@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.match-col {
  display: grid;
  gap: 10px;
  align-content: start;
}
.option--match {
  min-height: 52px;
  font-size: 1rem;
}

.cloze-text {
  font-size: 1.1875rem;
  line-height: 2.2;
}
.gap {
  display: inline-block;
  min-width: 5em;
  min-height: 40px;
  margin: 0 4px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid var(--border-strong);
  border-radius: 8px 8px 0 0;
  background: var(--fill);
  color: var(--text);
  font: 600 1.0625rem/40px var(--font-text);
  vertical-align: middle;
  cursor: pointer;
}
.gap.is-filled {
  border-bottom-color: var(--accent);
}
.word-bank,
.build-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.build-line {
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
}
.chip-word {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-rested);
  color: var(--text);
  font: 600 1rem/1 var(--font-text);
  cursor: pointer;
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.15s var(--ease-out);
}
.chip-word:disabled {
  opacity: 0.3;
  cursor: default;
}
.chip-word.is-placed {
  background: var(--accent-subtle);
  color: var(--accent-strong);
  box-shadow: none;
}
.chip-word.is-placed:disabled {
  opacity: 1;
}

.flash-front {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
}
.flash-back {
  padding: 20px;
  border-radius: 16px;
  background: var(--accent-subtle);
  color: var(--text);
  font-size: 1.125rem;
}
@media (prefers-reduced-motion: no-preference) {
  .flash-back:not([hidden]),
  .sample:not([hidden]) {
    animation: rise 0.4s var(--ease-out) both;
  }
}
.listen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.listen-phrase,
.speak-phrase {
  font-size: 1.375rem;
  font-weight: 600;
}
.sample {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 16px;
  background: var(--fill);
}
.sample-title {
  font-weight: 600;
}
.rubric {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.rubric li {
  display: flex;
  gap: 8px;
}
.rubric .icon {
  color: var(--success);
  margin-top: 4px;
}
.explain-input {
  resize: vertical;
  min-height: 140px;
}

.card-foot {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  margin-top: 28px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.card-foot:empty {
  display: none;
}
.card-foot > .btn {
  min-width: 180px;
}
.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.verdict.is-right,
.verdict.is-wrong {
  padding: 16px;
  border-radius: 16px;
}
.verdict.is-right {
  background: var(--success-subtle);
}
.verdict.is-wrong {
  background: var(--danger-subtle);
}
.verdict-text {
  display: grid;
  gap: 4px;
  flex: 1 1 260px;
}
.verdict-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.0625rem;
}
.is-right .verdict-title {
  color: var(--success-strong);
}
.is-wrong .verdict-title {
  color: var(--danger-strong);
}
@media (prefers-reduced-motion: no-preference) {
  .verdict {
    animation: rise 0.3s var(--ease-out) both;
  }
}
.self-rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.self-rate-q {
  flex: 1 1 100%;
  font-weight: 600;
}

.finish {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: clamp(28px, 5vw, 56px) 0;
}
.finish-poster {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 4.75rem);
  line-height: 0.92;
  padding-top: 0.14em;
  text-transform: uppercase;
}
.finish-pct {
  color: var(--text-muted);
  font-size: 1.125rem;
}
.finish-xp {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--accent-subtle);
  color: var(--accent-strong);
  font-weight: 600;
}
.finish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Widgets */
.widget {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 20px);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-rested);
}
.w-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--fill);
}
.w-line {
  stroke-width: 4;
  stroke-linecap: round;
}
.w-circle {
  fill: none;
  stroke-width: 2.5;
}
.w-point {
  stroke: var(--surface);
  stroke-width: 3;
}
.tone-accent {
  stroke: var(--accent);
}
.w-point.tone-accent {
  fill: var(--accent);
}
.tone-text {
  stroke: var(--text);
}
.w-point.tone-text {
  fill: var(--text);
}
.tone-muted {
  stroke: var(--border-strong);
}
.w-point.tone-muted {
  fill: var(--border-strong);
}
.w-label {
  fill: var(--text-muted);
  font: 600 20px var(--font-text);
}
.w-axes line {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.w-graph {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
}
.w-params {
  display: grid;
  gap: 14px;
}
.w-param {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: baseline;
}
.w-param label {
  font-weight: 600;
  font-size: 0.9375rem;
}
.w-param output {
  font-weight: 600;
}
.w-param input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent);
}
.w-readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 16px;
  margin: 0;
}
.w-readouts:empty {
  display: none;
}
.w-readouts dt {
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.w-readouts dd {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  padding-top: 0.1em;
}
.w-goal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--fill);
  font-weight: 600;
  transition: background-color 0.3s var(--ease-out);
}
.w-goal.is-reached {
  background: var(--success-subtle);
  color: var(--success-strong);
}
.w-layers,
.w-nodes,
.w-edges,
.w-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.w-layers {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.w-layers > li {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.w-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.w-node {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--fill);
  font-weight: 600;
  text-align: center;
}
.w-arrow {
  color: var(--text-muted);
}
.w-edges {
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
}
.w-edge-arrow {
  color: var(--accent);
}
.w-step-start,
.w-step-text {
  font-weight: 600;
  font-size: 1.125rem;
}
.w-steps {
  display: grid;
  gap: 12px;
  padding-left: 1.4em;
  list-style: decimal;
}
.w-steps li::marker {
  color: var(--text-muted);
  font-weight: 600;
}
.widget--steps .btn {
  justify-self: start;
}

/* ------------------------------------------------------------------ */
/* Anmelden                                                             */
/* ------------------------------------------------------------------ */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100svh;
}
.auth-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* Fläche der ruhigen Seiten: gerader Verlauf von oben nach unten (DESIGN.md §3, v6.27). */
  background: linear-gradient(180deg, var(--wash-calm-top), var(--wash-calm-bottom));
  color: var(--s-text);
  padding: calc(var(--head-h) + 48px) var(--gutter) 64px;
}
.auth-bogi {
  width: 132px;
  height: 132px;
  margin: 0 0 20px -14px;
}
.auth-stage-inner {
  position: relative;
  max-width: 520px;
  margin-left: auto;
  width: 100%;
}
.auth-poster {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.25rem, 8vw, 6rem);
  line-height: 0.9;
  text-transform: uppercase;
  padding-top: 0.14em;
}
.auth-stage-lead {
  margin-top: 20px;
  max-width: 40ch;
  color: var(--s-muted);
  font-size: 1.125rem;
}
.auth-points {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-points .icon {
  color: var(--s-accent);
}
.auth-side {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: calc(var(--head-h) + 48px) var(--gutter) 64px;
}
.auth-side > * {
  width: 100%;
  max-width: 420px;
}
.auth-panel {
  display: grid;
  gap: 18px;
}
.auth-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.auth-lead {
  color: var(--text-muted);
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 20px;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-oauth {
  display: grid;
  gap: 10px;
}
.auth-mark {
  width: 20px;
  height: 20px;
  flex: none;
}
.auth-foot {
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.auth-foot--quiet {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
}
.auth-foot--quiet .icon {
  margin-top: 3px;
}
@media (max-width: 900px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .auth-stage {
    padding: calc(var(--head-h) + 32px) var(--gutter) 36px;
  }
  .auth-stage-inner {
    margin-left: 0;
  }
  .auth-points,
  .auth-bogi {
    display: none;
  }
  .auth-side {
    padding: 32px var(--gutter) 64px;
    justify-items: start;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-panel > *,
  .auth-poster,
  .auth-stage-lead,
  .auth-points li {
    animation: rise 0.6s var(--ease-out) both;
  }
  .auth-stage-lead {
    animation-delay: 80ms;
  }
  .auth-points li:nth-child(1) {
    animation-delay: 160ms;
  }
  .auth-points li:nth-child(2) {
    animation-delay: 210ms;
  }
  .auth-points li:nth-child(3) {
    animation-delay: 260ms;
  }
  .auth-points li:nth-child(4) {
    animation-delay: 310ms;
  }
}

/* Häkchen „Angemeldet bleiben“ */
.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 44px;
  margin: -10px 0 0 -10px;
  cursor: pointer;
}
.check-box {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  background: var(--fill);
  color: transparent;
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out);
}
.check-box .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.check input:checked + .check-box {
  background: var(--accent);
  color: var(--text-on-accent);
}
.check input:focus-visible + .check-box {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.check-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
}
.check-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Einstellungen */
.settings-email {
  margin-top: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.settings .btn {
  margin-top: 4px;
}

.settings-plan {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.settings-plan-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.settings-foot {
  margin-top: 18px;
}
.settings .panel > .btn {
  margin-top: 12px;
}
.settings .panel > [aria-live]:not(:empty) {
  margin-top: 12px;
}

/* Konto löschen: von den übrigen Aktionen getrennt, die Gefahr steht am Knopf. */
.danger-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.danger-list li + li {
  margin-top: 2px;
}
.danger-sub {
  margin-top: 14px;
  font-weight: 600;
}
.danger-body {
  margin-top: 18px;
}
.danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn--danger {
  background: var(--danger);
  color: var(--text-on-danger);
}
.btn--danger-quiet {
  background: var(--danger-subtle);
  color: var(--danger-strong);
}

/* ------------------------------------------------------------------ */
/* Training: Reiter, Suche, Übungen, Meine Trainings                    */
/* ------------------------------------------------------------------ */

.seg {
  margin-bottom: clamp(16px, 2vw, 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg ul {
  display: inline-flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: 16px;
  background: var(--control);
}
.seg a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}
.seg a:hover {
  color: var(--text);
}
.seg a[aria-current="page"] {
  background: var(--thumb);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  .seg a[aria-current="page"] {
    background: var(--control-pressed);
  }
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.toolbar--split {
  justify-content: space-between;
}
.toolbar .back-link {
  margin-bottom: 0;
}
.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 440px;
}
.search input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px 12px 46px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--control);
  color: var(--text);
  font: 400 1rem/1.4 var(--font-text);
  transition:
    border-color 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
}
.search input::placeholder {
  color: var(--text-muted);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.tool-count {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.tool-count:empty {
  display: none;
}
.history {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}
.history-side {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  align-content: start;
}
.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.history-layout > .history-side {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--head-h) + 16px);
}
.history-layout > .history-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
@media (max-width: 960px) {
  .history-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .history-layout > .history-side,
  .history-layout > .history-main {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
}
.totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.totals .metric {
  padding: 0;
}
.totals .metric-value {
  display: grid;
  gap: 0;
}
.totals .metric-value .num {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.totals .metric-unit {
  font-size: 0.8125rem;
}
.top-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-list li + li {
  border-top: 1px solid var(--border);
}
.top-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  color: inherit;
  text-decoration: none;
}
.top-list a:hover .top-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.top-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.top-list .num {
  flex: none;
  color: var(--text-muted);
}
.month .panel-head {
  margin-bottom: 8px;
}
.empty-state {
  display: grid;
  gap: 6px;
  max-width: 52ch;
  padding: 8px 0;
}
.empty-title {
  font-size: 1.0625rem;
  font-weight: 600;
}
.cell-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}
.cell-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.records--links tbody th {
  padding-top: 2px;
  padding-bottom: 2px;
}
@media (max-width: 720px) {
  .col-wide {
    display: none;
  }
}
.exercise-name .row-chevron {
  width: 18px;
  height: 18px;
}

/* Eine Übung */
.ranges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 99px;
  background: var(--control);
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}
.range[aria-current="true"] {
  background: var(--text);
  color: var(--bg);
}
.range.is-locked {
  color: var(--text-muted);
  cursor: not-allowed;
}
.range-icon {
  width: 14px;
  height: 14px;
}
.pro-tag {
  display: inline-block;
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
  font: 700 0.75rem/1.5 var(--font-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pro-note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.exercise-page .metrics {
  margin-top: 8px;
}
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.today-foot {
  margin-top: 12px;
}

/* Meine Trainings */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.plan-card {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 22px 24px 18px;
  border-radius: var(--radius-tile);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.plan-card:hover {
  transform: translateY(-2px);
}
.plan-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1;
  text-transform: uppercase;
  /* Platz für Umlaute über der Zeile (AGENTS.md, Barlow) */
  padding-top: 0.14em;
  overflow-wrap: anywhere;
}
.plan-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.plan-page {
  max-width: 860px;
}
.plan-name {
  display: grid;
  grid-template-columns: 1.8em minmax(0, 1fr);
  align-items: baseline;
}
.plan-no {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.plan-note {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}
.plan-rest {
  display: none;
}
/* Handy: Die Pause rutscht unter den Namen, damit die Tabelle nicht seitlich läuft. */
@media (max-width: 560px) {
  .plan-table .col-rest {
    display: none;
  }
  .plan-rest {
    display: block;
  }
  .plan-table th,
  .plan-table td {
    padding-inline: 6px;
  }
  .plan-table th:first-child {
    padding-left: 0;
  }
}
.plan-edit {
  margin-top: 18px;
  font-size: 0.875rem;
}
.print-only,
.print-head {
  display: none;
}

/* Drucken: nur das Blatt, schwarz auf weiß, mit Feldern zum Abhaken. */
@media print {
  .site-head,
  .site-foot,
  .skip,
  .acct-stage,
  .seg,
  .toolbar,
  .plan-edit {
    display: none !important;
  }
  /* Papier ist hell, auch wenn das Gerät dunkel eingestellt ist. */
  :root {
    color-scheme: light;
  }
  html,
  body,
  .page-account,
  .acct-board {
    background: Canvas;
    color: CanvasText;
  }
  .acct-view {
    --surface: transparent;
    --text: CanvasText;
    --text-muted: GrayText;
    --border: GrayText;
    padding: 0;
  }
  .plan-sheet th,
  .plan-sheet td,
  .plan-sheet p {
    color: CanvasText;
  }
  .plan-sheet .plan-no,
  .plan-sheet .plan-note,
  .plan-sheet thead th {
    color: GrayText;
  }
  .acct-view.is-entering * {
    animation: none !important;
  }
  .plan-page {
    max-width: none;
  }
  .plan-sheet {
    max-width: none;
    padding: 0;
    color: CanvasText;
  }
  .print-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12pt;
    padding-bottom: 6pt;
    border-bottom: 1.5pt solid CanvasText;
  }
  .print-title {
    font: 700 26pt/1 var(--font-display);
    text-transform: uppercase;
    padding-top: 0.14em;
  }
  .print-only {
    display: table-cell;
  }
  .print-boxes {
    width: 28%;
  }
  .plan-table th,
  .plan-table td {
    border-bottom: 0.75pt solid GrayText;
    padding: 9pt 4pt;
  }
  .plan-table tr {
    break-inside: avoid;
  }
}

.settings .panel > h2 {
  margin-bottom: 8px;
}
.settings .panel > form {
  margin-top: 16px;
}
.settings form .btn {
  justify-self: start;
}
