:root {
  --bg: #f3f7fe;
  --paper: #ffffff;
  --ink: #16233d;
  --muted: #5d6e8c;
  --line: #dde5f2;
  --accent: #1559c4;
  --accent-dark: #0f47a1;
  --accent-ink: #ffffff;
  --accent-soft: #e7effd;
  --field: #eef3fb;
  --ok: #17864a;
  --ok-soft: #e1f4e9;
  --bad: #c62828;
  --bad-soft: #fbe5e5;
  --warn: #b26a00;
  --warn-soft: #fff3df;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(21, 60, 140, 0.05), 0 8px 26px rgba(21, 60, 140, 0.07);
  --shadow-lg: 0 24px 60px rgba(17, 52, 120, 0.14);
  --serif: "Georgia", "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: linear-gradient(180deg, #eff5fe 0%, #f7fafe 38%, #f3f7fe 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; }
p { margin: 0 0 0.9em; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 10px 22px;
}
.topbar .brand { font-weight: 800; font-size: 19px; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em; }
.topbar .brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2f74e0, #1147a6); color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 4px 10px rgba(17, 71, 166, 0.35);
}
.topbar .brand .badge { background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(21, 89, 196, 0.25); }
/* landing page: the bar floats over the decorated background */
body.auth-mode .topbar { background: transparent; border-bottom: 0; backdrop-filter: none; padding: 18px 26px; }
.topbar nav { display: flex; gap: 4px; margin-inline-start: 8px; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { background: var(--accent-soft); color: var(--accent); }
.topbar .spacer { flex: 1; }
.timer {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  padding: 6px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.timer small { font-family: var(--sans); font-weight: 500; font-size: 12px; color: var(--muted); }
.timer.low { background: var(--bad-soft); color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }
.container.wide { max-width: 1280px; }
.grid { display: grid; gap: 18px; }
/* min(…, 100%) and min-width: 0 keep wide content (tables) from stretching the page beyond a phone screen */
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid > *, .src-grid > * { min-width: 0; }

.card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px;
}
.card.accent { border-top: 0; box-shadow: var(--shadow), inset 0 0 0 2px var(--accent-soft); }
.card h2 { font-size: 20px; }
.card.accent { border-top: 4px solid var(--accent); }
.card.ok { border-top: 4px solid var(--ok); }
.card.bad { border-top: 4px solid var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.right { margin-inline-start: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover { background: #f2f6fd; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 6px 16px rgba(21, 89, 196, 0.25); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.big { padding: 14px 24px; font-size: 17px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.spinner { display: inline-block; vertical-align: middle; flex: 0 0 auto; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- countdown / dashboard ---------- */
.countdown { display: flex; gap: 16px; align-items: baseline; }
.countdown .num { font-size: 56px; font-weight: 800; color: var(--accent); line-height: 1; }
.countdown .lbl { font-size: 15px; color: var(--muted); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 28px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.list tr:hover td { background: #f7f9fc; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- exam paper ---------- */
.exam-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.exam-head h1 { font-size: 22px; margin: 0; }
.exam-head .sub { color: var(--muted); }
.teil-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.teil-tabs button {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper);
  font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: center;
}
.teil-tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.teil-tabs button .cnt { font-size: 11px; background: rgba(0,0,0,0.08); padding: 1px 7px; border-radius: 999px; }
.teil-tabs button.active .cnt { background: rgba(255,255,255,0.25); }
.teil-tabs button.done .cnt { background: var(--ok); color: #fff; }

.paper {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 40px; position: relative;
}
.paper .paper-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px;
}
.paper .paper-head .mod { font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.paper .paper-head .teil { font-weight: 700; }
.paper .anweisung {
  background: #f4f6f9; border-left: 4px solid var(--ink); padding: 10px 14px; margin-bottom: 20px; font-size: 14.5px;
}
.paper .anweisung .zeit { float: right; color: var(--muted); font-size: 13px; }
.lesetext { font-family: var(--serif); font-size: 16px; line-height: 1.65; }
.lesetext h3 { font-family: var(--sans); font-size: 16px; margin-bottom: 8px; }
.lesetext p { margin-bottom: 0.8em; }
.lesetext + .lesetext { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .paper { padding: 22px 18px; } }

.items { display: flex; flex-direction: column; gap: 14px; }
.item {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
}
.item.answered { border-color: #b7c9e2; background: #fbfcfe; }
.item .q { display: flex; gap: 10px; margin-bottom: 8px; }
.item .q .nr { font-weight: 800; min-width: 28px; color: var(--accent); }
.item .q .autor { font-weight: 700; margin-right: 6px; }
.item .opts { display: flex; flex-direction: column; gap: 6px; padding-left: 38px; }
.item .opts.inline { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; user-select: none;
}
.opt:hover { background: #f3f6fa; }
.opt .box {
  width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 4px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px;
  background: #fff;
}
.opt.selected .box { background: var(--ink); color: #fff; }
.opt.selected { background: var(--accent-soft); border-color: #b7c9e2; }
.opt.correct .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.correct { background: var(--ok-soft); }
.opt.wrong .box { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.wrong { background: var(--bad-soft); }

.anzeigen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
@media (max-width: 700px) { .anzeigen { grid-template-columns: 1fr; } }
.anzeige { border: 1px solid var(--ink); padding: 10px 12px; font-size: 14px; font-family: var(--serif); position: relative; background: #fffdf7; }
.anzeige .id { position: absolute; top: -10px; left: 10px; background: var(--ink); color: #fff; font-family: var(--sans); font-weight: 800; padding: 0 8px; border-radius: 4px; font-size: 13px; }

.thema-box { border: 2px solid var(--ink); padding: 12px 16px; margin-bottom: 18px; font-weight: 700; font-size: 17px; text-align: center; }

/* ---------- schreiben ---------- */
.aufgabe-box { border: 1px solid var(--ink); padding: 16px 20px; margin-bottom: 16px; font-size: 15.5px; }
.aufgabe-box ul { margin: 8px 0 0; padding-left: 22px; }
.aufgabe-box li { margin-bottom: 4px; }
.aufgabe-box .meinung { font-family: var(--serif); font-style: italic; background: #f8f8f4; padding: 10px 14px; margin: 10px 0; border-left: 3px solid var(--ink); }
textarea.antwort {
  width: 100%; min-height: 320px; padding: 16px; font-family: var(--serif); font-size: 16px; line-height: 1.7;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical;
  background: repeating-linear-gradient(transparent, transparent 26.2px, #eef1f5 26.2px, #eef1f5 27.2px);
  background-attachment: local;
}
textarea.antwort:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.wordcount { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.wordcount b { font-size: 16px; color: var(--ink); }
.wordcount .bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; max-width: 260px; }
.wordcount .bar i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.wordcount .bar i.ok { background: var(--ok); }
.wordcount .bar i.low { background: var(--warn); }

/* ---------- results ---------- */
.verdict { font-size: 26px; font-weight: 800; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.krit-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 16px; }
.krit-table th, .krit-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.krit-table th { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.stufe { display: inline-block; width: 28px; height: 28px; border-radius: 6px; text-align: center; line-height: 28px; font-weight: 800; color: #fff; }
.stufe.A { background: #1f8a4c; } .stufe.B { background: #5aa02c; } .stufe.C { background: #d39a00; } .stufe.D { background: #e0641b; } .stufe.E { background: #c62828; }

.fehler { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 14px; }
.fehler .typ { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted); padding-top: 3px; }
.fehler .erk { text-align: start; }
.fehler .orig { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(198,40,40,0.6); font-family: var(--serif); }
.fehler .korr { color: var(--ok); font-weight: 700; font-family: var(--serif); }
.fehler .erk { grid-column: 2; color: var(--muted); }
.textblock { font-family: var(--serif); white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; line-height: 1.7; }
.textblock.muster { background: #f3faf5; border-color: #bfe3ca; }
.explain { background: var(--warn-soft); border-inline-start: 4px solid var(--warn); padding: 8px 12px; margin-top: 8px; font-size: 14px; border-radius: 6px; }
.explain.ok { background: var(--ok-soft); border-inline-start-color: var(--ok); }
details { margin: 8px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.leitpunkt { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-bottom: 4px; }
.leitpunkt .ic { font-weight: 800; }
.leitpunkt .ic.ok { color: var(--ok); } .leitpunkt .ic.bad { color: var(--bad); }
ul.tipps { padding-left: 20px; }
ul.tipps li { margin-bottom: 4px; }

/* ---------- forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label.field input, label.field select {
  padding: 12px 14px; border: 1px solid transparent; border-radius: 11px; font: inherit;
  background: var(--field); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s;
}
label.field input:focus, label.field select:focus {
  outline: none; background: #fff; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 89, 196, 0.14);
}
label.field input:disabled, label.field select:disabled { color: var(--muted); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.alert.err { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.card.locked { opacity: .72; }

.overlay {
  position: fixed; inset: 0; background: rgba(20, 25, 35, 0.6); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay .card { max-width: 520px; width: 100%; text-align: center; }
.overlay.dlg { z-index: 95; }
.dlg .card { max-width: 440px; text-align: start; }
.dlg-text { white-space: pre-line; margin: 0 0 18px; font-size: 16px; line-height: 1.55; }
.dlg-btns { justify-content: flex-end; gap: 10px; }
.overlay .big-spinner { width: 46px; height: 46px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; margin: 10px auto 16px; animation: spin 0.9s linear infinite; }

.exam-footer { display: flex; gap: 12px; margin-top: 20px; align-items: center; flex-wrap: wrap; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .no-print, .exam-footer { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card, .paper { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; margin-bottom: 14px; }
  details { display: block; }
  details summary { display: none; }
  details > * { display: block; }
  .opt.correct, .opt.wrong, .stufe, .explain { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- header user slot ---------- */
.user-slot { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-slot .who { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- login / landing ---------- */
body.auth-mode { background: linear-gradient(140deg, #e7effd 0%, #f6f9ff 42%, #e9f1fe 100%); background-attachment: fixed; }
.container.auth-page { position: relative; z-index: 1; max-width: 1180px; padding-top: 10px; }

/* decorative background of the landing page – only in the outer margins, never behind the card */

.auth { display: grid; grid-template-columns: 1.08fr .92fr; gap: 54px; align-items: center; margin-top: 18px; }
.auth-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px 32px 26px; border: 1px solid rgba(255,255,255,.7); }
.auth-card .tabs { display: flex; gap: 10px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-card .tabs a { padding: 10px 6px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.auth-card .tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-card label.field { font-size: 14.5px; gap: 8px; margin-bottom: 18px; }
.auth-card .btn.big { border-radius: 12px; font-size: 16px; padding: 15px 24px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; gap: 26px; } .auth-card { padding: 24px 20px; } }

/* ---------- admin charts ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin: 8px 0 4px; border-bottom: 1px solid var(--line); }
.chart .bars i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; opacity: 0.85; }
.chart .bars i:hover { opacity: 1; background: #0a4f95; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .topbar .brand .badge { display: none; }
  .topbar nav { margin-left: 0; gap: 0; }
  .topbar nav a { padding: 6px 8px; font-size: 14px; }
  .user-slot .who b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
  .timer { font-size: 16px; padding: 4px 10px; }
  .container { padding: 14px 12px 60px; }
  .card { padding: 16px 16px; }
  .btn.big { padding: 12px 16px; font-size: 15px; width: 100%; justify-content: center; }
  .exam-footer .btn { flex: 1; justify-content: center; }
  .exam-footer .btn.right { flex-basis: 100%; }
  .countdown .num { font-size: 44px; }
  .item .opts { padding-left: 0; }
  .fehler { grid-template-columns: 1fr; }
  .fehler .erk { grid-column: 1; }
}

/* ---------- icons ---------- */
.ico { flex: 0 0 auto; vertical-align: -0.18em; }
.btn .ico { margin-inline-end: 2px; }
.btn.sm .ico { margin: 0; }
.topbar nav a { display: inline-flex; align-items: center; gap: 7px; }
.topbar nav a .ico { opacity: .75; }
.topbar nav a.active .ico { opacity: 1; }
.pill .ico { vertical-align: -0.15em; }

/* language switcher with flags */
.flag { border-radius: 3px; box-shadow: 0 0 0 1px rgba(20, 40, 80, .12); flex: 0 0 auto; }
.lang-pick { position: relative; }
.lang-btn, .lang-menu button {
  display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 11px;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.lang-btn { box-shadow: 0 2px 8px rgba(21, 60, 140, .07); }
.lang-btn:hover { border-color: #c5d6f2; }
.lang-btn .chev { opacity: .55; margin-inline-start: 2px; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 100%;
}
.lang-menu li { margin: 0; }
.lang-menu button { border: 0; border-radius: 9px; width: 100%; box-shadow: none; }
.lang-menu button:hover { background: var(--accent-soft); }
.lang-menu button.on { color: var(--accent); }
@media (max-width: 720px) { .lang-btn span, .hide-sm { display: none; } }
/* Arabic UI: the Design v2 Arabic face first (it also has Latin letters), then system fallbacks */
html[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif; }
html[dir="rtl"] .aufgabe-box, html[dir="rtl"] .textblock { direction: ltr; text-align: left; }
[dir="auto"] { unicode-bidi: plaintext; }
html[dir="rtl"] .exam-head .sub { direction: ltr; }
html[dir="rtl"] .countdown .num { direction: ltr; }
html[dir="rtl"] input[type="date"], html[dir="rtl"] select { direction: rtl; }
html[dir="rtl"] .krit-table td:last-child { direction: rtl; }

/* ---------- Hören player ---------- */
.player { background: var(--paper); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; position: sticky; top: 58px; z-index: 10; box-shadow: var(--shadow); }
.player-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.player-status { flex: 1; min-width: 200px; font-size: 15px; }
.player-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.player-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.player-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.speaking { display: inline-block; animation: pulse 1s infinite; }
.hoeren-text { margin-bottom: 18px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.hoeren-text h3 { font-size: 15px; margin-bottom: 8px; }
.hoeren-intro { font-style: italic; color: var(--muted); }
.beispiel { background: #eef1f6; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 4px; margin: 0 0 16px; }
.beispiel h4 { font-size: 14px; margin: 0 0 4px; color: var(--muted); }
.beispiel .item { opacity: .85; }
.beispiel .opt { cursor: default; }
.wer-head { display: grid; grid-template-columns: 1fr repeat(3, minmax(90px, 160px)); gap: 6px; font-size: 13px; color: var(--muted); padding: 0 14px 6px; }
.wer-head span b { color: var(--ink); }
.transcript { font-family: var(--serif); font-size: 15px; line-height: 1.6; background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 8px 0 14px; }
.transcript p { margin: 0 0 6px; }
.transcript b { font-family: var(--sans); color: var(--accent); }
.grid.cols-3 label.field { margin-bottom: 8px; }
@media (max-width: 640px) { .player { position: static; } .wer-head { display: none; } }

/* ---------- YouTube player ---------- */
.player.has-video { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: center; }
.yt-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.yt-wrap iframe, .yt-wrap #yt { position: absolute; inset: 0; width: 100%; height: 100%; }
.yt-cover[hidden] { display: none; }
.yt-cover { position: absolute; inset: 0; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; z-index: 2; }
@media (max-width: 760px) { .player.has-video { grid-template-columns: 1fr; } }

/* ---------- coach "Lina": floating helper + guided tour ---------- */
.coach { position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.coach-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid #fff; padding: 0; order: 2;
  background: #e7effd; box-shadow: var(--shadow-lg); display: grid; place-items: center; position: relative;
  transition: transform .15s;
}
.coach-btn:hover { transform: translateY(-2px) scale(1.04); }
.coach-btn .dot { position: absolute; top: 2px; inset-inline-end: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--warn); border: 2px solid #fff; display: none; }
.coach-btn.has-tip .dot { display: block; animation: pulse 1.6s infinite; }
.coach-bubble {
  order: 1; max-width: min(340px, calc(100vw - 32px)); background: var(--paper); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 14.5px; animation: coach-in .22s ease-out;
}
@keyframes coach-in { from { opacity: 0; transform: translateY(8px); } }
.coach-row { display: flex; gap: 10px; align-items: flex-start; }
.coach-row .coach-face { flex: 0 0 auto; }
.coach-text { flex: 1; min-width: 0; }
.coach-x { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; }
.coach-tips { margin: 8px 0 10px; padding-inline-start: 18px; }
.coach-tips li { margin-bottom: 5px; }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coach-hand { transform-origin: 95px 76px; animation: wave 2.2s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(18deg); } 85% { transform: rotate(-12deg); } }

body.tour-open { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 70; }
.tour-dim { position: absolute; inset: 0; background: rgba(12, 26, 54, .55); backdrop-filter: blur(1px); }
.tour-spot {
  position: fixed; border-radius: 14px; box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 0 0 9999px rgba(12,26,54,.55);
  transition: all .25s ease; pointer-events: none;
}
.tour-card {
  position: fixed; width: 380px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 18px 20px 14px; animation: coach-in .2s ease-out;
}
.tour-card.centered { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(430px, calc(100vw - 32px)); bottom: auto; }
.tour-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.tour-head h3 { font-size: 18px; margin: 2px 0 0; }
.tour-card p { font-size: 15px; color: var(--ink); }
.tour-dots { display: flex; gap: 6px; margin: 4px 0 12px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }
.tour-btns { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .coach { inset-block-end: 14px; inset-inline-end: 14px; }
  .coach-btn { width: 52px; height: 52px; }
  .tour-card, .tour-card.centered { width: calc(100vw - 24px) !important; left: 12px !important; right: 12px; }
}

/* ================= phones (most visitors come from Facebook on a phone) ================= */
.jump-btn { display: none; }
@media (max-width: 900px) {
  .jump-btn {
    display: inline-flex; align-items: center; gap: 6px; position: fixed; z-index: 45;
    left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
    padding: 11px 18px; border: 0; border-radius: 999px; font: inherit; font-weight: 700; font-size: 15px;
    background: var(--ink); color: #fff; box-shadow: 0 10px 26px rgba(10, 26, 56, .35); white-space: nowrap;
  }
}
@media (max-width: 640px) {
  /* no zoom on focus in iOS: form fields need 16px */
  label.field input, label.field select, textarea, .lang-btn { font-size: 16px; }

  /* compact one-row header, navigation as a bottom tab bar */
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; backdrop-filter: none; background: #fff; }
  .topbar .brand .brand-name { font-size: 17px; }
  body.in-exam .topbar .brand .brand-name { display: none; }
  .user-slot { gap: 6px; }
  .user-slot .who b { display: none; }
  .user-slot .btn.sm { padding: 7px 9px; }
  .lang-btn { padding: 7px 9px; }
  .topbar nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 0;
    display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(21, 60, 140, .06);
  }
  .topbar nav:empty, body.in-exam .topbar nav { display: none; }
  .topbar nav a { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11.5px; border-radius: 10px; text-align: center; }
  .topbar nav a .ico { width: 22px; height: 22px; opacity: .8; }
  body:not(.auth-mode):not(.in-exam) .container { padding-bottom: 96px; }
  .coach { inset-block-end: calc(82px + env(safe-area-inset-bottom)); }
  body.in-exam .jump-btn { bottom: calc(16px + env(safe-area-inset-bottom)); }

  /* landing: title, then straight to the sign-up form, then the arguments */
  .auth { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 4px; }
  .auth-card { order: 3; }

  /* bigger touch targets */
  .opt { min-height: 46px; align-items: center; padding: 10px 12px; }
  .teil-tabs button { padding: 10px 12px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }

  /* tour as a bottom sheet */
  .tour-card.sheet, .tour-card.centered {
    left: 10px !important; right: 10px !important; width: auto !important; top: auto !important; transform: none !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important; border-radius: 20px; padding: 16px 16px 12px;
  }
  .tour-cta { width: 100%; justify-content: center; margin: 2px 0 12px; }
}
.tour-cta { width: 100%; justify-content: center; margin: 2px 0 12px; }

/* ================= dashboard (simple version) ================= */
.dash-h { font-size: 18px; margin: 6px 2px 10px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.tile h3 { font-size: 18px; margin: 4px 0 0; }
.tile-sub { margin: 0; min-height: 2.6em; }
.tile-warn { margin: 0; color: var(--bad); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tile-ico.lesen { background: linear-gradient(145deg, #2f74e0, #1147a6); }
.tile-ico.hoeren { background: linear-gradient(145deg, #8b5cf6, #5b32c9); }
.tile-ico.schreiben { background: linear-gradient(145deg, #10b981, #047857); }
.tile-ico.komplett { background: linear-gradient(145deg, #334155, #0f172a); }
.tile-opts { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.tile-opts:hover { color: var(--accent); border-color: #c5d6f2; }
.tile-go { margin-top: auto; justify-content: center; }

.prog-row { display: grid; grid-template-columns: 86px 1fr 34px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.prog-l { font-weight: 600; }
.prog-v { font-weight: 800; text-align: end; }
.prog-bar { position: relative; height: 10px; background: #e8eef8; border-radius: 99px; overflow: hidden; }
.prog-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: #c9d6ea; }
.prog-bar i.ok { background: var(--ok); } .prog-bar i.bad { background: #f59e0b; }
.prog-60 { position: absolute; inset-block: -2px; inset-inline-start: 60%; width: 2px; background: rgba(22, 35, 61, .35); }

.res-list { display: flex; flex-direction: column; gap: 8px; }
.res-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.res-row:hover { background: #f5f8fe; }
.res-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.res-pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.opts-overlay .opts-card { text-align: start; max-width: 440px; }

/* WhatsApp next to the coach */
.wa-btn { order: 2; width: 50px; height: 50px; border-radius: 50%; border: 0; background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .35); cursor: pointer; transition: transform .15s; }
.wa-btn:hover { transform: translateY(-2px) scale(1.04); }
.wa-btn[hidden] { display: none; }
.coach-btn { order: 3; }
.wa-opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 2px; }
.wa-opts .btn { justify-content: flex-start; }

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; }
  .tile h3 { font-size: 16px; }
  .tile-ico { width: 36px; height: 36px; }
  .tile-sub { font-size: 12.5px; }
  .tile .btn.tile-go { min-height: 40px; padding: 8px 10px; font-size: 14px; width: 100%; }
  .wa-btn { width: 46px; height: 46px; }
}

/* ================= Premium page ================= */
.premium { max-width: 760px; margin: 0 auto; }
.premium-hero h1 { font-size: 28px; margin: 10px 0 6px; }
.premium-price { display: flex; align-items: baseline; gap: 10px; margin: 6px 0; }
.premium-price b { font-size: 46px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.premium-price span { font-size: 17px; color: var(--muted); font-weight: 600; }
.premium .features { list-style: none; padding: 0; margin: 16px 0 0; }
.premium .features li { padding: 7px 0; padding-inline-start: 30px; position: relative; }
.premium .features li::before { content: "\2713"; position: absolute; inset-inline-start: 0; color: var(--ok); font-weight: 800; font-size: 18px; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step h3 { margin: 2px 0 4px; font-size: 17px; }
.step p { margin: 0 0 10px; }
.step-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent); }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, .3); }
.btn.wa:hover { background: #1ebe5a; }
a.pill { text-decoration: none; }
@media (max-width: 640px) { .premium-price b { font-size: 38px; } .btn.wa.big { width: 100%; justify-content: center; } }

/* ================= Messages from the team + WhatsApp number (dashboard) ================= */
.phone-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.phone-form input { flex: 1 1 180px; min-width: 0; padding: 11px 14px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: 16px; background: var(--field); color: var(--ink); }
.phone-form input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 89, 196, .14); }

/* ================= Admin → Clients ================= */
.crm-live { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.crm-live span { display: inline-flex; align-items: center; gap: 6px; }
.dot-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); margin-inline-end: 6px; vertical-align: 1px; }
.crm-quick { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.crm-quick > b { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.seg-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: thin; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 13.5px; font-weight: 600; }
.seg-btn b { background: var(--field); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.seg-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-btn.on b { background: rgba(255, 255, 255, .22); }
.crm-bar { margin-bottom: 10px; }
.crm-list { display: flex; flex-direction: column; gap: 8px; }
.crm-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.crm-row:hover { background: #f8faff; }
.crm-score { flex: 0 0 52px; height: 52px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.crm-score b { font-size: 19px; }
.crm-score span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.crm-score.hot { background: #fde8e4; color: #c2410c; }
.crm-score.warm { background: var(--warn-soft); color: var(--warn); }
.crm-score.cold { background: #eef2f7; color: #64748b; }
.crm-who { flex: 1; min-width: 0; }
.crm-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-contact { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-sig { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #eef2f8; color: var(--ink); white-space: nowrap; }
.chip.strong { font-weight: 700; }
.chip.muted { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.crm-act { display: flex; gap: 6px; flex: 0 0 auto; }
.crm-act .btn { text-decoration: none; }
.crm-act .btn.wa { box-shadow: none; }
.crm-more { align-self: center; margin-top: 4px; }
.crm-compose textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); resize: vertical; margin-bottom: 8px; }
@media (max-width: 640px) {
  .crm-row { flex-wrap: wrap; align-items: flex-start; }
  .crm-score { flex-basis: 46px; height: 46px; }
  .crm-who { flex-basis: calc(100% - 60px); }
  .crm-act { width: 100%; justify-content: flex-end; }
  .crm-act .btn { min-width: 44px; justify-content: center; }
}
/* admins have a 4th menu entry: on medium screens show the icons only so the bar does not overflow */
@media (min-width: 641px) and (max-width: 1180px) { .topbar nav:has(a:nth-child(4)) a span { display: none; } }
/* long e-mail addresses must not push the admin tables wider than a phone screen */
table.list span[dir="ltr"], table.list a[dir="ltr"] { overflow-wrap: anywhere; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ================= Free plan (after the free week) ================= */
.free-list { list-style: none; padding: 0; margin: 6px 0 10px; }
.free-list li { padding: 4px 0; padding-inline-start: 26px; position: relative; }
.free-list li::before { content: "\2713"; position: absolute; inset-inline-start: 0; color: var(--ok); font-weight: 800; }
.free-box h2, .free-box h3 { margin-bottom: 6px; }
.free-hint { margin: 0; color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 4px; }
a.tile-go { text-decoration: none; }

/* ================= Schreiben helper: phrases, starter, umlauts ================= */
.write-help { margin: 10px 0 8px; font-family: var(--sans); }
.umlaut-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.umlaut-bar .key { min-width: 38px; height: 38px; border: 1px solid var(--line); background: var(--paper); border-radius: 9px; font-size: 17px; font-weight: 600; color: var(--ink); }
.umlaut-bar .key:active { background: var(--accent-soft); }
.write-help .starter { margin-bottom: 8px; }
.phrases { border: 1px solid var(--line); border-radius: 12px; background: #f8faff; padding: 8px 12px; }
.phrases summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--accent); }
.ph-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.ph-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 74px; }
.ph { border: 1px solid #cfdcf3; background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 11px; font-size: 13.5px; text-align: start; }
.ph:hover { border-color: var(--accent); }
.ph:active { background: var(--accent-soft); }
@media (max-width: 640px) {
  /* one scrolling row per group keeps the answer field close */
  .umlaut-bar, .ph-group { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .ph-label { min-width: 0; flex: 0 0 auto; }
  .ph, .umlaut-bar .key { flex: 0 0 auto; white-space: nowrap; }
  .umlaut-bar .key { min-width: 40px; height: 40px; }
  .write-help .starter { width: 100%; justify-content: center; }
}
@media print { .write-help { display: none; } }

/* ================= Timer options (hide / no time limit) ================= */
.timer { cursor: pointer; user-select: none; }
.timer.free { background: var(--ok-soft); color: var(--ok); }
.timer-menu { position: fixed; top: 64px; inset-inline-end: 12px; z-index: 60; width: min(320px, calc(100vw - 24px)); padding: 12px 14px; box-shadow: var(--shadow-lg); }
.tm-row { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 14.5px; margin: 6px 0; cursor: pointer; }
.tm-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ================= Target exam question + ad sources ================= */
.target-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.target-btn { border: 1px solid #c5d6f2; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14.5px; }
.target-btn:hover, .target-btn:active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ref-builder { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ref-builder input, .ref-builder select { width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); color: var(--ink); }
.ref-builder select { width: auto; }
.ref-builder code { flex: 1; min-width: 0; background: var(--field); padding: 7px 10px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.tgt-row { grid-template-columns: 110px 1fr 34px; }

/* ================= Mes mots: translation mode, popup, list ================= */
.vocab-dock { position: fixed; z-index: 44; inset-inline-start: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); }
.vocab-fab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 46px; height: 46px; padding: 0;
  border-radius: 999px; border: 1px solid #c5d6f2; background: var(--paper); color: var(--accent); font: inherit; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 22px rgba(21, 60, 140, .18); opacity: .92; }
.vocab-fab.on { width: auto; padding: 0 14px; background: #f59e0b; border-color: #f59e0b; color: #fff; opacity: 1; }
.vocab-x { position: absolute; top: -7px; inset-inline-end: -7px; width: 22px; height: 22px; padding: 0; border: 2px solid var(--paper); border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center; }
.vocab-tab { position: fixed; z-index: 44; inset-inline-start: 0; bottom: calc(24px + env(safe-area-inset-bottom)); width: 20px; height: 42px; padding: 0;
  border: 0; border-start-end-radius: 10px; border-end-end-radius: 10px; background: var(--accent); color: #fff; opacity: .55; display: grid; place-items: center; }
.vocab-tab:hover, .vocab-tab:active { opacity: 1; }
body.vocab-mode .paper { cursor: help; }
body.vocab-mode .paper .opt { cursor: help; }
mark.vocab-mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 #f5c518; cursor: pointer; }
.vocab-pop { position: fixed; z-index: 70; padding: 12px 14px; box-shadow: var(--shadow-lg); text-align: start; }
.vocab-entry .vocab-lemma { font-size: 17px; }
.vocab-ar { font-size: 19px; font-weight: 700; margin-top: 6px; font-family: "Segoe UI", Tahoma, sans-serif; }
.vocab-fr { color: var(--muted); margin-top: 2px; }
.vocab-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.words-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.word-row { padding: 14px 16px; }
.word-ctx { margin: 8px 0; }
.words-page #wsearch { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; max-width: 200px; }
@media (max-width: 640px) {
  body.in-exam .vocab-dock, body.in-exam .vocab-tab { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .words-list { grid-template-columns: 1fr; }
}
@media print { .vocab-dock, .vocab-tab { display: none; } mark.vocab-mark { background: none; box-shadow: none; } }
.src-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .src-grid { grid-template-columns: minmax(0, 1fr); } }

/* ================= Sprechen ================= */
.tile-ico.sprechen { background: linear-gradient(145deg, #f59e0b, #d97706); }
.sp-tabs a { text-decoration: none; }
.sp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.sp-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.sp-card:hover { box-shadow: var(--shadow-lg); }
.sp-card.locked { opacity: .65; }
.sp-num { flex: 0 0 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.sp-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-card-main .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-go { color: var(--muted); transform: rotate(-90deg); }
[dir="rtl"] .sp-go { transform: rotate(90deg); }
.sp-nav { margin-bottom: 12px; }
.sp-nav a { text-decoration: none; }
.sp-notiz { background: #fff8d6; border: 1px solid #f2df8a; border-radius: 4px; padding: 12px 16px; max-width: 420px; transform: rotate(-.6deg); box-shadow: 0 6px 14px rgba(120, 100, 20, .12); font-family: var(--serif); }
.sp-notiz ul { margin: 6px 0 0; padding-inline-start: 20px; }
.sp-dialog { display: flex; flex-direction: column; gap: 8px; }
.sp-line { display: flex; gap: 10px; align-items: flex-start; }
.sp-line p { margin: 0; padding: 8px 12px; border-radius: 12px; background: #f1f5fb; max-width: 85%; }
.sp-line.b { flex-direction: row-reverse; }
.sp-line.b p { background: #e7f6ee; }
.sp-who { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--accent); font-family: var(--sans); }
.sp-line.b .sp-who { background: var(--ok); }
.sp-folien { display: grid; gap: 10px; margin-top: 12px; }
.sp-folie { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfe; }
.sp-fnum { display: inline-block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-inline-end: 8px; font-family: var(--sans); }
.sp-h3 { font-size: 15px; margin: 14px 0 8px; font-family: var(--sans); }
.sp-q { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: #fbfcfe; }
.sp-q summary { cursor: pointer; font-weight: 600; }
.sp-q p { margin: 8px 0 0; color: var(--ok); }
.sp-rm-teil { font-family: var(--sans); font-weight: 800; color: var(--accent); margin: 12px 0 4px; }
.sp-rm-teil:first-child { margin-top: 0; }
.sp-rm-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ph.static { cursor: default; white-space: normal; flex: 0 1 auto; max-width: 100%; }
@media (max-width: 640px) {
  .sp-line p { max-width: 100%; }
  .sp-notiz { transform: none; }
}
/* outside an exam the bottom tab bar is visible on phones: keep the translate button above it */
@media (max-width: 640px) {
  body:not(.in-exam) .vocab-dock, body:not(.in-exam) .vocab-tab { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* Sprechen – guided flow */
.sp-h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sp-tabline { margin: 8px 0 12px; }
.sp-card.done .sp-num { background: var(--ok-soft); color: var(--ok); }
.sp-dialog[data-role="A"] .sp-line[data-who="A"]:not(.shown) p,
.sp-dialog[data-role="B"] .sp-line[data-who="B"]:not(.shown) p { filter: blur(5px); cursor: pointer; user-select: none; }
.sp-folie { display: block; width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.sp-folie.open { border-color: var(--accent); background: var(--accent-soft); }

/* Sprechen – task sheet (no simulation) */
.sp-kind { font-family: var(--sans); font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.sp-task { font-style: italic; }
.sp-task-list { margin: 0; padding-inline-start: 20px; }
.sp-task-list li { margin-bottom: 6px; }
.sp-folie { cursor: default; }
.sp-folie p { margin: 6px 0 0; }
.sp-fq { display: block; margin-top: 4px; font-size: 17px; }
.sp-mfolie { margin: 0 0 12px; }
.sp-mfolie .sp-fnum { display: block; margin-bottom: 2px; }
.sp-fold summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sp-fold .paper { margin-top: 12px; }
.sp-nav .btn.sm { text-decoration: none; }

/* page loader (also shown when a page loads slowly) */
.page-loading { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); font-weight: 600; }
.page-loading .spinner { width: 22px; height: 22px; border-width: 3px; color: var(--accent); }
.page-loading .page-slow { flex: 1 1 100%; text-align: center; margin: 4px 0 0; font-weight: 400; }

/* testimonials (landing + Premium page) */
.testi { position: relative; margin: 28px auto 8px; max-width: 1040px; }
.testi-h { text-align: center; margin: 0 0 14px; font-size: 20px; }
.testi-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min(300px, 86%), 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; }
.testi-row.one { grid-auto-columns: minmax(0, 520px); justify-content: center; }
.testi-card { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; }
.testi-who { display: flex; align-items: center; gap: 12px; }
.testi-who .pill { margin-top: 4px; }
.testi-av { flex: 0 0 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(145deg, var(--accent), #6d5dfc); }
.testi-card blockquote { margin: 0; font-size: 16px; line-height: 1.75; color: var(--ink); text-align: start; }
.testi-card figcaption { line-height: 1.5; }

/* tour card never taller than the window (short laptop screens, phones in landscape) */
.tour-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }

/* Schnelltest without an account (landing page) */
.guest-quick { background: var(--paper); border: 2px solid var(--accent); border-radius: 18px; padding: 16px 18px; margin: 4px 0 20px; box-shadow: var(--shadow); }
.gq-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.gq-head b { display: block; font-size: 17px; }
.gq-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #f59e0b, #ea580c); }
.gq-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.gq-btns .btn { flex: 1 1 160px; justify-content: center; }
.guest-result { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; border: 2px solid var(--accent); }
.gr-score { flex: 0 0 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--accent-soft); }
.gr-score b { font-size: 34px; line-height: 1; }
.gr-score span { font-size: 13px; color: var(--muted); }
.gr-score.ok { background: var(--ok-soft); color: var(--ok); }
.gr-score.bad { background: #fff4e5; color: #b45309; }
.gr-text h2 { margin: 0 0 6px; }
.gr-line { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .guest-quick { order: 2; margin: 0 0 18px; }
  .guest-result { order: 0; margin-bottom: 16px; gap: 14px; padding: 16px; }
  .gr-score { flex-basis: 76px; height: 76px; }
  .gr-score b { font-size: 26px; }
}
.crm-quick .crm-guest { flex-basis: 100%; color: var(--accent); }

/* first start (no test yet) */
.welcome { max-width: 760px; margin: 8px auto 24px; padding: 26px 28px; }
.welcome h1 { margin: 0 0 6px; }
.welcome-sub { margin: 0 0 18px; }
.wl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.wl-step { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--paper); }
.wl-step:last-child { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.wl-n { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; }
.wl-n svg { display: none; }
.wl-step.done .wl-n { background: var(--ok); }
.wl-step.done .wl-n b { display: none; }
.wl-step.done .wl-n svg { display: block; }
.wl-body { flex: 1; min-width: 0; }
.wl-body h3 { margin: 6px 0 10px; font-size: 17px; }
.wl-body > p { margin: -4px 0 12px; }
.wl-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.wl-btns .btn { flex: 1 1 180px; justify-content: center; }
.target-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wl-skip { display: block; margin: 16px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  .welcome { padding: 20px 16px; margin-top: 0; }
  .wl-step { padding: 14px 12px; gap: 10px; }
  .wl-n { flex-basis: 30px; height: 30px; }
}

/* welcome price during the trial */
.offer-note b, .wl-offer b { font-variant-numeric: tabular-nums; font-size: 22px; color: #b45309; }
.offer-note b, .wl-offer b { font-size: inherit; }
.premium-price s { color: var(--muted); font-size: 22px; margin-inline-end: 8px; }
.offer-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #b45309; font-weight: 600; margin: 6px 0 0; }
.wl-offer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff8eb; color: #b45309; font-weight: 600; text-decoration: none; font-size: 14px; }
.dup-card { border: 2px solid #f59e0b; }
.dup-card p { margin: 6px 0 12px; }

/* =====================================================================
   Design v2 (05.10.2026): one type family (Inter + IBM Plex Sans Arabic), calmer colours,
   cards with a hairline border, one button style, brand hero on the dashboard.
   ===================================================================== */
:root {
  --bg: #f5f7fb;
  --ink: #0f1a2e;
  --muted: #5a6782;
  --line: #e4e9f2;
  --accent: #1d5bd6;
  --accent-dark: #1647b0;
  --accent-soft: #ecf2fe;
  --field: #f1f4fa;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 26, 46, .04), 0 2px 10px rgba(15, 26, 46, .05);
  --shadow-lg: 0 18px 50px rgba(15, 26, 46, .12);
  --sans: "Inter", "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
body { background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1 { letter-spacing: -.025em; font-weight: 800; }
h2, h3 { letter-spacing: -.015em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }

/* cards & buttons */
.card { border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn { border-radius: 12px; padding: 10px 16px; font-weight: 600; letter-spacing: -.005em; }
.btn:hover { background: #f4f7fc; border-color: #d5deec; }
.btn.primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 1px 2px rgba(15, 26, 46, .08), 0 6px 14px rgba(29, 91, 214, .22); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:focus-visible, .seg-btn:focus-visible, .target-btn:focus-visible, .tile-opts:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(29, 91, 214, .3); }
.pill { font-weight: 600; }

/* top bar */
.topbar { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); }
.topbar nav a { border-radius: 10px; font-weight: 600; padding: 7px 12px; }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- dashboard ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 22px;
  padding: 26px 28px; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(135deg, #0b1f4d 0%, #123a8f 55%, #1d5bd6 100%);
  box-shadow: 0 14px 34px rgba(13, 38, 96, .22);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.hero::before { width: 340px; height: 340px; inset-inline-end: -90px; top: -170px; background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%); }
.hero::after { width: 220px; height: 220px; inset-inline-start: 36%; bottom: -150px; background: radial-gradient(circle, rgba(96, 165, 250, .28), rgba(96, 165, 250, 0) 70%); }
.hero-main { min-width: 0; }
.hero-kicker { margin: 0 0 4px; color: rgba(255, 255, 255, .72); font-size: 14px; font-weight: 500; }
.hero h1 { margin: 0 0 10px; font-size: 30px; color: #fff; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.hero-days { flex-direction: column; align-items: center; gap: 2px; padding: 12px 20px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(4px); }
.hero-days .num { color: #fff; font-size: 44px; line-height: 1; letter-spacing: -.03em; }
.hero-days .lbl { color: rgba(255, 255, 255, .8); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hero-offer {
  grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 12px 16px; border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none;
  box-shadow: 0 6px 18px rgba(8, 24, 64, .18); transition: transform .15s;
}
.hero-offer:hover { transform: translateY(-1px); }
.ho-badge { display: inline-flex; align-items: center; gap: 6px; background: #fff4e0; color: #b45309; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.ho-text { flex: 1 1 260px; font-size: 14.5px; font-weight: 500; }
.ho-time { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ho-time small { color: var(--muted); font-size: 11px; }
.ho-time b { font-variant-numeric: tabular-nums; color: #b45309; font-size: 18px; }
.ho-cta { color: var(--accent); font-weight: 700; white-space: nowrap; }

.dash-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 4px 12px; }
html[dir="rtl"] .dash-h { letter-spacing: 0; font-size: 15px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; gap: 8px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 26, 46, .08); border-color: #d5deec; }
.tile h3 { font-size: 17px; margin: 6px 0 0; }
.tile-ico { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 4px 10px rgba(15, 26, 46, .12); }
.tile-opts { border-radius: 11px; }
.tile-go { margin-top: auto; }
.tiles-wide .tile.wide {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 18px; row-gap: 2px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f6fc 100%); padding: 18px 20px;
}
.tile.wide .tile-top { grid-row: 1 / span 4; }
.tile.wide h3, .tile.wide .tile-sub, .tile.wide .free-hint, .tile.wide .tile-warn { grid-column: 2; margin: 0; min-height: 0; }
.tile.wide .tile-go { grid-column: 3; grid-row: 1 / span 4; margin: 0; min-width: 170px; }
.tile.wide .tile-ico { width: 50px; height: 50px; }
.prog-bar { background: #edf1f8; }
.res-row { border-color: var(--line); transition: background .15s, border-color .15s; }
.res-row:hover { background: #f7f9fd; border-color: #d5deec; }
@media (max-width: 640px) {
  .hero { padding: 20px 18px; gap: 12px 14px; border-radius: 20px; }
  .hero h1 { font-size: 23px; margin-bottom: 8px; }
  .hero-kicker { font-size: 13px; }
  .hero-days { padding: 8px 12px; border-radius: 14px; }
  .hero-days .num { font-size: 30px; }
  .hero-days .lbl { font-size: 10px; }
  .hero-offer { padding: 12px; gap: 8px 12px; }
  .ho-text { flex-basis: 100%; order: 2; font-size: 13.5px; }
  .ho-badge { order: 1; }
  .ho-time { order: 1; flex-direction: row; gap: 6px; align-items: baseline; margin-inline-start: auto; }
  .ho-cta { order: 3; }
  .dash-h { margin-top: 20px; }
  .tile { padding: 14px; }
  .tile:hover { transform: none; }
  .tiles-wide .tile.wide { grid-template-columns: auto 1fr; padding: 14px; }
  .tile.wide .tile-go { grid-column: 1 / -1; grid-row: auto; margin-top: 10px; min-width: 0; width: 100%; }
}
.tile.wide button.tile-go { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 6px 14px rgba(15, 26, 46, .18); }
.tile.wide button.tile-go:hover { background: #1c2a45; }
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; gap: 6px; }
  .tile-ico { width: 38px; height: 38px; border-radius: 11px; }
  .tile h3 { font-size: 16px; margin-top: 4px; }
  .tile-opts { width: 34px; height: 34px; }
}
.topbar .brand { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1180px) { body.in-exam .topbar .brand .badge { display: none; } }

/* ---------- notifications: bell + side panel ---------- */
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); flex: 0 0 auto; transition: background .15s, border-color .15s; }
.bell:hover { background: #f4f7fc; border-color: #d5deec; }
.bell.has .ico { animation: bell-ring 1.6s ease-in-out 1; transform-origin: 50% 15%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.bell-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
body.notif-open { overflow: hidden; }
.notif-layer { position: fixed; inset: 0; z-index: 80; }
.notif-dim { position: absolute; inset: 0; background: rgba(12, 22, 45, .38); opacity: 0; transition: opacity .2s; }
.notif-panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100vw); background: var(--bg); box-shadow: -18px 0 50px rgba(15, 26, 46, .18); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease; }
html[dir="rtl"] .notif-panel { transform: translateX(-105%); box-shadow: 18px 0 50px rgba(15, 26, 46, .18); }
.notif-layer.open .notif-dim { opacity: 1; }
.notif-layer.open .notif-panel { transform: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.notif-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.notif-x { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); display: grid; place-items: center; }
.notif-x:hover { color: var(--ink); background: #f4f7fc; }
.notif-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.notif-item.gone { opacity: 0; transform: translateX(16px); }
.notif-item.warn { border-color: #f6c77a; }
.ni-ico { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ni-ico.team { background: var(--accent-soft); color: var(--accent); }
.ni-ico.warn { background: #fff4e0; color: #b45309; }
.ni-ico.ask { background: #f1ecff; color: #6d4ae0; }
.ni-ico.wa { background: #e5f8ed; color: #16a34a; }
.ni-main { flex: 1; min-width: 0; }
.ni-main > b { display: block; font-size: 15px; margin-top: 2px; }
.ni-main p { margin: 6px 0 10px; font-size: 14px; color: var(--ink); line-height: 1.5; }
.ni-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ni-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ni-main .target-chips { margin-top: 10px; }
.ni-main .phone-form { display: flex; flex-wrap: wrap; gap: 8px; }
.ni-main .phone-form input { flex: 1 1 100%; }
.ni-done { margin: 2px 0 !important; color: var(--ok) !important; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.notif-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 16px; }
.ne-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 6px; }

/* dashboard: free plan strip, section head with the Schnelltest chips */
.ho-badge.free { background: var(--accent-soft); color: var(--accent); }
.sec-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin: 26px 4px 12px; }
.sec-head .dash-h { margin: 0; }
.quick-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qi-label { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; color: #c2410c; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); transition: border-color .15s, color .15s, background .15s; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(29, 91, 214, .3); }
@media (max-width: 640px) {
  .bell { width: 38px; height: 38px; }
  .notif-panel { width: 100vw; }
  .sec-head { margin-top: 20px; }
  .quick-inline { width: 100%; }
  .quick-inline .chip-btn { flex: 1 1 0; justify-content: center; }
  .qi-label { flex-basis: 100%; }
}
@media (max-width: 480px) { .user-slot .who { display: none; } }

/* =================== landing page v2 =================== */
body.auth-mode { background: radial-gradient(900px 460px at 18% -60px, #dce7ff 0%, rgba(220, 231, 255, 0) 72%) no-repeat, radial-gradient(760px 420px at 92% 40px, #ebe4ff 0%, rgba(235, 228, 255, 0) 70%) no-repeat, var(--bg); }
/* the bar stays readable when the page scrolls under it */
body.auth-mode .topbar { background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 10px 22px; }
.container.auth-page { max-width: 1160px; padding-top: 0; }
.land { position: relative; }
.land-hero > * { min-width: 0; }
.land-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; padding: 40px 0 24px; }
.lh-eyebrow { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); margin-bottom: 18px; }
.lh-text h1 { font-size: 46px; line-height: 1.08; margin: 0 0 16px; }
.lh-text .lead { font-size: 18px; color: var(--muted); margin: 0 0 22px; max-width: 560px; line-height: 1.6; }
.lh-text .guest-quick { margin: 0 0 18px; max-width: 560px; }
.lh-trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lh-trust li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.lh-trust .ico { color: var(--ok); }
.land .auth-card { box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.land .guest-result { margin-top: 24px; }

.land-sec { padding: 40px 0 8px; }
.land-h { text-align: center; font-size: 28px; margin: 0 0 22px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feat .tile-ico { margin-bottom: 14px; }
.feat p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.feat p b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.how-steps li { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.how-steps li b { font-size: 17px; }
.how-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 8px; }
.land .testi { margin-top: 40px; }
.land-cta { margin: 44px 0 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; padding: 28px 30px; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(135deg, #0b1f4d 0%, #123a8f 55%, #1d5bd6 100%); box-shadow: 0 14px 34px rgba(13, 38, 96, .22); }
.lc-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 320px; }
.lc-text b { font-size: 21px; letter-spacing: -.01em; }
.lc-text span { color: rgba(255, 255, 255, .78); }
.lc-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.lc-main { background: #fff; color: var(--accent); border-color: #fff; }
.lc-main:hover { background: #eef3ff; }
.lc-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.lc-ghost:hover { background: rgba(255, 255, 255, .1); }
.land-foot { text-align: center; margin: 20px 0 8px; }
.land-links { text-align: center; margin: 0 0 16px; }
.land-links a { color: var(--muted); }
.legal { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.legal h1 { margin: 4px 0; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal ul { padding-inline-start: 20px; margin: 0; }
.legal li { margin: 5px 0; }

@media (max-width: 980px) {
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .land-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 18px; }
  .lh-text h1 { font-size: 34px; }
}
@media (max-width: 640px) {
  .lh-eyebrow { font-size: 12px; margin-bottom: 12px; }
  .lh-text h1 { font-size: 29px; margin-bottom: 12px; }
  .lh-text .lead { font-size: 15.5px; margin-bottom: 16px; }
  .lh-trust { gap: 6px 14px; }
  .lh-trust li { font-size: 13px; }
  .land-sec { padding-top: 30px; }
  .land-h { font-size: 22px; margin-bottom: 16px; }
  .feat-grid { grid-template-columns: 1fr; gap: 10px; }
  .feat { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
  .feat .tile-ico { margin: 0; flex: 0 0 auto; }
  .how-steps { grid-template-columns: 1fr; gap: 10px; }
  .how-steps li { padding: 16px; }
  .land-cta { padding: 22px 18px; }
  .lc-btns, .lc-btns .btn { width: 100%; justify-content: center; }
}
.land .testi-h { font-size: 28px; margin-bottom: 22px; }
@media (max-width: 640px) { .land .testi-h { font-size: 22px; margin-bottom: 16px; } }

/* =================== result page v2 =================== */
.res-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.res-top .res-date { margin-inline-start: auto; }
.res-hero {
  position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px 26px;
  padding: 26px 28px; border-radius: var(--radius-lg); color: #fff; margin-bottom: 14px; box-shadow: 0 14px 34px rgba(13, 38, 96, .2);
  background: linear-gradient(135deg, #0b1f4d 0%, #123a8f 55%, #1d5bd6 100%);
}
.res-hero.pass { background: linear-gradient(135deg, #064e3b 0%, #047857 55%, #10b981 100%); box-shadow: 0 14px 34px rgba(4, 80, 56, .22); }
.res-hero::after { content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; inset-inline-end: -90px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%); }
.rh-ring { width: 128px; height: 128px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative;
  background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255, 255, 255, .2) 0); }
.res-hero.fail .rh-ring { background: conic-gradient(#fbbf24 calc(var(--pct) * 1%), rgba(255, 255, 255, .2) 0); }
.rh-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: rgba(8, 20, 50, .35); backdrop-filter: blur(2px); }
.res-hero.pass .rh-ring::before { background: rgba(2, 44, 32, .35); }
.rh-ring b, .rh-ring span { position: relative; }
.rh-ring b { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.rh-ring span { font-size: 12px; opacity: .8; }
.rh-main { min-width: 0; }
.rh-kicker { display: inline-block; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .78); text-transform: uppercase; letter-spacing: .06em; }
html[dir="rtl"] .rh-kicker { letter-spacing: 0; }
.rh-verdict { margin: 4px 0 6px; font-size: 30px; color: #fff; }
.rh-sub { margin: 0 0 14px; color: rgba(255, 255, 255, .85); }
.rh-sub .small { color: rgba(255, 255, 255, .7); }
.rh-scale { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255, 255, 255, .8); }
.rh-bar { position: relative; flex: 1 1 220px; max-width: 360px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .2); }
.rh-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: #fff; }
.res-hero.fail .rh-bar i { background: #fbbf24; }
.rh-60 { position: absolute; top: -4px; bottom: -4px; inset-inline-start: 60%; width: 2px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .12); }
.rh-parts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.rp-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: 99px; background: #fff; }
.rp-bar i.bad { background: #fbbf24; }
.res-fazit { display: flex; gap: 10px; align-items: flex-start; }
.res-fazit .ico { color: #d97706; flex: 0 0 auto; margin-top: 2px; }
.res-next { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 26px; }
.rn-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 3px; }
.rn-text b { font-size: 17px; }
.rn-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.offer-btn { border-color: #f6c77a; color: #b45309; background: #fff8eb; }
.offer-btn:hover { background: #fff1d6; border-color: #f59e0b; }
.corr-block { margin-bottom: 10px; }
.corr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin: 6px 2px 14px; }
.corr-head h2 { margin: 0; }
.corr-filter { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); }
.corr-filter b { background: var(--bad-soft); color: var(--bad); border-radius: 999px; padding: 0 8px; font-size: 12.5px; }
.corr-filter input { accent-color: var(--accent); width: 16px; height: 16px; }
.only-errors .item.is-ok { display: none; }
@media (max-width: 640px) {
  .res-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; }
  .rh-ring { width: 110px; height: 110px; }
  .rh-ring b { font-size: 34px; }
  .rh-verdict { font-size: 24px; }
  .rh-scale { justify-content: center; }
  .rh-parts { width: 100%; text-align: start; }
  .rn-btns, .rn-btns .btn { width: 100%; justify-content: center; }
}
@media print {
  .res-hero { color: #000; background: none !important; box-shadow: none; border: 1px solid #ccc; }
  .res-hero .rh-verdict, .res-hero .rh-sub, .res-hero .rh-kicker { color: #000; }
}
.rh-ring::before { background: #0f2b6b; backdrop-filter: none; }
.res-hero.pass .rh-ring::before { background: #05614a; }

/* header: never wider than the window (the admin has a 5th link) */
.topbar nav { min-width: 0; }
@media (max-width: 1440px) { body.role-admin .topbar nav a span { display: none; } body.role-admin .topbar nav a { padding: 8px 10px; } }
@media (max-width: 1240px) { .topbar .brand .badge { display: none; } }
@media (min-width: 641px) and (max-width: 1100px) { .topbar nav a span { display: none; } .topbar nav a { padding: 8px 10px; } .user-slot .who b { display: none; } }

/* exam date: tap the days box, or the field in the welcome screen / notifications */
.hero-days[data-set-date] { cursor: pointer; position: relative; transition: background .15s, border-color .15s; }
.hero-days[data-set-date]:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .32); }
.hero-days[data-set-date]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
/* the native picker opens via showPicker(); the field itself stays invisible under the box */
.hero-days .date-in { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; pointer-events: none; }
.hero-days.set-date { gap: 6px; padding: 14px 18px; min-width: 120px; border-style: dashed; border-color: rgba(255, 255, 255, .45); }
.hero-days.set-date .lbl { text-transform: none; letter-spacing: 0; font-size: 13px; color: #fff; }
.date-in { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.wl-date { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; font-weight: 600; font-size: 14.5px; }
.wl-date .ico { color: var(--accent); }
.date-row { margin-top: 8px; }
.date-row .date-in { width: 100%; }

/* "what's new" item in the notifications */
.ni-ico.news { background: linear-gradient(145deg, #eef2ff, #e0e7ff); color: #4f46e5; }
.notif-item.news { border-color: #c7d2fe; }
.ni-new { flex: 0 0 auto; background: #4f46e5; color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
/* tour on phones: sheet at the top when the explained element is low on the screen */
@media (max-width: 640px) {
  .tour-card.sheet.sheet-top { top: calc(10px + env(safe-area-inset-top)) !important; bottom: auto !important; }
}

/* "Gratis: …" line on a tile: tick aligned with the first line of the text */
.free-hint { align-items: flex-start; line-height: 1.35; }
.free-hint .ico { flex: 0 0 auto; margin-top: 2px; }

/* Meta Pixel consent (pixel.js) – small bar, never during an exam */
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; max-width: 560px; margin: 0 auto;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.consent p { margin: 0; flex: 1 1 240px; }
.consent .row { gap: 8px; margin-inline-start: auto; }
body.in-exam .consent { display: none; }
