/* Sicher! B2 · Sprechen & Shadowing — shared theme (palette of the approved "Sprechen & Shadowing – B2.2" app) */
:root {
  --bg: #faf8f5; --paper: #ffffff; --soft: #f1ede6; --line: #ddd6ca; --ink: #1f2328; --muted: #5b6470;
  --primary: #1d5f7a; --primary-soft: #e4eef2; --on-primary: #ffffff;
  --green: #1f7a3d; --green-soft: #e3f1e7; --red: #a63d3d; --red-soft: #f8e7e5;
  --gold: #8a6420; --gold-soft: #f6eedd; --violet: #5d4b8a; --violet-soft: #eeeaf5;
  --blue: var(--primary); --blue-soft: var(--primary-soft);
  --shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 6px 18px rgba(31, 35, 40, .05);
  --radius: 14px;
  --de: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --fa: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15181b; --paper: #1d2125; --soft: #262a2f; --line: #353b42; --ink: #e8e6e1; --muted: #a3abb4;
  --primary: #6fb3cf; --primary-soft: #1f3540; --on-primary: #0f1d24;
  --green: #6cc58c; --green-soft: #1b3225; --red: #e48e8e; --red-soft: #3a2224;
  --gold: #d8b46a; --gold-soft: #332b1c; --violet: #b9a8e6; --violet-soft: #2a2438;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--fa); line-height: 1.6; padding-bottom: 70px; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
[lang="de"], .de-txt { font-family: var(--de); }
.fa, [lang="fa"] { font-family: var(--fa); direction: ltr; text-align: left; }
.ltr { direction: ltr; text-align: left; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
h1, h2, h3 { line-height: 1.35; }

/* ---------- app header (same on every page) ---------- */
.apphead { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.ah-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 8px; }
.ah-title { font-weight: 700; font-size: 1.05rem; font-family: var(--de); direction: ltr; }
.ah-tools { display: flex; gap: 8px; align-items: center; }
.ah-tools select, .ah-tools button { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px 12px; cursor: pointer; min-height: 40px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: 8px 15px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.tabs a:hover { background: var(--soft); }
.tabs a.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* page title block */
.ptitle { padding: 18px 0 4px; }
.ptitle h1 { margin: 0; font-size: clamp(1.2rem, 3vw, 1.55rem); }
.ptitle .sub { color: var(--muted); font-size: .95rem; }

/* ---------- generic components ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--soft); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.pill.green { border-color: var(--green); color: var(--green); background: var(--paper); }
.pill.red { border-color: var(--red); color: var(--red); background: var(--paper); }
.pill.blue { border-color: var(--primary); color: var(--primary); background: var(--paper); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted); white-space: nowrap; }
.chip.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px 14px; cursor: pointer; font-size: .92rem; min-height: 38px; }
.btn:hover { border-color: var(--primary); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
a.btn.primary { color: var(--on-primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
:root[data-theme="dark"] .btn.green, :root[data-theme="dark"] .btn.red { color: #111; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .82rem; }
.btn[disabled] { opacity: .45; cursor: default; }
.note { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.note h3 { margin: 0 0 4px; font-size: 1rem; }
.quick { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.quick h3 { margin: 0; font-size: 1rem; display: inline; }
.quick summary { cursor: pointer; list-style: none; }
.quick summary::-webkit-details-marker { display: none; }
.quick summary::after { content: " ▾"; color: var(--muted); }
.quick[open] summary { margin-bottom: 6px; }
.quick[open] summary::after { content: " ▴"; }
.quick ol { margin: 0; padding: 0 20px 0 0; }
.quick li { margin: 3px 0; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.green > i { background: var(--green); }
input[type=text], input[type=search], input[type=date], input[type=number], input[type=url], select.inp, textarea {
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 11px; min-height: 40px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }

/* small speaker (TTS) */
.spk { border: 0; background: none; cursor: pointer; font-size: .9em; padding: 0 3px; opacity: .7; vertical-align: baseline; }
.spk:hover { opacity: 1; }

/* ---------- Stimme panel ---------- */
.voice-fab { position: fixed; right: 16px; bottom: 76px; z-index: 60; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); cursor: pointer; font-size: .9rem; font-family: var(--de); }
.voice-panel { position: fixed; right: 16px; bottom: 124px; z-index: 61; width: min(340px, calc(100vw - 32px)); padding: 14px; display: none; font-family: var(--de); }
.voice-panel.open { display: block; }
.voice-panel label { font-size: .82rem; color: var(--muted); display: block; margin: 8px 0 4px; }
.voice-panel select, .voice-panel input[type=range] { width: 100%; }
.voice-panel .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- focus timer bar (bottom) ---------- */
.tbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--paper); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .04); }
.tbar .wrap { display: flex; align-items: center; gap: 10px; min-height: 58px; direction: ltr; }
.tb-time { font-family: var(--de); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25rem; min-width: 64px; text-align: center; }
.tb-mode { font-size: .85rem; color: var(--muted); }
.tb-mode b { color: var(--primary); }
.tbar.brk .tb-mode b { color: var(--green); }
.tb-today { margin-right: auto; font-size: .85rem; color: var(--muted); }
.tbar .btn { min-height: 36px; padding: 5px 12px; white-space: nowrap; }
#sb2-toast { position: fixed; left: 50%; bottom: 74px; transform: translate(-50%, 30px); opacity: 0; transition: .25s;
  background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 999px; font-size: .9rem; z-index: 90; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#sb2-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .ah-title { font-size: 1rem; } .ah-sub { display: none; }
  .tb-today, .tb-len { display: none; }
  .tbar .wrap { gap: 7px; }
  .voice-fab { padding: 7px 11px; font-size: .82rem; }
}
