:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --surface-1: #171716;
  --surface-2: #21211f;
  --surface-3: #2c2c29;
  --line: #2f2f2b;
  --text-primary: #f2f1ec;
  --text-secondary: #c3c2b7;
  --text-muted: #8b8a82;
  --volt: #d4ff3a;          /* Marke: Aktionen, erledigt, Fortschritt */
  --volt-ink: #141a00;
  --volt-soft: rgba(212, 255, 58, .12);
  --series-1: #3987e5;      /* Diagramme (Referenzpalette, dunkel) */
  --good: #0ca30c;
  --critical: #e66767;
  --radius: 18px;
  --radius-s: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; color: var(--text-primary); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 calc(92px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% -10%, #1d2109 0%, var(--bg) 55%) fixed; min-height: 100vh; }
main { max-width: 620px; margin: 0 auto; padding: 18px 16px 24px; }
h1 { font-size: 32px; line-height: 1.1; margin: 0; letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: 20px; margin: 0; letter-spacing: -.015em; font-weight: 700; }
h3 { font-size: 13px; margin: 28px 2px 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: var(--text-secondary); }
.muted { color: var(--text-muted); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.head > div:first-child { flex: 1; min-width: 0; }
.head .sub { color: var(--text-secondary); margin-top: 6px; }
.pring { width: 64px; height: 64px; position: relative; flex: none; }
.pring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 5; }
.pring .track { stroke: var(--surface-3); }
.pring .prog { stroke: var(--volt); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }
.pring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* Tageswahl */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 16px; margin-bottom: 14px; }
.days button { border-radius: 12px; padding: 9px 2px 8px; font-size: 12px; color: var(--text-muted); position: relative;
  transition: background .2s var(--ease), color .2s; }
.days button b { display: block; font-size: 15px; color: var(--text-secondary); margin-bottom: 1px; }
.days button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-secondary); }
.days button[aria-pressed="true"] b { color: var(--text-primary); }
.days button .dot { position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--volt); }

.banner { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 12px; }
.banner > span { flex: 1; }
.linkbtn { color: var(--critical); font-size: 14px; font-weight: 600; padding: 4px 2px; }

/* ---------- Karten ---------- */
.card { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 14px; transition: border-color .3s; }
.card.done { border-color: rgba(212, 255, 58, .45); }
.card .pad { padding: 14px 16px 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }

.warm { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.warm .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.warm .ico svg { width: 22px; height: 22px; stroke: var(--text-secondary); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero { position: relative; height: 196px; background: #000; cursor: zoom-in; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,13,12,0) 35%, rgba(13,13,12,.55) 70%, rgba(23,23,22,.98) 100%); }
.hero .cap { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 1; }
.hero .cap h2 { font-size: 23px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.hero .cap .where { color: var(--text-secondary); font-size: 14px; }
.hero .idx { position: absolute; top: 12px; left: 12px; z-index: 1; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  background: rgba(13,13,12,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 4px 9px; border-radius: 999px; }
.hero .check { position: absolute; top: 12px; right: 12px; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  background: var(--volt); color: var(--volt-ink); display: grid; place-items: center; font-weight: 900;
  animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--line); white-space: nowrap; }
.chip b { color: var(--text-primary); }
.tip { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.last { font-size: 14px; color: var(--text-secondary); background: var(--surface-2); border-radius: var(--radius-s); padding: 9px 12px; margin-bottom: 14px; }
.last b { color: var(--text-primary); }
.up { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; color: var(--volt); font-weight: 600; }
.up svg { width: 16px; height: 16px; flex: none; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Gewicht für alle Sätze */
.stepper { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 6px; margin-bottom: 12px; }
.stepper .lbl { flex: 1; padding-left: 8px; font-size: 14px; color: var(--text-muted); }
.stepper button { width: 44px; height: 44px; border-radius: 11px; background: var(--surface-3); font-size: 22px; font-weight: 500; line-height: 1; }
.stepper button:active { transform: scale(.94); }
.stepper .val { min-width: 92px; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stepper .val small { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 3px; }

/* Satz-Tabelle */
.sets { display: grid; gap: 7px; }
.set { display: grid; grid-template-columns: 34px 1fr 1fr 52px; gap: 8px; align-items: center; }
.set.cols3 { grid-template-columns: 1fr 1fr 1fr 52px; }
.set.hdr { font-size: 11px; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: -2px; }
.set.hdr span:nth-child(n+2) { padding-left: 4px; }
.set .no { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2);
  font-weight: 700; font-size: 14px; color: var(--text-secondary); }
.set.w .no { font-size: 11px; color: var(--text-muted); }
.set.on .no { background: var(--volt-soft); color: var(--volt); }
.field { position: relative; }
.field input { width: 100%; height: 48px; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px;
  color: var(--text-primary); font-weight: 700; font-size: 19px; padding: 0 38px 0 12px; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield; transition: border-color .15s, background .15s; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input::placeholder { color: #5d5c56; font-weight: 600; }
.field input:focus { outline: none; border-color: var(--volt); background: var(--surface-3); }
.field span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }
.set.w .field input { font-weight: 500; color: var(--text-secondary); font-size: 17px; }
.set.on .field input { background: transparent; border-color: var(--line); }
.tick { width: 52px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center;
  border: 1px solid var(--line); transition: background .15s, transform .1s; }
.tick svg { width: 22px; height: 22px; stroke: var(--text-muted); fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tick:active { transform: scale(.92); }
.tick[aria-pressed="true"] { background: var(--volt); border-color: var(--volt); }
.tick[aria-pressed="true"] svg { stroke: var(--volt-ink); }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; border-radius: 16px;
  font-weight: 700; font-size: 17px; background: var(--volt); color: var(--volt-ink); transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--line); font-weight: 600; }
.btn + .btn { margin-top: 8px; }
.center { text-align: center; }
textarea.note { width: 100%; min-height: 64px; resize: vertical; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 10px 12px; color: var(--text-primary); margin-bottom: 14px; }
textarea.note:focus { outline: none; border-color: var(--volt); }

/* ---------- Timer ---------- */
#timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 8px; border-radius: 999px;
  background: rgba(33,33,31,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.55); animation: rise .35s var(--ease); width: max-content; max-width: calc(100% - 24px); }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
#timer .ring { width: 40px; height: 40px; transform: rotate(-90deg); flex: none; }
#timer circle { fill: none; stroke-width: 4; }
#timer .track { stroke: var(--surface-3); }
#timer .prog { stroke: var(--text-secondary); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset .25s linear, stroke .3s; }
#timer.ready .prog { stroke: var(--volt); }
#timer .tt { display: flex; flex-direction: column; min-width: 104px; line-height: 1.15; }
#timer .t { font-size: 20px; font-variant-numeric: tabular-nums; }
#timer .s { font-size: 12px; color: var(--text-muted); }
#timer.ready .s { color: var(--volt); }
#timer button { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface-3); font-size: 14px; font-weight: 600; }
#timer button.primary { background: var(--volt); color: var(--volt-ink); }

/* ---------- Navigation ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: center;
  padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
  background: rgba(13,13,12,.86); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line); }
#tabs button { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px;
  font-size: 11px; font-weight: 600; color: var(--text-muted); transition: color .2s; }
#tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs button[aria-current="page"] { color: var(--volt); }

/* ---------- Verlauf ---------- */
.sess { padding: 14px 16px; }
.sess header { display: flex; align-items: baseline; gap: 10px; }
.sess header b { flex: 1; font-size: 17px; }
.sess .meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.sess table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.sess td { padding: 6px 0; border-top: 1px solid var(--surface-2); color: var(--text-secondary); vertical-align: top; }
.sess td:last-child { text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; padding-left: 10px; }
.sess .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--volt-soft); color: var(--volt); }
.badge.pending { background: var(--surface-3); color: var(--text-secondary); }

/* ---------- Fortschritt ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 13px; color: var(--text-muted); }
.tile .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-left: 3px; letter-spacing: 0; }
.tile .d { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.chart { position: relative; padding: 14px 10px 8px; }
.chart .title { padding: 0 6px 2px; font-size: 15px; font-weight: 600; }
.chart .title + .muted { padding: 0 6px 8px; font-size: 13px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; overflow: visible; }
.chart .grid { stroke: #262624; stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--text-primary); font-size: 12px; font-weight: 700; }
.chart .ln { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#fadeBlue); }
.chart .pt { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.chart .bar { fill: var(--series-1); }
.chart .bar.dim { fill: #2d4d73; }
.chart .cross { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .empty { padding: 26px 6px; color: var(--text-muted); font-size: 14px; }
.tooltip { position: absolute; pointer-events: none; background: #0b0b0a; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; font-size: 13px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 2;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.tooltip .d { color: var(--text-muted); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 0 6px 10px; }
.seg button { flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-primary); }
.picker { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.picker button { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--line); font-size: 14px; color: var(--text-secondary); }
.picker button img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.picker button[aria-pressed="true"] { border-color: var(--volt); color: var(--text-primary); background: var(--surface-2); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 16px; border-bottom: 1px solid var(--surface-2); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
table.data td:nth-child(2) { color: var(--text-primary); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
.records li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--surface-2); }
.records li:first-child { border-top: 0; }
.records img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.records .n { flex: 1; min-width: 0; }
.records .n small { display: block; color: var(--text-muted); font-size: 13px; }
.records .v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; text-align: right; }
.records .v small { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); }
ul.clean { list-style: none; margin: 0; padding: 0; }

/* ---------- Plan ---------- */
.planday { padding: 14px 16px; }
.planday .ex { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--surface-2); }
.planday .ex:first-of-type { border-top: 0; }
.planday .ex img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
.planday .ex div { flex: 1; }
.planday .ex small { display: block; color: var(--text-muted); font-size: 13px; }
.rules li { padding: 9px 16px 9px 44px; position: relative; color: var(--text-secondary); font-size: 15px; border-top: 1px solid var(--surface-2); }
.rules li:first-child { border-top: 0; }
.rules li::before { content: ""; position: absolute; left: 18px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--volt); }
.credits { font-size: 12px; color: var(--text-muted); padding-left: 18px; }
.credits li { margin-bottom: 4px; }

/* ---------- Login ---------- */
.login { min-height: 70vh; display: grid; place-items: center; }
.login form { width: 100%; max-width: 340px; text-align: center; }
.login .logo { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 18px; background: var(--volt); display: grid; place-items: center; }
.login .logo svg { width: 40px; height: 40px; stroke: var(--volt-ink); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.login input { width: 100%; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  padding: 0 16px; font-size: 17px; margin: 22px 0 10px; color: var(--text-primary); }
.login input:focus { outline: none; border-color: var(--volt); }
.login .err { color: var(--critical); font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ---------- Sheet, Lightbox, Toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet-body { width: 100%; max-width: 620px; background: var(--surface-1); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .4s var(--ease);
  max-height: 90vh; overflow: auto; }
@keyframes up { from { transform: translateY(100%); } }
.done-hero { text-align: center; margin-bottom: 18px; }
.done-hero .big { width: 76px; height: 76px; border-radius: 50%; background: var(--volt); color: var(--volt-ink); margin: 0 auto 14px;
  display: grid; place-items: center; animation: pop .5s var(--ease); }
.done-hero .big svg { width: 40px; height: 40px; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done-hero p { color: var(--text-secondary); margin-top: 4px; }
.sheet .tiles { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.sheet .tile { padding: 12px; text-align: center; }
.sheet .tile .v { font-size: 22px; }
.prs { margin-bottom: 16px; }
.prs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--surface-2); font-size: 15px; }
.prs li .nm { flex: 1; color: var(--text-secondary); }

#lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.94); display: flex; align-items: center;
  justify-content: center; flex-direction: column; padding: 20px; animation: fade .2s; }
#lightbox img { max-width: 100%; max-height: 80vh; border-radius: 14px; }
#lightbox p { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 12px; }
#toast { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -80px); z-index: 40;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text-primary); font-weight: 600; font-size: 15px;
  padding: 10px 18px; border-radius: 999px; transition: transform .35s var(--ease); box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; }
#toast.on { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 560px) { .tiles.four { grid-template-columns: repeat(4, 1fr); } }
