/* ------------------------------------------------------------ Tokens */
:root {
  color-scheme: light dark;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --surface-3: #e4e7e2;
  --text: #121614;
  --text-2: #565d58;
  --text-3: #858c87;
  --line: #e2e5e0;
  --accent: #0f7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #dff1ea;
  --accent-text: #0b6a4f;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --danger: #b4321f;
  --danger-soft: #fbe6e2;
  --z: #d4561f;        /* zügig */
  --z-soft: #fbe5da;
  --l: #2a6fc4;        /* locker / Pause */
  --l-soft: #e1ecfa;
  --chart-series: #0f7a5c;
  --chart-band: rgba(18, 22, 20, 0.06);
  --chart-grid: #e8eae6;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .04);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1110;
    --surface: #181c1a;
    --surface-2: #222826;
    --surface-3: #2c3330;
    --text: #eef1ee;
    --text-2: #a9b1ab;
    --text-3: #717a74;
    --line: #2a302d;
    --accent: #36b585;
    --accent-ink: #04241a;
    --accent-soft: #15332a;
    --accent-text: #5fd0a4;
    --warn: #f0b04a;
    --warn-soft: #3a2c12;
    --danger: #ff8a73;
    --danger-soft: #3d1c16;
    --z: #f07a45;
    --z-soft: #3d2216;
    --l: #5b9ef0;
    --l-soft: #172a42;
    --chart-series: #2fa77a;
    --chart-band: rgba(238, 241, 238, 0.07);
    --chart-grid: #2a302d;
    --shadow: none;
  }
}

/* ------------------------------------------------------------ Basis */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#view {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}
body.no-tabs #view { padding-bottom: calc(var(--safe-bottom) + 24px); }

.splash { min-height: 70dvh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Kopf */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 2px 16px; }
.page-head .eyebrow { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.page-head h1 { font-size: 32px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; }
.page-head .sub { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: var(--surface); color: var(--text-2); display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin: 4px 0 8px; }
.back-link svg { width: 18px; height: 18px; }
svg.inline-ic { width: 16px; height: 16px; vertical-align: -3px; }

/* ------------------------------------------------------------ Karten */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { font-size: 17px; font-weight: 650; }
.card-head .meta { font-size: 14px; color: var(--text-3); }
.section-title { font-size: 13px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin: 22px 4px 8px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; color: var(--text-3); }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--text); font-size: 15px;
}
.banner.warn { background: var(--warn-soft); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--accent-text); }
.banner.warn svg { color: var(--warn); }
.banner b { font-weight: 650; }

/* ------------------------------------------------------------ Buttons & Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 16px;
  transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent-text); padding-inline: 8px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 15px; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

label.field { display: block; }
label.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin: 0 0 6px 2px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); font-size: 17px; outline: none; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 80px; resize: vertical; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858c87' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px;
}
.input:focus { border-color: var(--accent); background-color: var(--surface); }
.input[type="time"], .input[type="date"] { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-actions { margin-top: 16px; }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 8px 6px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--text-2);
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Schalter */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--surface-3); border-radius: 31px; transition: background .2s; }
.switch .track::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list > li:last-child { padding-bottom: 2px; }

/* Abhak-Kreis */
.check {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  border: 2px solid var(--surface-3); background: transparent; display: grid; place-items: center; padding: 0;
  transition: background .15s, border-color .15s;
}
.check svg { width: 16px; height: 16px; color: var(--accent-ink); opacity: 0; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on svg { opacity: 1; }

/* Fortschrittsbalken */
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 8px; transition: width .3s ease; }
.bar.big { height: 10px; }

/* Badges */
.badge {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font: 700 15px/1 var(--font-round); background: var(--accent-soft); color: var(--accent-text);
}
.badge.done { background: var(--accent); color: var(--accent-ink); }
.badge svg { width: 22px; height: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-2);
}
.pill.ok { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill svg { width: 14px; height: 14px; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.stat .value { font: 700 26px/1.15 var(--font-round); letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.stat .delta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.stat .delta.good { color: var(--accent-text); }

/* Tagesauswahl */
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.day-chips a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 12px;
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
}
.day-chips a small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.day-chips a.today { color: var(--accent-text); }
.day-chips a.active { background: var(--accent); color: var(--accent-ink); }
.day-chips a.active small { color: inherit; opacity: .8; }

/* Wochenstreifen Training */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-strip .d { text-align: center; }
.week-strip .d .lbl { font-size: 12px; color: var(--text-3); font-weight: 600; }
.week-strip .d .dot {
  margin: 6px auto 0; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font: 700 12px/1 var(--font-round); background: var(--surface-2); color: var(--text-3);
}
.week-strip .d .dot.plan { background: var(--accent-soft); color: var(--accent-text); }
.week-strip .d .dot.done { background: var(--accent); color: var(--accent-ink); }
.week-strip .d .dot svg { width: 16px; height: 16px; }
.week-strip .d.today .lbl { color: var(--accent-text); }

/* Mahlzeiten */
.meal { display: flex; gap: 12px; align-items: flex-start; }
.meal .slot { font-size: 13px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.meal .dish { font-weight: 600; }
.meal .amount { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.meal .macros { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.meal.eaten .dish { color: var(--text-2); }

/* Wasser */
.glasses { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 12px 0 4px; }
.glasses i { height: 22px; border-radius: 5px; background: var(--surface-2); transition: background .2s; }
.glasses i.on { background: var(--l); }
.counter { display: flex; align-items: center; gap: 12px; }
.counter .val { font: 700 28px/1 var(--font-round); min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; font-size: 22px; font-weight: 600;
}
.round-btn svg { width: 20px; height: 20px; }

/* Einkauf */
.shop-item { cursor: pointer; user-select: none; }
.shop-item .txt { flex: 1; min-width: 0; }
.shop-item.on .txt { color: var(--text-3); text-decoration: line-through; }
.del-btn { border: 0; background: transparent; color: var(--text-3); padding: 6px; border-radius: 8px; }
.del-btn svg { width: 18px; height: 18px; }

/* Übungen */
.ex-img { background: #fff; border-radius: var(--radius-sm); overflow: hidden; }
.ex-img img { width: 100%; height: auto; aspect-ratio: 558 / 242; }
:root:not([data-theme="light"]) .ex-img { box-shadow: inset 0 0 0 1px var(--line); }
details.ex { border-top: 1px solid var(--line); }
details.ex:first-of-type { border-top: 0; }
details.ex summary {
  list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer;
}
details.ex summary::-webkit-details-marker { display: none; }
details.ex summary .n {
  width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2); flex: none;
  display: grid; place-items: center; font: 700 13px/1 var(--font-round); color: var(--text-2);
}
details.ex summary .chev { margin-left: auto; color: var(--text-3); transition: transform .2s; }
details.ex summary .chev svg { width: 18px; height: 18px; }
details.ex[open] summary .chev { transform: rotate(90deg); }
details.ex .body { padding: 0 0 14px; }
details.ex .body p { font-size: 15px; color: var(--text-2); margin-top: 10px; }

details.plain > summary { cursor: pointer; font-weight: 600; color: var(--accent-text); list-style: none; padding: 4px 0; }
details.plain > summary::-webkit-details-marker { display: none; }
details.plain[open] > summary { margin-bottom: 10px; }

ul.bullets { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 15px; }
ul.bullets li + li { margin-top: 6px; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.tbl th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px 0; white-space: nowrap; }
table.tbl td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl tr.current td { font-weight: 650; }

/* Verlauf */
.history-item .title { font-weight: 600; }
.history-item .detail { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.history-item .note { font-size: 14px; color: var(--text-3); font-style: italic; margin-top: 2px; }

/* ------------------------------------------------------------ Chart */
.chart { position: relative; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .band { fill: var(--chart-band); }
.chart .line { fill: none; stroke: var(--chart-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--chart-series); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--text); font-size: 12px; font-weight: 650; font-family: var(--font); }
.chart .cross { stroke: var(--text-3); stroke-width: 1; }
.chart .hover-pt { fill: var(--chart-series); stroke: var(--surface); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 0; pointer-events: none; background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.15);
  white-space: nowrap; transform: translateX(-50%);
}
.chart-tip b { font-size: 15px; display: block; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--text-2); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.chart-legend .k { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .k i { display: inline-block; width: 16px; height: 2px; background: var(--chart-series); border-radius: 2px; }
.chart-legend .k i.band { height: 10px; background: var(--chart-band); border-radius: 3px; }

/* ------------------------------------------------------------ Geführtes Training */
.run { min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 36px); display: flex; flex-direction: column; }
.run-top { display: flex; align-items: center; gap: 10px; }
.run-top .grow { text-align: center; }
.run-top .section { font-weight: 650; font-size: 15px; }
.run-top .step-count { font-size: 13px; color: var(--text-3); }
.run-progress { height: 4px; border-radius: 4px; background: var(--surface-2); margin: 12px 0 16px; overflow: hidden; }
.run-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.run-main { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.run-label { font-size: 14px; font-weight: 600; color: var(--text-3); text-align: center; }
.run-title { font-size: 26px; font-weight: 750; line-height: 1.15; text-align: center; letter-spacing: -.01em; }
.run-how { font-size: 15px; color: var(--text-2); text-align: center; }
.run-studio { font-size: 14px; text-align: center; }
.run-ring { position: relative; width: 210px; height: 210px; margin: 4px auto; }
.run-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.run-ring .track { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.run-ring .prog { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.run-ring .time {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 56px/1 var(--font-round); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.run-ring .time small { display: block; font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; text-align: center; margin-top: 6px; }
.run.rest .run-ring .prog { stroke: var(--l); }
.run.z .run-ring .prog { stroke: var(--z); }
.run.l .run-ring .prog { stroke: var(--l); }
.run.paused .run-ring .time { opacity: .45; }
.run-reps { text-align: center; font: 700 44px/1 var(--font-round); margin: 8px 0; }
.run-reps small { display: block; font: 600 15px/1.3 var(--font); color: var(--text-2); margin-top: 6px; }
.run-next { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow); }
.run-next .ex-img { width: 96px; flex: none; }
.run-next .lbl { font-size: 12px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.run-next .name { font-weight: 650; }
.run-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; margin-top: 18px; }
.run-controls .btn { min-height: 56px; }
.run-controls .btn.primary { font-size: 18px; }
.run-elapsed { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 10px; font-variant-numeric: tabular-nums; }
.phase-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; margin: 0 auto; }
.phase-pill.work { background: var(--accent-soft); color: var(--accent-text); }
.phase-pill.rest { background: var(--l-soft); color: var(--l); }
.phase-pill.z { background: var(--z-soft); color: var(--z); }
.phase-pill.l { background: var(--l-soft); color: var(--l); }

.overview-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.overview-steps li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.overview-steps li:first-child { border-top: 0; }
.overview-steps li::before {
  counter-increment: s; content: counter(s);
  width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text);
  display: grid; place-items: center; font: 700 13px/1 var(--font-round);
}

/* ------------------------------------------------------------ Login */
.login { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 380px; margin: 0 auto; }
.login .logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 4px; box-shadow: var(--shadow); }
.login h1 { text-align: center; font-size: 28px; font-weight: 750; }
.login p { text-align: center; color: var(--text-2); }
.error-text { color: var(--danger); font-size: 14px; text-align: center; min-height: 20px; }

/* ------------------------------------------------------------ Tab-Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, env(safe-area-inset-left)) calc(var(--safe-bottom) + 4px) max(8px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
  font-size: 11px; font-weight: 600; color: var(--text-3);
}
.tabbar a .ti svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent-text); }

/* ------------------------------------------------------------ Toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px);
  animation: toast-in .2s ease;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (min-width: 520px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
