/* =====================================================================
   MHA ONE – Designsystem
   Primärfarbe #1E40AF (SRS). Für Text/Icons auf dunklem Grund werden
   hellere, kontrastgeprüfte Blauvarianten verwendet (≥ 4,5:1).
   Seit 27.11.2026 Corporate Design weiß/blau mit Schrift Manrope für alle Ansichten
   (Logo: Navy #0F2A64, Akzent Gold #C9A23A – Gold nur dekorativ, nie als Textfarbe).
   Keine Inline-Styles (CSP style-src 'self').
   ===================================================================== */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/manrope-latin-800-normal.woff2") format("woff2"); }

:root {
  --primary: #1E40AF;
  --primary-hover: #1D4ED8;
  --primary-press: #1E3A8A;
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 16px;
  --nav-h: 68px;
  --top-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Unterkategorie-Farben (Verteilungsbalken), zusätzlich immer als Text ausgewiesen */
  --c1: #3B82F6; --c2: #22D3EE; --c3: #818CF8; --c4: #34D399; --c5: #FBBF24; --c6: #F472B6; --c7: #A3E635;
}

/* Dunkle Kundenansicht */
.theme-dark {
  --bg: #040a1c;
  --bg-2: #071029;
  --surface: #0b1631;
  --surface-2: #0f1d3f;
  --surface-3: #142552;
  --border: #1e2d55;
  --text: #eef3ff;
  --text-2: #c4d0ea;
  --muted: #9fb0d0;
  --accent: #7cb3ff;        /* Links/Icons auf dunklem Grund: Kontrast > 7:1 */
  --accent-strong: #93c5fd;
  --chip-bg: rgba(59,130,246,.16);
  --chip-text: #9cc4ff;
  --ok: #4ade80; --ok-bg: rgba(16,185,129,.14); --ok-border: rgba(52,211,153,.35);
  --warn: #fcd34d; --warn-bg: rgba(251,191,36,.12); --warn-border: rgba(251,191,36,.35);
  --danger: #fca5a5; --danger-bg: rgba(239,68,68,.14); --danger-border: rgba(248,113,113,.4);
  --info-bg: rgba(59,130,246,.12); --info-border: rgba(96,165,250,.35);
  --focus: #93c5fd;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* Helle Arbeitsoberfläche (Berater, Admin, Gesellschaft, Zugang) */
.theme-light {
  --bg: #f6f8fc;
  --bg-2: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f4f7fc;
  --surface-3: #e8eef9;
  --border: #dbe3ef;
  --text: #0f1f45;
  --text-2: #1f2f57;
  --navy: #0F2A64;
  --gold: #C9A23A;
  --muted: #4b5a73;
  --accent: #1E40AF;
  --accent-strong: #1E3A8A;
  --chip-bg: #e3ebfc;
  --chip-text: #1E3A8A;
  --ok: #166534; --ok-bg: #e8f7ee; --ok-border: #a7e0bb;
  --warn: #92400e; --warn-bg: #fff6e0; --warn-border: #f5d58a;
  --danger: #991b1b; --danger-bg: #fdecec; --danger-border: #f2b6b6;
  --info-bg: #eaf1ff; --info-border: #bcd0fb;
  --focus: #1D4ED8;
  --shadow: 0 6px 20px rgba(15,23,42,.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.theme-dark body, body.theme-dark { background: radial-gradient(1200px 600px at 50% -200px, #0d1d47 0%, var(--bg) 60%) fixed, var(--bg); }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.9rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: .25rem; }
.hidden { display: none !important; }

/* Sichtbarer Fokus (N09) */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--primary); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 8px; color: #fff; }

.ic { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-sm { width: 18px; height: 18px; }
.ic-lg { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.content.narrow { max-width: 760px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center;
  min-height: var(--top-h); padding: var(--safe-t) 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; color: var(--navy, var(--text)); }
.brand-name span { color: inherit; }
.brand-sub { font-size: .62rem; font-weight: 600; letter-spacing: .24em; color: var(--navy, var(--muted)); text-transform: uppercase; }
.brand-sub .bd { color: var(--gold, var(--accent)); font-weight: 800; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.solid { background: var(--surface-3); color: var(--accent); border-color: var(--border); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }

/* Untere Navigation (mobil) – überdeckt keine Inhalte: content hat padding-bottom */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: .74rem; font-weight: 600;
}
.bottom-nav a[aria-current="page"] { color: var(--accent); }
.bottom-nav a[aria-current="page"] .ic { stroke-width: 2.2; }
body.keyboard-open .bottom-nav { display: none; }

/* Seitenleiste (Desktop) */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; width: 248px; flex: 0 0 248px;
    position: sticky; top: 0; height: 100vh; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border);
  }
  .sidebar .brand { align-items: flex-start; padding: 4px 10px 18px; }
  .sidebar a.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: 10px;
    color: var(--text-2); text-decoration: none; font-weight: 600;
  }
  .sidebar a.nav-link:hover { background: var(--surface-2); }
  .sidebar a.nav-link[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); }
  .sidebar .sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
  .bottom-nav { display: none; }
  .content { padding-bottom: 40px; padding-left: 32px; padding-right: 32px; }
  .topbar.has-sidebar .brand { visibility: hidden; }
}
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--muted); font-size: .85rem; }
.who strong { color: var(--text); display: block; font-size: .9rem; }

/* Arbeitsoberfläche: horizontale Tab-Navigation auf kleinen Bildschirmen */
.tabs-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); scrollbar-width: thin; }
.tabs-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 44px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tabs-nav a[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); }
@media (min-width: 1024px) { .tabs-nav { display: none; } }
.workspace .content { padding-bottom: 40px; }

/* Umgebungsbanner (Entwicklung/Test) */
.env-banner { background: #92400e; color: #fff; text-align: center; font-size: .8rem; font-weight: 600; padding: 4px 8px; }

/* ---------------------------------------------------------------- Seitenkopf */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }

/* ---------------------------------------------------------------- Karten */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.theme-dark .card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.card + .card, .stack > * + * { margin-top: var(--gap); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.card.hero { background: linear-gradient(135deg, #10235a 0%, #0b1838 55%, #0d1c44 100%); border-color: #22356a; }
.theme-light .card.hero { background: linear-gradient(135deg, #1E40AF, #1e3a8a); color: #fff; border: 0; }
.theme-light .card.hero .muted { color: #dbe6ff; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
@media (min-width: 1024px) { .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); align-items: start; } .split > * + * { margin-top: 0; } }

.stat-label { color: var(--muted); font-size: .9rem; }
.stat-value { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: .9rem; }

/* Vertragskarten (Q7b) */
.contract-card { display: block; text-decoration: none; color: inherit; padding: 16px; }
.contract-card:hover { border-color: #2c4380; }
.theme-light .contract-card:hover { border-color: #9fb6e6; }
.cc-main { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 14px; align-items: start; }
.cc-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); border: 1px solid var(--border); }
.cc-icon.tone-2 { color: #67e8f9; } .cc-icon.tone-3 { color: #a5b4fc; }
.theme-light .cc-icon.tone-2 { color: #0e7490; } .theme-light .cc-icon.tone-3 { color: #4338ca; }
.cc-title { font-weight: 700; font-size: 1.04rem; overflow-wrap: anywhere; }
.cc-sub { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.cc-price { text-align: right; font-weight: 700; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-price small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .92rem; color: var(--text-2); }
.cc-foot .meta { display: inline-flex; align-items: center; gap: 8px; }
.cc-foot .meta.warn { color: var(--warn); }
.cc-foot .go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
@media (max-width: 420px) {
  .cc-main { grid-template-columns: 44px minmax(0,1fr); }
  .cc-icon { width: 44px; height: 44px; }
  .cc-price { grid-column: 2; text-align: left; }
  .cc-price small { display: inline; margin-left: 4px; }
}

/* Kategorie-Kacheln */
.cat-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.cat-tile .amount { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }

/* Verteilungsbalken (SVG, Breiten als Attribute – CSP-konform) */
.dist { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.dist-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.dist svg { display: block; width: 100%; height: 12px; border-radius: 6px; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.fill-1 { fill: var(--c1); background: var(--c1); } .fill-2 { fill: var(--c2); background: var(--c2); } .fill-3 { fill: var(--c3); background: var(--c3); }
.fill-4 { fill: var(--c4); background: var(--c4); } .fill-5 { fill: var(--c5); background: var(--c5); } .fill-6 { fill: var(--c6); background: var(--c6); } .fill-7 { fill: var(--c7); background: var(--c7); }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.5; background: var(--chip-bg); color: var(--chip-text); border: 1px solid transparent; white-space: nowrap; }
.badge .ic { width: 15px; height: 15px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge.muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.info { background: var(--info-bg); color: var(--chip-text); border-color: var(--info-border); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-hover); color: #fff; }
.btn:active { background: var(--primary-press); }
.btn.secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.outline { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.outline:hover { background: var(--chip-bg); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--chip-bg); }
.btn.danger { background: #b91c1c; color: #fff; }
.btn.danger:hover { background: #991b1b; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn.secondary.busy::after, .btn.outline.busy::after, .btn.ghost.busy::after { border-color: var(--accent); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Aktionskacheln (Q7c) */
.action-tile { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; min-height: 120px; }
.action-tile .tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); }
.action-tile .tile-ic.green { background: var(--ok-bg); color: var(--ok); }
.action-tile strong { font-size: 1rem; }

/* ---------------------------------------------------------------- Formulare */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: .93rem; color: var(--text-2); }
.field .hint { font-size: .85rem; color: var(--muted); }
.req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font: inherit;
}
.theme-light .input, .theme-light .select, .theme-light .textarea { background: #fff; border-color: #b9c6d9; }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"], .input-validation-error { border-color: var(--danger); }
.field-error, .field-validation-error { color: var(--danger); font-size: .88rem; font-weight: 600; }
.field-validation-valid { display: none; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.otp { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; max-width: 220px; }

/* Suche und Filter */
.filters { display: grid; gap: 10px; grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(140px, 1fr)); align-items: end; margin-bottom: 16px; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chip[aria-current="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------------------------------------------------------------- Hinweise / Zustände */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--info-border); background: var(--info-bg); color: var(--text); margin-bottom: 16px; }
.alert .ic { color: var(--accent); margin-top: 1px; }
.alert.ok { border-color: var(--ok-border); background: var(--ok-bg); } .alert.ok .ic { color: var(--ok); }
.alert.warn { border-color: var(--warn-border); background: var(--warn-bg); } .alert.warn .ic { color: var(--warn); }
.alert.error { border-color: var(--danger-border); background: var(--danger-bg); } .alert.error .ic { color: var(--danger); }
.alert p:last-child { margin: 0; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--accent); margin-bottom: 8px; }
.empty h3 { color: var(--text); }

/* ---------------------------------------------------------------- Listen / Tabellen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.row-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-height: 44px; }
.row-link:hover .row-title { color: var(--accent); }
.row-title { font-weight: 600; }
.row-meta { color: var(--muted); font-size: .88rem; }
.row-end { margin-left: auto; text-align: right; display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv dd.missing { color: var(--muted); font-weight: 400; font-style: italic; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .84rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--surface-2); }
@media (max-width: 760px) {
  table.table.stackable thead { display: none; }
  table.table.stackable tr { display: block; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; }
  table.table.stackable td { display: grid; grid-template-columns: 42% 1fr; gap: 8px; border: 0; padding: 6px 12px; }
  table.table.stackable td::before { content: attr(data-label); color: var(--muted); font-size: .84rem; }
}

/* Verlauf / Nachrichten */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline time { color: var(--muted); font-size: .85rem; display: block; }
.messages { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border); }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--primary) 30%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.theme-light .msg.mine { background: #e5edff; border-color: #c4d4fb; }
.msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.note { padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px dashed var(--warn-border); }

/* Dokumente */
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc:last-child { border-bottom: 0; }
.doc .ic { color: var(--accent); }
.doc-info { min-width: 0; flex: 1; }
.doc-name { font-weight: 600; overflow-wrap: anywhere; }

/* Zugangsseiten */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .brand { margin-bottom: 18px; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.steps span.on { background: var(--primary); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; padding: 12px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border); }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 12px; width: 220px; height: 220px; margin: 8px auto 12px; }
.qr svg { width: 196px; height: 196px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; }

/* Schwebende Hinweise (Offline, Update, Installation) */
.toast-area { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 1024px) { .toast-area { bottom: 20px; left: auto; right: 20px; align-items: flex-end; } }
.workspace .toast-area, .auth-page .toast-area { bottom: calc(var(--safe-b) + 16px); }
.toast { pointer-events: auto; max-width: 520px; width: 100%; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #0f1d3f; color: #eef3ff; border: 1px solid #2a3d73; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.toast .btn { margin-left: auto; min-height: 38px; padding: 6px 12px; }
.toast.offline { background: #3b1f07; border-color: #92400e; color: #fde7c4; }

.notif-list .unread .row-title::before { content: "● "; color: var(--accent); }

/* Druck: hell und lesbar */
@media print {
  .bottom-nav, .sidebar, .topbar, .toast-area, .tabs-nav, .btn { display: none !important; }
  body, .theme-dark { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none; border-color: #ccc; background: #fff !important; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.topbar-end { display: flex; justify-content: flex-end; }
@media (min-width: 1024px) { .lg-hide { display: none; } }
.inline-form { display: inline; }
.stack-sm > * + * { margin-top: 8px; }
.mt { margin-top: var(--gap); }
.mb0 { margin-bottom: 0; }
.right { text-align: right; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 32px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); }
details.card[open] > summary::after { content: "–"; }
details.card[open] > summary { margin-bottom: 12px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.stack-top { margin-top: 6px; gap: 6px; }
.center { justify-content: center; text-align: center; }

/* ===================================================================== 
   Kundenentwurf 10.11.2026: Kachel-Startseite, Menü oben rechts, Support
   ===================================================================== */
.topbar.cust { grid-template-columns: 1fr auto; }
.tb-start { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand.brand-left { align-items: flex-start; padding-left: 6px; }
.bn-ic { position: relative; display: inline-grid; }
.bn-dot { position: absolute; top: -2px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--surface); }

/* Menü (Burger) als Seitenpanel von rechts */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 20, .62); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 360px); overflow-y: auto;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 20px);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow);
  animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body.menu-open { overflow: hidden; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-link {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 10px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.menu-link .ic { color: var(--accent); }
.menu-link .chev { margin-left: auto; color: var(--muted); }
.menu-link:hover { background: var(--surface-2); }
.menu-link[aria-current="page"] { background: var(--chip-bg); color: var(--chip-text); }
.support-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.support-box > div { display: flex; flex-direction: column; gap: 2px; }
.support-box .tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); flex: 0 0 auto; }
.support-phone { font-weight: 700; font-size: 1.05rem; text-decoration: none; margin-top: 4px; }
.sidebar .support-box { margin: 0 0 10px; }

/* Startseite: Begrüßung, Fortschritt, Bereiche */
.greeting { font-size: clamp(1.6rem, 6vw, 2.1rem); margin: 4px 0 14px; }
.progress-card { display: flex; flex-direction: column; gap: 10px; }
.progress-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
progress.bar { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 6px; }
progress.bar::-webkit-progress-value { background: linear-gradient(90deg, var(--primary-hover), var(--accent)); border-radius: 6px; }
progress.bar::-moz-progress-bar { background: linear-gradient(90deg, var(--primary-hover), var(--accent)); border-radius: 6px; }
.next-step { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }

.area-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.area-tile {
  display: flex; align-items: center; gap: 16px; min-height: 80px; padding: 16px 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
a.area-tile:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }
a.area-tile:active { transform: scale(.99); }
.area-ic { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }
.area-ic .ic { width: 32px; height: 32px; stroke-width: 1.6; }
.area-text { display: flex; flex-direction: column; min-width: 0; }
.area-label { font-size: 1.15rem; font-weight: 700; }
.area-meta { font-size: .85rem; color: var(--muted); }
.area-tile .chev { margin-left: auto; color: var(--muted); }
.area-tile.off { background: var(--bg-2); border-style: dashed; color: var(--muted); }
.area-tile.off .area-ic { color: var(--muted); }
.area-tile.off .area-label { font-weight: 600; }
.soon { margin-left: auto; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.quick-row { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.quick-link:hover { border-color: var(--accent); }
.quick-link .tile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); flex: 0 0 auto; }
.quick-link strong { display: block; }
.quick-link .chev { margin-left: auto; color: var(--muted); }

/* Termine: positive Darstellung */
.badge.good { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }

/* Kleiner Erfolgsmoment bei Bestätigungen */
.alert.ok { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.h3 { font-size: 1.02rem; font-weight: 700; }
.quick-link > span:not(.tile-ic) { display: flex; flex-direction: column; min-width: 0; }
.advisor { display: flex; align-items: center; gap: 14px; }
.advisor .tile-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); flex: 0 0 auto; }
.advisor > div { display: flex; flex-direction: column; }
.area-text { flex: 1 1 auto; }
.area-label { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .area-tile { gap: 12px; padding: 14px; }
  .area-ic { width: 40px; height: 40px; }
  .area-ic .ic { width: 28px; height: 28px; }
  .area-label { font-size: 1.05rem; }
  .soon { font-size: .66rem; padding: 3px 6px; }
}

/* Vertrauensseite und Claim (Testerfeedback 26.11.2026) */
.auth-card.wide { max-width: 560px; }
.trust-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 14px; }
.trust-list li { display: flex; gap: 14px; align-items: flex-start; }
.trust-list li > .ic { flex: 0 0 auto; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--chip-bg); color: var(--accent); }
.trust-list li > div { display: flex; flex-direction: column; gap: 2px; }
.trust-list li span { color: var(--text-2); font-size: .94rem; }
.claim { font-size: 1.05rem; font-weight: 600; color: var(--navy, var(--text)); margin: -6px 0 16px; }
.claim-note { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.trust-link { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; }
.term-actions { gap: 16px; padding: 0 0 8px 52px; }

/* Offener Vergleich bisher → Alternative */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 14px; align-items: center; margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.cmp-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmp-col strong { font-size: 1.1rem; }
.cmp-col.alt strong { color: var(--accent-strong); }
.cmp-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cmp-arrow { color: var(--muted); }
.cmp-result { grid-column: 1 / -1; margin: 0; font-weight: 700; }
.cmp-result.good { color: var(--ok); }
@media (max-width: 420px) { .compare { grid-template-columns: 1fr; } .cmp-arrow { transform: rotate(90deg); justify-self: start; } }

/* "Tipp für dich" im Kopf der Startseite */
.tip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 0 0 14px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, var(--chip-bg), var(--surface)); border: 1px solid var(--info-border); }
.tip:hover { border-color: var(--accent); }
.tip .tile-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent); flex: 0 0 auto; border: 1px solid var(--border); }
.tip > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.tip-label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tip-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold, var(--accent)); margin-right: 6px; vertical-align: middle; }
.tip-text { font-weight: 600; }
.tip-action { margin-left: auto; white-space: nowrap; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; }
@media (max-width: 560px) { .tip { display: grid; grid-template-columns: auto 1fr; align-items: start; } .tip-action { grid-column: 2; margin-left: 0; } }

/* Einführung beim ersten Öffnen */
.onboarding { text-align: center; padding: 28px 22px; }
.onboarding .btn-row { justify-content: center; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 18px; }
.ob-dots span { width: 26px; height: 5px; border-radius: 3px; background: var(--surface-3); }
.ob-dots span.on { background: var(--accent); }
.ob-ic { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--chip-bg); color: var(--accent); }
.ob-ic .ic { width: 36px; height: 36px; }
.btn-link { background: none; border: 0; padding: 4px; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* Logo/Schriftzug vorerst ausgeblendet (Product:ShowLogo=false), bis das endgültige Logo vorliegt. */
.no-logo .brand { display: none !important; }
