/* telc B1 Prep — styles */
:root {
  --paper: #f6f1e8;
  --paper-2: #efe8db;
  --surface: #fffdf8;
  --ink: #1d2230;
  --ink-2: #4a5160;
  --ink-3: #7a8191;
  --line: #ddd4c4;
  --accent: #b8431f;      /* brick */
  --accent-2: #2f6f73;    /* teal */
  --accent-3: #e9c46a;    /* highlighter */
  --ok: #2e7d4f;
  --warn: #c98a12;
  --bad: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29,34,48,.06), 0 6px 20px rgba(29,34,48,.05);
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15181e; --paper-2: #1b1f27; --surface: #1f242d;
    --ink: #e9e4da; --ink-2: #b6b0a4; --ink-3: #847e73; --line: #2f3540;
    --accent: #e0683f; --accent-2: #5fb0b4; --accent-3: #d8b24f;
    --ok: #5cbf86; --warn: #e0a93a; --bad: #e46a63;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --paper: #15181e; --paper-2: #1b1f27; --surface: #1f242d;
  --ink: #e9e4da; --ink-2: #b6b0a4; --ink-3: #847e73; --line: #2f3540;
  --accent: #e0683f; --accent-2: #5fb0b4; --accent-3: #d8b24f;
  --ok: #5cbf86; --warn: #e0a93a; --bad: #e46a63;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.2em; }
p { margin: 0 0 .9em; }
small, .muted { color: var(--ink-3); }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
ul, ol { padding-left: 1.3em; margin: 0 0 .9em; }
li { margin: .2em 0; }

/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.brand { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; padding: 0 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.brand span { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 500; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.active { background: var(--accent); color: #fff; }
.nav .grp { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 4px; }
.nav .num { margin-left: auto; font-size: .75rem; opacity: .7; }
.main { padding: 32px 40px 80px; max-width: 1040px; }
.topbar { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { padding: 16px; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .topbar button { font-size: 1.2rem; }
}

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.big { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; font-weight: 700; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .lbl { font-size: .8rem; color: var(--ink-3); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); border-color: transparent; }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); border-color: transparent; }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); border-color: transparent; }
.pill.accent { background: var(--accent); color: #fff; border-color: transparent; }
.pill.teal { background: var(--accent-2); color: #fff; border-color: transparent; }

button, .btn { font: inherit; font-size: .9rem; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover, .btn:hover { border-color: var(--ink-3); }
button.primary { background: var(--accent); color: #fff; border-color: transparent; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: .8rem; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input[type="number"] { width: 90px; }
textarea { width: 100%; min-height: 260px; line-height: 1.6; resize: vertical; font-size: 1rem; }
label { font-size: .85rem; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 4px; }

table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }

.progress { height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent-2); border-radius: 999px; transition: width .3s; }
.progress.accent > i { background: var(--accent); }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { margin-top: 5px; flex: 0 0 auto; accent-color: var(--accent); width: 16px; height: 16px; }
.check.done span { text-decoration: line-through; color: var(--ink-3); }

.callout { border-left: 4px solid var(--accent-3); background: color-mix(in srgb, var(--accent-3) 14%, transparent); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; }
.callout.red { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.callout.teal { border-left-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, transparent); }

details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin: 8px 0; }
details > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::before { content: "▸"; color: var(--accent); font-size: .9em; }
details[open] > summary::before { content: "▾"; }
details > .body { padding: 4px 14px 14px; }

.week { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.week > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--paper-2); cursor: pointer; }
.week > header h3 { margin: 0; font-size: 1.05rem; }
.week.current > header { background: color-mix(in srgb, var(--accent-3) 35%, var(--paper-2)); }
.week .sessions { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; }
.session { padding: 12px 16px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.session:last-child { border-right: 0; }
.session h4 { margin: 0 0 2px; font-size: 1rem; }
.session .when { font-size: .78rem; color: var(--ink-3); margin-bottom: 6px; }
.session.today { background: color-mix(in srgb, var(--accent-3) 18%, transparent); }
.session.past-missed h4::after { content: " · übersprungen"; color: var(--bad); font-size: .75rem; font-family: var(--font-body); font-weight: 500; }

.timer { font-family: var(--font-mono); font-size: 2.4rem; font-weight: 700; letter-spacing: .02em; }
.timer.over { color: var(--bad); }
.pre { white-space: pre-wrap; font-family: inherit; line-height: 1.6; }

.quiz .q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.quiz .q:last-child { border-bottom: 0; }
.quiz .opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.quiz .opts label { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .92rem; color: var(--ink); background: var(--surface); }
.quiz .opts input { display: none; }
.quiz .opts input:checked + span { font-weight: 700; }
.quiz .opts label.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.quiz .opts label.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.quiz .opts label.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.quiz .expl { font-size: .88rem; color: var(--ink-2); margin-top: 6px; display: none; }
.quiz.graded .expl { display: block; }
.gap { display: inline-block; min-width: 110px; margin: 0 2px; }
.gap select { padding: 2px 6px; font-size: .95rem; }
.gap.right select { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.gap.wrong select { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.wordbank { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wordbank span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; background: var(--paper-2); }

.flash { perspective: 1000px; }
.flash .face { min-height: 180px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; font-size: 1.3rem; font-family: var(--font-display); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.flash .face.back { background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); }
.flash .face.back { flex-direction: column; align-items: stretch; cursor: default; }
.flash .cb-main { text-align: center; padding: 6px 0 4px; }
.flash .cb-more { font-family: var(--font-body); font-size: .95rem; text-align: left; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: grid; gap: 8px; }
.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-refl { font-size: .85rem; color: var(--ink-2); }
.cb-ex { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cb-ex li { display: flex; gap: 8px; align-items: flex-start; }
.cb-ex li > span { display: flex; flex-direction: column; min-width: 0; }
.cb-ex .de { color: var(--ink); }
.cb-ex .en { color: var(--ink-3); font-size: .85rem; }
.cb-note { font-size: .88rem; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent-3) 22%, transparent); color: var(--ink); }
.cb-det { margin-top: 4px; font-size: .9rem; } .cb-det summary { cursor: pointer; color: var(--accent-2); font-size: .82rem; } .cb-det .cb-ex, .cb-det .cb-note { margin-top: 6px; }
.art { font-weight: 600; }
.art-der { color: #2b6cb0; } .art-die { color: var(--bad); } .art-das { color: var(--ok); }
[data-theme="dark"] .art-der { color: #7fb2ec; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .art-der { color: #7fb2ec; } }

.rubric select { width: 100%; }
.score-big { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.chart { width: 100%; height: auto; }
.chart text { font-family: var(--font-body); font-size: 11px; fill: var(--ink-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button.active { background: var(--ink); color: var(--paper); border-color: transparent; }

.status-sel { font-size: .8rem; padding: 3px 8px; }
button.say { padding: 1px 7px; font-size: .75rem; line-height: 1.4; border-radius: 6px; color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); vertical-align: middle; }
button.say:hover { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
details > .body p { margin-bottom: .7em; }
details > .body h4 { font-size: 1rem; margin-bottom: .3em; }
.quiz .opts input[type=text], .quiz input[data-gin] { font-size: .95rem; }
.status-ok { color: var(--ok); } .status-learn { color: var(--warn); } .status-open { color: var(--ink-3); }
.two { columns: 2; column-gap: 28px; }
@media (max-width: 700px) { .two { columns: 1; } }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: .9rem; opacity: 0; transform: translateY(10px); transition: all .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: none; }
.mat-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mat-item:last-child { border-bottom: 0; }
.mat-item input { margin-top: 5px; accent-color: var(--accent-2); }
.mat-item .n { font-weight: 600; }
.mat-item .w { font-size: .9rem; color: var(--ink-2); }
.mat-item .t { font-size: .78rem; color: var(--ink-3); }
.printonly { display: none; }
@media print {
  .side, .topbar, button, .noprint { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .printonly { display: block; }
}

/* ---------- lesson stepper ---------- */
.lesson-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
@media (min-width: 861px) { .lesson-head { position: sticky; top: 0; z-index: 5; } }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step > header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.step > header h3 { margin: 0; font-size: 1.02rem; }
.step > header small { color: var(--ink-3); font-size: .8rem; }
.step .st-title { flex: 1; min-width: 0; }
.step .st-toggle { color: var(--ink-3); }
.step .num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.step.current .num { background: var(--accent); color: #fff; border-color: transparent; }
.step.done .num { background: var(--ok); color: #fff; border-color: transparent; }
.step.done > header h3, .step.skipped > header h3 { color: var(--ink-3); }
.step.skipped .num { background: var(--paper-2); color: var(--ink-3); }
.step.optional:not(.done) > header h3::after { content: " · optional"; font-family: var(--font-body); font-size: .75rem; font-weight: 500; color: var(--warn); }
.step > .body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.step > .body > footer { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lesson-summary { border-color: var(--ok); }
.quiz .opts.col { flex-direction: column; align-items: flex-start; }
.timerbox .timer { font-size: 1.6rem; }
/* plan rows */
.weeklabel { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 4px; }
.lrow { display: grid; grid-template-columns: 36px 120px minmax(0, 1fr) 64px 92px; gap: 10px; align-items: center; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; color: var(--ink); text-decoration: none; }
.lrow:hover { border-color: var(--ink-3); }
.lrow.today { border-color: var(--accent); background: color-mix(in srgb, var(--accent-3) 18%, var(--surface)); }
.lrow .ln { font-weight: 700; color: var(--ink-3); font-family: var(--font-mono); }
.lrow small { display: block; font-size: .76rem; color: var(--ink-3); }
.lrow .lt { min-width: 0; } .lrow .lt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .ls { text-align: right; }
.lrow.erledigt { opacity: .75; }
@media (max-width: 640px) { .lrow { grid-template-columns: 30px 82px minmax(0, 1fr); } .lrow .lm, .lrow .ls { display: none; } }
/* settings days */
.days { display: flex; flex-direction: column; gap: 6px; }
.dayrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; opacity: .6; }
.dayrow.on { opacity: 1; }
.card.setup { border-color: var(--accent); }
.gramgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gcell { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--paper-2); font-size: .88rem; }
.gcell small { display: block; color: var(--ink-3); font-size: .75rem; }
.gcell.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.gcell.part { border-color: var(--warn); }
.pill.status-ok { color: var(--ok); } .pill.status-learn { color: var(--warn); }
.info p { margin-bottom: .8em; }
.mock-sec { border-left: 3px solid var(--line); padding-left: 12px; margin: 10px 0; }
@media (max-width: 860px) { .main { max-width: 100vw; overflow-x: hidden; } table { font-size: .86rem; } .step > .body { padding: 4px 10px 12px; } }
.lrow.short { background: var(--paper-2); padding-top: 6px; padding-bottom: 6px; }
.lrow.short .lt b { font-weight: 500; color: var(--ink-2); }
.tok { cursor: pointer; border-radius: 4px; padding: 0 1px; }
.tok:hover { background: color-mix(in srgb, var(--accent-3) 30%, transparent); }
.tok.picked { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.tok.hit { background: color-mix(in srgb, var(--ok) 30%, transparent); }
.tok.miss { background: color-mix(in srgb, var(--bad) 30%, transparent); text-decoration: underline wavy var(--bad); }
.tok.fa { text-decoration: line-through; }
.fehlerbrief .pre { line-height: 1.9; }
.gapno { color: var(--accent); }
.sbl .quiz .q { padding: 6px 0; }
.partner { border-color: var(--accent-2); }
