/* Masterplan AI – Komponenten. Nutzt ausschließlich Variablen aus tokens.css. Mobil zuerst. */

/* ============ Grundlagen ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-m);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); font-weight: 650; letter-spacing: -0.012em; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-l); }
h3 { font-size: var(--fs-m); }
p { margin: 0; }
a { color: var(--c-primary-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--space-4) 0; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.num, .amount, .kpi-value, td, th, .pill { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--c-primary-strong); outline-offset: 2px; border-radius: var(--radius-s); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--c-text-muted); }
.small { font-size: var(--fs-s); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 650; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: var(--gap, var(--space-4)); }
.stack-s { --gap: var(--space-2); }
.stack-l { --gap: var(--space-5); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-3)); }
.row-between { justify-content: space-between; }
.row-nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 0; min-width: 0; }
@media (max-width: 1023.98px) { .hide-mobile { display: none !important; } }
.grid-2, .grid-3, .kpi-grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
  .kpi-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hide-desktop { display: none !important; }
}
/* zweispaltige Arbeitsfläche (Rechner): Hauptteil + Seitenteil */
.split { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } .split.is-even { grid-template-columns: 1fr 1fr; } .split.is-rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); } }

/* ============ App-Gerüst ============ */
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
.app-shell > .demo-banner { grid-row: 1; }
.app-shell > .topbar { grid-row: 2; }
.app-shell > .content { grid-row: 3; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-bar);
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--topbar-h);
  padding: var(--space-2) var(--space-4);
  padding-top: max(var(--space-2), env(safe-area-inset-top));
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
/* Akzentstreifen: zeigt auf jedem Bildschirm den aktiven Bereich */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--c-accent); transition: background var(--dur-med) var(--ease); }
.topbar-brand { display: inline-flex; flex: none; width: 36px; height: 36px; }
.topbar-brand img, .topbar-brand svg { width: 36px; height: 36px; }
.topbar-switch { flex: 1 1 auto; max-width: 340px; margin-inline: auto; }
.topbar-search { display: none; }
.topbar-fixed { flex: 1 1 auto; display: flex; justify-content: center; }
.skip-link { position: absolute; left: var(--space-3); top: -80px; z-index: 100; padding: var(--space-3) var(--space-4); border-radius: var(--radius-pill); background: var(--c-text); color: var(--c-bg); font-weight: 650; text-decoration: none; }
.skip-link:focus { top: var(--space-3); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-1); flex: none; margin-left: auto; }
.topbar-title { font-weight: 650; }

.content {
  width: 100%; max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-5) var(--space-4) calc(var(--bottomnav-h) + var(--space-7) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-5);
  min-width: 0;
}

.sidebar { display: none; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 0 var(--space-1) env(safe-area-inset-bottom);
  min-height: var(--bottomnav-h);
}
.bottomnav-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--bottomnav-h); min-width: var(--tap);
  padding: var(--space-2) 0;
  color: var(--c-text-muted); font-size: var(--fs-xs); font-weight: 600; text-decoration: none;
  background: none; border: 0;
  transition: color var(--dur-fast) var(--ease);
}
.bottomnav-item .icon { width: 24px; height: 24px; }
.bottomnav-item::before {
  content: ""; position: absolute; top: 6px; width: 52px; height: 30px; border-radius: var(--radius-pill);
  background: var(--c-accent-soft); opacity: 0; transform: scale(0.7);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.bottomnav-item > * { position: relative; }
.bottomnav-item:hover { color: var(--c-text); }
.bottomnav-item.is-active { color: var(--c-accent-text); }
.bottomnav-item.is-active::before { opacity: 1; transform: none; }
.bottomnav-item:focus-visible { outline-offset: -4px; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--c-danger); color: var(--c-surface);
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.bottomnav-item .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); }

.fab {
  position: fixed; right: var(--space-4); bottom: calc(var(--bottomnav-h) + var(--space-4) + env(safe-area-inset-bottom)); z-index: var(--z-bar);
  width: 56px; height: 56px; border-radius: var(--radius-pill); border: 0;
  display: grid; place-items: center;
  background: var(--c-primary-strong); color: var(--c-on-primary); box-shadow: var(--shadow-2);
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.fab .icon { width: 26px; height: 26px; }
.fab:hover { filter: brightness(0.94); }
.fab:active { transform: scale(0.94); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.page-head-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.page-head p { color: var(--c-text-muted); font-size: var(--fs-s); }
.page-head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.eyebrow { display: flex; align-items: center; gap: var(--space-2); color: var(--c-text-muted); font-size: var(--fs-s); font-weight: 600; }

/* Etikett für den aktiven Bereich */
.bereich-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--c-accent-soft); color: var(--c-accent-text);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.bereich-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.bereich-tag.is-privat { background: var(--c-primary-soft); color: var(--c-primary-text); }
.bereich-tag.is-privat::before { background: var(--c-primary); }
.bereich-tag.is-betrieb { background: var(--c-betrieb-soft); color: var(--c-betrieb); }
.bereich-tag.is-betrieb::before { background: var(--c-betrieb); }

/* Rechner: Seitenleiste */
@media (min-width: 1024px) {
  .app-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .app-shell > .demo-banner { grid-column: 1 / -1; }
  .app-shell > .topbar { grid-column: 2; grid-row: 2; padding-inline: var(--space-6); }
  .app-shell > .content { grid-column: 2; grid-row: 3; padding: var(--space-6) var(--space-6) var(--space-7); }
  .app-shell > .sidebar { grid-column: 1; grid-row: 2 / span 2; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-4);
    position: sticky; top: 0; align-self: start; height: 100dvh;
    padding: var(--space-5) var(--space-4);
    background: var(--c-surface); border-right: 1px solid var(--c-border);
    overflow-y: auto;
  }
  .sidebar-brand { display: flex; align-items: center; padding: var(--space-1) var(--space-2) var(--space-3); }
  .sidebar-brand img, .sidebar-brand svg { height: 36px; width: auto; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-label { padding: var(--space-4) var(--space-3) var(--space-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-muted); }
  .nav-item {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--tap); padding: 0 var(--space-3);
    border-radius: var(--radius-m);
    color: var(--c-text); font-weight: 550; text-decoration: none;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }
  .nav-item .icon { color: var(--c-text-muted); width: 22px; height: 22px; }
  .nav-item:hover { background: var(--c-surface-2); }
  .nav-item.is-active { background: var(--c-accent-soft); color: var(--c-accent-text); font-weight: 650; }
  .nav-item.is-active .icon { color: var(--c-accent-text); }
  .nav-item .nav-badge { margin-left: auto; }
  .sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-m); background: var(--c-surface-2); }
  .bottomnav, .fab { display: none; }
  .topbar-brand, .topbar-more { display: none; }
  .topbar-search { display: flex; flex: 1 1 auto; max-width: 420px; position: relative; }
  .topbar-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-text-muted); pointer-events: none; }
  .topbar-search .input { padding-left: 42px; border-radius: var(--radius-pill); background: var(--c-surface-2); border-color: transparent; }
  .topbar-switch { flex: none; margin: 0 0 0 auto; width: 300px; }
  .topbar-fixed { flex: none; margin-left: auto; }
  .topbar-actions { margin-left: 0; }
  .toast-region { bottom: var(--space-6) !important; }
}

/* ============ Schaltflächen ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--space-5);
  border: 1.5px solid transparent; border-radius: var(--radius-pill);
  font-size: var(--fs-m); font-weight: 650; line-height: 1; text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--c-text);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn .icon { width: 1.2em; height: 1.2em; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--c-primary-strong); color: var(--c-on-primary); box-shadow: 0 1px 2px rgba(120, 40, 0, 0.18); }
.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { filter: brightness(0.9); }
.btn-primary:focus-visible { box-shadow: var(--focus-ring); }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border-strong); }
.btn-secondary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--c-surface-2); }
.btn-ghost { color: var(--c-primary-text); padding: 0 var(--space-4); }
.btn-ghost:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--c-primary-soft); }
.btn-danger { background: var(--c-danger); color: var(--c-on-primary); }
.btn-danger:hover:not(:disabled):not([aria-disabled="true"]) { filter: brightness(0.9); }
.btn-icon { padding: 0; width: var(--tap); height: var(--tap); border-radius: 50%; color: var(--c-text); }
.btn-icon .icon { width: 22px; height: 22px; }
.btn-icon:hover:not(:disabled) { background: var(--c-surface-2); }
.btn-icon.btn-secondary { border-color: var(--c-border); }
.btn-block { display: flex; width: 100%; }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; color: var(--c-on-primary); animation: spin 0.8s linear infinite; }
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { color: var(--c-text); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ============ Pillen, Chips, Avatar, Herkunft ============ */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 650; white-space: nowrap; line-height: 1;
  background: var(--c-surface-2); color: var(--c-text-muted);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.no-dot::before { display: none; }
.pill-ok { background: var(--c-success-soft); color: var(--c-success); }
.pill-warn { background: var(--c-warning-soft); color: var(--c-warning); }
.pill-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.pill-info { background: var(--c-info-soft); color: var(--c-info); }
.pill-neutral { background: var(--c-surface-2); color: var(--c-text-muted); }
.pill-accent { background: var(--c-primary-soft); color: var(--c-primary-text); }
.pill-betrieb { background: var(--c-betrieb-soft); color: var(--c-betrieb); }

.chip {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2);
  height: 36px; padding: 0 var(--space-4);
  border: 1.5px solid var(--c-border-strong); border-radius: var(--radius-pill);
  background: var(--c-surface); color: var(--c-text); font-size: var(--fs-s); font-weight: 600; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip::after { content: ""; position: absolute; inset: -4px -2px; } /* Trefferfläche mind. 44 px */
.chip:hover { background: var(--c-surface-2); }
.chip.is-active { background: var(--c-accent-soft); border-color: var(--c-accent-strong); color: var(--c-accent-text); }
.chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-1) 2px; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
.chip-row::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .chip-row { margin-inline: 0; padding-inline: 2px; flex-wrap: wrap; overflow: visible; } }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-surface-2); color: var(--c-text); font-size: var(--fs-s); font-weight: 700; letter-spacing: 0.02em; user-select: none;
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--fs-m); }
.avatar-1 { background: #FFE3D0; color: #7A2E00; }
.avatar-2 { background: #D8EEF0; color: #0B4A50; }
.avatar-3 { background: #E3E6FB; color: #2B3A8C; }
.avatar-4 { background: #E4F3DA; color: #2D5B14; }
.avatar-5 { background: #F8E1EE; color: #7C1F57; }
.avatar-6 { background: #EFE7D6; color: #5F4A12; }

.src-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; line-height: 1; white-space: nowrap;
  background: var(--c-surface-2); color: var(--c-text-muted);
}
.src-badge .icon { width: 12px; height: 12px; }
.src-ki { background: var(--c-info-soft); color: var(--c-info); }
.src-regel { background: var(--c-surface-2); color: var(--c-text-muted); box-shadow: inset 0 0 0 1px var(--c-border); }
.src-hand { background: var(--c-primary-soft); color: var(--c-primary-text); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar-1 { background: #4A2A18; color: #FFC9A6; }
  :root:not([data-theme="light"]) .avatar-2 { background: #123A3F; color: #A9E3E8; }
  :root:not([data-theme="light"]) .avatar-3 { background: #262C55; color: #C6CCFF; }
  :root:not([data-theme="light"]) .avatar-4 { background: #24391A; color: #C2EBA6; }
  :root:not([data-theme="light"]) .avatar-5 { background: #4A1E3A; color: #F6BFE0; }
  :root:not([data-theme="light"]) .avatar-6 { background: #3C3216; color: #EBD79B; }
}
:root[data-theme="dark"] .avatar-1 { background: #4A2A18; color: #FFC9A6; }
:root[data-theme="dark"] .avatar-2 { background: #123A3F; color: #A9E3E8; }
:root[data-theme="dark"] .avatar-3 { background: #262C55; color: #C6CCFF; }
:root[data-theme="dark"] .avatar-4 { background: #24391A; color: #C2EBA6; }
:root[data-theme="dark"] .avatar-5 { background: #4A1E3A; color: #F6BFE0; }
:root[data-theme="dark"] .avatar-6 { background: #3C3216; color: #EBD79B; }

/* ============ Karte ============ */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-l);
  box-shadow: var(--shadow-1); padding: var(--space-5); min-width: 0;
}
.card.is-flat { box-shadow: none; }
.card.is-flush { padding: 0; overflow: hidden; }
.card.is-accent { border-color: var(--c-accent-strong); box-shadow: 0 0 0 1px var(--c-accent-strong), var(--shadow-1); }
.card.is-alert { background: var(--c-danger-soft); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card.is-flush > .card-head { padding: var(--space-4) var(--space-4) 0; margin-bottom: var(--space-2); }
.card-head h2, .card-head h3 { font-size: var(--fs-m); font-weight: 650; }
.card-head .btn-ghost { margin-right: calc(var(--space-4) * -1); }

/* ============ Listen im Banking-Stil ============ */
.list-group-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-1) var(--space-2);
  font-size: var(--fs-s); font-weight: 650; color: var(--c-text-muted);
  position: sticky; top: calc(var(--topbar-h) + 3px); z-index: 2; background: var(--c-bg);
}
.list-group-title .amount { font-size: var(--fs-s); color: var(--c-text-muted); font-weight: 600; }
.list-group {
  list-style: none; margin: 0; padding: 0; min-width: 0;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-l); overflow: hidden;
}
.list-group > * + * { border-top: 1px solid var(--c-border); }
.list-row {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  min-height: 68px; padding: var(--space-3) var(--space-4);
  width: 100%; text-align: left; text-decoration: none; color: inherit;
  background: transparent; border: 0; border-radius: 0;
  transition: background var(--dur-fast) var(--ease);
}
a.list-row, button.list-row, .list-row.is-link { cursor: pointer; }
a.list-row:hover, button.list-row:hover, .list-row.is-link:hover { background: var(--c-surface-2); }
a.list-row:active, button.list-row:active { background: var(--c-border); }
.list-row:focus-visible { outline: 3px solid var(--c-primary-strong); outline-offset: -3px; border-radius: 0; }
.list-row.is-selected { background: var(--c-accent-soft); }
.list-row.is-overdue::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c-danger); }
.list-row-icon {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-accent-soft); color: var(--c-accent-text);
}
.list-row-icon .icon { width: 20px; height: 20px; }
.list-row-icon.is-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.list-row-icon.is-ok { background: var(--c-success-soft); color: var(--c-success); }
.list-row-icon.is-warn { background: var(--c-warning-soft); color: var(--c-warning); }
.list-row-icon.is-info { background: var(--c-info-soft); color: var(--c-info); }
.list-row-icon.is-neutral { background: var(--c-surface-2); color: var(--c-text-muted); }
.list-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row-title { font-size: var(--fs-m); font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.list-row-title.is-wrap { display: block; -webkit-line-clamp: unset; }
.list-row-title.is-nowrap { display: block; white-space: nowrap; }
.list-row-sub { font-size: var(--fs-s); color: var(--c-text-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub.is-wrap { white-space: normal; }
.list-row-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; max-width: 44%; }
.list-row-chevron { flex: none; color: var(--c-text-muted); width: 18px; height: 18px; }
.list-row .checkbox { flex: none; min-width: var(--tap); justify-content: center; margin-inline: calc(var(--space-3) * -1) calc(var(--space-2) * -1); }

.amount { font-size: var(--fs-m); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; color: var(--c-text); }
.amount-neg { color: var(--c-danger); }
.amount-pos { color: var(--c-success); }
.amount.is-big { font-size: var(--fs-xl); font-weight: 700; }
.amount small { font-size: 0.75em; font-weight: 600; opacity: 0.8; }

/* ============ Formulare ============ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-s); font-weight: 600; color: var(--c-text); }
.field-hint { font-size: var(--fs-xs); color: var(--c-text-muted); }
.field-error { font-size: var(--fs-xs); color: var(--c-danger); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 0 var(--space-4);
  font-size: 1rem; /* 16 px: verhindert Zoomen auf dem iPhone */
  background: var(--c-surface); color: var(--c-text);
  border: 1.5px solid var(--c-border-strong); border-radius: var(--radius-m);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-muted); opacity: 0.85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--c-primary-strong); box-shadow: 0 0 0 3px var(--c-primary-soft), 0 0 0 4.5px var(--c-primary-strong); border-radius: var(--radius-m); }
.input[aria-invalid="true"], .is-invalid > .input, .is-invalid > .select { border-color: var(--c-danger); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--c-surface-2); color: var(--c-text-muted); cursor: not-allowed; }
.textarea { min-height: 112px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: var(--lh-body); }
.select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237B8090' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.input-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; font-size: var(--fs-l); }
.input-group { display: flex; align-items: stretch; gap: var(--space-2); }
.input-group .input { flex: 1; }
.form-grid { display: grid; gap: var(--space-4); }
@media (min-width: 640px) { .form-grid.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.checkbox, .switch { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); cursor: pointer; font-size: var(--fs-m); position: relative; }
.checkbox input, .checkbox-box {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--c-border-strong); background: var(--c-surface);
  display: inline-grid; place-content: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.checkbox input[type="radio"] { border-radius: 50%; }
.checkbox input::after {
  content: ""; width: 16px; height: 16px; background: var(--c-on-primary); opacity: 0; transform: scale(0.6);
  -webkit-mask: var(--check-mask) center / contain no-repeat; mask: var(--check-mask) center / contain no-repeat;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.checkbox { --check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.checkbox input[type="radio"]::after { width: 10px; height: 10px; border-radius: 50%; -webkit-mask: none; mask: none; }
.checkbox input:hover { border-color: var(--c-text-muted); }
.checkbox input:checked, .checkbox input:indeterminate { background: var(--c-primary-strong); border-color: var(--c-primary-strong); }
.checkbox input:checked::after, .checkbox input:indeterminate::after { opacity: 1; transform: none; }
.checkbox input:indeterminate::after { -webkit-mask: none; mask: none; width: 10px; height: 3px; border-radius: 2px; }
.checkbox input:focus-visible, .switch input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.checkbox input:disabled { opacity: 0.45; cursor: not-allowed; }
.checkbox:has(input:disabled) { cursor: not-allowed; color: var(--c-text-muted); }
.checkbox-text { display: flex; flex-direction: column; gap: 1px; }
.checkbox-text small { color: var(--c-text-muted); font-size: var(--fs-s); }
.betrieb-check input:checked { background: var(--c-betrieb); border-color: var(--c-betrieb); }

.switch input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 50px; height: 30px; border-radius: var(--radius-pill); background: var(--c-border-strong); position: relative;
  transition: background var(--dur-med) var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform var(--dur-med) var(--ease);
}
.switch input:checked { background: var(--c-primary-strong); }
.switch input:checked::after { transform: translateX(20px); background: var(--c-on-primary); }
.switch input:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============ Umschalter, Tabs ============ */
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--radius-pill); background: var(--c-surface-2); width: 100%; }
.segmented-option {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--c-text-muted); font-size: var(--fs-s); font-weight: 650; white-space: nowrap; text-decoration: none;
  transition: background var(--dur-med) var(--ease), color var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}
.segmented-option:hover:not(.is-active) { color: var(--c-text); }
.segmented-option.is-active, .segmented-option[aria-selected="true"], .segmented-option[aria-pressed="true"] { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-1); }
.segmented-option:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.segmented-option .icon { width: 18px; height: 18px; }
/* Bereichs-Umschalter: der aktive Bereich ist farbig gefüllt */
.segmented-bereich { width: 100%; }
.segmented-bereich .segmented-option::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.segmented-bereich .segmented-option.is-active::before { opacity: 1; background: currentColor; }
.segmented-bereich .segmented-option[data-bereich="privat"].is-active { background: var(--c-primary-strong); color: var(--c-on-primary); box-shadow: none; }
.segmented-bereich .segmented-option[data-bereich="betrieb"].is-active { background: var(--c-betrieb); color: var(--c-on-primary); box-shadow: none; }
/* Nur ein Bereich erlaubt: kein Umschalter, nur festes Etikett (siehe .bereich-tag) */

.tabs { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--c-border); scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 var(--space-4);
  background: none; border: 0; color: var(--c-text-muted); font-weight: 650; font-size: var(--fs-s); white-space: nowrap; text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.tab::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--c-accent-strong); transform: scaleX(0); transition: transform var(--dur-med) var(--ease); }
.tab:hover { color: var(--c-text); }
.tab.is-active, .tab[aria-selected="true"] { color: var(--c-accent-text); }
.tab.is-active::after, .tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -4px; }
.tab .count { font-size: var(--fs-xs); background: var(--c-surface-2); color: var(--c-text-muted); padding: 1px 7px; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums; }
@media (min-width: 1024px) { .tabs { margin-inline: 0; padding-inline: 0; } }

/* ============ Kennzahlen, Balken ============ */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: var(--space-4); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-l); box-shadow: var(--shadow-1); min-width: 0; }
.kpi-label { font-size: var(--fs-s); color: var(--c-text-muted); font-weight: 550; line-height: 1.3; }
.kpi-value { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-family: var(--font-num); overflow-wrap: anywhere; }
.kpi-sub { font-size: var(--fs-xs); color: var(--c-text-muted); }
.kpi-grid .kpi-value { font-size: var(--fs-l); white-space: nowrap; }
@media (min-width: 1024px) { .kpi-grid .kpi-value { font-size: var(--fs-xl); } }
.kpi.is-danger { background: var(--c-danger-soft); border-color: transparent; }
.kpi.is-danger .kpi-value { color: var(--c-danger); }
.kpi.is-ok .kpi-value { color: var(--c-success); }
.kpi.is-warn .kpi-value { color: var(--c-warning); }
.kpi.is-hero { background: linear-gradient(150deg, var(--c-primary-strong), color-mix(in srgb, var(--c-primary-strong) 78%, #000)); border-color: transparent; color: var(--c-on-primary); }
.kpi.is-hero .kpi-label, .kpi.is-hero .kpi-sub { color: inherit; opacity: 0.92; }
.kpi.is-hero .kpi-value { font-size: var(--fs-xxl); }
body[data-bereich="betrieb"] .kpi.is-hero, .scope-betrieb .kpi.is-hero { background: linear-gradient(150deg, var(--c-betrieb), color-mix(in srgb, var(--c-betrieb) 78%, #000)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.is-hero { background: linear-gradient(150deg, #FF9A62, #E7743A); } :root:not([data-theme="light"]) body[data-bereich="betrieb"] .kpi.is-hero { background: linear-gradient(150deg, #6FD3DA, #3FA9B1); } }

.bar { height: 10px; border-radius: var(--radius-pill); background: var(--c-border); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; min-width: 0; border-radius: inherit; background: var(--c-accent-strong); transition: width var(--dur-med) var(--ease), background var(--dur-med) var(--ease); }
.bar.is-ok .bar-fill { background: var(--c-success); }
.bar.is-warn .bar-fill { background: var(--c-warning-bar); }   /* ab 90 % */
.bar.is-over .bar-fill { background: var(--c-danger); }        /* über 100 % */
.bar-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--fs-s); margin-bottom: 6px; }
.bar-meta .num { font-weight: 650; }
.bar-note { margin-top: 6px; font-size: var(--fs-xs); color: var(--c-text-muted); }
.bar.is-warn + .bar-note, .bar.is-over + .bar-note { color: var(--c-text); font-weight: 600; }
.pot { display: flex; flex-direction: column; gap: 2px; padding: var(--space-4); }
.pot + .pot { border-top: 1px solid var(--c-border); }

/* ============ Hinweise ============ */
.notice {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m); background: var(--c-info-soft); color: var(--c-text); font-size: var(--fs-s); line-height: 1.45;
}
.notice > .icon { color: var(--c-info); width: 20px; height: 20px; margin-top: 1px; }
.notice strong { font-weight: 650; }
.notice-warn { background: var(--c-warning-soft); }
.notice-warn > .icon { color: var(--c-warning); }
.notice-danger { background: var(--c-danger-soft); }
.notice-danger > .icon { color: var(--c-danger); }
.notice-ok { background: var(--c-success-soft); }
.notice-ok > .icon { color: var(--c-success); }
.notice-legal { background: var(--c-surface-2); border: 1px solid var(--c-border); border-left: 4px solid var(--c-text-muted); color: var(--c-text); }
.notice-legal > .icon { color: var(--c-text-muted); }
.notice .btn { margin-top: var(--space-2); }

/* ============ Overlays: Sheet (Handy) / Modal (Rechner) ============ */
.overlay { position: fixed; inset: 0; z-index: var(--z-overlay); background: var(--c-overlay); opacity: 0; visibility: hidden; transition: opacity var(--dur-med) var(--ease), visibility 0s linear var(--dur-med); }
.overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.sheet, .modal {
  position: fixed; z-index: calc(var(--z-overlay) + 1); background: var(--c-surface); color: var(--c-text);
  display: flex; flex-direction: column; box-shadow: var(--shadow-2);
  visibility: hidden; opacity: 0; transition: transform var(--dur-med) var(--ease), opacity var(--dur-med) var(--ease), visibility 0s linear var(--dur-med);
}
.sheet.is-open, .modal.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.sheet {
  left: 0; right: 0; bottom: 0; max-height: 90dvh; border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding-bottom: env(safe-area-inset-bottom); transform: translateY(40px);
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--c-border-strong); margin: 10px 0 2px; flex: none; }
.modal {
  left: 50%; top: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(86dvh, 760px);
  border-radius: var(--radius-l); transform: translate(-50%, calc(-50% + 16px));
}
.modal.is-open { transform: translate(-50%, -50%); }
.modal.is-wide { width: min(760px, calc(100vw - 32px)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-5) var(--space-3); }
.sheet-head h2 { font-size: var(--fs-l); }
.sheet-body { padding: var(--space-2) var(--space-5) var(--space-5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); min-height: 0; }
.sheet-foot { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-5); border-top: 1px solid var(--c-border); }
.sheet-foot .btn { flex: 1; }
@media (min-width: 768px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(560px, calc(100vw - 32px)); max-height: min(86dvh, 760px); border-radius: var(--radius-l); padding-bottom: 0; transform: translate(-50%, calc(-50% + 16px)); }
  .sheet.is-open { transform: translate(-50%, -50%); }
  .sheet::before { display: none; }
}
/* Vorschau im Styleguide/Entwurf: ohne Überlagerung */
.sheet.is-static, .modal.is-static { position: relative; inset: auto; transform: none; visibility: visible; opacity: 1; width: auto; max-width: 560px; max-height: none; border: 1px solid var(--c-border); box-shadow: var(--shadow-1); border-radius: var(--radius-l); left: auto; top: auto; }
.sheet.is-static::before { display: block; }

/* ============ Toast, Demo-Banner ============ */
.toast-region { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--bottomnav-h) + var(--space-3) + env(safe-area-inset-bottom)); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); max-width: 480px; width: 100%;
  min-height: 52px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-radius: var(--radius-m); background: var(--c-text); color: var(--c-bg); box-shadow: var(--shadow-2); font-size: var(--fs-s); font-weight: 550;
  animation: toast-in var(--dur-med) var(--ease) both;
}
.toast > .icon { color: var(--c-success); filter: brightness(1.3); }
.toast-err > .icon { color: var(--c-danger); filter: brightness(1.2); }
.toast .btn { color: var(--c-bg); min-height: var(--tap); margin-left: auto; padding: 0 var(--space-3); }
.toast .btn:hover { background: rgba(255, 255, 255, 0.12); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast.is-static { animation: none; }

.demo-banner {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); flex-wrap: wrap; text-align: center;
  padding: var(--space-2) var(--space-4); min-height: 36px;
  background: repeating-linear-gradient(-45deg, var(--c-warning-soft), var(--c-warning-soft) 14px, color-mix(in srgb, var(--c-warning-soft) 82%, var(--c-warning)) 14px, color-mix(in srgb, var(--c-warning-soft) 82%, var(--c-warning)) 28px);
  color: var(--c-warning); font-size: var(--fs-s); font-weight: 650; border-bottom: 1px solid var(--c-border);
}
.demo-banner .icon { width: 16px; height: 16px; }

/* ============ Ladezustand, leere Zustände ============ */
.skeleton, .skeleton-line, .skeleton-circle {
  display: block; background: linear-gradient(100deg, var(--c-surface-2) 30%, var(--c-border) 50%, var(--c-surface-2) 70%); background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite; border-radius: var(--radius-s);
}
.skeleton-line { height: 14px; width: 100%; }
.skeleton-line.is-short { width: 55%; }
.skeleton-line.is-mid { width: 75%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skeleton-card { height: 96px; border-radius: var(--radius-l); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-7) var(--space-5); }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-text); }
.empty-icon .icon { width: 32px; height: 32px; }
.empty h2, .empty h3 { font-size: var(--fs-l); }
.empty p { color: var(--c-text-muted); max-width: 36ch; }

/* ============ Zusatz: Zeitleiste, Upload, Auswahl, Tabelle, Anmeldung ============ */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline-item { position: relative; display: flex; gap: var(--space-3); padding-bottom: var(--space-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--c-border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--c-surface-2); color: var(--c-text-muted); position: relative; z-index: 1; }
.timeline-dot .icon { width: 18px; height: 18px; }
.timeline-item.is-letter .timeline-dot { background: var(--c-info-soft); color: var(--c-info); }
.timeline-item.is-status .timeline-dot { background: var(--c-accent-soft); color: var(--c-accent-text); }
.timeline-item.is-payment .timeline-dot { background: var(--c-success-soft); color: var(--c-success); }
.timeline-item.is-own .timeline-dot { background: var(--c-primary-soft); color: var(--c-primary-text); }
.timeline-item.is-warn .timeline-dot { background: var(--c-warning-soft); color: var(--c-warning); }
.timeline-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.timeline-title { font-weight: 600; }
.timeline-meta { font-size: var(--fs-xs); color: var(--c-text-muted); }
.timeline-text { font-size: var(--fs-s); color: var(--c-text-muted); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); text-align: center;
  padding: var(--space-6) var(--space-5); border: 2px dashed var(--c-border-strong); border-radius: var(--radius-l); background: var(--c-surface);
  transition: border-color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--c-accent-strong); background: var(--c-accent-soft); }
.dropzone-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-text); }
.dropzone-icon .icon { width: 30px; height: 30px; }
.dropzone-title { font-weight: 650; font-size: var(--fs-l); }

.selection-bar {
  position: sticky; bottom: calc(var(--bottomnav-h) + var(--space-3) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-l);
  background: var(--c-text); color: var(--c-bg); box-shadow: var(--shadow-2);
}
.selection-bar .amount { color: inherit; font-size: var(--fs-l); }
.selection-bar .btn-primary { background: var(--c-primary); color: #1A0B00; }
@media (min-width: 1024px) { .selection-bar { bottom: var(--space-5); } }

.table-wrap { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius-l); background: var(--c-surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.table th, .table td { padding: var(--space-2) var(--space-4); text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table th { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-muted); letter-spacing: 0.04em; text-transform: uppercase; background: var(--c-surface-2); }
.table tbody th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: var(--fs-s); font-weight: 600; color: var(--c-text); background: none; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; width: 92px; }
.matrix .checkbox { justify-content: center; min-width: var(--tap); }

.preview {
  display: grid; place-items: center; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-l); padding: var(--space-5); min-height: 280px;
}
.paper {
  width: 100%; max-width: 360px; aspect-ratio: 210 / 297; background: #fff; color: #333; border-radius: 4px; padding: 7% 8%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.14); display: flex; flex-direction: column; gap: 9px;
}
.paper i { display: block; height: 7px; border-radius: 4px; background: #D9D9DE; }
.paper i.w60 { width: 60%; } .paper i.w40 { width: 40%; } .paper i.w80 { width: 80%; } .paper i.dark { background: #8E8E98; } .paper i.gap { background: none; height: 10px; }
.paper i.stamp { background: #F5C9AC; height: 22px; width: 38%; align-self: flex-end; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5) var(--space-4); background: radial-gradient(1000px 520px at 50% -10%, var(--c-primary-soft), transparent 70%), var(--c-bg); }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--space-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-l); box-shadow: var(--shadow-2); padding: var(--space-6) var(--space-5); }
.auth-logo { display: flex; justify-content: center; }
.auth-logo img { height: 44px; width: auto; }
.pin-dots { display: flex; justify-content: center; gap: var(--space-3); }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c-border-strong); transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.pin-dot.is-filled { background: var(--c-primary-strong); border-color: var(--c-primary-strong); }
.pin-dots.is-error .pin-dot { border-color: var(--c-danger); background: var(--c-danger); animation: shake 0.4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: var(--space-3) var(--space-5); }
.pin-key { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--c-surface-2); font-size: var(--fs-xl); font-weight: 600; display: grid; place-items: center; color: var(--c-text); transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.pin-key:hover { background: var(--c-border); }
.pin-key:active { transform: scale(0.94); }
.pin-key:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pin-key.is-ghost { background: none; font-size: var(--fs-s); font-weight: 650; color: var(--c-primary-text); }
.steps { display: flex; gap: var(--space-2); justify-content: center; }
.step { height: 6px; flex: 1; max-width: 56px; border-radius: 3px; background: var(--c-border); }
.step.is-done { background: var(--c-accent-strong); }
.divider-label { display: flex; align-items: center; gap: var(--space-3); color: var(--c-text-muted); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.kv { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-2) var(--space-4); font-size: var(--fs-s); margin: 0; }
.kv dt { color: var(--c-text-muted); } .kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.copybox { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); background: var(--c-surface-2); border: 1px dashed var(--c-border-strong); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-s); overflow-wrap: anywhere; }

/* ============ Bewegung reduzieren ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .skeleton, .skeleton-line, .skeleton-circle { animation: none; background: var(--c-surface-2); }
}

/* Hoher Kontrast / Windows-Kontrastmodus */
@media (forced-colors: active) {
  .btn, .chip, .input, .select, .textarea, .card, .list-group, .kpi { border: 1px solid CanvasText; }
  .btn-primary { background: Highlight; color: HighlightText; }
}
@media print { .topbar, .sidebar, .bottomnav, .fab, .toast-region, .demo-banner { display: none !important; } body { background: #fff; } }
