/* ==========================================================================
   Cevi Drive · Design-System
   Ruhig, offiziell, vertrauenswürdig: Cevi-Blau als einzige Leitfarbe,
   Cevi-Rot nur als Markenakzent, kühle Graustufen, klare Hierarchie.
   ========================================================================== */

:root {
  /* Flächen */
  --canvas: #f3f5f9;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --surface-subtle: #f8f9fc;
  --surface-brand: #f2f6fc;

  /* Schrift */
  --ink: #0c1a30;
  --ink-soft: #4a5872;
  --ink-faint: #6b778d;

  /* Linien */
  --line: #dfe5ee;
  --line-strong: #c3cddc;

  /* Marke */
  --brand: #003d8f;
  --brand-hover: #002d6b;
  --brand-deep: #00265a;
  --brand-soft: color-mix(in srgb, var(--brand) 8%, transparent);
  --brand-line: color-mix(in srgb, var(--brand) 26%, var(--line));
  --accent: #e20031;
  --on-brand: #ffffff;

  /* Status */
  --positive: #0a6b40;
  --warning: #9a5506;
  --negative: #b4233a;

  /* Form */
  --radius-lg: 14px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(12, 30, 60, 0.05);
  --shadow: 0 1px 2px rgba(12, 30, 60, 0.04), 0 8px 24px -12px rgba(12, 30, 60, 0.12);
  --shadow-lg: 0 2px 4px rgba(12, 30, 60, 0.04), 0 24px 48px -20px rgba(12, 30, 60, 0.22);

  /* Raster */
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0a1220;
    --surface: #111b2c;
    --surface-muted: #182437;
    --surface-subtle: #0f1828;
    --surface-brand: #13213a;
    --ink: #eef2f8;
    --ink-soft: #a5b3c9;
    --ink-faint: #8090a8;
    --line: #23324a;
    --line-strong: #34476a;
    --brand: #7fb1ff;
    --brand-hover: #a6c9ff;
    --brand-deep: #0c1f40;
    --brand-soft: color-mix(in srgb, var(--brand) 13%, transparent);
    --brand-line: color-mix(in srgb, var(--brand) 32%, var(--line));
    --accent: #ff5c7c;
    --on-brand: #06101f;
    --positive: #5fd39a;
    --warning: #f0b95e;
    --negative: #ff8599;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px -12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 56px -20px rgba(0, 0, 0, 0.6);
  }
}

/* --------------------------------------------------------------------------
   Basis
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color-scheme: light dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--canvas);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.16s var(--ease);
}

a:hover {
  color: var(--brand-hover);
}

img,
svg {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 12px;
}

.sim-banner {
  padding: 7px 16px;
  background: repeating-linear-gradient(-45deg, #8a5a00, #8a5a00 12px, #7a4f00 12px, #7a4f00 24px);
  color: #ffffff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Kopfbereich
   -------------------------------------------------------------------------- */
.top-strip {
  border-top: 3px solid var(--accent);
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.top-strip-inner,
.header-bar,
main,
.footer-inner,
.footer-bottom {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.top-strip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 32px;
}

.top-strip-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-strip-secure .icon {
  width: 14px;
  height: 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
}

.header-bar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-org {
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 500;
}

.brand-small img {
  width: 32px;
  height: 32px;
}

.brand-small .brand-name {
  font-size: 1rem;
}

.header-help {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--surface-muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.nav-list a:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.nav-list a[aria-current="page"] {
  color: var(--brand);
}

.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: -16px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 10px;
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--line);
}

.nav-user-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.nav-user-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

.nav-list .nav-logout-link {
  color: var(--ink-faint);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Inhalt & Fusszeile
   -------------------------------------------------------------------------- */
main {
  flex: 1 0 auto;
  padding-block: clamp(32px, 5vw, 56px) clamp(56px, 7vw, 88px);
}

main:focus {
  outline: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding-block: 40px 28px;
}

.footer-brand p {
  max-width: 42ch;
  margin: 14px 0 0;
}

.footer-col h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-col ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Typografie
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 650;
}

p {
  margin: 0 0 14px;
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

.prose {
  max-inline-size: 68ch;
}

.prose li + li {
  margin-top: 6px;
}

article.prose h2 {
  margin-top: 28px;
}

article.prose h2:first-child {
  margin-top: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.page-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin-bottom: 10px;
}

.page-heading .muted {
  margin-bottom: 0;
  font-size: 1.04rem;
  line-height: 1.65;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Karten & Layout
   -------------------------------------------------------------------------- */
.card {
  margin-bottom: 20px;
  padding: clamp(20px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card > :last-child {
  margin-bottom: 0;
}

.card-subtle {
  background: var(--surface-subtle);
  box-shadow: none;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.section-heading > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.section-heading p {
  margin-bottom: 0;
}

.section-title {
  margin: clamp(40px, 6vw, 64px) 0 20px;
}

.section-title h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  letter-spacing: -0.02em;
}

.section-title p {
  max-width: 62ch;
  margin-bottom: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mt-sm {
  margin-top: 12px;
}

.mt-md {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Startseite (nicht angemeldet)
   -------------------------------------------------------------------------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.hero-lead {
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.4vw, 1.14rem);
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.hero-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 52ch;
  margin: 24px 0 0;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.hero-note .icon {
  margin-top: 3px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.trust-panel {
  position: relative;
  margin: 0;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.trust-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--brand) 0 70%, var(--accent) 70% 100%);
}

.trust-panel h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.trust-panel > p {
  margin-bottom: 18px;
}

.trust-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.trust-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.trust-icon .icon {
  width: 18px;
  height: 18px;
}

.trust-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.trust-item span {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Ablauf in drei Schritten */
.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  counter-increment: step;
}

.process-step + .process-step {
  border-inline-start: 1px solid var(--line);
}

.process-step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.process-step h3 {
  font-size: 1.04rem;
}

.process-step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Häufige Fragen */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 48px);
  margin: 0;
}

.faq-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.faq-item dt {
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 650;
}

.faq-item dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

/* Bestehende Hero-/Step-Klassen (Rückwärtskompatibilität) */
.hero {
  padding: clamp(28px, 5.5vw, 56px);
}

.hero-inner {
  max-width: 640px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.step-card {
  margin-bottom: 0;
  padding: 20px;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Fortschritt (angemeldet)
   -------------------------------------------------------------------------- */
.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.stepper-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.stepper-item + .stepper-item {
  border-inline-start: 1px solid var(--line);
}

.stepper-item::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: transparent;
}

.stepper-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stepper-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.stepper-title {
  font-weight: 650;
  color: var(--ink-soft);
}

.stepper-sub {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.stepper-item.is-active {
  background: var(--surface-brand);
}

.stepper-item.is-active::after {
  background: var(--brand);
}

.stepper-item.is-active .stepper-badge {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.stepper-item.is-active .stepper-title {
  color: var(--brand);
}

.stepper-item.is-done::after {
  background: var(--positive);
}

.stepper-item.is-done .stepper-badge {
  border-color: color-mix(in srgb, var(--positive) 50%, var(--line));
  background: color-mix(in srgb, var(--positive) 12%, transparent);
  color: var(--positive);
}

.stepper-item.is-done .stepper-title {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Hinweise & Konten
   -------------------------------------------------------------------------- */
.callout-info {
  position: relative;
  padding: 14px 16px 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-line);
  border-inline-start: 4px solid var(--brand);
  background: var(--surface-brand);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.6;
}

.account-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.account-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.btn:hover {
  color: var(--on-brand);
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 60%, transparent);
}

.btn:active {
  transform: translateY(1px);
}

.btn.lg {
  min-height: 52px;
  padding: 12px 26px;
  font-size: 1rem;
}

.btn.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn.secondary:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn.danger-ghost {
  color: var(--negative);
  background: transparent;
  border-color: color-mix(in srgb, var(--negative) 32%, var(--line));
  box-shadow: none;
}

.btn.danger-ghost:hover {
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 7%, transparent);
  border-color: var(--negative);
}

.btn.danger {
  color: #ffffff;
  background: var(--negative);
  border-color: var(--negative);
}

.btn.danger:hover {
  color: #ffffff;
  background: color-mix(in srgb, var(--negative) 86%, #000000);
  border-color: color-mix(in srgb, var(--negative) 86%, #000000);
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn.small {
  min-height: 36px;
  padding: 6px 13px;
  font-size: 0.85rem;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.btn.is-loading::before {
  content: "";
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@media (prefers-color-scheme: dark) {
  .btn.danger,
  .btn.danger:hover {
    color: #1a0509;
  }
}

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  align-items: start;
}

/* Button-Spalte auf Höhe der Eingabefelder (Label + Abstand), auch wenn ein Feld einen Hinweis hat */
.form-grid > div:not(.field) {
  padding-top: calc(0.88rem * 1.6 + 6px);
}

.form-grid > div:not(.field) .btn {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
label.field-label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.field-hint {
  color: var(--ink-faint);
  font-size: 0.84rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-inline .field {
  flex: 1 1 260px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: max(1rem, 1em);
  outline: 0;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong));
}

input[type="hidden"] {
  display: none;
}

input::placeholder {
  color: var(--ink-faint);
  opacity: 0.8;
}

input:user-invalid,
select:user-invalid {
  border-color: var(--negative);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.btn:focus-visible {
  border-radius: var(--radius-sm);
}

.errorlist {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--negative);
  font-size: 0.84rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Meldungen & Badges
   -------------------------------------------------------------------------- */
.messages {
  margin-bottom: 24px;
}

.msg {
  margin-bottom: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
}

.msg.success {
  border-inline-start-color: var(--positive);
}

.msg.warning {
  border-inline-start-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 6%, var(--surface));
}

.msg.error {
  border-inline-start-color: var(--negative);
  background: color-mix(in srgb, var(--negative) 5%, var(--surface));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 9px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge.ok {
  color: var(--positive);
  border-color: color-mix(in srgb, var(--positive) 32%, var(--line));
  background: color-mix(in srgb, var(--positive) 9%, transparent);
}

.badge.ok::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.warn {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 36%, var(--line));
  background: color-mix(in srgb, var(--warning) 9%, transparent);
}

.badge.brand {
  color: var(--brand);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

a.badge {
  text-decoration: none;
}

a.badge:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Tabellen
   -------------------------------------------------------------------------- */
.table-wrap {
  container-type: inline-size;
  overflow-x: auto;
  max-inline-size: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.14s var(--ease);
}

tbody tr:hover {
  background: var(--surface-subtle);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.actions-cell,
th.actions-cell {
  text-align: right;
  white-space: nowrap;
}

@container (max-width: 580px) {
  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table tr:last-child {
    border-bottom: 0;
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--ink-faint);
    font-size: 0.78rem;
    font-weight: 600;
    flex: 0 0 auto;
  }

  .responsive-table td > * {
    text-align: right;
  }

  .responsive-table td .drive-links {
    justify-content: flex-end;
  }

  .responsive-table td.actions-cell {
    justify-content: flex-start;
    padding-top: 10px;
  }

  .responsive-table td.actions-cell::before {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Drive-Links & Code
   -------------------------------------------------------------------------- */
.drive-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drive-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--brand);
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.drive-pill:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.drive-pill .icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

code {
  padding: 2px 6px;
  color: var(--brand);
  background: var(--surface-muted);
  border-radius: 5px;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Kennzahlen & Protokolle (Verwaltung)
   -------------------------------------------------------------------------- */
.connection-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  position: relative;
  display: flex;
  min-height: 120px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.stat-link:hover {
  color: var(--ink);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.stat-link:hover .stat-label {
  color: var(--brand);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.16s var(--ease);
}

.log-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.45fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.log-list {
  border-top: 1px solid var(--line);
}

.log-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.log-entry[hidden] {
  display: none;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.log-summary {
  display: flex;
  min-width: 112px;
  gap: 8px;
  align-items: flex-end;
  flex-direction: column;
  text-align: right;
  font-size: 0.82rem;
}

.status-ok .status-badge {
  color: var(--positive);
}

.status-failed .status-badge,
.log-error {
  color: var(--negative);
}

.status-running .status-badge {
  color: var(--brand);
}

.status-aborted .status-badge {
  color: var(--warning);
}

.log-error {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.log-entry details {
  margin-top: 8px;
}

.log-entry summary {
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.change-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   Simulation
   -------------------------------------------------------------------------- */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.persona-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Events & Lager
   -------------------------------------------------------------------------- */
.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.filter-pill {
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.filter-pill:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.filter-pill[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}

.person-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.person-filter-row input {
  max-width: 320px;
}

.series-section {
  margin-bottom: 36px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.series-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.series-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.series-header h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.year-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.year-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.year-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archived-years {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.year-create-form {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-input {
  width: 100px;
  min-height: 36px;
  padding: 5px 10px;
}

.year-create-form .btn {
  flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   Admin-Karten
   -------------------------------------------------------------------------- */
.admin-section {
  margin-bottom: 26px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}

.admin-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.admin-card p {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Bestätigungsdialog
   -------------------------------------------------------------------------- */
.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(6, 16, 34, 0.32);
}

.confirm-dialog[open] {
  animation: dialog-in 0.2s var(--ease);
}

.confirm-dialog::backdrop {
  background: rgba(6, 16, 34, 0.5);
  backdrop-filter: blur(3px);
}

.confirm-dialog-body {
  padding: 26px;
}

.confirm-dialog-body h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.confirm-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* --------------------------------------------------------------------------
   Combobox
   -------------------------------------------------------------------------- */
.combobox-wrap {
  position: relative;
}

.combobox-list {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline: 0;
  z-index: 30;
  max-block-size: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.combobox-list[hidden] {
  display: none;
}

.combobox-option {
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.94rem;
}

.combobox-option:hover,
.combobox-option.is-focused {
  background: var(--brand-soft);
  color: var(--brand);
}

.combobox-option[aria-selected="true"] {
  font-weight: 650;
}

.combobox-empty {
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Leerzustände & Hilfsklassen
   -------------------------------------------------------------------------- */
.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 4px;
}

p.empty-state {
  margin-bottom: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-card {
  max-width: 560px;
}

.simple-list {
  margin: 0;
  padding-left: 20px;
}

.simple-list li + li {
  margin-top: 6px;
}

/* Hilfe-Seite */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.help-grid .card {
  margin-bottom: 0;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.card-icon .icon {
  width: 20px;
  height: 20px;
}

.steps-list {
  margin: 0;
  padding-left: 20px;
}

.steps-list li + li {
  margin-top: 8px;
}

.steps-list li::marker {
  color: var(--brand);
  font-weight: 700;
}

/* Fehlerseiten */
.error-page {
  max-width: 620px;
  padding-block: clamp(20px, 6vw, 64px);
}

.error-code {
  margin-bottom: 8px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* --------------------------------------------------------------------------
   Ablagen als Kacheln (Übersicht)
   -------------------------------------------------------------------------- */
.access-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.access-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.access-tile-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.access-tile-icon {
  display: inline-grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}

.access-tile-icon .icon {
  width: 20px;
  height: 20px;
}

.access-tile-title {
  min-width: 0;
}

.access-tile-title h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  line-height: 1.35;
  text-wrap: balance;
}

.access-tile-group {
  display: block;
  color: var(--ink-faint);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.access-tile-links {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.access-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface-brand);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

a.access-link:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

a.access-link:active {
  transform: translateY(1px);
}

.access-link-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-size: 0.86rem;
  white-space: nowrap;
}

.access-link-cta .icon {
  width: 14px;
  height: 14px;
}

.access-link.is-preview {
  color: var(--ink-soft);
  background: var(--surface-subtle);
  border-style: dashed;
  border-color: var(--line-strong);
}

.access-tile-empty {
  margin: auto 0 0;
  font-size: 0.88rem;
}

/* Abgleich-Status */
.sync-status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.sync-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 18%, transparent);
  transform: translateY(-1px);
}

.sync-status.is-stale {
  color: var(--warning);
}

.sync-status.is-stale .sync-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent);
}

/* Liste «Noch nicht verknüpft» */
.unlinked-tools {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

#unlinked-count {
  margin: 0 0 10px;
}

.reminder {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.reminder summary {
  padding: 12px 16px;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.reminder-body {
  padding: 0 16px 16px;
}

.reminder textarea {
  min-height: 150px;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
}

/* --------------------------------------------------------------------------
   Responsiv
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .nav-user-label {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-header {
    position: relative;
  }

  .header-bar {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: absolute;
    inset: 100% 0 auto;
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px var(--gutter) 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open .nav-list,
  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    width: 100%;
    padding: 11px 12px;
  }

  .nav-list a[aria-current="page"] {
    background: var(--brand-soft);
  }

  .nav-list a[aria-current="page"]::after {
    inset: 10px auto 10px 0;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
  }

  .nav-user {
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 6px 0 0;
    padding: 10px 0 0 12px;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .nav-user-label {
    display: inline;
  }

  .nav-user .nav-logout-link {
    width: auto;
  }

  .stepper,
  .process {
    grid-template-columns: 1fr;
  }

  .stepper-item + .stepper-item,
  .process-step + .process-step {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .stepper-item::after {
    inset: 0 auto 0 0;
    width: 3px;
    height: auto;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .log-controls {
    grid-template-columns: 1fr 1fr;
  }

  .log-controls .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .unlinked-tools {
    grid-template-columns: 1fr;
  }

  .top-strip-secure {
    display: none;
  }

  .top-strip-inner {
    justify-content: center;
  }

  .card {
    padding: 18px;
    border-radius: var(--radius);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 16px 18px;
  }

  .stat-value {
    min-width: 2.2ch;
    font-size: 1.6rem;
  }

  .log-entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .log-summary {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    text-align: left;
  }

  .log-controls {
    grid-template-columns: 1fr;
  }

  .log-controls .btn {
    grid-column: auto;
  }

  .filter-bar {
    display: flex;
  }

  .filter-pill {
    flex: 1 1 auto;
  }
}

@media (max-width: 440px) {
  .brand-org {
    display: none;
  }

  .btn:not(.small) {
    width: 100%;
  }

  .row .btn {
    flex: 1 1 auto;
  }

  .hero-actions .text-link {
    width: 100%;
    justify-content: center;
  }
}

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

/* Migration: Explorer-Ansicht */
.mig-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.mig-side { display: grid; gap: 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.mig-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 14px;
  background: var(--surface-muted); border-radius: var(--radius-sm); font-size: 0.92rem; }
.mig-crumbs a { color: var(--brand); text-decoration: none; }
.mig-crumbs a:hover { text-decoration: underline; }
.mig-current { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; padding: 14px;
  margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-subtle); }
.mig-current h3 { margin: 2px 0 4px; }
.small-link { font-size: 0.8rem; font-weight: 400; }
.mig-head, .mig-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 150px minmax(0, 1.4fr); gap: 12px; align-items: start; }
.mig-head { padding: 0 10px 6px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.mig-list { list-style: none; margin: 0; padding: 0; }
.mig-row { padding: 10px; border-bottom: 1px solid var(--line); }
.mig-row:hover { background: var(--surface-subtle); }
.mig-name { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; text-decoration: none;
  min-width: 0; padding-top: 6px; }
.mig-name span:first-of-type { overflow-wrap: anywhere; }
.mig-name .icon { width: 18px; height: 18px; flex: none; color: var(--brand); }
.mig-name:hover span:first-of-type { text-decoration: underline; }
.mig-meta { font-size: 0.82rem; padding-top: 8px; }
.mig-target { display: grid; gap: 6px; min-width: 0; }
.mig-select { font-size: 0.88rem; }
.mig-select:not(.is-set) { color: var(--ink-soft); }
.mig-select.is-set { border-color: var(--brand); }
.mig-sub { font-size: 0.85rem; }
.mig-files { margin-top: 14px; font-size: 0.9rem; }
.mig-files summary { cursor: pointer; color: var(--ink-soft); }
.mig-files ul { margin: 8px 0 0; padding-left: 20px; max-height: 320px; overflow: auto; }
.mig-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px;
  padding: 12px 0 4px; background: var(--surface); border-top: 1px solid var(--line); }
.mig-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 0.86rem; }
.mig-rules li { display: grid; gap: 3px; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mig-tag { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem;
  border: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); overflow-wrap: anywhere; }
.mig-drive-01_vorstand { color: #7a1fa2; background: color-mix(in srgb, #7a1fa2 10%, transparent); border-color: color-mix(in srgb, #7a1fa2 35%, var(--line)); }
.mig-drive-02_illnau { color: #0b6bcb; background: color-mix(in srgb, #0b6bcb 10%, transparent); border-color: color-mix(in srgb, #0b6bcb 35%, var(--line)); }
.mig-drive-03_effi { color: #b45309; background: color-mix(in srgb, #b45309 10%, transparent); border-color: color-mix(in srgb, #b45309 35%, var(--line)); }
.mig-drive-04_gemeinsam { color: var(--positive); background: color-mix(in srgb, var(--positive) 10%, transparent); border-color: color-mix(in srgb, var(--positive) 35%, var(--line)); }
.mig-drive-05_dachverein, .mig-drive-06_fotos { color: var(--brand); background: var(--brand-soft); }
.mig-drive-skip { text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  .mig-drive-01_vorstand { color: #d79bf0; }
  .mig-drive-02_illnau { color: #7cb8ff; }
  .mig-drive-03_effi { color: #f3b26b; }
}
@media (max-width: 1000px) {
  .mig-layout { grid-template-columns: 1fr; }
  .mig-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .mig-head { display: none; }
  .mig-row, .mig-current { grid-template-columns: 1fr; gap: 6px; }
  .mig-meta { padding-top: 0; }
}
