/* VIAVENDO CI (Styleguide v2.1): helles Theme wie Dokumente (Grund #f4f7f8, Text VIAVENDO Dark),
   Orange als Akzent, Teal Deep für Links,
   Headlines Rajdhani, Fließtext Montserrat. Schriften selbst gehostet (SIL OFL 1.1). */
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap; src: url('fonts/montserrat-latin.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url('fonts/rajdhani-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url('fonts/rajdhani-latin-700.woff2') format('woff2'); }
:root {
  color-scheme: light;
  --bg: #f4f7f8; --card: #ffffff; --ink: #29383d; --muted: #5a6a70;
  --line: #d8e2e5; --accent: #ff6f05; --accent-2: #e66405; --accent-ink: #ffffff; --accent-text: #c25504;
  --link: #017992; --good: #1d7a46; --good-bg: #e5f4eb; --good-line: #a9d8bc;
  --warn: #8a4500; --warn-bg: #fff1e5; --danger: #b3261e; --field: #ffffff; --soft: #eef3f5;
  --shadow: 0 1px 2px rgba(41,56,61,.06), 0 4px 14px rgba(41,56,61,.06);
  --display: 'Rajdhani', 'Montserrat', sans-serif;
  --body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 500 16px/1.5 var(--body); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 24px; margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.top h1::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 10px;
  background: linear-gradient(135deg, #ff6f05, #33b9cf); vertical-align: 3px; }
.status { font-size: 13px; color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 12px 16px; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); box-shadow: 0 -2px 10px rgba(41,56,61,.06); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { border: 0; background: none; padding: 16px 2px; font: 700 14px var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.tabs button.active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.card h2 { font-size: 22px; margin: 0 0 4px; }
.card h3 { font-size: 18px; margin: 12px 0 6px; }
a { color: var(--link); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; color: var(--ink); padding: 11px 14px; cursor: pointer;
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 14px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, #ff6f05, #e66405); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 4px 14px rgba(255,111,5,.28); }
.btn.block { width: 100%; padding: 16px; font-size: 16px; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn.link { border: 0; background: none; color: var(--link); padding: 8px 4px; text-transform: none; letter-spacing: 0; font-size: 15px; }
.btn:disabled { opacity: .35; }

input, select, textarea { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 3px; }
.field { margin-bottom: 10px; }

.ex-meta { font-size: 13px; color: var(--muted); }
.last { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hint { display: inline-block; font-size: 13px; padding: 3px 8px; border-radius: 6px; margin-top: 6px; }
.hint.up { background: var(--good-bg); color: var(--good); font-weight: 600; }
.hint.same { background: var(--warn-bg); color: var(--warn); }

.sets { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 6px 8px; align-items: center; margin-top: 10px; }
.sets .lbl { font-size: 13px; color: var(--muted); }
.sets .head { font-size: 12px; color: var(--muted); }
.sets input { text-align: center; font-size: 18px; padding: 10px 6px; }
.sets.bw { grid-template-columns: 52px 1fr; }

.big { font: 700 40px/1.05 var(--display); }
.bar { height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; margin: 8px 0; }
.bar > div { height: 100%; background: var(--accent); }
.bar.done > div { background: var(--good); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.presets button { text-align: left; }
.presets b { display: block; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--soft); border-radius: 8px; padding: 8px 4px; }
.stats b { display: block; font: 700 24px var(--display); }
.stats span { font-size: 12px; color: var(--muted); }

svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { fill: var(--muted); font-size: 20px; }

.ex-edit { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ex-edit .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
details summary { cursor: pointer; }
.week { display: flex; gap: 4px; align-items: flex-end; height: 70px; }
.week div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.week i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.week i.ok { background: var(--good); }

body.auth .tabs { display: none; }
.studio { text-align: center; }
.studio .sname { font-size: 34px; line-height: 1.05; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.studio .hint { margin: 10px auto 0; }
.stepper { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 10px; margin-top: 16px; }
.stepper .btn { font-size: 32px; padding: 14px 0; line-height: 1; }
.stepper .val { font: 700 60px/1 var(--display); font-variant-numeric: tabular-nums; }
.stepper > div { min-width: 0; }
.stepper .unit { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.studio-btns { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 8px; margin-top: 20px; }
.studio-btns.two { grid-template-columns: 1fr 1.6fr; }
.studio-btns .btn { padding: 20px 6px; font-size: 13px; }
.studio-btns .btn.primary { font-size: 17px; }
.timer { font: 700 104px/1 var(--display); margin: 4px 0 18px; font-variant-numeric: tabular-nums; color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 15px; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
a.btn { display: inline-block; text-decoration: none; color: inherit; }
a.btn.link { color: var(--link); }

/* ---------- Studio-Modus: Übersicht, Satz-Kacheln, Vorschaubilder ---------- */
.studio-wrap { padding-top: 2px; }
.studio-top { margin-bottom: 10px; }
.kicker { font: 700 12px var(--body); letter-spacing: .15em; text-transform: uppercase; color: var(--accent-text); }
.studio .sname.left, .sname.left { text-align: left; font-size: 30px; margin: 6px 0 4px; text-transform: uppercase; }
.setno { font: 700 44px/1 var(--display); margin: 6px 0 2px; }
.setno span { font-size: 24px; color: var(--muted); }
.setchips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; }
.setchip { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 7px 10px; border-radius: 12px;
  border: 1px dashed var(--line); color: var(--muted); font: 700 17px var(--display); background: none; }
.setchip small { font: 600 10px var(--body); letter-spacing: .08em; text-transform: uppercase; }
.setchip.done { border: 1px solid var(--good-line); background: var(--good-bg); color: var(--good); cursor: pointer; }
.setchip.cur { border: 2px solid var(--accent); color: var(--ink); background: var(--warn-bg); }
.exinfo { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 12px 0 4px; padding: 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); font-size: 14px; }
.exinfo-text { display: grid; gap: 3px; min-width: 0; }
.thumb { position: relative; flex: 0 0 132px; width: 132px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: #dfe7ea; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.45)); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.thumb.sm { flex-basis: 96px; width: 96px; }
.tiles { display: grid; gap: 8px; }
.tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.tile.full { border-color: var(--good-line); }
.tile-body { flex: 1; min-width: 0; display: grid; gap: 3px; text-align: left; border: 0; background: none; padding: 2px 26px 2px 0; cursor: pointer; }
.tile-body b { font: 700 19px/1.15 var(--display); letter-spacing: .02em; }
.tile .tick { position: absolute; right: 12px; top: 10px; color: var(--good); font-size: 20px; font-weight: 700; }
.dots { display: flex; gap: 5px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.bigtick { width: 64px; height: 64px; margin: 10px auto 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 34px; font-weight: 700; color: var(--good); background: var(--good-bg); border: 2px solid var(--good-line); }
.timer.small-timer { font-size: 56px; margin: 0; }
.noted { margin-top: 4px; font-size: 15px; }
.btn.link.danger { color: var(--danger); }

/* ---------- Start: Kennzahlen, Heatmap, Kraftverlauf ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.kpi b { font: 700 32px/1.05 var(--display); }
.kpi b i { font-style: normal; font-size: 17px; color: var(--muted); }
.kpi span { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi small { font-size: 12px; color: var(--link); }
.kpi.ok { border-color: var(--good-line); }
.kpi.ok small { color: var(--good); }
.card.next { border-left: 4px solid var(--accent); }
.card.next h2 { font-size: 28px; text-transform: uppercase; margin: 2px 0 2px; }
.ups { list-style: none; margin: 8px 0 0; padding: 0; }
.ups li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.ups b { color: var(--good); }
.hm-months, .hm-cols { display: grid; grid-template-columns: 22px repeat(12, 1fr); gap: 3px; }
.hm-months { font-size: 10px; color: var(--muted); height: 14px; margin-bottom: 3px; white-space: nowrap; }
.hm-col.lbl span { aspect-ratio: auto; display: flex; align-items: center; font-size: 10px; color: var(--muted); }
.hm-col { display: grid; grid-template-rows: repeat(7, auto) 16px; gap: 3px; }
.hm-col.lbl { grid-template-rows: repeat(7, 1fr) 16px; }
.hm-col b { text-align: center; font: 700 12px var(--display); color: var(--muted); height: 16px; }
.hm-col.goal b { color: var(--good); }
.hm i, .hm-legend i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--soft); border: 1px solid #e3eaec; }
.hm i.l1, .hm-legend i.l1 { background: #ffd2b0; border-color: #ffd2b0; }
.hm i.l2, .hm-legend i.l2 { background: #ff9a4f; border-color: #ff9a4f; }
.hm i.l3, .hm-legend i.l3 { background: #e66405; border-color: #e66405; }
.hm i.today { outline: 2px solid var(--ink); outline-offset: -1px; }
.hm i.future { opacity: .35; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; }
.hm-legend i { width: 12px; }
.strength li { align-items: center; }
.strength small { display: block; font-size: 12px; }
.strength b { font: 700 20px var(--display); min-width: 64px; text-align: right; }
svg.spark { width: 96px; height: 30px; flex: 0 0 96px; }
