/* Vokabeln – Glas-Design auf dunklem Petrol, abgestimmt auf das App-Icon */

:root {
  --bg-0: #061c24;
  --bg-1: #0d3b4a;
  --bg-2: #17616b;
  --surface: rgba(9, 33, 42, 0.74);
  --surface-solid: #0c2a35;
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.1);
  --field: rgba(0, 0, 0, 0.28);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #eef6f6;
  --muted: #a6c1c6;
  --faint: #6f9097;
  --accent: #2fc28a;
  --accent-ink: #052419;
  --accent-2: #3bb6c8;
  --ok: #39c98f;
  --warn: #f0b955;
  --bad: #ef6a5a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --nav-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-0);
}
[hidden] { display: none !important; }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- Hintergrund */
#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120% 90% at 15% 0%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}
#bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.2s, filter 0.2s;
  will-change: filter, opacity;
}
#bg-dim { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- Layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: rgba(6, 28, 36, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.brand img { display: block; width: 34px; height: 34px; border-radius: 9px; }
.realm-switch select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 52vw;
  padding: 7px 34px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23eef6f6' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font: 600 16px/1.2 inherit;
  font-family: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}
.page-title { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 24px);
}
.view > * + * { margin-top: 14px; }

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  padding: 4px 4px calc(4px + var(--safe-bottom));
  background: rgba(6, 28, 36, 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid var(--border);
}
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.nav a.active { color: var(--accent); }
.nav .desktop-only { display: none; }

body.focus-mode .nav { display: none; }
body.focus-mode main { padding-bottom: calc(var(--safe-bottom) + 24px); }

@media (min-width: 900px) {
  #app { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  body.no-shell #app { display: block; }
  .topbar { grid-column: 1 / -1; padding-left: 20px; padding-right: 24px; }
  .nav {
    position: sticky;
    top: 62px;
    align-self: start;
    height: calc(100vh - 62px);
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: rgba(6, 28, 36, 0.45);
  }
  .nav a { flex: none; flex-direction: row; gap: 12px; padding: 10px 14px; font-size: 15px; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--surface-3); color: var(--text); }
  .nav .desktop-only { display: flex; }
  .nav a[href="#/more"] { margin-top: auto; }
  main { padding: 28px 32px 48px; }
  body.focus-mode #app { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- Bausteine */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.row.spread, .card.row.spread { justify-content: space-between; flex-wrap: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { display: inline-block; margin-top: 4px; color: var(--faint); font-size: 13px; }
.hint.block, .block { display: block; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.icon { display: inline-flex; flex: none; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, opacity 0.15s;
  user-select: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { background: #3ad59a; }
.btn.danger { background: rgba(239, 106, 90, 0.16); border-color: rgba(239, 106, 90, 0.45); color: #ffb9b0; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost[aria-pressed="true"], .btn.ghost.on { background: var(--surface-3); border-color: var(--border-strong); color: var(--accent); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 52px; font-size: 17px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Formulare */
.input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 194, 138, 0.22); }
.input.big { min-height: 56px; font-size: 20px; }
.input.num { width: 90px; text-align: center; }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a6c1c6' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.row .input, .toolbar .input { width: auto; }
.field { display: block; }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.checks { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; }
.form-error { color: #ffb9b0; font-size: 14px; }

.seg { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); }
.seg button {
  flex: 1;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }

.accent-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.chip:active { background: var(--accent); color: var(--accent-ink); }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.notice.warn { background: rgba(240, 185, 85, 0.13); border: 1px solid rgba(240, 185, 85, 0.4); color: #ffd99a; }
.notice.ok { background: rgba(57, 201, 143, 0.13); border: 1px solid rgba(57, 201, 143, 0.4); color: #a5f0cf; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill + .pill { margin-left: 4px; }
.pill.new { background: rgba(59, 182, 200, 0.18); color: #9fe3ee; }
.pill.learn { background: rgba(240, 185, 85, 0.16); color: #ffd99a; }
.pill.sure { background: rgba(57, 201, 143, 0.18); color: #a5f0cf; }
.pill.bad { background: rgba(239, 106, 90, 0.2); color: #ffb9b0; }
.pill.none { opacity: 0.5; }
.pill.pkg-pill { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

.pbar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.09); }
.pbar i { display: block; height: 100%; transition: width 0.3s; }
.pbar .sure { background: var(--accent); }
.pbar .learn { background: var(--accent-2); opacity: 0.75; }

/* ---------------------------------------------------------------- Start */
.hero { text-align: center; padding: 28px 18px; }
.hero > * + * { margin-top: 12px; }
.hero-num { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.hero-label { color: var(--muted); font-weight: 600; margin-top: 4px !important; }
.hero .btn { margin-top: 18px; }

.boxes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 130px; }
.box-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.box-bar { width: 100%; max-width: 40px; border-radius: 6px 6px 3px 3px; background: var(--accent-2); }
.box-bar.b0 { background: rgba(159, 227, 238, 0.45); }
.box-bar.b1, .box-bar.b2 { background: var(--warn); opacity: 0.85; }
.box-bar.b3, .box-bar.b4, .box-bar.b5, .box-bar.b6 { background: var(--accent); }
.box-count { font-size: 12px; font-weight: 700; color: var(--muted); }
.box-label { font-size: 12px; color: var(--faint); }

/* ---------------------------------------------------------------- Pakete */
.pkg { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.pkg-list > .pkg:first-child { border-top: 0; padding-top: 0; }
.pkg-main { flex: 1; min-width: 0; }
.pkg-main > * + * { margin-top: 6px; }
.pkg-name { font-weight: 700; }
.pkg-meta { color: var(--muted); font-size: 13px; }
.pkg.done .pkg-name { color: var(--muted); }
.pkg-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.pkg-create { padding-top: 14px; border-top: 1px solid var(--border); }
.pkg-create > * + * { margin-top: 10px; }
.card > .pkg-create:first-of-type:nth-child(2) { border-top: 0; padding-top: 0; }

/* ---------------------------------------------------------------- Liste */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-wrap { position: relative; flex: 1 1 220px; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-wrap .input { width: 100%; padding-left: 38px; }
.vhead, .vrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 210px; gap: 12px; align-items: center; padding: 11px 16px; }
.vhead { color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); }
.vhead::after { content: ""; }
.vrow { border-bottom: 1px solid var(--border); cursor: pointer; }
.vrow:last-child { border-bottom: 0; }
.vrow:hover { background: var(--surface-2); }
.vlist.selecting .vrow { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) 210px; }
.vrow.selected { background: rgba(47, 194, 138, 0.13); }
.vcheck { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--border-strong); border-radius: 6px; color: var(--accent); }
.vrow.selected .vcheck { border-color: var(--accent); }
.vcell { overflow-wrap: anywhere; }
.vf { font-weight: 650; }
.vmeta { display: flex; align-items: center; justify-content: flex-end; }
.cover-f .vf:not(.revealed), .cover-g .vg:not(.revealed) { filter: blur(7px); opacity: 0.7; user-select: none; }
.vlist .empty { padding: 28px 16px; text-align: center; }
.vlist + .btn { border-top: 1px solid var(--border); border-radius: 0; }
.bulkbar {
  position: sticky;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(9, 33, 42, 0.95);
}
.bulkbar select.input { width: auto; min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.bulk-count { font-weight: 700; margin-right: auto; }

/* ---------------------------------------------------------------- Neu / Import */
.recent-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.recent-item:first-child { border-top: 0; }
.recent-item .icon-btn { margin-left: auto; width: 34px; height: 34px; }
.table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { position: sticky; top: 0; background: var(--surface-solid); color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.table tr.dup td { color: var(--warn); }
details summary { cursor: pointer; color: var(--muted); }
pre { white-space: pre-wrap; margin: 8px 0 0; color: var(--faint); }

/* ---------------------------------------------------------------- Übung */
.setup { max-width: 560px; margin: 0 auto; }
.session { max-width: 620px; margin: 0 auto; }
.session > * + * { margin-top: 14px; }
.session-top { display: flex; align-items: center; gap: 12px; }
.session-top .pbar { height: 10px; }
.flash { display: flex; flex-direction: column; gap: 16px; padding: 26px 20px; text-align: center; }
.flash-head { display: flex; flex-direction: column; gap: 12px; }
.flash .dir { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.badges { min-height: 22px; }
.flash .prompt { font-size: clamp(30px, 8vw, 46px); font-weight: 750; line-height: 1.15; overflow-wrap: anywhere; padding: 8px 0; }
.flash .answer { font-size: 26px; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.flash .notes { color: var(--muted); font-size: 15px; white-space: pre-line; margin-top: 6px; }
.answer-input { text-align: center; }
.answer-input.is-ok { border-color: var(--ok); }
.answer-input.is-bad { border-color: var(--bad); }
.answer-area .accent-bar { justify-content: center; }
.verdict { padding: 14px; border-radius: var(--radius-sm); }
.verdict-msg { font-weight: 700; margin-bottom: 6px; }
.verdict.ok { background: rgba(57, 201, 143, 0.13); border: 1px solid rgba(57, 201, 143, 0.4); }
.verdict.ok .verdict-msg { margin-bottom: 0; }
.verdict.typo { background: rgba(240, 185, 85, 0.13); border: 1px solid rgba(240, 185, 85, 0.45); }
.verdict.bad { background: rgba(239, 106, 90, 0.13); border: 1px solid rgba(239, 106, 90, 0.45); }
.verdict.bad .answer { color: var(--text); }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; }
.desktop-hint { display: none; }
@media (hover: hover) and (pointer: fine) { .desktop-hint { display: block; } }
.summary { max-width: 620px; margin: 0 auto; text-align: center; }
.summary .wrong-list { text-align: left; }
.score { display: flex; justify-content: center; gap: 32px; }
.score div { display: flex; flex-direction: column; }
.score strong { font-size: 44px; line-height: 1.1; }
.score span { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- Sprachraum */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--field) center / cover no-repeat;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
}
.tile.none { display: grid; place-items: center; border: 2px dashed var(--border-strong); }
.tile.active { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(47, 194, 138, 0.25); }
.tile .del {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}
.url-row { display: flex; gap: 8px; }
.url-row .input { flex: 1; min-width: 0; }
.slider-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 100px; align-items: center; gap: 12px; }
.slider-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.slider-val { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Mehr / Admin */
.menu { padding: 4px 18px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item > .icon:first-child { color: var(--accent); }
.menu-item > .icon:last-child { color: var(--faint); }
.user-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.user-row:first-child { border-top: 0; }
.user-row strong { margin-right: 6px; }
.user-row.inactive strong { color: var(--muted); text-decoration: line-through; }

/* ---------------------------------------------------------------- Login */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 16px calc(var(--safe-bottom) + 24px); }
.login { width: min(420px, 100%); }
.login-head { text-align: center; }
.login-head img { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.login-head h1 { margin-top: 12px; }
.login-head p { margin-top: 4px; }

/* ---------------------------------------------------------------- Modal & Toast */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.55);
}
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: rgba(10, 36, 46, 0.97); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 18px; }

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(8, 30, 38, 0.96);
  box-shadow: var(--shadow);
  font-size: 15px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: rgba(239, 106, 90, 0.7); }
.toast-success { border-color: rgba(57, 201, 143, 0.7); }

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .checks { padding-top: 0; }
  .vhead, .vrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 11px 14px; row-gap: 6px; }
  .vlist.selecting .vrow { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
  .vmeta { grid-column: 1 / -1; justify-content: flex-start; }
  .vlist.selecting .vmeta { grid-column: 2 / -1; }
  .pkg { flex-wrap: wrap; }
  .pkg-actions { width: 100%; justify-content: flex-end; }
  .slider-row { grid-template-columns: 86px minmax(0, 1fr); }
  .slider-val { grid-column: 2; text-align: left; margin-top: -8px; }
  .url-row { flex-direction: column; }
  .hero-num { font-size: 60px; }
  .card.row.spread { flex-wrap: wrap; }
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}
@media (min-width: 900px) {
  #toasts { bottom: 24px; }
  .bulkbar { bottom: 16px; }
}

/* ---------------------------------------------------------------- Phase 2a: Statistik, Auswahl, Vorlesen */
.goal-mini { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 18px auto 0 !important; color: var(--muted); font-size: 13px; text-decoration: none; }
.goal-mini .pbar { flex: 1; }
.streak-mini { display: inline-flex; align-items: center; gap: 2px; color: var(--warn); font-weight: 700; }
.goal-row { display: flex; align-items: center; gap: 18px; }
.goal-row .grow > * + * { margin-top: 8px; }
.pbar.big { height: 12px; }
.streak { display: flex; flex-direction: column; align-items: center; color: var(--warn); line-height: 1.1; }
.streak strong { font-size: 26px; color: var(--text); }
.streak span:last-child { color: var(--muted); font-size: 12px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.tile-stat strong { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-stat span { font-weight: 600; font-size: 14px; }
.tile-stat small { color: var(--faint); font-size: 12px; }

.chart { margin: 0; }
.chart-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 4px; border-bottom: 1px solid var(--border-strong); }
.chart-col { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { background: #6fd3e1; }
.chart-col:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chart-bar { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent-2); }
.chart-bar.zero { background: var(--border); }
.chart-goal { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, 0.45); pointer-events: none; }
.chart-goal span { position: absolute; right: 0; top: -18px; color: var(--muted); font-size: 11px; }
.chart-axis { display: flex; gap: 2px; margin-top: 6px; }
.chart-axis span { flex: 1; min-width: 0; overflow: visible; white-space: nowrap; color: var(--faint); font-size: 11px; }
.chart-readout { min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 13px; }

.prompt-row, .answer-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.speak-btn { flex: none; color: var(--accent-2); }
.input-with-btn { display: flex; gap: 6px; align-items: center; }
.input-with-btn .input { flex: 1; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.choice:hover:not(:disabled) { border-color: var(--accent-2); }
.choice:disabled { cursor: default; opacity: 0.55; }
.choice.is-ok { opacity: 1; border-color: var(--ok); background: rgba(57, 201, 143, 0.16); }
.choice.is-bad { opacity: 1; border-color: var(--bad); background: rgba(239, 106, 90, 0.16); }
.choice-key { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr; }
  .chart-bars { height: 130px; }
}

/* ---------------------------------------------------------------- Phase 2b: Wörterbuch */
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px !important; }
.suggest .hint { margin: 0 4px 0 0; }
.chip.sugg { min-height: 34px; padding: 0 12px; font-size: 15px; border-color: rgba(59, 182, 200, 0.45); background: rgba(59, 182, 200, 0.12); }
.dict-results > * + * { margin-top: 12px; }
.dict-entry { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.modal .dict-entry { background: var(--surface-2); }
.dict-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dict-word { font-size: 21px; }
.dict-ipa { color: var(--muted); font-size: 14px; }
.dict-head .icon-btn { width: 34px; height: 34px; }
.dict-senses { margin: 10px 0 0; padding-left: 22px; }
.dict-senses li + li { margin-top: 8px; }
.dict-senses li::marker { color: var(--faint); }
.dict-de { font-weight: 600; }
.dict-def { color: var(--muted); font-size: 14px; font-style: italic; }
.dict-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.answer-row .icon-btn { color: var(--accent-2); }

/* ---------------------------------------------------------------- Phase 2c: Sprechen */
.mic-area { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0; }
.mic-btn {
  --level: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 0 0 calc(4px + var(--level) * 22px) rgba(47, 194, 138, 0.25);
  transition: box-shadow 0.08s linear, transform 0.1s;
}
.mic-btn:active { transform: scale(0.96); }
.mic-btn:disabled { opacity: 0.5; }
.mic-btn.listening { background: var(--bad); color: #fff; box-shadow: 0 0 0 calc(4px + var(--level) * 22px) rgba(239, 106, 90, 0.3); }
.mic-status { min-height: 22px; color: var(--muted); font-size: 15px; }

/* „Weiß ich nicht“ */
.actions .dont-know { flex: 0 1 auto; color: var(--muted); }
.verdict.unknown { background: var(--surface-3); border: 1px solid var(--border-strong); }
.verdict.unknown .answer { color: var(--text); }
