
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/inter-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: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("/fonts/inter-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;
}
@font-face {
  font-family: "Outfit Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/outfit-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/outfit-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: "Outfit Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/outfit-latin-ext-wght-normal.woff2") format("woff2-variations"), url("/fonts/outfit-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;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgb(255 255 255 / 0.03);
  --surface-2: rgb(255 255 255 / 0.055);
  --hover: rgb(255 255 255 / 0.09);
  --border: rgb(255 255 255 / 0.07);
  --border-strong: rgb(255 255 255 / 0.14);
  --text: #ffffff;
  --muted: rgb(255 255 255 / 0.68);
  --primary: #ffffff;
  --primary-text: #000000;
  --primary-hover: #e6e6e6;
  --focus: #ffffff;
  --danger: #ff8a80;
  --danger-soft: rgba(218, 41, 28, 0.16);
  --success: #6ee7a0;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #fcd34d;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --info: #93c5fd;
  --info-soft: rgba(59, 130, 246, 0.16);
  --shadow: none;
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --logo-dark: none;
  --logo-light: block;
  --glass-card-bg: rgb(255 255 255 / 0.03);
  --glass-card-shadow: 0 0 0 1px rgb(255 255 255 / 0.07), inset 0 1px 0 rgb(255 255 255 / 0.06);
  --glass-card-radius: 12px;
  --glass-tile-bg: rgb(255 255 255 / 0.055);
  --glass-tile-hover: rgb(255 255 255 / 0.09);
  --glass-tile-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05);
  --glass-tile-radius: 10px;
  --glass-row-hover: rgb(255 255 255 / 0.03);
  --glass-bar-line: rgb(255 255 255 / 0.07);
  --menu-bg: #1d1d1d;
  --menu-shadow: 0 10px 28px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.1);
  --font: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Outfit Variable", var(--font);
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --touch: 44px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --tabbar-h: 60px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --hover: #f0f0f0;
  --border: #e6e6e6;
  --border-strong: #cfcfcf;
  --text: #111111;
  --muted: #595959;
  --primary: #111111;
  --primary-text: #ffffff;
  --primary-hover: #2e2e2e;
  --focus: #111111;
  --danger: #b4231a;
  --danger-soft: #fdeceb;
  --success: #12703f;
  --success-soft: #e9f7ef;
  --warning: #8a5300;
  --warning-soft: #fdf4e3;
  --info: #1d4ed8;
  --info-soft: #eaf1fd;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.05);
  --shadow-lg: 0 16px 40px rgba(17, 17, 17, 0.14);
  --logo-dark: block;
  --logo-light: none;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
  color-scheme: light;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --hover: #f0f0f0;
  --border: #e6e6e6;
  --border-strong: #cfcfcf;
  --text: #111111;
  --muted: #595959;
  --primary: #111111;
  --primary-text: #ffffff;
  --primary-hover: #2e2e2e;
  --focus: #111111;
  --danger: #b4231a;
  --danger-soft: #fdeceb;
  --success: #12703f;
  --success-soft: #e9f7ef;
  --warning: #8a5300;
  --warning-soft: #fdf4e3;
  --info: #1d4ed8;
  --info-soft: #eaf1fd;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.05);
  --shadow-lg: 0 16px 40px rgba(17, 17, 17, 0.14);
  --logo-dark: block;
  --logo-light: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg.icon { width: 18px; height: 18px; flex: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 1.625rem; line-height: 1.2; }
h2 { font-size: 1.0625rem; line-height: 1.35; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.status-error { color: var(--danger); font-weight: 600; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 60;
  background: var(--primary); color: var(--primary-text); padding: 12px 16px; min-height: var(--touch);
  border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* --- Logo: je Darstellung die passende Datei (Rot nur im Punkt) ---------------- */
.brand { display: inline-flex; align-items: center; min-height: var(--touch); text-decoration: none; }
.brand img { height: 22px; width: auto; }
.brand .logo-on-dark { display: var(--logo-light); }
.brand .logo-on-light { display: var(--logo-dark); }
.area-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-left: 10px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Gerüst --------------------------------------------------------------------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 12px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-context { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar-context strong {
  font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-context span { color: var(--muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand { flex: none; }
.topbar .topbar-context { display: none; }

main { padding: 20px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
.content { max-width: 1120px; margin: 0 auto; }
.content.narrow { max-width: 760px; }

/* Benutzermenü ohne JavaScript */
.user-menu { position: relative; margin-left: auto; }
.user-menu summary {
  display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 6px;
  border-radius: var(--radius); cursor: pointer; list-style: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--hover); }
.user-menu[open] summary { background: var(--hover); }
/* Unter 768 px nur für Screenreader: der zugängliche Name beginnt mit dem sichtbaren Namen (WCAG 2.5.3). */
.user-name {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; font-weight: 500;
}
.user-menu summary svg.icon { width: 16px; height: 16px; color: var(--muted); }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: var(--primary-text);
  font-family: var(--font-display); font-weight: 600; font-size: 0.875rem;
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 260px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.menu-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head strong { font-weight: 600; }
.menu-head span { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--touch); padding: 0 12px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--text);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item svg.icon { color: var(--muted); }
.menu-form { margin: 0; }

/* Navigation (Seitenleiste und Tab-Leiste) */
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px;
  border-radius: var(--radius); color: var(--muted); font-weight: 500; text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--primary-text); background: var(--primary); }
.nav-label {
  margin: 20px 12px 8px; color: var(--muted); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tabbar .nav { flex-direction: row; gap: 0; padding: 0 4px; }
.tabbar li { flex: 1; min-width: 0; }
.tabbar .nav a {
  flex-direction: column; justify-content: center; gap: 3px; height: var(--tabbar-h); padding: 0 4px;
  border-radius: 0; background: none; color: var(--muted); font-size: 0.6875rem; text-align: center;
}
.tabbar .nav a:hover { background: none; color: var(--text); }
.tabbar .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .nav a[aria-current="page"] { color: var(--text); background: none; }
.tabbar .nav a[aria-current="page"] svg.icon {
  color: var(--primary-text); background: var(--primary); border-radius: 999px;
  width: 44px; height: 26px; padding: 3px 11px;
}
.tabbar svg.icon { width: 22px; height: 22px; }

/* --- Seitenkopf ----------------------------------------------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-header .subtitle { color: var(--muted); margin: 4px 0 0; }
.page-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.breadcrumb a { display: inline-flex; align-items: center; min-height: var(--touch); color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: 4px; color: var(--border-strong); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* --- Karten ----------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.card + .card, .card + .grid, .grid + .card, .stats + .card, .stats + .grid { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 1rem; }
.card-head a { color: var(--muted); font-size: 0.8125rem; font-weight: 500; display: inline-flex; align-items: center; min-height: var(--touch); }
.card-head a:hover { color: var(--text); }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }

/* Kennzahlen mit farbiger Oberkante */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  position: relative; overflow: hidden; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone, var(--border-strong)); }
.stat.success { --tone: var(--success); }
.stat.warning { --tone: var(--warning); }
.stat.info { --tone: var(--info); }
.stat-label { display: block; color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.stat-value { display: block; margin-top: 6px; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--border-strong); }

/* --- Tabellen (mobil als Karten) -------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 10px 16px; text-align: left; color: var(--muted); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.02em; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table a.cell-link { display: inline-flex; flex-direction: column; min-height: var(--touch); justify-content: center; text-decoration: none; }
.table a.cell-link:hover strong { text-decoration: underline; }
.cell-title { font-weight: 600; }
.cell-meta { color: var(--muted); font-size: 0.8125rem; }
.nowrap { white-space: nowrap; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: flex; justify-content: space-between; gap: 16px; padding: 6px 16px; border: 0; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; }
  .table td.cell-primary { display: block; }
}

/* Filter, Suche, Seiten */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap; text-decoration: none;
}
.tabs a:hover { color: var(--text); background: var(--hover); }
.tabs a[aria-current="page"] { color: var(--primary-text); background: var(--primary); }
.count { font-size: 0.75rem; opacity: 0.75; }
.search { display: flex; gap: 8px; flex: 1 1 260px; margin: 0; }
.search-field { position: relative; flex: 1; }
.search-field svg.icon { position: absolute; left: 12px; top: 50%; margin-top: -9px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px !important; }
.lead-search { margin: 0 0 12px; }
.lead-search-info { margin: 0 0 12px; }
/* Anfragen-Statistik (ADR 0072): Balken als <progress>, Zahlen daneben als Text */
.stats-filter-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.stats-filter-body .field { flex: 1 1 200px; margin: 0; }
.stats-filter-body .button { min-height: var(--touch); }
.stats-note { margin: 8px 0 0; font-size: 0.8125rem; }
.meter-list + h3 { margin-top: 24px; }
.meter-list { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.meter-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.meter-label { overflow-wrap: anywhere; }
.meter-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-note { grid-column: 1 / -1; color: var(--warning); font-size: 0.8125rem; }
progress.bar { grid-column: 1 / -1; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--border); appearance: none; }
progress.bar::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8125rem; }
.pager-links { display: flex; gap: 8px; }

/* Unternavigation einer Detailseite */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.detail > * { min-width: 0; }
.subnav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.subnav a {
  display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 12px;
  color: var(--muted); font-weight: 500; white-space: nowrap; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* Wiederholbare Zeilen im Abschnittsformular */
fieldset.repeat, fieldset.field-group { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
fieldset.repeat > legend, fieldset.field-group > legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.repeat-row { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: var(--surface); }
.repeat-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.repeat-actions { display: flex; gap: 6px; }
.repeat-actions .button { min-width: var(--touch); min-height: var(--touch); padding: 0; justify-content: center; }
.repeat-actions .button:disabled { opacity: 0.4; }

.color-input { display: block; width: 100%; max-width: 12rem; height: var(--touch); padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.color-hex { display: inline-block; margin-top: 4px; color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* Rücklink über einem Formular */
.auth-link { margin: 8px 0 0; }
.auth-link a { display: inline-flex; align-items: center; min-height: var(--touch); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch); color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--text); text-decoration: underline; }
.back-link svg.icon { width: 16px; height: 16px; }

/* Abschnittsliste einer Seite */
.section-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; min-height: 64px; }
.section-item + .section-item { border-top: 1px solid var(--border); }
.section-item-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; }
.section-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.section-item-actions .button { min-height: var(--touch); }
.section-item-actions form { display: contents; }

/* Angaben als Raster */
.info-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.info-grid div { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.info-grid div:last-child { border-bottom: 0; }
.info-grid dt { color: var(--muted); font-size: 0.8125rem; }
.info-grid dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* Einrichtungs-Assistent (ADR 0054): Schrittanzeige; mobil nur "Schritt n von m" */
.wizard-steps { margin: 0 0 16px; }
.wizard-count { margin: 0; color: var(--muted); }
.wizard-count strong { color: var(--text); }
.wizard-steps ol { display: none; list-style: none; margin: 8px 0 0; padding: 0; gap: 4px 16px; flex-wrap: wrap; }
.wizard-steps li { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); }
.wizard-steps li a { color: inherit; min-height: 44px; display: inline-flex; align-items: center; }
.wizard-steps li.done { color: var(--text); }
.wizard-steps li.current { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }
.wizard-steps svg.icon { width: 16px; height: 16px; }
@media (min-width: 768px) { .wizard-steps ol { display: flex; } }
.plain-list { margin: 0 0 12px; padding-left: 20px; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; color: inherit; text-decoration: none; }
a.list-row:hover { background: var(--hover); }
.list li:first-child .list-row { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.list li:last-child .list-row { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.list-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { color: var(--muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-chevron { color: var(--muted); }
.monogram {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--success); background: var(--success-soft); border-color: transparent; }
.badge.draft { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.badge.maintenance { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
/* Status einer Anfrage */
.badge.lead-new { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.lead-contacted, .badge.lead-visit, .badge.lead-quoted { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.badge.lead-won { color: var(--success); background: var(--success-soft); border-color: transparent; }

/* Anfragen: Filter-Reiter (mobil wischbar), Kontaktknöpfe, Verlauf */
.filter-tabs { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0 0 4px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs a {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); padding: 0 14px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.875rem;
}
.filter-tabs a:hover { color: var(--text); border-color: var(--border-strong); }
.filter-tabs a[aria-current="page"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.filter-count { font-variant-numeric: tabular-nums; opacity: 0.75; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.contact-actions .button { justify-content: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; }
.stack { display: grid; gap: 16px; align-content: start; }
.photo-grid { list-style: none; margin: 0; padding: 16px; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-grid a { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-grid a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stack > .card + .card { margin-top: 0; }
/* Anfrage mobil: Wichtiges zuerst (Kontakt, Status), Spalten erst ab Tablet */
.lead-layout > .stack { display: contents; }
.lead-layout .card { margin-top: 0; }
.lead-contact { order: 1; } .lead-status { order: 2; } .lead-photos, .lead-section { order: 3; }
.lead-notes { order: 4; } .lead-history { order: 5; } .lead-more { order: 6; } .lead-erase { order: 7; }

/* Medienbibliothek (ADR 0049) */
[hidden] { display: none !important; }
.media-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.media-toolbar p { margin: 0; }
.media-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 8px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none;
}
.media-card:hover { border-color: var(--muted); }
.media-card-name { font-weight: 600; overflow-wrap: anywhere; }
.media-card .badge { align-self: flex-start; }
.media-thumb {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 8px;
  background: var(--surface-2);
}
.section-item > .media-thumb { width: 64px; flex: 0 0 64px; }
.media-preview { margin: 0; }
.media-preview .media-thumb { aspect-ratio: auto; max-height: 360px; }
.media-detail { display: grid; gap: 16px; }
.image-field-links { display: flex; flex-wrap: wrap; gap: 8px; }
.media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.media-actions p { flex-basis: 100%; margin: 0; }
.media-actions form { display: contents; }
.crop-canvas {
  display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; border-radius: 8px;
  background: var(--surface-2); user-select: none; -webkit-user-select: none;
}
.crop-canvas:focus-visible { outline: 3px solid var(--focus, #1d4ed8); outline-offset: 2px; }
.crop-tools { display: grid; gap: 12px; margin-top: 12px; }
.crop-zoom { width: 100%; min-height: var(--touch); }
.crop-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-field-thumb { display: block; width: 160px; height: auto; max-height: 120px; object-fit: contain; border-radius: 8px; background: var(--surface-2); margin: 0 0 8px; }

/* Leerzustände */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.empty p { color: var(--muted); max-width: 420px; margin: 0; }
.empty h1, .empty h2 { font-size: 1.125rem; }
.empty-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-bottom: 4px;
}
.empty .actions { justify-content: center; margin-top: 8px; }

/* Schnellzugriff */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick a {
  display: flex; flex-direction: column; gap: 10px; min-height: 96px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-decoration: none; font-weight: 500;
}
.quick a:hover { border-color: var(--border-strong); background: var(--hover); }
.quick svg.icon { width: 22px; height: 22px; color: var(--muted); }

/* --- Formulare -------------------------------------------------------------------- */
.section { border: 0; margin: 0; padding: 16px; min-width: 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 16px; }
.section-head legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.section-head p { clear: both; margin: 0; padding-top: 4px; color: var(--muted); font-size: 0.8125rem; }
.section-head::after { content: ""; display: block; clear: both; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { display: block; font-weight: 500; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 0.8125rem; margin: 6px 0 0; }
.field .error { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: 0.8125rem; font-weight: 500; margin: 6px 0 0; }
.field .error svg.icon { width: 16px; height: 16px; }
.optional { font-weight: 400; color: var(--muted); }
.code { display: block; width: 100%; margin: 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font: 0.8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; resize: none; }
.section-title { margin: 24px 0 12px; }
.form-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; }
.form-item-head + .muted { margin: 0; }
.form-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.form-item-head h3 { margin: 0; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Formular-Editor (ADR 0020) */
form.op { display: inline-flex; margin: 0; }
.icon-button { width: var(--touch); padding: 0; }
.editor-head { align-items: flex-start; }
.editor-head h3 { font-size: 1rem; margin: 2px 0 0; }
.editor-head .muted { font-size: 0.8125rem; margin: 0; }
.editor-tools { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex: none; }
.editor-fields { list-style: none; margin: 0; padding: 0; }
.editor-field { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.editor-field .list-title { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; white-space: normal; }
.editor-field .list-title:hover { text-decoration-color: currentColor; }
/* Regeln einer Bedingung: lange Texte umbrechen statt die Karte zu verbreitern (ADR 0028) */
.cond-list { min-width: 0; }
.cond-list .list-row { padding-inline: 12px; }
.cond-list .list-title { font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
/* Änderungen des Entwurfs (ADR 0029) */
.change-list { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; }
.change-list summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.change-list summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.change-list ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.editor-field .list-meta { white-space: normal; }
.editor-add { display: grid; gap: 8px; padding: 12px 16px; }
.card-body .editor-add { padding: 0; }
/* Sprachwahl als Reiter (Links, ohne JS). */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.lang-tabs a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
/* Rechtstext-Vorschau. */
.legal-doc h3 { margin: 0 0 12px; font-size: 1.25rem; }
.legal-doc h4 { margin: 16px 0 4px; font-size: 1rem; }
.legal-doc p { margin: 0 0 8px; overflow-wrap: anywhere; }
/* PLZ schmal, Ort breit; auf sehr kleinen Bildschirmen untereinander. */
.field-row.zip-city { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 0 12px; }
@media (max-width: 340px) { .field-row.zip-city { grid-template-columns: minmax(0, 1fr); } }
.option-image { margin: 0; max-width: 28rem; }
/* Eigene Formular-Vorlagen (ADR 0075) */
.library-list { margin: 0; padding: 0; list-style: none; }
.library-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.library-list li:first-child { border-top: 0; padding-top: 0; }
.library-list form { margin: 0; }
/* Kartenbild aus der Medienbibliothek (ADR 0073) */
fieldset.library-picker { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.library-picker > legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.library-picker .hint { margin: 0 0 12px; }
.library-picker .error { margin: 0 0 12px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-height: 26rem; overflow-y: auto; margin: 0; padding: 4px; list-style: none; }
.library-item { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: var(--touch); padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.library-item:hover { border-color: var(--border-strong); }
.library-item input { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.library-item img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; background: var(--hover); }
.library-item:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.library-item:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.library-name { font-size: 0.8125rem; overflow-wrap: anywhere; }
.option-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
/* Bildausschnitt (ADR 0032), wie im Besucherformular. */
.option-image.focus-top img { object-position: center top; }
.option-image.focus-bottom img { object-position: center bottom; }
.option-image.focus-left img { object-position: left center; }
.option-image.focus-right img { object-position: right center; }
/* Logo: ganz zeigen, auf hellem Grund wie im Besucherformular (auch im dunklen Panel). */
.option-image.logo-image { max-width: 16rem; padding: 12px; border-radius: var(--radius-sm); background: #ffffff; }
.option-image.logo-image img { aspect-ratio: auto; max-height: 80px; width: auto; max-width: 100%; object-fit: contain; background: none; }
.editor-step { scroll-margin-top: 80px; }
.inline-actions form { margin: 0; }
/* Domains (ADR 0036): Name links, Aktionen umbrechend darunter/daneben. */
.domain-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.domain-row + .domain-row { border-top: 1px solid var(--border); }
.domain-row .list-main { min-width: 0; overflow-wrap: anywhere; }
.domain-row .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Zugang: Status mit Ablaufdatum vollständig zeigen (ADR 0056). */
.list-meta.wrap { white-space: normal; }
.list-title.wrap { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.readonly { min-height: var(--touch); display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); overflow-wrap: anywhere; }
input:not([type="radio"]):not([type="hidden"]), select {
  display: block; width: 100%; height: var(--touch); padding: 0 12px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  display: block; width: 100%; min-height: 96px; padding: 10px 12px; resize: vertical;
  font: inherit; font-size: 1rem; line-height: 1.5; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
textarea:hover { border-color: var(--muted); }
textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
textarea[aria-invalid="true"] { border-color: var(--danger); }
input::placeholder { color: var(--muted); opacity: 0.8; }
input:not([type="radio"]):hover, select:hover { border-color: var(--muted); }
input:not([type="radio"]):focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}
.input-status { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--success); font-size: 0.8125rem; font-weight: 500; }
.input-status svg.icon { width: 16px; height: 16px; }

.choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { padding: 0; }
.choice-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--muted); }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-title { font-weight: 600; }
.choice-meta { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
@supports selector(:has(*)) {
  .smtp-form:not(:has(input[name="preset"][value="custom"]:checked)) .custom-only { display: none; }
}
.custom-only { margin-top: 16px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border-strong); }

/* --- Schaltflächen ---------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px;
  font: inherit; font-weight: 600; color: var(--primary-text); background: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s;
}
.button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.button.secondary:hover { background: var(--hover); }
.button.danger { color: #ffffff; background: #b4231a; border-color: #b4231a; }
.button.small { min-height: 36px; padding: 0 12px; font-size: 0.8125rem; }
.button svg.icon { width: 16px; height: 16px; }
.button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.form-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.form-actions .button { flex: 1 1 auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- Meldungen -------------------------------------------------------------------- */
.notice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 16px;
  border-radius: var(--radius); font-weight: 500;
  color: var(--success); background: var(--success-soft);
}
.notice.info { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.notice.error { color: var(--danger); background: var(--danger-soft); }
.notice.warning { color: var(--text); background: var(--warning-soft); }
.notice.warning svg.icon { color: var(--warning); }
.error-summary { padding: 14px 16px; margin: 0 0 16px; border-radius: var(--radius); color: var(--danger); background: var(--danger-soft); }
.error-summary:focus { outline: 2px solid var(--danger); outline-offset: 2px; }
.error-summary h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 0.875rem; margin-bottom: 6px; }
.error-summary ul { margin: 0; padding-left: 26px; }
.error-summary a { color: inherit; font-weight: 500; }

/* --- Anmelden, Einrichtung -------------------------------------------------------- */
body.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
body.auth main { width: 100%; max-width: 400px; padding: 0; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand .brand img { height: 32px; }
.auth-card { padding: 28px 20px; }
.auth-card h1 { font-size: 1.375rem; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--muted); margin-bottom: 20px; }
.auth-card .button { width: 100%; margin-top: 8px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 0.8125rem; }

/* --- Breitere Bildschirme --------------------------------------------------------- */
/* Kästchen/Optionsfeld mit Beschriftung: ganze Zeile klickbar (≥ 44 px).
   Nach den allgemeinen input-Regeln, damit Breite/Höhe nicht übernommen werden. */
.field > label.check, label.check { display: flex; align-items: center; gap: 12px; min-height: var(--touch); margin: 0; cursor: pointer; font-weight: 500; }
label.check > input[type="checkbox"], label.check > input[type="radio"] { display: inline-block; width: 20px; height: 20px; margin: 0; padding: 0; flex: none; accent-color: var(--primary); }
.cond-rule fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.cond-rule legend { font-weight: 600; margin-bottom: 4px; }
@media (min-width: 720px) {
  .editor-add { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) auto; align-items: center; }
  .editor-add.two { grid-template-columns: minmax(0, 1fr) auto; }
  .lead-layout > .stack { display: grid; }
  main { padding: 28px 28px 48px; }
  .user-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .card-head, .card-body, .section, .toolbar, .pager { padding-left: 20px; padding-right: 20px; }
  .table th, .table td { padding-left: 20px; padding-right: 20px; }
  .section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding-top: 20px; padding-bottom: 20px; }
  .section-head { margin-bottom: 0; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .choice-grid.three { grid-template-columns: repeat(3, 1fr); }
  .form-actions { justify-content: flex-end; padding: 12px 20px; }
  .form-actions .button { flex: 0 0 auto; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .info-grid div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .info-grid.stacked { grid-template-columns: 1fr; }
  .info-grid.stacked div:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--border); }
  .auth-card { padding: 32px 28px; }
  h1 { font-size: 1.875rem; }
}
@media (min-width: 1024px) {
  .media-detail { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .media-detail .card + .card { margin-top: 0; }
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; padding: 12px;
    border-right: 1px solid var(--border); background: var(--bg);
  }
  .sidebar-head { display: flex; align-items: center; min-height: var(--topbar-h); padding: 0 8px; margin: -12px -4px 12px; }
  .sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
  .topbar { padding: 0 20px 0 28px; }
  .topbar .brand { display: none; }
  .topbar .topbar-context { display: flex; }
  .tabbar { display: none; }
  main { padding: 32px 40px 56px; }
  .detail { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .subnav { flex-direction: column; border-bottom: 0; position: sticky; top: calc(var(--topbar-h) + 16px); }
  .subnav a { border-bottom: 0; border-radius: var(--radius); margin: 0; }
  .subnav a:hover { background: var(--hover); }
  .subnav a[aria-current="page"] { color: var(--primary-text); background: var(--primary); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* --- Dunkel: schwarzer Grund, Glaskarten (Standard, "dark" und "system" bei dunklem Gerät) --- */
:root:not([data-theme]) .topbar { background: var(--bg); border-bottom: 0; box-shadow: 0 1px 0 var(--glass-bar-line); }
:root:not([data-theme]) .tabbar { background: var(--bg); border-top: 0; box-shadow: 0 -1px 0 var(--glass-bar-line); }
:root:not([data-theme]) .card, :root:not([data-theme]) .stat, :root:not([data-theme]) .notice.info { background: var(--glass-card-bg); border-color: transparent; border-radius: var(--glass-card-radius); box-shadow: var(--glass-card-shadow); }
:root:not([data-theme]) .form-actions { background: transparent; border-radius: 0 0 var(--glass-card-radius) var(--glass-card-radius); }
:root:not([data-theme]) .choice, :root:not([data-theme]) .quick a, :root:not([data-theme]) .monogram, :root:not([data-theme]) .empty-icon, :root:not([data-theme]) .readonly, :root:not([data-theme]) .button.secondary, :root:not([data-theme]) .badge:not(.live):not(.draft):not(.maintenance) { background: var(--glass-tile-bg); border-color: transparent; border-radius: var(--glass-tile-radius); box-shadow: var(--glass-tile-shadow); }
:root:not([data-theme]) .badge:not(.live):not(.draft):not(.maintenance) { border-radius: 999px; }
:root:not([data-theme]) .choice:hover, :root:not([data-theme]) .quick a:hover, :root:not([data-theme]) .button.secondary:hover { background: var(--glass-tile-hover); }
:root:not([data-theme]) .choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--focus); }
:root:not([data-theme]) .custom-only { background: var(--glass-tile-bg); }
:root:not([data-theme]) input:not([type="radio"]):not([type="hidden"]), :root:not([data-theme]) select { background: var(--glass-tile-bg); }
:root:not([data-theme]) .table tbody tr:hover { background: var(--glass-row-hover); }
:root:not([data-theme]) .menu-panel { background: var(--menu-bg); border-color: transparent; box-shadow: var(--menu-shadow); }
:root[data-theme="dark"] .topbar { background: var(--bg); border-bottom: 0; box-shadow: 0 1px 0 var(--glass-bar-line); }
:root[data-theme="dark"] .tabbar { background: var(--bg); border-top: 0; box-shadow: 0 -1px 0 var(--glass-bar-line); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .stat, :root[data-theme="dark"] .notice.info { background: var(--glass-card-bg); border-color: transparent; border-radius: var(--glass-card-radius); box-shadow: var(--glass-card-shadow); }
:root[data-theme="dark"] .form-actions { background: transparent; border-radius: 0 0 var(--glass-card-radius) var(--glass-card-radius); }
:root[data-theme="dark"] .choice, :root[data-theme="dark"] .quick a, :root[data-theme="dark"] .monogram, :root[data-theme="dark"] .empty-icon, :root[data-theme="dark"] .readonly, :root[data-theme="dark"] .button.secondary, :root[data-theme="dark"] .badge:not(.live):not(.draft):not(.maintenance) { background: var(--glass-tile-bg); border-color: transparent; border-radius: var(--glass-tile-radius); box-shadow: var(--glass-tile-shadow); }
:root[data-theme="dark"] .badge:not(.live):not(.draft):not(.maintenance) { border-radius: 999px; }
:root[data-theme="dark"] .choice:hover, :root[data-theme="dark"] .quick a:hover, :root[data-theme="dark"] .button.secondary:hover { background: var(--glass-tile-hover); }
:root[data-theme="dark"] .choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--focus); }
:root[data-theme="dark"] .custom-only { background: var(--glass-tile-bg); }
:root[data-theme="dark"] input:not([type="radio"]):not([type="hidden"]), :root[data-theme="dark"] select { background: var(--glass-tile-bg); }
:root[data-theme="dark"] .table tbody tr:hover { background: var(--glass-row-hover); }
:root[data-theme="dark"] .menu-panel { background: var(--menu-bg); border-color: transparent; box-shadow: var(--menu-shadow); }
@media (prefers-color-scheme: dark) {
:root[data-theme="system"] .topbar { background: var(--bg); border-bottom: 0; box-shadow: 0 1px 0 var(--glass-bar-line); }
:root[data-theme="system"] .tabbar { background: var(--bg); border-top: 0; box-shadow: 0 -1px 0 var(--glass-bar-line); }
:root[data-theme="system"] .card, :root[data-theme="system"] .stat, :root[data-theme="system"] .notice.info { background: var(--glass-card-bg); border-color: transparent; border-radius: var(--glass-card-radius); box-shadow: var(--glass-card-shadow); }
:root[data-theme="system"] .form-actions { background: transparent; border-radius: 0 0 var(--glass-card-radius) var(--glass-card-radius); }
:root[data-theme="system"] .choice, :root[data-theme="system"] .quick a, :root[data-theme="system"] .monogram, :root[data-theme="system"] .empty-icon, :root[data-theme="system"] .readonly, :root[data-theme="system"] .button.secondary, :root[data-theme="system"] .badge:not(.live):not(.draft):not(.maintenance) { background: var(--glass-tile-bg); border-color: transparent; border-radius: var(--glass-tile-radius); box-shadow: var(--glass-tile-shadow); }
:root[data-theme="system"] .badge:not(.live):not(.draft):not(.maintenance) { border-radius: 999px; }
:root[data-theme="system"] .choice:hover, :root[data-theme="system"] .quick a:hover, :root[data-theme="system"] .button.secondary:hover { background: var(--glass-tile-hover); }
:root[data-theme="system"] .choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--focus); }
:root[data-theme="system"] .custom-only { background: var(--glass-tile-bg); }
:root[data-theme="system"] input:not([type="radio"]):not([type="hidden"]), :root[data-theme="system"] select { background: var(--glass-tile-bg); }
:root[data-theme="system"] .table tbody tr:hover { background: var(--glass-row-hover); }
:root[data-theme="system"] .menu-panel { background: var(--menu-bg); border-color: transparent; box-shadow: var(--menu-shadow); }
}
