/* =========================================================
   Huckepack – Stylesheet
   Raster: eine zentrierte Spalte, dünne Ränder statt Schatten.
   Farben: Tinte + Papier, Akzent Blau. Hell- und Dunkelmodus.
   Formate (mobile-first):
     Handy   < 640px   (Grundstil)
     Tablet  ≥ 640px
     PC      ≥ 1024px
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --fg: #0A0A0B;
  --muted: #5F636B;
  --subtle: #8A8F98;
  --line: #E6E7EA;
  --line-strong: #D4D6DB;
  --surface: #FAFAFB;
  --surface-2: #F3F4F6;

  --accent: #2563EB;
  --accent-soft: #EFF4FF;
  --accent-line: #C7D6FB;

  --btn-bg: #0A0A0B;
  --btn-fg: #FFFFFF;
  --btn-hover: #26272B;

  --ok: #16A34A;
  --ok-soft: #F0FDF4;
  --ok-line: #BBF7D0;
  --err: #DC2626;
  --err-soft: #FEF2F2;
  --err-line: #FECACA;
  --warn: #CA8A04;

  --menu-shadow: 0 6px 20px rgba(10, 10, 11, 0.06);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r: 8px;
  --r-lg: 12px;
  --gutter: 20px;
  --topbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0B;
    --fg: #EDEDEF;
    --muted: #A1A1AA;
    --subtle: #71717A;
    --line: #232327;
    --line-strong: #34343A;
    --surface: #111113;
    --surface-2: #18181B;
    --accent: #3B82F6;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-line: rgba(59, 130, 246, 0.45);
    --btn-bg: #EDEDEF;
    --btn-fg: #0A0A0B;
    --btn-hover: #D4D4D8;
    --ok-soft: rgba(22, 163, 74, 0.12);
    --ok-line: rgba(22, 163, 74, 0.4);
    --err-soft: rgba(220, 38, 38, 0.12);
    --err-line: rgba(220, 38, 38, 0.4);
    --menu-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0B;
  --fg: #EDEDEF;
  --muted: #A1A1AA;
  --subtle: #71717A;
  --line: #232327;
  --line-strong: #34343A;
  --surface: #111113;
  --surface-2: #18181B;
  --accent: #3B82F6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-line: rgba(59, 130, 246, 0.45);
  --btn-bg: #EDEDEF;
  --btn-fg: #0A0A0B;
  --btn-hover: #D4D4D8;
  --ok-soft: rgba(22, 163, 74, 0.12);
  --ok-line: rgba(22, 163, 74, 0.4);
  --err-soft: rgba(220, 38, 38, 0.12);
  --err-line: rgba(220, 38, 38, 0.4);
  --menu-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- Basis ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Icons */
.i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Logo (inline, passt sich dem Modus an) */
.logo { width: 24px; height: 24px; display: block; flex-shrink: 0; }
.logo .logo-bg { fill: var(--fg); }
.logo .logo-dot { fill: var(--accent); }
.logo .logo-arc { fill: none; stroke: var(--bg); stroke-width: 2; stroke-linecap: round; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.topnav { display: none; }

/* ---------- Profilmenü ---------- */
.usermenu { position: relative; }
.usermenu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.usermenu-btn:hover { border-color: var(--line); }
.usermenu-btn[aria-expanded="true"] { border-color: var(--line-strong); }
.usermenu-name, .usermenu-chev { display: none; }
.usermenu-chev { width: 15px; height: 15px; color: var(--subtle); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-xl { width: 72px; height: 72px; font-size: 22px; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 2 * var(--gutter)));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--menu-shadow);
  overflow: hidden;
}
.menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.menu-id { min-width: 0; }
.menu-name { font-weight: 600; font-size: 14px; }
.menu-mail {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-list { padding: 6px; display: grid; gap: 2px; }
.menu-list-sep { border-top: 1px solid var(--line); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.menu-item .i { width: 16px; height: 16px; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item[aria-current="page"] { background: var(--surface-2); }

/* ---------- Typografie ---------- */
.eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}
h1 {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.lead { margin: 14px 0 0; font-size: 16px; color: var(--muted); max-width: 58ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
  white-space: nowrap;
}
.btn .i { width: 16px; height: 16px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg); }
.btn-primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn-secondary { background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface); }
.btn-danger { background: var(--bg); color: var(--err); border: 1px solid var(--err-line); }
.btn-danger:hover:not(:disabled) { background: var(--err-soft); }

.link { color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--fg); }
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.backlink:hover { color: var(--fg); }
.backlink .i { width: 15px; height: 15px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 500; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hint { font-size: 12.5px; color: var(--subtle); }
.input-wrap { position: relative; }
.input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--subtle); }
.input:hover { border-color: var(--subtle); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[readonly] { background: var(--surface); color: var(--muted); }
.input-wrap .input { padding-right: 44px; }
.input-action {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--subtle);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.input-action:hover { color: var(--fg); background: var(--surface-2); }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
}
.alert .i { margin-top: 2px; width: 16px; height: 16px; }
.alert-err { background: var(--err-soft); border-color: var(--err-line); color: var(--fg); }
.alert-err .i { color: var(--err); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); }
.alert-info > .i { color: var(--accent); }
.alert-body { display: grid; gap: 10px; justify-items: start; }
.alert-body p { margin: 0; }
.alert-ok .i { color: var(--ok); }

/* Kontoart-Auswahl (Segmente) */
.segments {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.segment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  text-align: left;
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
}
.segment:last-child { border-bottom: 0; }
.segment .i { color: var(--muted); }
.segment:hover { background: var(--surface); }
.segment[aria-checked="true"] { background: var(--accent-soft); }
.segment[aria-checked="true"] .i { color: var(--accent); }
.segment[aria-checked="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  pointer-events: none;
}
.segment:first-child[aria-checked="true"]::after { border-radius: var(--r) var(--r) 0 0; }
.segment:last-child[aria-checked="true"]::after { border-radius: 0 0 var(--r) var(--r); }

/* ---------- Startseite ---------- */
.main {
  flex: 1;
  display: grid;
  gap: 40px;
  padding-block: 48px 48px;
  align-content: start;
}
.intro { max-width: 640px; }
.section-label { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }

.role-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.role {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 2px;
  align-items: start;
  padding: 18px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background-color .15s;
}
.role:last-child { border-bottom: 0; }
.role:hover { background: var(--surface); }
.role[aria-checked="true"] { background: var(--accent-soft); }
.role[aria-checked="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
}
.role-icon {
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}
.role[aria-checked="true"] .role-icon { color: var(--accent); border-color: var(--accent-line); }
.role-title { font-weight: 600; font-size: 15px; }
.role-text { color: var(--muted); font-size: 14px; }

.actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Fußzeile ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--subtle);
}
.db-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.db-status.ok .dot { background: var(--ok); }
.db-status.err .dot { background: var(--err); }

/* ---------- Anmelden / Registrieren ---------- */
.auth { flex: 1; display: grid; grid-template-columns: 1fr; }
.auth-side { display: none; }
.auth-main {
  display: flex;
  flex-direction: column;
  padding-block: 20px 40px;
}
.auth-top { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.auth-top .brand { display: inline-flex; }
.auth-center { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding-top: 32px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 28px; }
.auth-head h1 { font-size: 1.625rem; }
.auth-head p { margin: 8px 0 0; color: var(--muted); }
.auth-alt { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.auth-done { display: grid; gap: 16px; text-align: left; }
.auth-done-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth-done-icon .i { width: 20px; height: 20px; color: var(--accent); }

/* ---------- App-Seiten (angemeldet) ---------- */
.protected main { visibility: hidden; }
.auth-ready .protected main { visibility: visible; }

.page { flex: 1; padding-block: 32px 48px; display: grid; gap: 28px; align-content: start; }
.page-head h1 { font-size: 1.625rem; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  min-width: 0;
}
.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.panel-body { padding: 18px; }
.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.panel-foot .hint { margin: 0; }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px 18px;
}
.empty-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.empty h3 { margin: 6px 0 0; font-size: 15px; }
.empty p { margin: 0; font-size: 14px; color: var(--muted); max-width: 46ch; }

.kv { display: grid; margin: 0; }
.kv-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-child { border-bottom: 0; }
.kv dt { font-size: 12.5px; color: var(--subtle); }
.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.badge {
  white-space: nowrap;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg);
  background: var(--bg);
}
.badge .i { width: 13px; height: 13px; color: var(--muted); }

.profile-id { display: flex; align-items: center; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.profile-id h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 1fr; gap: 24px; }
.settings-nav { display: none; }
.settings-content { display: grid; gap: 20px; min-width: 0; }
.theme-options { display: grid; grid-template-columns: 1fr; gap: 10px; }
.theme-option {
  display: grid;
  gap: 10px;
  padding: 10px;
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
}
.theme-option:hover { border-color: var(--line-strong); }
.theme-option[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-option-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 2px; font-size: 14px; font-weight: 500; }
.theme-option-row span { display: inline-flex; align-items: center; gap: 8px; }
.theme-option-row .i { width: 16px; height: 16px; color: var(--muted); }
.theme-check { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.theme-check .i { width: 12px; height: 12px; stroke-width: 2.5; color: transparent; }
.theme-option[aria-checked="true"] .theme-check { background: var(--accent); border-color: var(--accent); }
.theme-option[aria-checked="true"] .theme-check .i { color: #FFFFFF; }

/* Mini-Vorschau der Modi: feste Farben, weil sie den jeweiligen Modus zeigen */
.swatch {
  display: grid;
  grid-template-columns: 30% 1fr;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.swatch > span { display: block; }
.swatch-light .sw-side { background: #F3F4F6; }
.swatch-light .sw-main { background: #FFFFFF; position: relative; }
.swatch-dark .sw-side { background: #18181B; }
.swatch-dark .sw-main { background: #0A0A0B; position: relative; }
.sw-main::before, .sw-main::after {
  content: "";
  position: absolute;
  left: 12%;
  height: 7px;
  border-radius: 4px;
}
.sw-main::before { top: 18px; width: 55%; }
.sw-main::after { top: 34px; width: 38%; }
.swatch-light .sw-main::before { background: #0A0A0B; }
.swatch-light .sw-main::after { background: #D4D6DB; }
.swatch-dark .sw-main::before { background: #EDEDEF; }
.swatch-dark .sw-main::after { background: #34343A; }
.swatch-system { grid-template-columns: 1fr 1fr; }
.swatch-system .sw-half-light { background: #FFFFFF; position: relative; }
.swatch-system .sw-half-dark { background: #0A0A0B; position: relative; }
.swatch-system .sw-half-light::before { content: ""; position: absolute; left: 20%; top: 18px; width: 70%; height: 7px; border-radius: 4px; background: #0A0A0B; }
.swatch-system .sw-half-dark::before { content: ""; position: absolute; left: 10%; top: 18px; width: 60%; height: 7px; border-radius: 4px; background: #EDEDEF; }

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .btn { align-self: flex-start; }
.setting-row h3 { margin: 0; font-size: 14px; font-weight: 500; }
.setting-row p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.save-state .i { width: 15px; height: 15px; color: var(--ok); }

/* ---------- Kleinteile ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-title { margin-top: 12px; }
.inline-actions { display: flex; align-items: center; gap: 12px; }
.inline-row { display: flex; align-items: center; gap: 14px; }
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.form-row-2 { display: grid; gap: 18px; }

/* =========================================================
   TABLET  ≥ 640px
   ========================================================= */
@media (min-width: 640px) {
  :root { --gutter: 32px; --topbar-h: 60px; }

  h1 { font-size: 2.25rem; }
  .lead { font-size: 17px; }

  .usermenu-name { display: inline; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .usermenu-chev { display: block; }
  .usermenu-btn { padding: 3px 10px 3px 3px; }

  .main { padding-block: 72px 64px; gap: 44px; }
  .actions { flex-direction: row; flex-wrap: wrap; }

  .role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role {
    grid-template-columns: 1fr;
    row-gap: 6px;
    padding: 22px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .role:last-child { border-right: 0; }
  .role-icon { grid-row: auto; margin-bottom: 10px; }

  /* Formular als umrandete Karte mittig */
  .auth-main { padding-block: 24px 56px; }
  .auth-center { align-items: center; padding-top: 24px; }
  .auth-card {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
  }

  .segments { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segment {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 76px;
    padding: 12px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .segment:last-child { border-right: 0; }
  .segment:first-child[aria-checked="true"]::after { border-radius: var(--r) 0 0 var(--r); }
  .segment:last-child[aria-checked="true"]::after { border-radius: 0 var(--r) var(--r) 0; }

  .page { padding-block: 44px 64px; gap: 32px; }
  .page-head h1 { font-size: 1.875rem; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-row { grid-template-columns: 140px 1fr; gap: 16px; align-items: baseline; }

  .theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* =========================================================
   PC  ≥ 1024px
   ========================================================= */
@media (min-width: 1024px) {
  :root { --gutter: 40px; --topbar-h: 64px; }

  h1 { font-size: 2.75rem; }
  .main { padding-block: 112px 88px; gap: 56px; }

  .topnav { display: flex; gap: 4px; margin-left: 24px; margin-right: auto; }
  .topnav a {
    padding: 6px 10px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 6px;
  }
  .topnav a:hover { color: var(--fg); background: var(--surface-2); }
  .topnav a[aria-current="page"] { color: var(--fg); }

  /* Anmelden: zweigeteilt, links Info, rechts Formular */
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
  .auth-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 40px 56px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }
  .auth-side-body { max-width: 440px; }
  .auth-side h2 { margin: 0; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
  .auth-side p { margin: 14px 0 0; color: var(--muted); }
  .auth-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; }
  .auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
  .auth-points .i { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
  .auth-side-foot { font-size: 13px; color: var(--subtle); }
  .auth-main { padding: 40px 56px; }
  .auth-top .brand { display: none; }
  .auth-top { justify-content: flex-start; }
  .auth-card { padding: 0; border: 0; max-width: 400px; }
  .auth-center { align-items: center; padding-top: 0; }

  .page { padding-block: 56px 80px; }
  .page-head h1 { font-size: 2rem; }
  .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
  .kv-row { grid-template-columns: 110px 1fr; }

  /* Einstellungen mit Seitennavigation */
  .settings { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
  .settings-nav {
    display: grid;
    gap: 2px;
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
  }
  .settings-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 6px;
  }
  .settings-nav a .i { width: 16px; height: 16px; }
  .settings-nav a:hover { color: var(--fg); background: var(--surface-2); }
  .settings-nav a[aria-current="true"] { color: var(--fg); background: var(--surface-2); }

  .setting-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  .setting-row .btn { align-self: center; }

  .profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
}

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

/* =========================================================
   Konto bestätigen, Anfragen, Status
   ========================================================= */
.page-narrow { max-width: 760px; }

.badge-ok { border-color: var(--ok-line); background: var(--ok-soft); }
.badge-ok .i { color: var(--ok); }
.badge-wait { border-color: var(--line-strong); color: var(--muted); }
.badge-err { border-color: var(--err-line); background: var(--err-soft); }

.step-head { display: flex; align-items: flex-start; gap: 14px; }
.step-title { flex: 1; min-width: 0; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
}
.step.is-done .step-num { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.step.is-done .panel-head { border-bottom: 0; }
.step.is-locked .step-title { opacity: .6; }
.choice-row { display: flex; flex-direction: column; gap: 10px; }

.uploader { display: grid; gap: 12px; }
.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
}
.dropzone-title { font-weight: 500; font-size: 14px; }
.dropzone-hint { font-size: 13px; color: var(--subtle); max-width: 36ch; }
.uploader-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.preview img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}
.preview-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.preview-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line); background: var(--surface-2); }

/* Kamera-Fenster */
.camera {
  width: min(640px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.camera::backdrop { background: rgba(10, 10, 11, 0.55); }
.camera-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.camera-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.camera-view { position: relative; background: #000; }
.camera-view video { display: block; width: 100%; max-height: 60dvh; object-fit: contain; }
.camera-msg { margin: 0; padding: 24px; color: #fff; text-align: center; }
.camera-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* Anfragen und Verknüpfungen */
.list { display: grid; }
.list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.list-title { font-weight: 500; font-size: 14px; }
.list-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.list-actions { display: flex; gap: 8px; }

.notice-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-lg);
}
.notice-bar-text { display: flex; gap: 12px; align-items: flex-start; }
.notice-bar-text > .i { color: var(--accent); margin-top: 2px; }
.notice-bar h2 { margin: 0; font-size: 15px; font-weight: 600; }
.notice-bar p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.notice-bar.is-wait { border-color: var(--line); background: var(--surface); }
.notice-bar.is-wait .notice-bar-text > .i { color: var(--muted); }
.notice-bar .btn { align-self: flex-start; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.inline-form { display: grid; gap: 10px; }

.dash-stack { display: grid; gap: 16px; min-width: 0; align-content: start; }

@media (min-width: 640px) {
  .choice-row { flex-direction: row; flex-wrap: wrap; }
  .notice-bar { flex-direction: row; align-items: center; justify-content: space-between; }
  .notice-bar .btn { align-self: center; }
  .inline-form { grid-template-columns: 1fr auto; align-items: end; }
}

.form-msg { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.form-msg.is-err { color: var(--err); }
.list-err { flex-basis: 100%; margin: 0; }
.inline-stack { display: grid; gap: 8px; }

/* =========================================================
   Navigation unten (Handy), Glocke, Popups
   ========================================================= */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 4px;
  font-size: 11px;
  color: var(--subtle);
  text-decoration: none;
  border-radius: 8px;
}
.tabbar a .i { width: 20px; height: 20px; }
.tabbar a[aria-current="page"] { color: var(--fg); }
.tabbar a[aria-current="page"] .i { color: var(--accent); }
body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

.topbar-inner > [data-user-menu] { display: flex; }
.bell { position: relative; margin-left: auto; margin-right: 4px; }
.topnav + .bell { margin-left: 0; }
.bell-btn { position: relative; width: 36px; height: 36px; }
.bell-count {
  position: absolute;
  top: 3px; right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 999px;
}
.bell-menu { width: min(340px, calc(100vw - 2 * var(--gutter))); right: -44px; }
.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.bell-head .link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
.bell-list { max-height: min(420px, 60vh); overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.bell-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 8px;
}
.bell-item:hover { background: var(--surface-2); }
.bell-dot { width: 7px; height: 7px; margin-top: 6px; flex-shrink: 0; border-radius: 50%; background: transparent; }
.bell-item.is-unread .bell-dot { background: var(--accent); }
.bell-text { display: grid; gap: 2px; min-width: 0; }
.bell-title { font-size: 14px; font-weight: 500; }
.bell-body { font-size: 13px; color: var(--muted); }
.bell-time { font-size: 12px; color: var(--subtle); }
.bell-empty { margin: 0; padding: 20px 10px; text-align: center; font-size: 14px; color: var(--muted); }

.toasts {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: max(16px, env(safe-area-inset-left, 0px));
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}
body.has-tabbar .toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.toast {
  pointer-events: auto;
  width: min(380px, 100%);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--menu-shadow);
  animation: toast-in .2s ease-out;
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast-main { display: flex; gap: 12px; padding: 14px 10px 14px 14px; }
.toast-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.toast-action .toast-icon { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.toast-text { flex: 1; min-width: 0; }
.toast-title { margin: 0; font-size: 14px; font-weight: 600; }
.toast-body { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.toast-msg { margin: 6px 0 0; font-size: 13px; color: var(--ok); }
.toast-msg.is-err { color: var(--err); }
.toast-close { width: 28px; height: 28px; }
.toast-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 14px 14px; }

.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.confirm-q { font-size: 13px; color: var(--muted); }

.blocked-bar {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--err-line);
  background: var(--err-soft);
  border-radius: var(--r);
}
.blocked-bar .i { color: var(--err); }

/* =========================================================
   Karte und Ortssuche
   ========================================================= */
.place-field { position: relative; }
.place-field .input { padding-left: 38px; }
.place-field > .field-icon {
  position: absolute; left: 12px; top: 13px;
  width: 18px; height: 18px;
  color: var(--subtle);
  pointer-events: none;
}
.place-field.has-value > .field-icon { color: var(--accent); }
.place-list {
  position: absolute;
  z-index: 40;
  left: 0; right: 0;
  top: calc(100% + 4px);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--menu-shadow);
}
.place-item {
  display: flex; gap: 10px; align-items: center;
  width: 100%;
  padding: 8px;
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.place-item:hover, .place-item.is-active { background: var(--surface-2); }
.place-item.is-out { opacity: .5; cursor: default; }
.place-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.place-icon .i { width: 16px; height: 16px; }
.place-text { display: grid; min-width: 0; }
.place-main { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-note { margin: 0; padding: 10px; font-size: 13px; color: var(--muted); }

.map { position: relative; z-index: 0; width: 100%; height: 100%; min-height: 240px; background: var(--surface-2); }
.map-fallback { margin: 0; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
.leaflet-control-attribution {
  font-size: 10.5px;
  background: color-mix(in srgb, var(--bg) 85%, transparent) !important;
  color: var(--muted) !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: none !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { background: var(--bg) !important; color: var(--fg) !important; border-bottom-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; }
.area-circle { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 6; fill: var(--accent); fill-opacity: 0.04; }
.route-line { stroke: var(--accent); stroke-width: 5; stroke-opacity: .85; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route-line-muted { stroke: var(--subtle); stroke-width: 4; stroke-opacity: .7; stroke-dasharray: 2 7; fill: none; stroke-linecap: round; }

.pin { display: grid; place-items: center; }
.pin span {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  font-size: 11px; font-weight: 600; font-family: var(--mono);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.pin-start span { background: var(--fg); color: var(--bg); }
.pin-dest span { background: var(--accent); color: #FFFFFF; border-radius: 7px; }
.pin-pickup span { background: var(--bg); color: var(--accent); border: 3px solid var(--accent); box-shadow: none; }
.pin-center span { width: 16px; height: 16px; background: var(--accent); }
.pin-home span { background: var(--bg); color: var(--fg); border: 3px solid var(--fg); box-shadow: none; width: 20px; height: 20px; }

/* =========================================================
   Navigator-Layout (Liste links, Karte rechts)
   ========================================================= */
.finder { flex: 1; display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.finder-map { height: 38vh; min-height: 220px; border-bottom: 1px solid var(--line); position: relative; }
.finder-panel {
  display: grid;
  align-content: start;
  gap: 20px;
  padding-block: 20px 32px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  min-width: 0;
}
.finder-panel .page-head h1 { font-size: 1.5rem; }
.finder-form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > * { min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--surface); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; height: 44px; }
.stepper button { width: 44px; height: 100%; display: grid; place-items: center; background: var(--bg); color: var(--fg); border: 0; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { color: var(--subtle); cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 42px; }

select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--subtle) 50%), linear-gradient(135deg, var(--subtle) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.results-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.results { display: grid; gap: 10px; }

.ride {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
button.ride { cursor: pointer; }
button.ride:hover { border-color: var(--line-strong); background: var(--surface); }
.ride.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ride-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ride-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.ride-day { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.ride-path { display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; row-gap: 4px; align-items: center; font-size: 14px; }
.ride-path .dot-start, .ride-path .dot-dest { width: 9px; height: 9px; border-radius: 50%; justify-self: center; }
.ride-path .dot-start { background: var(--fg); }
.ride-path .dot-dest { background: var(--accent); border-radius: 2px; }
.ride-path span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ride-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.ride-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ride-meta .i { width: 14px; height: 14px; }
.ride-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.detail { display: grid; gap: 16px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); }
.detail-stats > div { padding: 12px 14px; border-right: 1px solid var(--line); min-width: 0; }
.detail-stats > div:last-child { border-right: 0; }
.detail-stats dt { font-size: 12px; color: var(--subtle); }
.detail-stats dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { height: 32px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--line); }

.req-list { display: grid; border-top: 1px solid var(--line); }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req-main { flex: 1; min-width: 160px; display: grid; gap: 2px; }
.req-name { font-weight: 500; font-size: 14px; }
.req-sub { font-size: 13px; color: var(--muted); }
.req-msg { font-size: 13px; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.section-title { margin: 0; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); font-family: var(--mono); }

.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: stop; }
.stops li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; font-size: 14px; }
.stops .n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-family: var(--mono); font-weight: 600; border: 2px solid var(--accent); color: var(--accent); }
.stops .n.s { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.stops .n.d { background: var(--accent); border-color: var(--accent); color: #FFFFFF; border-radius: 6px; }

.gate { display: grid; gap: 12px; justify-items: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.gate h2 { margin: 0; font-size: 16px; }
.gate p { margin: 0; color: var(--muted); font-size: 14px; }

@media (min-width: 640px) {
  .tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  body.has-tabbar .toasts { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .toasts { left: auto; }
  .topnav { display: flex; gap: 2px; margin-left: 20px; margin-right: auto; }
  .topnav a { padding: 6px 10px; font-size: 14px; color: var(--muted); text-decoration: none; border-radius: 6px; white-space: nowrap; }
  .topnav a:hover { color: var(--fg); background: var(--surface-2); }
  .topnav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
  .bell { margin-left: 0; }
  .bell-menu { right: 0; }

  .finder { flex: none; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(340px, 400px) 1fr; height: calc(100dvh - var(--topbar-h)); }
  .finder-panel { min-height: 0; }
  .finder-panel { order: 1; overflow-y: auto; border-right: 1px solid var(--line); padding: 24px; }
  .finder-map { order: 2; height: auto; border-bottom: 0; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .topnav a { padding: 6px 8px; font-size: 13.5px; }
  .usermenu-name { display: none; }
  .usermenu-chev { display: none; }
  .usermenu-btn { padding: 3px; }
}

@media (min-width: 1024px) {
  .finder { grid-template-columns: 440px 1fr; }
  .finder-panel { padding: 28px 32px; }
}
.results-head + .results { margin-top: 12px; }
.detail-title { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.pin-mini { display: grid; place-items: center; width: 14px; height: 14px; justify-self: center; font-size: 9px; font-weight: 700; font-family: var(--mono); color: var(--accent); border: 2px solid var(--accent); border-radius: 50%; }
button.backlink { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; justify-self: start; }
.ride.is-past { opacity: .65; }
.ride-head-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ride-block { display: grid; gap: 8px; }
.route-box { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.addr-grid { display: grid; gap: 16px; }
.addr-map { height: 240px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
#adresse { margin-top: 0; }
@media (min-width: 1024px) {
  .addr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
  .addr-map { height: 260px; }
}
.list-link { color: var(--fg); text-decoration: none; }
.list-link:hover { background: var(--surface); }
/* Handy: Karte über der Liste */
.finder-map { order: -1; }
@media (min-width: 640px) { .finder-map { order: 2; } }

/* Kartenkacheln: hell leicht entsättigt, dunkel invertiert */
.leaflet-tile-pane { filter: grayscale(0.35) saturate(0.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) grayscale(0.3); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) grayscale(0.3); }

/* =========================================================
   Profilbilder
   ========================================================= */
.avatar-img { object-fit: cover; padding: 0; background: var(--surface-2); }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 15px; }
.bell-item .avatar-sm { margin-top: 1px; }

.avatar-picker { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-drop {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  padding: 0;
  color: var(--subtle);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.avatar-drop:hover, .avatar-drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.avatar-drop.has-image { border-style: solid; border-color: var(--line); }
.avatar-drop .i { width: 24px; height: 24px; }
.avatar-drop-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker-side { flex: 1; min-width: 200px; display: grid; gap: 6px; }
.avatar-picker-title { margin: 0; font-size: 13px; font-weight: 500; }
.avatar-picker-side .hint { margin: 0; }
.avatar-picker-side .uploader-actions { margin-top: 4px; }
.avatar-picker.is-invalid .avatar-drop { border-color: var(--err); }

.ride-driver { display: flex; align-items: center; gap: 10px; }
.ride-driver-text { display: grid; gap: 1px; min-width: 0; }
.ride-driver-name { font-weight: 600; font-size: 15px; }
.ride-driver-sub { font-size: 13px; color: var(--muted); }
.ride-meta .avatar-sm { width: 20px; height: 20px; font-size: 9px; border-width: 0; }

.menu-item-meta { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Guthaben */
.balance { display: grid; gap: 6px; padding: 22px 18px; }
.balance-label { font-size: 13px; color: var(--muted); }
.balance-value { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.tx-icon .i { width: 16px; height: 16px; }
.tx-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tx-title { font-size: 14px; font-weight: 500; }
.tx-sub { font-size: 12.5px; color: var(--muted); }
.tx-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amount.is-plus { color: var(--ok); }
.tx-sub-amount { display: block; text-align: right; font-size: 12px; color: var(--subtle); font-weight: 400; }

/* Guthaben in der Kopfzeile */
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  margin-right: 6px;
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.balance-chip .i { width: 15px; height: 15px; color: var(--muted); }
.balance-chip:hover { background: var(--surface-2); }
.balance-chip[aria-current="page"] { border-color: var(--line-strong); background: var(--surface-2); }
.bell { margin-right: 2px; }
@media (max-width: 380px) { .balance-chip .i { display: none; } .balance-chip { padding: 0 8px; } }

/* Rollstuhl */
.option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
}
.option-row:hover { background: var(--surface); }
.option-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.option-row .i { width: 18px; height: 18px; color: var(--muted); margin-top: 1px; flex-shrink: 0; }
.option-row:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.option-row:has(input:checked) .i { color: var(--accent); }
.option-text { display: grid; gap: 2px; }
.option-title { font-size: 14px; font-weight: 500; }
.option-sub { font-size: 13px; color: var(--muted); }
.chip .i { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.badge-access { border-color: var(--accent-line); background: var(--accent-soft); }
.badge-access .i { color: var(--accent); }

/* Nachweis-Bilder */
.doc-picker { display: grid; gap: 10px; }
.doc-drop {
  display: grid; place-items: center;
  width: 100%; min-height: 120px; padding: 0;
  font: inherit; color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
}
.doc-drop:hover, .doc-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.doc-drop.has-image { border-style: solid; border-color: var(--line); background: var(--bg); }
.doc-empty { display: grid; justify-items: center; gap: 4px; padding: 18px; font-size: 14px; font-weight: 500; color: var(--fg); }
.doc-empty .i { width: 20px; height: 20px; color: var(--muted); }
.doc-empty .hint { font-weight: 400; }
.doc-img { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.doc-picker.is-invalid .doc-drop { border-color: var(--err); }

/* Fahrzeuge */
.vehicle { display: grid; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.vehicle:last-child { border-bottom: 0; }
.vehicle-head { display: flex; align-items: center; gap: 12px; }
.vehicle-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.vehicle-title { display: grid; gap: 1px; flex: 1; min-width: 0; }
.vehicle-title strong { font-size: 15px; }
.vehicle-title span { font-size: 13px; color: var(--muted); }
.plate {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .04em;
  color: var(--fg); background: var(--bg);
  border: 1.5px solid var(--fg); border-radius: 4px;
  white-space: nowrap;
}
.vehicle-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.vehicle-facts div { min-width: 0; }
.vehicle-facts dt { font-size: 12px; color: var(--subtle); }
.vehicle-facts dd { margin: 1px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.vehicle-status { display: flex; flex-wrap: wrap; gap: 6px; }
.vehicle-edit { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.form-grid { display: grid; gap: 14px; }
.ride-vehicle { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.ride-vehicle .i { width: 15px; height: 15px; }
@media (min-width: 640px) {
  .vehicle-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
}
.badge-prefix { font-size: 12.5px; color: var(--muted); align-self: center; margin-left: 4px; }
.ride-vehicle { align-items: flex-start; }
.ride-vehicle .i { margin-top: 2px; flex: none; }
.ride-vehicle small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ride-vehicle > span { color: var(--fg); }

/* Nachweise im Profil */
.proof-list { margin: 0; }
.proof-list > div { display: grid; gap: 6px; padding: 14px 20px; border-top: 1px solid var(--line); }
.proof-list > div:first-child { border-top: 0; }
.proof-list dt { font-size: 13.5px; color: var(--muted); }
.proof-list dd { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.proof-vehicle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
@media (min-width: 640px) {
  .proof-list > div { grid-template-columns: 180px 1fr; align-items: center; padding: 14px 24px; }
}
#gate:empty { display: none; }
.area-circle-other { stroke: var(--muted); fill: var(--muted); fill-opacity: 0.03; }

/* ---------- Fußzeile: Beta, Feedback, Rechtliches ---------- */
.site-foot {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: auto;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
body > .site-foot { padding-bottom: 24px; }
.site-foot-beta { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.site-foot-beta:hover { color: var(--fg); }
.site-foot-beta .i { width: 14px; height: 14px; flex: none; }
.beta-pill {
  flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
}
.site-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot-links a { color: var(--muted); text-decoration: none; }
.site-foot-links a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.site-foot-compact { margin-top: 12px; padding-bottom: 4px; }
.site-foot-host { flex-direction: column; align-items: stretch; }
.site-foot-host .site-foot { border-top: 0; padding: 0; margin: 0; }
@media (min-width: 640px) {
  .site-foot:not(.site-foot-compact) { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  .site-foot-host { flex-direction: row; }
  .site-foot-host .site-foot { flex: 1; }
}

/* ---------- Infoseiten (Beta, Impressum, Datenschutz) ---------- */
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--topbar-h, 60px); border-bottom: 1px solid var(--line); }
.pub-head-wrap { border-bottom: 1px solid var(--line); }
.pub-head-wrap .pub-head { border-bottom: 0; }
.prose { display: grid; gap: 28px; }
.prose section { display: grid; gap: 10px; }
.prose h2 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.005em; }
.prose h3 { margin: 6px 0 0; font-size: .95rem; font-weight: 600; }
.prose p, .prose li { margin: 0; color: var(--muted); line-height: 1.65; font-size: 15px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose a { color: var(--fg); text-underline-offset: 3px; }
.prose address { font-style: normal; color: var(--fg); line-height: 1.7; }
.placeholder { color: var(--err); font-family: var(--mono); font-size: 13px; }
.facts { display: grid; gap: 12px; }
.fact { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.fact .vehicle-icon { width: 36px; height: 36px; }
.fact strong { display: block; font-weight: 500; color: var(--fg); margin-bottom: 2px; }
.fact p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.kind-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kind-picker label { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; text-align: center; }
.kind-picker input { position: absolute; opacity: 0; pointer-events: none; }
.kind-picker label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.kind-picker label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.kind-picker .i { width: 18px; height: 18px; color: var(--muted); }
.kind-picker label:has(input:checked) .i { color: var(--accent); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 8px; }

/* ---------- Rechtliches ---------- */
.law-toc { display: grid; grid-template-columns: 1fr; gap: 8px; }
.law-toc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; font-size: 14px; line-height: 1.35; }
.law-toc-item:hover { border-color: var(--line-strong); background: var(--bg-subtle, transparent); }
.law-toc-item .vehicle-icon { width: 32px; height: 32px; }
.law-list { display: grid; gap: 16px; }
.law { scroll-margin-top: 16px; }
.law .prose { gap: 18px; }
.law .prose h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--fg); text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono); }
.law-beta { justify-content: flex-start; gap: 10px; font-size: 13.5px; color: var(--muted); }
@media (min-width: 640px) { .law-toc { grid-template-columns: 1fr 1fr; } }

/* ---------- Alle Fahrten auf der Karte ---------- */
.routes-section { display: grid; gap: 10px; }
.routes-section .hint { margin: 0; }
.route-legend { display: grid; gap: 6px; }
.route-item {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; text-align: left; font: inherit;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.route-item:hover { border-color: var(--line-strong); }
.route-item[aria-pressed="true"] { border-color: var(--fg); }
.route-swatch { width: 22px; height: 0; border-top: 4px solid var(--c); border-radius: 2px; }
.route-swatch.is-dashed { border-top-style: dashed; }
.route-item-main { display: grid; gap: 1px; min-width: 0; }
.route-item-main strong { font-weight: 500; font-size: 13.5px; }
.route-item-main span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-item-seats { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.route-more { justify-self: start; }
.mini-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mini-switch input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.leaflet-tooltip.route-tip { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; font: 13px/1.45 var(--font); padding: 6px 9px; }
.leaflet-tooltip.route-tip::before { display: none; }

/* ---------- Preis ---------- */
.price-box { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.price-box-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price-box-main .label { margin: 0; }
.price-box-main strong { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.price-box .hint { margin: 0; line-height: 1.5; }
.price-tag { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); }
.price-lines { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.price-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.price-lines dt { color: var(--muted); }
.price-lines dd { margin: 0; font-variant-numeric: tabular-nums; }
.price-lines .price-total { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }
.price-lines .price-total dt { color: var(--fg); }
.ride-price-line { display: flex; align-items: center; gap: 6px; margin: 0; }
.ride-price-line .i { width: 14px; height: 14px; }

/* ---------- Live ---------- */
.live-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.live-status-text { display: grid; gap: 2px; }
.live-status-text strong { font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--subtle); flex: none; }
.live-dot.is-live { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live-pulse 1.8s ease-out infinite; }
.live-dot.is-wait { background: var(--warn); }
.live-dot.is-done { background: var(--accent); }
.live-dot.is-off { background: var(--err); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot.is-live { animation: none; } }
.car-pin span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--fg); color: var(--bg); border: 3px solid var(--bg); }
.car-pin .i { width: 18px; height: 18px; }
.acc-circle { stroke: var(--accent); stroke-width: 1; fill: var(--accent); fill-opacity: .08; }
.live-driver-panel .panel-foot { justify-content: flex-end; gap: 8px; }

/* Preisfilter in der Suche */
.price-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 12px; }
.price-filter .field { gap: 4px; }
.price-filter .label { font-size: 12.5px; color: var(--muted); }
.input-sm { height: 36px; font-size: 14px; padding-top: 0; padding-bottom: 0; }
.route-item-seats { text-align: right; line-height: 1.35; }
