/* ===== LPIC Trainer · Stylesheet (aufgesetzt auf DaisyUI 5) =====
   Farben kommen aus DaisyUI (vendor/daisyui.css). Hier wird die Markenfarbe
   (LPIC-Grün) als Primary überschrieben und die Projekt-Tokens werden auf die
   DaisyUI-Variablen abgebildet, sodass alle Eigen-Komponenten automatisch das
   Theme (hell/dunkel) übernehmen. */

/* Markenfarbe + eigene Link-/Schatten-Werte je Theme */
[data-theme="light"] {
  --color-primary: oklch(58% 0.132 153);
  --color-primary-content: oklch(98% 0.02 153);
  --link: oklch(50% 0.17 256);
  --link-hover: oklch(42% 0.17 256);
  --shadow: 0 1px 2px rgba(15,30,45,.05), 0 8px 24px -8px rgba(15,30,45,.14);
}
[data-theme="dark"] {
  --color-primary: oklch(70% 0.15 153);
  --color-primary-content: oklch(16% 0.04 153);
  --link: oklch(74% 0.12 256);
  --link-hover: oklch(84% 0.09 256);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -10px rgba(0,0,0,.6);
}

/* Projekt-Tokens → DaisyUI-Variablen (gelten in beiden Themes automatisch) */
:root {
  --bg: var(--color-base-200);
  --surface: var(--color-base-100);
  --surface-2: var(--color-base-200);
  --border: var(--color-base-300);
  --text: var(--color-base-content);
  --text-muted: color-mix(in oklch, var(--color-base-content) 62%, transparent);
  --accent: var(--color-primary);
  --accent-dark: color-mix(in oklch, var(--color-primary) 82%, black);
  --accent-soft: color-mix(in oklch, var(--color-primary) 14%, var(--color-base-100));
  --danger: var(--color-error);
  --danger-soft: color-mix(in oklch, var(--color-error) 14%, var(--color-base-100));
  --warn: var(--color-warning);
  --info: var(--color-info);
  --radius: var(--radius-box);
  --maxw: 1040px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Inhaltslinks: angenehmes Blau. Komponenten (Buttons, Nav, Kacheln, Chips) setzen eigene Farben. */
a { color: var(--link); }
a:hover { color: var(--link-hover); }
/* Externe URLs mit ↗ kennzeichnen (nicht bei Buttons/Kacheln/Nav) */
a[target="_blank"]:not(.btn):not(.tile):not(.cert-pill):not(.navlink):not(.navmenu-item):not(.drawer-link)::after {
  content: "\2197"; display: inline-block; margin-left: .18em;
  font-size: .82em; line-height: 1; opacity: .65; vertical-align: text-top;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: rgba(46,158,91,.18);
  -webkit-text-size-adjust: 100%;
}

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) calc(1.2rem + env(safe-area-inset-right)) .6rem calc(1.2rem + env(safe-area-inset-left));
  background: color-mix(in oklch, var(--color-base-100) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; text-decoration: none; color: inherit; }
.brand .logo { font-size: 2rem; }
.brand h1 { font-size: 1.15rem; margin: 0; }
.brand .subtitle { font-size: .75rem; color: var(--text-muted); }
.brand:hover h1 { color: var(--accent-dark); }
:root[data-theme="dark"] .brand:hover h1 { color: var(--accent); }

/* ---- Hauptnavigation (Desktop, mit Dropdowns) ---- */
.mainnav { display: flex; gap: .2rem; align-items: center; }
.navlink {
  display: inline-flex; align-items: center; gap: .35rem;
  text-decoration: none; color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  padding: .5rem .85rem; border-radius: 9px; font-weight: 600; font-size: .9rem; font-family: inherit;
  transition: background .15s, color .15s;
}
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink.active { background: var(--accent-soft); color: var(--accent-dark); }
:root[data-theme="dark"] .navlink.active { color: var(--accent); }
.navgroup { position: relative; }
.navgroup .caret { display: inline-flex; align-items: center; opacity: .65; transition: transform .15s; margin-left: -.1rem; }
.navgroup.open .caret { transform: rotate(180deg); }
.navgroup.open > .navgroup-btn { background: var(--surface-2); color: var(--text); }
.navgroup.has-active > .navgroup-btn { color: var(--accent-dark); }
:root[data-theme="dark"] .navgroup.has-active > .navgroup-btn { color: var(--accent); }
.navmenu {
  position: absolute; top: calc(100% + .35rem); left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .4rem; z-index: 20;
  display: none; flex-direction: column; gap: .1rem;
}
.navgroup.open .navmenu { display: flex; animation: navpop .14s ease; }
@keyframes navpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.navmenu-item {
  display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text);
  padding: .55rem .7rem; border-radius: 8px; font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.navmenu-item:hover { background: var(--surface-2); }
.navmenu-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
:root[data-theme="dark"] .navmenu-item.active { color: var(--accent); }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.navlink.active .nav-ico, .navmenu-item.active .nav-ico, .drawer-link.active .nav-ico { color: var(--accent); }
/* Monochrome Icons */
.icn { display: inline-block; vertical-align: -.18em; flex-shrink: 0; }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 44px; height: 44px; font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); }
.burger { display: none; font-size: 1.3rem; }

/* ---- Mobiles Off-Canvas-Drawer ---- */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; height: 100dvh; width: min(330px, 86vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgba(0,0,0,.25);
  z-index: 40; transform: translateX(100%); transition: transform .22s ease; overflow-y: auto;
  padding: calc(env(safe-area-inset-top)) 0 calc(env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.drawer-body { padding: .6rem .7rem 1.2rem; }
.drawer-group { margin-top: .6rem; }
.drawer-group-title { display: flex; align-items: center; gap: .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: .5rem .6rem .25rem; }
.drawer-link {
  display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text);
  padding: .7rem .7rem; border-radius: 9px; font-weight: 600; font-size: .98rem;
}
.drawer-link.sub { font-weight: 500; padding-left: .9rem; }
.drawer-link:hover { background: var(--surface-2); }
.drawer-link.active { background: var(--accent-soft); color: var(--accent-dark); }
:root[data-theme="dark"] .drawer-link.active { color: var(--accent); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
body.no-scroll { overflow: hidden; }

/* ---- View / Layout ---- */
.view {
  width: 100%; max-width: var(--maxw); margin: 0 auto; flex: 1;
  padding: 1.5rem calc(1.2rem + env(safe-area-inset-right)) 1.5rem calc(1.2rem + env(safe-area-inset-left));
}
.footer {
  font-size: .8rem; color: var(--text-muted); background: var(--surface);
  padding: 2rem calc(1.2rem + env(safe-area-inset-right)) calc(1.2rem + env(safe-area-inset-bottom)) calc(1.2rem + env(safe-area-inset-left));
  border-top: 1px solid var(--border);
}
.footer-grid {
  max-width: var(--maxw); margin: 0 auto; display: grid; gap: 1.4rem 2rem;
  grid-template-columns: 1fr; padding-bottom: 1.4rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand { display: flex; gap: .7rem; align-items: flex-start; }
.footer-logo { font-size: 1.8rem; line-height: 1; }
.footer-brand strong { color: var(--text); font-size: .95rem; }
.footer-brand p { margin: .25rem 0 0; max-width: 24ch; }
.footer-col { display: flex; flex-direction: column; gap: .45rem; }
.footer-col h4 { margin: 0 0 .2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.footer-col a { color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding-top: 1.2rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .74rem;
}
kbd {
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: .75rem; font-family: ui-monospace, monospace;
}

/* ---- Cards / Tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.3rem; cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: .4rem; box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 28px -10px color-mix(in oklch, var(--color-primary) 40%, transparent); }
.tile .ico { font-size: 1.8rem; }
.tile h3 { margin: 0; }
.tile p { margin: 0; color: var(--text-muted); font-size: .88rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem;
}
.hero { text-align: center; padding: 1.8rem 1rem 1rem; }
.hero h2 { margin: .2rem 0; font-size: 1.6rem; }
.hero p { color: var(--text-muted); max-width: 640px; margin: .4rem auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  background: var(--accent); color: var(--color-primary-content); border: 1px solid transparent; border-radius: 8px;
  padding: .6rem 1.15rem; min-height: 44px; font-size: .94rem; font-weight: 600; cursor: pointer;
  text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s; touch-action: manipulation;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
:root[data-theme="dark"] .btn.secondary:hover { color: var(--accent); }
.btn.ghost { background: transparent; color: var(--text-muted); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

/* ---- Exam picker / topic chips ---- */
.cert-group { margin-bottom: .9rem; }
.cert-label { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .35rem; }
.exam-switch { display: flex; gap: .5rem; margin-bottom: 1rem; }
.exam-switch button {
  flex: 1; padding: .8rem; border-radius: 10px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; font-size: 1rem;
}
.exam-switch button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
:root[data-theme="dark"] .exam-switch button.active { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  cursor: pointer; font-size: .85rem; user-select: none;
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
:root[data-theme="dark"] .chip.on { color: var(--accent); }
.chip .count { color: var(--text-muted); font-size: .78rem; }

/* ---- Question ---- */
.q-meta { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: .82rem; margin-bottom: .6rem; flex-wrap: wrap; gap: .5rem; }
.q-badge { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; font-family: ui-monospace, monospace; }
.q-text { font-size: 1.12rem; font-weight: 600; margin: .3rem 0 1rem; white-space: pre-wrap; }
.q-hint { color: var(--text-muted); font-size: .85rem; margin-bottom: .8rem; }
.options { display: flex; flex-direction: column; gap: .55rem; }
.opt {
  display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--accent); }
.opt .key { font-weight: 700; font-family: ui-monospace, monospace; min-width: 1.4em; text-align: center; color: var(--text-muted); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.correct { border-color: var(--accent); background: var(--accent-soft); }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt .mark { margin-left: auto; font-weight: 700; }
.opt.disabled { cursor: default; }

.fill-input {
  width: 100%; padding: .7rem .9rem; font-size: 1rem; font-family: ui-monospace, monospace;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.fill-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 25%, transparent); }

/* ---- Feedback box ---- */
.feedback { margin-top: 1rem; padding: 1rem; border-radius: 10px; border-left: 4px solid var(--info); background: var(--surface-2); }
.feedback.ok { border-left-color: var(--accent); background: var(--accent-soft); }
.feedback.no { border-left-color: var(--danger); background: var(--danger-soft); }
.feedback .verdict { font-weight: 700; margin-bottom: .3rem; }
.feedback .sol { font-family: ui-monospace, monospace; font-weight: 600; }
.feedback .expl { margin-top: .4rem; }

/* ---- Progress bar ---- */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: .4rem 0 1rem; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---- Timer ---- */
.timer { font-family: ui-monospace, monospace; font-weight: 700; font-size: 1.05rem; padding: .3rem .7rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.timer.warn { color: var(--warn); border-color: var(--warn); }
.timer.crit { color: var(--danger); border-color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---- Exam grid nav ---- */
.qnav { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.qnav button {
  width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: .8rem; font-weight: 600;
}
.qnav button.answered { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.qnav button.current { outline: 2px solid var(--accent); }
.qnav button.flagged { border-color: var(--warn); }

/* ---- Result ---- */
.score-big { font-size: 3rem; font-weight: 800; text-align: center; }
.score-big.pass { color: var(--accent); }
.score-big.fail { color: var(--danger); }
.result-meta { text-align: center; color: var(--text-muted); margin-bottom: 1rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 60px; gap: .6rem; align-items: center; margin: .35rem 0; font-size: .85rem; }
.bar-track { height: 16px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.low { background: var(--danger); }
.bar-fill.mid { background: var(--warn); }

/* ---- Flashcards ---- */
.flashcard {
  perspective: 1200px; margin: 1rem auto; max-width: 560px; height: 280px; cursor: pointer;
}
.flashcard-inner {
  position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem; text-align: center; gap: .6rem;
}
.flash-face.back { transform: rotateY(180deg); background: var(--accent-soft); }
.flash-face .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.flash-face .content { font-size: 1.3rem; font-weight: 600; }
.flash-face .content code { font-family: ui-monospace, monospace; }

/* ---- Deutsch-Tooltip (Lernmodus) ---- */
.de-tip {
  position: absolute; display: none; z-index: 50; max-width: min(460px, calc(100vw - 20px));
  background: var(--text); color: var(--bg);
  padding: .5rem .7rem; border-radius: 8px; font-size: .88rem; line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0,0,0,.3); pointer-events: none;
}
:root[data-theme="dark"] .de-tip { background: #e6edf3; color: #0f141a; }
[data-de]:not([data-de=""]) { cursor: help; }

/* ---- Lessons ---- */
.lesson { line-height: 1.65; }
.lesson p { margin: 0 0 .9rem; }
.lesson p:last-child { margin-bottom: 0; }
.lesson code { font-family: ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: .9em; }
.lesson strong { color: var(--text); }
.lesson ul { margin: .2rem 0 .9rem; padding-left: 1.2rem; }
.lesson em { color: var(--text-muted); font-style: normal; font-weight: 600; }

/* ---- Misc ---- */
.muted { color: var(--text-muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tag { font-size: .7rem; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1rem; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-box .num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-box .lbl { font-size: .8rem; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 2rem; }
table.history { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.history th, table.history td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: left; }
table.history .pass { color: var(--accent); font-weight: 700; }
table.history .fail { color: var(--danger); font-weight: 700; }

/* Unter 880px: Desktop-Nav ausblenden, Burger-Menü zeigen */
@media (max-width: 880px) {
  .mainnav { display: none; }
  .burger { display: inline-flex; }
}
@media (min-width: 881px) {
  .drawer, .drawer-backdrop { display: none !important; }
}

@media (max-width: 640px) {
  .brand .subtitle { display: none; }
  .brand h1 { font-size: 1.05rem; }
  .brand .logo { font-size: 1.7rem; }
  .topbar { gap: .5rem; }
  .view { padding-top: 1rem; padding-bottom: 1rem; }
  .bar-row { grid-template-columns: 84px 1fr 46px; font-size: .8rem; }
  .flashcard { height: 230px; }
  .q-text { font-size: 1.05rem; }
  .opt { padding: .8rem .9rem; }
  .btn-row { gap: .5rem; }
  .btn { padding: .6rem 1rem; }
  .qnav button { width: 36px; height: 36px; }
  .hero h2 { font-size: 1.35rem; }
}

/* Im installierten PWA-Modus etwas mehr Luft oben für die Statusleiste */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(.7rem + env(safe-area-inset-top)); }
}

/* ---- Auth / Community ---- */
.authbox { display: flex; align-items: center; gap: .5rem; }
.authuser { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; padding: .4rem .6rem; border-radius: 8px; }
.authuser .nav-ico, .authuser .icn { color: var(--text-muted); }
.authuser-name { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authuser:hover { background: var(--surface-2); }
@media (max-width: 520px) { .authuser-name { display: none; } }
.authbtn { min-height: 38px; padding: .4rem .85rem; font-size: .9rem; }
.fld { display: block; margin-bottom: .85rem; font-weight: 600; font-size: .9rem; }
.fld > input, .fld > textarea { display: block; width: 100%; margin-top: .35rem; font-weight: 400; }
textarea.fill-input { resize: vertical; font-family: inherit; line-height: 1.5; }
.tile p { white-space: normal; }

/* ---- Avatare, Rollen, Profil, Posts ---- */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; overflow: hidden; flex-shrink: 0; line-height: 1; }
:root[data-theme="dark"] .avatar { color: var(--accent); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Rollen-Tags bewusst dezent (klein, gedämpft, kein lauter Rahmen) */
.rolebadge { font-size: .62rem; font-weight: 600; letter-spacing: .02em; padding: 0 5px; border-radius: 5px; vertical-align: middle; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.post .post-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.post-author { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.post-author:hover strong { text-decoration: underline; }
.rolesel { font-family: inherit; }

/* ---- Forenbeitrag: zweispaltig (Autor-Sidebar | Inhalt) ---- */
.postrow { display: grid; grid-template-columns: 160px 1fr; gap: 0; padding: 0; overflow: hidden; }
.post-aside { background: var(--surface-2); border-right: 1px solid var(--border); padding: 1rem .8rem; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }
.post-aside .avatar { margin-bottom: .2rem; }
.post-uname { font-weight: 700; text-decoration: none; color: var(--accent); word-break: break-word; }
.post-uname:hover { color: var(--accent-dark); }
.post-aside-meta { font-size: .74rem; color: var(--text-muted); }
.post-main { padding: 1rem 1.1rem; display: flex; flex-direction: column; min-width: 0; }
.post-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-bottom: .4rem; }
.post-act { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 7px; padding: .2rem .55rem; font-size: .78rem; cursor: pointer; }
.post-act:hover { border-color: var(--accent); color: var(--text); }
.post-act.danger:hover { border-color: var(--danger); color: var(--danger); }
.post-body { white-space: pre-wrap; word-break: break-word; flex: 1; }
.post-body .quote { white-space: pre-wrap; margin: .2rem 0 .6rem; padding: .5rem .7rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-muted); font-size: .92em; }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .8rem; padding-top: .5rem; border-top: 1px solid var(--border); font-size: .76rem; color: var(--text-muted); }
.post-sig { font-style: italic; word-break: break-word; }
.post-when { white-space: nowrap; }

@media (max-width: 640px) {
  .postrow { grid-template-columns: 1fr; }
  .post-aside { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: .5rem .7rem; border-right: none; border-bottom: 1px solid var(--border); padding: .6rem .8rem; text-align: left; }
  .post-aside .avatar { width: 36px !important; height: 36px !important; font-size: 14px !important; margin: 0; }
  .post-aside-meta { font-size: .72rem; }
}

/* (Einstellungs-Tabs nutzen jetzt DaisyUI `tabs`/`tab`/`tab-active`) */

/* ---------- Mini-Buttons & Aktionen ---------- */
.btn.sm { padding: .4rem .8rem; min-height: 36px; font-size: .85rem; }
.btn.xs { padding: .25rem .55rem; min-height: 0; font-size: .78rem; border-radius: 7px; }
.btn.ghost.xs { border: 1px solid var(--border); }
.btn.danger, .btn.ghost.danger { color: var(--danger); }
.btn.danger:hover, .btn.ghost.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- Admin-Nutzerliste ---------- */
table.admin-users td { vertical-align: middle; }
table.admin-users tr.row-suspended { opacity: .6; }
table.admin-users tr.row-suspended .statlbl { color: var(--danger); font-weight: 600; }

/* ---------- Wiki ---------- */
.wiki-body { line-height: 1.6; word-break: break-word; }
.wiki-body h2 { margin: 1.1rem 0 .5rem; font-size: 1.35rem; }
.wiki-body h3 { margin: 1rem 0 .4rem; font-size: 1.12rem; }
.wiki-body h4 { margin: .9rem 0 .3rem; font-size: 1rem; }
.wiki-body p { margin: .5rem 0; }
.wiki-body ul { margin: .5rem 0; padding-left: 1.3rem; }
.wiki-body code { font-family: ui-monospace, monospace; background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.wiki-body pre.wiki-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .8rem; overflow-x: auto; margin: .6rem 0; }
.wiki-body pre.wiki-code code { background: none; padding: 0; }
/* Inhaltslinks im Wiki & Forum: grün, ohne Unterstreichung */
.wiki-body a, .post-body a { color: var(--accent); text-decoration: none; font-weight: 600; }
.wiki-body a:hover, .post-body a:hover { color: var(--accent-dark); }
:root[data-theme="dark"] .wiki-body a:hover, :root[data-theme="dark"] .post-body a:hover { filter: brightness(1.15); }
/* interner Wiki-Link + Inhaltsverzeichnis */
.wiki-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.wiki-link.missing { color: var(--danger); }
.wiki-toc { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: .8rem 1rem; margin: .6rem 0 1rem; }
.wiki-toc strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .4rem; }
.wiki-toc ol { margin: 0; padding-left: 1.2rem; }
.wiki-toc a { color: var(--accent); text-decoration: none; }
.wiki-toc .lvl3 { margin-left: .8rem; list-style: circle; }
.wiki-editor { font-family: ui-monospace, monospace; font-size: .9rem; line-height: 1.5; }

/* ---------- Zertifizierungen ---------- */
.cert-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 820px) { .cert-grid { grid-template-columns: 1fr 1fr; } }
.cert-card h3 { font-size: 1.2rem; }
.cert-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.cert-card table.history { font-size: .82rem; }

/* Startseiten-Block */
.home-certs { margin-top: 1.4rem; }
.cert-strip { display: flex; gap: .7rem; overflow-x: auto; padding: .3rem 0 .5rem; -webkit-overflow-scrolling: touch; }
.cert-pill { flex: 0 0 auto; min-width: 180px; display: flex; flex-direction: column; gap: .15rem;
  text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem 1rem; transition: border-color .15s, transform .15s; }
.cert-pill:hover { border-color: var(--accent); transform: translateY(-2px); }
.cert-pill strong { font-size: 1.05rem; }
.cert-pill .muted, .cert-pill span { color: var(--text-muted); font-size: .8rem; }
.cert-pill-exams { font-family: ui-monospace, monospace; font-size: .78rem !important; margin-top: .2rem; }

/* ---------- Impressum / Rechtstexte ---------- */
.legal h3 { margin: 1.1rem 0 .3rem; font-size: 1.05rem; }
.legal h3:first-child { margin-top: 0; }
.legal p { margin: .3rem 0 .6rem; line-height: 1.6; }

/* ---------- Wiki-Bilder ---------- */
.wiki-img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); margin: .6rem 0; display: block; }

/* ---------- Fragen-Editor ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.opt-edit { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; }
.opt-edit .fill-input { flex: 1; margin: 0; }
.opt-correct { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.opt-correct input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.opt-key { width: 1.4rem; text-align: center; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

/* ===================== Startseite (Redesign) ===================== */
.home-hero {
  text-align: center; padding: clamp(2rem, 5vw, 3.2rem) 1.2rem;
  background: linear-gradient(160deg, color-mix(in oklch, var(--color-primary) 16%, var(--color-base-100)), var(--color-base-100));
}
.home-hero-inner { max-width: 700px; margin: 0 auto; }
.home-hero-logo { font-size: 3rem; display: block; line-height: 1; }
.home-hero h1 { font-size: clamp(1.6rem, 4.2vw, 2.45rem); margin: .5rem 0 .7rem; letter-spacing: -.01em; }
.home-hero .hl { color: var(--accent); }
.home-hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto 1.3rem; font-size: 1.02rem; }
.home-hero-cta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

.home-stats { width: 100%; overflow-x: auto; margin-bottom: .4rem; }
.home-stats .stat-value.accent { color: var(--accent); }

.home-section { margin-top: 2rem; }
.home-h2 { font-size: 1.3rem; margin: 0 0 .9rem; letter-spacing: -.01em; }

.steps-wrap { overflow-x: auto; padding-bottom: .3rem; }
.steps-wrap .steps { min-width: 100%; }
.step-box { display: flex; flex-direction: column; gap: .05rem; padding-top: .35rem; }
.step-box span { font-size: .76rem; color: var(--text-muted); }

.home-collapse { padding: 0; margin-bottom: .8rem; }
.home-collapse .collapse-title { font-weight: 700; }
.topic-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.topic-list { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .9rem; line-height: 1.95; }
.topic-list .q-badge { font-size: .78rem; }

.home-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem;
  background: linear-gradient(120deg, color-mix(in oklch, var(--color-primary) 12%, var(--color-base-100)), var(--color-base-100)); }
.home-cta h2 { margin: 0 0 .2rem; font-size: 1.2rem; }

@media (max-width: 640px) {
  .topic-cols { grid-template-columns: 1fr; }
  .home-cta { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ---------- Wiki: interne-Link-Autovervollständigung ---------- */
.wiki-editor-wrap { position: relative; }
.wiki-ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; overflow: hidden; max-height: 240px; overflow-y: auto; }
.wiki-ac-item { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: .55rem .8rem; cursor: pointer; color: var(--text); font: inherit; }
.wiki-ac-item:last-child { border-bottom: none; }
.wiki-ac-item:hover { background: var(--accent-soft); color: var(--accent-dark); }
.wiki-toc .lvl4 { margin-left: 1.6rem; list-style: square; }

/* ---------- Forum: WoltLab-Gruppen ---------- */
.forum-group-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 0 .25rem .5rem; }

/* ---------- Sprachumschalter ---------- */
.lang-btn { font-size: .8rem; font-weight: 700; letter-spacing: .03em; }

/* ---------- TOTP-QR ---------- */
.totp-qr { background: #fff; padding: .6rem; border-radius: 10px; width: fit-content; margin: .2rem 0 .9rem; border: 1px solid var(--border); }
.totp-qr svg { display: block; width: 180px; height: 180px; }

/* ---------- Anzeigenblock (Google Ads, optional) ---------- */
.ad-slot { border: 1px dashed var(--border); border-radius: 10px; padding: .5rem; text-align: center; min-height: 60px; }
.ad-label { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .3rem; }
