/* ===== DEVI Interaktives Handbuch – Layout & Theme ===== */
:root {
  --bg: #f5f4f1;
  --bg-main: #fff;
  --bg-sidebar: #fff;
  --text: #1c1c1c;
  --text-muted: #5c5c5c;
  --accent: #b71c38;
  --accent-hover: #8e152c;
  --border: #e2e0dc;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-sidebar: 2px 0 12px rgba(0,0,0,.04);
  --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-vi: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Monaco', monospace;
  --sidebar-width: 280px;
}

[data-theme="dark"] {
  --bg: #1c1c1e;
  --bg-main: #252528;
  --bg-sidebar: #2c2c30;
  --text: #eae8e5;
  --text-muted: #9a9895;
  --border: #3c3c40;
  --shadow: 0 1px 3px rgba(0,0,0,.2);
  --shadow-sidebar: 2px 0 16px rgba(0,0,0,.2);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  /* Safe area für PWA / Notch-Geräte */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ----- Layout: Sidebar links, Main rechts (fix: Main immer in Spalte 2) ----- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

/* Overlay aus dem Gridfluss, damit nur Sidebar + Main die Spalten belegen */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 99;
  pointer-events: none;
}
.sidebar-overlay.open {
  display: block;
  pointer-events: auto;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-sidebar);
  z-index: 10;
}

.main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0; /* Grid-Overflow verhindern */
}

/* ----- Mobile & PWA: Touch-freundlich, Safe Area ----- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    max-width: min(85vw, 320px);
    z-index: 100;
    transition: left .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-bottom: env(safe-area-inset-bottom);
    height: 100vh;
    height: 100dvh;
  }
  .sidebar.open { left: 0; }
  .main { grid-column: 1; grid-row: 1; }

  /* Größere Touch-Ziele in der Sidebar */
  .sidebar-header { padding: 1rem 1rem 0.75rem; }
  .search-wrap { padding: 0 1rem 0.75rem; }
  .search-wrap input {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 16px; /* verhindert iOS-Zoom beim Fokus */
  }
  .toolbar {
    padding: 0 1rem 0.75rem;
    gap: 0.5rem;
  }
  .toolbar button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .menu-toggle {
    min-width: 48px;
    min-height: 44px;
    font-size: 1.25rem;
  }
  .nav-tree {
    padding: 0 0 2rem;
    font-size: 0.9rem;
  }
  .nav-tree a {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .sidebar { max-width: 100%; }
  .main {
    padding: 1.25rem 1rem 3rem;
    padding-top: calc(52px + env(safe-area-inset-top) + 1.25rem);
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
    box-shadow: none;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .main h1 { font-size: 1.5rem; }
  .main h2 { font-size: 1.25rem; margin: 1.75rem 0 0.75rem; scroll-margin-top: 1rem; }
  .main h3 { font-size: 1.1rem; }
  .main h4 { font-size: 1rem; }
  body { font-size: 1rem; }
  .vokabel-table {
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .vokabel-table th, .vokabel-table td { padding: 0.5rem 0.6rem; white-space: normal; word-break: break-word; }
  .dialog { padding: 0.85rem 1rem; }
  .dialog-line .who { display: block; margin-bottom: 0.2rem; }
  .exercise {
    padding: 1rem 1.1rem;
    margin: 1.25rem 0;
  }
  .exercise .solution-toggle {
    min-height: 44px;
    padding: 0.65rem 1.1rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .bookmark-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
  .pwa-install-box {
    padding: 1rem 1.1rem;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .pwa-install-logo { margin: 0 auto; }
  .pwa-install-btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-size: 1.05rem;
  }
  .steps li { padding: 0.65rem 0.75rem 0.65rem 3rem; }
  .box-tip, .box-wichtig { padding: 0.85rem 1rem; }
  .beruf-card-body { padding: 1rem 1.1rem; }
  .beruf-overview-grid { grid-template-columns: 1fr; }
  .berufe-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 400px) {
  .sidebar-header h1 { font-size: 1.05rem; }
  .nav-tree a { padding: 0.65rem 1rem; }
  .main { padding: 1rem 0.75rem 2.5rem; }
}

.sidebar-header {
  padding: 1rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-header .subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sidebar-logos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.sidebar-logo {
  height: auto;
  max-height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-logo-main { max-width: 140px; }
.sidebar-logo-2664 { max-width: 90px; }

[data-theme="dark"] .sidebar-logo-main {
  filter: brightness(0) invert(1);
}

/* Suche */
.search-wrap {
  padding: 0 1.25rem 0.75rem;
}

.search-wrap input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { outline: 2px solid var(--accent); outline-offset: 0; }

/* Nav-Baum */
.nav-tree {
  list-style: none;
  padding: 0 0 1.5rem;
  margin: 0;
  font-size: 0.88rem;
}

.nav-tree li { margin: 0; }

.nav-tree a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.nav-tree a:hover { background: var(--bg); color: var(--accent); border-left-color: var(--accent); }
.nav-tree a.active { border-left-color: var(--accent); font-weight: 600; color: var(--accent); background: rgba(183, 28, 56, 0.06); }
[data-theme="dark"] .nav-tree a.active { background: rgba(183, 28, 56, 0.15); }
.nav-tree ul { list-style: none; padding-left: 1rem; margin: 0; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem 0.75rem;
  flex-wrap: wrap;
}

.toolbar button {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background .15s, border-color .15s, color .15s;
}

.toolbar button:hover { background: var(--border); }
.toolbar button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.toolbar button, .menu-toggle, .bookmark-btn, .solution-toggle, .pwa-install-btn, .nav-tree a {
  touch-action: manipulation;
}

/* Sidebar-Schließen-Button (nur Mobile) */
.sidebar-close {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .15s, color .15s;
}
.sidebar-close:hover { background: var(--border); color: var(--accent); }
@media (max-width: 900px) {
  .sidebar-header { position: relative; }
  .sidebar-close { display: flex; }
}
@media (min-width: 901px) { .sidebar-close { display: none !important; } }

/* Mobile-Header: feste Leiste mit Menü-Button (nur bei schmalem Viewport) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  height: 52px;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 0.75rem;
  padding-left: calc(0.75rem + env(safe-area-inset-left));
  box-shadow: var(--shadow);
}
.mobile-menu-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.mobile-menu-btn:hover { background: var(--border); }
.mobile-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
@media (max-width: 900px) {
  .mobile-header { display: flex; }
  .main { padding-top: calc(52px + env(safe-area-inset-top) + 1rem) !important; }
}
@media (min-width: 901px) { .mobile-header { display: none !important; } }

.menu-toggle { display: none; }
@media (max-width: 900px) { .menu-toggle { display: inline-flex; } }

/* ----- Main Content (immer rechts neben der Sidebar) ----- */
.main {
  padding: 2.5rem 3rem 4rem;
  max-width: 56rem;
  margin: 0 auto;
  background: var(--bg-main);
  box-shadow: -4px 0 20px rgba(0,0,0,.03);
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

[data-theme="dark"] .main { box-shadow: -4px 0 24px rgba(0,0,0,.15); }

.main h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--accent);
  letter-spacing: -0.02em;
}

.main h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.25rem 0 1rem;
  color: var(--text);
  scroll-margin-top: 1.5rem;
}

.main h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.6rem; }
.main h4 { font-size: 1.05rem; font-weight: 600; margin: 1.1rem 0 0.5rem; }

.main p { margin: 0 0 1rem; color: var(--text); }
.main ul, .main ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.main li { margin: 0.35rem 0; }

.main a { color: var(--accent); text-decoration: none; font-weight: 500; }
.main a:hover { text-decoration: underline; }
.main .lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Lesezeichen-Badge */
.bookmark-btn {
  padding: .2rem .5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: .5rem;
  vertical-align: middle;
}

.bookmark-btn:hover { color: var(--accent); border-color: var(--accent); }
.bookmark-btn.saved { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Suchergebnisse verstecken wenn kein Treffer */
section.hidden-by-search { display: none; }
section.hidden-by-search h2 { display: none; }

/* ----- Lerninhalte: Schritte, Boxen, Vokabeln, Dialoge ----- */
.steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: .75rem 1rem .75rem 3.5rem;
  margin: .5rem 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.box-tip, .box-wichtig {
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: var(--radius);
  border-left: 4px solid;
}
.box-tip {
  background: rgba(196, 30, 58, 0.08);
  border-left-color: var(--accent);
}
.box-wichtig {
  background: rgba(220, 180, 0, 0.12);
  border-left-color: #c9a600;
}
.box-tip strong, .box-wichtig strong { display: block; margin-bottom: .35rem; }
.vokabel-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.vokabel-table th,
.vokabel-table td {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.vokabel-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}
.vokabel-table td { background: var(--bg-main); }
[data-theme="dark"] .vokabel-table th { background: var(--border); }
.vokabel-table tr:nth-child(even) { background: rgba(0,0,0,.02); }
[data-theme="dark"] .vokabel-table tr:nth-child(even) { background: rgba(255,255,255,.04); }
.vokabel-table .pronounce { font-size: 0.85em; color: var(--text-muted); }
.dialog {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.dialog-line { margin: .5rem 0; }
.dialog-line .who { font-weight: 600; color: var(--accent); margin-right: .5rem; }
.handbuch-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1rem 0;
  display: block;
}

.willkommen-bridge { margin: 1.5rem 0 2rem; }
.willkommen-bridge-img { width: 100%; max-width: 100%; }
.img-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: .35rem;
  margin-bottom: 1rem;
}
.vokabel-section h4 { margin-top: 1.25rem; }

/* ----- Übungen ----- */
.exercise {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.exercise-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.exercise p { margin: 0.5rem 0; }

/* Bilinguale Hinweise: andere Sprache als Lernhilfe in Übungen */
.exercise-bilingual-hint {
  display: block;
  margin: 0.4rem 0 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  border-left: 2px solid var(--border);
}
[data-theme="dark"] .exercise-bilingual-hint { background: rgba(255, 255, 255, 0.06); }

.exercise .solution-toggle {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background .2s, transform .1s;
}
.exercise .solution-toggle:hover { background: var(--accent-hover); }
.exercise .solution-toggle .toggle-hide { display: none; }
.exercise .solution-toggle[aria-expanded="true"] .toggle-show { display: none; }
.exercise .solution-toggle[aria-expanded="true"] .toggle-hide { display: inline; }

.solution {
  display: none;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(183, 28, 56, 0.08);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-weight: 500;
}
.solution.revealed { display: block; }
[data-theme="dark"] .solution { background: rgba(183, 28, 56, 0.15); }

/* Interaktive Übungen: Eingabe & Prüfen */
.exercise-input-wrap { display: inline-block; margin: 0 0.25rem; }
.exercise-input-field {
  width: 8rem;
  min-width: 6rem;
  max-width: 100%;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-main);
  color: var(--text);
}
.exercise-input-field:focus {
  outline: none;
  border-color: var(--accent);
}
.exercise-input-field.correct { border-color: #0a7c42; background: rgba(10, 124, 66, 0.08); }
.exercise-input-field.incorrect { border-color: #c0392b; background: rgba(192, 57, 43, 0.06); }
.exercise-check-row { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.exercise-check-btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}
.exercise-check-btn:hover { background: var(--accent-hover); }
.exercise-feedback {
  font-weight: 600;
  padding: 0.25rem 0;
  min-height: 1.5em;
}
.exercise-feedback.correct { color: #0a7c42; }
.exercise-feedback.incorrect { color: #c0392b; }
[data-theme="dark"] .exercise-input-field.correct { background: rgba(10, 124, 66, 0.2); }
[data-theme="dark"] .exercise-input-field.incorrect { background: rgba(192, 57, 43, 0.15); }

.mc-options { list-style: none; padding-left: 0; margin: 0.5rem 0; }
.mc-options li { padding: 0.35rem 0; padding-left: 1rem; border-left: 2px solid var(--border); margin: 0.25rem 0; }
.mc-options.mc-clickable li {
  cursor: pointer;
  padding: 0.5rem 1rem;
  margin: 0.35rem 0;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: background .15s, border-color .15s;
}
.mc-options.mc-clickable li:hover { background: var(--bg); border-color: var(--accent); }
.mc-options.mc-clickable li.mc-correct { border-color: #0a7c42; background: rgba(10, 124, 66, 0.1); cursor: default; }
.mc-options.mc-clickable li.mc-incorrect { border-color: #c0392b; background: rgba(192, 57, 43, 0.08); cursor: default; }
.mc-options.mc-clickable li.mc-disabled { pointer-events: none; opacity: 0.85; }
.match-list { list-style: none; padding-left: 0; }
.match-list li { margin: 0.4rem 0; }

/* Kurz-Üben-Boxen in anderen Kapiteln */
.exercise.kurz-ueben {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-left-width: 4px;
}
.exercise.kurz-ueben .exercise-title { font-size: 1rem; margin-bottom: 0.5rem; }
.exercise.kurz-ueben p { margin-bottom: 0.5rem; }

/* PWA Install-Box (unter Willkommen) */
.pwa-install-box {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.pwa-install-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}
.pwa-install-text {
  flex: 1;
  min-width: 200px;
  font-size: 0.95rem;
  color: var(--text);
}
.pwa-install-btn {
  flex-shrink: 0;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.pwa-install-btn:hover {
  background: var(--accent-hover);
}
.pwa-install-box .pwa-install-hint {
  width: 100%;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pwa-install-box:not(.installable) .pwa-install-btn {
  opacity: 0.85;
}

.berufe-table { font-size: 0.9rem; }
.berufe-table th:nth-child(1),
.berufe-table td:nth-child(1) { min-width: 10rem; }
@media (max-width: 600px) {
  .berufe-table { display: block; overflow-x: auto; }
}

/* Berufe-Karten mit Bild */
.beruf-card {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-main);
  box-shadow: var(--shadow);
}
.beruf-card-img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  background: var(--bg);
  vertical-align: middle;
}
.beruf-card-body { padding: 1.25rem 1.5rem; }
.beruf-card h4 { margin: 0 0 0.75rem; font-size: 1.2rem; color: var(--accent); }
.beruf-card ul { margin: 0.5rem 0; padding-left: 1.25rem; }
.beruf-card .beruf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.beruf-card .beruf-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.beruf-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.beruf-overview-item {
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  font-size: 0.95rem;
}
.beruf-overview-item strong { display: block; margin-bottom: 0.25rem; }
.beruf-flow {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: rgba(183, 28, 56, 0.06);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}
.beruf-flow ol { margin: 0.5rem 0 0 1.25rem; padding: 0; }
.beruf-flow li { margin: 0.35rem 0; }
[data-theme="dark"] .beruf-flow { background: rgba(183, 28, 56, 0.12); }

/* ----- Druck ----- */
/* ----- Sprachumschaltung (DE / Tiếng Việt) ----- */
[data-lang="de"] .content-vi,
[data-lang="vi"] .content-de { display: none; }
[data-lang="de"] .content-de,
[data-lang="vi"] .content-vi { display: block; }

/* Navigation: beide Sprachen sichtbar, optional nur aktive */
[data-lang="vi"] .nav-de { opacity: 0.6; }
[data-lang="de"] .nav-vi { opacity: 0.6; }

[data-lang="vi"] .sub-de { display: none; }
[data-lang="de"] .sub-vi { display: none; }
[data-lang="vi"] .sub-vi { display: block; }
[data-lang="de"] .sub-de { display: block; }

/* Vietnamesischer Text: gute Lesbarkeit für Diakritika */
.content-vi, .nav-vi, .sub-vi, [lang="vi"] {
  font-family: var(--font-vi);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .sidebar, .toolbar, .search-wrap, .menu-toggle, .bookmark-btn, .no-print, .solution-toggle, .mobile-header, .sidebar-close, .exercise-check-row, .exercise-check-btn { display: none !important; }
  .solution { display: block !important; }
  .exercise-input-field { border: 1px solid #ccc; background: #f9f9f9; }
  .mc-clickable li.mc-correct { border-color: #0a7c42 !important; }
  .mc-clickable li.mc-incorrect { border-color: #c0392b !important; }
  .layout { grid-template-columns: 1fr; }
  .main { max-width: none; padding: 0 !important; padding-top: 0 !important; }
  body { background: #fff; color: #000; }
  .main a { color: #000; }
  .main h2 { break-after: avoid; }
  .vokabel-table, .steps li, .dialog, .exercise, .beruf-card { break-inside: avoid; }
  .handbuch-img, .beruf-card-img { max-width: 80%; }
  .beruf-card-img { max-height: none; height: auto; object-fit: contain; }
}
