/* style.css — "Liquid Glass": milchige Glasflächen über einem farbigen
   Hintergrund, feine Lichtkanten, weiche Schatten. Dunkel, große Tasten,
   einhändig bedienbar. Farben: Blau, Violett, Türkis. */

:root {
  /* --- Grundfarben --- */
  --ink: #05070d;              /* tiefster Hintergrund */
  --text: #f4f6fb;
  --muted: rgba(244,246,251,.62);
  --muted-2: rgba(244,246,251,.40);

  /* --- Akzente: Blau, Violett, Türkis --- */
  --violet: #8b5cf6;   --violet-rgb: 139,92,246;
  --blue:   #3b82f6;   --blue-rgb:   59,130,246;
  --teal:   #2dd4bf;   --teal-rgb:   45,212,191;
  --indigo: #6366f1;   --indigo-rgb: 99,102,241;
  --sky:    #38bdf8;   --sky-rgb:    56,189,248;
  --slate:  #94a3b8;   --slate-rgb:  148,163,184;

  --ok: var(--teal);
  --danger: #fb7185;
  --warn: #fbbf24;
  --gold: #fcd34d;

  /* --- Glas --- */
  /* Glas = heller Schimmer OBEN + dunkle Tönung DAHINTER.
     Die dunkle Schicht sorgt dafür, dass Text auch über den hellen
     Stellen des Hintergrunds gut lesbar bleibt. */
  --glass-bg:     linear-gradient(165deg, rgba(255,255,255,.15), rgba(255,255,255,.06) 55%, rgba(255,255,255,.03)),
                  rgba(10,14,26,.42);
  --glass-bg-2:   linear-gradient(165deg, rgba(255,255,255,.1), rgba(255,255,255,.04)),
                  rgba(9,12,24,.52);
  --glass-line:   rgba(255,255,255,.16);
  --glass-line-2: rgba(255,255,255,.10);
  --glass-top:    inset 0 1px 0 rgba(255,255,255,.34);   /* Lichtkante oben */
  --glass-bottom: inset 0 -1px 0 rgba(255,255,255,.055);
  --glass-drop:   0 12px 34px rgba(2,4,12,.46);
  --blur: blur(26px) saturate(185%);

  --radius: 20px;
  --tap: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
}

/* ---------- Grundlagen ---------- */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  /* durchsichtig lassen! Der Farbnebel unten liegt hinter dem Body und
     würde von einem eigenen Hintergrund zugedeckt. */
  background: transparent;
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  -webkit-user-select: none; user-select: none;
}

/* Der farbige Nebel im Hintergrund. Erst dadurch sieht Glas wie Glas aus –
   die Flächen lassen ja etwas durchscheinen. Liegt fest, scrollt nicht mit. */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: -2;
  background:
    radial-gradient(58% 40% at 12% 4%,   rgba(var(--indigo-rgb), .58), transparent 72%),
    radial-gradient(48% 32% at 92% 14%,  rgba(var(--teal-rgb),   .42), transparent 72%),
    radial-gradient(70% 45% at 82% 76%,  rgba(var(--violet-rgb), .52), transparent 74%),
    radial-gradient(55% 38% at 4% 92%,   rgba(var(--sky-rgb),    .40), transparent 72%),
    radial-gradient(75% 55% at 50% 48%,  rgba(6,9,20,.62), transparent 82%),
    var(--ink);
  pointer-events: none;
}
/* ganz feines Rauschen gegen Streifen in den Verläufen */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

input, textarea, select { -webkit-user-select: text; user-select: text; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 10px; }

#app {
  padding: calc(var(--safe-t) + 10px) 14px calc(var(--nav-h) + var(--safe-b) + 28px);
  max-width: 680px;
  margin: 0 auto;
}
body.no-nav #app { padding-bottom: calc(var(--safe-b) + 28px); }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

svg.ic { display: block; flex: 0 0 auto; }

/* ---------- Glas-Bausteine ---------- */

/* Echtes Glas: verwischt, was dahinter liegt. Für Leisten, Dialoge,
   Kacheln – also für wenige, große Flächen. */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-top), var(--glass-bottom), var(--glass-drop);
}

/* Leichtes Glas: nur durchscheinend, ohne Weichzeichner. Für Listen und
   Übungskarten, von denen es viele gibt – bleibt dadurch flüssig. */
.glass-soft {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 6px 18px rgba(2,4,12,.3);
}

/* ---------- Farbhilfen ---------- */

.c-violet { --c: var(--violet); --c-rgb: var(--violet-rgb); }
.c-blue   { --c: var(--blue);   --c-rgb: var(--blue-rgb); }
.c-teal   { --c: var(--teal);   --c-rgb: var(--teal-rgb); }
.c-indigo { --c: var(--indigo); --c-rgb: var(--indigo-rgb); }
.c-sky    { --c: var(--sky);    --c-rgb: var(--sky-rgb); }
.c-slate  { --c: var(--slate);  --c-rgb: var(--slate-rgb); }
/* Farben aus älteren Daten – damit alte Trainings nicht farblos werden */
.c-purple { --c: var(--violet); --c-rgb: var(--violet-rgb); }
.c-cyan   { --c: var(--sky);    --c-rgb: var(--sky-rgb); }
.c-green  { --c: var(--teal);   --c-rgb: var(--teal-rgb); }
.c-orange, .c-red, .c-pink { --c: var(--indigo); --c-rgb: var(--indigo-rgb); }
.c-gray   { --c: var(--slate); --c-rgb: var(--slate-rgb); }

.dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: var(--c, var(--slate));
  box-shadow: 0 0 0 3px rgba(var(--c-rgb, var(--slate-rgb)), .18), 0 0 10px rgba(var(--c-rgb, var(--slate-rgb)), .5);
}

/* ---------- Kopfzeile ---------- */

.appbar {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0 18px;
  min-height: 46px;
}
.appbar h1 { font-size: 28px; }
.appbar .sub { color: var(--muted); font-size: 14px; margin-top: 1px; }

.iconbtn {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: var(--text);
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top);
  cursor: pointer; padding: 0;
  transition: transform .07s ease, background .15s;
}
.iconbtn:active { transform: scale(.93); background: rgba(255,255,255,.14); }
.iconbtn.ghost { background: transparent; border-color: transparent; box-shadow: none; }

/* ---------- Knöpfe ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 17px;
  color: var(--text);
  font-size: 17px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-top), var(--glass-bottom), 0 6px 18px rgba(2,4,12,.32);
  transition: transform .07s ease, filter .15s ease;
  overflow: hidden;
}
/* Hinweis: Knöpfe bekommen bewusst KEINEN Weichzeichner.
   Auf einem Bildschirm sind viele davon – der Verlauf plus die Lichtkante
   sehen genauso nach Glas aus, bleiben aber beim Scrollen flüssig.
   Echtes Milchglas gibt es nur für die wenigen großen Flächen:
   Leiste unten, Kopfzeile, Kacheln, Pausen-Balken, Dialoge. */
/* schmaler Lichtstreifen oben – der "Glanz" auf dem Glas */
.btn::after {
  content: ''; position: absolute; left: 12%; right: 12%; top: 0; height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.26), transparent);
  pointer-events: none;
}
.btn:active { transform: scale(.97); filter: brightness(1.12); }
.btn.block { display: flex; width: 100%; }

.btn.primary {
  background:
    linear-gradient(165deg, rgba(255,255,255,.26), rgba(255,255,255,.06) 55%, rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(var(--indigo-rgb),.95), rgba(var(--violet-rgb),.9));
  border-color: rgba(255,255,255,.26);
  box-shadow: var(--glass-top), 0 8px 24px rgba(var(--violet-rgb), .42);
}
.btn.ok {
  background:
    linear-gradient(165deg, rgba(255,255,255,.3), rgba(255,255,255,.06) 55%, rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(var(--teal-rgb),.95), rgba(var(--sky-rgb),.85));
  color: #04231f;
  border-color: rgba(255,255,255,.34);
  box-shadow: var(--glass-top), 0 8px 24px rgba(var(--teal-rgb), .38);
}
.btn.danger { color: var(--danger); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.14); }
.btn.outline { background: rgba(255,255,255,.04); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.quiet::after { display: none; }
.btn.small { min-height: 42px; padding: 0 14px; font-size: 15px; border-radius: 13px; gap: 6px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Karten ---------- */

.card {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 8px 22px rgba(2,4,12,.32);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card.tight { padding: 11px 13px; }

/* ---------- Startseite: Trainings-Kacheln ---------- */

.tiles { display: grid; grid-template-columns: 1fr; gap: 13px; }
.tiles.two { grid-template-columns: 1fr 1fr; }

.tile {
  position: relative; overflow: hidden;
  border-radius: 26px;
  padding: 20px;
  min-height: 118px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  gap: 3px;
  color: #fff; font-family: inherit;
  text-align: left; cursor: pointer;
  background:
    linear-gradient(160deg, rgba(255,255,255,.3), rgba(255,255,255,.08) 46%, rgba(255,255,255,.02)),
    linear-gradient(145deg, rgba(var(--c-rgb), .92), rgba(var(--c-rgb), .55));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -14px 28px rgba(255,255,255,.07),
    0 14px 34px rgba(var(--c-rgb), .32);
  transition: transform .08s ease, filter .15s;
}
.tile:active { transform: scale(.975); filter: brightness(1.1); }
/* der helle Bogen oben links – wie Licht auf gewölbtem Glas */
.tile::before {
  content: ''; position: absolute; inset: -40% 45% 55% -25%;
  background: radial-gradient(closest-side, rgba(255,255,255,.4), transparent);
  pointer-events: none;
}
.tile .tile-name { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; position: relative; }
.tile .tile-sub { font-size: 13.5px; opacity: .88; font-weight: 500; position: relative; }
.tile .tile-last {
  position: absolute; top: 15px; right: 15px; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tile .tile-ic { position: absolute; right: 16px; bottom: 16px; opacity: .3; }

/* "Anstehend" – das Training, das als Nächstes dran ist. Heller Rahmen
   und weißes Schild, damit es auf einen Blick heraussticht. */
.tile .tile-last.next {
  background: rgba(255,255,255,.94);
  border-color: #fff;
  color: #10131f;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 3px 14px rgba(255,255,255,.3);
}
.tile.is-next {
  border-color: rgba(255,255,255,.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -14px 28px rgba(255,255,255,.1),
    0 0 0 1px rgba(255,255,255,.18),
    0 16px 38px rgba(var(--c-rgb), .42);
}

/* ---------- Hinweis-Balken ---------- */

.banner {
  display: flex; align-items: center; gap: 13px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  border-left: 3px solid var(--warn);
  box-shadow: var(--glass-top), 0 8px 20px rgba(2,4,12,.3);
  border-radius: 17px;
  padding: 13px 15px;
  margin-bottom: 14px;
  font-size: 15px;
}
.banner > svg.ic { color: var(--warn); }
.banner.info { border-left-color: var(--sky); }
.banner.info > svg.ic { color: var(--sky); }
.banner .btn { margin-left: auto; }

/* ---------- Eingabefelder ---------- */

label.field { display: block; margin-bottom: 13px; }
label.field > span { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 7px; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.045)), rgba(8,11,22,.5);
  border: 1px solid var(--glass-line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  border-radius: 16px;
  color: var(--text);
  font: inherit;
  font-size: 17px;            /* nie kleiner: sonst zoomt iOS beim Tippen */
  min-width: 0;
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  background: rgba(255,255,255,.1);
  border-color: rgba(var(--violet-rgb), .75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 4px rgba(var(--violet-rgb), .2);
}
input::placeholder { color: var(--muted-2); }

select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(244,246,251,.7) 50%),
    linear-gradient(135deg, rgba(244,246,251,.7) 50%, transparent 50%);
  background-position: calc(100% - 21px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
select option { background: #141828; color: var(--text); }

.switch { display: flex; align-items: center; gap: 13px; min-height: var(--tap); }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 54px; height: 32px; flex: 0 0 auto; min-height: 0; border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid var(--glass-line-2);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
  position: relative; transition: background .2s, box-shadow .2s;
  padding: 0; margin: 0; cursor: pointer;
}
.switch input:checked {
  background: linear-gradient(135deg, rgba(var(--teal-rgb),.95), rgba(var(--sky-rgb),.85));
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 0 16px rgba(var(--teal-rgb), .45);
}
.switch input::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.switch input:checked::after { transform: translateX(22px); }
.switch span { flex: 1; }

/* ---------- Training ---------- */

.workout-head {
  position: sticky; top: 0; z-index: 20;
  margin: -10px -14px 16px;
  padding: calc(var(--safe-t) + 12px) 14px 12px;
  background: linear-gradient(180deg, rgba(8,11,22,.86), rgba(8,11,22,.62));
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--glass-line-2);
}
.workout-head h1 { font-size: 20px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }

.group-head {
  margin: 24px 0 11px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 11px;
}
.group-head::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--glass-line), transparent);
}

.ex-card {
  position: relative; overflow: hidden;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 8px 22px rgba(2,4,12,.32);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
}
/* farbiger Lichtschimmer am linken Rand statt eines harten Balkens */
.ex-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, rgba(var(--c-rgb), .95), rgba(var(--c-rgb), .25));
  box-shadow: 0 0 16px rgba(var(--c-rgb), .55);
}
.ex-card.done { opacity: .55; }
.ex-title { display: flex; align-items: baseline; gap: 9px; }
.ex-title h3 { font-size: 18px; flex: 1; }
.ex-meta { font-size: 13px; color: var(--muted-2); margin-top: 3px; }
.ex-last { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.ex-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chip-up {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 11px; padding: 9px 10px 9px 13px;
  border-radius: 15px;
  background: linear-gradient(140deg, rgba(var(--teal-rgb),.22), rgba(var(--sky-rgb),.1));
  border: 1px solid rgba(var(--teal-rgb), .3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  color: #9df3e4; font-size: 14px; font-weight: 600;
}
.chip-up > svg.ic { color: var(--teal); }
.chip-up .btn { margin-left: auto; min-height: 38px; padding: 0 13px; font-size: 14px; }

.setlist { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.setrow { display: grid; grid-template-columns: 24px 1fr 1fr 58px; gap: 8px; align-items: center; }
.setrow .sn { color: var(--muted-2); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.setrow input {
  min-height: 52px; text-align: center; font-weight: 700; font-size: 18px;
  font-variant-numeric: tabular-nums; padding: 10px 6px;
}
.setrow .unit { position: relative; }
.setrow .unit::after {
  content: attr(data-unit); position: absolute; right: 9px; bottom: 7px;
  font-size: 10.5px; color: var(--muted-2); pointer-events: none; font-weight: 600;
}
/* Die Satz-Zeilen bleiben bewusst schwarz-weiß: nur Glas, keine Farbe.
   Erledigt = die Fläche wird hell, offen = dunkel. Das ist auf einen Blick
   erkennbar, auch mit verschwitzten Augen im Gym. */
.check {
  min-height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(170deg, rgba(255,255,255,.1), rgba(255,255,255,.035)), rgba(8,11,22,.5);
  border: 1px solid var(--glass-line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  color: var(--muted-2);
  cursor: pointer; font-family: inherit; padding: 0;
  transition: transform .08s, background .22s, color .22s, box-shadow .22s;
}
.check:active { transform: scale(.93); }

.setrow.done .check {
  background: linear-gradient(170deg, rgba(255,255,255,.96), rgba(255,255,255,.74));
  color: #0a0d16;
  border-color: rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 #fff, 0 4px 18px rgba(255,255,255,.2);
}
.setrow.done input {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.03)), rgba(8,11,22,.56);
  color: var(--muted);
  border-color: rgba(255,255,255,.18);
}
/* auch der Rahmen beim Tippen bleibt hier farblos */
.setrow input:focus {
  border-color: rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 4px rgba(255,255,255,.13);
}

/* ---------- Pausen-Timer ---------- */

#restbar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  z-index: 40;
  transform: translateY(150%);
  transition: transform .34s cubic-bezier(.2,.9,.25,1);
  padding: 0 12px 12px;
}
body.no-nav #restbar { bottom: var(--safe-b); }
#restbar.show { transform: translateY(0); }
.restbox {
  background: linear-gradient(165deg, rgba(255,255,255,.17), rgba(255,255,255,.07));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px;
  padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 -6px 34px rgba(2,4,12,.55);
  max-width: 660px; margin: 0 auto;
  display: flex; align-items: center; gap: 9px;
}
.restbox .time {
  font-size: 27px; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 64px; letter-spacing: -0.03em;
}
.restbox .lbl { font-size: 14px; color: var(--muted); font-weight: 600; }
.restbox .btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.restprog {
  position: absolute; left: 14px; right: 14px; bottom: 7px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  transform-origin: left;
  box-shadow: 0 0 10px rgba(var(--teal-rgb), .7);
}
.restbox.done-state {
  background: linear-gradient(140deg, rgba(var(--teal-rgb),.9), rgba(var(--sky-rgb),.72));
  color: #04231f;
}
.restbox.done-state .lbl { color: rgba(4,35,31,.75); }

/* ---------- Untere Leiste ---------- */

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: linear-gradient(180deg, rgba(8,11,22,.72), rgba(8,11,22,.92));
  backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-top: 1px solid var(--glass-line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
body.no-nav #nav { display: none; }
#nav button {
  position: relative;
  border: 0; background: none; color: var(--muted-2);
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; border-radius: 15px; padding: 0;
  transition: color .2s;
}
#nav button:active { transform: scale(.94); }
#nav button.active { color: var(--text); }
/* die leuchtende Glaspille hinter dem aktiven Eintrag */
#nav button.active::before {
  content: ''; position: absolute; inset: 1px 6px;
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 20px rgba(var(--violet-rgb), .35);
}
#nav button > * { position: relative; }

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

.list { display: flex; flex-direction: column; gap: 9px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 5px 16px rgba(2,4,12,.26);
  border-radius: 17px;
  padding: 13px 15px; min-height: var(--tap);
}
.list-item .main { flex: 1; min-width: 0; }
.list-item .main .t { font-weight: 600; }
.list-item .main .s { font-size: 13px; color: var(--muted-2); margin-top: 1px; }
.list-item .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.list-item > svg.ic { color: var(--muted-2); }
.list-item .medal { color: var(--gold); filter: drop-shadow(0 0 8px rgba(252,211,77,.45)); }

/* ---------- Reiter ---------- */

.tabs {
  display: flex; gap: 3px; padding: 4px; margin-bottom: 18px;
  border-radius: 17px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--glass-line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.tabs button {
  position: relative;
  flex: 1; min-width: 0; min-height: 42px; border: 0; border-radius: 13px;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0 2px; white-space: nowrap;
  transition: color .2s;
}
.tabs button.active {
  color: var(--text);
  background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.07));
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 10px rgba(2,4,12,.3);
}

/* ---------- Diagramm ---------- */

.chartbox {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 8px 22px rgba(2,4,12,.3);
  border-radius: var(--radius);
  padding: 16px 12px 11px;
}
.chartbox svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: rgba(255,255,255,.1); stroke-width: 1; }
.chart-line {
  fill: none; stroke: var(--c, var(--violet)); stroke-width: 2.6;
  stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 7px rgba(var(--c-rgb, var(--violet-rgb)), .6));
}
.chart-area { fill: var(--c, var(--violet)); opacity: .16; }
.chart-pt { fill: var(--c, var(--violet)); stroke: rgba(255,255,255,.75); stroke-width: 1.2; }
.chart-lbl { fill: var(--muted-2); font-size: 11px; }
.chart-empty { color: var(--muted); text-align: center; padding: 32px 10px; }

/* ---------- Dialog ---------- */

#modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3,5,12,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-end; justify-content: center;
  padding: 14px; padding-bottom: calc(14px + var(--safe-b));
}
#modal.show { display: flex; }
.modal-box {
  background: linear-gradient(165deg, rgba(255,255,255,.16), rgba(255,255,255,.065));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 -10px 50px rgba(2,4,12,.6);
  border-radius: 28px; padding: 20px;
  width: 100%; max-width: 480px;
  max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: pop .26s cubic-bezier(.2,.9,.25,1);
}
@keyframes pop { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-box h2 { font-size: 21px; margin-bottom: 11px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
  transform: translate(-50%, 26px); z-index: 95;
  background: linear-gradient(165deg, rgba(255,255,255,.2), rgba(255,255,255,.09));
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--text);
  padding: 13px 20px; border-radius: 17px; font-size: 15px; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 30px rgba(2,4,12,.5);
  opacity: 0; pointer-events: none; transition: opacity .24s, transform .24s;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Pokal ---------- */

#celebrate {
  position: fixed; inset: 0; z-index: 99;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
#celebrate.show { display: flex; }
.trophy {
  text-align: center;
  padding: 26px 34px 22px;
  border-radius: 30px;
  background: linear-gradient(165deg, rgba(255,255,255,.18), rgba(255,255,255,.07));
  backdrop-filter: blur(30px) saturate(190%); -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid rgba(252,211,77,.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 16px 50px rgba(2,4,12,.6), 0 0 60px rgba(252,211,77,.18);
  animation: trophy 1.7s ease forwards;
}
.trophy .ico { color: var(--gold); display: flex; justify-content: center;
  filter: drop-shadow(0 4px 18px rgba(252,211,77,.6)); }
.trophy .txt { font-size: 19px; font-weight: 800; color: var(--gold); margin-top: 8px; }
.trophy .sub { font-size: 15px; color: var(--text); opacity: .92; margin-top: 2px; }
@keyframes trophy {
  0%   { transform: scale(.5) rotate(-10deg); opacity: 0; }
  16%  { transform: scale(1.1) rotate(3deg); opacity: 1; }
  28%  { transform: scale(1) rotate(0); }
  80%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(.95) translateY(-16px); opacity: 0; }
}

/* ---------- Diverses ---------- */

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-line-2);
  box-shadow: var(--glass-top), 0 5px 16px rgba(2,4,12,.26);
  border-radius: 18px; padding: 14px 10px; text-align: center;
}
.kpi .v { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .l { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .ico { display: flex; justify-content: center; margin-bottom: 12px; color: var(--muted-2); }

.section-title { font-size: 13px; font-weight: 700; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .1em; margin: 20px 0 10px; }

hr.sep { border: 0; border-top: 1px solid var(--glass-line-2); margin: 20px 0; }

/* Wer Bewegung nicht mag, bekommt keine */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
