/* Gestaltung: Marineblau aus dem Logo (Initialen) als Hauptfarbe, Gold nur als feine Linie, ruhiger heller Grund,
   weiche Karten statt Kästen. Große Schrift und große Tippflächen bleiben – die App ist für Menschen ohne PC-Erfahrung. */
:root {
  --marine: #24427a; --marine-tief: #172e57; --marine-hell: #e9eef7; --marine-linie: #c5cfe2;
  --gold: #c9a44c; --gold-hell: #f7efd9; --gold-linie: #e4d3a3;
  --grund: #f4f6fa; --weiss: #ffffff; --text: #182234; --leise: #4f5a70; --linie: #dfe4ed;
  --gruen: #1d6b4c; --gruen-hell: #e3f2ea; --rot: #a3262b; --rot-hell: #fbe9ea;
  --schatten: 0 1px 2px rgba(23, 46, 87, .06), 0 4px 14px rgba(23, 46, 87, .07);
  --schatten-hoch: 0 2px 4px rgba(23, 46, 87, .10), 0 10px 24px rgba(23, 46, 87, .12);
  --abstand: 16px; --schrift: 20px; --rund: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--schrift)/1.45 var(--sans); color: var(--text); background: var(--grund); display: flex; flex-direction: column;
       -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.versteckt { display: none !important; }
.unsichtbar { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
:focus-visible { outline: 3px solid var(--marine); outline-offset: 2px; }

/* ---------- Kopf: Logo · Umschalter · Sprache, darunter eine feine Goldlinie */
.kopf { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(10px);
        -webkit-backdrop-filter: saturate(1.4) blur(10px); padding: max(10px, env(safe-area-inset-top)) 10px 10px;
        box-shadow: 0 1px 0 var(--linie); }
.kopf::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
               background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-linie) 50%, var(--gold) 80%, transparent); opacity: .7; }
.tabs { display: flex; gap: 8px; align-items: center; max-width: 720px; margin: 0 auto; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 50%; box-shadow: 0 1px 3px rgba(23, 46, 87, .25); }
.umschalter { flex: 1; display: flex; gap: 4px; padding: 4px; background: var(--marine-hell); border-radius: 16px; min-width: 0; }
.tab { flex: 1; min-height: 52px; border: 0; background: transparent; color: var(--marine); border-radius: 12px;
       font-weight: 650; font-size: 16px; padding: 4px 6px; line-height: 1.2; min-width: 0; }
.tab.aktiv { background: var(--weiss); color: var(--marine-tief); box-shadow: 0 1px 2px rgba(23, 46, 87, .12), 0 2px 8px rgba(23, 46, 87, .10); }
.sprachen { display: flex; flex-direction: column; gap: 4px; flex: none; }
.flagge { width: 44px; height: 26px; font-size: 18px; line-height: 1; padding: 0; border-radius: 8px;
          border: 1.5px solid transparent; background: transparent; opacity: .45; filter: saturate(.6); }
.flagge.aktiv { border-color: var(--gold); background: var(--weiss); opacity: 1; filter: none; }

main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ansicht { padding: var(--abstand); max-width: 720px; margin: 0 auto; }
.titel { font-size: 26px; margin: 4px 0 12px; color: var(--marine-tief); letter-spacing: -.01em; }

/* ---------- Chat */
.verlauf { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.blase { max-width: 94%; padding: 15px 17px; border-radius: var(--rund); white-space: pre-wrap; word-wrap: break-word; scroll-margin-top: 12px; }
.blase.programm { background: var(--weiss); align-self: flex-start; border-bottom-left-radius: 6px; box-shadow: var(--schatten); }
.blase.person { background: var(--marine); color: var(--weiss); align-self: flex-end; border-bottom-right-radius: 6px; }
.blase.hinweis { background: var(--gold-hell); box-shadow: none; border: 1px solid var(--gold-linie); }
.blase.info { background: transparent; box-shadow: none; color: var(--leise); padding: 4px 6px; font-size: 18px; }
.blase.fehler, .blase.stopp { background: var(--rot-hell); box-shadow: none; border: 1px solid #e9b8bb; }
.blase.fertig { background: var(--gruen-hell); box-shadow: none; border: 1px solid #b7dcc8; font-weight: 600; }
.blase.vorschau { border: 1px solid var(--gold-linie); box-shadow: var(--schatten-hoch); }
.blase.start { box-shadow: var(--schatten); }

.knoepfe { display: flex; flex-direction: column; gap: 10px; align-self: stretch; margin-top: 2px; }
.knopf { min-height: 60px; width: 100%; border-radius: 16px; border: 1.5px solid var(--marine-linie); background: var(--weiss);
         color: var(--marine-tief); font-weight: 650; text-align: left; padding: 12px 18px; display: block; text-decoration: none;
         box-shadow: 0 1px 2px rgba(23, 46, 87, .05); transition: transform .08s, box-shadow .15s; }
.knopf.haupt { background: linear-gradient(180deg, #2b4d8a, var(--marine) 55%, #1f3a6c); border-color: transparent; color: var(--weiss);
               box-shadow: 0 1px 2px rgba(23, 46, 87, .2), 0 6px 16px rgba(36, 66, 122, .25); }
.knopf.gruen { background: linear-gradient(180deg, #23795a, var(--gruen)); border-color: transparent; color: var(--weiss);
               box-shadow: 0 6px 16px rgba(29, 107, 76, .25); }
.knopf.leise { border-color: var(--linie); color: var(--leise); font-weight: 600; }
.knopf:active { transform: scale(.985); }
.knopf[disabled] { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .knopf { transition: none; } .knopf:active { transform: none; } }

/* ---------- Eingabe */
.eingabe { position: sticky; bottom: 0; background: rgba(255, 255, 255, .97); box-shadow: 0 -1px 0 var(--linie), 0 -6px 18px rgba(23, 46, 87, .05);
           padding: 10px 10px max(10px, env(safe-area-inset-bottom)); }
.eingabe-zeile { display: flex; gap: 8px; align-items: flex-end; max-width: 720px; margin: 0 auto; }
textarea { flex: 1; font: inherit; min-height: 58px; max-height: 40vh; resize: none; border: 1.5px solid var(--marine-linie);
           border-radius: 16px; padding: 14px 15px; background: var(--weiss); color: var(--text); }
textarea:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 4px rgba(36, 66, 122, .15); }
.senden { min-height: 58px; min-width: 104px; border: none; border-radius: 16px; color: var(--weiss); font-weight: 700;
          background: linear-gradient(180deg, #2b4d8a, var(--marine) 55%, #1f3a6c); box-shadow: 0 4px 12px rgba(36, 66, 122, .25); }
.eingabe-hilfe { display: flex; justify-content: flex-end; max-width: 720px; margin: 4px auto 0; }
.link { background: none; border: none; color: var(--rot); text-decoration: underline; text-underline-offset: 3px; font-size: 18px; padding: 8px 4px; }

/* ---------- Meine Rechnungen */
.suche { width: 100%; font: inherit; min-height: 56px; border: 1.5px solid var(--marine-linie); border-radius: 16px; padding: 10px 16px;
         background: var(--weiss); color: var(--text); }
.suche:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 4px rgba(36, 66, 122, .15); }
.filter { display: flex; gap: 10px; align-items: center; margin: 12px 2px 16px; font-size: 19px; color: var(--leise); }
.filter input { width: 26px; height: 26px; accent-color: var(--marine); }
.karte { display: block; width: 100%; text-align: left; background: var(--weiss); color: var(--text); border: 1px solid var(--linie);
         border-radius: var(--rund); padding: 14px 44px 14px 16px; margin-bottom: 10px; position: relative; box-shadow: var(--schatten); }
.karte::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 32px; color: var(--marine-linie); }
.karte:active { background: var(--marine-hell); }
.karte .zeile1 { display: block; font-weight: 700; font-size: 20px; color: var(--marine-tief); }
.karte .zeile2 { display: block; color: var(--leise); font-size: 17px; margin: 2px 0 6px; white-space: pre-line; }
.jahr { margin-bottom: 18px; }
.jahr-kopf { list-style: none; display: flex; align-items: baseline; gap: 12px; cursor: pointer; padding: 12px 4px 10px; margin-bottom: 6px;
             border-bottom: 1.5px solid var(--gold-linie); }
.jahr-kopf::-webkit-details-marker { display: none; }
.jahr-kopf::before { content: "▸"; color: var(--gold); font-size: 20px; }
.jahr[open] > .jahr-kopf::before { content: "▾"; }
.jahr-zahl { font-size: 28px; font-weight: 750; color: var(--marine-tief); letter-spacing: -.01em; }
.jahr-info, .monat-info { color: var(--leise); font-size: 17px; }
.monat-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 18px 4px 8px; }
.monat-name { font-size: 21px; font-weight: 700; color: var(--marine-tief); }
.knopf.klein { min-height: 50px; font-size: 18px; margin: 2px 0 8px; background: transparent; box-shadow: none; text-align: center; }
.marke { display: inline-block; font-size: 16px; font-weight: 650; padding: 3px 12px; border-radius: 999px; margin: 6px 0 0; }
.marke.offen { background: var(--gold-hell); color: #7a5a12; }
.marke.bezahlt { background: var(--gruen-hell); color: var(--gruen); }
.marke.ueberfaellig { background: var(--rot-hell); color: var(--rot); }
.marke.storno { background: #eceef3; color: var(--leise); }
.leer { color: var(--leise); text-align: center; padding: 24px 8px; }

/* ---------- Rechnung ansehen */
.betrachter { position: fixed; inset: 0; background: #e7eaf1; z-index: 30; display: flex; flex-direction: column; }
.betrachter-kopf { display: flex; gap: 12px; align-items: center; padding: max(10px, env(safe-area-inset-top)) 12px 10px;
                   background: var(--weiss); box-shadow: 0 1px 0 var(--linie); }
.betrachter-kopf .knopf { width: auto; min-width: 140px; text-align: center; min-height: 52px; }
#betrachter-titel { font-weight: 700; font-size: 19px; color: var(--marine-tief); min-width: 0; }
.seiten { flex: 1; min-height: 34vh; overflow-y: auto; padding: 14px; }
.seiten img { width: 100%; max-width: 720px; display: block; margin: 0 auto 14px; background: var(--weiss); border-radius: 4px;
              box-shadow: 0 2px 6px rgba(23, 46, 87, .12), 0 12px 28px rgba(23, 46, 87, .12); }
.betrachter-knoepfe { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px max(12px, env(safe-area-inset-bottom));
                      max-height: 58%; overflow-y: auto; flex: none;
                      background: var(--weiss); box-shadow: 0 -1px 0 var(--linie), 0 -8px 20px rgba(23, 46, 87, .06); }
.hilfe-text { font-size: 17px; color: var(--leise); margin: 0; white-space: pre-line; }
.hilfe-text:empty { display: none; }
.aktionen { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.aktionen .knopf { text-align: center; padding: 8px 4px; min-height: 64px; display: flex; flex-direction: column; align-items: center;
                  justify-content: center; gap: 2px; line-height: 1.15; }
.aktionen .symbol { font-size: 22px; line-height: 1; }
.aktionen .wort { font-size: 17px; }
.weitere-aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.weitere-aktionen .knopf { min-height: 48px; font-size: 17px; padding: 8px 12px; }
@media (max-width: 380px) { .aktionen .wort { font-size: 16px; } .weitere-aktionen { grid-template-columns: 1fr; } .tab { font-size: 15px; } }

/* ---------- Rückfrage-Fenster, Anmeldung */
.overlay { position: fixed; inset: 0; background: rgba(15, 26, 48, .45); display: flex; align-items: center; justify-content: center;
           padding: 16px; z-index: 40; }
.dialog-box { background: var(--weiss); border-radius: 22px; padding: 22px; max-width: 480px; width: 100%; box-shadow: var(--schatten-hoch); }
.dialog-knoepfe { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tippt { color: var(--leise); font-style: italic; box-shadow: none !important; background: transparent !important; }
.gross { font-size: 22px; }
.anmelde-logo { display: block; width: 112px; height: 112px; margin: 28px auto 8px; border-radius: 50%; box-shadow: var(--schatten-hoch); }
.anmelden { text-align: center; }
.code-anmeldung { display: grid; gap: 12px; margin: 16px 4px; }
.code-feld { font-size: 28px; letter-spacing: .12em; text-align: center; }
.code-anmeldung .knopf { justify-content: center; text-align: center; }

/* ---------- Verwaltungsseite (Hilfsperson) */
.vw { max-width: 640px; margin: 0 auto; padding-bottom: 40px; }
.vw-kopf { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.vw-kopf .titel { margin: 0; }
.vw-karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--rund); padding: 16px; margin-bottom: 14px;
            box-shadow: var(--schatten); display: grid; gap: 10px; }
.vw-karte h2 { margin: 0; font-size: 21px; color: var(--marine-tief); }
.vw-karte.rot { border-color: #d9a3a3; background: #fdf3f3; }
.vw-leise { color: var(--leise); margin: 0; font-size: 17px; }
.vw-hinweis { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--grund); font-size: 16px; overflow-wrap: anywhere; }
.vw-pre { white-space: pre-wrap; font-size: 14px; max-height: 50vh; overflow: auto; background: var(--grund); padding: 10px; border-radius: 12px; }
.vw-code { font-size: 32px; letter-spacing: .12em; text-align: center; margin: 0; font-weight: 700; color: var(--marine-tief); }
.vw-geraet { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--linie); }
.vw-geraet:last-child { border-bottom: 0; }
.vw-klein { width: auto; min-height: 44px; padding: 8px 14px; }
.vw-zeile { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ---------- Einrichtungsassistent */
.ew-schritte { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 12px; }
.ew-schritte li { font-size: 14px; padding: 6px 10px; border-radius: 999px; background: var(--weiss); border: 1px solid var(--linie); color: var(--leise); }
.ew-schritte li.aktiv { border-color: var(--marine); color: var(--marine-tief); font-weight: 700; }
.ew-schritte li.ok { color: #1f7a55; }
.ew-form { display: grid; gap: 12px; }
.ew-feld { display: grid; gap: 6px; font-size: 16px; color: var(--marine-tief); border: 0; padding: 0; margin: 0; }
.ew-feld legend { margin-bottom: 6px; }
.ew-feld select { appearance: auto; }
.ew-wahl { display: flex; align-items: center; gap: 10px; font-size: 18px; min-height: 44px; }
.ew-wahl input { width: 24px; height: 24px; }
.ew-gruppe { display: grid; gap: 12px; padding: 12px; border-radius: 12px; background: var(--grund); }
.ew-schluessel { font-size: 15px; overflow-wrap: anywhere; user-select: all; }
.ew-fehler { white-space: pre-line; border: 1px solid #d9a3a3; background: #fdf3f3; }
#sich-status { white-space: pre-line; }

.vw-test { border-color: #e7c76b; background: #fffaf0; }
#test-stamm { white-space: pre-line; }
.test-marke { font: 700 12px/1 system-ui, sans-serif; letter-spacing: .08em; color: #b91c1c; background: #fde8e8;
              border: 1px solid #f3b9b9; border-radius: 999px; padding: 4px 8px; margin-left: 4px; }

/* Erster Start: die Person gibt ihre Geschäftsangaben ein */
.a-form { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }
.a-feld { display: flex; flex-direction: column; gap: 6px; font-weight: 650; color: var(--marine-tief); border: 0; padding: 0; margin: 0; min-width: 0; }
.a-feld legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.a-zeile { display: flex; gap: 10px; }
.a-zeile .a-feld { flex: 1; }
.a-zeile .a-plz { flex: 0 0 34%; }
.a-leise { color: var(--leise); font-weight: 400; font-size: 17px; margin: 0; }
.a-wahl { display: flex; gap: 12px; align-items: center; min-height: 58px; padding: 10px 14px; margin-bottom: 8px; border: 1.5px solid var(--marine-linie);
  border-radius: 16px; background: var(--weiss); font-weight: 600; color: var(--text); }
.a-wahl input { width: 26px; height: 26px; flex: none; accent-color: var(--marine); }
.a-wahl:has(input:checked) { border-color: var(--marine); background: var(--marine-hell); }
.a-feld.falsch input.suche, .a-feld.falsch .a-wahl { border-color: var(--rot); }
.a-feld.falsch > span, .a-feld.falsch legend { color: var(--rot); }
.a-fehlerbox { margin: 0; padding: 15px 17px; border-radius: var(--rund); background: var(--rot-hell); border: 1px solid #e9b8bb; }
.vw-version { display: block; font-size: 15px; margin-top: 2px; }
.vw-version.gut { color: var(--gruen); }
.vw-version.alt { color: #7a5a12; }
