/* ==========================================================================
   FitCards — Design Tokens
   Konzept: ein physisches Kartenspiel für dein Workout. Der Timer läuft als
   mechanische Flip-Anzeige (Bahnhofsuhr/Klappzahlen), die Übungskarte ist
   echtes Kartonpapier zwischen zwei dunklen "Bahnen" — Arbeit (warm) und
   Pause (kühl). Ein Signaturelement zieht sich durch: alles klappt.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Erzwingt das hidden-Attribut auch gegen Klassen mit eigenem display:-Wert
   (sonst gewinnt bei gleicher Spezifität die Author-Regel gegen [hidden]). */
[hidden] { display: none !important; }

.env-badge {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  z-index: 9999;
  pointer-events: none;
}
.env-tag {
  position: fixed;
  top: 8px; right: 8px;
  z-index: 9999;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0A1F12;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.env-debug {
  position: fixed;
  top: 32px; right: 8px;
  z-index: 9999;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 999px;
}

:root {
  /* Farbe */
  --ink-bg:      #14171C;   /* App-Hintergrund, Bahn */
  --ink-bg-2:    #1B1F26;   /* leicht angehobene Fläche */
  --ink-bg-3:    #232833;   /* Chips, Inputs */
  --paper:       #EDE6D6;   /* Kartenpapier */
  --paper-ink:   #221F1A;   /* Text auf Karte */
  --paper-soft:  #E2D9C4;   /* Kartenschatten/Rand */
  --text:        #F3F0E7;   /* Text auf dunkel */
  --text-muted:  #90959F;
  --line:        rgba(243,240,231,0.09);

  --work:        #FF5A36;   /* Arbeit — warm, Puls */
  --work-dim:    #40241C;
  --work-soft:   rgba(255,90,54,0.14);
  --rest:        #2FD3C4;   /* Pause — kühl, Atem */
  --rest-dim:    #17332F;
  --rest-soft:   rgba(47,211,196,0.14);

  /* Typografie */
  --f-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --f-body: 'Space Grotesk', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Form */
  --radius-l: 26px;
  --radius-m: 16px;
  --radius-s: 10px;
  --tap: 48px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-bg);
  color: var(--text);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible {
  outline: 2px solid var(--rest);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }

/* App-Rahmen: mobile-first, auf Desktop wie ein Handy gerahmt.
   `height` (nicht nur `min-height`) ist hier Pflicht, nicht nur Kosmetik:
   `.card-stage` nutzt weiter unten Container-Query-Einheiten (cqh), damit die
   Trainings-Karte sich nach verfügbarer Höhe statt fixer Breite richtet —
   Chromium löst `cqh` aber nur auf, wenn die Höhen-Kette bis hier hoch über
   ein „definites" `height` läuft, ein reines `min-height` reicht dafür nicht
   (Container-Box bleibt sonst 0×0, obwohl normales Flex-Layout normal
   funktioniert). Getestet/isoliert reproduziert, kein Chromium-Bug-Workaround
   „auf Verdacht". */
.app {
  height: 100dvh;
  min-height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ink-bg);
}
@media (min-width: 540px) {
  body { background: #0B0D10; }
  .app {
    height: min(860px, 96dvh);
    min-height: min(860px, 96dvh);
    margin: 2dvh auto;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  }
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.screen.is-active { display: flex; }

/* ==========================================================================
   Eyebrow / Wortmarke
   ========================================================================== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  line-height: 1;
}

/* ==========================================================================
   START-SCREEN
   ========================================================================== */
.start-screen {
  padding: 22px 26px 26px;
  justify-content: space-between;
}
.start-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-btn {
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--ink-bg-2); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

.start-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Wächst nur, wenn wirklich Platz da ist (oberhalb ~700px Viewport-Höhe),
     statt eines festen 10vh-Abstands — auf kurzen mobilen Viewports (Adress-
     leiste sichtbar etc.) frisst der sonst genau den Platz, den z.B. der
     Trainings-Picker unten braucht, und erzwingt Scrollen. */
  margin-top: max(0px, calc((100dvh - 700px) / 3));
}
.start-kicker {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rest);
}
.start-title {
  font-family: var(--f-display);
  font-size: 58px;
  line-height: 0.94;
  letter-spacing: 0.01em;
  color: var(--text);
}
.start-title em {
  font-style: normal;
  color: var(--work);
}
.start-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 34ch;
  line-height: 1.5;
}

.deck-preview {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 8px;
}
.deck-stack {
  position: relative;
  width: 84px;
  height: 108px;
  flex-shrink: 0;
}
.deck-stack .chip {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}
.deck-stack .chip:nth-child(1) { transform: rotate(-8deg) translate(-4px, 4px); opacity: .55; }
.deck-stack .chip:nth-child(2) { transform: rotate(4deg) translate(3px, 2px); opacity: .78; }
.deck-stack .chip:nth-child(3) { transform: rotate(-2deg); display: grid; place-items: center; color: var(--paper-ink); }
.deck-stack .chip:nth-child(3) svg { width: 34px; height: 34px; opacity: .8; }

.stat-line { display: flex; flex-direction: column; gap: 4px; }
.stat-line .num { font-family: var(--f-display); font-size: 40px; line-height: 1; color: var(--text); }
.stat-line .lbl { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.stat-row { display: flex; gap: 28px; }

.start-bottom { display: flex; flex-direction: column; gap: 16px; }
.btn-start {
  width: 100%;
  padding: 20px;
  border-radius: 999px;
  background: var(--work);
  color: #1A0D08;
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  box-shadow: 0 10px 26px var(--work-soft);
}
.btn-start:active { transform: scale(0.97); }
.btn-start svg { width: 20px; height: 20px; }
.start-foot {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   WORKOUT-SCREEN
   ========================================================================== */
.workout-screen {
  --phase-color: var(--work);
  --phase-dim: var(--work-dim);
  --phase-soft: var(--work-soft);
  padding: 20px 22px 26px;
  gap: 18px;
  transition: background .5s var(--ease);
}
.workout-screen[data-phase="rest"] {
  --phase-color: var(--rest);
  --phase-dim: var(--rest-dim);
  --phase-soft: var(--rest-soft);
}

.workout-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phase-pill {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--phase-color);
  background: var(--phase-soft);
  display: flex; align-items: center; gap: 7px;
  transition: color .4s var(--ease), background .4s var(--ease);
}
.phase-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--phase-color);
  box-shadow: 0 0 0 4px var(--phase-soft);
}
#phase-label { font-size: x-large; }

/* Klappzahlen-Timer */
.timer {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 2px;
}
.flip-unit {
  position: relative;
  width: 58px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--ink-bg-3);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  transition: box-shadow .4s var(--ease);
}
.flip-unit::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(0,0,0,0.45);
  transform: translateY(-0.5px);
}
.flip-unit::before {
  content: '';
  position: absolute;
  left: 6px; top: calc(50% - 1px);
  width: 4px; height: 2px;
  background: var(--ink-bg);
  border-radius: 2px;
  z-index: 2;
}
.flip-unit .digit {
  font-family: var(--f-display);
  font-size: 46px;
  line-height: 1;
  text-align: center;
  color: var(--text);
  transition: color .4s var(--ease);
}
.flip-unit.is-flash { box-shadow: inset 0 0 0 1px var(--phase-color), 0 0 0 4px var(--phase-soft); }
.timer-colon {
  font-family: var(--f-display);
  font-size: 40px;
  color: var(--text-muted);
  align-self: center;
  padding-bottom: 6px;
}

.timer-caption {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--phase-color);
  transition: color .4s var(--ease);
}

/* Fortschritt */
.progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.progress-label {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.progress-label b { color: var(--text); font-weight: 500; }
.progress-dashes {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.progress-dashes .dash {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: var(--ink-bg-3);
  overflow: hidden;
}
.progress-dashes .dash > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--phase-color);
  border-radius: 3px;
  transition: width .3s linear, background .4s var(--ease);
}
.progress-dashes .dash.is-done > i { width: 100%; background: var(--text-muted); }

/* Karte */
.card-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  min-height: 0;
  container-type: size;
  perspective: 1400px;
}
.flip-card {
  /* Größte 3:4-Karte, die noch in card-stage passt: 100% Breite ODER die
     Breite, die der verfügbaren Höhe entspricht (75cqh, da 3/4 von 100cqh)
     — je nachdem was zuerst greift. Nutzt so die volle Breite auf normal
     hohen Screens, schrumpft aber automatisch statt zu überlaufen, wenn
     wenig Höhe verfügbar ist (kurze mobile Viewports, Adressleiste etc.). */
  width: min(100%, 75cqh);
  aspect-ratio: 3 / 4;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s var(--ease);
}
.flip-card.is-flipped { transform: rotateY(180deg); }
.flip-card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-l);
  background: var(--paper);
  color: var(--paper-ink);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(0,0,0,0.05);
}
.flip-card-face.is-back { transform: rotateY(180deg); }

.card-front { align-items: stretch; justify-content: space-between; padding: 22px; }
.card-icon-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--paper-ink);
  opacity: 0.82;
}
.card-icon-wrap svg { width: 88%; height: 88%; }
.card-front-foot { display: flex; flex-direction: column; gap: 8px; }
.card-title {
  font-family: var(--f-display);
  font-size: 30px;
  letter-spacing: 0.01em;
  line-height: 1.02;
}
.card-hint {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(34,31,26,0.5);
  display: flex; align-items: center; gap: 6px;
}
.card-hint svg { width: 13px; height: 13px; }

.card-back { padding: 26px; justify-content: flex-start; gap: 16px; }
.card-back .card-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(34,31,26,0.55);
}
.card-back .card-title { font-size: 24px; }
.card-desc { font-size: 15px; line-height: 1.55; }
.card-tip {
  margin-top: auto;
  padding: 14px 16px;
  background: rgba(34,31,26,0.06);
  border-radius: var(--radius-s);
  border-left: 3px solid var(--phase-color);
  font-size: 13.5px;
  line-height: 1.5;
}
.card-tip b {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: rgba(34,31,26,0.55);
}

.reps-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 4px 0;
}
.reps-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink-bg-3);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: grid; place-items: center;
}
.reps-btn:active { transform: scale(0.92); }
.reps-value {
  font-family: var(--f-display);
  font-size: 32px;
  min-width: 60px;
  text-align: center;
}
.reps-label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: -8px;
}

.reps-mini-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.reps-mini-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink-bg-3);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  display: grid; place-items: center;
}
.reps-mini-value {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 46px;
  text-align: center;
}

.next-up {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.next-up b { color: var(--text); font-weight: 500; }

.workout-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.ctrl-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink-bg-3);
  color: var(--text);
  display: grid; place-items: center;
  transition: background .2s var(--ease);
}
.ctrl-btn:hover { background: #2A303C; }
.ctrl-btn svg { width: 20px; height: 20px; }
.ctrl-btn.primary {
  width: 64px; height: 64px;
  background: var(--phase-color);
  color: #14171C;
  transition: background .4s var(--ease);
}
.ctrl-btn.primary svg { width: 24px; height: 24px; }

/* ==========================================================================
   FERTIG-SCREEN
   ========================================================================== */
.done-screen {
  padding: 28px 26px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}
.done-badge {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: var(--work-soft);
  color: var(--work);
  display: grid; place-items: center;
}
.done-badge svg { width: 34px; height: 34px; }
.done-title { font-family: var(--f-display); font-size: 40px; }
.done-sub { color: var(--text-muted); font-size: 14.5px; max-width: 30ch; line-height: 1.5; }
.done-stats { display: flex; gap: 34px; margin: 8px 0 6px; }

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
.onboarding-screen { padding: 28px 26px 34px; justify-content: space-between; }
.onboarding-hero { display: flex; flex-direction: column; gap: 18px; margin-top: 8vh; }
.onb-title {
  font-family: var(--f-display);
  font-size: 50px;
  line-height: 0.98;
  letter-spacing: 0.01em;
}
.onb-title em { font-style: normal; color: var(--rest); }
.onb-input {
  margin-top: 6px;
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--radius-m);
  background: var(--ink-bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 18px;
  font-weight: 500;
}
.onb-input::placeholder { color: var(--text-muted); font-weight: 400; }
.onb-input:focus { border-color: var(--rest); }
.btn-start:disabled { opacity: 0.4; pointer-events: none; }

/* ==========================================================================
   ÜBUNGEN VERWALTEN (Onboarding Schritt 2 + spätere Bearbeitung)
   ========================================================================== */
.exercises-screen { padding: 20px 22px 26px; gap: 16px; }
.exercises-top { display: flex; align-items: center; gap: 4px; }
.exercises-sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-top: -8px; }

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 2px;
}
.category-header:first-child { padding-top: 0; }
.category-expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 0;
}
.category-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .18s var(--ease);
}
.category-header.is-expanded .category-chevron { transform: rotate(90deg); }
.category-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-name {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.exercise-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  transition: opacity .2s var(--ease);
}
.exercise-row.is-off { opacity: 0.45; }
.exercise-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--ink-bg-3);
  color: var(--text);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.exercise-icon svg { width: 19px; height: 19px; }
.exercise-row.is-custom .exercise-icon { color: var(--rest); background: var(--rest-soft); }
.exercise-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exercise-name { font-size: 14.5px; font-weight: 500; }
.exercise-desc {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exercise-delete {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.exercise-delete:hover { color: var(--work); background: var(--work-soft); }
.exercise-delete svg { width: 15px; height: 15px; }
.training-load-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--rest);
  color: #0B211E;
}
.training-load-btn.is-active { background: var(--ink-bg-3); color: var(--text-muted); }
.exercise-row.is-training-active { box-shadow: inset 0 0 0 1.5px var(--rest); }
.trainings-empty {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 4px 2px 12px;
}
.exercise-edit {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.exercise-edit:hover { color: var(--rest); background: var(--rest-soft); }
.exercise-edit svg { width: 15px; height: 15px; }
.start-training-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.start-training-picker label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.start-training-picker select {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.add-exercise-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-m);
  border: 1.5px dashed var(--line);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.add-exercise-btn svg { width: 16px; height: 16px; }
.add-exercise-btn:hover { border-color: var(--rest); color: var(--rest); }

.add-exercise-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-field label span { text-transform: none; letter-spacing: 0; opacity: 0.7; }
.form-field input {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--ink-bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 14px;
}
.form-field input:focus { border-color: var(--rest); }
.form-actions { display: flex; gap: 10px; margin-top: 2px; }
.form-btn {
  flex: 1;
  padding: 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}
.form-btn.secondary { background: var(--ink-bg-3); color: var(--text-muted); }
.form-btn.primary { background: var(--rest); color: #0B211E; }
.form-btn.primary:disabled { opacity: 0.4; pointer-events: none; }

/* ==========================================================================
   START-SCREEN — zusätzliche Kopfzeilen-Actions (Statistik + Einstellungen)
   ========================================================================== */
.start-top-actions { display: flex; align-items: center; gap: 4px; }

/* ==========================================================================
   STATS-SCREEN
   ========================================================================== */
.stats-screen { padding: 20px 22px 30px; gap: 20px; }
.stats-top { display: flex; align-items: center; gap: 4px; }

.last-workout-card {
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius-l);
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 5px solid var(--work);
  box-shadow: 0 14px 30px rgba(0,0,0,0.3);
}
.lw-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(34,31,26,0.55);
}
.lw-relative {
  font-family: var(--f-display);
  font-size: 40px;
  line-height: 1.05;
}
.lw-meta {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: rgba(34,31,26,0.6);
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-tile {
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.tile-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.tile-icon svg { width: 16px; height: 16px; }
.tile-icon--work { background: var(--work-soft); color: var(--work); }
.tile-icon--rest { background: var(--rest-soft); color: var(--rest); }
.tile-num { font-family: var(--f-display); font-size: 26px; line-height: 1; }
.tile-lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-muted); line-height: 1.3; }

.block-title { font-size: 15px; font-weight: 500; }
.block-sub { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-muted); }

.activity-block { display: flex; flex-direction: column; gap: 12px; }
.activity-head { display: flex; align-items: baseline; justify-content: space-between; }
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 64px;
  padding: 10px 6px 0;
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
}
.activity-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}
.activity-bar {
  width: 100%;
  max-width: 16px;
  border-radius: 4px 4px 2px 2px;
  background: var(--ink-bg-3);
  min-height: 5px;
}
.activity-bar.is-active { background: var(--work); }
.activity-bar.is-today { box-shadow: 0 0 0 2px var(--rest); }
.activity-day {
  font-family: var(--f-mono);
  font-size: 8.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.history-block { display: flex; flex-direction: column; gap: 12px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink-bg-2);
  border-radius: var(--radius-s);
  padding: 12px 14px;
}
.history-date {
  font-family: var(--f-display);
  font-size: 20px;
  color: var(--text);
  width: 46px;
  line-height: 1;
  flex-shrink: 0;
}
.history-weekday {
  display: block;
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}
.history-mid { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.history-title-row { font-size: 13.5px; color: var(--text); }
.history-sub { font-family: var(--f-mono); font-size: 11px; color: var(--text-muted); }
.history-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--work-soft);
  color: var(--work);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.history-check svg { width: 13px; height: 13px; }

/* ==========================================================================
   SETTINGS-SCREEN
   ========================================================================== */
.settings-screen { padding: 20px 22px 30px; gap: 22px; }
.settings-top { display: flex; align-items: center; gap: 4px; }
.settings-title { font-family: var(--f-display); font-size: 24px; margin-left: 2px; }

.setting-card {
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.setting-head { display: flex; align-items: baseline; justify-content: space-between; }
.setting-name { font-size: 15px; font-weight: 500; }
.setting-value {
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--phase-color, var(--work));
}
.setting-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; margin-top: -8px; }

.stepper { display: flex; align-items: center; gap: 14px; }
.stepper-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink-bg-3);
  display: grid; place-items: center;
  font-family: var(--f-body);
  font-size: 18px;
  color: var(--text);
  transition: background .15s var(--ease);
}
.stepper-btn:active { background: #2A303C; }
.stepper-track {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--ink-bg-3);
  position: relative;
}
.stepper-track > i {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--work);
}
.setting-card[data-tone="rest"] .stepper-track > i { background: var(--rest); }
.setting-card[data-tone="rest"] .setting-value { color: var(--rest); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle {
  width: 50px; height: 30px;
  border-radius: 999px;
  background: var(--ink-bg-3);
  position: relative;
  flex-shrink: 0;
  transition: background .2s var(--ease);
}
.toggle > i {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.toggle.is-on { background: var(--work-soft); }
.toggle.is-on > i { transform: translateX(20px); background: var(--work); }

.reminder-time-row { display: flex; align-items: center; justify-content: space-between; }
.reminder-time-row input[type="time"] {
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--ink-bg-3);
  border: none;
  border-radius: var(--radius-s, 8px);
  padding: 8px 10px;
  color-scheme: dark;
}
.reminder-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 15, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}
.modal-box {
  width: 100%;
  max-width: 320px;
  background: var(--ink-bg-2);
  border-radius: var(--radius-m);
  padding: 24px 22px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.modal-title {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.modal-text {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-s);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.modal-btn:active { transform: scale(0.96); }
.modal-btn-cancel {
  background: var(--ink-bg-3);
  color: var(--text);
  border: 1px solid var(--line);
}
.modal-btn-danger {
  background: var(--work);
  color: var(--ink-bg);
  border: none;
}

.about-card { gap: 10px; }
.about-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
}
.about-version svg { width: 16px; height: 16px; color: var(--text-muted); }
.about-version #app-version { font-family: var(--f-mono); color: var(--text-muted); font-weight: 400; }
.about-author { font-size: 12.5px; color: var(--text-muted); }
.about-author a { color: var(--rest); text-decoration: underline; text-underline-offset: 2px; }

.settings-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
}
.settings-nav-row svg { width: 16px; height: 16px; color: var(--text-muted); }
.sync-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

.changelog-body { overflow-y: auto; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.changelog-body h2 { font-family: var(--f-display); font-size: 20px; margin: 18px 0 8px; }
.changelog-body h2:first-child { margin-top: 0; }
.changelog-body h3 { font-family: var(--f-mono); font-size: 13px; color: var(--rest); text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 4px; }
.changelog-body h4 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 4px; }
.changelog-version { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.changelog-version-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--rest);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.changelog-version-toggle .category-chevron { color: var(--text-muted); }
.changelog-version.is-open .category-chevron { transform: rotate(90deg); }
.changelog-version-body { padding-top: 6px; }
.changelog-body p { margin: 6px 0; color: var(--text-muted); }
.changelog-body ul { padding-left: 18px; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.changelog-body li { color: var(--text-muted); }
.changelog-body code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: var(--ink-bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text);
}
.changelog-body a { color: var(--rest); }

.btn-logout {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--f-body);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.btn-logout:active { color: var(--work); border-color: var(--work); }

.settings-foot {
  margin-top: auto;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flip-card, .btn-start, .ctrl-btn, .toggle, .toggle > i, .workout-screen,
  .progress-dashes .dash > i, .phase-pill, .flip-unit { transition: none !important; }
}
