:root {
  --grund: #FBF8F3; --ink: #211A12; --muted: #8A8178; --line: #E8E2D8;
  --card: #FFFFFF; --akzent-a: #F9DD00; --akzent-b: #F70806; --ok: #2E7D46; --warn: #B3261E;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--grund); color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
}
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--grund); z-index: 10; }
.wortmarke { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.wortmarke::after { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 4px; background: linear-gradient(135deg, var(--akzent-a), var(--akzent-b)); }
.spacer { flex: 1; }
main { padding: 22px; max-width: 1100px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
button, input { font: inherit; }
button.primary { background: var(--ink); color: var(--grund); border: none; border-radius: 999px; padding: 10px 22px; font-weight: 700; cursor: pointer; }
button.primary:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--akzent-b); outline-offset: 2px; }
input[type=text], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 12px; }
.fehler { color: var(--warn); font-size: 14px; min-height: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: #F4EFE7; }
.klickbar:focus-visible { outline: 2px solid var(--akzent-b); outline-offset: -2px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.badge.interview { background: #FFF3C4; }
.badge.freigegeben { background: #DBEAFE; }
.badge.gebaut { background: #DCFCE7; }
.badge.build-fehler { background: #FEE2E2; color: var(--warn); }
.badge.abgenommen { background: #E9D5FF; }
.badge.live { background: var(--ink); color: var(--grund); }
.warn-flag { color: var(--warn); font-weight: 700; font-size: 12px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 380px; max-width: 100%; }
.login-card h1 { font-size: 20px; margin: 0 0 16px; }
.qr { display: block; margin: 12px auto; width: 180px; height: 180px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; background: #F4EFE7; padding: 8px; border-radius: 6px; }
.recovery-liste { columns: 2; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.detail-grid pre { white-space: pre-wrap; font-size: 12px; max-height: 420px; overflow-y: auto; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.chat .msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; }
.chat .user { align-self: flex-end; background: var(--ink); color: var(--grund); }
.chat .assistant { align-self: flex-start; background: #F4EFE7; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

/* --- Ergaenzungen Katalog + Konfigurator (Plan 09b Task 6) --- */

.topbar a.nav-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.topbar a.nav-link:hover { text-decoration: underline; }

.detail-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Katalog-Seite */
.gruppen-karte { margin-bottom: 18px; }
.gruppen-kopf { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.gruppen-kopf h2 { margin: 0; font-size: 18px; }
.badge.single { background: #DBEAFE; }
.badge.multi { background: #FFF3C4; }

.inline-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.inline-edit input[type=text] { width: auto; flex: 1 1 160px; margin-bottom: 0; }
.inline-edit input[type=number] { width: 90px; margin-bottom: 0; }

.gruppen-karte table td input[type=text],
.gruppen-karte table td input[type=number] { width: 100%; margin-bottom: 0; padding: 6px 8px; font-size: 13px; }
.gruppen-karte table td button { margin-right: 6px; }

.neue-option-formular { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.neue-option-formular input { width: auto; flex: 1 1 120px; margin-bottom: 0; }

/* Konfigurator-Seite */
.konf-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.konf-kopf h1 { margin: 0; font-size: 22px; }
.badge.entwurf { background: #FFF3C4; }
.badge.angebot { background: #DBEAFE; }
.badge.angenommen { background: #DCFCE7; }

.hinweis-block { background: #E9D5FF; border-radius: 10px; padding: 12px 16px; font-weight: 600; margin-bottom: 18px; }

#demoFrame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }

#matrix fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
#matrix legend { font-weight: 700; padding: 0 6px; }
.option-zeile { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.option-zeile:last-child { border-bottom: none; }
.option-text { flex: 1; }
.option-beschreibung { color: var(--muted); font-size: 13px; }

.sumleiste { display: flex; gap: 24px; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; padding: 14px 0; }
.praesentation .preis, .praesentation .sumleiste { display: none; }

#angebotPanel form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
#angebotErgebnis { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#angebotErgebnis input { flex: 1 1 260px; margin-bottom: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.warnhinweis { color: var(--warn); font-size: 13px; font-weight: 600; margin: 6px 0 0; width: 100%; }
