/* SFM Händlerservice – werkstatttauglich: große Flächen, hoher Kontrast, keine externen Ressourcen */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #16191d;
  --ink-2: #4a525c;
  --ink-3: #737c87;
  --line: #dde0dc;
  --line-strong: #c3c8c2;
  --accent: #1d4ed8;
  --brand: var(--accent);
  --ok: #157347;
  --warn: #a15c00;
  --bad: #b42318;
  --info: #1d4ed8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315; --surface: #1a1d21; --ink: #eceef0; --ink-2: #b6bcc4; --ink-3: #8a929c;
    --line: #2b3036; --line-strong: #3a4048; --accent: #6b9bff;
    --ok: #4cc38a; --warn: #f0a640; --bad: #ff6b5e; --info: #6b9bff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.lead { color: var(--ink-2); font-size: 1.05rem; max-width: 65ch; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
[hidden] { display: none !important; }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); position: relative; }
.logo-mark::after { content: ""; position: absolute; inset: 7px 5px 7px 5px; border: 2px solid var(--surface); border-radius: 3px; border-right-color: transparent; }
.mainnav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a, .mainnav .link { color: var(--ink-2); text-decoration: none; padding: 8px 9px; border-radius: 8px; font-size: .93rem; white-space: nowrap; }
.mainnav a:hover, .mainnav .link:hover { background: var(--bg); color: var(--ink); }
.mainnav a.on { color: var(--ink); font-weight: 600; background: var(--bg); }
.mainnav a.btn { color: #fff; background: var(--ink); }
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.nav-toggle { display: none; margin-left: auto; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .mainnav:not(.open) { display: none; }
  .mainnav { width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .mainnav a, .mainnav .link, .mainnav form { width: 100%; }
  .mainnav .link { text-align: left; }
  .nav-sep { width: 100%; height: 1px; margin: 6px 0; }
}

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: .875rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 16px; }
.footer a { color: var(--ink-2); }

/* Buttons und Formulare */
.btn, button.btn, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 9px; border: 1px solid transparent; background: var(--ink); color: #fff; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.15); }
.btn-brand { background: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-danger { background: var(--bad); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }
.nav-toggle { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--ink-3); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], input[type=color], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font: 1rem var(--font);
}
input[type=color] { padding: 4px; width: 72px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: .92rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.req::after { content: " *"; color: var(--bad); }
.honeypot { position: absolute; left: -9999px; }
.file-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: .9rem; color: var(--ink-2); }
.file-list .too-big { color: var(--bad); font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }

/* Karten und Flächen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stack > .card + .card, .narrow > .card + .card, .narrow-wide > .card + .card { margin-top: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.stat { display: block; text-decoration: none; color: inherit; }
.stat .num { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--ink-2); font-size: .9rem; }
.stat.attn .num { color: var(--warn); }

/* Flash */
.flashes { margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 9px; margin-bottom: 8px; border: 1px solid; word-break: break-word; }
.flash-success { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.flash-error { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.flash-info { background: color-mix(in srgb, var(--info) 8%, var(--surface)); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* Marken */
.brand-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.brand-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.brand-hero { border-top: 5px solid var(--brand); }
.brand-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; border-top: 5px solid var(--brand); min-height: 150px; }
.brand-card:hover { border-color: var(--brand); }
.brand-card h3 { margin: 0; font-size: 1.3rem; }
.brand-card img { max-height: 44px; max-width: 180px; object-fit: contain; align-self: flex-start; }
.brand-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-switch a { text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; color: var(--ink); }
.brand-switch a.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* Tabellen und Listen */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
.row-link:hover td { background: color-mix(in srgb, var(--bg) 70%, var(--surface)); }
.empty { padding: 32px; text-align: center; color: var(--ink-2); }

.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.status-neu { color: var(--info); border-color: currentColor; }
.status-pruefung { color: var(--ink-2); border-color: currentColor; }
.status-rueckfrage { color: var(--warn); border-color: currentColor; background: color-mix(in srgb, var(--warn) 10%, transparent); }
.status-genehmigt { color: var(--ok); border-color: currentColor; }
.status-abgelehnt { color: var(--bad); border-color: currentColor; }
.status-erledigt { color: var(--ink-3); border-color: var(--line-strong); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); padding: 1px 8px; border-radius: 6px; }
.tag-warn { color: var(--warn); }
.pill-pending { color: var(--warn); } .pill-active { color: var(--ok); } .pill-blocked { color: var(--bad); }

/* Wissensdatenbank */
.search { display: flex; gap: 8px; }
.search input { font-size: 1.1rem; min-height: 54px; }
.search .btn { min-height: 54px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 20px; }
.filters a { text-decoration: none; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 13px; font-size: .9rem; background: var(--surface); }
.filters a.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.filters .count { color: inherit; opacity: .65; margin-left: 4px; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.result a { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
.result a:hover { border-color: var(--line-strong); border-left-color: var(--brand); }
.result .t { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.result .s { color: var(--ink-2); font-size: .93rem; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result .m { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.code-chip { font-family: var(--mono); font-size: .8rem; font-weight: 700; background: var(--ink); color: var(--surface); padding: 1px 7px; border-radius: 5px; }

.article h1 { margin-bottom: 12px; }
.article section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.article section h2 { margin: 0 0 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.article section ol, .article section ul { margin: 0; padding-left: 1.3em; }
.article section li { margin: 6px 0; }
.article .steps ol li { padding-left: 4px; }
.safety { border: 2px solid var(--warn) !important; background: color-mix(in srgb, var(--warn) 8%, var(--surface)) !important; }
.safety h2 { color: var(--warn) !important; }
.feedback { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meta-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.meta-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.meta-list li:last-child { border-bottom: 0; }
.meta-list span:first-child { color: var(--ink-3); }

/* Fallverlauf */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.tl-item { position: relative; padding: 0 0 18px 18px; }
.tl-item::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tl-sfm::before { border-color: var(--accent); }
.tl-internal .tl-body { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.tl-meta { font-size: .88rem; color: var(--ink-2); }
.tl-body { margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; white-space: pre-wrap; }
.attachments { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.attachments a { display: flex; flex-direction: column; gap: 4px; width: 120px; font-size: .78rem; color: var(--ink-2); text-decoration: none; word-break: break-all; }
.attachments img, .file-icon { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.file-icon { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--bad); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: .95rem; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; font-weight: 600; word-break: break-word; }

/* Startseite */
.hero { padding: 32px 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 22ch; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
@media (max-width: 760px) { .steps-row { grid-template-columns: 1fr; } }
.steps-row .n { font-weight: 800; color: var(--ink-3); font-size: .85rem; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 1.2em; }
.placeholder { background: color-mix(in srgb, var(--warn) 15%, transparent); padding: 0 3px; border-radius: 3px; }

/* Ergänzungen */
.center { margin: 24px auto; }
.narrow-wide { max-width: 760px; }
.spread { justify-content: space-between; }
.section-gap { margin-top: 24px; }
.flush { margin-top: 0; }
.pre { white-space: pre-wrap; }
.select-auto { width: auto; min-width: 160px; }
.search .select-auto { flex: none; }
@media (max-width: 680px) { .search { flex-wrap: wrap; } .search .select-auto { flex: 1 1 100%; } }
.logo-preview { max-height: 60px; max-width: 220px; }
.bar-row { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
meter.bar { width: 100%; height: 10px; }
meter.bar::-webkit-meter-bar { background: var(--bg); border: 0; border-radius: 5px; }
meter.bar::-webkit-meter-optimum-value { background: var(--ink-2); border-radius: 5px; }
meter.bar::-moz-meter-bar { background: var(--ink-2); }
.setup-2fa { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 640px) { .setup-2fa { grid-template-columns: 1fr; } }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 6px; }
.secret { display: inline-block; margin-top: 6px; font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.dealer-hit { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
details summary { cursor: pointer; font-weight: 600; padding: 8px 0; }

.brand-pick { margin-top: 20px; }
.brand-pick h2 { margin-top: 0; }
.user-link { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
td:first-child a { white-space: nowrap; }
