/* dirks3n – Design-System (hell)
 * Klares Weiß, Limetten-Akzent, Space Grotesk für Zahlen & Titel, Inter für Text.
 * Schriften liegen lokal auf dem Server (kein Google Fonts, kein Tracking).
 */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: light;
  /* Flächen */
  --bg: #f4f5f7;
  --surface-1: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e6e9ee;
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.12);
  /* Text */
  --text-primary: #0e1116;
  --text-secondary: #4a5260;
  --text-muted: #868e9b;
  /* Marke: Limette als Fläche (mit dunkler Schrift), dunkles Grün für Text-Akzente */
  --lime: #c6f432;
  --lime-ink: #0e1116;
  --lime-soft: rgba(166, 214, 20, 0.16);
  --accent-text: #4b7a00;
  --cyan: #0e86b8;
  /* Datenreihen – validiert (Farbsehschwäche & Kontrast) für hellen Grund */
  --series-1: #1f7fd1;
  --series-2: #5e8e12;
  --series-3: #7b61e8;
  --series-4: #d9621f;
  /* Status – immer mit Icon + Text */
  --good: #3b7d0c;
  --ok: #0e7fb0;
  --warning: #a96300;
  --critical: #d22d2d;

  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --tabbar-h: 68px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text-primary); }
body {
  font: 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 90% -140px, rgba(198, 244, 50, 0.28), transparent 60%),
    radial-gradient(700px 380px at -10% -80px, rgba(14, 134, 184, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
[hidden] { display: none !important; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) var(--gutter) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px);
}

/* ---------------------------------------------------------------- Kopfzeile */
.header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 2px 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.header h1 { font-family: var(--font-display); font-size: 34px; line-height: 1.05; margin: 4px 0 0; letter-spacing: -0.035em; font-weight: 700; }
.header h1 .accent { color: #9bd60a; }
.pillnav { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow); }
.iconbtn {
  width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text-primary);
}
.iconbtn:active { background: var(--surface-3); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- Karten */
.card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: .01em; }
.card-title .ico { color: var(--text-muted); }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 13px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); padding: 4px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }

/* ---------------------------------------------------------------- Bereitschaft (Hero) */
.hero { padding: 20px; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -40px -80px auto; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(198,244,50,.3)), transparent 65%); pointer-events: none;
}
.readiness { display: grid; grid-template-columns: 148px 1fr; gap: 18px; align-items: center; position: relative; z-index: 1; }
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 148px; height: 148px; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .value { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .score { font-family: var(--font-display); font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.ring .of { font-size: 11px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.status.good { color: var(--good); } .status.ok { color: var(--ok); } .status.warning { color: var(--warning); } .status.critical { color: var(--critical); } .status.none { color: var(--text-muted); }
.meters { display: grid; grid-template-columns: 1fr; gap: 9px; }
@media (min-width: 480px) { .meters { grid-template-columns: 1fr 1fr; gap: 12px 16px; } }
.meter .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.meter .lbl b { color: var(--text-primary); font-weight: 600; font-family: var(--font-display); }
.meter .bar { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter .bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2bb3d6, #9bd60a); }

/* ---------------------------------------------------------------- Plan des Tages */
.plan-top { display: flex; gap: 14px; align-items: center; }
.kind-ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: var(--lime); color: var(--lime-ink); border: 1px solid rgba(120,170,0,.35);
}
.kind-ico.rest { background: #ece8ff; color: #5b43d6; border-color: rgba(91,67,214,.2); }
.kind-ico.easy { background: #e2f3fa; color: #0b6f99; border-color: rgba(11,111,153,.2); }
.kind-ico .ico { width: 28px; height: 28px; stroke-width: 1.7; }
.plan-title { font-family: var(--font-display); font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; margin: 2px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.chip b { color: var(--text-primary); font-weight: 600; }
.chip .ico { width: 14px; height: 14px; }
.reason { color: var(--text-secondary); margin: 0; line-height: 1.55; }
.session { list-style: none; padding: 0; margin: 16px 0 0; counter-reset: ex; }
.session li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); counter-increment: ex; }
.session li::before {
  content: counter(ex); width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font: 600 12px var(--font-display); color: var(--text-secondary); background: var(--surface-2);
}
.session li span:last-child { color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.warn { margin-top: 12px; padding: 11px 13px; border-radius: 14px; background: #fff6e6; border: 1px solid #f6dfae; color: #7a4a00; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.engine { font-size: 12px; color: var(--text-muted); margin-top: 14px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; background: #7cc000; box-shadow: 0 0 0 3px rgba(124,192,0,.18); }
.dot.off { background: var(--text-muted); box-shadow: none; }

/* ---------------------------------------------------------------- Kacheln */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  background: var(--surface-1); box-shadow: var(--shadow);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 10px; min-width: 0; overflow: hidden;
}
.tile .label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.tile .label .ico { width: 15px; height: 15px; color: var(--text-muted); }
.tile .val { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .val small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; letter-spacing: 0; }
.tile .delta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark { display: block; width: 100%; height: 28px; margin-top: 6px; }

/* ---------------------------------------------------------------- Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); align-items: center; }
.list li:first-child { border-top: 0; padding-top: 2px; }
.list .time { color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 92px; font-size: 13px; font-family: var(--font-display); }
.list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .badge-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-secondary); flex: none; }

/* ---------------------------------------------------------------- Knöpfe & Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-primary); font-weight: 600; cursor: pointer; min-height: 46px; font-size: 15px;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--lime); border-color: #b2e01c; color: var(--lime-ink); box-shadow: 0 6px 16px rgba(150,200,0,.28); }
.btn.ghost { background: var(--surface-1); }
.btn.danger { color: var(--critical); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-primary); font-size: 16px; /* 16px: iOS zoomt sonst */
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #9bd60a; outline-offset: 1px; background: #fff; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-wrap: anywhere; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #2bb3d6, #9bd60a); border-radius: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 4px 0 14px; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; text-align: right; color: var(--text-primary); }

/* ---------------------------------------------------------------- Hinweis-Banner */
.banner { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); margin-bottom: 14px; background: #fff6e6; border: 1px solid #f6dfae; color: #7a4a00; }
.banner .grow { flex: 1; font-size: 14px; color: #7a4a00; }
.banner .btn { min-height: 38px; padding: 8px 14px; font-size: 14px; }

/* ---------------------------------------------------------------- Segment-Umschalter */
.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.segment button { border: 0; background: transparent; padding: 9px 4px; border-radius: 999px; color: var(--text-secondary); font-weight: 600; font-size: 14px; cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

/* ---------------------------------------------------------------- Diagramme */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chart-head .big { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.chart-head .big small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; letter-spacing: 0; }
.trend { font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; }
.trend .pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-weight: 600; background: var(--surface-2); }
.chart-box { position: relative; height: 180px; margin-top: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { color: var(--text-muted); font-size: 14px; padding: 18px 0 6px; text-align: center; }
details.table summary { cursor: pointer; color: var(--text-muted); font-size: 12px; margin-top: 10px; }
details.table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
details.table td, details.table th { padding: 5px 2px; border-bottom: 1px solid var(--border); text-align: right; }
details.table td:first-child, details.table th:first-child { text-align: left; }

/* ---------------------------------------------------------------- Login */
.login { max-width: 380px; margin: 14vh auto 0; }
.wordmark { font-family: var(--font-display); font-size: 52px; font-weight: 700; letter-spacing: -0.06em; line-height: 1; }
.wordmark span { color: var(--lime-ink); background: var(--lime); border-radius: 12px; padding: 0 6px; margin: 0 2px; display: inline-block; line-height: 1.05; }
.login .tagline { color: var(--text-secondary); margin: 10px 0 28px; font-size: 16px; }
.error { color: var(--critical); font-size: 14px; margin: 8px 0; }

/* ---------------------------------------------------------------- Tab-Leiste (schwebend) */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 10;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: min(380px, calc(100% - 32px)); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; gap: 4px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong); border-radius: 26px; box-shadow: var(--shadow-lg);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; border-radius: 20px; }
.tabbar .ico { width: 22px; height: 22px; }
.tabbar a.active { color: var(--lime-ink); background: var(--lime); }

/* ---------------------------------------------------------------- Diverses */
.boot { min-height: 70vh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: #7cc000; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 26px);
  background: #0e1116; border: 1px solid #0e1116; color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg);
}
.footer-info { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 20px; line-height: 1.8; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-lg); height: 150px; margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .readiness { grid-template-columns: 1fr; justify-items: center; }
  .header h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ================================================================ Training */
.tabbar { grid-template-columns: repeat(4, 1fr); width: min(420px, calc(100% - 24px)); }
.tabbar a { font-size: 10.5px; }

.thumb { position: relative; width: 56px; height: 56px; border-radius: 14px; overflow: hidden; background: var(--surface-2); flex: none; border: 1px solid var(--border); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 18px; }
.thumb .f2 { animation: frame 2.4s steps(1) infinite; }
@keyframes frame { 0% { opacity: 0; } 50% { opacity: 1; } }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); }

.ex-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.ex-row:first-child { border-top: 0; }
.ex-row .grow { flex: 1; min-width: 0; }
.ex-row .name { font-weight: 600; }
.ex-row .sub { font-size: 13px; color: var(--text-secondary); }
.ex-row .chev { color: var(--text-muted); }

.session-head { position: sticky; top: 0; z-index: 5; margin: 0 calc(-1 * var(--gutter)) 14px; padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) 12px;
  background: rgba(244,245,247,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; }
.session-head .grow { flex: 1; min-width: 0; }
.session-head .title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-head .clock { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 14px; }
.session-head .btn { min-height: 40px; padding: 8px 14px; }

.ex-card .ex-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; cursor: pointer; }
.ex-card .ex-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; line-height: 1.2; }
.ex-card .ex-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.sets { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.sets th { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; text-align: center; padding: 0 2px; }
.sets th:first-child, .sets td:first-child { text-align: left; width: 34px; }
.sets td { text-align: center; padding: 0 3px; vertical-align: middle; }
.sets tr.done td { background: rgba(198, 244, 50, .18); }
.sets tr.done td:first-child { border-radius: 12px 0 0 12px; }
.sets tr.done td:last-child { border-radius: 0 12px 12px 0; }
.sets .no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font: 600 12px var(--font-display); color: var(--text-secondary); }
.sets .target { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sets input { width: 100%; min-width: 0; max-width: 76px; padding: 9px 6px; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 17px; border-radius: 11px; }
.sets tr.done input { background: transparent; border-color: transparent; }
.check { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-1); display: grid; place-items: center; cursor: pointer; color: var(--text-muted); }
.check.on { background: var(--lime); border-color: #b2e01c; color: var(--lime-ink); }
.linkbtn { background: none; border: 0; color: var(--accent-text); font-weight: 600; padding: 8px 0; cursor: pointer; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.linkbtn.danger { color: var(--critical); }

.rest {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 15;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 22px);
  width: min(420px, calc(100% - 24px)); padding: 14px 16px; border-radius: 22px;
  background: #0e1116; color: #fff; box-shadow: var(--shadow-lg);
}
.rest .row1 { display: flex; align-items: center; gap: 12px; }
.rest .time { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.rest .lbl { font-size: 12px; color: #aab2bf; text-transform: uppercase; letter-spacing: .08em; }
.rest .next { font-size: 13px; color: #d5d9e0; margin-top: 2px; }
.rest .bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; margin: 12px 0 10px; }
.rest .bar > i { display: block; height: 100%; background: var(--lime); transition: width .25s linear; }
.rest .ctrl { display: flex; gap: 8px; }
.rest .ctrl button { flex: 1; min-height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; font-weight: 600; cursor: pointer; }
.rest .ctrl button.go { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.rest.finished { background: var(--lime); color: var(--lime-ink); }
.rest.finished .lbl, .rest.finished .next { color: #2c3a00; }

.chipsrow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 calc(-1 * var(--gutter)) 12px; padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: none; }
.chipsrow::-webkit-scrollbar { display: none; }
.chipsrow button { flex: none; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.chipsrow button[aria-pressed="true"] { background: #0e1116; color: #fff; border-color: #0e1116; }
.search { position: relative; margin-bottom: 12px; }
.search input { padding-left: 42px; border-radius: 14px; background: var(--surface-1); box-shadow: var(--shadow); }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.stat-grid b { display: block; font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; }
.stat-grid span { font-size: 11.5px; color: var(--text-secondary); }
.pref { display: flex; gap: 8px; }
.pref button { flex: 1; }
.pref button[aria-pressed="true"] { background: #0e1116; color: #fff; border-color: #0e1116; }
.steps-list { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.steps-list li { margin-bottom: 8px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text-secondary); margin: 6px 0 4px; background: none; border: 0; cursor: pointer; padding: 6px 0; font-size: 15px; }
.trophy { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(198,244,50,.2); margin-top: 8px; font-size: 14px; }

/* ================================================================ Ziel-Chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 120px; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.msg.assistant { align-self: flex-start; background: var(--surface-1); border: 1px solid var(--border); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.user { align-self: flex-end; background: #0e1116; color: #fff; border-bottom-right-radius: 6px; }
.msg.typing { color: var(--text-muted); }
.proposal { align-self: stretch; background: var(--surface-1); border: 2px solid #b2e01c; border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.goal-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.goal-item:first-of-type { border-top: 0; }
.goal-prio { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; font: 700 13px var(--font-display); background: var(--surface-2); color: var(--text-secondary); }
.goal-prio.p1 { background: var(--lime); color: var(--lime-ink); }
.goal-item .t { font-weight: 600; }
.goal-item .d { font-size: 13px; color: var(--text-secondary); }
.composer {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 12;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 22px);
  width: min(560px, calc(100% - 24px)); display: flex; gap: 8px; align-items: flex-end;
  padding: 8px; border-radius: 22px; background: rgba(255,255,255,.92); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.composer textarea { min-height: 44px; max-height: 140px; resize: none; border: 0; background: transparent; padding: 11px 10px; }
.composer textarea:focus { outline: none; background: transparent; }
.composer .btn { min-height: 44px; width: 44px; padding: 0; border-radius: 14px; flex: none; }
.goal-strip { display: flex; flex-direction: column; gap: 2px; }
