/* translateandlearn – Design-System. Keine Inline-Styles (CSP): dynamische Werte über SVG-Attribute. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e4e6ef;
  --border-strong: #d2d5e2;
  --text: #151826;
  --text-2: #464b63;
  --muted: #767c95;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #ffffff;
  --success: #16a34a;
  --success-soft: #e7f6ec;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --warning: #c2710c;
  --warning-soft: #fdf3e1;
  --teal: #0d9488;
  --teal-soft: #e2f5f3;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;

  --p0: #94a3b8;
  --p1: #60a5fa;
  --p2: #3b82f6;
  --p3: #6366f1;
  --p4: #8b5cf6;
  --p5: #14b8a6;
  --p6: #22c55e;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgb(20 22 40 / 6%);
  --shadow: 0 1px 2px rgb(20 22 40 / 5%), 0 10px 30px -14px rgb(20 22 40 / 18%);
  --ring: 0 0 0 3px rgb(79 70 229 / 22%);
  --header-h: 64px;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e16; --surface: #141724; --surface-2: #1b1f30; --border: #252a3d; --border-strong: #343a52;
    --text: #eceef7; --text-2: #b6bbd1; --muted: #848aa5;
    --accent: #818cf8; --accent-hover: #a5b4fc; --accent-soft: #1e2246; --accent-text: #0c0e16;
    --success: #4ade80; --success-soft: #11261a; --danger: #f87171; --danger-soft: #2b1517;
    --warning: #fbbf24; --warning-soft: #2a210e; --teal: #2dd4bf; --teal-soft: #0f2624;
    --violet: #a78bfa; --violet-soft: #221a3b;
    --p0: #64748b;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px -16px rgb(0 0 0 / 60%);
    --ring: 0 0 0 3px rgb(129 140 248 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e16; --surface: #141724; --surface-2: #1b1f30; --border: #252a3d; --border-strong: #343a52;
  --text: #eceef7; --text-2: #b6bbd1; --muted: #848aa5;
  --accent: #818cf8; --accent-hover: #a5b4fc; --accent-soft: #1e2246; --accent-text: #0c0e16;
  --success: #4ade80; --success-soft: #11261a; --danger: #f87171; --danger-soft: #2b1517;
  --warning: #fbbf24; --warning-soft: #2a210e; --teal: #2dd4bf; --teal-soft: #0f2624;
  --violet: #a78bfa; --violet-soft: #221a3b;
  --p0: #64748b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px -16px rgb(0 0 0 / 60%);
  --ring: 0 0 0 3px rgb(129 140 248 / 30%);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-24 { width: 24px; height: 24px; }
.icon-28 { width: 28px; height: 28px; }

/* ---------- App-Shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-header .inner {
  max-width: 1080px; height: var(--header-h); margin: 0 auto;
  padding: 0 max(var(--s5), env(safe-area-inset-right)) 0 max(var(--s5), env(safe-area-inset-left));
  display: flex; align-items: center; gap: var(--s5);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.topnav { display: flex; gap: 2px; flex: 1; }
.topnav a {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border-radius: 10px; color: var(--text-2); font-weight: 500;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 11.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}

.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--violet-soft); color: var(--violet); font-weight: 700; font-size: 14px; text-transform: uppercase;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: var(--s2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
}
.menu .who { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); }
.menu .who strong { display: block; }
.menu a, .menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px var(--s3); border-radius: var(--r-sm);
  background: none; border: 0; color: var(--text-2); font: inherit; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }

.container { max-width: 1080px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
.container.narrow { max-width: 720px; }

.tabbar { display: none; }

@media (max-width: 767px) {
  .app-header .inner { padding: 0 var(--s4); gap: var(--s3); }
  .topnav { display: none; }
  .container { padding: var(--s5) var(--s4) calc(var(--tabbar-h) + var(--s6) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600; position: relative;
  }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar .count { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; }
  h1 { font-size: 23px; }
}

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Panels & Layout ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: var(--s5);
}
.panel + .panel, .stack-lg > * + * { margin-top: var(--s5); }
.panel-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.panel-head .grow { flex: 1; min-width: 0; }
.panel-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.grid-2 > .panel + .panel { margin-top: 0; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: var(--s4); }

.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: var(--s4); }

.tile {
  width: 40px; height: 40px; border-radius: var(--r); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.tile.lg { width: 56px; height: 56px; border-radius: var(--r-lg); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-gray { background: var(--surface-2); color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14.5px; line-height: 1; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: var(--accent-text);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: color-mix(in srgb, var(--success) 85%, #000); color: #fff; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 13px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.bordered { border-color: var(--border); }
.kbd {
  font: 600 11px/1 "Inter", system-ui; padding: 3px 6px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent); opacity: .75;
}

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 11px; padding: 0 14px; height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767c95' stroke-width='2' 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;
}
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.input-icon .input { padding-left: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none;
  transition: background-color .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .2s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; flex-wrap: wrap;
}
.segmented button, .segmented a {
  height: 34px; min-width: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented [aria-pressed="true"], .segmented [aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Meldungen ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r);
  font-size: 14px; border: 1px solid transparent; margin-bottom: var(--s4);
}
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert .body { color: var(--text); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Chips, Tags, Phasen ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
a.chip:hover { color: var(--text); background: var(--border); }
.chip.active { background: var(--accent-soft); color: var(--accent); }

.ph-0 { --c: var(--p0); } .ph-1 { --c: var(--p1); } .ph-2 { --c: var(--p2); } .ph-3 { --c: var(--p3); }
.ph-4 { --c: var(--p4); } .ph-5 { --c: var(--p5); } .ph-6 { --c: var(--p6); }
.phase-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 80%, var(--text)); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.phase-chip::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--c); }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--c); flex: none; }
.phase-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.phase-pills a {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600;
}
.phase-pills a:hover { border-color: var(--border-strong); color: var(--text); }
.phase-pills a[aria-current="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.phase-pills .n { color: var(--muted); font-weight: 500; }

/* ---------- Kennzahlen & Fortschritt ---------- */
.ring { display: block; }
.ring .track { stroke: var(--surface-2); }
.ring .value { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }
.ring.done .value { stroke: var(--success); }
.ring-wrap { position: relative; width: 132px; height: 132px; flex: none; }
.ring-wrap .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-wrap .pct { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.ring-wrap .sub { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

@media (max-width: 420px) {  .ring-wrap { margin: 0 auto; } }

.bar { display: block; width: 100%; height: 8px; }
.bar .track { fill: var(--surface-2); }
.bar .value { fill: var(--accent); }
.bar.done .value { fill: var(--success); }
.phase-rows { display: grid; gap: 10px; }
.phase-row { display: grid; grid-template-columns: 86px 1fr 34px; align-items: center; gap: var(--s3); color: var(--text-2); font-size: 13.5px; }
.phase-row:hover { color: var(--text); }
.phase-row .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.phase-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.phase-row svg { height: 8px; }
.phase-row .value { fill: var(--c); }
.phase-row .track { fill: var(--surface-2); }

/* ---------- Listen ---------- */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.list-panel { padding: 0; overflow: hidden; }
.list-panel .item + .item { border-top: 1px solid var(--border); }
.item { display: flex; align-items: center; gap: var(--s4); padding: 14px var(--s5); color: var(--text); }
a.item:hover { background: var(--surface-2); color: var(--text); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .title .arrow { color: var(--muted); margin: 0 6px; font-weight: 400; }
.item .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.item .side { display: flex; align-items: center; gap: 6px; flex: none; }
.item .chev { color: var(--muted); }
@media (max-width: 600px) {
  .item { padding: 12px var(--s4); align-items: flex-start; }
  .item .side { flex-direction: column; align-items: flex-end; }
  .item .chev { display: none; }
}

.toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s4); }
.toolbar .input-icon { flex: 1 1 260px; }
.toolbar .select { width: auto; flex: 0 1 190px; }

.empty { text-align: center; padding: var(--s7) var(--s5); }
.empty .tile { margin: 0 auto var(--s4); }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: var(--s4); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

details.disclosure > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-weight: 600; font-size: 13.5px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform .15s; width: 16px; height: 16px; }
details.disclosure[open] > summary .icon { transform: rotate(180deg); }
details.disclosure > .content { margin-top: var(--s4); }

/* ---------- Übersetzer ---------- */
.translator .langs { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2); align-items: center; margin-bottom: var(--s3); }
.translator .textarea { min-height: 110px; font-size: 16px; }
.translator .actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.result { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px dashed var(--border-strong); }
.result .answer { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Lernen ---------- */
.learn-top { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.learn-top .bar { flex: 1; height: 10px; }
.learn-top .bar rect { rx: 5px; }
.learn-top .pct { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.quiz { padding: var(--s6); text-align: center; }
.quiz .meta { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--s5); }
.lang { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .04em; }
.lang .icon { width: 14px; height: 14px; color: var(--muted); }
.prompt { font-size: clamp(26px, 5vw, 36px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; overflow-wrap: anywhere; }
.note { margin-top: var(--s3); color: var(--muted); }
.quiz form { margin-top: var(--s6); }
.answer-input { height: 56px; font-size: 18px; text-align: center; border-radius: 14px; }
.quiz .buttons { display: flex; gap: var(--s3); justify-content: center; margin-top: var(--s4); flex-wrap: wrap; }
.quiz .buttons .btn { min-width: 160px; }
@media (max-width: 600px) { .quiz { padding: var(--s5) var(--s4); } .quiz .buttons .btn { flex: 1; min-width: 0; } }

.verdict { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: var(--s4); }
.verdict.ok { color: var(--success); }
.verdict.bad { color: var(--danger); }
.verdict.check { color: var(--warning); }
.quiz.is-ok { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); box-shadow: 0 0 0 4px var(--success-soft), var(--shadow-sm); }
.quiz.is-bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); box-shadow: 0 0 0 4px var(--danger-soft), var(--shadow-sm); }
.quiz.is-check { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); box-shadow: 0 0 0 4px var(--warning-soft), var(--shadow-sm); }
.compare { display: grid; gap: var(--s3); margin: var(--s5) auto 0; max-width: 520px; text-align: left; }
.compare .box { padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); }
.compare .box.solution { background: var(--success-soft); }
.compare .box.given { background: var(--surface-2); }
.compare .k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.compare .v { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; color: var(--text); }
.phase-move { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s4); color: var(--muted); font-size: 13.5px; }

.next-row { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin-top: var(--s6); flex-wrap: wrap; }
.countdown { position: relative; width: 52px; height: 52px; border: 0; padding: 0; background: none; cursor: pointer; color: var(--text); }
.countdown svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.countdown .track { stroke: var(--surface-2); }
.countdown .value { stroke: var(--success); }
.countdown .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown .num .icon { width: 18px; height: 18px; }
.countdown.paused .value { stroke: var(--muted); }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--s5) var(--s4); }
.auth .panel { width: 100%; max-width: 400px; padding: var(--s6); box-shadow: var(--shadow); }
.auth .logo { width: 56px; height: 56px; border-radius: 16px; display: block; margin-bottom: var(--s5); }
.auth h1 { margin-bottom: 6px; }
.auth .lead { color: var(--muted); margin-bottom: var(--s5); }

/* ---------- Sonstiges ---------- */

.interval-row { display: grid; grid-template-columns: 110px 96px 1fr; gap: var(--s3); align-items: center; }
@media (max-width: 480px) { .interval-row { grid-template-columns: 90px 80px 1fr; } }
.direction-phase { display: grid; gap: var(--s2); padding: var(--s4); border-radius: var(--r); background: var(--surface-2); }
.direction-phase + .direction-phase { margin-top: var(--s3); }

.footer-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: var(--s6); }
.center { display: flex; justify-content: center; }
.icon.flip { transform: scaleX(-1); }

.brand .amp { color: var(--accent); font-weight: 600; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 6px; }
.label .icon, .field > span .icon { width: 16px; height: 16px; vertical-align: -3px; }

.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r); cursor: pointer; background: var(--surface);
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice strong { display: block; color: var(--text); }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
form.busy { opacity: .6; pointer-events: none; }
.input:disabled { opacity: .55; cursor: not-allowed; }
.hint .icon { vertical-align: -3px; }
.mb { margin-bottom: var(--s5); }

.group-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.group-head h2 { font-size: 16px; }
@media (max-width: 600px) { .group-head { padding: var(--s3) var(--s4); }    }

/* ---------- Statistik ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.kpi strong { display: block; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.kpi span:not(.tile) { font-size: 12.5px; color: var(--muted); }
@media (max-width: 420px) { .kpi { padding: var(--s3); gap: 10px; } .kpi .tile { width: 34px; height: 34px; } .kpi strong { font-size: 17px; } }
.legend { display: flex; gap: var(--s3); font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.ok { background: var(--accent); } .sw.bad { background: var(--bad-bar); }

.heatmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: block; width: 100%; min-width: 640px; height: auto; }
.hm-label { font: 600 8.5px "Inter", system-ui; fill: var(--muted); }
.hl-0 { fill: var(--surface-2); }
.hl-1 { fill: color-mix(in srgb, var(--success) 30%, var(--surface-2)); }
.hl-2 { fill: color-mix(in srgb, var(--success) 55%, var(--surface-2)); }
.hl-3 { fill: color-mix(in srgb, var(--success) 78%, var(--surface-2)); }
.hl-4 { fill: var(--success); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: var(--s3); font-size: 12px; color: var(--muted); }
.heat-legend span { margin: 0 4px; }
.avatar.current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
a.main.link { color: var(--text); }
a.main.link:hover .title { color: var(--accent); }
.meta-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row.center { justify-content: center; }

/* Als App auf dem Home-Bildschirm (iOS): die Kopfzeile reicht deckend bis unter Statusleiste/Dynamic Island,
   iOS passt die Schriftfarbe der Statusleiste selbst an (hell: dunkle Schrift, dunkel: helle Schrift). */
@media (display-mode: standalone) {
  .app-header { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.auth { padding-top: max(var(--s5), env(safe-area-inset-top)); }

.time-select { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2); align-items: center; }
.time-select .sep { font-weight: 700; color: var(--muted); }

/* Tastatur offen (Handy): Tab-Leiste ausblenden, sie würde sonst über der Tastatur bzw. verschoben stehen */

/* Verbindungsstatus in der Kopfzeile */
.conn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.conn-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--muted); transition: background-color .3s; }
.conn[data-state="ok"] .conn-dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.conn[data-state="down"] .conn-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); animation: conn-pulse 1.6s ease-in-out infinite; }
@keyframes conn-pulse { 50% { opacity: .45; } }

/* Pull-to-Refresh-Anzeige */
.ptr {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 4px); z-index: 30;
  width: 38px; height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translate(-50%, -60px); opacity: 0; pointer-events: none;
}
.ptr .icon { width: 18px; height: 18px; }
.ptr.ready { color: var(--accent); }
.ptr.spinning .icon { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .conn[data-state="down"] .conn-dot, .ptr.spinning .icon { animation: none; } }
.answer-multi { height: auto; min-height: 92px; padding: 14px 16px; resize: none; line-height: 1.45; text-align: center; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .kpis-3 .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpis-3 .kpi .tile { width: 32px; height: 32px; border-radius: 9px; }
  .kpis-3 .kpi .icon { width: 18px; height: 18px; }
}
.input[type="search"] { -webkit-appearance: none; appearance: none; }

/* ---------- Karte anlegen/bearbeiten ---------- */
.faces { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s3); align-items: stretch; }
@media (max-width: 680px) { .faces { grid-template-columns: 1fr; } .face-arrow { transform: rotate(90deg); justify-self: center; } }
.face {
  display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); min-height: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow);
  position: relative;
}
.face { border-top: 4px solid var(--accent); }
.face.back { border-top-color: var(--teal); }
.face:focus-within { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }
.face-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.face-arrow { align-self: center; color: var(--muted); display: inline-flex; }
.lang-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.face-text {
  flex: 1; width: 100%; border: 0; background: transparent; resize: none; padding: 0; margin: 0;
  font: 650 22px/1.3 "Inter", system-ui; letter-spacing: -0.015em; color: var(--text); min-height: 60px;
}
.face-text:focus { outline: none; }
.face-text::placeholder { color: var(--muted); font-weight: 500; }
.face-text.static { min-height: 0; overflow-wrap: anywhere; }
.select-sm { height: 32px; width: auto; font-size: 13px; padding: 0 30px 0 10px; border-radius: 9px; background-position: right 8px center; }

.chips-radio { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chips-radio label { cursor: pointer; }
.chips-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips-radio span {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px;
}
.chips-radio span .icon { width: 16px; height: 16px; }
.chips-radio input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chips-radio input:focus-visible + span { box-shadow: var(--ring); }

.save-bar {
  position: sticky; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; justify-content: center; align-items: center; gap: 6px;
  width: fit-content; max-width: 100%; margin: var(--s5) auto 0; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid var(--border);
  box-shadow: 0 10px 28px -12px rgb(0 0 0 / 40%);
  backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px);
}
.save-bar .btn { border-radius: 999px; }
@media (max-width: 767px) { .save-bar { bottom: calc(var(--tabbar-space) + 10px); } }

.direction-phase .due { display: block; text-align: center; margin-top: 4px; }

/* ---------- Schwebende Tab-Leiste (Handy, Stil iOS 26/27) ---------- */
:root { --tabbar-space: 0px; --glass-top: rgb(255 255 255 / 62%); --glass-bottom: rgb(255 255 255 / 38%);
  --glass-edge: rgb(255 255 255 / 55%); --glass-shine: rgb(255 255 255 / 85%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass-top: rgb(44 48 70 / 62%); --glass-bottom: rgb(24 27 42 / 55%);
  --glass-edge: rgb(255 255 255 / 12%); --glass-shine: rgb(255 255 255 / 16%); } }
:root[data-theme="dark"] { --glass-top: rgb(44 48 70 / 62%); --glass-bottom: rgb(24 27 42 / 55%);
  --glass-edge: rgb(255 255 255 / 12%); --glass-shine: rgb(255 255 255 / 16%); }
@media (max-width: 767px) {
  :root { --tabbar-gap: max(10px, calc(env(safe-area-inset-bottom) - 12px)); --tabbar-space: calc(var(--tabbar-h) + var(--tabbar-gap)); }
  .container { padding-bottom: calc(var(--tabbar-space) + var(--s6)); }
  /* Liquid Glass: durchscheinend, stark weichgezeichnet, Lichtkante oben, weicher Schatten */
  .tabbar {
    left: 14px; right: 14px; bottom: var(--tabbar-gap);
    height: var(--tabbar-h); padding: 6px; gap: 2px; isolation: isolate; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
    border-radius: 999px; border: 1px solid var(--glass-edge);
    background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
    backdrop-filter: blur(18px) saturate(200%) brightness(1.04); -webkit-backdrop-filter: blur(18px) saturate(200%) brightness(1.04);
    box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 -1px 1px rgb(0 0 0 / 6%),
      0 16px 36px -14px rgb(0 0 0 / 42%), 0 2px 8px rgb(0 0 0 / 8%);
    transition: transform .25s ease, opacity .25s ease;
  }
  .tabbar::before {  /* Glanz oben wie bei gebogenem Glas */
    content: ""; position: absolute; inset: 1px 18px auto; height: 45%; border-radius: 999px 999px 40% 40%; z-index: -1;
    background: linear-gradient(180deg, var(--glass-shine), transparent); opacity: .55; pointer-events: none;
  }
  .tabbar a { border-radius: 999px; gap: 2px; font-size: 10.5px; z-index: 1; -webkit-tap-highlight-color: transparent;
    transition: color .25s, transform .2s; }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"], .tabbar a.is-target { color: var(--accent); }
  .tabbar a:active { transform: scale(.94); }
  /* Gleitende Markierung (Glas-Linse), Position/Breite setzt app.js */
  .tab-glass {
    position: absolute; top: 5px; bottom: 5px; left: 0; z-index: 0; border-radius: 999px; pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--glass-top)), color-mix(in srgb, var(--accent) 22%, var(--glass-bottom)));
    box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
      0 4px 14px -6px color-mix(in srgb, var(--accent) 45%, transparent);
    transition: transform .45s cubic-bezier(.3, 1.35, .45, 1), width .35s cubic-bezier(.3, 1.2, .45, 1), opacity .2s;
  }
  .tab-glass.no-anim { transition: none; }
  .tabbar.dragging .tab-glass {
    transition: width .2s; backdrop-filter: blur(2px) saturate(160%); -webkit-backdrop-filter: blur(2px) saturate(160%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, rgb(255 255 255 / 55%)), color-mix(in srgb, var(--accent) 16%, rgb(255 255 255 / 25%)));
    box-shadow: inset 0 1px 1px rgb(255 255 255 / 80%), inset 0 -2px 6px rgb(0 0 0 / 8%), 0 10px 26px -8px rgb(0 0 0 / 35%);
  }
  .tabbar .count { top: 3px; left: calc(50% + 4px); }
  body.kbd-open .tabbar { transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .tabbar, .tab-glass { transition: none; } }
@media (max-width: 600px) {
  .phase-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4); }
  .phase-pills::-webkit-scrollbar { display: none; }
  .phase-pills a { flex: none; }
  .toolbar { flex-wrap: nowrap; }
  .toolbar .input-icon { flex: 1 1 auto; min-width: 0; }
}

/* Kartenseite: einheitliche Abstände */
.stack-lg { display: flex; flex-direction: column; gap: var(--s5); }
.stack-lg > * + * { margin-top: 0; }
.stack-lg > .alert, .stack-lg > .panel + .panel { margin: 0; }
.section-gap { margin-top: var(--s5); }
.card-meta { margin: calc(-1 * var(--s3)) 0 var(--s5); }
.direction-phase + .direction-phase { margin-top: 0; }
.direction-phase .due { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; }
.direction-phase .due .icon { width: 14px; height: 14px; }
.actions-panel .item { align-items: center; }
.actions-panel .meta { display: block; }
@media (max-width: 600px) { .actions-panel .item { flex-wrap: wrap; } .actions-panel .item .btn { margin-left: auto; } }
@media (max-width: 680px) {
  .face { min-height: 0; padding: var(--s4); gap: var(--s2); }
  .face-text { font-size: 20px; min-height: 30px; }
  .faces { gap: var(--s2); }
  .face-arrow .icon { width: 16px; height: 16px; }
}

/* iOS-App: Seite immer 1 px scrollbar, damit app.js die Höhen-Neuberechnung per Mini-Scroll anstoßen kann */
@media (display-mode: standalone) { body { min-height: calc(100vh + 1px); } }

/* Kartenfelder ohne inneren Fokusrahmen – die ganze Karte zeigt den Fokus */
.face-text:focus, .face-text:focus-visible { outline: none; box-shadow: none; }
@media (max-width: 400px) { .hide-xs { display: none; } }

/* Lernstand: Segment-Leiste je Richtung, jede Stufe in ihrer Phasenfarbe */
.phase-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: var(--s3) 0 var(--s2); }
.seg {
  height: 36px; border: 0; border-radius: 6px; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--muted); font: 650 12.5px/1 "Inter", system-ui;
  box-shadow: inset 0 0 0 1px var(--border); transition: background-color .2s, color .2s, box-shadow .2s, transform .1s;
}
.seg:first-child { border-radius: 12px 6px 6px 12px; }
.seg:last-child { border-radius: 6px 12px 12px 6px; }
.seg .icon { width: 14px; height: 14px; }
.seg:hover { box-shadow: inset 0 0 0 1.5px var(--c); color: var(--text); }
.seg:active { transform: scale(.96); }
.seg.done { background: color-mix(in srgb, var(--c) 32%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, var(--text)); box-shadow: none; }
.seg[aria-pressed="true"] { background: var(--c); color: #fff; box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--c) 70%, transparent); }
.direction-phase .due-row { justify-content: flex-start; }
.direction-phase .due { display: inline-flex; align-items: center; gap: 6px; }
.direction-phase .due .icon { width: 14px; height: 14px; }

/* Weitere Aktionen: eingeklappt */
details.actions-panel > summary { list-style: none; cursor: pointer; border-bottom: 0; background: transparent; }
details.actions-panel > summary::-webkit-details-marker { display: none; }
details.actions-panel[open] > summary { border-bottom: 1px solid var(--border); }
details.actions-panel .chev-toggle { color: var(--muted); transition: transform .2s; }
details.actions-panel[open] .chev-toggle { transform: rotate(180deg); }

/* Kurzer Hinweis (z. B. "gespeichert") */
.toast {
  position: fixed; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 12px); z-index: 40;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
  width: max-content; max-width: calc(100vw - 32px); line-height: 1.35;
}
.toast .icon { flex: none; }

/* Rückfrage vor dem Löschen */
.confirm-dialog {
  width: min(400px, calc(100vw - 32px)); padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-align: center;
}
.confirm-dialog::backdrop { background: rgb(15 18 30 / .45); backdrop-filter: blur(2px); }
.confirm-dialog[open] { animation: dialog-in .16s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.confirm-dialog .tile { margin: 0 auto var(--s3); }
.confirm-dialog h2 { font-size: 18px; margin: 0 0 6px; overflow-wrap: anywhere; }
.confirm-dialog p { margin: 0 0 var(--s4); font-size: 14px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.delete-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.delete-row .btn { flex: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 18px; height: 18px; color: var(--success); }
.toast.error .icon { color: var(--danger); }

/* Abschluss-Bildschirm Lernen */
.done-hero { text-align: center; padding: var(--s6) var(--s4) var(--s5); }
.done-hero h1 { font-size: clamp(26px, 6vw, 32px); margin: 6px 0 var(--s2); }
.done-hero .lead { color: var(--muted); max-width: 420px; margin: 0 auto; }
.done-badge { position: relative; width: 96px; height: 96px; margin: 0 auto var(--s4); display: grid; place-items: center; }
.done-badge .tile.lg { width: 72px; height: 72px; border-radius: 22px; position: relative; z-index: 1; }
.done-badge .tile.lg .icon { width: 34px; height: 34px; }
.done-badge .halo { position: absolute; inset: 0; border-radius: 30px; background: radial-gradient(circle, color-mix(in srgb, var(--success) 35%, transparent), transparent 70%); opacity: 0; }
.done-hero.finished .halo { opacity: 1; animation: halo 2.4s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.15); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .done-hero.finished .halo { animation: none; } }
.done-kpis { margin-bottom: var(--s4); }
.next-up { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); }
.next-up strong { display: block; }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s5); }
@media (max-width: 380px) { .done-actions { grid-template-columns: 1fr; } }

/* ---------- Startseite: Kachel "Heute" ---------- */
.grid-2 > .panel { display: flex; flex-direction: column; }

.today-panel .ring-wrap { width: 112px; height: 112px; }
.today-panel .ring-wrap .pct { font-size: 26px; }
.chip.streak { background: var(--warning-soft); color: var(--warning); }

.fact-icon { width: 28px; height: 28px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); }
.fact-icon .icon { width: 16px; height: 16px; }

@media (max-width: 420px) {
  
  .today-panel .ring-wrap { width: 96px; height: 96px; margin: 0; }
  .today-panel .ring-wrap svg { width: 96px; height: 96px; }
  .today-panel .ring-wrap .pct { font-size: 22px; }
  .today-panel .ring-wrap .sub { font-size: 11px; }
}

/* ---------- Übersetzer: Ergebnis ---------- */

.pair-src { color: var(--text-2); font-size: 16px; overflow-wrap: anywhere; }

.lang-badge.accent { background: var(--accent-soft); color: var(--accent); }

.save-head { display: flex; align-items: center; gap: 8px; color: var(--text); }
.save-head .icon { color: var(--success); }
.chips-radio.compact span { height: 34px; padding: 0 12px; font-size: 13.5px; }

.btn .shortcut-hint { margin-left: 2px; }

/* ---------- Unter-Navigation (Einstellungen, Administration) ---------- */
.subnav {
  display: flex; gap: 4px; padding: 4px; margin-bottom: var(--s5); width: fit-content; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; flex: none;
  color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
@media (max-width: 600px) { .subnav { width: 100%; } .subnav a { flex: 1; justify-content: center; padding: 0 10px; } }
@media (max-width: 420px) { .subnav a span { display: none; } .subnav a[aria-current="page"] span { display: inline; } }

/* ---------- Einstellungen ---------- */
.grid-2 + .alert, .settings-form + .alert { margin-top: var(--s4); }

.interval-list { display: grid; gap: var(--s2); }
.interval-list .interval-row { grid-template-columns: 100px 90px 1fr; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }
.device { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r); background: var(--surface-2); flex-wrap: wrap; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; flex: none; }

/* ---------- Administration ---------- */

.group-head h2 { margin: 0; }

.muted-avatar { background: var(--surface-2); color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); display: inline-block; }
.status-dot.on { background: var(--success); }

.manage-grid { display: grid; gap: var(--s3); }
.manage-block { display: grid; gap: 6px; padding: var(--s3); border-radius: var(--r); background: var(--surface-2); }
.manage-block.danger { background: color-mix(in srgb, var(--danger) 7%, var(--surface-2)); }
.inline-form { display: flex; gap: var(--s2); }
.inline-form .input { height: 36px; flex: 1; min-width: 0; }

/* Einstellungs-Zeilen: Icon | Titel + Beschreibung | Bedienelement */

.segmented label { cursor: pointer; }
.segmented label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label span { display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 10px; border-radius: 9px;
  font-weight: 600; font-size: 13.5px; color: var(--text-2); text-align: center; }
.segmented label input:checked + span { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.segmented label input:focus-visible + span { box-shadow: var(--ring); }

/* Administration: Schnellformular oben, Liste darunter */
.quick-panel { padding: var(--s4) var(--s5); }
.quick-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.quick-head h2 { margin: 0; }
.quick-head .muted { margin-left: auto; }
.quick-form { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: var(--s2); align-items: center; }
.quick-form.cols-2 { grid-template-columns: 1fr auto; }
.quick-form.cols-5 { grid-template-columns: .7fr 1.2fr 1fr 1fr auto; }
@media (max-width: 760px) {
  .quick-form { grid-template-columns: 1fr 1fr; }
  .quick-form.cols-5 { grid-template-columns: 1fr; }  /* Sprache: vier Felder untereinander */
  .quick-form .btn { grid-column: 1 / -1; }
  .quick-form.cols-2 { grid-template-columns: 1fr auto; }
  .quick-form.cols-2 .btn { grid-column: auto; }
}
@media (max-width: 420px) { .quick-form, .quick-form.cols-5 { grid-template-columns: 1fr; } }

.user-row > summary { list-style: none; cursor: pointer; }
.user-row > summary::-webkit-details-marker { display: none; }
.user-row + .user-row { border-top: 1px solid var(--border); }
.user-row .item { align-items: center; }
.user-row .title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-row .meta { gap: 6px; }
.manage-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); flex: none; }
.user-row[open] .manage-toggle { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.user-row[open] .chev-toggle { transform: rotate(180deg); }
.chev-toggle { transition: transform .2s; }
.user-row .manage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); padding: 0 var(--s5) var(--s5); }
.manage-grid .span-all { grid-column: 1 / -1; margin: 0; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
@media (max-width: 860px) { .user-row .manage-grid { grid-template-columns: minmax(0, 1fr); padding: 0 var(--s4) var(--s4); } }
.cat-item { gap: var(--s2); }
.cat-edit { display: flex; gap: var(--s2); flex: 1; min-width: 0; }
.cat-edit .input { height: 38px; }
.fact-icon.tone-green { background: var(--success-soft); color: var(--success); }
.fact-icon.tone-amber { background: var(--warning-soft); color: var(--warning); }
.fact-icon.tone-violet { background: var(--violet-soft); color: var(--violet); }
.fact-icon.tone-red { background: var(--danger-soft); color: var(--danger); }
.fact-icon.tone-teal { background: var(--teal-soft); color: var(--teal); }
.fact-icon.tone-gray { background: var(--surface); color: var(--muted); }

@media (max-width: 520px) {
  
  .segmented label span { white-space: nowrap; font-size: 13px; padding: 0 6px; }
}
.manage-grid > *, .manage-block > *, .btn-pair > * { min-width: 0; }
.btn-pair .btn { white-space: normal; height: auto; min-height: 34px; padding: 6px 10px; }
@media (max-width: 420px) { .btn-pair { grid-template-columns: 1fr; } }
.btn-pair { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.btn-pair .btn { white-space: nowrap; }
/* Katalog: "alles übernommen" statt Knopf */
.taken { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px;
  color: var(--success); background: var(--success-soft); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.taken .icon { width: 16px; height: 16px; }
/* Neuer Benutzer: auf dem Handy Felder untereinander, Admin-Schalter und Knopf in einer Zeile */
@media (max-width: 760px) {
  .quick-form.user-form { grid-template-columns: 1fr auto; }
  .quick-form.user-form .input { grid-column: 1 / -1; }
  .quick-form.user-form .btn { grid-column: auto; }
}
@media (max-width: 420px) { .quick-form.user-form { grid-template-columns: 1fr auto; } }

/* ---------- Panel-Kopf als farbig hinterlegte Leiste (wie Listen-Köpfe) ---------- */
.panel { --pad: var(--s5); padding: var(--pad); }
.auth .panel { --pad: var(--s6); }
.panel.list-panel { padding: 0; }
.panel.quick-panel { padding: var(--s4) var(--s5); }
.panel-head .segmented { margin-left: auto; }
@media (max-width: 600px) {
  .panel-head:has(.segmented) .grow { flex: 1 1 180px; }
  .panel-head .segmented { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
}
.group-head p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.pane-title { margin-bottom: var(--s2); }
.panel > .panel-head:first-child {
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--s5);
  padding: var(--s4) var(--pad);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  flex-wrap: wrap;
}
.quick-panel > .quick-head {
  margin: calc(-1 * var(--s4)) calc(-1 * var(--s5)) var(--s4);
  padding: var(--s3) var(--s5);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
}
@media (max-width: 600px) { .panel > .panel-head:first-child { padding: var(--s3) var(--pad); } }

/* ---------- Säulendiagramme ---------- */
:root { --bad-bar: color-mix(in srgb, var(--danger) 70%, var(--surface)); }
.h-0 { height: 0; } .h-2 { height: 2%; } .h-4 { height: 4%; } .h-6 { height: 6%; } .h-8 { height: 8%; }
.h-10 { height: 10%; } .h-12 { height: 12%; } .h-14 { height: 14%; } .h-16 { height: 16%; } .h-18 { height: 18%; }
.h-20 { height: 20%; } .h-22 { height: 22%; } .h-24 { height: 24%; } .h-26 { height: 26%; } .h-28 { height: 28%; }
.h-30 { height: 30%; } .h-32 { height: 32%; } .h-34 { height: 34%; } .h-36 { height: 36%; } .h-38 { height: 38%; }
.h-40 { height: 40%; } .h-42 { height: 42%; } .h-44 { height: 44%; } .h-46 { height: 46%; } .h-48 { height: 48%; }
.h-50 { height: 50%; } .h-52 { height: 52%; } .h-54 { height: 54%; } .h-56 { height: 56%; } .h-58 { height: 58%; }
.h-60 { height: 60%; } .h-62 { height: 62%; } .h-64 { height: 64%; } .h-66 { height: 66%; } .h-68 { height: 68%; }
.h-70 { height: 70%; } .h-72 { height: 72%; } .h-74 { height: 74%; } .h-76 { height: 76%; } .h-78 { height: 78%; }
.h-80 { height: 80%; } .h-82 { height: 82%; } .h-84 { height: 84%; } .h-86 { height: 86%; } .h-88 { height: 88%; }
.h-90 { height: 90%; } .h-92 { height: 92%; } .h-94 { height: 94%; } .h-96 { height: 96%; } .h-98 { height: 98%; }
.h-100 { height: 100%; }

.bchart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s2); }
.bc-y { height: 200px; display: flex; flex-direction: column; justify-content: space-between; text-align: right;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.bc-y span { line-height: 1; transform: translateY(-50%); }
.bc-y span:last-child { transform: translateY(50%); }
.bc-cols {
  display: flex; align-items: stretch; gap: 3px; height: 200px; border-bottom: 1px solid var(--border-strong);
  background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 50%;
}
.bc-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 0; border: 0; background: transparent; border-radius: 6px 6px 0 0; cursor: pointer; font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.bc-col:hover, .bc-col.is-sel { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.bc-col:focus-visible { box-shadow: var(--ring); }
.bc-bar {
  width: min(72%, 30px); display: flex; flex-direction: column; overflow: hidden; flex: none;
  background: var(--accent); border-radius: 5px 5px 1px 1px; transition: filter .15s;
}
.bc-col.is-sel .bc-bar { filter: brightness(1.08) saturate(1.1); }
.bc-bad { width: 100%; flex: none; background: var(--bad-bar); }
.bc-x { display: flex; gap: 3px; margin-top: 6px; font-size: 11px; color: var(--muted); font-weight: 600; }
.bc-x span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; }@media (max-width: 600px) { .bc-y, .bc-cols { height: 170px; } .bc-cols, .bc-x { gap: 2px; } }

.chart-tip {
  position: fixed; z-index: 45; pointer-events: none; display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 12.5px; line-height: 1.35; box-shadow: var(--shadow);
  max-width: min(260px, calc(100vw - 16px));
}
.chart-tip strong { font-size: 13px; }
.chart-tip span { opacity: .85; }
.heatmap rect[data-tip] { cursor: pointer; }
.heatmap rect.is-sel { stroke: var(--text); stroke-width: 1.5; }

.sum-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-bottom: var(--s5); }
.sum-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sum-row > div { padding: var(--s3); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.sum-row strong { display: block; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.sum-row span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
@media (max-width: 600px) { .sum-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sum-row strong { font-size: 18px; } }
.empty.compact { padding: var(--s5) var(--s4); }
.rank { width: 28px; height: 28px; border-radius: 999px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: 13px; }
.item .side.rate { flex-direction: row; align-items: center; gap: var(--s2); }
.rate .rate-bar { width: 64px; height: 6px; }
.rate .rate-bar .value { fill: var(--danger); }
.rate strong { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; }
@media (max-width: 600px) { .rate .rate-bar { display: none; } }

/* ---------- Startseite: Kachel "Heute" – nur: was ist noch offen? ---------- */
/* Übersetzer: Ergebnis als breite Zeile, darunter die Speichern-Leiste (keine leeren Flächen am Desktop) */
.result-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.result-top .row { gap: var(--s2); }
.pair-h { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface-2); }
.pair-h .side { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.pair-h .pair-arrow { color: var(--muted); display: inline-flex; }
.pair-h .pair-src { font-size: 18px; }
.save-strip { margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-lg); display: grid; gap: var(--s3); }
.save-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s2); align-items: center; }
.save-controls .chips-radio { flex-wrap: nowrap; }
.save-strip .disclosure > .content { margin-top: var(--s3); }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 860px) {
  /* Handy: zwei Zeilen wie Vorder-/Rückseite, getrennt durch eine feine Linie statt Pfeil */
  .pair-h { grid-template-columns: 1fr; gap: 0; padding: 0 var(--s4); }
  .pair-h .pair-arrow { display: none; }
  .pair-h .side { padding: 14px 0; align-items: center; }
  .pair-h .side.to { border-top: 1px solid var(--border-strong); }
  .pair-h .lang-badge { min-width: 38px; text-align: center; }
  .pair-h .pair-src { font-size: 16px; }
  .save-controls { grid-template-columns: 1fr; }
  .save-controls .chips-radio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .save-controls .chips-radio span { width: 100%; justify-content: center; padding: 0 8px; }
  .save-controls .btn { width: 100%; }
  .edit-grid { grid-template-columns: 1fr; }
}

/* Desktop: Ring links, Text und Knopf rechts, mittig in der Kachel (gleich hoch wie "Karteikarten").
   Handy: Ring und Text nebeneinander, Knopf über die ganze Breite darunter. */
.today-hero {
  flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ring text" "ring cta" "facts facts";
  align-content: center; align-items: center; column-gap: var(--s6); row-gap: var(--s4); padding: var(--s3) 0;
}
.today-hero > .ring-wrap { grid-area: ring; }
.today-text { grid-area: text; align-self: end; }
.today-cta { grid-area: cta; align-self: start; max-width: 300px; }
/* Startseite Desktop: "Heute" über die ganze Breite – Ring | Text + Knopf | Tageszahlen */
@media (min-width: 861px) {
  .today-hero { grid-template-columns: auto minmax(0, 1fr) minmax(280px, 380px); grid-template-areas: "ring text facts" "ring cta facts"; }
  .today-hero .today-facts-row { align-self: center; margin: 0; padding: 0 0 0 var(--s5); border-top: 0; border-left: 1px solid var(--border); }
}
.today-facts-row { grid-area: facts; list-style: none; margin: var(--s2) 0 0; padding: var(--s4) 0 0; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.today-facts-row li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.today-facts-row strong { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.today-facts-row li > span:last-child { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.today-facts-row .fact-icon { width: 26px; height: 26px; }
.today-panel .today-hero .ring-wrap { width: 140px; height: 140px; }
.today-panel .today-hero .ring-wrap .pct { font-size: 30px; }
@media (max-width: 860px) {
  .today-hero { grid-template-areas: "ring text" "cta cta" "facts facts"; column-gap: var(--s5); padding: 0; }
  .today-text { align-self: center; }
  .today-cta { max-width: none; }
  .today-panel .today-hero .ring-wrap, .today-panel .today-hero .ring-wrap svg { width: 104px; height: 104px; }
  .today-panel .today-hero .ring-wrap .pct { font-size: 24px; }
}
.today-text { display: grid; gap: 2px; min-width: 0; }
.today-text .big { font-size: 44px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; color: var(--text); }
.today-text .lead { font-size: 15.5px; font-weight: 650; color: var(--text); margin-bottom: 2px; }
.today-text .headline { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; color: var(--success); }
.next-chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: var(--s2); padding: 5px 11px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.next-chip .icon { width: 14px; height: 14px; }

/* ---------- Einstellungen: Abfrage ---------- */
.opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt + .opt { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.opt-head { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0; float: left; width: 100%; }
.opt-head + * { clear: both; padding-top: var(--s3); }
.opt-head strong { display: block; font-size: 15px; font-weight: 650; color: var(--text); }
.opt-head > span > span { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.sec-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sec-chips label { position: relative; cursor: pointer; }
.sec-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sec-chips span {
  display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; transition: background-color .15s, border-color .15s, color .15s;
}
.sec-chips label:hover span { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.sec-chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.sec-chips input:focus-visible + span { box-shadow: var(--ring); }
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (max-width: 1000px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card {
  position: relative; display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r); min-width: 0;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.mode-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.mode-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-card:has(input:focus-visible) { box-shadow: var(--ring); }
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.mode-top strong { font-size: 14.5px; }
.radio-dot { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--border-strong); flex: none; background: var(--surface); }
.mode-card:has(input:checked) .radio-dot { border: 5px solid var(--accent); }
.mode-demo { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.mode-demo .icon { width: 14px; height: 14px; }

/* Zusatzinfo ("Zum Merken") nach dem Beantworten */
.context-box { display: flex; gap: var(--s3); align-items: flex-start; max-width: 520px; margin: var(--s3) auto 0; padding: 12px 16px;
  border-radius: var(--r); background: var(--warning-soft); color: var(--warning); text-align: left; }
.context-box .icon { margin-top: 2px; }
.context-box .k { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.context-box p { color: var(--text); font-size: 15px; overflow-wrap: anywhere; }

h2.label-row { display: flex; }
.chip.hard { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 480px) { .hide-sm { display: none; } }
.panel-head > .btn-sm { flex: none; }

/* Karten-Tab: einklappbarer Lernstand nach Phase */
.phase-overview .phase-rows { padding: var(--s4) var(--s5) var(--s5); }
@media (max-width: 600px) { .phase-overview .phase-rows { padding: var(--s3) var(--s4) var(--s4); } }

/* ---------- Kategorie-Kombifeld ---------- */
.combo { position: relative; }
.combo .input { padding-right: 40px; }
.combo-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: inline-flex; }
.combo-caret .icon { width: 18px; height: 18px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  max-height: 248px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.combo-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14.5px; overflow-wrap: anywhere; }
.combo-list li:hover, .combo-list li.active { background: var(--surface-2); }
.combo-list li[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.combo-list li.none { color: var(--muted); }
.combo-list li.create { color: var(--accent); font-weight: 600; }
.combo-list li.create:not(:first-child) { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 11px; }
.combo-list li.create::before { content: "+ "; }

/* ---------- Info-Hinweis zum Antippen ---------- */
.label-row { display: inline-flex; align-items: center; gap: 4px; }
/* Info-Symbol neben einer Beschriftung macht die Zeile nicht höher (Felder bleiben auf einer Linie) */
.label-row .info-tip > summary { width: 22px; height: 22px; margin: -4px 0; }
.info-tip { position: relative; display: inline-flex; }
.info-tip > summary {
  list-style: none; cursor: pointer; width: 26px; height: 26px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--muted);
}
.info-tip > summary::-webkit-details-marker { display: none; }
.info-tip > summary:hover, .info-tip[open] > summary { color: var(--accent); background: var(--accent-soft); }
.info-tip .icon { width: 16px; height: 16px; }
.tip-body {
  position: absolute; left: -10px; top: calc(100% + 6px); z-index: 30; width: max-content; max-width: min(300px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500;
  line-height: 1.45; letter-spacing: 0; text-transform: none; box-shadow: var(--shadow); white-space: normal;
}

/* ---------- Konto ---------- */
.learned-box { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2); margin-bottom: var(--s3); }
.learned-box .bar .value { fill: var(--success); }
.learned-box .bar .track { fill: var(--surface); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--s2); }
/* Kompakt: Symbol + Zahl in einer Zeile, Bedeutung hinter dem Info-Symbol */
.mini-stat { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; border-radius: var(--r);
  background: var(--surface-2); color: var(--text); min-width: 0; }
.mini-text { flex: 1; min-width: 0; display: grid; }
.mini-text strong { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; white-space: nowrap; }
.mini-text span { font-size: 11.5px; color: var(--muted); line-height: 1.3; hyphens: auto; }
.mini-stat { position: relative; padding-right: 28px; }
.mini-stat .info-tip { position: absolute; top: 6px; right: 4px; }
.mini-stat { align-items: center; }
.mini-stat .info-tip > summary { width: 24px; height: 24px; }
@media (max-width: 480px) { .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
