/* Centar Zlata – Lernplattform · Design-System
   Schrift: Plus Jakarta Sans (variabel, selbst gehostet unter /vendor/fonts).
   Farben nach WCAG 2.2 AA geprüft (Text ≥ 4,5:1, Fließtext ≥ 7:1, Bedienelemente ≥ 3:1);
   Gold nur als Akzent – Text in Gold immer in der dunklen Variante --gold-ink. */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/vendor/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }


/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Flächen */
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f5f3ee;
  --surface-3: #efece5;
  --line: #ebe7df;          /* dekorative Linien */
  --line-strong: #8f887b;   /* Eingabefelder & Bedienelemente: 3,5:1 auf Weiß */

  /* Text: 17:1 · 9,5:1 · 5,8:1 auf Weiß */
  --ink: #1c1a17;
  --ink-2: #4a453d;
  --ink-3: #6b655b;

  /* Gold: --gold für Balken/Icons (≥ 3:1), --gold-ink für Text (≥ 6:1) */
  --gold: #a07a22;
  --gold-ink: #7a5c14;
  --gold-soft: #f6efdd;
  --gold-line: #e6d7ad;

  --ok: #1b6b41;
  --ok-ui: #2e8b57;
  --ok-soft: #e7f4ec;
  --ok-line: #bfe0cc;
  --warn: #7f4d00;
  --warn-soft: #fdf3e1;
  --warn-line: #f0d9a8;
  --bad: #a3271b;
  --bad-soft: #fdeeec;
  --bad-line: #f3c4be;
  --hl: #fff3c2;
  --brand-yellow: #f3bf11;   /* Markenfarbe centarzlata.com – nur dekorativ (Linien), nie für Text */
  --hl-line: #e6c34a;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 23, .04);
  --shadow: 0 1px 2px rgba(28, 26, 23, .04), 0 2px 8px -2px rgba(28, 26, 23, .05);
  --shadow-lg: 0 18px 48px -14px rgba(28, 26, 23, .22);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold);

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; font-weight: 400; line-height: 1.6; letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
}
a { color: var(--gold-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
b, strong { font-weight: 500; }
.content strong, .msg strong, .block strong { font-weight: 600; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 500; }
h1 { font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.15rem); letter-spacing: -.03em; }
h2 { font-size: 1.1rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-3); padding: .1em .35em; border-radius: 6px; }
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; stroke-width: 1.75; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; gap: .65em; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.bad-text { color: var(--bad); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::selection { background: var(--hl); }
.show-sm { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 40px; padding: .5em 1.05em; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: .92rem; text-decoration: none;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { border-color: #d9d3c7; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.primary .ic { color: #e6c873; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: .3em .75em; font-size: .85rem; border-radius: 9px; }
.btn.lg { min-height: 50px; padding: .75em 1.3em; font-size: .97rem; white-space: normal; text-align: left; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 34px; }
.btn:disabled { opacity: .5; cursor: default; }
/* Text in Buttons bleibt immer innerhalb des Buttons */
.btn { max-width: 100%; line-height: 1.2; }
.btn .lbl-t, .btn .hide-sm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-group { display: inline-flex; gap: 4px; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 500; font-size: .86rem; margin: .95em 0 .4em; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: .6em .85em; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8a8478; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(160, 122, 34, .18); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 18px; height: 18px; }
.check { display: flex; gap: .6em; align-items: center; font-weight: 400; color: var(--ink); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.error { color: var(--bad); font-size: .88rem; margin-top: .8em; background: var(--bad-soft); border: 1px solid var(--bad-line); padding: .55em .8em; border-radius: 10px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3em; font-size: .74rem; font-weight: 500; padding: .2em .65em; border-radius: 99px; background: var(--gold-soft); color: var(--gold-ink); white-space: nowrap; }
.badge .ic { width: 1em; height: 1em; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.grey { background: var(--surface-3); color: var(--ink-2); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; margin: 16px; border-radius: 24px; padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(110% 80% at 0% 0%, #f8f1df 0%, transparent 60%), radial-gradient(90% 70% at 100% 100%, #f3ead3 0%, transparent 55%), #fbf8f1; border: 1px solid var(--gold-line); }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid var(--gold-line); box-shadow: 0 0 0 40px rgba(230, 215, 173, .18), 0 0 0 80px rgba(230, 215, 173, .1); pointer-events: none; }
.login-art > * { position: relative; z-index: 1; }
.login-art::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--brand-yellow); z-index: 1; }
.login-art h2 { font-size: clamp(2rem, 1.3rem + 2.2vw, 3.1rem); font-weight: 400; line-height: 1.08; letter-spacing: -.035em; color: var(--ink); max-width: 13ch; }
.login-art h2 em { font-style: normal; color: var(--gold-ink); }
.login-art p { color: var(--ink-2); max-width: 40ch; }
.login-art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; color: var(--ink-2); }
.login-art li { display: flex; gap: 12px; align-items: center; }
.login-art li .ic { color: var(--gold); width: 20px; height: 20px; }
.login-art small { color: var(--ink-3); }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { display: none; align-items: center; gap: 12px; margin-bottom: 28px; }

.login-card h1 { margin-bottom: .25em; }
.login-card .btn { width: 100%; margin-top: 22px; min-height: 48px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); border-top: 3px solid var(--brand-yellow); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 10px 18px; }
.demo-badge { display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; margin: 0 10px 10px; padding: 3px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: .72rem; font-weight: 500; }
.demo-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; }
.demo-note .ic { margin-top: 2px; }
.brand-sub { font-size: .68rem; color: var(--ink-3); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }

/* Original-Logo (centarzlata.com, 600 × 150), Hintergrund transparent freigestellt */
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; text-decoration: none; }
.wordmark .logo-img { display: block; height: 46px; width: auto; max-width: 100%; }
.wordmark .wm-local { font-size: .78rem; color: var(--ink-3); letter-spacing: .02em; padding-left: 2px; }
.wordmark.lg .logo-img { height: 62px; }
.wordmark.sm .logo-img { height: 30px; }
.brand .wordmark .logo-img { height: 44px; }
.search { position: relative; margin: 0 2px 12px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 36px; }
.sidebar .search input { min-height: 40px; background: var(--surface-2); border-color: transparent; font-size: .9rem; }
.sidebar .search input:focus { border-color: var(--gold); background: var(--surface); }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin: 18px 12px 6px; font-weight: 500; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 450; font-size: .92rem; transition: background .15s, color .15s; }
.nav a .ic { color: var(--ink-3); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--gold-soft); color: var(--ink); font-weight: 500; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a.active .ic { color: var(--gold-ink); }
.nav a .ni { width: 20px; text-align: center; flex: none; font-size: .95rem; }
.nav a .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .pct { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav a .pct.bad { color: var(--bad); font-weight: 500; }
.nav a .pct.ok { color: var(--ok); }
.nav a .count { background: var(--bad); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 600; padding: 1px 7px; }
.me { margin-top: auto; padding: 12px 6px 2px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.me .who { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: flex; gap: 10px; align-items: center; padding: 4px; border-radius: 10px; }
.me .who:hover { background: var(--surface-2); }
.me .who b { display: block; font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: .78rem; color: var(--ink-3); }
.me .btn.ghost { color: var(--ink-3); }
.me .btn.ghost:hover { color: var(--ink); }
.main { padding: 36px clamp(16px, 3.4vw, 48px) 120px; width: 100%; max-width: 1220px; min-width: 0; margin: 0 auto; }
.topbar, .tabbar, .scrim { display: none; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); max-width: 68ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ic { color: var(--gold); }
.card-head b { font-weight: 500; }
.grid { display: grid; gap: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 1.15rem; }
.section-title a { margin-left: auto; font-size: .88rem; font-weight: 500; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 32px;
  background: radial-gradient(90% 140% at 100% 0%, #f8f1df 0%, rgba(248, 241, 223, 0) 60%), var(--surface); border-color: var(--gold-line); }
.hero h1 { margin-bottom: .3em; }
.hero p { color: var(--ink-2); margin: 0 0 20px; max-width: 54ch; }
.hero .kicker { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; margin-bottom: 8px; }
.hero .meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 18px; font-size: .86rem; color: var(--ink-3); }
.hero .meta span { display: inline-flex; gap: 7px; align-items: center; }
.hero .meta .ic { color: var(--gold); }
.ring { --p: 0; --size: 136px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring > div { width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 2rem; font-weight: 400; display: block; line-height: 1; letter-spacing: -.04em; }
.ring span { font-size: .7rem; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }

.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.done > i { background: var(--ok-ui); }
.bar.thin { height: 4px; }
.mini-bar { width: 80px; display: inline-block; vertical-align: middle; margin-right: 8px; }

.track-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.track-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gold-line); }
.track-card.overdue { border-color: var(--bad-line); }
.track-card .top { display: flex; align-items: center; gap: 12px; }
.track-card .title { font-weight: 500; font-size: 1rem; }
.track-card .sub { font-size: .82rem; color: var(--ink-3); }
.tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.3rem; flex: none; }
.track-card .foot { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-3); flex-wrap: wrap; }
.track-card .pct-big { margin-left: auto; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: .82rem; color: var(--ink-3); display: flex; gap: 7px; align-items: center; }
.stat .label .ic { color: var(--gold); }
.stat b { font-size: 1.85rem; font-weight: 400; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat.alert { border-color: var(--bad-line); background: var(--bad-soft); }
.stat.alert b, .stat.alert .label, .stat.alert .label .ic { color: var(--bad); }

.banner { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 18px; flex-wrap: wrap; }
.banner .ic.lead { width: 24px; height: 24px; color: var(--gold); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.banner.ok .ic.lead { color: var(--ok); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.banner.bad .ic.lead { color: var(--bad); }
.banner > div { flex: 1; min-width: 200px; }
.banner b { font-weight: 500; }

.announce { padding: 16px 0; border-bottom: 1px solid var(--line); }
.announce:first-child { padding-top: 0; }
.announce:last-child { border-bottom: 0; padding-bottom: 0; }
.announce h3 { margin: 0; font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.announce h3 .ic { color: var(--gold); }
.announce p { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink-2); }
.announce .when { font-size: .8rem; color: var(--ink-3); }
.announce.fresh h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex: none; }

.empty { text-align: center; padding: 44px 20px; }
.empty .ic { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: 10px; }

/* ---------- Lernbereich ---------- */
.cat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cat-head h2 { margin: 0; }
.cat-num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-weight: 500; font-size: .85rem; flex: none; }
.lesson-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 2px; }
.lesson-list a { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 8px 12px; border-radius: 11px; text-decoration: none; color: var(--ink); transition: background .15s; }
.lesson-list a:hover { background: var(--surface-2); }
.lesson-list a .ic.chev { color: var(--ink-3); margin-left: auto; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: #fff; }
.tick .ic { width: 13px; height: 13px; stroke-width: 2.5; }
.tick.done { background: var(--ok-ui); border-color: var(--ok-ui); }
.quiz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.quiz-row .ic.lead { color: var(--gold); }
.quiz-row b { font-weight: 500; }

/* ---------- Lektion ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .ic { width: 14px; height: 14px; }
.lesson { max-width: 740px; margin: 0 auto; }
.lesson-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-3); }
.lesson-meta .mini-bar { width: 120px; }
.content { font-size: 1.04rem; line-height: 1.75; color: var(--ink); }
.content h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.35rem); margin: .5em 0 .35em; letter-spacing: -.035em; }
.content h2 { font-size: 1.22rem; margin: 1.1em 0 .3em; }
.content h3 { margin: .9em 0 .3em; }
.block { padding: 4px 12px; margin: 0 -12px 12px; border-radius: 12px; position: relative; transition: background .4s, box-shadow .4s; }
.block p { margin: 0; }
.block ul, .block ol { margin: 0; padding-left: 1.35em; }
.block li { margin: .25em 0; }
.block li::marker { color: var(--gold); }
.block blockquote { margin: 0; padding: 12px 16px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 12px; color: var(--warn); font-size: .94rem; }
.block.hl { background: var(--hl); box-shadow: 0 0 0 1.5px var(--hl-line); }
.block .note { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: .86rem; background: var(--ink); color: #fff; padding: 7px 12px; border-radius: 10px; width: fit-content; }
.lesson-actions { display: flex; gap: 10px; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hint { display: flex; gap: 8px; align-items: center; margin-top: 24px; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; font-size: .86rem; color: var(--ink-3); }
.hint .ic { color: var(--gold); }

/* ---------- Quiz ---------- */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.q { margin-bottom: 14px; }
.q .qnum { font-size: .74rem; font-weight: 500; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .1em; }
.q .qtext { font-weight: 500; font-size: 1.04rem; margin: 6px 0 8px; display: block; }
.q .opt { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; margin-top: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.q .opt:hover { border-color: #d9d3c7; background: var(--surface-2); }
.q .opt:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.q .opt input { margin: 0; flex: none; }
.q .opt.correct { border-color: var(--ok-ui); background: var(--ok-soft); }
.q .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.q .explain { margin-top: 10px; font-size: .9rem; color: var(--ink-2); display: flex; gap: 8px; }
.q .explain .ic { color: var(--gold); margin-top: 3px; }
.quiz-bar { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 10px 10px 10px 16px; box-shadow: var(--shadow-lg); }
.result { text-align: center; padding: 32px 20px; }
.result .big { font-size: 3rem; font-weight: 300; line-height: 1; letter-spacing: -.04em; }
.result.passed { border-color: var(--ok-line); background: var(--ok-soft); }
.result .row { justify-content: center; margin-top: 14px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; padding: 6px 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.person { display: flex; gap: 11px; align-items: center; min-width: 0; }
.person b { display: block; font-weight: 500; }

/* ---------- Checkliste ---------- */
.checklist { list-style: none; padding: 0; margin: 4px 0 0; }
.checklist li { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .check { align-items: flex-start; gap: 14px; margin: 0; cursor: pointer; font-size: .95rem; }
.checklist div.check { cursor: default; }
.checklist b { font-weight: 500; }
.checklist input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ok-ui); }
.checklist .d { display: block; margin-top: 2px; }
.checklist li.done b { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }
.checklist.compact li { padding: 9px 2px; }
.checklist.compact .d { display: none; }

/* ---------- Personen ---------- */
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.people li { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.people li b { display: block; font-size: .92rem; font-weight: 500; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); display: grid; place-items: center; font-weight: 500; font-size: .78rem; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 50px; height: 50px; font-size: .95rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.35rem; font-weight: 400; }
.contact { display: flex; flex-direction: column; gap: 12px; }
.contact b { font-weight: 500; }
.contact .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Suche ---------- */
.result-item { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.result-item:hover { border-color: var(--gold-line); box-shadow: var(--shadow-lg); }
.result-item + .result-item { margin-top: 12px; }
.snippet { margin: 6px 0 0; color: var(--ink-2); }
mark { background: var(--hl); color: inherit; padding: 0 2px; border-radius: 4px; }
.mobile-search { display: none; margin-bottom: 16px; }
.mobile-search .search { margin: 0; }

/* ---------- Profil ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: .88rem; }
.kv dd { margin: 0; }

/* ---------- Sprache ---------- */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; border-radius: 9px; min-height: 34px; padding: 0 12px; font-weight: 500; font-size: .84rem; cursor: pointer; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented button { white-space: nowrap; }
.segmented .lang-full { display: none; }
.segmented.full .lang-full { display: inline; }
.segmented.full .lang-code { display: none; }
.segmented.full { width: 100%; }
.segmented.full button { flex: 1; justify-content: center; }
.segmented.tabs button { min-height: 38px; }
.lang-btn { display: none; }
.flag { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 5px; margin-right: 7px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); font-size: .66rem; font-weight: 600; letter-spacing: .05em; vertical-align: 1px; }
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; flex: 1; min-width: 0; }
.bi > div { min-width: 0; }
.qedit .optrow .bi { gap: 8px; }

/* ---------- Admin: Editor ---------- */
.editor { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree { max-height: calc(100dvh - 140px); overflow-y: auto; position: sticky; top: 16px; padding: 12px; }
.tree .dept { margin-bottom: 8px; }
.tree .head, .tree .lessonn, .tree .add { display: flex; align-items: center; gap: 8px; border-radius: 9px; cursor: pointer; min-height: 36px; }
.tree .dept > .head { font-weight: 500; padding: 6px 8px; }
.tree .catn > .head { color: var(--ink-2); padding: 5px 8px 5px 18px; font-size: .9rem; }
.tree .lessonn { padding: 4px 8px 4px 36px; font-size: .88rem; color: var(--ink-2); }
.tree .add { font-size: .84rem; padding: 2px 8px 2px 36px; color: var(--gold-ink); font-weight: 500; }
.tree .add.cat { padding-left: 18px; }
.tree .head:hover, .tree .lessonn:hover, .tree .add:hover { background: var(--surface-2); }
.tree .sel { background: var(--gold-soft) !important; color: var(--ink) !important; }
.tree .ic { width: 15px; height: 15px; color: var(--ink-3); }
.tree .badge { margin-left: auto; }
.split { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1360px) { .split { grid-template-columns: 1fr 1fr; } }
.split textarea { min-height: 460px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.preview { border: 1px dashed #d9d3c7; border-radius: 12px; padding: 14px 18px; max-height: 560px; overflow-y: auto; font-size: .96rem; }
.md-help { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; font-size: .8rem; color: var(--ink-3); }
.qedit { border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.qedit b { font-weight: 500; }
.qedit .optrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qedit .optrow input[type=radio] { width: 20px; height: 20px; flex: none; }
.savestate { font-size: .84rem; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.savestate.dirty { color: var(--warn); }
.mailbody { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); padding: 14px; border-radius: 12px; margin: 0; }

/* ---------- Modal / Bottom-Sheet ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(28, 26, 23, .32); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 540px; max-height: min(90dvh, 900px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head > .ic { color: var(--gold); width: 22px; height: 22px; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.welcome { text-align: center; padding: 12px 6px; }
.welcome img { width: 64px; }
.welcome h1 { margin-top: 14px; }
.welcome .steps { list-style: none; text-align: left; max-width: 420px; margin: 20px auto 0; padding: 0; display: grid; gap: 10px; }
.welcome .steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.welcome .steps b { font-weight: 500; }
.welcome .steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-ink); display: grid; place-items: center; font-weight: 500; font-size: .82rem; flex: none; }
.welcome .row { justify-content: center; margin-top: 22px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 90; box-shadow: var(--shadow-lg); font-weight: 500; font-size: .9rem; display: flex; gap: 8px; align-items: center; animation: pop .2s ease-out; max-width: calc(100vw - 32px); }
.toast .ic { color: #e6c873; }

/* ---------- Markierungen durch den Assistenten ---------- */
.tour-hl { position: relative; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold), 0 0 0 10px rgba(160, 122, 34, .15) !important; border-radius: 12px; animation: pulse 1.4s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold), 0 0 0 16px rgba(160, 122, 34, .06); } }
.tour-note { position: absolute; z-index: 65; background: var(--ink); color: #fff; font-size: .86rem; padding: 8px 12px; border-radius: 10px; max-width: 280px; box-shadow: var(--shadow-lg); }
.ask-sel { position: absolute; z-index: 45; display: inline-flex; gap: 6px; align-items: center; background: var(--ink); color: #fff; border: 0; border-radius: 99px; padding: 8px 14px; font-size: .84rem; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-lg); }
.ask-sel .ic { color: #e6c873; }

/* ---------- Rundgang ---------- */
.tour-layer { position: fixed; inset: 0; z-index: 70; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(28, 26, 23, .45); transition: all .28s cubic-bezier(.2,.8,.2,1); pointer-events: none; outline: 2px solid var(--gold); outline-offset: 2px; }
.tour-pop { position: fixed; background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); transition: top .28s, left .28s; }
.tour-pop h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.tour-pop p { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--surface-3); transition: width .2s, background .2s; }
.tour-dots i.on { width: 18px; background: var(--gold); }

/* ---------- Chat ---------- */
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; height: 52px; padding: 0 20px 0 16px; border-radius: 99px; border: 0; background: var(--ink); color: #fff; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; box-shadow: 0 10px 28px -10px rgba(28, 26, 23, .6); cursor: pointer; transition: transform .15s; }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab .ic { width: 20px; height: 20px; color: #e6c873; }
.chat { position: fixed; right: 24px; bottom: 92px; z-index: 41; width: 400px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100dvh - 124px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s ease-out; }
.chat header { padding: 14px 12px 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.chat header .bot-av { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-ink); display: grid; place-items: center; flex: none; }
.chat header b { display: block; font-size: .95rem; font-weight: 500; }
.chat header .status { font-size: .76rem; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.chat header .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok-ui); }
.chat header .status.off::before { background: var(--gold); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot p, .msg.bot ul, .msg.bot ol { margin: 0 0 6px; }
.msg.bot ul, .msg.bot ol { padding-left: 1.2em; }
.msg.bot h1, .msg.bot h2, .msg.bot h3 { font-size: .95rem; margin: 4px 0; letter-spacing: 0; }
.msg.bot blockquote { margin: 0 0 6px; padding: 6px 10px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; }
.msg.bot > :last-child { margin-bottom: 0; }
.msg .act { display: flex; gap: 5px; align-items: center; margin-top: 8px; font-size: .78rem; color: var(--gold-ink); font-weight: 500; }
.msg .links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.msg .links a { display: flex; gap: 6px; align-items: center; justify-content: space-between; font-size: .86rem; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 8px 10px; font-weight: 500; }
.msg .links a:hover { border-color: var(--gold-line); }
.chat .suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; background: var(--bg); }
.chat .suggest button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 7px 12px; font-size: .82rem; cursor: pointer; text-align: left; }
.chat .suggest button:hover { border-color: var(--gold); color: var(--ink); }
.chat .sel-chip { margin: 0 12px 8px; padding: 8px 10px; background: var(--hl); border-radius: 10px; font-size: .82rem; display: flex; gap: 8px; align-items: center; }
.chat .sel-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.chat form input { flex: 1; border-radius: 99px; padding-left: 16px; }
.chat form .btn { border-radius: 50%; width: 44px; min-height: 44px; padding: 0; }
.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Skeleton ---------- */
.skeleton div { height: 18px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; border-radius: 12px; margin-bottom: 14px; animation: shimmer 1.2s infinite; }
.skeleton div:first-child { width: 40%; height: 34px; }
.skeleton div:nth-child(2) { width: 100%; height: 160px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Zertifikat ---------- */
.certificate { position: relative; background: #fffdf8; color: var(--ink); border: 1px solid var(--gold-line); border-radius: 6px; padding: 64px 48px; text-align: center; max-width: 800px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.certificate::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--gold); border-radius: 3px; pointer-events: none; }
.certificate h1 { font-size: clamp(2rem, 1.5rem + 2.6vw, 3rem); font-weight: 300; letter-spacing: .28em; text-transform: uppercase; margin: 10px 0 22px; color: var(--gold-ink); }
.certificate p { color: var(--ink-2); }
.certificate b { font-weight: 500; }
.cert-company { letter-spacing: .26em; text-transform: uppercase; font-size: .76rem; color: var(--ink-3); margin-top: 12px; }
.cert-name { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem); font-weight: 400; letter-spacing: -.02em; margin: 6px 0 16px; border-bottom: 1px solid var(--gold-line); display: inline-block; padding: 0 24px 8px; }
.cert-foot { display: flex; justify-content: space-around; gap: 30px; margin-top: 52px; font-size: .85rem; color: var(--ink-2); flex-wrap: wrap; }
.cert-foot .line { width: 190px; border-top: 1px solid var(--ink-3); margin: 0 auto 6px; }

/* =========================================================
   Tablet & Handy
   ========================================================= */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .editor { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card .logo { display: flex; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 55; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); padding-bottom: calc(14px + var(--safe-b)); border-right: 0; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(28, 26, 23, .32); z-index: 50; animation: fade .2s; }

  .topbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
    background: rgba(250, 249, 246, .88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
  .topbar { border-top: 3px solid var(--brand-yellow); }
  .topbar-brand { min-width: 0; overflow: hidden; text-decoration: none; display: flex; }
  .topbar .btn.icon { width: 44px; min-height: 44px; }
  .topbar .lang-btn { display: inline-flex; min-height: 40px; padding: 0 10px; font-weight: 600; color: var(--ink-2); }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; text-decoration: none; color: var(--ink-3); font-size: .7rem; font-weight: 500; cursor: pointer; min-height: 44px; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar span:not(.dot) { max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar .active { color: var(--ink); }
  .tabbar .active .ic { color: var(--gold-ink); }
  .tabbar .active::before { content: ""; position: absolute; top: 0; width: 26px; height: 2px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tabbar .dot { position: absolute; top: 8px; left: calc(50% + 7px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .62rem; display: grid; place-items: center; }

  .main { padding: 20px 16px calc(var(--tabbar-h) + var(--safe-b) + 96px); }
  .mobile-search { display: block; }
  .hero { grid-template-columns: 1fr; padding: 22px; gap: 18px; }
  .hero .ring { --size: 100px; justify-self: start; grid-row: 1; }
  .hero .ring b { font-size: 1.55rem; }
  .hero .btn.lg { width: 100%; justify-content: space-between; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-5 > :last-child:nth-child(odd) { grid-column: span 2; }
  .card { padding: 18px; border-radius: 16px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }

  /* Große Touch-Flächen */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .btn.icon.sm { width: 40px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { font-size: 16px; min-height: 48px; }

  .lesson-actions { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 20; margin: 24px -6px 0; padding: 8px; gap: 8px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); box-shadow: var(--shadow-lg); flex-wrap: nowrap; }
  /* Haupt-Button bekommt den Platz, Zurück ist ein Pfeil, Quiz bleibt kompakt */
  .lesson-actions .btn { flex: 0 0 auto; min-height: 48px; padding: 0 16px; border-radius: 13px; }
  .lesson-actions .btn.primary { flex: 1 1 auto; min-width: 0; font-size: .95rem; justify-content: center; }
  .lesson-actions .btn.nav-prev { width: 48px; padding: 0; }
  .lesson-actions .hide-sm, .hide-sm { display: none; }
  .show-sm { display: inline; }
  .lesson-actions .spacer { display: none; }
  .quiz-bar { bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); }

  .chat-fab { right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); height: 52px; width: 52px; padding: 0; justify-content: center; }
  .chat-fab .lbl { display: none; }
  body:has(.editor) .chat-fab { display: none; }
  body:has(.lesson-actions) .chat-fab, body:has(.quiz-bar) .chat-fab { bottom: calc(var(--tabbar-h) + var(--safe-b) + 88px); }
  .chat { inset: auto 0 0 0; width: 100%; max-width: none; height: 88dvh; max-height: none; border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); z-index: 58; }
  .chat .msgs { padding: 14px; }

  .modal-bg { place-items: end center; padding: 0; }
  .modal { max-width: none !important; border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 20px 18px calc(20px + var(--safe-b)); animation: sheet .25s cubic-bezier(.2,.8,.2,1); }
  .modal::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 99px; background: #d9d3c7; margin: -8px auto 14px; }
  .modal-actions .btn { flex: 1; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

  .editor { grid-template-columns: 1fr; }
  .bi { grid-template-columns: 1fr; }
  .qedit .optrow { align-items: flex-start; }
  .tree { position: static; max-height: 46dvh; }
  .split textarea { min-height: 320px; }
  .certificate { padding: 44px 22px; }
  .cert-foot { flex-direction: column; align-items: center; }

  /* Tabellen werden zu Karten */
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  table.responsive tr:last-child { border-bottom: 0; }
  table.responsive td { border: 0; padding: 3px 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
  table.responsive td::before { content: attr(data-label); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 500; text-align: left; flex: none; }
  table.responsive td:first-child { text-align: left; padding-bottom: 6px; }
  table.responsive td:first-child::before, table.responsive td[data-label=""]::before { display: none; }
  table.responsive td.actions { justify-content: flex-end; padding-top: 8px; }
  table.responsive td.na { display: none; }
  .table-wrap { padding: 4px 14px; }
}

@media (max-width: 420px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .grid.cols-5 { gap: 10px; }
  .stat b { font-size: 1.5rem; }
}

/* ---------- Druck (Zertifikat) ---------- */
@media print {
  .sidebar, .topbar, .tabbar, .chat-fab, .chat, .no-print, .toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .certificate { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
