:root {
  /* Design „Warm“ hell, zugleich Grundwerte für alle Designs (Konzept Abschnitt 45) */
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --line: #e5e3de;
  --accent: #e4572e;
  --accent-text: #ffffff;
  --ok: #2f855a;
  --err: #c53030;
  --warn: #d69e2e;
  --warn-text: #b7791f;
  --chip: #efede8;
  --chart-1: #c7401a;
  --chart-2: #1f5fa8;
  --chart-3: #2f855a;
  --chart-muted: #8a8f98;
  /* Formen */
  --radius: 14px;
  --radius-box: 12px;
  --radius-ctl: 10px;
  --radius-btn: var(--radius-ctl);
  --radius-img: 8px;
  --radius-chip: 999px;
  --radius-sheet: 16px;
  --card-border-style: solid;
  /* Schrift */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --head-font: var(--font);
  --head-weight: 700;
  --head-transform: none;
  --head-spacing: normal;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
:root[data-mode="light"] { color-scheme: light; }
:root[data-mode="dark"] { color-scheme: dark; }

/* Warm dunkel: fest gewählt oder automatisch nach Systemeinstellung */
:root[data-mode="dark"] {
  --bg: #111418; --card: #1b2027; --text: #e8eaed; --muted: #9aa3ad; --line: #2c333c; --chip: #262c35;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #111418; --card: #1b2027; --text: #e8eaed; --muted: #9aa3ad; --line: #2c333c; --chip: #262c35;
  }
}

/* Ozean (hell) und Mitternacht (dunkel) */
:root[data-theme="ozean"] {
  --bg: #f2f6fc; --card: #ffffff; --text: #13284a; --muted: #5c6f8f; --line: #d9e3f2; --chip: #e3ecfa;
  --accent: #1d5fd1; --accent-text: #ffffff;
  --ok: #2f855a; --err: #c53030; --warn: #d69e2e; --warn-text: #b7791f;
  --chart-1: #1d5fd1; --chart-2: #e4572e; --chart-3: #2f855a; --chart-muted: #8a99b0;
  --radius: 18px; --radius-box: 14px; --radius-ctl: 12px; --radius-btn: 999px; --radius-img: 12px;
}
:root[data-theme="ozean"][data-mode="dark"] {
  --bg: #0f1a2e; --card: #16243d; --text: #e6edf8; --muted: #8fa3c2; --line: #263a5c; --chip: #22355a;
  --accent: #6cb4ff; --accent-text: #0f1a2e;
  --ok: #68d391; --err: #fc8181; --warn: #f6c453; --warn-text: #f6c453;
  --chart-1: #6cb4ff; --chart-2: #ff9f6b; --chart-3: #68d391; --chart-muted: #8fa3c2;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="ozean"]:not([data-mode="light"]) {
    --bg: #0f1a2e; --card: #16243d; --text: #e6edf8; --muted: #8fa3c2; --line: #263a5c; --chip: #22355a;
    --accent: #6cb4ff; --accent-text: #0f1a2e;
    --ok: #68d391; --err: #fc8181; --warn: #f6c453; --warn-text: #f6c453;
    --chart-1: #6cb4ff; --chart-2: #ff9f6b; --chart-3: #68d391; --chart-muted: #8fa3c2;
  }
}

/* Kreidetafel: immer dunkel, Tafelgrün, gelbe Kreide, gestrichelte Karten */
:root[data-theme="kreide"] {
  color-scheme: dark;
  --bg: #1f2b26; --card: #2a3832; --text: #eef0ea; --muted: #a9b5ad; --line: #4d5f56; --chip: #3a4a43;
  --accent: #f2c94c; --accent-text: #1f2b26;
  --ok: #8fdc9a; --err: #ff9a8a; --warn: #f2c94c; --warn-text: #f2c94c;
  --chart-1: #f2c94c; --chart-2: #7fc8f8; --chart-3: #8fdc9a; --chart-muted: #a9b5ad;
  --radius: 6px; --radius-box: 6px; --radius-ctl: 6px; --radius-img: 4px; --radius-chip: 4px; --radius-sheet: 8px;
  --card-border-style: dashed;
  --head-font: "Chalkboard SE", "Chalkboard", "Comic Sans MS", var(--font);
}

/* Eisen: immer dunkel, Stahlgrau, Lime, kantig, Überschriften in Großbuchstaben */
:root[data-theme="eisen"] {
  color-scheme: dark;
  --bg: #16181b; --card: #212428; --text: #f2f2f2; --muted: #9aa0a8; --line: #33373d; --chip: #33373d;
  --accent: #c6f432; --accent-text: #16181b;
  --ok: #7ee2a8; --err: #ff7b72; --warn: #ffb84d; --warn-text: #ffb84d;
  --chart-1: #c6f432; --chart-2: #5bc0eb; --chart-3: #ffb84d; --chart-muted: #9aa0a8;
  --radius: 4px; --radius-box: 4px; --radius-ctl: 2px; --radius-img: 2px; --radius-chip: 2px; --radius-sheet: 4px;
  --head-font: "DIN Condensed", "DIN Alternate", "Arial Narrow", var(--font);
  --head-weight: 700; --head-transform: uppercase; --head-spacing: .05em;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 var(--font);
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(72px + var(--safe-bottom));
}
h1, h2, h3, .session-date, .timeline-month {
  line-height: 1.2; margin: 0 0 .6rem;
  font-family: var(--head-font); font-weight: var(--head-weight); text-transform: var(--head-transform); letter-spacing: var(--head-spacing);
}
.session-date, .timeline-month { margin: 0; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { font-size: .9em; background: var(--chip); padding: .1em .35em; border-radius: 5px; word-break: break-all; }
small, .muted { color: var(--muted); }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
main { max-width: 760px; margin: 0 auto; padding: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar button {
  flex: 1; border: 0; background: none; color: var(--muted);
  padding: 8px 0 10px; font-size: .75rem; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button span { font-size: 1.3rem; filter: grayscale(1); opacity: .7; }
.tabbar button.active { color: var(--accent); font-weight: 600; }
.tabbar button.active span { filter: none; opacity: 1; }

.card {
  background: var(--card); border: 1px var(--card-border-style) var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 120px; }
.row > .shrink { flex: 0 0 auto; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* ---------- Formulare ---------- */
label { display: block; font-size: .85rem; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 9px 10px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: var(--radius-btn); padding: 9px 14px; min-height: 42px;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--err); }
button.small, .button.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
button.block, .button.block { width: 100%; }
button:disabled { opacity: .5; }
.icon-btn { border: 0; background: none; font-size: 1.3rem; min-height: 0; padding: 4px 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.msg { padding: 9px 12px; border-radius: var(--radius-ctl); font-size: .9rem; margin: 0 0 10px; }
.msg.error { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.msg.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.msg.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); }
.msg ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Training ---------- */
.session { cursor: pointer; }
.session-head { display: flex; gap: 12px; align-items: center; }
.session-head img { width: 64px; height: 48px; object-fit: cover; border-radius: var(--radius-img); flex: none; }
.session-date { font-weight: 700; }
.part-line { font-size: .9rem; margin-top: 2px; }
.chip {
  display: inline-block; background: var(--chip); border-radius: var(--radius-chip);
  padding: 1px 8px; font-size: .78rem; font-weight: 600; margin-right: 4px;
}
.result { font-weight: 700; color: var(--accent); }
.board-photo { width: 100%; border-radius: var(--radius-ctl); display: block; margin: 10px 0; }
.part-edit { border: 1px solid var(--line); border-radius: var(--radius-box); padding: 12px; margin: 10px 0; }
.lift-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.lift-row [name="exercise"] { grid-column: 1 / -1; }
.lift-row button { min-height: 0; padding: 0; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Körper ---------- */
.big-input { font-size: 1.6rem; font-weight: 700; text-align: center; }
.chart-box { position: relative; height: 230px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.delta-up { color: var(--err); }
.delta-down { color: var(--ok); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid figure { margin: 0; position: relative; }
.photo-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-img); display: block; }
.photo-grid figcaption { font-size: .72rem; color: var(--muted); text-align: center; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.compare img { width: 100%; border-radius: var(--radius-img); display: block; }
.slider-compare { position: relative; overflow: hidden; border-radius: var(--radius-ctl); aspect-ratio: 3/4; }
.slider-compare img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider-compare .top { position: absolute; inset: 0; }
.slider-compare .handle { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.5); pointer-events: none; }
.slider-compare .tag { position: absolute; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: var(--radius-chip); }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.photo-full { width: 100%; border-radius: var(--radius-ctl); display: block; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 4px 0; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 34px; padding: 4px; font-size: .85rem; }
.seg button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pre { white-space: pre-line; }
.progress { height: 8px; background: var(--chip); border-radius: var(--radius-chip); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: var(--radius-chip);
  font-size: .9rem; z-index: 50; max-width: 90vw; text-align: center;
}

/* ---------- Login / Installation ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card form > * + *, .auth-card > * + * { margin-top: 12px; }
.token { display: block; padding: 8px; font-size: 1rem; }
.secondary-login { border-top: 1px solid var(--line); padding-top: 12px; }
.auth-card form { display: block; }
.auth-card a { color: var(--accent); font-size: .9rem; }
.box-tag { font-size: .8rem; color: var(--muted); }
.map { height: 300px; border-radius: var(--radius-ctl); overflow: hidden; z-index: 0; }
.leaflet-container { font: inherit; background: var(--chip); }
.box-edit { border: 1px solid var(--accent); border-radius: var(--radius-box); padding: 12px; margin-top: 10px; }

/* ===== Version 3 ===== */
.tabbar button, .tabbar a { flex: 1; border: 0; background: none; color: var(--muted); padding: 8px 0 10px; font: inherit; font-size: .75rem; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; }
.tabbar .active { color: var(--accent); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }
.seg { display: flex; gap: 0; border: 1px solid var(--text); border-radius: var(--radius-ctl); overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; min-height: 40px; padding: 4px 8px; font-size: .85rem; background: var(--card); color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 40px; padding: 4px 12px; border-radius: var(--radius-chip); font-size: .85rem; font-weight: 500; }
.chip-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.kraft { background: var(--text); color: var(--bg); }
.chip.max { background: var(--accent); color: var(--accent-text); }
.entry { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.set-grid { display: grid; gap: 6px; align-items: center; }
.set-grid .num { font-weight: 600; color: var(--muted); font-size: .85rem; text-align: center; }
.last-box { background: var(--bg); border-radius: var(--radius-ctl); padding: 8px 10px; font-size: .85rem; }
.warn-mark { color: var(--warn-text); font-size: .8rem; }
.new-ex { border: 1px dashed var(--accent); border-radius: var(--radius-ctl); padding: 10px; }
.logo { width: 52px; height: 52px; border-radius: var(--radius-ctl); object-fit: cover; background: var(--chip); flex: none; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--muted); }
.place-row { display: flex; gap: 12px; align-items: center; }
.timeline-month { font-weight: 700; font-size: .9rem; margin: 14px 0 6px; }
.photo-grid figure.sel img { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo-grid figure { cursor: pointer; }
.photo-grid figcaption b { color: var(--text); }
.upload-row { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px; align-items: center; }
.upload-row img { width: 64px; height: 84px; object-fit: cover; border-radius: var(--radius-img); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.right { text-align: right; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: var(--radius-chip); padding: 1px 8px; border: 1px solid currentColor; }
.hidden { display: none !important; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--card); width: 100%; max-width: 760px; max-height: 88vh; overflow: auto; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: 16px 16px calc(16px + var(--safe-bottom)); }

/* ---------- Version 3.1 ---------- */
body.no-scroll { overflow: hidden; }
.sheet { display: flex; flex-direction: column; height: 85vh; }
.sheet-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); margin-top: 8px; }
.sheet-item { display: flex; width: 100%; text-align: left; justify-content: flex-start; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 4px; min-height: 52px; font-weight: 400; }
.sheet-item.new { color: var(--accent); font-weight: 600; }
.ex-pick { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; font-weight: 600; gap: 8px; }
.scale-box { border: 1px dashed var(--line); border-radius: var(--radius-box); padding: 10px; }
.scale-row { display: flex; gap: 10px; align-items: flex-end; }
/* Nur für Bildschirmleser (VoiceOver): unsichtbar, aber vorgelesen */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* WOD der Box und Box-Verwaltung (Konzept Abschnitte 29 bis 31) */
.wod-head { display: flex; gap: 12px; align-items: center; }
.wod-part { border-top: 1px solid var(--line); padding-top: 10px; }
.wod-desc { white-space: pre-wrap; margin-top: 6px; line-height: 1.5; }
.wod-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* Runde Icon-Knöpfe neben dem Box-Namen: Website, Instagram, Karte, KI (Lesehinweise) */
.wod-links .icon-link { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--chip); color: var(--text); text-decoration: none; }
.wod-links .icon-link:active { color: var(--accent); border-color: var(--accent); }
.wod-links .icon-link.ai { color: var(--accent); }
.box-map { height: 260px; border-radius: var(--radius-box); overflow: hidden; }
/* Leaflet-Ebenen bleiben unter der unteren Leiste */
.leaflet-container { z-index: 0; }
.more-sheet { max-height: 70vh; }
.more-item { gap: 12px; align-items: center; font-weight: 500; }
.more-item svg { width: 22px; height: 22px; flex: none; }
.more-item.active { color: var(--accent); }
.tabbar [data-more].active { color: var(--accent); }
/* Zeile antippen (Konzept Abschnitt 27) */
.row-pick { position: relative; line-height: 0; }
.row-pick.picking { cursor: pointer; outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--radius-ctl); }
/* Vollbild zum Markieren mit eigenem Foto-Zoom: die Leiste zoomt nie mit */
.rowfs { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.rowfs-help { margin: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; font-size: .85rem; line-height: 1.35; text-align: center; color: rgba(255,255,255,.8); }
.rowfs-help.warn { color: #fbd38d; font-weight: 600; }
.rowfs-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: crosshair; touch-action: none; }
.rowfs-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; line-height: 0; --s: 1; }
.rowfs-layer img { width: 100%; height: 100%; display: block; pointer-events: none; -webkit-touch-callout: none; }
.rowfs .row-mark { border-width: calc(3px / var(--s)); border-radius: calc(6px / var(--s)); }
.rowfs-bar { display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #111; }
.rowfs-bar button { flex: 1; }
.rowfs-bar .rowfs-zoom { flex: 0 0 48px; font-size: 1.25rem; padding: 0; }
.row-pick img { width: 100%; height: auto; border-radius: var(--radius-ctl); display: block; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.row-mark { position: absolute; border: 3px solid var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 15%, transparent); pointer-events: none; }
/* Eigenes Workout statt WOD (Konzept Abschnitt 46): blau gestrichelt, damit es sich von der eigenen Zeile abhebt */
.row-mark.custom { border-style: dashed; border-color: #2f7fd8; background: color-mix(in srgb, #2f7fd8 12%, transparent); }
.badge.custom-wod { color: #2f7fd8; }
/* Unsichere Stellen (Konzept Abschnitt 28) */
.unsure { box-shadow: 0 0 0 2px var(--warn); border-radius: var(--radius-ctl); }
/* Equipment-Chips (Konzept Abschnitt 26): Pille mit Icon und Kürzel, am WOD-Teil mit Wert */
.eq-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 12px; border-radius: var(--radius-chip); font-size: .85rem; font-weight: 600; }
.eq-chip .eq-icon { flex: none; }
.eq-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.eq-chip.sug { background: var(--card); color: var(--text); border: 1px solid var(--accent); }
.eq-chip.sug .eq-val { color: var(--accent); }
.eq-chip.add { border-style: dashed; color: var(--muted); background: transparent; }
/* Aktiver Chip am WOD-Teil: Hauptteil öffnet die Eingabe, × wählt ab */
.eq-pair { padding: 0; gap: 0; overflow: hidden; border: 1px solid var(--text); }
.eq-pair > button { background: none; border: 0; border-radius: 0; color: inherit; min-height: 40px; font: inherit; margin: 0; box-shadow: none; }
.eq-pair .eq-main { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 12px; }
.eq-pair .eq-x { padding: 4px 12px 4px 8px; font-size: 1.15rem; line-height: 1; border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.eq-pair.sug { border-color: var(--accent); }
.eq-rx { font-size: .7rem; font-weight: 700; padding: 1px 6px; margin-left: 6px; border-radius: var(--radius-chip); background: var(--accent); color: var(--accent-text); }
.check-row { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.check-row input { width: auto; margin: 0; }
.eq-derived { display: block; margin-top: 6px; }
.eq-val { font-weight: 400; padding-left: 7px; margin-left: 2px; border-left: 1px solid currentColor; }
.eq-box { margin-top: 8px; }
.eq-edit { border: 1px dashed var(--line); border-radius: var(--radius-box); padding: 10px; margin-top: 8px; }
.eq-filter { margin: 0 0 10px; }
.eq-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 40px; border-radius: var(--radius-ctl); background: var(--chip); font-weight: 700; font-size: .85rem; align-self: flex-end; }
details.per-ex > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.bubble { padding: 10px 14px; border-radius: var(--radius); max-width: 92%; line-height: 1.45; }
.bubble p { margin: 0 0 .4rem; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: .2rem 0 .4rem; padding-left: 18px; }
.bubble.user { align-self: flex-end; margin-left: auto; background: var(--text); color: var(--bg); white-space: pre-wrap; }
.bubble.assistant { background: var(--card); border: 1px solid var(--line); }
.bubble.assistant a, .answer a { color: var(--accent); font-weight: 600; }
#conv { display: flex; flex-direction: column; margin-bottom: 12px; }
.answer p { margin: 0 0 .4rem; }
.answer ul { margin: .2rem 0; padding-left: 18px; }

/* ---------- Verwaltung als Kacheln (Abschnitt 40) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
  text-align: left; min-height: 128px; padding: 14px; border-radius: var(--radius); font-weight: 400;
}
.tile:active { transform: scale(.98); }
.tile b { font-size: 1rem; line-height: 1.25; }
.tile small { line-height: 1.3; }
.tile-icon {
  display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 6px;
  border-radius: var(--radius-box); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tile-count {
  position: absolute; top: 12px; right: 12px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-chip);
  background: var(--accent); color: var(--accent-text); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.tile .progress { display: block; width: 100%; margin-top: auto; }
.tile .progress > span { display: block; height: 100%; background: var(--accent); }

/* ---------- Bandfarben je Box (Abschnitt 44) ---------- */
.band-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.band-btns { display: flex; gap: 4px; }
.band-btns button { min-width: 36px; padding: 4px 8px; }
.band-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); vertical-align: middle; }
@media (max-width: 420px) { .band-row { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1fr); } .band-btns { grid-column: 2 / -1; justify-content: flex-end; } }

/* ---------- Offizielles WOD (Abschnitt 43) ---------- */
.we-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.we-thumb { position: relative; width: 96px; height: 96px; }
.we-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-ctl); display: block; }
.we-thumb button { position: absolute; top: 4px; right: 4px; min-width: 28px; min-height: 28px; padding: 0; }

/* ---------- Design wählen (Abschnitt 45) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-tile {
  flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px;
  text-align: left; padding: 8px; border-radius: var(--radius-box); font-weight: 400;
}
.theme-tile.on { border: 2px solid var(--accent); padding: 7px; }
.theme-tile b { font-size: .95rem; margin-top: 4px; }
.theme-tile small { font-size: .75rem; line-height: 1.25; }
.theme-prev { display: flex; width: 100%; height: 58px; border-radius: var(--radius-img); overflow: hidden; border: 1px solid var(--line); }
.theme-sw { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; }
.theme-sw > span { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 6px; }
.theme-sw i { display: block; height: 5px; border-radius: 3px; }
.theme-sw i + i { height: 8px; width: 60%; }
