/* Minijob im Privathaushalt – Grundlayout
   Farben als Tokens; dunkler Modus über prefers-color-scheme. */

:root {
  --bg: #f6f4ef;
  --flaeche: #ffffff;
  --flaeche-2: #efece4;
  --text: #1d2422;
  --text-2: #55605c;
  --rand: #d9d4c8;
  --primaer: #1f5d4f;
  --primaer-hover: #174a3f;
  --primaer-text: #ffffff;
  --akzent: #c46a2b;
  --fokus: #2f7fd1;
  --gruen: #2e7d4f;
  --gelb: #b7791f;
  --rot: #b3261e;
  --info-bg: #e6f0ed;
  --warn-bg: #fbf1df;
  --fehler-bg: #fbe7e5;
  --erfolg-bg: #e3f2e8;
  --radius: 12px;
  --schatten: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111816;
    --flaeche: #19221f;
    --flaeche-2: #212c28;
    --text: #e8ece9;
    --text-2: #a7b3ae;
    --rand: #33413c;
    --primaer: #5fb39d;
    --primaer-hover: #78c5b0;
    --primaer-text: #0d1a16;
    --akzent: #e39a5f;
    --fokus: #7db5ee;
    --gruen: #6cc28f;
    --gelb: #e2b25c;
    --rot: #f08b84;
    --info-bg: #1b2d28;
    --warn-bg: #2f2716;
    --fehler-bg: #3a1e1c;
    --erfolg-bg: #1a2e22;
    --schatten: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primaer); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

h1 { font-size: 1.75rem; line-height: 1.2; margin: .25rem 0 .5rem; letter-spacing: -.01em; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; margin: 0; }
h3.unter { font-size: .95rem; font-weight: 600; color: var(--text-2); margin: 1rem 0 .5rem; }
.lead { font-size: 1.05rem; color: var(--text-2); margin: 0 0 1.5rem; max-width: 40em; }
.klein { font-size: .875rem; color: var(--text-2); }

.springen { position: absolute; left: -999px; top: 0; background: var(--flaeche); padding: .5rem 1rem; z-index: 10; }
.springen:focus { left: 1rem; }

/* ------------------------------------------------------------ Rahmen */

.kopfzeile {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem max(16px, env(safe-area-inset-left)) .75rem max(16px, env(safe-area-inset-right));
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky; top: 0; z-index: 5;
}
.marke { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.navi { display: flex; gap: .25rem; }
.navi a { padding: .4rem .75rem; border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 500; }
.navi a[aria-current] { background: var(--flaeche-2); color: var(--text); }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
}
.laden { color: var(--text-2); }

.fusszeile {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center;
  padding: 1rem 16px calc(1rem + env(safe-area-inset-bottom));
  font-size: .85rem; color: var(--text-2);
  border-top: 1px solid var(--rand);
}
.fusszeile a { color: var(--text-2); }

.update {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 16px; background: var(--info-bg); font-size: .95rem;
}

/* ------------------------------------------------------------ Knöpfe */

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .6rem 1.4rem;
  border: 1px solid var(--primaer); border-radius: 10px;
  background: var(--primaer); color: var(--primaer-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.knopf:hover { background: var(--primaer-hover); border-color: var(--primaer-hover); }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf--zweit { background: transparent; color: var(--primaer); }
.knopf--zweit:hover { background: var(--flaeche-2); }
.knopf--gross { min-height: 56px; font-size: 1.1rem; padding: .75rem 2rem; }
.knopf--klein { min-height: 40px; padding: .35rem .9rem; font-size: .9rem; }
.knopf--gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf--gefahr:hover { background: var(--rot); filter: brightness(.9); }

.aktionen { display: flex; gap: .75rem; justify-content: space-between; flex-wrap: wrap; margin-top: 1.5rem; }
.aktionen--links { justify-content: flex-start; }
.aktionen--start { justify-content: flex-start; margin: 1.5rem 0 1rem; }

/* ------------------------------------------------------------ Startseite */

.held { padding-top: 1rem; }
.held h1 { font-size: 2.1rem; }
.vorteile { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.vorteile li { padding-left: 1.75rem; position: relative; }
.vorteile li::before { content: "✓"; position: absolute; left: 0; color: var(--primaer); font-weight: 700; }

/* ------------------------------------------------------------ Karten */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.karte > h2 { margin-bottom: .75rem; }
.karte--gefahr { border-color: color-mix(in srgb, var(--rot) 40%, var(--rand)); }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.karte-kopf a { font-size: .9rem; }

.zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: .75rem 0; }
.zahlen div { background: var(--flaeche-2); border-radius: 10px; padding: .75rem; }
.zahlen span { display: block; font-size: .8rem; color: var(--text-2); }
.zahlen strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .zahlen { grid-template-columns: 1fr; } .zahlen div { display: flex; justify-content: space-between; align-items: baseline; } }

.liste { margin: 0; display: grid; gap: .4rem; }
.liste div { display: grid; grid-template-columns: 9rem 1fr; gap: .75rem; }
.liste dt { color: var(--text-2); }
.liste dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .liste div { grid-template-columns: 1fr; gap: 0; } .liste div + div { margin-top: .4rem; } }

.tabelle { width: 100%; border-collapse: collapse; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.tabelle th { text-align: left; font-weight: 400; padding: .4rem 0; }
.tabelle td { text-align: right; padding: .4rem 0 .4rem 1rem; white-space: nowrap; }
.tabelle tr + tr { border-top: 1px solid var(--rand); }
.tabelle .summe th, .tabelle .summe td { font-weight: 700; }

.aufklapp summary { cursor: pointer; color: var(--primaer); font-weight: 500; padding: .25rem 0; }

.ampel { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px; background: var(--flaeche-2); }
.ampel .punkt { width: .65rem; height: .65rem; border-radius: 50%; }
.ampel--gruen .punkt { background: var(--gruen); }
.ampel--gelb .punkt { background: var(--gelb); }
.ampel--rot .punkt { background: var(--rot); }
.ampel--rot { color: var(--rot); }

.aufgaben { list-style: none; margin: 0; padding: 0; }
.aufgaben li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; flex-wrap: wrap; }
.aufgaben li + li { border-top: 1px solid var(--rand); }
.aufgaben span { display: block; font-size: .9rem; color: var(--text-2); }
.aufgabe-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------ Hinweise */

.hinweis { border-radius: 10px; padding: .85rem 1rem; margin: 0 0 1rem; border-left: 4px solid; font-size: .95rem; }
.hinweis--info { background: var(--info-bg); border-color: var(--primaer); }
.hinweis--warnung { background: var(--warn-bg); border-color: var(--gelb); }
.hinweis--fehler { background: var(--fehler-bg); border-color: var(--rot); }
.hinweis--erfolg { background: var(--erfolg-bg); border-color: var(--gruen); }
.karte .hinweis { margin: .75rem 0 0; }

/* ------------------------------------------------------------ Assistent */

.schritte { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.25rem; counter-reset: s; }
.schritte li { flex: 1; display: flex; flex-direction: column; gap: .35rem; font-size: .8rem; color: var(--text-2); }
.schritte li::before { content: ""; height: 4px; border-radius: 2px; background: var(--rand); }
.schritte li.erledigt::before, .schritte li.aktiv::before { background: var(--primaer); }
.schritte li.aktiv { color: var(--text); font-weight: 600; }
.schritte .nr { display: none; }
@media (max-width: 520px) { .schritte .txt { display: none; } .schritte li.aktiv .txt { display: inline; } .schritte li { flex: 1 1 0; } .schritte li.aktiv { flex: 3 1 0; } }

.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.feld { min-width: 0; margin: 0; border: 0; padding: 0; }
.feld--voll { grid-column: 1 / -1; }
.feld--klein { max-width: 10rem; }
@media (max-width: 600px) { .raster { grid-template-columns: 1fr; } }

.feld > label:not(.radio):not(.check), .feld > legend { display: block; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.pflicht { color: var(--akzent); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], select {
  width: 100%;
  min-height: 48px;
  padding: .55rem .75rem;
  border: 1.5px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus { border-color: var(--primaer); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primaer) 25%, transparent); }
[aria-invalid="true"] input, input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--rot); }

.einheit { display: flex; align-items: center; gap: .5rem; }
.einheit input { flex: 1; }
.einheit span { color: var(--text-2); font-size: .9rem; white-space: nowrap; }

.radio, .check { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .85rem; border: 1.5px solid var(--rand); border-radius: 10px; cursor: pointer; background: var(--flaeche); }
.radio + .radio { margin-top: .5rem; }
.radio:has(input:checked) { border-color: var(--primaer); background: var(--info-bg); }
.radio input, .check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--primaer); flex-shrink: 0; }
.radio small { display: block; color: var(--text-2); font-size: .85rem; font-weight: 400; }
.check { border: 0; padding: .25rem 0; background: none; }

.hilfe { margin-top: .35rem; font-size: .9rem; }
.hilfe summary { cursor: pointer; color: var(--primaer); width: fit-content; }
.hilfe p { margin: .4rem 0 0; padding: .6rem .8rem; background: var(--flaeche-2); border-radius: 8px; color: var(--text); }

.fehler { color: var(--rot); font-size: .9rem; margin: .35rem 0 0; font-weight: 500; }

/* ------------------------------------------------------------ Textseiten */

.text { max-width: 40em; }
.text h2 { margin-top: 1.75rem; }

input[type="file"] {
  width: 100%; padding: .6rem; border: 1.5px dashed var(--rand); border-radius: 10px;
  background: var(--flaeche-2); color: var(--text); font: inherit; font-size: .95rem;
}
input[type="file"]::file-selector-button {
  margin-right: .75rem; padding: .45rem .9rem; border: 1px solid var(--primaer); border-radius: 8px;
  background: var(--flaeche); color: var(--primaer); font: inherit; font-weight: 600; cursor: pointer;
}
[data-ergebnis], [data-vorschau] { margin-top: .5rem; }

/* Kopfzeile auf schmalen Bildschirmen: Navigation in eigener Zeile */
.marke { white-space: nowrap; }
@media (max-width: 560px) {
  .kopfzeile { flex-wrap: wrap; row-gap: .4rem; padding-bottom: .5rem; }
  .navi { width: 100%; }
  .navi a { flex: 1; text-align: center; padding: .4rem .25rem; font-size: .95rem; }
}

/* ------------------------------------------------------------ Monatsabrechnung */

.brotkrumen { font-size: .9rem; color: var(--text-2); margin: 0 0 .5rem; }
.monatskopf { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.monatskopf h1 { margin: 0; text-align: center; flex: 1; }
.monatskopf .knopf { min-width: 44px; font-size: 1.3rem; padding: .2rem .6rem; }

.monate { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 1rem 0 1.25rem; }
.mon {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: .35rem 0 .45rem; border-radius: 8px; font-size: .75rem; text-decoration: none;
  color: var(--text-2); background: var(--flaeche); border: 1px solid var(--rand);
}
.mon::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rand); }
.mon--fertig::after { background: var(--gruen); }
.mon--entwurf::after { background: var(--gelb); }
.mon--offen::after { background: transparent; border: 1.5px solid var(--text-2); width: 5px; height: 5px; }
.mon--leer { opacity: .35; border-style: dashed; }
.mon--leer::after { visibility: hidden; }
.mon[aria-current] { border-color: var(--primaer); background: var(--info-bg); color: var(--text); font-weight: 700; }
@media (max-width: 560px) { .monate { grid-template-columns: repeat(6, 1fr); } }

.abrechnung { display: grid; gap: 1rem; align-items: start; }
.abrechnung .karte { margin-bottom: 0; }
.abrechnung .raster { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) {
  main:has(.abrechnung) { max-width: 1080px; }
  .abrechnung { grid-template-columns: 1.1fr 1fr; }
  .ergebnis { position: sticky; top: 5rem; }
}
@media (max-width: 420px) { .abrechnung .raster { grid-template-columns: 1fr; } }

.tabelle th small { display: block; color: var(--text-2); font-size: .8rem; }
.tabelle .gross th, .tabelle .gross td { font-size: 1.15rem; padding-top: .6rem; }
.liste--kompakt { margin-top: 1rem; font-size: .92rem; }
.liste--kompakt div { grid-template-columns: 8rem 1fr; }
.liste--kompakt .ampel { margin-left: .35rem; vertical-align: middle; }
.trenner { border: 0; border-top: 1px solid var(--rand); margin: 1.25rem 0 0; }

/* ------------------------------------------------------------ Stammdaten */
.tabelle--links td { text-align: left; white-space: normal; }
.tabelle--links th { white-space: nowrap; padding-right: 1rem; color: var(--text-2); width: 1%; }
@media (max-width: 380px) { .navi a { font-size: .85rem; padding: .4rem .1rem; } }
.aktionen--oben { margin: 0 0 1rem; }
@media (max-width: 520px) {
  .tabelle--links th, .tabelle--links td { display: block; width: auto; padding: .15rem 0; }
  .tabelle--links th { padding-top: .5rem; font-size: .85rem; }
  .tabelle--links td { padding-bottom: .5rem; }
}

/* ------------------------------------------------------------ Jahresübersicht */
.karte--betont { border-color: color-mix(in srgb, var(--primaer) 45%, var(--rand)); }
.tabelle--jahr thead th { font-size: .8rem; color: var(--text-2); font-weight: 600; text-align: right; padding-bottom: .3rem; }
.tabelle--jahr thead th:first-child { text-align: left; }
@media (max-width: 520px) { .nur-breit { display: none; } }

/* ------------------------------------------------------------ Arbeitsvertrag */
.vorschau { max-height: 80vh; overflow: auto; }
.vertrag { font-family: Georgia, "Times New Roman", serif; font-size: .92rem; line-height: 1.55; }
.vertrag h2 { font-size: 1.35rem; text-align: center; margin-bottom: .2rem; }
.vertrag .untertitel { text-align: center; color: var(--text-2); margin-top: 0; font-size: .85rem; }
.vertrag h3 { font-family: system-ui, sans-serif; font-size: .95rem; margin: 1.1rem 0 .3rem; }
.vertrag ol { padding-left: 1.6rem; margin: .3rem 0; }
.vertrag ol li { margin-bottom: .3rem; }
.vertrag ol li::marker { content: "(" counter(list-item) ")  "; }
.vertrag p { margin: .3rem 0; }
@media (min-width: 900px) { .vorschau { position: sticky; top: 5rem; } }

/* ------------------------------------------------------------ Lizenz */
textarea { width: 100%; padding: .6rem .75rem; border: 1.5px solid var(--rand); border-radius: 10px; background: var(--flaeche);
  color: var(--text); font: .9rem/1.4 ui-monospace, "SF Mono", Consolas, monospace; resize: vertical; word-break: break-all; }
textarea:focus { border-color: var(--primaer); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primaer) 25%, transparent); }
textarea[aria-invalid="true"] { border-color: var(--rot); }
.lizenzzeile { font-size: .9rem; color: var(--text-2); margin: -1rem 0 1.25rem; }

/* ------------------------------------------------------------ Anleitung */
.anleitung { max-width: 820px; }
.anleitung section { margin-top: 2.25rem; scroll-margin-top: 5rem; }
.anleitung h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.anleitung h3 { font-size: 1.02rem; margin: 0 0 .4rem; }
.anleitung p { max-width: 44em; }
.anleitung .karte p:last-child { margin-bottom: 0; }
.anleitung .hinweis { margin: 1rem 0; }
.inhalt ol { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.4rem; }
.inhalt li { margin-bottom: .3rem; break-inside: avoid; }
@media (max-width: 600px) { .inhalt ol { columns: 1; } }

.ablauf { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; margin: 1rem 0; }
.ablauf > div { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: .85rem; display: flex; flex-direction: column; gap: .25rem; }
.ablauf .nr { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--primaer); color: var(--primaer-text); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.ablauf span:last-child { font-size: .85rem; color: var(--text-2); }
@media (max-width: 760px) { .ablauf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .ablauf { grid-template-columns: 1fr; } }

.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.raster-2 .karte { margin: 0; }

.liste-punkte, .liste-haken { padding-left: 0; list-style: none; }
.liste-punkte li, .liste-haken li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.liste-punkte li::before { content: ""; position: absolute; left: .35rem; top: .6em; width: .45rem; height: .45rem; border-radius: 50%; background: var(--primaer); }
.liste-haken li::before { content: "✓"; position: absolute; left: .1rem; color: var(--primaer); font-weight: 700; }

.schrittliste { counter-reset: schritt; list-style: none; padding-left: 0; }
.schrittliste > li { counter-increment: schritt; position: relative; padding: .1rem 0 .7rem 2.6rem; }
.schrittliste > li::before { content: counter(schritt); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  border: 2px solid var(--primaer); color: var(--primaer); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

.punkt-legende { display: inline-flex; align-items: center; gap: .3rem; margin-right: .9rem; white-space: nowrap; }
.punkt-legende .p { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.p--gruen { background: var(--gruen); } .p--gelb { background: var(--gelb); } .p--offen { border: 1.5px solid var(--text-2); }

.tabelle--anleitung th { white-space: normal; width: 34%; font-weight: 600; color: var(--text); vertical-align: top; }
.tabelle--anleitung td { vertical-align: top; }

.frage { border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); margin-bottom: .6rem; }
.frage summary { cursor: pointer; padding: .85rem 1rem; font-weight: 600; }
.frage p { margin: 0; padding: 0 1rem 1rem; }
.frage[open] summary { color: var(--primaer); }

kbd { font: inherit; font-size: .85em; padding: .05rem .4rem; border: 1px solid var(--rand); border-bottom-width: 2px; border-radius: 5px; background: var(--flaeche-2); }
.abschluss { margin-top: 2.5rem; border-top: 1px solid var(--rand); padding-top: 1rem; }

.nur-druck { display: none; }
.druckkopf { align-items: center; gap: .75rem; margin-bottom: 1rem; color: var(--text-2); }

@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  :root { --bg: #fff; --flaeche: #fff; --schatten: none; color-scheme: light; }
  body { font-size: 10.5pt; background: #fff; }
  .nur-bildschirm { display: none !important; }
  .nur-druck { display: flex; }
  main { padding: 0; max-width: none; }
  .anleitung h1 { font-size: 22pt; }
  .anleitung section { margin-top: 1.3rem; }
  .anleitung h2 { break-after: avoid; }
  .karte, .hinweis, .ablauf > div, .schrittliste > li, .frage, tr { break-inside: avoid; }
  .frage summary { list-style: none; }
  .frage summary::-webkit-details-marker { display: none; }
  .frage p { display: block !important; }
  a { color: inherit; text-decoration: none; }
  .ablauf { grid-template-columns: repeat(5, 1fr); gap: .4rem; }
  .ablauf > div { padding: .6rem; }
  .raster-2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .lead { margin-bottom: 1rem; }
}
.pdf-link { margin: -.5rem 0 1.25rem; }

/* Erstattung U1 */
.status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--rand); color: var(--text); white-space: nowrap; }
.status--ok { background: var(--erfolg-bg); color: var(--gruen); }
.fall h3 { margin: 0; font-size: 1rem; }
ol.nummern { padding-left: 1.25rem; margin: 0 0 .75rem; }
ol.nummern li { margin-bottom: .4rem; }
