/* Gym – Glas-Look: Farbverlauf-Hintergrund, milchige Karten mit großen Radien, schwarze Pill-Buttons.
   Hell: Stahlblau → Nebelgrau. Dunkel: Schwarz mit blauem Glow. Farben nur über Variablen. */

:root {
  color-scheme: light dark;
  --bg: #eef1f5;
  --grad:
    radial-gradient(90% 45% at 85% 0%, rgba(255, 255, 255, 0.28), transparent 60%),
    linear-gradient(180deg, #56809e 0px, #7a9db6 150px, #a9bfcf 320px, #d6dfe7 480px, #eef1f5 640px);
  --grad-size: 100% 700px;
  --on-hero: #ffffff;
  --on-hero-2: rgba(255, 255, 255, 0.8);

  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 12px 40px rgba(28, 48, 76, 0.12), 0 1px 3px rgba(28, 48, 76, 0.06);
  --blur: saturate(170%) blur(22px);
  --card: var(--glass-strong);
  --sheet-bg: rgba(244, 246, 249, 0.94);
  --bar-bg: rgba(255, 255, 255, 0.72);
  --head-bg: rgba(74, 114, 145, 0.9);
  --seg-on: #ffffff;

  --text: #121419;
  --text-2: #555c67;
  --text-3: #8a919c;
  --fill: rgba(22, 34, 54, 0.06);
  --fill-soft: rgba(22, 34, 54, 0.035);
  --fill-2: rgba(22, 34, 54, 0.12);
  --sep: rgba(22, 34, 54, 0.08);
  --sep-strong: rgba(22, 34, 54, 0.2);

  --ink: #0d0e12;
  --on-ink: #ffffff;
  --accent: #2c5fe6;
  --accent-soft: rgba(44, 95, 230, 0.11);
  --good: #1a7f37;
  --good-soft: rgba(26, 127, 55, 0.12);
  --warn: #9a5500;
  --warn-soft: rgba(230, 140, 0, 0.15);
  --bad: #c9372c;
  --bad-soft: rgba(201, 55, 44, 0.11);
  --go: #1f8a3e;
  --tip-bg: #121419;
  --tip-text: #ffffff;

  --tile-a: linear-gradient(145deg, #f6cda6 0%, #f3e4c9 100%);
  --tile-b: linear-gradient(145deg, #c3dcae 0%, #e7efd9 100%);
  --tile-c: linear-gradient(145deg, #b9cdee 0%, #e3eaf7 100%);

  --r-card: 26px;
  --r-tray: 32px;
  --tabbar-h: 62px;
  --side-w: 240px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #04050a;
    --grad:
      radial-gradient(110% 50% at 50% 14%, rgba(56, 104, 255, 0.55) 0%, rgba(32, 64, 190, 0.22) 38%, transparent 70%),
      linear-gradient(180deg, #010207 0%, #050a1d 42%, #04050a 100%);
    --grad-size: 100% 900px;
    --on-hero: #ffffff;
    --on-hero-2: #7fa3ff;

    --glass: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
    --sheet-bg: rgba(20, 22, 30, 0.94);
    --bar-bg: rgba(18, 20, 28, 0.72);
    --head-bg: rgba(6, 9, 24, 0.82);
    --seg-on: rgba(255, 255, 255, 0.18);

    --text: #f3f4f7;
    --text-2: #a5abb8;
    --text-3: #6f7584;
    --fill: rgba(255, 255, 255, 0.07);
    --fill-soft: rgba(255, 255, 255, 0.04);
    --fill-2: rgba(255, 255, 255, 0.15);
    --sep: rgba(255, 255, 255, 0.08);
    --sep-strong: rgba(255, 255, 255, 0.22);

    --ink: #f3f4f7;
    --on-ink: #0d0e12;
    --accent: #6190ff;
    --accent-soft: rgba(97, 144, 255, 0.18);
    --good: #32d74b;
    --good-soft: rgba(50, 215, 75, 0.15);
    --warn: #ffb340;
    --warn-soft: rgba(255, 179, 64, 0.15);
    --bad: #ff6961;
    --bad-soft: rgba(255, 105, 97, 0.15);
    --go: #248a3d;
    --tip-bg: #2a2d38;

    --tile-a: linear-gradient(145deg, rgba(246, 150, 80, 0.32) 0%, rgba(246, 200, 140, 0.08) 100%);
    --tile-b: linear-gradient(145deg, rgba(120, 200, 100, 0.28) 0%, rgba(160, 220, 140, 0.06) 100%);
    --tile-c: linear-gradient(145deg, rgba(90, 140, 255, 0.32) 0%, rgba(120, 160, 255, 0.06) 100%);
  }
}

/* ------------------------------------------------------------ Basis */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--grad);
  background-size: var(--grad-size);
  background-repeat: no-repeat;
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html.no-bounce, html.no-bounce body { overscroll-behavior: none; }
html.has-sheet body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg.ic { flex: 0 0 auto; display: block; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.accent { color: var(--accent); }
.danger { color: var(--bad); }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.pad { padding: 14px 18px; }
.pad-s { padding: 4px 4px 8px; }
.gap { height: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Glas-Fläche – Grundbaustein aller Karten */
.glass, .card, .tray, .tile {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ------------------------------------------------------------ Shell */

.sidebar { display: none; }
.main { min-width: 0; }
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 40px);
  animation: fadeIn 0.2s ease-out;
}

/* Schwebende Tab-Bar als Glas-Pille */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 8px);
  transform: translateX(-50%);
  z-index: 30;
  width: min(420px, calc(100% - 28px));
  height: var(--tabbar-h);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--bar-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 40px rgba(20, 30, 50, 0.18);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 10.5px; font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s;
}
.tabbar a.on { background: var(--ink); color: var(--on-ink); }

/* ------------------------------------------------------------ Kopfbereiche (auf dem Verlauf) */

.page-head { margin: 8px 2px 18px; color: var(--on-hero); }
.page-head h1 { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; margin: 2px 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-row h1 { flex: 1; min-width: 0; }
.page-head .head-row h1 { font-size: 28px; }
.page-head .meta, .page-head .subtitle { color: var(--on-hero-2); }
.page-head .icon-btn, .page-head .back { color: var(--on-hero); }
.subtitle { font-size: 20px; font-weight: 500; }
.meta { font-size: 15px; margin-top: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.section-title { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 26px 6px 10px; }
.h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin: 2px 0 4px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--accent); font-size: 17px; font-weight: 500; }

/* Heute: Titel + Datum + Ring */
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 4px 22px; color: var(--on-hero); }
.hero-head h1 { font-size: 36px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.hero-date { font-size: 28px; line-height: 1.15; font-weight: 400; letter-spacing: -0.02em; color: var(--on-hero-2); margin-top: 2px; }

.ring { position: relative; flex: 0 0 84px; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ring svg { display: block; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 4; }
.ring-fill { fill: none; stroke: #ffffff; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; line-height: 1.1; }
.ring-label strong { font-size: 19px; font-weight: 600; }
.ring-label span { font-size: 11px; opacity: 0.8; }

/* Gestapelte Fokus-Karte (Tray mit Karte darin) */
.tray { border-radius: var(--r-tray); padding: 6px; margin-bottom: 14px; background: var(--glass); }
.tray-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 15px; }
.tray-row strong { font-weight: 600; }
.tray-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); color: var(--text-2); }
.tray-foot { gap: 14px; padding-top: 14px; }
.tray-foot .grow { font-weight: 500; }
.hero {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  padding: 20px 20px 18px;
  box-shadow: 0 10px 30px rgba(28, 48, 76, 0.1);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; min-height: 40px; }
.hero-title { font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -0.025em; margin: 18px 0 8px; }
.hero-text { font-size: 15px; color: var(--text-2); line-height: 1.45; }
.hero-list { margin: 16px 0 18px; }
.hero-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 0; border-top: 1px solid var(--sep); color: var(--text); font-size: 15px; }
.hero-item .muted, .hero-item .accent { font-size: 14px; white-space: nowrap; }
.hero-item .accent { font-weight: 600; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.hero-cta { margin-top: 4px; }
.cta-sub { font-weight: 500; opacity: 0.55; margin-left: 6px; }
.round-btn {
  flex: 0 0 40px; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--fill); color: var(--text);
}
.badge-code { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 15px; }

/* Wochenleiste */
.week-card { border-radius: var(--r-tray); padding: 16px 12px 12px; margin-bottom: 14px; background: var(--glass); }
.week-head { display: flex; justify-content: space-between; padding: 0 8px 12px; font-size: 15px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 0 10px; border-radius: 999px; color: var(--text);
}
.day.today { background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 8px 20px rgba(28, 48, 76, 0.12); }
.wd { font-size: 12px; color: var(--text-3); font-weight: 500; }
.dn { font-size: 18px; font-weight: 500; }
.dot { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 700; }
.dot.on { background: var(--ink); color: var(--on-ink); }

/* ------------------------------------------------------------ Karten & Listen */

.card { border-radius: var(--r-card); padding: 16px 18px; margin-bottom: 12px; }
.card-accent { box-shadow: inset 0 0 0 1.5px var(--accent), var(--glass-shadow); }
.card-inset { background: var(--glass-strong); border-radius: 18px; }
.list, .card.list { padding: 0; overflow: hidden; }
.list > * { position: relative; }
.list > * + *::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; border-top: 1px solid var(--sep); }
.li {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 18px;
  border: 0; background: none; color: var(--text); text-align: left; text-decoration: none;
  transition: background 0.15s;
}
button.li:active, a.li:active, label.li:active { background: var(--fill-soft); }
.li.on { color: var(--accent); }
.li > .ic:first-child { color: var(--text-2); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 500; }
.li-sub { font-size: 14px; color: var(--text-2); }
.li-sub.accent { color: var(--accent); font-weight: 600; }
.li-note { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-more { justify-content: center; color: var(--text-2); font-size: 15px; font-weight: 500; }
.li.is-busy { opacity: 0.5; }
.li-static { display: flex; align-items: center; gap: 12px; background: var(--glass-strong); border-radius: 18px; padding: 12px 12px 12px 18px; }
.chev { color: var(--text-3); }
.day-code {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 15px;
}
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-btns .btn { flex: 1 1 auto; }
.hero-actions .row-btns { margin-top: 0; }

/* ------------------------------------------------------------ Buttons & Eingaben */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font-weight: 600; font-size: 17px; line-height: 1.1; text-align: center; text-decoration: none;
  transition: transform 0.15s var(--ease), opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); opacity: 0.88; }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16); }
.btn-tinted, .btn-glass { background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-border); box-shadow: 0 4px 14px rgba(28, 48, 76, 0.08); }
.btn-plain { background: transparent; color: var(--text-2); }
.btn-plain.danger, .btn-glass.danger { color: var(--bad); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--text);
}
.icon-btn:disabled { opacity: 0.35; }
.icon-btn.danger { color: var(--bad); }
.link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; border: 0; background: none; color: var(--accent); font-size: inherit; font-weight: 500; }
.link.small { font-size: 14px; }
.link.muted { color: var(--text-2); }

.in {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font-size: 17px; /* ≥ 16px: kein Auto-Zoom auf iOS */
  color: var(--text); background: var(--fill);
  border: 1.5px solid transparent; border-radius: 14px;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s, background 0.15s;
}
.in:focus { border-color: var(--ink); background: var(--glass-strong); }
.in::placeholder { color: var(--text-3); opacity: 1; }
select.in {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a919c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.textarea { width: 100%; min-height: 110px; padding: 12px 14px; font-size: 17px; color: var(--text); background: var(--fill); border: 1.5px solid transparent; border-radius: 16px; resize: vertical; outline: none; }
.textarea:focus { border-color: var(--ink); }
.textarea.mono { font: 13px/1.45 ui-monospace, "SF Mono", Menlo, monospace; min-height: 280px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.form-row { display: flex; gap: 10px; }
.form-row .field { flex: 1; min-width: 0; }
.field-code { flex: 0 0 84px !important; }
.day-head { margin-top: 6px; }
.page-head .field { color: var(--on-hero-2); }
.page-head .in { background: var(--glass-strong); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 38px; min-width: 44px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); font-size: 15px; font-weight: 500;
}
.chip.on { background: var(--ink); color: var(--on-ink); }

.seg { display: flex; padding: 4px; margin: 0 0 14px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.seg button { flex: 1; min-height: 38px; padding: 0 6px; border: 0; border-radius: 999px; background: none; color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 0.2s; }
.seg button.on { background: var(--seg-on); font-weight: 600; box-shadow: 0 4px 12px rgba(28, 48, 76, 0.12); }
.seg-page { margin-bottom: 18px; }
.seg-gap { margin: 12px 0; }

.toggle { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 18px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: 0 0 51px; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2); position: relative; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.set-field { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 56px; }
.set-field-text { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 18px; }
.set-input { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.set-input .in { width: 84px; text-align: right; }

/* ------------------------------------------------------------ Status, Hinweise, Notizen */

.pill { display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-up { color: var(--good); background: var(--good-soft); }
.st-stall { color: var(--warn); background: var(--warn-soft); }
.st-down { color: var(--bad); background: var(--bad-soft); }
.st-new { color: var(--text-3); background: var(--fill); }
.pill-space { width: 28px; }

.hint { align-items: flex-start; }
.hint-ic { flex: 0 0 28px; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; }
.hint-up .hint-ic { color: var(--good); background: var(--good-soft); }
.hint-warn .hint-ic { color: var(--warn); background: var(--warn-soft); }
.hint-bad .hint-ic { color: var(--bad); background: var(--bad-soft); }
.hint-info .hint-ic { color: var(--accent); background: var(--accent-soft); }

.note { padding: 12px 14px; border-radius: 16px; font-size: 15px; margin: 4px 0 12px; }
.note-bad { background: var(--bad-soft); color: var(--bad); }
.note-warn { background: var(--warn-soft); color: var(--text); }
.note-info { background: var(--accent-soft); color: var(--text); }
.banner { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.banner-warn { box-shadow: inset 0 0 0 1.5px var(--warn), var(--glass-shadow); }
.banner-info { box-shadow: inset 0 0 0 1.5px var(--accent), var(--glass-shadow); }
.banner .row-btns { margin-top: 0; }
.tips { margin: 8px 0 2px; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.tips li { margin: 4px 0; }
.pr-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--on-ink); background: var(--ink); vertical-align: 1px; }

.sync { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--glass-strong); color: var(--text-2); font-size: 13px; font-weight: 500; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.sync-warn .sync-dot { background: var(--warn); }
.sync-bad { color: var(--bad); }
.sync-bad .sync-dot { background: var(--bad); }
.sync-busy .sync-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.wo-head .sync { background: none; padding: 0 10px; color: var(--on-hero-2); }
.sync-float { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 14px; z-index: 29; }

.empty { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { font-size: 20px; font-weight: 600; }
.empty p { color: var(--text-2); }

/* ------------------------------------------------------------ Skeleton, Toast */

.skel {
  height: 14px; margin: 10px 0; border-radius: 7px;
  background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 37%, var(--fill) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skel-title { height: 30px; width: 70%; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); z-index: 80;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 11px 18px;
  border-radius: 999px; background: var(--tip-bg); color: var(--tip-text);
  font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  animation: toastIn 0.22s var(--ease);
}
.toast-bad { background: var(--bad); }

/* ------------------------------------------------------------ Bottom Sheets */

.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 22, 0.32); animation: fadeIn 0.2s ease-out; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
  display: flex; flex-direction: column;
  background: var(--sheet-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-radius: 30px 30px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  animation: slideUp 0.26s var(--ease);
  transition: transform 0.2s var(--ease);
}
.is-out .sheet { transform: translateY(105%); transition: transform 0.2s ease-in; }
.is-out .sheet-backdrop { opacity: 0; }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 20px 10px 8px 22px; touch-action: none; }
.sheet-grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--fill-2); }
.sheet-head h3 { flex: 1; min-width: 0; font-size: 19px; font-weight: 600; }
.sheet-head .icon-btn { background: var(--fill); width: 36px; height: 36px; }
.sheet-body { overflow-y: auto; padding: 6px 18px 22px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-text { font-size: 15px; }
.sheet .list { background: var(--glass-strong); border-radius: 18px; }
.picker { max-height: 50vh; overflow-y: auto; }
.in-search { background: var(--glass-strong); }

/* ------------------------------------------------------------ Workout */

.wo { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 60px) 0 calc(env(safe-area-inset-bottom) + 210px); }
.wo-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: var(--head-bg);
  color: var(--on-hero);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.wo-head .muted { color: var(--on-hero-2); }
.wo-head .icon-btn { color: var(--on-hero); }
.wo-head .progress { background: rgba(255, 255, 255, 0.22); }
.wo-head .progress > div { background: #fff; }
.wo-head-row { display: flex; align-items: center; gap: 2px; height: 56px; max-width: 720px; margin: 0 auto; padding: 0 16px 0 4px; }
.wo-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
.wo-stats { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-size: 16px; font-weight: 600; }
.wo-stats .muted { font-size: 13px; font-weight: 500; }
.progress { height: 3px; background: var(--fill); }
.progress > div { height: 100%; background: var(--accent); transform-origin: left; transition: transform 0.3s var(--ease); }
.wo-body { max-width: 720px; margin: 0 auto; padding: 14px 14px; }
.wo-tail { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }

.ex-card { padding: 18px 10px 6px; scroll-margin-top: 80px; }
.ex-card.is-complete .ex-head h3 { color: var(--text-2); }
.ex-head { display: flex; align-items: flex-start; gap: 8px; padding: 0 8px; }
.ex-name { flex: 1; min-width: 0; }
.ex-name h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.ex-name p { margin-top: 3px; }
.sug { margin: 12px 4px 12px; padding: 12px 14px; border-radius: 18px; background: var(--fill); }
.sug-head { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sug-why { font-size: 14px; color: var(--text-2); margin-top: 3px; }
.sug-increase { background: var(--accent-soft); }
.sug-increase .sug-head, .sug-up { color: var(--accent); }
.sug-deload { background: var(--warn-soft); }
.sug-card .sug-head { margin-top: 6px; font-size: 18px; }

.set-grid-head, .set-line { display: grid; grid-template-columns: 30px minmax(0, 1fr) 62px 52px; gap: 6px; align-items: center; }
.set-grid-head { padding: 0 4px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.set-grid-head .c-w, .set-grid-head .c-r { text-align: center; }
.set-row { position: relative; padding: 3px 4px; border-radius: 20px; scroll-margin-bottom: 200px; scroll-margin-top: 90px; transition: background 0.2s; }
.set-row.is-active { background: var(--fill); }
.set-row.is-locked { opacity: 0.45; }
.set-row.is-locked .in { pointer-events: none; }
.set-no { height: 48px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 16px; font-weight: 600; }
.is-done .set-no { color: var(--text); }
.w-field { display: flex; align-items: center; gap: 4px; min-width: 0; }
.in-w, .in-r { height: 48px; padding: 6px 2px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.in-w { flex: 1; min-width: 0; }
.is-active .in { background: var(--glass-strong); }
.is-done:not(.is-active) .in { background: transparent; }
.step-btn {
  flex: 0 0 44px; width: 44px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: var(--glass-strong); color: var(--text);
  box-shadow: 0 2px 8px rgba(28, 48, 76, 0.08);
  -webkit-touch-callout: none;
}
.step-btn:active { background: var(--ink); color: var(--on-ink); }
.check {
  width: 52px; height: 48px;
  display: grid; place-items: center;
  border: 1.5px solid var(--sep-strong); border-radius: 999px;
  background: none; color: var(--text-3);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.check:active { transform: scale(0.94); }
.is-active .check { border-color: var(--ink); color: var(--ink); }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.set-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0 4px 36px; }
.rpe-chips { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rpe-chips::-webkit-scrollbar { display: none; }
.rpe-chips .chip { flex: 0 0 auto; }
.rpe-label { flex: 0 0 auto; min-height: 38px; padding: 0 4px 0 0; border: 0; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.rpe-tag { position: absolute; left: 4px; bottom: 1px; width: 30px; text-align: center; font-size: 10px; color: var(--text-3); pointer-events: none; }
.ex-foot { display: flex; gap: 16px; padding: 2px 8px; }
.ex-foot .link { color: var(--text-2); }

/* Aufwärmen */
.warm { display: flex; flex-direction: column; gap: 12px; padding: 18px; margin-bottom: 12px; border-radius: var(--r-card); }
.warm-head { display: flex; align-items: flex-start; gap: 10px; }
.warm-head h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.warm-timer { text-align: center; padding: 4px 0; }
.warm-clock { font-size: 46px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.warm.is-over .warm-clock { color: var(--go); animation: pulse 1.1s ease-in-out infinite; }
.warm .row-btns { margin-top: 0; }
.warm-done { flex-direction: row; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; text-align: left; font-size: 16px; color: var(--text); }
.warm-check { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--on-ink); }

/* Schwebende Leiste unten: Pausen-Timer + Beenden */
.wo-dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 8px);
  z-index: 30;
  width: min(688px, calc(100% - 20px));
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  border-radius: 30px;
  background: var(--bar-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 40px rgba(20, 30, 50, 0.2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  animation: dockIn 0.24s var(--ease);
}
.rest { display: flex; align-items: center; gap: 8px; }
.rest-btn { flex: 0 0 auto; min-width: 58px; height: 52px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rest-time { flex: 1; text-align: center; }
.rest-time strong { display: block; font-size: 30px; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.rest-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin-bottom: 2px; }
.rest-bar { height: 4px; margin: 6px 8px 0; border-radius: 2px; background: var(--fill); overflow: hidden; }
.rest-bar > div { height: 100%; background: var(--accent); transform-origin: left; transition: transform 0.25s linear; }
.rest-over {
  width: 100%; min-height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 999px;
  background: var(--go); color: #fff;
  animation: pulse 1.1s ease-in-out infinite;
}
.rest-over strong { font-size: 19px; }
.rest-over span { font-size: 13px; opacity: 0.9; }

/* ------------------------------------------------------------ Verlauf */

.ex-log { padding: 16px 14px 8px; }
.ex-log-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 4px; }
.ex-log-head h3 { font-size: 17px; font-weight: 600; color: var(--text); }
.log-sets { display: grid; }
.log-set { display: grid; grid-template-columns: 22px 1fr 1fr 1.1fr; gap: 8px; align-items: center; min-height: 42px; padding: 6px 4px; border: 0; border-radius: 12px; background: none; text-align: left; }
.log-set:active { background: var(--fill-soft); }
.done-card { display: flex; flex-direction: column; gap: 12px; }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.week-nav .icon-btn { background: var(--glass-strong); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 22px; min-width: 0; }
.tile:nth-child(3n + 1) { background: var(--tile-a); }
.tile:nth-child(3n + 2) { background: var(--tile-b); }
.tile:nth-child(3n + 3) { background: var(--tile-c); }
.tile-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.tile-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--text-2); }

.vol { padding: 14px 18px; }
.vol-legend { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vol-row { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr) 34px 16px; gap: 8px; align-items: center; min-height: 32px; font-size: 14px; }
.vol-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vol-track { position: relative; height: 12px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.vol-band { position: absolute; top: 0; bottom: 0; background: var(--good-soft); }
.vol-fill { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 0 5px 5px 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #9ec0ff)); }
.vol-num { text-align: right; font-weight: 600; }
.vol-flag { text-align: center; font-weight: 700; }
.vol-ok .vol-flag { color: var(--good); }
.vol-low .vol-flag { color: var(--warn); }
.vol-high .vol-flag { color: var(--bad); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.filters .seg { flex: 1 1 260px; margin: 0; }
.in-select { flex: 1 1 200px; width: auto; background-color: var(--glass-strong); }
.table-wrap { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.log { width: 100%; border-collapse: collapse; font-size: 15px; }
table.log th, table.log td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--sep); }
table.log th { position: sticky; top: 0; background: var(--glass-strong); }
table.log th button { padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; }
table.log .num { text-align: right; }
table.log tbody tr { cursor: pointer; }
table.log tbody tr:hover { background: var(--fill-soft); }

/* ------------------------------------------------------------ Charts */

.chart-card { padding: 14px 10px 10px; }
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--sep); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area-stop-a { stop-color: var(--accent); stop-opacity: 0.28; }
.chart .area-stop-b { stop-color: var(--accent); stop-opacity: 0; }
.chart .dot { fill: var(--accent); stroke: var(--glass-strong); stroke-width: 2; }
.chart .dot-hover { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; }
.chart .val { font-size: 12px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; }
.chart .bar { fill: var(--accent); transition: opacity 0.15s; }
.chart .bar-hover { opacity: 0.7; }
.chart .bar-warn { fill: var(--warn); }
.chart-empty { display: grid; place-items: center; color: var(--text-3); font-size: 15px; }
.tip {
  position: absolute; top: -4px; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 12px; border-radius: 14px;
  background: var(--tip-bg); color: var(--tip-text);
  font-size: 13px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  z-index: 5;
}
.tip .muted { color: rgba(255, 255, 255, 0.7); }
.tip .pr-badge { background: #fff; color: #0d0e12; }
.spark { flex: 0 0 auto; }
.spark path { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }

/* ------------------------------------------------------------ Login */

.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: center; padding: 30px 24px; border-radius: var(--r-tray); }
.login-box h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.login-icon { margin: 0 auto; border-radius: 16px; box-shadow: 0 8px 24px rgba(20, 40, 90, 0.25); }

/* ------------------------------------------------------------ Desktop ab 900 px */

@media (min-width: 900px) {
  body { background-size: 100% 820px; }
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
  .tabbar, .mobile-only { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 3px;
    position: sticky; top: 14px; height: calc(100vh - 28px);
    margin: 14px 0 14px 14px;
    padding: 20px 12px;
    border-radius: 28px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-size: 20px; font-weight: 600; }
  .brand img { border-radius: 8px; }
  .side-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 14px; border-radius: 999px; color: var(--text); font-size: 15px; font-weight: 500; }
  .side-link .ic { color: var(--text-2); }
  .side-link:hover { background: var(--fill); }
  .side-link.on { background: var(--ink); color: var(--on-ink); }
  .side-link.on .ic { color: var(--on-ink); }
  .side-sep { height: 1px; margin: 12px 12px; background: var(--sep); }
  .side-foot { margin-top: auto; padding: 0 6px; }
  .page { max-width: 880px; padding: 40px 40px 56px; }
  .page-wide { max-width: 1120px; }
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: 560px; max-height: 84vh; transform: translate(-50%, -50%); border-radius: 30px; animation: popIn 0.2s var(--ease); padding-bottom: 0; }
  .is-out .sheet { transform: translate(-50%, -46%); opacity: 0; transition: transform 0.18s, opacity 0.18s; }
  .sheet-grab { display: none; }
  .tiles { gap: 14px; }
  .tile-value { font-size: 28px; }
  .chart-card { padding: 18px 18px 12px; }
  .vol-row { grid-template-columns: 170px minmax(0, 1fr) 40px 18px; }
  .page-today { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 20px; max-width: 1120px; align-items: start; }
  .page-today > .hero-head, .page-today > .banner { grid-column: 1 / -1; }
  .page-today > .tray { grid-column: 1; grid-row: span 3; }
}

/* ------------------------------------------------------------ Animation */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
