/* fairment MHD-Alarm · durchgehende Bänder: Lila-Kopf mit Lage-Satz, gelbes Schrägband, Live-Lila „Jetzt handeln“, weiße Arbeitsfläche */
:root {
  --lila: #4C2087;
  --lila-tief: #2A1150;
  --live: #DDD7F7;
  --live-hell: #F3F0FD;
  --gelb: #F6DC8C;
  --orange: #F17218;
  --rot: #C8352B;
  --gruen: #2B8A57;
  --papier: #FFFFFF;
  --linie: #E4DFF6;
  --text-leise: #6B5C8A;
  --font: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --r-pille: 999px;
  --r-etikett: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { font-family: var(--font); color: var(--lila-tief); background: var(--papier); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--lila); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.innen { max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Kopf */
.kopf { background: var(--lila); color: var(--papier); }
.kopf-leiste { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.kopf-marke { display: flex; align-items: center; gap: 14px; color: var(--papier); text-decoration: none; font-weight: 700; }
.kopf-marke img { height: 34px; width: auto; filter: brightness(0) invert(1); }
.kopf-marke span { font-size: 15px; opacity: .85; border-left: 1px solid rgba(255,255,255,.35); padding-left: 14px; }
.kopf-nav { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.kopf-nav a, .kopf-nav button { white-space: nowrap; }
.kopf-nav a, .kopf-nav button { color: var(--papier); text-decoration: none; padding: 7px 14px; border-radius: var(--r-pille); font-size: 15px; font-weight: 600; background: none; border: 0; cursor: pointer; }
.kopf-nav a:hover, .kopf-nav button:hover, .kopf-nav a[aria-current="page"] { background: rgba(255,255,255,.14); }
.kopf-nav form { margin: 0; }

.lage { padding-block: 28px 44px; }
.lage h1.hinweis-titel { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.lage h1 { font-size: clamp(2.1rem, 5.2vw, 4.2rem); line-height: 1.04; font-weight: 800; margin: 0; letter-spacing: -.02em; max-width: 16ch; text-wrap: balance; }
.lage h1 .zahl { font-variant-numeric: tabular-nums; }
.lage-sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); margin: 18px 0 0; max-width: 52ch; opacity: .92; }
.ampel { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.ampel button { display: inline-flex; align-items: baseline; gap: 10px; border: 2px solid rgba(255,255,255,.4); background: transparent; color: var(--papier); border-radius: var(--r-pille); padding: 9px 18px; cursor: pointer; font-weight: 600; }
.ampel button b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ampel button[aria-pressed="true"] { background: var(--papier); color: var(--lila); border-color: var(--papier); }
.ampel i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; align-self: center; }

/* gelbes Schrägband: schräg zugeschnitten, Text bleibt gerade, oben Lila, unten Live-Lila */
.band-rahmen { background: linear-gradient(var(--lila) 50%, var(--live) 50%); }
.band { background: var(--gelb); color: var(--lila-tief); padding-block: 26px; clip-path: polygon(0 16px, 100% 0, 100% calc(100% - 16px), 0 100%); }
.band p { margin: 0; font-weight: 700; font-size: 15px; }
.band .leise { font-weight: 500; }

/* Jetzt handeln */
.handeln { background: var(--live); padding-block: 40px 56px; }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; margin: 0; letter-spacing: -.01em; }
.abschnitt-kopf p { margin: 0; color: var(--text-leise); max-width: 60ch; }
.etiketten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.etikett { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 18px; background: var(--papier); border-radius: var(--r-etikett); padding: 12px 18px 12px 12px; }
.countdown { background: var(--orange); color: var(--papier); border-radius: 10px; text-align: center; padding: 10px 6px; line-height: 1.1; }
.countdown b { display: block; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown small { font-size: 12px; font-weight: 600; }
.etikett[data-r="1"] .countdown, .etikett[data-r="2"] .countdown { background: var(--rot); }
.etikett-name { font-weight: 700; font-size: 1.08rem; }
.etikett-meta { color: var(--text-leise); font-size: 14px; }
.etikett-meta strong { color: var(--lila-tief); font-weight: 700; }
.etikett-zahlen { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text-leise); }
.etikett-zahlen b { display: block; color: var(--lila-tief); font-size: 1.2rem; font-weight: 800; }
.leer { background: var(--papier); border-radius: var(--r-etikett); padding: 22px; font-weight: 600; }

/* Arbeitsfläche */
.flaeche { padding-block: 60px; }
.flaeche + .flaeche { padding-top: 0; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 13px; fill: var(--text-leise); }
.chart .lbl { fill: var(--lila-tief); font-weight: 600; }
.legende { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-leise); margin: 0 0 18px; }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--lila-tief); color: var(--papier); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; max-width: 290px; z-index: 5; }
.tip strong { display: block; font-size: 14.5px; margin-bottom: 2px; }

.werkzeuge { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pillen { display: flex; gap: 8px; flex-wrap: wrap; }
.pillen button { border: 2px solid var(--live); background: var(--papier); color: var(--lila); border-radius: var(--r-pille); padding: 7px 16px; font-weight: 700; cursor: pointer; font-size: 14.5px; }
.pillen button[aria-pressed="true"] { background: var(--lila); border-color: var(--lila); color: var(--papier); }
.suche { flex: 1 1 220px; max-width: 340px; border: 2px solid var(--live); border-radius: var(--r-pille); padding: 8px 16px; color: var(--lila-tief); background: var(--papier); }
.tabwrap { overflow-x: auto; border-radius: var(--r-etikett); border: 2px solid var(--live); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { background: var(--live-hell); color: var(--lila); font-weight: 700; position: sticky; top: 0; cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
td.z, th.z { text-align: right; }
td.name { white-space: normal; min-width: 220px; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.stufe { display: inline-block; border-radius: var(--r-pille); padding: 2px 10px; font-weight: 700; font-size: 13px; color: var(--papier); }
.stufe[data-r="1"], .stufe[data-r="2"] { background: var(--rot); }
.stufe[data-r="3"], .stufe[data-r="4"] { background: var(--orange); }
.stufe[data-r="5"] { background: var(--gelb); color: var(--lila-tief); }
.stufe[data-r="6"] { background: var(--live); color: var(--lila); }
.stufe[data-r="7"] { background: #E3F2E9; color: var(--gruen); }
.pruef { color: var(--orange); font-weight: 700; }
.hinweis { color: var(--text-leise); font-size: 14px; max-width: 75ch; }
details.regeln { background: var(--live-hell); border-radius: var(--r-etikett); padding: 16px 20px; margin-top: 28px; }
details.regeln summary { font-weight: 700; cursor: pointer; color: var(--lila); }
details.regeln ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--lila-tief); font-size: 14.5px; }
.fuss { background: var(--lila-tief); color: rgba(255,255,255,.75); font-size: 13.5px; padding-block: 22px; }

/* Formulare: Login, Benutzer, Konto */
.formseite { min-height: 100vh; background: var(--lila); display: grid; place-items: center; padding: 24px; }
.formkarte { background: var(--papier); border-radius: 22px; padding: 34px; width: min(420px, 100%); }
.formkarte img { height: 40px; margin-bottom: 18px; }
.formkarte h1 { font-size: 1.8rem; font-weight: 800; margin: 0 0 6px; }
.formkarte p { margin: 0 0 20px; color: var(--text-leise); }
label { display: block; font-weight: 700; font-size: 14.5px; margin: 14px 0 6px; }
input[type=text], input[type=password] { width: 100%; border: 2px solid var(--live); border-radius: 12px; padding: 11px 14px; color: var(--lila-tief); background: var(--papier); }
input:focus { border-color: var(--lila); outline: none; }
.knopf { display: inline-block; background: var(--orange); color: var(--papier); border: 0; border-radius: var(--r-pille); padding: 12px 24px; font-weight: 800; cursor: pointer; margin-top: 20px; text-decoration: none; }
.knopf.leise { background: var(--live); color: var(--lila); }
.knopf.klein { padding: 6px 14px; margin: 0; font-size: 14px; font-weight: 700; }
.fehler { background: #FBE7E5; color: var(--rot); border-radius: 12px; padding: 10px 14px; font-weight: 600; margin-top: 14px; }
.ok-box { background: var(--gelb); border-radius: 14px; padding: 16px 18px; margin: 0 0 24px; }
.ok-box code { font-size: 1.15rem; font-weight: 800; background: var(--papier); padding: 3px 10px; border-radius: 8px; user-select: all; }
.verwaltung { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
.verwaltung .neu { background: var(--live-hell); border-radius: var(--r-etikett); padding: 22px; }
.verwaltung .neu h2 { font-size: 1.3rem; }
.checkzeile { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 14px; }
.aktionen { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.aktionen form { margin: 0; }

@media (max-width: 720px) {
  .etikett { grid-template-columns: 84px minmax(0, 1fr); }
  .etikett-zahlen { grid-column: 2; text-align: left; }
  .etikett-zahlen b { display: inline; margin-right: 6px; }
  .countdown b { font-size: 1.35rem; }
  .verwaltung { grid-template-columns: 1fr; }
  .lage { padding-block: 18px 36px; }
  .kopf-nav a, .kopf-nav button { padding: 6px 10px; font-size: 14px; }
  .kopf-marke span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .lage h1 { animation: rein .5s ease-out both; }
  @keyframes rein { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Regeln */
.unterkopf { font-size: 1.25rem; font-weight: 800; margin: 34px 0 6px; }
.regeltab td { vertical-align: middle; }
.regeltab td.name input[type=text] { font-weight: 700; padding: 8px 12px; }
.regeltab td.name input.bsp { font-weight: 500; font-size: 13.5px; margin-top: 6px; color: var(--text-leise); padding: 6px 12px; }
.regeltab input.tage { width: 88px; text-align: right; border: 2px solid var(--live); border-radius: 10px; padding: 7px 10px; color: var(--lila-tief); }
.regeltab small[data-monate] { display: block; color: var(--text-leise); font-size: 12px; min-height: 1em; margin-top: 3px; }
.regeltab select.kat { border: 2px solid var(--live); border-radius: 10px; padding: 7px 10px; color: var(--lila-tief); background: var(--papier); max-width: 300px; }
.checkzeile.ohne-abstand { margin: 0; white-space: nowrap; }
.speicherleiste { position: sticky; bottom: 0; background: var(--papier); padding: 14px 0 18px; display: flex; gap: 10px; align-items: center; border-top: 2px solid var(--live); margin-top: 24px; }
.speicherleiste .knopf { margin-top: 0; }

/* Benutzer */
.benutzertab td { vertical-align: middle; }
.rollenform { margin: 0; display: flex; gap: 6px; align-items: center; }
.rolle-fest { font-weight: 600; color: var(--text-leise); }
.neu-band { background: var(--live-hell); border-radius: var(--r-etikett); padding: 22px 24px; margin-top: 28px; }
.neu-band h2 { font-size: 1.3rem; }
.neu-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; align-items: end; }
.neu-felder .knopf { margin-top: 14px; width: 100%; }
select.kat.breit { width: 100%; max-width: none; padding: 11px 14px; border-radius: 12px; }
select.kat { appearance: none; -webkit-appearance: none; border: 2px solid var(--live); border-radius: 10px; padding: 7px 34px 7px 12px; color: var(--lila-tief); font-weight: 600; cursor: pointer;
  background: var(--papier) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234C2087' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; }
select.kat:focus { border-color: var(--lila); outline: none; }
select.kat.breit { padding: 11px 38px 11px 14px; }
.neu-felder input, .neu-felder select { height: 48px; }

/* Kommentare je Charge */
.notiz { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.notiz-text { margin: 0; flex-basis: 100%; background: var(--live-hell); border-left: 4px solid var(--gelb); border-radius: 8px; padding: 6px 10px; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.notiz-wer { color: var(--text-leise); font-size: 12.5px; }
.notiz-knopf { background: none; border: 0; padding: 2px 0; color: var(--lila); font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.notiz-knopf.neu { text-decoration: none; background: var(--live-hell); border-radius: var(--r-pille); padding: 4px 12px; }
.notiz-knopf:hover { color: var(--orange); }
.notiz.kompakt { margin-top: 0; }
td.notiz-zelle { white-space: normal; min-width: 220px; max-width: 320px; }
td.notiz-zelle .notiz-text { font-size: 13.5px; }
.notiz-dialog { border: 0; border-radius: 22px; padding: 28px; width: min(520px, calc(100vw - 32px)); color: var(--lila-tief); }
.notiz-dialog::backdrop { background: rgba(42, 17, 80, .55); }
.notiz-dialog h2 { font-size: 1.5rem; }
.notiz-charge { margin: 6px 0 0; color: var(--text-leise); font-weight: 600; }
.notiz-dialog textarea { width: 100%; border: 2px solid var(--live); border-radius: 12px; padding: 11px 14px; color: var(--lila-tief); font: inherit; resize: vertical; }
.notiz-dialog textarea:focus { border-color: var(--lila); outline: none; }
.notiz-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.notiz-knoepfe .knopf { margin-top: 0; }
.notiz-knoepfe [hidden] { display: none; }

/* ---------- Zahlungseingänge ---------- */
.ansichten { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.ansichten a { display: inline-flex; align-items: baseline; gap: 10px; border: 2px solid rgba(255,255,255,.4); color: var(--papier); border-radius: var(--r-pille); padding: 9px 18px; font-weight: 600; text-decoration: none; }
.ansichten a b { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ansichten a[aria-current="page"] { background: var(--papier); color: var(--lila); border-color: var(--papier); }
.modus { background: var(--live); color: var(--lila-tief); padding-block: 14px; font-size: 14.5px; }
.modus strong { color: var(--lila); }
td.betrag, .betrag { font-weight: 800; white-space: nowrap; }
.betrag.gross { font-size: 1.5rem; }
td.zweck { white-space: normal; min-width: 200px; max-width: 320px; overflow-wrap: anywhere; }
td.status { white-space: normal; min-width: 170px; }
td.aktion { white-space: normal; min-width: 230px; }
.leise { color: var(--text-leise); }
.kat-pille { display: inline-block; border-radius: var(--r-pille); padding: 2px 10px; font-weight: 700; font-size: 13px; background: var(--live); color: var(--lila); }
.kat-pille[data-farbe="gruen"] { background: #E3F2E9; color: var(--gruen); }
.kat-pille[data-farbe="orange"] { background: #FDE6D4; color: #A6480A; }
.kat-pille[data-farbe="rot"] { background: #FBE7E5; color: var(--rot); }
.kat-pille[data-farbe="gelb"] { background: var(--gelb); color: var(--lila-tief); }
.kat-pille[data-farbe="grau"] { background: #EEEBF3; color: var(--text-leise); }
form.zuordnen { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; }
form.zuordnen input { width: 112px; border: 2px solid var(--live); border-radius: 10px; padding: 6px 10px; color: var(--lila-tief); font-variant-numeric: tabular-nums; }
.leise-link { font-size: 13.5px; color: var(--text-leise); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leer { background: var(--live-hell); border-radius: var(--r-etikett); padding: 22px; font-weight: 600; }
.innen.schmal { max-width: 760px; }
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.vergleich section { background: var(--live-hell); border-radius: var(--r-etikett); padding: 18px 20px; }
.vergleich h3 { margin: 0 0 10px; font-size: 1.05rem; color: var(--lila); }
.vergleich-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; }
.vergleich-dl dt { color: var(--text-leise); font-weight: 600; }
.vergleich-dl dd { margin: 0; overflow-wrap: anywhere; }
.bestellliste { margin: 0; padding-left: 1.1em; }
.bestellliste li { margin-bottom: 6px; }
.summe { margin: 10px 0 0; }
.ok-box.warn { background: #FDE6D4; }
.fehler ul, .ok-box ul { margin: 6px 0 0; padding-left: 1.2em; }
.qr { display: flex; justify-content: center; margin: 6px 0 10px; }
.qr { background: #fff; padding: 8px; border-radius: 12px; }
.qr svg { display: block; width: min(260px, 100%); height: auto; shape-rendering: crispEdges; }
details.geheim { margin: 0 0 6px; font-size: 14px; }
details.geheim summary { cursor: pointer; color: var(--lila); font-weight: 700; }
details.geheim code { display: block; margin-top: 6px; font-size: 15px; font-weight: 700; letter-spacing: .05em; background: var(--live-hell); padding: 8px 10px; border-radius: 8px; user-select: all; overflow-wrap: anywhere; }
.klein-abstand { margin-top: 16px !important; }
button.scharf { background: var(--rot) !important; color: #fff !important; }
button:disabled { opacity: .6; cursor: progress; }
input[type=radio] { accent-color: var(--lila); }
@media (max-width: 720px) {
  .vergleich { grid-template-columns: 1fr; }
  .ansichten a { padding: 7px 14px; font-size: 14px; }
}
.anleitung { max-width: 860px; }
.anleitung section { padding-top: 28px; scroll-margin-top: 12px; }
.anleitung h3 { font-size: 1.35rem; font-weight: 800; margin: 0 0 10px; }
.anleitung p, .anleitung li { max-width: 72ch; }
.anleitung li { margin-bottom: 4px; }
.anleitung code { background: var(--live-hell); padding: 1px 6px; border-radius: 6px; }
.anleitung .tabwrap { margin: 12px 0 16px; }
.anleitung-tab td, .anleitung-tab th { white-space: normal; cursor: default; }
.anleitung-tab td:first-child { font-weight: 600; min-width: 150px; }
nav.inhalt { background: var(--live-hell); border-radius: var(--r-etikett); padding: 16px 22px; }
nav.inhalt ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 32px; }
nav.inhalt li { margin-bottom: 4px; break-inside: avoid; }
@media (max-width: 720px) { nav.inhalt ol { columns: 1; } }
