/* DDoSGuard Panel v2 – Bausteine (aus muster/muster.css). */

/* ---------- Lagesatz: die eine Antwort ganz oben ---------- */
.lagesatz { max-width: 46rem; margin-bottom: var(--s-6); }
.lagesatz p:first-child { font-size: var(--fs-34); line-height: var(--lh-34); font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
.lagesatz p:first-child em { font-style: normal; color: var(--signal-text); }
.lagesatz p + p { margin-top: var(--s-2); color: var(--text-2); font-size: var(--fs-16); line-height: var(--lh-16); }
.stand { display: block; margin-top: var(--s-1); color: var(--text-3); font-size: var(--fs-13); line-height: var(--lh-13); }

/* ---------- Lagezeichen: Form + Farbe, nie Farbe allein ---------- */
.lz { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }             /* ok: Punkt */
.lz-tun { width: 9px; height: 9px; border-radius: 1px; background: var(--warn); transform: rotate(45deg); }                        /* braucht dich: Raute */
.lz-aus { background: transparent; border: 2px solid var(--text-3); }                                                             /* aus/pausiert/offline: Ring */
.lz-angriff { border-radius: 2px; background: var(--signal); position: relative; }                                                 /* Angriff: Quadrat */
.lz-angriff::after { content: ""; position: absolute; inset: 0; border-radius: 2px; border: 2px solid var(--signal); animation: welle 2s var(--ease) infinite; }
@keyframes welle { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lz-angriff::after { animation: none; opacity: 0; } }

/* ---------- Chips (Zustandswörter) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 var(--s-2); border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: var(--fs-12); font-weight: 500; white-space: nowrap; }
.chip-ok { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chip-tun { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn-text); }
.chip-aus { background: var(--surface-sunk); color: var(--text-2); }
.chip-angriff { border-color: var(--signal); background: var(--signal); color: var(--on-signal); font-weight: 600; }

/* ---------- Stufenanzeige (Pegel): Stufe 0–3, wirksame Anhebung in Signalrot ---------- */
.pegel { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.pegel i { width: 4px; border-radius: 1px; background: var(--line); }
.pegel i:nth-child(1) { height: 6px; } .pegel i:nth-child(2) { height: 10px; } .pegel i:nth-child(3) { height: 14px; }
.pegel i.an { background: var(--accent); }
.pegel i.auf { background: var(--signal); }
.pegel.is-ohne i { background: none; border: 1px dashed var(--line-strong); }     /* Art API/CDN: Stufe wirkt nicht */
.stufe { display: inline-flex; align-items: center; gap: var(--s-2); }
.stufe small { display: block; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--signal-text); font-weight: 500; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--h); padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); color: var(--text); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--d-1) var(--ease), border-color var(--d-1) var(--ease); }
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn:active { background: var(--selected); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--on-signal); font-weight: 600; }   /* nur Under Attack Mode einschalten */
.btn-signal:hover { background: var(--signal-hover); border-color: var(--signal-hover); color: var(--on-signal); }
.btn-signal:active { background: var(--signal-press); }
.btn-deep { background: var(--deep); border-color: var(--deep); color: var(--on-deep); font-weight: 600; }           /* endgültige/folgenreiche Bestätigung */
.btn-deep:hover { background: var(--deep-hover); border-color: var(--deep-hover); color: var(--on-deep); }
.btn-ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-onsignal { background: #fff; border-color: #fff; color: #9a2b15; font-weight: 600; }                              /* auf dem roten Lagebalken */
.btn-onsignal:hover { background: #fdf1ed; color: #9a2b15; }
.btn-sm { min-height: var(--h-sm); padding: 0 10px; font-size: var(--fs-13); }
.btn-lg { min-height: var(--h-lg); padding: 0 18px; font-size: var(--fs-16); }
.btn-icon { width: var(--h); padding: 0; }
.btn-icon.btn-sm { width: var(--h-sm); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-sunk); border-color: var(--line); color: var(--text-3); cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--on-accent); border-right-color: transparent; border-radius: 50%; animation: dreh .7s linear infinite; }
@keyframes dreh { to { transform: rotate(1turn); } }
.linkbtn { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Kopierbarer Wert */
.copy { display: inline-flex; align-items: center; gap: var(--s-1); max-width: 100%; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-sunk); font-family: var(--mono); font-size: var(--fs-13); }
.copy button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: var(--r-1); background: none; color: var(--text-3); cursor: pointer; }
.copy button:hover { background: var(--selected); color: var(--text); }

/* ---------- Hinweise (ganzer Rahmen, nie Seitenstreifen) ---------- */
.hinweis { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--accent-line); border-radius: var(--r-3); background: var(--accent-soft); color: var(--text); }
.hinweis > .ic { margin-top: 2px; color: var(--accent); }
.hinweis b, .hinweis h3 { font-size: var(--fs-14); font-weight: 600; }
.hinweis p { color: var(--text-2); }
.hinweis .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-self: center; }
.hinweis ul { margin-top: var(--s-1); display: grid; gap: 2px; }
.hinweis ul a { color: var(--warn-text); font-weight: 500; }
.hinweis-warn { border-color: var(--warn-line); background: var(--warn-soft); }
.hinweis-warn > .ic { color: var(--warn-text); }
.hinweis-neutral { border-color: var(--line); background: var(--surface-sunk); }
.hinweis-neutral > .ic { color: var(--text-3); }

/* ---------- Lagebalken: Angriff (einzige rote Fläche des Panels) ---------- */
.lage { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-4) var(--s-6); padding: var(--s-5); border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface-sunk); }
.lage h2 { font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; letter-spacing: -.015em; }
.lage p { margin-top: var(--s-1); max-width: 40rem; color: var(--text-2); }
.lage dl { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin-top: var(--s-4); }
.lage dt { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-3); }
.lage dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.lage-tun { border-color: var(--warn-line); background: var(--warn-soft); }                                   /* braucht dich */
.lage-angriff { border-color: var(--signal); background: var(--signal); color: var(--on-signal); }
.lage-angriff p { color: #fff; opacity: .92; }
.lage-angriff dt { color: #fff; opacity: .8; }
.lage-angriff :focus-visible { outline-color: #fff; }
.lage-angriff ::selection { background: #fff; color: #9a2b15; }

/* ---------- Website-Liste (Zeilen, keine Karten) ---------- */
.gruppe { margin-top: var(--s-6); }
.gruppe > h2 { display: flex; align-items: baseline; gap: var(--s-2); padding-bottom: var(--s-2); font-size: var(--fs-13); line-height: var(--lh-13); font-weight: 600; color: var(--text-2); }
.gruppe > h2 span { font-weight: 400; color: var(--text-3); }
.gruppe-angriff > h2 { color: var(--signal-text); }
.zeilen { border-bottom: 1px solid var(--line); }
.zeile { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1.5fr) minmax(0, 1fr) 104px 196px; align-items: center; gap: var(--s-2) var(--s-4); padding: 14px var(--s-3); border-top: 1px solid var(--line); transition: background var(--d-1) var(--ease); }
.zeile:hover { background: var(--surface-hover); }
.zeile-angriff { background: var(--signal-soft); border-top-color: var(--signal-line); }
.zeile-angriff + .zeile { border-top-color: var(--signal-line); }
.zeile-angriff:hover { background: var(--signal-soft); }
.zeile .wer { min-width: 0; }
.zeile .wer a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font: 600 var(--fs-16)/var(--lh-16) var(--mono); letter-spacing: -.02em; text-decoration: none; }
.zeile .wer a::after { content: ""; position: absolute; inset: 0; }                 /* ganze Zeile klickbar */
.zeile .wer a:focus-visible { outline: none; }
.zeile:has(.wer a:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-2); }
.zeile .wer p { color: var(--text-2); font-size: var(--fs-13); line-height: var(--lh-13); margin-top: 2px; }
.zeile-angriff .wer p { color: var(--signal-text); font-weight: 500; }
.zeile .feld { min-width: 0; font-size: var(--fs-13); line-height: var(--lh-13); }
.zeile .feld small { display: block; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-3); }
.zeile .feld .wert { font: 500 var(--fs-14)/var(--lh-14) var(--mono); font-variant-numeric: tabular-nums; }
.zeile .tun { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end; }
.zeile .tun > .ic { color: var(--text-3); }

/* ---------- Jetzt-Leiste: drei Raten + Verteilung ---------- */
.jetzt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.jetzt > div { padding: var(--s-4) var(--s-5); border-left: 1px solid var(--line); }
.jetzt > div:first-child { border-left: 0; }
.jetzt dt { display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-13); }
.jetzt dd { margin-top: var(--s-1); font: 600 var(--fs-26)/var(--lh-26) var(--mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.jetzt dd span { font: 400 var(--fs-13)/1 var(--font); letter-spacing: 0; color: var(--text-3); margin-left: 4px; }
.jetzt .anteil { grid-column: 1 / -1; display: flex; height: 8px; padding: 0; border: 0; border-top: 1px solid var(--line); gap: 2px; background: var(--bg); }
.jetzt .anteil i { display: block; height: 100%; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.sw-pass, .bg-pass { background: var(--data-pass); }
.sw-check, .bg-check { background: var(--data-check); }
.sw-block, .bg-block { background: var(--data-block); }

/* ---------- Diagramm (gestapelte Säulen je Zeitabschnitt) ---------- */
.legende { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--text-2); font-size: var(--fs-13); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; margin-top: var(--s-3); padding-left: 44px; }
.chart .plot { position: relative; height: 220px; border-bottom: 1px solid var(--line-strong); }
.chart svg { display: block; width: 100%; height: 100%; }
.chart .f-pass { fill: var(--data-pass); } .chart .f-check { fill: var(--data-check); } .chart .f-block { fill: var(--data-block); }
.chart .grid { stroke: var(--data-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .y { position: absolute; left: 0; top: 0; width: 36px; height: 220px; color: var(--text-3); font: 400 var(--fs-12)/1 var(--mono); text-align: right; }
.chart .y span { position: absolute; right: 0; transform: translateY(-50%); }
.chart .x { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-3); font: 400 var(--fs-12)/var(--lh-12) var(--mono); }
.chart .marke { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--signal); }
.chart .marke span { position: absolute; top: 0; left: 6px; padding: 1px 6px; border-radius: var(--r-1); background: var(--signal); color: var(--on-signal); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; }
.chartfoot { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin-top: var(--s-3); color: var(--text-2); font-size: var(--fs-13); }
.chartfoot b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Zweispaltiger Bereich ---------- */
.spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--s-7); }
.spalten .sechead { margin-top: var(--s-7); }

/* Faktenliste: Bezeichnung links, Zustand rechts */
.fakten > div { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px var(--s-3); align-items: baseline; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.fakten > div:last-child { border-bottom: 1px solid var(--line); }
.fakten .lz { align-self: center; grid-row: 1; }
.fakten dt { font-weight: 600; }
.fakten dd { grid-column: 2; color: var(--text-2); font-size: var(--fs-13); line-height: var(--lh-13); }

/* Balkenliste: Blockiert nach Grund */
.balken li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); padding: 10px 0; border-top: 1px solid var(--line); }
.balken li:last-child { border-bottom: 1px solid var(--line); }
.balken .wert { font: 500 var(--fs-13)/var(--lh-14) var(--mono); font-variant-numeric: tabular-nums; }
.balken .spur { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--data-grid); overflow: hidden; }
.balken .spur i { display: block; height: 100%; border-radius: 3px; background: var(--data-block); }

/* ---------- Tabellen ---------- */
.tblwrap { border: 1px solid var(--line); border-radius: var(--r-3); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-13); line-height: var(--lh-13); }
.tbl th { padding: 10px var(--s-3); background: var(--surface-sunk); color: var(--text-3); font-size: var(--fs-12); font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px var(--s-3); border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tbody tr:hover td { background: var(--surface-hover); }
.tbl .r { text-align: right; }
.tbl .mono { font-size: var(--fs-13); }
.tbl td b { font-weight: 600; }
.tbl td small { display: block; white-space: nowrap; color: var(--text-3); font-size: var(--fs-12); line-height: var(--lh-12); }
.tbl .zustand { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; font-weight: 500; }
.tbl tr.is-aus td { color: var(--text-3); }
.tbl tr.is-aus td b { color: var(--text-2); }
.tbl .aktionen { display: flex; justify-content: flex-end; gap: var(--s-1); }
.meter { white-space: nowrap; display: inline-grid; grid-template-columns: 48px auto; align-items: center; gap: var(--s-2); }
.meter i { display: block; height: 6px; border-radius: 3px; background: var(--data-grid); overflow: hidden; }
.meter i::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--text-3); border-radius: 3px; }
.meter.is-hoch i::after { background: var(--warn); }

/* ---------- Formulare ---------- */
.form { display: grid; gap: var(--s-6); max-width: var(--form-max); }
.formgrid { display: grid; grid-template-columns: minmax(0, var(--form-max)) minmax(0, 300px); gap: var(--s-7); align-items: start; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fs { display: grid; gap: var(--s-4); }
.fs > legend, .fs > h2 { padding: 0; margin-bottom: var(--s-1); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 600; }
.fs > legend + p, .fs > .lead { color: var(--text-2); margin-top: calc(var(--s-3) * -1); }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 500; }
.field .opt { font-weight: 400; color: var(--text-3); }
.hint { color: var(--text-3); font-size: var(--fs-13); line-height: var(--lh-13); }
.input, .select select, .textarea { width: 100%; min-height: var(--h); padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); color: var(--text); caret-color: var(--accent); transition: border-color var(--d-1) var(--ease), box-shadow var(--d-1) var(--ease); }
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .select select:hover { border-color: var(--text-2); }
.input:focus-visible, .select select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: var(--r-2); }
.input[aria-invalid="true"], .select select[aria-invalid="true"] { border-color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-text); background: var(--warn-soft); }
.input[disabled], .select select[disabled] { background: var(--surface-sunk); border-color: var(--line); color: var(--text-3); }
.input.mono { font-family: var(--mono); font-size: var(--fs-13); }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 32px; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--text-3); pointer-events: none; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.err { display: flex; align-items: flex-start; gap: 6px; color: var(--warn-text); font-size: var(--fs-13); line-height: var(--lh-13); font-weight: 500; }
.err .ic { width: 14px; height: 14px; margin-top: 2px; }

/* Schalter */
.schalter { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; }
.schalter input { appearance: none; flex: none; width: 36px; height: 20px; margin: 0; border-radius: var(--r-full); background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--d-2) var(--ease); }
.schalter input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--d-2) var(--ease); }
.schalter input:checked { background: var(--accent); }
.schalter input:checked::after { transform: translateX(16px); background: var(--on-accent); }
.schalter b { display: block; font-weight: 500; }
.schalter span span { display: block; color: var(--text-3); font-size: var(--fs-13); line-height: var(--lh-13); }

/* Auswahlzeilen (Radio mit Erklärung) */
.wahl { display: grid; border: 1px solid var(--line-strong); border-radius: var(--r-2); overflow: hidden; background: var(--surface); }
.wahl label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px var(--s-3); padding: 10px var(--s-3); border-top: 1px solid var(--line); cursor: pointer; }
.wahl label:first-child { border-top: 0; }
.wahl label:hover { background: var(--surface-hover); }
.wahl label:has(input:checked) { background: var(--selected); }
.wahl input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); cursor: pointer; }
.wahl input:checked { border: 5.5px solid var(--accent); }
.wahl b { font-weight: 500; }
.wahl span { grid-column: 2; color: var(--text-2); font-size: var(--fs-13); line-height: var(--lh-13); }
.wahl-reihe { grid-auto-flow: column; grid-auto-columns: 1fr; }
.wahl-reihe label { border-top: 0; border-left: 1px solid var(--line); grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 10px var(--s-2); }
.wahl-reihe label:first-child { border-left: 0; }
.wahl-reihe input { position: absolute; opacity: 0; }
.wahl-reihe label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.wahl-reihe label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -4px; }

/* Bedingungs-Editor (Regel-Engine) */
.bed { display: grid; gap: var(--s-2); }
.bed-zeile { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) var(--h); gap: var(--s-2); align-items: start; }
.bed-zeile .verb { align-self: center; color: var(--text-3); font-size: var(--fs-13); }
.bed-zeile .err { grid-column: 2 / -1; }

.savebar { position: sticky; bottom: 0; z-index: var(--z-bar); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-6); padding: var(--s-3) 0; background: var(--bg); border-top: 1px solid var(--line); }
.savebar .hint { margin-left: auto; }

.merk { position: sticky; top: var(--s-5); display: grid; gap: var(--s-4); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-sunk); font-size: var(--fs-13); line-height: var(--lh-14); }
.merk h2 { font-size: var(--fs-13); font-weight: 600; }
.merk p { color: var(--text-2); }
.merk .satz { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); color: var(--text); }
.merk .satz code { font-family: var(--mono); font-size: var(--fs-12); background: var(--surface-sunk); padding: 1px 4px; border-radius: 3px; }
.merk .satz mark { background: var(--warn-soft); color: var(--warn-text); padding: 0 3px; border-radius: 3px; }

/* ---------- Dialoge ---------- */
.dlg { position: fixed; inset: 0; z-index: var(--z-overlay); display: none; place-items: center; padding: var(--s-4); background: var(--scrim); }
.dlg.is-open { display: grid; }
.dlg-box { width: min(100%, 480px); max-height: calc(100dvh - 32px); overflow: auto; padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-2); display: grid; gap: var(--s-4); }
.dlg-box h2 { font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.dlg-box h2 .mono { white-space: nowrap; }
.dlg-box p { color: var(--text-2); }
.dlg-box .folgen { display: grid; gap: var(--s-2); }
.dlg-box .folgen li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--s-2); color: var(--text-2); }
.dlg-box .folgen li::before { content: ""; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--text-3); }
.dlg-box .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-2); }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: var(--z-toast); display: grid; gap: var(--s-2); }
.toast { display: flex; align-items: center; gap: var(--s-3); max-width: 420px; padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--deep); color: var(--on-deep); box-shadow: var(--shadow-1); font-weight: 500; }
.toast .ic { color: var(--mint); }
:root[data-theme="dark"] .toast .ic { color: var(--seegruen); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast .ic { color: var(--seegruen); } }

/* ---------- Lade- und Leerzustand ---------- */
.skel { display: block; height: 14px; border-radius: var(--r-1); background: linear-gradient(90deg, var(--surface-sunk) 25%, var(--selected) 50%, var(--surface-sunk) 75%) 0 0 / 200% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .btn.is-busy::after { animation-duration: 2s; } }
.leer { display: grid; justify-items: start; gap: var(--s-2); padding: var(--s-6) var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--r-3); color: var(--text-2); }
.leer h3 { font-size: var(--fs-16); font-weight: 600; color: var(--text); }

.quelle { margin-top: var(--s-7); padding-top: var(--s-3); border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-12); }
.quelle a { color: var(--text-3); }

/* ---------- Handy-Aktionsleiste: Under Attack Mode immer in Daumenreichweite ---------- */
.aktionsleiste { display: none; }

/* ============ Breakpoints ============ */
/* < 1100: Zusatzspalten einklappen */
@media (max-width: 1099px) {
  .page { padding: var(--s-5) var(--s-5) var(--s-8); }
  .formgrid { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .merk { position: static; }
  .spalten { grid-template-columns: minmax(0, 1fr); }
}
/* < 900: Navigation wird Schublade, Kopfleiste erscheint */
@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { position: sticky; top: 0; z-index: var(--z-bar); display: flex; align-items: center; gap: var(--s-2); height: 56px; padding: 0 var(--s-3); background: var(--bg-nav); border-bottom: 1px solid var(--line); }
  .topbar .brand { font-size: var(--fs-14); }
  .topbar .ort { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); min-width: 0; font: 600 var(--fs-13)/1 var(--mono); }
  .nav { position: fixed; inset: 0 auto 0 0; z-index: var(--z-nav); width: min(86vw, 320px); transform: translateX(-102%); visibility: hidden; transition: transform var(--d-3) var(--ease), visibility 0s var(--d-3); box-shadow: var(--shadow-2); }
  .nav.is-open { transform: none; visibility: visible; transition: transform var(--d-3) var(--ease); box-shadow: 0 0 0 100vmax var(--scrim); }
  .nav .navzu { display: inline-flex; }
  .navlink { min-height: 44px; }
}
/* < 640: einspaltig, Tabellen werden Listen, Bedienelemente 44 px */
@media (max-width: 639px) {
  body { font-size: var(--fs-14); }
  .input, .select select, .textarea { font-size: 1rem; }         /* verhindert iOS-Zoom */
  .page { padding: var(--s-4) var(--s-4) 120px; }
  .pagehead h1 { font-size: var(--fs-20); line-height: var(--lh-20); }
  .lagesatz p:first-child { font-size: var(--fs-26); line-height: var(--lh-26); }
  .sechead { margin-top: var(--s-6); }
  .hinweis { grid-template-columns: auto minmax(0, 1fr); }
  .hinweis .actions { grid-column: 2; }

  .zeile { grid-template-columns: 14px minmax(0, 1fr) auto; padding: 14px var(--s-1); }
  .zeile .feld { grid-column: 2; grid-row: auto; }
  .zeile .feld + .feld { display: none; }                         /* Rate nur in der Website selbst */
  .zeile .tun { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
  .zeile .tun .btn, .zeile .tun .chip { display: none; }
  .zeile .wer a { white-space: normal; overflow-wrap: anywhere; }                             /* Aktion steckt in der Zeile selbst */

  .lage { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .lage .btn { display: none; }                                   /* Aktion sitzt in der Aktionsleiste */
  .lage dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
  .jetzt > div { padding: var(--s-3) 10px; }
  .jetzt dt { font-size: var(--fs-12); gap: 6px; }
  .jetzt dd { font-size: var(--fs-20); line-height: var(--lh-20); }
  .jetzt dd span { display: block; margin: 2px 0 0; }
  .chart { padding-left: 36px; }
  .chart .plot, .chart .y { height: 160px; }
  .chart .y { width: 30px; }

  .aktionsleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar); display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .aktionsleiste .btn { flex: 1; min-height: 48px; }

  .tblwrap { border: 0; border-radius: 0; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--line); }
  .tbl td, .tbl tbody tr:first-child td { padding: 0; border: 0; }
  .tbl tbody tr:hover td { background: none; }
  .tbl td[data-l]::before { content: attr(data-l); display: block; color: var(--text-3); font: 400 var(--fs-12)/var(--lh-12) var(--font); }
  .tbl td.voll { grid-column: 1 / -1; }
  .tbl .r { text-align: left; }
  .tbl .aktionen { justify-content: flex-start; }

  .bed-zeile { grid-template-columns: minmax(0, 1fr) var(--h); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); }
  .bed-zeile > * { grid-column: 1 / -1; }
  .bed-zeile > .verb { grid-column: 1; }
  .bed-zeile > .btn-icon { grid-column: 2; grid-row: 1; }
  .bed-zeile .err { grid-column: 1 / -1; }
  .wahl-reihe { grid-auto-flow: row; }
  .wahl-reihe label { border-left: 0; border-top: 1px solid var(--line); justify-items: start; text-align: left; padding: 12px var(--s-3); }
  .savebar { position: fixed; left: 0; right: 0; padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); margin: 0; }
  .savebar .btn { flex: 1; }
  .savebar .hint { display: none; }

  .dlg { place-items: end stretch; padding: 0; }
  .dlg-box { width: 100%; border-radius: var(--r-3) var(--r-3) 0 0; border-width: 1px 0 0; padding: var(--s-5) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); }
  .dlg-box .actions { flex-direction: column-reverse; }
  .dlg-box .actions .btn { width: 100%; min-height: 48px; }
  .toasts { left: var(--s-4); right: var(--s-4); bottom: 84px; }
}
