/* ═══════════════════════════════════════════════════════════════
   MOREMEDIA® Master AI — Shared Template
   Used by Handbuch, Dokumentation, Admin Panel.
═══════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-base);
  color: var(--tx-0);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ac-bg); }

/* ── App shell ──────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────── */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #161310;
  border-bottom: 1px solid #2b2723;
  z-index: 20;
  color: #f4ede2;
}
.hdr-l { display: flex; align-items: center; gap: 14px; }
.hdr-logo { height: 16px; display: block; }
/* Header is always dark → always show the light (white) logo */
.hdr-logo.l-light { display: none; }
.hdr-logo.l-dark  { display: block; }
.hdr-pipe {
  width: 1px;
  height: 16px;
  background: #3a342d;
  margin: 0 6px;
}
.hdr-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 320px;
  color: #f4ede2;
  letter-spacing: -0.005em;
}
.hdr-crumb {
  font-size: 14px;
  color: #a39a8c;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
.hdr-crumb::before {
  content: "›";
  color: #6e665b;
}
.hdr-r { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }

/* User badge + logout in header (right side) */
.hdr-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.14);
  margin: 0 4px;
  flex-shrink: 0;
}
.hdr-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  cursor: default;
}
.hdr-avi {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706 0%, #a05a05 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.hdr-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.hdr-user-name {
  font-size: 13px;
  font-weight: 500;
  color: #f4ede2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  letter-spacing: -0.005em;
}
.hdr-user-role {
  font-size: 11px;
  color: #a39a8c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  letter-spacing: 0.01em;
}
.hdr-logout {
  /* picks up shared .icon-btn styles; no extra colour needed */
}
@media (max-width: 1100px) {
  .hdr-user-meta { display: none; }
}
@media (max-width: 720px) {
  .hdr-divider { display: none; }
  .hdr-user { padding: 0; }
}
.hdr-l { min-width: 0; flex: 1 1 auto; }

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #221e1a;
  border: 1px solid #322c26;
  border-radius: var(--r-md);
  padding: 6px 10px;
  width: clamp(180px, 28vw, 360px);
  flex-shrink: 1;
  min-width: 0;
  transition: border-color 120ms, background 120ms;
}
.search:focus-within {
  border-color: #4a4239;
  background: #2a2520;
}
.search input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  font: inherit;
  color: #f4ede2;
  font-size: 13px;
}
.search input::placeholder { color: #8b8275; }
.search svg { color: #8b8275; flex-shrink: 0; }
/* Compact search trigger (mobile): hidden on wide screens */
.search-trigger { display: none; }
.search-trigger.is-active {
  background: #322c26;
  color: #f4ede2;
}
.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #a39a8c;
  background: #161310;
  border: 1px solid #3a342d;
  border-radius: 3px;
  padding: 1px 5px;
}

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: #c8bfb0;
  transition: background 120ms, color 120ms;
}
.hdr .icon-btn { color: #c8bfb0; }
.hdr .icon-btn:hover { background: #2a2520; color: #fff; }
.icon-btn:hover { background: var(--ac-bg); color: var(--tx-0); }

/* ── Body grid (sidebar + main + toc) ───────────────────── */
.body {
  display: grid;
  grid-template-columns: 264px 1fr;
  overflow: hidden;
}
.body.with-toc {
  grid-template-columns: 264px 1fr 240px;
}

/* ── Left nav ───────────────────────────────────────────── */
.nav {
  background: var(--bg-surface);
  border-right: 1px solid var(--bdr-def);
  overflow-y: auto;
  padding: 18px 0 32px;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--bdr-def); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }

.nav-section {
  padding: 22px 22px 8px 22px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx-2);
}
.nav-group:first-child .nav-section { padding-top: 6px; }
.nav-group { margin-bottom: 4px; position: relative; }
.nav-group.has-label { padding-left: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 22px 6px 22px;
  font-size: 13.5px;
  color: var(--tx-1);
  border-left: 2px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
  cursor: pointer;
  line-height: 1.4;
  position: relative;
}
.nav-item:hover { color: var(--tx-0); background: var(--ac-bg); }
.nav-item.active {
  color: var(--tx-0);
  background: var(--ac-bg);
  border-left-color: var(--ac-1);
  font-weight: 500;
}
.nav-item .nav-ico {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--tx-2);
}
.nav-item.active .nav-ico { color: var(--ac-1); }

/* Sub-items live under a section label — indent so the hierarchy reads */
.nav-item.nav-sub {
  padding-left: 38px;
  font-size: 13px;
}
/* Subtle vertical guide rail showing items belong to their section */
.nav-group.has-label .nav-item.nav-sub::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--bdr-faint);
}
.nav-group.has-label .nav-item.nav-sub.active::before { background: transparent; }

/* ── Main content ────────────────────────────────────────── */
.main {
  overflow-y: auto;
  padding: 0;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--bdr-def); border-radius: 4px; }
.main::-webkit-scrollbar-track { background: transparent; }

.page {
  max-width: clamp(720px, 72vw, 1120px);
  margin: 0 auto;
  padding: 56px clamp(32px, 4vw, 72px) 96px;
}
.page-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.page h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
.page h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 56px 0 14px; line-height: 1.25; }
.page h3 { font-size: 17px; font-weight: 600; margin: 32px 0 10px; }
.page h4 { font-size: 14.5px; font-weight: 600; margin: 24px 0 8px; }
.page p  { color: var(--tx-1); line-height: 1.7; margin: 0 0 14px; font-size: 14.5px; }
.page p strong, .page li strong { color: var(--tx-0); font-weight: 600; }
.page ul, .page ol { padding-left: 36px; margin: 0 0 24px; color: var(--tx-1); }
.page li { margin: 6px 0; line-height: 1.65; padding-left: 4px; }
.page code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-el);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--tx-0);
}
.page pre {
  background: var(--bg-el);
  border: 1px solid var(--bdr-faint);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 14px 0 22px;
}
.page pre code { background: none; padding: 0; font-size: inherit; }
.page hr { border: 0; border-top: 1px solid var(--bdr-faint); margin: 28px 0; }
.page a.link { color: var(--ac-1); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.page a.link:hover { color: var(--tx-0); }

/* Page header (above h1) */
.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx-2);
  margin-bottom: 14px;
}
.page-meta {
  display: flex;
  gap: 18px;
  margin: 18px 0 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--bdr-faint);
  font-size: 12.5px;
  color: var(--tx-2);
}
.page-meta .metric { color: var(--tx-1); font-family: var(--font-mono); font-size: 12px; }

/* Admonitions / Callouts */
.callout {
  border: 1px solid var(--bdr-def);
  border-left: 5px solid var(--inf);
  background: var(--inf-bg);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 18px 0;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
}
.callout-ico { color: var(--inf); margin-top: 2px; }
.callout-t { font-weight: 600; color: var(--tx-0); margin-bottom: 4px; font-size: 14px; }
.callout-b { color: var(--tx-1); font-size: 14px; line-height: 1.6; }
.callout-b p { margin: 0; }
.callout.tip     { border-left-color: var(--ok);  background: var(--ok-bg);  }
.callout.tip   .callout-ico { color: var(--ok); }
.callout.warn  { border-left-color: var(--wa);  background: var(--wa-bg);  }
.callout.warn  .callout-ico { color: var(--wa); }
.callout.danger{ border-left-color: var(--er);  background: var(--er-bg);  }
.callout.danger .callout-ico { color: var(--er); }

/* Card (used in admin / general) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card.el { background: var(--bg-el); }
.card-h {
  padding: 14px 22px;
  border-bottom: 1px solid var(--bdr-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-t { font-size: 13.5px; font-weight: 500; color: var(--tx-0); }
.card-u { font-size: 12px; color: var(--tx-2); display: flex; align-items: center; gap: 8px; }
.card-b { padding: 22px; }
.card-b.flush { padding: 0; }

/* Tables */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  background: var(--bg-ov);
  color: var(--tx-2);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  border-bottom: 1px solid var(--bdr-def);
}
.tbl td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--bdr-faint);
  color: var(--tx-1);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.tx0 { color: var(--tx-0); font-weight: 500; }
.tbl td.mono { font-family: var(--font-mono); font-size: 12px; color: var(--tx-1); }

.page .tbl-wrap {
  border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 16px 0 22px;
  background: var(--bg-surface);
}
.page .tbl-wrap .tbl td { padding: 12px 18px; }

/* Plain table — no zebra, used on Handbuch start page */
.tbl.tbl-plain tbody tr:nth-child(even) td { background: transparent; }
.tbl.tbl-plain td { padding: 16px 18px; }
.tbl.tbl-plain td:first-child { font-weight: 500; }

/* Numbered feature blocks (Handbuch start) */
.hb-feat {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--bdr-def);
}
.hb-feat:first-of-type { border-top: none; padding-top: 6px; }
.hb-feat-num {
  font: 500 13px var(--font-mono);
  color: var(--tx-2);
  letter-spacing: 0.04em;
  padding-top: 6px;
}
.hb-feat-ico {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--bdr-def);
  border-radius: 8px;
  color: var(--tx-1);
  background: var(--bg-el);
  margin-top: 4px;
}
.hb-feat-ico svg { width: 18px; height: 18px; }
.tbl-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  color: var(--tx-2);
  margin-right: 10px;
  vertical-align: -5px;
}
.tbl-ico svg { width: 16px; height: 16px; }
.hb-feat-body h3 { margin-top: 4px; }
.hb-feat-body p:last-child { margin-bottom: 0; }

/* Status dot + badge */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tx-2);
  margin-right: 7px;
  vertical-align: 1px;
}
.dot.ok { background: var(--ok); }
.dot.wa { background: var(--wa); }
.dot.er { background: var(--er); }
.dot.inf{ background: var(--inf); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bdr-def);
  background: var(--bg-el);
  color: var(--tx-1);
}
.badge.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok); }
.badge.wa { background: var(--wa-bg); border-color: var(--wa-bd); color: var(--wa); }
.badge.er { background: var(--er-bg); border-color: var(--er-bd); color: var(--er); }
.badge.inf{ background: var(--inf-bg); border-color: var(--inf-bd); color: var(--inf); }

/* Metric tile (admin) */
.tile {
  background: var(--bg-surface);
  border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg);
  padding: 18px 22px 16px;
}
.tile-k {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx-2);
  margin-bottom: 8px;
}
.tile-v {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 28px;
  color: var(--tx-0);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.tile-v .u { font-size: 14px; color: var(--tx-2); margin-left: 6px; font-weight: 400; }
.tile-d { font-size: 11.5px; color: var(--tx-2); margin-top: 6px; font-family: var(--font-mono); }
.tile-d.up { color: var(--ok); }
.tile-d.down { color: var(--er); }

/* Score bar */
.bar { margin: 12px 0; }
.bar-h {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--tx-1);
  margin-bottom: 5px;
}
.bar-h .mono { font-family: var(--font-mono); color: var(--tx-0); }
.bar-t {
  background: var(--bg-el);
  border-radius: var(--r-sm);
  height: 6px;
  overflow: hidden;
}
.bar-f { height: 100%; background: var(--ac-1); border-radius: var(--r-sm); }
.bar-f.ok { background: var(--ok); }
.bar-f.wa { background: var(--wa); }
.bar-f.er { background: var(--er); }
.bar-f.inf{ background: var(--inf); }

/* ── Right TOC ───────────────────────────────────────────── */
.toc {
  border-left: 1px solid var(--bdr-def);
  background: var(--bg-base);
  overflow-y: auto;
  padding: 32px 22px;
}
.toc-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx-2);
  margin-bottom: 14px;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin: 0; }
.toc-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--tx-1);
  border-left: 2px solid transparent;
  margin-left: -10px;
  transition: color 120ms, border-color 120ms;
  line-height: 1.45;
}
.toc-list .toc-ico {
  width: 13px; height: 13px;
  flex-shrink: 0;
  color: var(--tx-2);
  display: inline-flex;
}
.toc-list .toc-ico svg { width: 13px; height: 13px; }
.toc-list a:hover { color: var(--tx-0); }
.toc-list a:hover .toc-ico { color: var(--tx-1); }
.toc-list a.on {
  color: var(--tx-0);
  border-left-color: var(--ac-1);
  font-weight: 500;
}
.toc-list a.on .toc-ico { color: var(--ac-1); }
.toc-list .lvl-3 a { padding-left: 22px; font-size: 12.5px; }
.toc-list .lvl-3 .toc-ico { width: 12px; height: 12px; }
.toc-list .lvl-3 .toc-ico svg { width: 12px; height: 12px; }

/* ── Theme toggle button visual ──────────────────────────── */
.surface-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-2);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--bdr-def);
  background: var(--bg-el);
}

/* ── Layout helpers ──────────────────────────────────────── */
.row { display: flex; gap: 14px; }
.col { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mono { font-family: var(--font-mono); }
.tx2 { color: var(--tx-2); }
.tx1 { color: var(--tx-1); }

/* ── Hamburger + backdrop (only shown on small screens) ──── */
.hdr-burger { display: none; }
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0 0;
  background: rgba(20,15,5,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
  z-index: 25;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1280px) {
  .search { width: clamp(160px, 22vw, 260px); }
  .hdr-title { max-width: 220px; }
}
@media (max-width: 1180px) {
  .body.with-toc { grid-template-columns: 264px 1fr; }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .body, .body.with-toc { grid-template-columns: 1fr; }
  .nav {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    width: 280px;
    max-width: 86vw;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.2,.7,.2,1);
  }
  .app.nav-open .nav { transform: translateX(0); }
  .app.nav-open .nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .hdr-burger { display: inline-flex; margin-left: -6px; }
  .hdr-crumb { display: none; }
  .hdr-title { max-width: 180px; }
  .search { width: 200px; }
}
@media (max-width: 820px) {
  .hdr-title { max-width: 140px; }
}
@media (max-width: 720px) {
  /* Collapse search to a single icon button; keep title visible */
  .hdr-title { max-width: 110px; }
  .search {
    display: none;
    position: absolute;
    top: 50%;
    right: 56px;
    transform: translateY(-50%);
    width: min(420px, calc(100vw - 100px));
    z-index: 25;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  .search.is-open { display: flex; }
  .search-trigger { display: inline-flex; }
  .hdr { position: relative; }
}
/* ═══════════════════════════════════════════════════════════
   Admin · Design System / Schriften / Mitarbeiter / Audit-Log
   ═══════════════════════════════════════════════════════════ */
.ds-page { padding-top: 36px; }
.ds-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
}
.ds-title { font-size: 32px; margin: 4px 0 0; letter-spacing: -0.02em; }
.ds-sub { color: var(--tx-1); margin: 8px 0 0; max-width: 640px; font-size: 14px; }
.ds-sub code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-el); padding: 1px 6px; border-radius: var(--r-sm);
}
.ds-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }

/* Buttons */
.btn {
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; transition: 120ms;
  display: inline-flex; align-items: center; gap: 6px;
  line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--ac-2); color: var(--bg-surface); border-color: var(--ac-2); }
.btn-primary:hover { background: var(--ac-1); border-color: var(--ac-1); }
.btn-ghost { background: transparent; color: var(--tx-1); border-color: var(--bdr-def); }
.btn-ghost:hover { color: var(--tx-0); border-color: var(--bdr-str); background: var(--bg-el); }
.btn.btn-sm { font-size: 11px; padding: 3px 10px; line-height: 16px; }
.btn-xs {
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-sm);
  line-height: 1.4;
}

/* Section labels */
.ds-section-l {
  font-size: 11px; font-weight: 500; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--tx-2);
  margin: 0 0 14px;
}

/* Color tokens grid */
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 32px; }
.ds-col {
  background: var(--bg-surface); border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg); padding: 18px 20px;
}
.ds-col-h {
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tx-2);
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--bdr-faint);
  display: flex; align-items: baseline; gap: 8px;
}
.ds-col-hs { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--tx-2); }
.ds-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--bdr-faint);
}
.ds-row:last-child { border-bottom: 0; }
.ds-sw {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid var(--bdr-def);
}
.ds-name { font-size: 13px; color: var(--tx-0); font-weight: 500; line-height: 1.25; }
.ds-var { font-size: 11.5px; color: var(--tx-2); margin-top: 2px; }
.ds-hex { font-size: 11.5px; color: var(--tx-1); letter-spacing: 0.02em; }

/* Color preview block */
.ds-preview {
  background: var(--bg-surface); border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg); padding: 18px 20px;
}
.ds-prev-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.ds-prev-block {
  height: 64px; border-radius: var(--r-md);
  border: 1px solid var(--bdr-def);
}
.ds-prev-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Schriften — family cards */
.ds-fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 28px; }
.ds-fam {
  background: var(--bg-surface); border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.ds-fam.on { border-color: var(--ac-1); box-shadow: 0 0 0 3px var(--ac-bg); }
.ds-fam-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ds-fam-n { font-size: 19px; font-weight: 700; color: var(--tx-0); letter-spacing: -0.01em; }
.ds-fam-c { font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.ds-fam-pill {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--ac-2); color: var(--bg-surface);
  padding: 3px 9px; border-radius: 999px;
}
.ds-fam-spec {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 0; border-top: 1px solid var(--bdr-faint); border-bottom: 1px solid var(--bdr-faint);
}
.ds-fam-spec-l { color: var(--tx-2); font-weight: 400; font-size: 13px; font-style: normal; letter-spacing: 0; }
.ds-fam-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-tag {
  font-size: 11px; color: var(--tx-1); background: var(--bg-el);
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--bdr-faint);
}
.ds-fam .btn { width: 100%; justify-content: center; padding: 11px; }

/* Drop zone + upload row */
.ds-drop {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px dashed var(--bdr-def); border-radius: var(--r-md);
  padding: 32px 20px; color: var(--tx-2); font-size: 13.5px;
  background: var(--bg-base);
  cursor: pointer; transition: 120ms;
}
.ds-drop:hover { border-color: var(--ac-1); color: var(--tx-1); background: var(--ac-bg); }
.ds-drop-ico { width: 18px; height: 18px; color: var(--tx-2); display: inline-flex; }
.ds-upload-row { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr auto; gap: 14px; align-items: end; margin-top: 18px; }
.ds-fld { display: flex; flex-direction: column; gap: 6px; }
.ds-fld label { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tx-2); }
.ds-fld input,
.ds-fld select {
  font-family: var(--font-ui); font-size: 13.5px; color: var(--tx-0);
  background: var(--bg-base); border: 1px solid var(--bdr-def);
  border-radius: var(--r-md); padding: 10px 12px; height: 38px;
  appearance: none;
}
.ds-fld input::placeholder { color: var(--tx-2); }
.ds-fld input:focus, .ds-fld select:focus { outline: none; border-color: var(--ac-1); box-shadow: 0 0 0 3px var(--ac-bg); }
.ds-fld select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238A8478' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.ds-upload-row .btn { height: 38px; padding: 0 18px; }

/* Mitarbeiter */
.ds-perms { display: flex; flex-wrap: wrap; gap: 4px; }
.ds-perm {
  font-family: var(--font-mono); font-size: 11px; color: var(--tx-1);
  background: var(--bg-el); padding: 2px 7px; border-radius: var(--r-sm);
  border: 1px solid var(--bdr-faint); line-height: 1.5;
}
.ds-me {
  margin-left: 8px; font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ac-2);
  background: var(--ac-bg); padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--bdr-faint);
}
.tbl-mit td { vertical-align: top; padding: 16px 18px !important; }
.tbl-mit td.tx0 { padding-top: 18px !important; }

/* Audit-Log */
.ds-sel-inline {
  font-family: var(--font-ui); font-size: 12px; color: var(--tx-1);
  background: transparent; border: 0; appearance: none; cursor: pointer;
  padding: 2px 18px 2px 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238A8478' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 0 center;
}
.tbl-audit td { padding: 13px 18px !important; }

@media (max-width: 1080px) {
  .ds-grid { grid-template-columns: 1fr; }
  .ds-upload-row { grid-template-columns: 1fr 1fr; }
  .ds-upload-row .btn { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .hdr { padding: 0 14px; }
  .hdr-l { gap: 8px; }
  .hdr-pipe { display: none; }
  .hdr-title { display: none; }
  .page { padding: 28px 20px 64px; }
  .page h1 { font-size: 26px; }
  .page-wide { padding: 22px 18px 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Tutorials page ───────────────────────────────────────── */
.page-eyebrow-pill {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--ac-soft, rgba(217, 119, 87, 0.14));
  color: var(--ac, #a8552d);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
}
[data-theme="dark"] .page-eyebrow-pill { background: rgba(217, 119, 87, 0.18); color: #f0a482; }

.tut { margin: 32px 0 0; }
.tut:first-of-type { margin-top: 24px; }

.tut-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0;
  background: var(--bg-card, var(--bg-base));
  border: 1px solid var(--bdr-def);
  border-radius: 14px;
  overflow: hidden;
}
.tut-rail {
  background: var(--bg-sunken);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--bdr-faint);
  position: relative;
}
.tut-rail-eyebrow {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-2);
}
.tut-rail-num {
  font: 600 44px/1 var(--font-display, var(--font-sans));
  color: var(--tx-1);
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.tut-rail-emoji { font-size: 22px; margin-top: 4px; }
.tut-rail-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-base);
  border: 1px solid var(--bdr-def);
  color: var(--tx-1);
  margin-top: 4px;
}
.tut-rail-icon svg { width: 18px; height: 18px; }
.tut-tip-ico { color: var(--tx-1); }
.tut-tip-ico svg { width: 20px; height: 20px; }
.tut-rail-dur {
  margin-top: auto;
  font: 12px/1.3 var(--font-mono);
  color: var(--tx-2);
}

.tut-body { padding: 24px 28px 26px; min-width: 0; }
.tut-h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.tut-scenario {
  margin: 0 0 18px;
  padding-left: 14px;
  border-left: 3px solid var(--ac, #d97757);
  color: var(--tx-1);
  font-size: 14.5px;
  line-height: 1.6;
}
.tut-plugin-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--bdr-faint);
}
.tut-plugin-lbl {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-2);
  margin-right: 4px;
}
.tut-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-sunken);
  border: 1px solid var(--bdr-faint);
  font-size: 12px;
  color: var(--tx-1);
  white-space: nowrap;
}

.tut-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tut-step {
  margin: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}
.tut-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ac, #d97757);
  color: #fff;
  font: 600 12px/26px var(--font-mono);
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.tut-step-body { min-width: 0; }
.tut-step-h { margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--tx-1); }
.tut-prompt {
  margin: 0;
  padding: 18px 20px;
  background: var(--bg-sunken);
  border: 1px solid var(--bdr-faint);
  border-radius: 10px;
  font: 13px/1.6 var(--font-mono);
  color: var(--tx-1);
  white-space: pre;
  overflow-x: auto;
}
.tut-prompt code { font: inherit; color: inherit; background: transparent; padding: 0; }

.tut-tip {
  margin: 48px 0 0;
  padding: 22px 24px;
  background: var(--bg-sunken);
  border: 1px solid var(--bdr-faint);
  border-radius: 12px;
}
.tut-tip ul { margin: 8px 0 0; padding-left: 20px; }
.tut-tip li { margin: 6px 0; line-height: 1.55; }

/* ── Docs · Start (Bereiche-Cards) ───────────────────────── */
.doc-bereiche {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 28px;
}
.doc-bereich { padding: 4px 0; }
.doc-bereich-h {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600;
  margin: 0 0 4px; color: var(--tx-1);
}
.doc-bereich-ico {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--bdr-def);
  border-radius: var(--rad-sm);
  background: var(--bg-base);
  color: var(--tx-1);
  flex-shrink: 0;
}
.doc-bereich-ico svg { width: 16px; height: 16px; }
.doc-bereich p { margin: 0; color: var(--tx-1); line-height: 1.55; }

.tbl-emoji { display: inline-block; margin-right: 6px; }
.tbl-arch td.num, .tbl-arch th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-arch th.num { text-transform: uppercase; letter-spacing: 0.06em; }

.code-mermaid {
  background: var(--bg-sunken);
  border: 1px solid var(--bdr-faint);
  border-radius: 10px;
  padding: 18px 20px;
  font: 12.5px/1.5 var(--font-mono);
  color: var(--tx-1);
  white-space: pre;
  overflow-x: auto;
  margin: 16px 0 28px;
}
.page-meta-line { color: var(--tx-2); margin-top: -8px; margin-bottom: 24px; }




/* ── Emoji → SVG icon replacement (replaces page-ico class) ─── */
/* Used by replace_emoji_with_icons() in build_react_site.py     */
.page-ico {
  display: inline-block;
  width: 15px; height: 15px;
  vertical-align: -0.2em;
  color: var(--tx-2);
  flex-shrink: 0;
  margin-right: 2px;
}
.page h3 .page-ico { width: 17px; height: 17px; vertical-align: -0.18em; color: var(--ac-1); }

/* ── Content alignment: non-TOC pages align same as TOC pages ── */
.body:not(.with-toc) .page {
  margin-right: 240px; /* Reserve TOC column width so content stays aligned */
}

/* ── Admin panel: page typography ─────────────────────────────── */
.page-h1    { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 0; color: var(--tx-0); }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; color: var(--tx-0); }
.page-sub   { font-size: 13px; color: var(--tx-1); margin-bottom: 24px; }

/* ── Admin panel: action buttons ──────────────────────────────── */
.btn-outline {
  padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  border: 1px solid var(--bdr-def); background: transparent; color: var(--tx-0);
  transition: background .15s;
}
.btn-outline:hover { background: var(--bg-el); }
.btn-dark {
  padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  border: none; background: var(--tx-0); color: var(--bg-base);
  transition: opacity .15s;
}
.btn-dark:hover { opacity: 0.85; }

/* ── page-ico overrides inside hb-feat and tbl-ico containers ── */
/* The parent CSS (.hb-feat-ico svg, .tbl-ico svg) controls size; */
/* color must use parent so currentColor works correctly.          */
.hb-feat-ico .page-ico { color: inherit; width: auto; height: auto; display: block; vertical-align: 0; margin: 0; flex-shrink: initial; }
.tbl-ico .page-ico { color: inherit; width: auto; height: auto; vertical-align: 0; margin: 0; }

/* ── page-ico overrides inside tutorial containers ─────────────── */
.tut-rail-icon .page-ico { color: inherit; width: auto; height: auto; display: block; vertical-align: 0; margin: 0; flex-shrink: initial; }
.tut-tip-ico .page-ico { color: inherit; width: auto; height: auto; display: block; vertical-align: 0; margin: 0; }
