/* RiVo – Grundauftritt nach White Label Makler (Design-System „White Label Makler“, tokens.json).
   Partner-Werte (Regel „Partner-Tools“): --p-logo, --p-accent, --p-font, --p-radius ersetzen den Grundauftritt. */
@font-face { font-family: "Archivo"; src: url(/statisch/fonts/Archivo-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/statisch/fonts/Archivo-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/statisch/fonts/Archivo-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo Expanded"; src: url(/statisch/fonts/ArchivoExpanded-Light.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Archivo Expanded"; src: url(/statisch/fonts/ArchivoExpanded-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --surface: #ffffff; --mist: #f2f3f4; --line: #e3e5e8; --steel: #a9afb6;
  --ink: #111317; --ink-muted: #5b626b; --on-ink: #ffffff;
  --slate: #34404c; --slate-soft: #e6eaee;
  --success: #2e6a4e; --warning: #8a5a00; --danger: #a3352b;
  --p-accent: var(--ink); --p-on-accent: #ffffff; --p-akzent-text: var(--slate);
  --p-font: "Archivo", system-ui, sans-serif; --p-display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
  --p-radius: 0px;
  --r: var(--p-radius);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0e1013; --mist: #181b1f; --line: #2a2f35; --steel: #5c646d;
    --ink: #f2f3f4; --ink-muted: #a3aab2; --on-ink: #0e1013; --slate: #a9b8c6; --slate-soft: #1e252d;
    --success: #7fc4a0; --warning: #e0b060; --danger: #f08a80;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--ink); }
body { font: 16px/26px var(--p-font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }

.eyebrow { font: 500 11px/16px var(--p-display); letter-spacing: .2em; text-transform: uppercase; color: var(--p-akzent-text); margin: 0 0 10px; }
h1, h2, h3 { font-family: var(--p-display); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; }
h2 { font-size: 28px; line-height: 34px; }
h3 { font-size: 18px; line-height: 26px; }
.lead { font-size: 19px; line-height: 30px; color: var(--ink-muted); max-width: 46ch; }
.muted { color: var(--ink-muted); }
.klein { font-size: 14px; line-height: 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: var(--r); cursor: pointer;
  font: 500 15px/1 var(--p-font); letter-spacing: .01em; text-decoration: none; }
.btn:hover { background: var(--mist); }
.btn.haupt { background: var(--p-accent); border-color: var(--p-accent); color: var(--p-on-accent); }
.btn.haupt:hover { filter: brightness(1.12); }
.btn.klein { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.leise { border-color: var(--line); }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
label.feld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-muted); }
label.feld > span { font-weight: 500; letter-spacing: .02em; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 20px; }
.raster .breit { grid-column: 1 / -1; }

/* ---------- Startseite ---------- */
.start { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.start header { padding: 28px clamp(16px, 5vw, 64px); }
.start header img { height: 44px; display: block; }
.start main { display: grid; align-content: center; padding: 24px clamp(16px, 5vw, 64px) 64px; max-width: 1180px; width: 100%; margin: 0 auto;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.start .karte { border: 1px solid var(--line); padding: 32px; display: grid; gap: 14px; background: var(--surface); }
.start .karte .btn { width: 100%; justify-content: flex-start; }
.start .karte .btn svg { width: 20px; height: 20px; flex: none; }
.start .fehler { border-left: 3px solid var(--danger); background: var(--mist); padding: 10px 14px; color: var(--danger); font-size: 14px; }
.start footer { padding: 20px clamp(16px, 5vw, 64px); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px;
  justify-content: space-between; font-size: 13px; color: var(--ink-muted); }
.start .punkte { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.start .punkte li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--ink-muted); }
.start .punkte li::before { content: ""; width: 10px; height: 10px; margin-top: 8px; background: var(--slate); }
@media (max-width: 860px) { .start main { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- App ---------- */
.kopf { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.kopf .in { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); min-height: 68px; display: flex; align-items: center; gap: 28px; }
.kopf .marke { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kopf .marke img { height: 30px; max-width: 200px; object-fit: contain; display: block; }
.kopf .marke b { font: 500 15px/1.2 var(--p-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.kopf nav button { background: none; border: 0; padding: 22px 12px; cursor: pointer; color: var(--ink-muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.kopf nav button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.kopf .wer { font-size: 13px; color: var(--ink-muted); text-align: right; line-height: 18px; }
.seite { max-width: 1240px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 96px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }

.flaeche { background: var(--mist); padding: 24px; border-radius: var(--r); }
.block { border: 1px solid var(--line); padding: 24px; border-radius: var(--r); margin-bottom: 20px; background: var(--surface); }
.block > h3 { margin-bottom: 4px; }
.block > .muted { margin: 0 0 18px; }

.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 28px; }
.zahlen div { background: var(--surface); padding: 18px 20px; }
.zahlen b { display: block; font: 300 40px/44px var(--p-display); }
.zahlen span { color: var(--ink-muted); font-size: 14px; }
.zahlen div.akzent { background: var(--slate); color: #fff; } .zahlen div.akzent span { color: rgba(255,255,255,.75); }

.liste { border-top: 1px solid var(--line); }
.zeile { display: grid; grid-template-columns: 130px minmax(0, 1fr) 160px 140px 24px; gap: 16px; align-items: center; padding: 16px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.zeile:hover { background: var(--mist); }
.zeile .nr { font: 500 14px/1 var(--p-display); letter-spacing: .04em; }
.zeile small { display: block; color: var(--ink-muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; background: var(--steel); }
.status.erfassung::before { background: var(--warning); } .status.bereit::before { background: var(--slate); }
.status.versendet::before { background: var(--ink); } .status.abgeschlossen::before { background: var(--success); }
@media (max-width: 760px) { .zeile { grid-template-columns: 1fr auto; } .zeile .weg { display: none; } }
.leer { padding: 56px 24px; text-align: center; border: 1px dashed var(--line); color: var(--ink-muted); }

.diagnose { border: 1px solid var(--line); border-left: 3px solid var(--slate); padding: 18px 20px; margin-bottom: 14px; border-radius: var(--r); }
.diagnose .dkopf { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.diagnose .dkopf b { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: 14px; border-radius: var(--r); }
.chip:hover { border-color: var(--ink); }
.schalter { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.schalter button { border: 0; background: none; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.schalter button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th { text-align: left; font: 500 11px/16px var(--p-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted);
  padding: 10px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
table.tab td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tab td.f { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.tab .pruefen { color: var(--warning); font-weight: 500; }
.tabwrap { overflow-x: auto; }

.hinweis { background: var(--slate-soft); padding: 14px 16px; font-size: 14px; border-radius: var(--r); }
.speicherstand { font-size: 13px; color: var(--ink-muted); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 12px 18px;
  font-size: 14px; z-index: 50; border-radius: var(--r); }
.vorschau { border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; border-radius: var(--r); }
.vorschau .logo { height: 36px; max-width: 220px; object-fit: contain; }
.farbe { display: flex; gap: 10px; } .farbe input[type=color] { width: 56px; padding: 4px; flex: none; }
@media (max-width: 760px) {
  .kopf .in { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 12px; }
  .kopf .marke { flex: 1; }
  .kopf nav { order: 3; flex-basis: 100%; margin: 4px -8px 0; }
  .kopf nav button { padding: 12px 8px 14px; }
  .kopf .wer { font-size: 0; } .kopf .wer .link { font-size: 13px; }
  .zeile { grid-template-columns: minmax(0, 1fr) 20px; gap: 6px 12px; }
  .zeile .nr { grid-column: 1; font-size: 12px; } .zeile > span:nth-child(2) { grid-column: 1; }
  .zeile .status { grid-column: 1; } .zeile > span:last-child { grid-column: 2; grid-row: 1 / span 3; }
  .seite { padding-top: 28px; }
}

/* ---------- Anfragen, Voten, Ergebnis ---------- */
.warn { color: var(--warning); font-weight: 600; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hinweis.warnfeld { border-left: 3px solid var(--warning); }
.anfragen { display: grid; gap: 12px; margin-top: 12px; }
.anfrage { border: 1px solid var(--line); padding: 16px 18px; border-radius: var(--r); background: var(--surface); }
.anfrage.st-nicht_noetig { background: var(--mist); }
.anfrage.st-votum { border-left: 3px solid var(--success); }
.anfrage.st-rueckfrage { border-left: 3px solid var(--warning); }
.akopf { display: flex; align-items: center; gap: 14px; }
.akopf .wahl input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.aname { flex: 1; min-width: 0; } .aname b { display: block; } .aname small { color: var(--ink-muted); font-size: 13px; overflow-wrap: anywhere; }
.achip { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); white-space: nowrap; border-radius: var(--r); }
.achip.freigegeben { border-color: var(--slate); color: var(--slate); }
.achip.versendet { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.achip.rueckfrage { border-color: var(--warning); color: var(--warning); }
.achip.votum { background: var(--success); border-color: var(--success); color: #fff; }
.achip.nicht_noetig { color: var(--ink-muted); }
.anfrage .angaben { margin: 8px 0 0; color: var(--ink-muted); }
.anfrage details { margin-top: 10px; }
.anfrage summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.anfrage details[open] > summary { margin-bottom: 10px; }
.gruende ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 20px; }
.mailtext { min-height: 260px; font: 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace; }
.anfrage label.feld { margin-bottom: 10px; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.votum { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.erg-ablehnung b, .votum.erg-ablehnung b { color: var(--danger); }
.ergebnis tr.erg-annahme td:nth-child(3) { color: var(--success); font-weight: 600; }
@media print {
  body.druck-ergebnis .kopf, body.druck-ergebnis .toast { display: none !important; }
  body.druck-ergebnis #anfragen-bereich > *:not(.ergebnis) { display: none !important; }
  body.druck-ergebnis .seite > .seitenkopf, body.druck-ergebnis .seite > section { display: none !important; }
  body.druck-ergebnis #anfragen-bereich { display: block !important; }
  body.druck-ergebnis .ergebnis button { display: none; }
  body.druck-ergebnis .ergebnis { border: 0; padding: 0; }
}

/* ---------- Kunden-Fragebogen ---------- */
.fb { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.fb-kopf { border-bottom: 1px solid var(--line); } .fb-kopf .in { max-width: 820px; margin: 0 auto; padding: 18px 16px; min-height: 72px; display: flex; align-items: center; }
.fb-kopf img { height: 36px; max-width: 240px; object-fit: contain; } .fb-kopf b { font: 500 18px/1.2 var(--p-display); }
.fb-seite { max-width: 820px; width: 100%; margin: 0 auto; padding: 32px 16px 80px; }
.fb-seite h1 { margin-bottom: 14px; } .fb-seite h2 { margin: 8px 0 12px; }
.fb-fuss { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 13px; color: var(--ink-muted); }
.fb-schritte { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-muted); counter-reset: s; }
.fb-schritte li { counter-increment: s; } .fb-schritte li::before { content: counter(s) ". "; }
.fb-schritte li[aria-current] { color: var(--ink); font-weight: 600; } .fb-schritte li.fertig { color: var(--success); }
.fb-frage { font-weight: 500; margin: 0 0 8px; } .frage .schalter { margin: 6px 0 4px; } .frage .diagnose { margin-top: 14px; } .frage .chip { margin-top: 10px; }
.fb-knoepfe { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.haken { display: flex; gap: 10px; align-items: center; font-weight: 500; margin-top: 12px; } .haken input { width: 22px; height: 22px; min-height: 0; accent-color: var(--p-accent); }
.fb .fehler { border-left: 3px solid var(--danger); background: var(--mist); padding: 10px 14px; color: var(--danger); font-size: 14px; }
.fb .schalter button[aria-pressed="true"] { background: var(--p-accent); color: var(--p-on-accent); }

/* ---------- Angaben einholen, Glocke ---------- */
.wege { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.weg-karte { border: 1px solid var(--line); padding: 16px; border-radius: var(--r); display: grid; gap: 8px; align-content: start; }
.weg-karte .muted { margin: 0; } .weg-karte .eyebrow { margin: 0; }
.linkfeld { font-size: 12px; min-height: 36px; }
.dateiwahl { position: relative; overflow: hidden; justify-self: start; } .dateiwahl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pwsuche { display: flex; gap: 8px; } .pwsuche input { min-height: 36px; }
.treffer { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.hinweis.eingang { margin-top: 12px; border-left: 3px solid var(--p-accent); } .hinweis.eingang ul { margin: 8px 0; padding-left: 18px; }
.kiv { list-style: none; padding: 0 !important; } .kiv li { margin: 6px 0; } .kiv input { width: 16px; height: 16px; min-height: 0; vertical-align: -2px; }
.glocke { position: relative; }
.glocke-knopf { position: relative; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); display: flex; }
.glocke-knopf .zahl { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.glocke-liste { position: absolute; right: 0; top: calc(100% + 6px); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 30; border-radius: var(--r); }
.gkopf { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ghinweis { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; cursor: pointer; font-size: 14px; border-left: 3px solid var(--slate); }
.ghinweis:hover { background: var(--mist); } .ghinweis .nr { font-size: 11px; letter-spacing: .08em; color: var(--ink-muted); }
.ghinweis.ablauf, .ghinweis.abgelaufen, .ghinweis.rueckfrage { border-left-color: var(--warning); } .ghinweis.bogen { border-left-color: var(--success); }
.ghinweis.gelesen { border-left-color: transparent; color: var(--ink-muted); }
@media (max-width: 760px) { .glocke { order: 2; } }
.weg-karte .btn { justify-self: start; }
