
@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: 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;
  --accent: #da291c;
  --nav-active: #e9e9e9;
  --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;
  --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="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1b1b1b;
  --surface-2: #232323;
  --hover: #2c2c2c;
  --border: #2e2e2e;
  --border-strong: #3a3a3a;
  --text: #ededed;
  --muted: #a3a3a3;
  --primary: #ededed;
  --primary-text: #121212;
  --primary-hover: #d4d4d4;
  --focus: #ededed;
  --accent: #da291c;
  --nav-active: #2c2c2c;
  --danger: #ff8a80;
  --danger-soft: #321614;
  --success: #6ee7a0;
  --success-soft: #142b1d;
  --warning: #fcd34d;
  --warning-soft: #322611;
  --info: #93c5fd;
  --info-soft: #192436;
  --shadow: none;
  --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.5);
  --logo-dark: none;
  --logo-light: block;
  --glass-card-bg: #1b1b1b;
  --glass-card-shadow: 0 0 0 1px #2e2e2e;
  --glass-card-radius: 12px;
  --glass-tile-bg: #232323;
  --glass-tile-hover: #2c2c2c;
  --glass-tile-shadow: inset 0 0 0 1px #2e2e2e;
  --glass-tile-radius: 10px;
  --glass-row-hover: #1f1f1f;
  --glass-bar-line: #2e2e2e;
  --menu-bg: #1f1f1f;
  --menu-shadow: 0 10px 28px rgb(0 0 0 / 0.5), 0 0 0 1px #3a3a3a;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1b1b1b;
  --surface-2: #232323;
  --hover: #2c2c2c;
  --border: #2e2e2e;
  --border-strong: #3a3a3a;
  --text: #ededed;
  --muted: #a3a3a3;
  --primary: #ededed;
  --primary-text: #121212;
  --primary-hover: #d4d4d4;
  --focus: #ededed;
  --accent: #da291c;
  --nav-active: #2c2c2c;
  --danger: #ff8a80;
  --danger-soft: #321614;
  --success: #6ee7a0;
  --success-soft: #142b1d;
  --warning: #fcd34d;
  --warning-soft: #322611;
  --info: #93c5fd;
  --info-soft: #192436;
  --shadow: none;
  --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.5);
  --logo-dark: none;
  --logo-light: block;
  --glass-card-bg: #1b1b1b;
  --glass-card-shadow: 0 0 0 1px #2e2e2e;
  --glass-card-radius: 12px;
  --glass-tile-bg: #232323;
  --glass-tile-hover: #2c2c2c;
  --glass-tile-shadow: inset 0 0 0 1px #2e2e2e;
  --glass-tile-radius: 10px;
  --glass-row-hover: #1f1f1f;
  --glass-bar-line: #2e2e2e;
  --menu-bg: #1f1f1f;
  --menu-shadow: 0 10px 28px rgb(0 0 0 / 0.5), 0 0 0 1px #3a3a3a;
  }
}

*, *::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); }
/* Superadmin (admin.ordx.ch): roter Streifen oben und Etikett, in beiden Darstellungen. */
body.area-admin::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
  background: var(--accent); pointer-events: none;
}
.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; flex-shrink: 0;
  color: var(--text); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Superadmin auf einer Kunden-Website (app.ordx.ch): dünner roter Streifen mit Hinweis (§11.3) */
.superadmin-stripe {
  margin: 0; padding: 4px 16px; background: var(--accent); color: #ffffff;
  font-size: 0.75rem; font-weight: 600; text-align: center;
}
/* Rolle neben dem Namen (Kopfzeile) */
.role-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted); font-size: 0.75rem; font-weight: 500; white-space: nowrap;
  max-width: 11rem; overflow: hidden; text-overflow: ellipsis;
}
/* "Änderung bei Creatus anfragen" */
.request-change { margin: 16px 0 0; font-size: 0.875rem; }
.request-change a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); color: var(--text); font-weight: 500; }
.request-change svg.icon { width: 16px; height: 16px; }
/* Reiter eines Bereichs (z. B. Website: Seiten, Menüs, Medien) */
.area-tabs {
  list-style: none; margin: 0 0 20px; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.area-tabs li { flex: none; }
.area-tabs a {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 12px; margin-bottom: -1px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.875rem; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.area-tabs a:hover { color: var(--text); }
.area-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* --- 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); }
/* Aktiv: nur neutraler Grund, kräftiger Text, Symbol in voller Farbe (ADR 0080, Nachtrag). */
.nav a[aria-current="page"] { color: var(--text); background: var(--nav-active); font-weight: 600; }
.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; }
/* Tab-Leiste: dunkles Symbol auf neutraler Pille, kräftige Beschriftung, keine Farblinie. */
.tabbar .nav a[aria-current="page"] { color: var(--text); background: none; font-weight: 600; }
.tabbar .nav a[aria-current="page"] svg.icon {
  color: var(--text); background: var(--nav-active); border-radius: 999px;
  width: 44px; height: 26px; padding: 3px 11px;
}
.tabbar svg.icon { width: 22px; height: 22px; }
/* Abzeichen: offene Anfragen (Reservationen, Termine) */
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: var(--primary-text); font-size: 0.75rem; font-weight: 700;
  line-height: 20px; text-align: center;
}
.tabbar .nav a { position: relative; }
.tabbar .nav a .nav-badge {
  position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; max-width: none;
  min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.6875rem; line-height: 18px;
}
.area-tabs .nav-badge { display: inline-block; margin-left: 6px; vertical-align: 1px; }

/* --- 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: ohne Farbe; nur Dringendes erhält einen kleinen Statuspunkt neben der Zahl. */
.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.warning .stat-value::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%;
  vertical-align: middle; background: var(--warning);
}
.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 td.cell-actions { text-align: right; width: 1%; }
.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; }
  .table td.cell-actions { justify-content: flex-end; }
}

/* 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); }
/* Gruppierte Unternavigation (ADR 0101 B7) */
.subnav-groups { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.subnav-groups .subnav { border-bottom: 0; overflow: visible; }
.subnav-group + .subnav-group { border-left: 1px solid var(--border); margin-left: 4px; padding-left: 4px; }
.subnav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* 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; }
/* Panel-Suche (ADR 0101 B7) */
.topbar-search { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); min-width: var(--touch); justify-content: center; padding: 0 12px; margin-left: auto; margin-right: 8px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.topbar-search:hover { background: var(--hover); color: var(--text); }
.topbar-search kbd { display: none; }
.topbar-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar-search kbd { font: inherit; font-size: 0.75rem; padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (min-width: 768px) {
  .topbar-search kbd { display: inline; }
  .topbar-search-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
.cmdk { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 64px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); }
.cmdk::backdrop { background: rgba(0, 0, 0, 0.45); }
.cmdk form { display: flex; flex-direction: column; max-height: inherit; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk .cmdk-input input, .cmdk .cmdk-input input:focus, .cmdk .cmdk-input input:focus-visible { flex: 1; min-height: 56px; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 1rem; outline: none; box-shadow: none; }
.cmdk-input:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.cmdk-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cmdk-results [role="option"] { display: flex; flex-direction: column; min-height: var(--touch); justify-content: center; padding: 6px 12px; border-radius: var(--radius); cursor: pointer; }
.cmdk-results [aria-selected="true"] { background: var(--primary); color: var(--primary-text); }
.cmdk-results [aria-selected="true"] .cmdk-meta { color: inherit; }
.cmdk-title { font-weight: 600; }
.cmdk-meta { color: var(--muted); font-size: 0.8125rem; }
.cmdk-status { margin: 0; padding: 8px 16px; color: var(--muted); font-size: 0.8125rem; }
.cmdk-status:empty { display: none; }
.cmdk-hint { margin: 0; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.75rem; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-row input { flex: 1 1 240px; }
.search-form { margin-bottom: 16px; }
/* Heute (ADR 0101 B6): grosse Kurzbefehle und "Jetzt zu tun" */
.shortcuts ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .shortcuts ul { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.shortcut { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 88px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: inherit; text-decoration: none; font-weight: 600; }
.shortcut:hover { background: var(--hover); }
.shortcut svg.icon { width: 24px; height: 24px; color: var(--primary); }
.todo { margin-bottom: 16px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li + li { border-top: 1px solid var(--border); }
.task { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; color: inherit; text-decoration: none; }
.task:hover { background: var(--hover); }
.task-list li:last-child .task { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.task-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--hover); color: var(--primary); }
.task.is-warning .task-icon { color: var(--warning); }
.task .list-meta { white-space: normal; }
.hours-day { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.hours-day legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.hours-range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.hours-range .field { flex: 1 1 120px; margin: 0 0 8px; }
.hours-dash { padding-bottom: 18px; color: var(--muted); }
.hours-input label { font-size: 0.8125rem; color: var(--muted); }
.hours-day .check { min-height: 44px; display: flex; align-items: center; gap: 8px; }
/* Öffnungszeiten (ADR 0101 B4): Schalter je Tag, Zeiten nur wenn geöffnet, Vorschau */
.hours-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.hours-week { display: grid; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); margin: 0; }
.hours-week legend { float: left; width: 100%; margin: 0; }
.hours-week:has(.switch input:not(:checked)) .hours-times { display: none; }
.hours-times { display: grid; gap: 4px; }
.hours-pause > summary {
  display: inline-flex; align-items: center; min-height: var(--touch); cursor: pointer; list-style: none;
  color: var(--text); text-decoration: underline; text-underline-offset: 3px;
}
.hours-pause > summary::-webkit-details-marker { display: none; }
.hours-pause[open] > summary { display: none; }
/* Telefon zuerst (Plan §27): Von/Bis nur für Screenreader, Zeilen nur wenn genutzt */
.hours-compact .hours-input > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hours-compact { flex-wrap: nowrap; align-items: center; }
.hours-compact .field { flex: 1 1 0; min-width: 0; }
.hours-compact input { width: 100%; min-width: 0; }
.hours-compact .hours-dash { padding-bottom: 8px; }
.hours-special:has(input[name$=".closed"]:checked) .hours-times { display: none; }
.hours-add { margin: 0 0 8px; }
.hours-add > summary {
  display: inline-flex; align-items: center; min-height: var(--touch); cursor: pointer; list-style: none;
  color: var(--text); text-decoration: underline; text-underline-offset: 3px;
}
.hours-add > summary::-webkit-details-marker { display: none; }
.hours-add[open]:not(.hours-holidays) > summary { display: none; }
.hours-holidays > summary { text-decoration: none; font-weight: 600; }
.hours-holidays > summary::after { content: " ▾"; color: var(--muted); }
.hours-holidays[open] > summary::after { content: " ▴"; }
/* Speichern bleibt auf dem Telefon sichtbar (über der Tab-Leiste) */
.hours-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 4;
  background: var(--surface); border-top: 1px solid var(--border); margin: 0; padding: 12px 16px;
}
@media (min-width: 1024px) { .hours-actions { bottom: 0; } }
.hours-copy.button {
  justify-self: start; min-height: var(--touch); padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--muted); font-weight: 400; text-decoration: underline; text-underline-offset: 3px;
}
.hours-copy.button:hover { color: var(--text); background: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.switch-track {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px;
  background: var(--border-strong); transition: background 0.15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow); transition: transform 0.15s;
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:checked ~ .switch-off, .switch input:not(:checked) ~ .switch-on { display: none; }
/* Zusammenfassung je Zeile; "Bearbeiten" klappt die Felder auf (Telefon: ~1/3 der Höhe) */
.hours-row { border-bottom: 1px solid var(--border); }
.hours-row > summary {
  display: grid; grid-template-columns: minmax(5.5em, auto) minmax(0, 1fr) var(--touch); align-items: center;
  gap: 0 12px; min-height: var(--touch); padding: 0; cursor: pointer; list-style: none;
}
.hours-row > summary::-webkit-details-marker { display: none; }
.hours-row > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hours-row-label { font-weight: 600; }
.hours-row-short { display: none; text-decoration: none; }
@media (max-width: 479px) {
  .hours-row:not(.is-stacked) > summary { grid-template-columns: 3em minmax(0, 1fr) var(--touch); }
  .hours-row-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hours-row-short { display: inline; }
}
.hours-row.is-stacked > summary { grid-template-columns: minmax(0, 1fr) var(--touch); padding: 4px 0; }
.hours-row.is-stacked .hours-row-label { grid-column: 1; }
.hours-row.is-stacked .hours-row-text { grid-column: 1; grid-row: 2; color: var(--muted); }
.hours-row.is-stacked .hours-row-edit { grid-column: 2; grid-row: 1 / span 2; }
.hours-row-text { font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.hours-row-text.is-closed { color: var(--muted); }
.hours-row-edit { display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); color: var(--muted); }
.hours-row > summary:hover .hours-row-edit { color: var(--text); }
.hours-row[open] .hours-row-text, .hours-row[open] .hours-row-edit { display: none; }
.hours-row > .hours-day { padding-top: 0; }
.hours-row > .hours-day > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hours-row > .hours-week { border-bottom: 0; }
/* Die Vorschau wiederholt auf dem Telefon nur die Zusammenfassung */
@media (max-width: 1023px) { .hours-preview { display: none; } }
.hours-preview h2 { font-size: 1rem; margin: 0 0 12px; }
.hours-preview-list { margin: 0 0 12px; }
.hours-preview-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.hours-preview-list dt { font-weight: 600; }
.hours-preview-list dd { margin: 0; text-align: right; }
.hours-preview-list .is-closed dd { color: var(--muted); }
@media (min-width: 1024px) {
  .hours-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .hours-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
}
.list-fields { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 0.875rem; }
.list-field { overflow-wrap: anywhere; }
.list-field-label { color: var(--muted); }
.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);
}
/* Status: neutrale Pille, Farbe nur im Punkt (ADR 0080, Nachtrag). */
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, currentColor); }
.badge.live, .badge.draft, .badge.maintenance, .badge.success, .badge.danger, .badge.warning,
.badge[class*="lead-"] { color: var(--text); }
.badge.live, .badge.success, .badge.lead-won { --dot: var(--success); }
.badge.draft, .badge.warning, .badge.lead-contacted, .badge.lead-visit, .badge.lead-quoted { --dot: var(--warning); }
.badge.maintenance, .badge.danger { --dot: var(--danger); }
.badge.lead-new { --dot: var(--info); }

/* 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: thin; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.filter-tabs li { flex: none; scroll-snap-align: start; }
@media (max-width: 639px) {
  /* Wischbar bis an den Rand; der angeschnittene letzte Reiter zeigt, dass es weitergeht */
  .filter-tabs { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .filter-tabs::after { content: ""; flex: none; width: 8px; }
}
.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; }
/* Video und Animation ohne Vorschaubild (ADR 0103) */
.media-thumb-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-weight: 600;
}
.media-thumb-file svg { width: 32px; height: 32px; }
.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; }
/* Fokuspunkt per Klick und Vorschau (FOCAL_JS); Lage nur über Klassen, CSP ohne Inline-Stile */
.focal-picker { margin-top: 12px; }
.focal-area { position: relative; cursor: crosshair; line-height: 0; border-radius: 8px; overflow: hidden; }
.focal-image { display: block; width: 100%; height: auto; }
.focal-marker {
  position: absolute; left: var(--ordx-fx, 50%); top: var(--ordx-fy, 50%); width: 28px; height: 28px;
  margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #111111, 0 2px 8px rgb(0 0 0 / 0.4); pointer-events: none;
}
.focal-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.focal-preview { margin: 0; }
.focal-preview-image { display: block; width: 100%; height: auto; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.focal-preview-image.ratio-16-9 { aspect-ratio: 16 / 9; }
.focal-preview-image.ratio-4-3 { aspect-ratio: 4 / 3; }
.focal-preview-image.ratio-1-1 { aspect-ratio: 1 / 1; }
.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; }
.form-uses { margin: 12px 0; }
.form-uses-label { margin: 0 0 4px; font-weight: 600; }
.form-uses ul { list-style: none; margin: 0; padding: 0; }
.form-uses li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.form-uses a { display: inline-flex; align-items: center; min-height: 44px; }
.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; }
.version-row { flex-wrap: wrap; }
.version-row .list-main { flex: 1 1 220px; }
.version-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.version-actions form { margin: 0; }
.usage-list { margin: 8px 0 0; padding-left: 20px; }
.usage-list li { padding: 6px 0; }
.usage-list a { display: inline-flex; align-items: center; min-height: 44px; }
/* SEO-Check (8b): Vorschläge als Liste, ohne Punktzahl */
.seo-check { margin: 8px 0 0; padding-left: 20px; }
.seo-check li { padding: 6px 0; overflow-wrap: anywhere; }
.seo-check-ok { margin: 0; color: var(--text); }
.seo-check a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* Link-Feld mit Art (ADR 0101 B3): nur das Eingabefeld der gewählten Art; ohne :has() alle */
.link-field:has(select[name$=".kind"] option[value="page"]:checked) .link-input:not([data-kind="page"]),
.link-field:has(select[name$=".kind"] option[value="phone"]:checked) .link-input:not([data-kind="phone"]),
.link-field:has(select[name$=".kind"] option[value="email"]:checked) .link-input:not([data-kind="email"]),
.link-field:has(select[name$=".kind"] option[value="url"]:checked) .link-input:not([data-kind="url"]) { display: none; }
/* Google-Vorschau (ADR 0101 B2): angelehnt an einen Suchtreffer, Farben aus den Token */
.serp {
  display: flex; flex-direction: column; gap: 2px; margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.serp-label { margin-bottom: 6px; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.serp-url { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.serp-title { color: var(--text); font-size: 1.125rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.serp-desc { color: var(--text); font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
.serp-warn { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; color: var(--text); font-size: 0.8125rem; }
.serp-warn[hidden] { display: none; }
.serp-warn svg.icon { flex: none; color: var(--warning); }
/* Übersetzen (ADR 0095): Quelltext unter dem Feld, Stand je Sprache */
.source-text { margin: -8px 0 16px; padding: 8px 12px; border-left: 3px solid var(--border-strong);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: pre-wrap;
  overflow-wrap: anywhere; font-size: 0.875rem; color: var(--text); }
.source-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.editor-outdated { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text);
  font-weight: 600; }
.editor-outdated svg.icon { color: var(--warning); }
.translation-state { font-weight: 500; }
.translation-state.is-missing, .translation-state.is-outdated { font-weight: 700; }
.pick-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pick-item { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; position: relative; min-height: 44px; }
.pick-item input { position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; margin: 0; }
.pick-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; }
.pick-item:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.pick-item:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-name { font-size: 0.8125rem; overflow-wrap: anywhere; }
/* Medien: Ziehen und Ablegen (ADR 0101 B3) */
form.is-dragover { outline: 2px dashed var(--focus); outline-offset: -6px; background: var(--hover); }
/* Foto wählen (ADR 0101 B3) */
.photo-current { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.photo-current img { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.photo-empty {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 120px; height: 80px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 0.75rem;
}
.photo-name { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.photo-picker > summary { list-style: none; display: inline-flex; }
.photo-picker > summary::-webkit-details-marker { display: none; }
.photo-picker[open] > summary { margin-bottom: 8px; }
.photo-picker .pick-grid { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); max-height: 22rem; overflow-y: auto; padding: 2px; }
.pick-none { display: grid; place-items: center; height: 90px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.photo-upload { margin: 8px 0 12px; }
.photo-upload a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); color: var(--text); }
/* Erweitert (Adresse, Suchmaschinen): zugeklappt */
.advanced { border-top: 1px solid var(--border); }
.advanced > summary {
  display: flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 12px 20px; cursor: pointer;
  font-weight: 600; list-style: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary svg.icon { transition: transform 0.15s; }
.advanced[open] > summary svg.icon { transform: rotate(90deg); }
.advanced-body { padding: 0 20px 12px; }
.schedule-fields { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.schedule-form + form { margin-top: 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; }
.role-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-form .select { min-width: 12rem; }
/* 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; }
.module-settings { margin-top: 12px; }
/* Module: Einstellungen und Mail-Vorlagen (ADR 0104) */
.module-detail-link { display: inline-flex; align-items: center; min-height: var(--touch); font-weight: 600; }
.mail-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1024px) { .mail-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.mail-title { margin: 0 0 4px; }
.mail-sample { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow-wrap: anywhere; }
.mail-sample-subject { margin: 0 0 12px; }
.mail-sample-p { margin: 0 0 12px; white-space: pre-line; }
.mail-sample-p:last-child { margin-bottom: 0; }
.wp-report { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8125rem; background: var(--hover); padding: 12px; border-radius: var(--radius); max-height: 70vh; overflow: auto; }
/* 2FA (ADR 0091): QR immer schwarz auf weiss, damit Kameras ihn auch im Dunkelmodus lesen. */
.qr-box { display: flex; justify-content: center; margin-bottom: 16px; }
.qr { width: 100%; max-width: 232px; height: auto; border-radius: var(--radius-sm); }
.qr rect { fill: #ffffff; }
.qr path { fill: #111111; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0 0 16px; padding-left: 1.75em; font-size: 1.0625rem; }
.danger-zone { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.danger-zone summary { min-height: var(--touch); display: flex; align-items: center; cursor: pointer; color: var(--danger); font-weight: 600; }
.danger-zone form { display: grid; gap: 12px; margin-top: 8px; }
.module-settings .field { margin-bottom: 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 -------------------------------------------------------------------- */
/* Hinweise: neutrale Fläche, Farbe nur im Symbol; Links in Textfarbe, unterstrichen (ADR 0080, Nachtrag). */
.notice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 16px;
  border-radius: var(--radius); font-weight: 500;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
.notice svg.icon { flex: none; color: var(--success); }
.notice.info svg.icon { color: var(--muted); }
.notice.error svg.icon { color: var(--danger); }
.notice.warning svg.icon { color: var(--warning); }
.notice a { color: var(--text); text-decoration: underline; }
/* Unveröffentlichte Änderungen (ADR 0081): Hinweis mit Veröffentlichen/Verwerfen */
.draft-bar { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.draft-bar p { margin: 0; flex: 1 1 16rem; }
.draft-bar .actions { margin: 0; }

/* --- Seiteneditor mit Live-Vorschau (ADR 0081) ------------------------------------ */
.content:has(.editor) { max-width: none; }
/* Vollbild ohne Menü des Panels (ORDX-PLAN §11.3, ADR 0101 B2) */
body.bare main { padding: 0; max-width: none; }
.ed-top {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.ed-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch); padding: 0 12px 0 6px;
  border-radius: var(--radius); color: var(--text); font-weight: 500; text-decoration: none;
}
.ed-back:hover { background: var(--hover); }
.ed-name { display: flex; flex-direction: column; flex: 1 1 8rem; min-width: 0; line-height: 1.3; }
.ed-name strong { color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.ed-name span { font-weight: 600; }
.ed-name strong, .ed-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-langs .is-missing { border: 1px dashed var(--border-strong); }
.ed-publish { margin: 0; }
/* Telefon: eine Zeile oben; Versionen stehen im Menü "⋯" der Seite */
@media (max-width: 639.98px) {
  .ed-versions { display: none; }
  .ed-name { flex-basis: 0; }
  .ed-back { min-width: var(--touch); justify-content: center; padding: 0; }
  .ed-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ed-top .editor-status:empty { display: none; }
  .ed-top .editor-status { order: 10; flex-basis: 100%; }
}
.ed-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 8px;
  border-radius: 999px; background: var(--primary-text); color: var(--primary); font-size: 0.75rem; font-weight: 700;
}
.ed-count[hidden] { display: none; }
.ed-switch { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.ed-switch[hidden] { display: none; }
.ed-switch .button { flex: 1 1 0; }
.ed-switch .button[aria-pressed="true"] { background: var(--nav-active); border-color: var(--text); }
.editor-side { padding: 16px; }
/* Laden einer anderen Spalte (Editor-Skript): sofort sichtbar, ohne Sprung (ORDX-PLAN §11.2.1) */
.editor-side[aria-busy] { opacity: 0.6; transition: opacity 120ms ease 80ms; cursor: progress; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }
@media (prefers-reduced-motion: reduce) { .editor-side[aria-busy] { transition: none; } }
.ed-tree, .ed-more { margin-bottom: 24px; }
.ed-pages { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-page-row { display: flex; align-items: center; gap: 4px; }
.ed-page-name {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0; min-height: var(--touch); padding: 0 12px;
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
a.ed-page-name:hover { background: var(--hover); }
.ed-pages .is-open { padding-bottom: 8px; }
.ed-pages .is-open .ed-page-name { background: var(--nav-active); font-weight: 600; }
.ed-pages .is-open .editor-sections, .ed-pages .is-open > .muted, .ed-pages .is-open > .editor-add { margin: 6px 0 8px 12px; }
.ed-pages .is-open > .ed-undo { margin: 6px 0 4px 12px; }
.ed-undo .button { min-height: 44px; }
.ed-menu { position: relative; }
.ed-menu summary {
  display: inline-grid; place-items: center; width: var(--touch); height: var(--touch); border-radius: var(--radius);
  color: var(--muted); cursor: pointer; list-style: none;
}
.ed-menu summary::-webkit-details-marker { display: none; }
.ed-menu summary:hover, .ed-menu[open] summary { background: var(--hover); color: var(--text); }
.ed-menu .menu-panel { width: 230px; margin: 0; }
.ed-more ul { list-style: none; margin: 0; padding: 0; }
.ed-more a {
  display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 12px;
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.ed-more a:hover { background: var(--hover); }
.ed-more svg.icon { color: var(--muted); }
.ed-to-tree { display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch); margin: 0 0 8px; }
.editor-langs { display: flex; gap: 4px; }
.editor-langs a, .editor-langs span {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch);
  min-height: var(--touch); border-radius: var(--radius); font-weight: 600; font-size: 0.8125rem;
  color: var(--muted); text-decoration: none;
}
.editor-langs a:hover { background: var(--hover); color: var(--text); }
.editor-langs span[aria-current], .editor-langs a[aria-current] { color: var(--text); background: var(--nav-active); }
.lang-tabs { margin: 0 0 16px; }
.editor-status { margin: 0; color: var(--muted); font-size: 0.875rem; min-height: 1.25em; }
.editor-devices { display: none; gap: 4px; }
.editor-devices .button[aria-pressed="true"] { background: var(--nav-active); border-color: var(--text); }
.editor-main { display: grid; gap: 16px; }
.editor-heading { font-size: 1rem; margin: 0 0 8px; }
.editor-sections { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.editor-sections a, .editor-section-locked {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: var(--touch);
  padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.editor-section-locked { color: var(--muted); }
.editor-sections a:hover { background: var(--hover); }
.editor-sections a[aria-current="true"] {
  background: var(--nav-active); border-color: var(--border-strong); font-weight: 600;
}
.editor-hint { margin: 0; }
.editor-sections li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px; }
.editor-sections .badge { margin-left: 8px; }
.editor-sections .is-hidden > a, .editor-sections .is-hidden > .editor-section-locked { border-style: dashed; }
/* Verwaister Theme-Abschnitt (ADR 0082): grau, nur verschieben oder entfernen */
.editor-sections .is-orphan > .editor-section-locked, .editor-sections .is-orphan strong { color: var(--muted); }
.icon-only { min-width: var(--touch); padding: 0; justify-content: center; }
/* Speisekarte (ADR 0106): Gericht je Zeile, Aktionen darunter (Telefon) bzw. rechts */
.food-category-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.food-category-head h2 { margin: 0; }
.food-category-actions, .move-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.food-category-actions form, .move-buttons form { display: contents; }
.food-category-actions .button, .move-buttons .button { min-width: var(--touch); min-height: var(--touch); padding: 0 10px; }
.dish-rows { list-style: none; margin: 0; padding: 0; }
/* Ziehen (Skript): Griff links, Zeile hebt sich beim Ziehen ab */
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--touch); height: var(--touch); margin-left: -8px; color: var(--muted);
  cursor: grab; touch-action: none; user-select: none;
}
.drag-handle[hidden] { display: none; }
.is-dragging { opacity: 0.85; box-shadow: var(--shadow); position: relative; z-index: 2; background: var(--surface); }
.is-dragging .drag-handle { cursor: grabbing; color: var(--text); }
.food-sort-status:empty { display: none; }
.csv-errors { margin: 0 0 16px; padding-left: 1.25rem; color: var(--danger); }
.bulk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bulk-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.bulk-row.is-open { border-color: var(--danger); }
.bulk-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.bulk-fields { display: grid; gap: 4px; min-width: 0; }
.bulk-fields select { width: 100%; min-height: 44px; }
.bulk-file { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.food-categories { margin-top: 16px; }
.food-sort-status { margin: 12px 0 0; }
.dish-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.dish-row-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; }
.dish-row-name { font-weight: 600; overflow-wrap: anywhere; }
.dish-row.is-soldout .dish-row-name { color: var(--muted); text-decoration: line-through; }
.dish-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dish-row-actions form { display: flex; gap: 6px; align-items: center; }
.dish-row-actions .button { min-height: var(--touch); }
.inline-price input { width: 6.5rem; min-height: var(--touch); text-align: right; font-variant-numeric: tabular-nums; }
.price-rows .price-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 8rem); gap: 8px 12px; }
/* Weitere Sprachen unter der Bezeichnung, Betrag bleibt oben rechts */
.price-rows .price-row .price-label-lang { grid-column: 1; }
.price-rows .price-row .price-amount { grid-row: 1; grid-column: 2; }
.price-rows .price-row + .price-row:has(.price-label-lang) { border-top: 1px solid var(--border); padding-top: 12px; }
.field-row.time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 4px 16px; }
.check-grid > legend, .check-grid > .hint, .check-grid > .error { grid-column: 1 / -1; }
.check-grid .check { min-height: var(--touch); }
/* Tagesmenü (ADR 0107) */
.daily-day-head h2 { margin: 0; font-size: 1.0625rem; }
.daily-day-empty { margin: 0; padding-top: 0; }
.daily-day-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 0; }
.daily-day-actions form { display: contents; }
.daily-day-actions .button { min-height: var(--touch); }
/* QR-Menü (ADR 0108) */
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.qr-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.qr-steps li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.qr-steps li.is-done { color: var(--text); }
.qr-steps svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.qr-form { display: grid; gap: 4px; max-width: 420px; margin-top: 12px; }
.qr-form .button { justify-self: start; }
.qr-form input[type="color"] { width: 100%; min-height: var(--touch); padding: 4px; }
.qr-preview { margin: 20px 0 0; display: grid; justify-items: center; gap: 8px; }
.qr-big { width: 100%; max-width: 240px; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-preview figcaption { font-size: 0.8125rem; overflow-wrap: anywhere; text-align: center; }
.qr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.qr-card { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center;
  break-inside: avoid; background: #ffffff; color: #111111; }
.qr-card-site { margin: 0 0 8px; font-weight: 700; font-size: 1.0625rem; }
.qr-card-code { width: 100%; max-width: 180px; height: auto; }
.qr-card-table { margin: 8px 0 0; font-size: 1.5rem; font-weight: 700; }
.qr-card-hint { margin: 2px 0 0; font-size: 0.8125rem; color: #444444; }
/* Reservationen (ADR 0109): Tagesliste fürs Telefon, Zeitfenster als Zwischentitel */
.actions-row.res-top { margin: 0 0 16px; }
.res-list { list-style: none; margin: 0; padding: 0; }
.res-item { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.res-item:last-child { border-bottom: 0; }
.res-item-main { min-width: 0; flex: 1 1 16rem; }
.res-item-main p { margin: 0; }
.res-item-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.res-item-name { margin-top: 2px; overflow-wrap: anywhere; }
.res-item-name a { display: inline-flex; min-height: var(--touch); align-items: center; }
.res-item-note { color: var(--muted); font-size: 0.875rem; white-space: pre-line; overflow-wrap: anywhere; }
.res-item-note.internal { display: flex; gap: 6px; align-items: flex-start; color: var(--text); }
.res-item-note.internal svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.res-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.res-daynav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.res-daynav input[type="date"] { width: auto; min-height: var(--touch); }
.button.icon-only { min-width: var(--touch); padding-left: 0; padding-right: 0; justify-content: center; }
.res-shift-title { margin: 16px 0 0; font-size: 0.95rem; color: var(--muted); }
/* Termine (ADR 0110): je Person ein Block, Arbeitszeit daneben */
.appt-staff-title { color: var(--text); padding-top: 12px; border-top: 1px solid var(--border); }
.appt-staff-title .muted { font-weight: 400; }
.res-export { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.res-export .field { flex: 1 1 10rem; min-width: 0; }
.res-export .button { margin-bottom: 16px; }
.field-row.res-when { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 0 12px; }
@media (max-width: 420px) { .field-row.res-when { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.res-status-line { display: flex; gap: 10px; align-items: center; }
@media print {
  @page { size: A4; margin: 10mm; }
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; left: 0; top: 0; width: 100%; }
  .qr-cards { grid-template-columns: repeat(2, 1fr); gap: 6mm; }
  .qr-card { height: 128mm; display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-color: #999999; }
  .qr-card-code { max-width: 70mm; }
  .res-print .table th, .res-print .table td { padding: 4px 6px; font-size: 10pt; border-bottom: 1px solid #999999; }
  .no-print { display: none; }
}
.notice .inline-form, .inline-form { display: inline-flex; margin-left: 8px; }
.editor-add { margin: 0 0 16px; }
.editor-library h2:focus { outline: none; }
.editor-library-list {
  list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.editor-library-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: var(--touch); padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--text); text-decoration: none;
}
.editor-library-list a:hover { background: var(--hover); }
/* Vorschau eines Theme-Abschnitts (ADR 0082): nur Bild, festes Seitenverhältnis */
.editor-library-preview {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: #ffffff;
}
.editor-library-group { margin: 16px 0 8px; font-size: 0.95rem; }
.editor-form h2:focus { outline: none; }
.editor-preview { display: flex; flex-direction: column; padding: 16px; }
.editor-frame { display: none; width: 100%; height: 100%; border: 0; background: #ffffff; }
/* Ohne Skript unter 1100 px: Vorschau im neuen Tab; mit Skript: "Bearbeiten | Vorschau" */
.editor[data-js] .editor-open-preview { display: none; }
@media (max-width: 1099.98px) {
  .editor[data-js][data-view="edit"] .editor-preview { display: none; }
  .editor[data-js][data-view="preview"] .editor-side { display: none; }
  .editor[data-js] .editor-preview { padding: 0; height: calc(100dvh - 130px); min-height: 420px; }
  .editor[data-js] .editor-frame { display: block; }
  .editor[data-js] .editor-devices:not([hidden]) { display: none; }
}
@media (min-width: 1100px) {
  body.bare { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  body.bare main { flex: 1 1 auto; min-height: 0; }
  .editor { display: flex; flex-direction: column; height: 100%; }
  .ed-switch, .ed-switch:not([hidden]) { display: none; }
  .editor-devices:not([hidden]) { display: flex; }
  .editor-open-preview { display: none; }
  .editor-main { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0; }
  .editor-side { overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); }
  .editor-preview { align-items: center; padding: 16px; min-height: 0; background: var(--surface-2); }
  .editor-frame { display: block; border: 1px solid var(--border); border-radius: var(--radius); }
  .editor-preview[data-device="tablet"] .editor-frame { width: 768px; max-width: 100%; }
  .editor-preview[data-device="mobile"] .editor-frame { width: 390px; max-width: 100%; }
}
.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, .topbar-area { 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); }
  .subnav-groups { flex-direction: column; border-bottom: 0; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
  .subnav-groups .subnav { position: static; }
  .subnav-group + .subnav-group { border-left: 0; margin: 12px 0 0; padding: 0; }
  .subnav-label { position: static; width: auto; height: auto; clip: auto; padding: 0 12px 4px; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
}
/* --- Richtext-Editor (ADR 0099): ohne Skript bleibt das Textfeld --- */
.rt { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.rt:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.rt-field:has([aria-invalid="true"]) .rt { border-color: var(--danger); }
.rt { position: relative; }
/* Eine Zeile; was nicht passt, wird seitlich gewischt (Telefon: Verlauf im Menü "⋯") */
.rt-toolbar {
  position: sticky; top: var(--topbar-h); z-index: 5;
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 4px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.rt-toolbar::-webkit-scrollbar { display: none; }
.rt-group { display: flex; flex: none; gap: 2px; }
.rt-group + .rt-group { padding-left: 8px; border-left: 1px solid var(--border); }
.rt-block {
  width: auto; height: var(--touch); padding: 0 28px 0 10px; max-width: 11rem;
  border: 0; border-radius: var(--radius-sm); background-color: transparent; color: var(--text); font: inherit; font-size: 0.875rem; cursor: pointer;
}
.rt-block:hover { background-color: var(--hover); }
.rt-block:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.rt-more-group { display: none; }
.rt-menu {
  position: absolute; z-index: 6; right: 4px; top: calc(var(--touch) + 12px); min-width: 12rem; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.rt-menuitem {
  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; cursor: pointer;
}
.rt-menuitem:hover, .rt-menuitem:focus-visible { background: var(--hover); }
.rt-menuitem[aria-disabled="true"] { color: var(--muted); opacity: 0.5; cursor: default; }
/* Schmal (Telefon, Seitenleiste des Seiteneditors; Klasse setzt das Skript): Verlauf im Menü,
   "⋯" bleibt rechts stehen, der Rest wird darunter durchgewischt */
.rt-compact .rt-history { display: none; }
.rt-compact .rt-more-group {
  display: flex; position: sticky; right: -4px; margin-left: auto;
  background: var(--surface); box-shadow: -14px 0 10px -6px var(--surface);
}
@media (max-width: 639px) {
  /* Beim Schreiben klebt die Leiste über der Tastatur (Abstand setzt das Skript) */
  .rt-docked .rt-toolbar {
    position: fixed; z-index: 60; left: 0; right: 0; top: auto; bottom: var(--rt-keyboard, 0px);
    padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left));
    border-radius: 0; border-top: 1px solid var(--border-strong); border-bottom: 0; box-shadow: var(--shadow-lg);
  }
  .rt-docked .rt-menu { position: fixed; z-index: 61; top: auto; right: 8px; bottom: calc(var(--rt-keyboard, 0px) + var(--touch) + 16px); }
  .rt-docked .rt-content { padding-top: 10px; }
}
.rt-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--touch); min-height: var(--touch); padding: 0;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); cursor: pointer;
}
.rt-button:hover { background: var(--hover); }
.rt-button[aria-pressed="true"] { color: var(--primary-text); background: var(--primary); }
.rt-button[aria-disabled="true"] { color: var(--muted); opacity: 0.5; cursor: default; }
.rt-button[aria-disabled="true"]:hover { background: none; }
.rt-button svg.icon { width: 20px; height: 20px; }
.rt-content { padding: 10px 12px; }
.rt-editor {
  position: relative; min-height: 10rem; outline: none;
  font-size: 1rem; line-height: 1.6; color: var(--text);
  word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces;
  font-variant-ligatures: none;
}
.rt-editor > :first-child { margin-top: 0; }
.rt-editor p { margin: 0 0 0.75em; }
.rt-editor h2 { font-size: 1.25rem; margin: 1em 0 0.5em; }
.rt-editor h3 { font-size: 1.0625rem; margin: 1em 0 0.5em; }
.rt-editor ul, .rt-editor ol { margin: 0 0 0.75em; padding-left: 1.5em; }
.rt-editor li p { margin: 0; }
.rt-editor blockquote { margin: 0 0 0.75em; padding: 2px 0 2px 14px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.rt-editor a { color: var(--focus); text-decoration: underline; }
.rt-editor .ProseMirror-hideselection *::selection { background: transparent; }
.rt-editor .ProseMirror-hideselection * { caret-color: transparent; }
.rt-editor img.ProseMirror-separator { display: inline; border: none; margin: 0; width: 0; height: 0; }
.rt-dialog {
  width: min(32rem, calc(100vw - 32px)); padding: 20px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.rt-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.rt-dialog h2 { margin-bottom: 16px; }
.rt-dialog .form-actions { flex-wrap: wrap; }
@media (min-width: 1024px) {
  /* Im Seiteneditor scrollt die Seitenleiste selbst */
  .editor-side .rt-toolbar { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* --- Dunkel: deckende Grautöne ("dark" und "system" bei dunklem Gerät) --- */
: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 { 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 { 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); }
}
.ordx-focal{object-position:var(--ordx-fx,50%) var(--ordx-fy,50%)}
.ordx-fx-0{--ordx-fx:0%}.ordx-fy-0{--ordx-fy:0%}
.ordx-fx-10{--ordx-fx:10%}.ordx-fy-10{--ordx-fy:10%}
.ordx-fx-20{--ordx-fx:20%}.ordx-fy-20{--ordx-fy:20%}
.ordx-fx-30{--ordx-fx:30%}.ordx-fy-30{--ordx-fy:30%}
.ordx-fx-40{--ordx-fx:40%}.ordx-fy-40{--ordx-fy:40%}
.ordx-fx-50{--ordx-fx:50%}.ordx-fy-50{--ordx-fy:50%}
.ordx-fx-60{--ordx-fx:60%}.ordx-fy-60{--ordx-fy:60%}
.ordx-fx-70{--ordx-fx:70%}.ordx-fy-70{--ordx-fy:70%}
.ordx-fx-80{--ordx-fx:80%}.ordx-fy-80{--ordx-fy:80%}
.ordx-fx-90{--ordx-fx:90%}.ordx-fy-90{--ordx-fy:90%}
.ordx-fx-100{--ordx-fx:100%}.ordx-fy-100{--ordx-fy:100%}
