/* Laufkompass – Layout "Weg zum Lindkogel".
   Eine Spalte am Handy, Navigation unten. Dunkel ist Standard, hell per Schalter.
   Gelb wie die Wegweiser am Berg ist der rote Faden: Fortschritt, heute, Hauptknopf. */
:root {
  --bg: #14130f; --surface: #1c1a14; --card: #22201a; --line: #2f2c23; --line2: #4a463a;
  --ink: #ece8df; --muted: #a8a294; --dim: #8f8979; --topo: #2a2720;
  --accent: #f2c230; --accent-ink: #1d1d1b; --accent-text: #f2c230; --accent-soft: #2b2a1c;
  --ok: #6fd08f; --warn: #e2b53a; --bad: #ff8a80; --bad-fill: #c0392b;
  --k-lauf: #f2c230; --k-physio: #a891e6; --k-yoga: #79b4e8; --k-bouldern: #e8975a; --k-kraft: #d6a36b; --k-rad: #8ccf9e; --k-wandern: #c9b38a; --k-info: #6b6555;
  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f3ee; --surface: #ffffff; --card: #ffffff; --line: #e4e0d6; --line2: #cfc9bb;
  --ink: #1f1d18; --muted: #625d52; --dim: #7d7769; --topo: #ebe6da;
  --accent: #f2c230; --accent-ink: #1d1d1b; --accent-text: #7a5d00; --accent-soft: #fbf1cc;
  --ok: #2b7344; --warn: #8a6400; --bad: #b3261e; --bad-fill: #b3261e;
  --k-lauf: #d9a600; --k-physio: #6f52b8; --k-yoga: #2f72ad; --k-bouldern: #c46a1f; --k-kraft: #9a6a2c; --k-rad: #3f8f57; --k-wandern: #8a7346; --k-info: #b8b1a2;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.display { font-family: var(--f-display); font-weight: 700; line-height: 1.05; letter-spacing: .005em; }
.label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* App-Gerüst */
.app { height: 100%; display: flex; flex-direction: column; }
.views { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view { max-width: 560px; margin: 0 auto; padding-bottom: 24px; }
.pad { padding: 20px max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; }
.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line);
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tabbar button { border: 0; background: transparent; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 12px; font-weight: 600; }
.tabbar button[aria-current="page"] { color: var(--accent-text); }
.tabbar svg { width: 24px; height: 24px; }

/* Kopf mit Weg */
.hero { position: relative; overflow: hidden; background: var(--surface); padding: calc(18px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 16px max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; }
.hero .topo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero > *:not(.topo) { position: relative; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-head h1 { font-size: 30px; }
.chip-sign { font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--accent-ink); background: var(--accent); padding: 4px 9px; border-radius: 5px; white-space: nowrap; }
.path { width: 100%; height: auto; display: block; max-width: 420px; }
.path text { font-family: var(--f-body); }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 14px; }
.tile { background: var(--surface); border-radius: 14px; padding: 12px; min-width: 0; }
.tile .val { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1.1; }
.tile .val small { font-family: var(--f-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.tile .lab { font-size: 12px; color: var(--muted); }
.tile .st { font-size: 12px; font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-ok { color: var(--ok); } .st-warn { color: var(--warn); } .st-bad { color: var(--bad); } .st-dim { color: var(--muted); }

.status { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lvl-gruen .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); } .lvl-gruen { color: var(--ok); }
.lvl-gelb .dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); } .lvl-gelb { color: var(--warn); }
.lvl-rot .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); } .lvl-rot { color: var(--bad); }
.lvl-grau .dot { background: var(--dim); } .lvl-grau { color: var(--muted); }

.today-title { font-size: 30px; }
.today-meta { color: var(--muted); font-size: 15px; margin-top: 4px; }
.advice { border-radius: 12px; padding: 12px 14px; font-size: 14px; background: var(--accent-soft); }
.advice b { display: block; margin-bottom: 2px; }
.done-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }
.unit-mini { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.unit-mini:first-child { border-top: 0; }

.btn { min-height: 46px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; padding: 0 16px; }
.btn-primary { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-small { min-height: 40px; border-radius: 10px; font-size: 14px; padding: 0 14px; }
.btn-text { border: 0; background: transparent; color: var(--accent-text); font-weight: 600; min-height: 44px; padding: 0 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }
.btn[disabled] { opacity: .55; cursor: default; }

.row-card { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border: 0; width: 100%; text-align: left; color: var(--ink); }
.row-card .grow { flex: 1 1 auto; min-width: 0; }
.row-card b { display: block; font-size: 15px; }
.row-card small { display: block; font-size: 13px; color: var(--muted); }
.row-card.todo { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.badge-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }

/* Wochenstreifen */
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.strip button { border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 12px; background: var(--surface); color: var(--ink); }
.strip button .wd { font-size: 11px; font-weight: 600; color: var(--muted); }
.strip button .dn { font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.strip button .dots { display: flex; gap: 3px; height: 6px; }
.strip button .dots i { width: 6px; height: 6px; border-radius: 50%; }
.strip button.today { background: var(--accent); color: var(--accent-ink); }
.strip button.today .wd { color: var(--accent-ink); }
.strip button.today .dots i { background: var(--accent-ink) !important; }
.strip button.done-all .dn::after { content: " ✓"; font-size: 12px; }

/* Plan */
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.week-sep { margin-top: 8px; }
.day { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 14px; }
.day.today { background: var(--accent-soft); }
.day .date { width: 44px; flex: none; text-align: center; }
.day .date .wd { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day .date .dn { font-family: var(--f-display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.day.today .date .wd, .day.today .date .dn { color: var(--accent-text); }
.day .units { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.unit { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.unit .kd { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.unit .t { display: block; font-size: 15px; font-weight: 600; }
.unit .m { display: block; font-size: 13px; color: var(--muted); }
.unit.prio1 { border: 2px solid var(--accent); }
.unit.k-info { background: transparent; border: 1px dashed var(--line2); }
.unit.s-erledigt .t, .unit.s-ausgefallen .t, .unit.s-verpasst .t { text-decoration: line-through; color: var(--dim); }
.unit.s-erledigt .t::before { content: "✓ "; text-decoration: none; display: inline-block; color: var(--ok); margin-right: 2px; }
.unit-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 4px 4px; }
.free { padding: 10px 0; font-size: 14px; color: var(--dim); }

/* Verlauf */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; }
.seg button { min-height: 38px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 600; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--line); color: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--f-body); font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: 2px; }
.week-row { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.week-row .kw { width: 54px; flex: none; }
.week-row .kw b { display: block; font-size: 13px; }
.week-row .kw small { font-size: 12px; color: var(--muted); }
.week-row .mid { flex: 1 1 auto; min-width: 0; display: grid; gap: 5px; }
.week-row .mid small { font-size: 13px; color: var(--muted); }
.week-row .km { min-width: 58px; white-space: nowrap; text-align: right; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.week-row.cur { outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* Mehr */
.list { background: var(--surface); border-radius: 16px; overflow: hidden; }
.list > button, .list > div { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.list > * + * { border-top: 1px solid var(--line) !important; }
.list b { display: block; font-size: 15px; }
.list small { display: block; font-size: 13px; color: var(--muted); }
.list .grow { flex: 1 1 auto; min-width: 0; }
.chev { width: 18px; height: 18px; flex: none; color: var(--dim); }

/* Banner, Toast */
.banner { border-radius: 12px; padding: 10px 14px; font-size: 14px; background: color-mix(in srgb, var(--warn) 18%, transparent); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: calc(100vw - 32px); }

/* Dialoge als Blätter */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 20px; width: min(520px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog form, .sheet { display: grid; gap: 14px; }
dialog h2 { font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.hint { color: var(--muted); font-size: 14px; }
label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
  font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); width: 100%; }
textarea { min-height: 3.5em; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--ink); }
.check-row input { width: 22px; height: 22px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q { display: grid; gap: 6px; }
.q-label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.q-label span { color: var(--muted); font-weight: 400; font-size: 12px; }
.scale { display: grid; gap: 4px; }
.scale.s11 { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.scale.s10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.scale.s5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale button { min-height: 42px; padding: 0; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); font-variant-numeric: tabular-nums; min-width: 0; }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.scale.pain button[aria-pressed="true"].p-mid { background: var(--warn); border-color: var(--warn); color: var(--accent-ink); }
.scale.pain button[aria-pressed="true"].p-high { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.avail { display: grid; gap: 8px; }
.avail-row { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.chips button { min-height: 38px; font-size: 13px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.msg { font-size: 14px; min-height: 1.2em; }
.msg.err { color: var(--bad); }
.report-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.info-text p + p, .info-text ul { margin-top: 8px; }
.info-text ul { padding-left: 18px; display: grid; gap: 6px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px max(18px, env(safe-area-inset-left, 0px)); }
.login .card { width: 100%; max-width: 380px; }
.login h1 { font-size: 38px; }

@media (prefers-reduced-motion: no-preference) {
  .view { animation: fade .18s ease-out; }
  @keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 700px) {
  .tabbar { max-width: 560px; margin: 0 auto; width: 100%; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}

/* Ausbau: Warum, Übungen, Vergleich, Reha-Weg */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.why { display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.why b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.why ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.why-btn { border: 0; background: transparent; color: var(--accent-text); font-weight: 600; font-size: 14px; padding: 0; min-height: 32px; justify-self: start; }
.ex-list { display: grid; gap: 6px; margin-top: 12px; }
.ex { display: grid; grid-template-columns: 30px minmax(0, 1fr) 76px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ex .box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line2); background: transparent; display: grid; place-items: center; padding: 0; color: var(--accent-ink); }
.ex .box[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.ex .nm { font-size: 15px; font-weight: 600; min-width: 0; }
.ex .nm small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.ex input { width: 100%; min-height: 38px; padding: 6px 8px; font-size: 15px; text-align: right; border-radius: 9px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); }
.ex.ok .nm { color: var(--dim); }
.alt { margin-top: 2px; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line2); font-size: 13px; color: var(--muted); }
.alt b { color: var(--ink); font-weight: 600; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp .tile b { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.crit { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crit li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.4; }
.crit li .ic { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; margin-top: 1px; }
.crit li.ok .ic { background: var(--ok); border-color: var(--ok); color: #10200f; }
.crit li small { display: block; color: var(--muted); font-size: 13px; }
.phases { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.phases li { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.phases li.cur { border-color: var(--accent); background: var(--accent-soft); }
.phases li b { display: block; font-size: 15px; }
.mini-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
button.tile { border: 0; cursor: pointer; display: block; width: 100%; }
