/* Rentenlupe – ruhig, gut lesbar, große Bedienelemente */
:root {
  --bg: #f4f6f9;
  --karte: #ffffff;
  --text: #17202c;
  --leise: #505c6c;
  --linie: #d3d9e2;
  --primaer: #0b4f94;
  --primaer-dunkel: #083b70;
  --primaer-hell: #e7f0fa;
  --akzent: #f0a202;
  --gut: #1c6b36;
  --gut-hell: #e8f5ec;
  --warn: #8a4b00;
  --warn-hell: #fff3e0;
  --rot: #a4161a;
  --rot-hell: #fdecec;
  --radius: 12px;
  --schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d;
    --karte: #1a212b;
    --text: #e8edf3;
    --leise: #a9b4c2;
    --linie: #334052;
    --primaer: #6aa9ec;
    --primaer-dunkel: #8fbef2;
    --primaer-hell: #1d2d42;
    --gut: #6cc58a;
    --gut-hell: #173020;
    --warn: #f3b25c;
    --warn-hell: #33260f;
    --rot: #f28b8b;
    --rot-hell: #3a1a1a;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primaer); text-underline-offset: 2px; }
a:hover { color: var(--primaer-dunkel); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
kbd { font: inherit; background: var(--primaer-hell); border-radius: 4px; padding: 0 .3em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--karte); padding: 8px 12px; z-index: 10; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.klein { font-size: .88rem; color: var(--leise); }
.block { display: block; }
.optional { font-weight: 400; color: var(--leise); font-size: .9em; }
.abstand { margin-top: 2rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Kopf und Fuß */
.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.marke { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; color: var(--primaer); text-decoration: none; }
.marke-bild { width: 34px; height: 34px; }
.kopf-nav { display: flex; gap: 18px; font-size: .95rem; }
.fuss { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--linie); font-size: .9rem; color: var(--leise); }

/* Start */
.held { padding: 2rem 0 .5rem; }
.obertitel { color: var(--primaer); font-weight: 600; margin-bottom: .4em; }
.lead { font-size: 1.12rem; }
.haken { list-style: none; padding: 0; }
.haken li { padding-left: 1.8em; position: relative; }
.haken li::before { content: "✓"; position: absolute; left: .2em; color: var(--gut); font-weight: 700; }
.fortsetzen { margin-top: 1rem; }
.raster2, .raster3 { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .raster2 { grid-template-columns: 1fr 1fr; }
  .raster3 { grid-template-columns: 1fr 1fr 1fr; }
}
.ablauf li { margin-bottom: .6em; }
.faq details { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6em 0 0; }
.vertrauen { border-left: 5px solid var(--gut); }

/* Karten, Hinweise */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--schatten); margin-bottom: 1rem; }
.karte > :last-child { margin-bottom: 0; }
.hinweis { border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1rem; background: var(--primaer-hell); }
.hinweis.warn { background: var(--warn-hell); }
.hinweis.gut { background: var(--gut-hell); }
.hinweis.rot { background: var(--rot-hell); }
.status:empty { display: none; }
.status { margin: 1rem 0; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--primaer-hell); }
.status.gut { background: var(--gut-hell); }
.status.warn { background: var(--warn-hell); }
.status.rot { background: var(--rot-hell); }
.fehler { color: var(--rot); font-weight: 600; }
.fehler:empty { display: none; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: .6em 1.2em; border-radius: 10px; border: 2px solid var(--primaer);
  background: var(--primaer); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
@media (prefers-color-scheme: dark) { .knopf { color: #0c1520; } }
.knopf:hover { background: var(--primaer-dunkel); border-color: var(--primaer-dunkel); color: #fff; }
@media (prefers-color-scheme: dark) { .knopf:hover { color: #0c1520; } }
.knopf.zweit { background: transparent; color: var(--primaer); }
.knopf.zweit:hover { background: var(--primaer-hell); color: var(--primaer-dunkel); }
.knopf.gross { font-size: 1.08rem; padding: .7em 1.5em; }
.knopf.klein { min-height: 42px; padding: .4em .9em; font-size: .95rem; }
.knopf[disabled] { opacity: .55; cursor: not-allowed; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px; margin: 1rem 0; }
.knopfreihe.weiter { justify-content: space-between; margin-top: 1.5rem; }
.knopfreihe.weiter .knopf.gross { margin-left: auto; }
.linkknopf { background: none; border: 0; padding: 0; font: inherit; color: var(--primaer); text-decoration: underline; cursor: pointer; }
.loeschknopf { background: none; border: 1px solid var(--linie); border-radius: 8px; min-width: 44px; min-height: 44px; font-size: 1.1rem; color: var(--rot); cursor: pointer; }

/* Schritte */
.schritte { list-style: none; display: flex; gap: 6px; padding: 0; margin: 1.2rem 0 1.5rem; counter-reset: s; }
.schritte li { flex: 1; display: flex; align-items: center; gap: .45em; font-size: .9rem; color: var(--leise); padding: .45em .5em; border-bottom: 4px solid var(--linie); margin: 0; }
.schritte li span { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--linie); color: var(--text); font-weight: 700; font-size: .85rem; flex: none; }
.schritte li.aktiv { color: var(--text); font-weight: 700; border-color: var(--primaer); }
.schritte li.aktiv span { background: var(--primaer); color: #fff; }
.schritte li.fertig { border-color: var(--gut); }
.schritte li.fertig span { background: var(--gut); color: #fff; }
@media (max-width: 520px) { .schritte li { font-size: 0; } .schritte li span { font-size: .85rem; } .schritte li.aktiv { font-size: .85rem; } }

/* Auswahl Schritt 1 */
.wahl { display: grid; gap: 12px; }
@media (min-width: 720px) { .wahl { grid-template-columns: repeat(3, 1fr); } }
.wahlkarte {
  display: flex; flex-direction: column; gap: .3em; text-align: left; cursor: pointer;
  background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem;
  font: inherit; color: inherit;
}
.wahlkarte:hover, .wahlkarte:focus-within, .wahlkarte.ziehen { border-color: var(--primaer); background: var(--primaer-hell); }
.wahl-titel { font-weight: 700; color: var(--primaer); font-size: 1.05rem; }
.wahl-text { font-size: .9rem; color: var(--leise); }

/* Formulare */
.feld { display: flex; flex-direction: column; gap: .25em; margin-bottom: .9rem; min-width: 0; }
.feld label, fieldset legend { font-weight: 600; }
fieldset { margin: 0 0 1rem; }
fieldset legend { font-size: 1.12rem; padding: 0 .2em; float: left; width: 100%; margin-bottom: .5rem; }
fieldset legend + * { clear: both; }
.feldhilfe { font-size: .88rem; color: var(--leise); }
.feldhilfe.fehlt { color: var(--rot); font-weight: 600; }
input[type=text], input:not([type]), input[inputmode], select, textarea {
  font: inherit; color: var(--text); background: var(--karte);
  border: 1.5px solid #8b97a8; border-radius: 8px; padding: .5em .65em; min-height: 46px; width: 100%;
}
textarea { min-height: 10em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
input.ungueltig { border-color: var(--rot); background: var(--rot-hell); }
.feldreihe { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .feldreihe { grid-template-columns: 1fr 1fr; } .feldreihe.drei { grid-template-columns: 1fr 1fr 1.4fr; } }
.listeneintrag { border: 1px dashed var(--linie); border-radius: 10px; padding: .8rem .9rem .1rem; margin-bottom: .8rem; position: relative; }
.listeneintrag .loeschknopf { position: absolute; top: .5rem; right: .5rem; }
.listeneintrag .feldreihe { padding-right: 52px; }
.haekchen { display: flex; gap: .6em; align-items: flex-start; margin: .5rem 0; cursor: pointer; }
.haekchen input { width: 1.3em; height: 1.3em; margin-top: .2em; flex: none; }

/* Tabelle der Einträge */
.tabelle-huelle { overflow-x: auto; }
.eintraege-details > summary { cursor: pointer; color: var(--primaer); padding: 2px 0; }
.eintraege-details[open] > summary { margin-bottom: 8px; }
table.eintraege { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); }
table.eintraege th, table.eintraege td { padding: .45rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; text-align: left; }
table.eintraege th { font-size: .85rem; color: var(--leise); }
table.eintraege td input, table.eintraege td select { min-height: 42px; font-size: .95rem; }
table.eintraege td.datum { width: 9.5em; }
table.eintraege td.art { width: 12.5em; }
table.eintraege tr.ungeklaert td { background: var(--warn-hell); }
@media (max-width: 720px) {
  table.eintraege thead { display: none; }
  table.eintraege, table.eintraege tbody, table.eintraege tr, table.eintraege td { display: block; width: 100%; }
  table.eintraege tr { border-bottom: 2px solid var(--linie); padding: .5rem 0; position: relative; }
  table.eintraege td { border: 0; padding: .25rem .5rem; }
  table.eintraege td.datum { display: inline-block; width: calc(50% - 30px); }
  table.eintraege td.art, table.eintraege td.text { width: 100%; }
  table.eintraege td.aktion { position: absolute; top: .5rem; right: 0; width: auto; }
  table.eintraege td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--leise); }
}

/* Lücken */
.luecke { display: grid; gap: .5rem; }
.luecke-kopf { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.luecke-zeit { font-weight: 700; font-size: 1.1rem; }
.luecke-dauer { color: var(--leise); }
.luecke.beantwortet { border-left: 5px solid var(--gut); }
.luecke.offen { border-left: 5px solid var(--akzent); }
details.erklaert summary { cursor: pointer; font-weight: 600; }

/* Ergebnis */
.zusammenfassung { display: grid; gap: 12px; margin-bottom: 1.2rem; }
@media (min-width: 720px) { .zusammenfassung { grid-template-columns: repeat(3, 1fr); } }
.kennzahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kennzahl .zahl { font-size: 1.8rem; font-weight: 800; line-height: 1.1; color: var(--primaer); display: block; }
.kennzahl .zahl.gut { color: var(--gut); }
.kennzahl .text { font-size: .92rem; color: var(--leise); }
.befund { border-left: 6px solid var(--akzent); }
.befund.p1 { border-left-color: #d9480f; }
.befund.p2 { border-left-color: var(--akzent); }
.befund.p3, .befund.p4, .befund.p5 { border-left-color: #7c8a9e; }
.befund h3 { margin-bottom: .3em; }
.befund dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: .6rem 0; }
.befund dt { font-weight: 600; color: var(--leise); font-size: .92rem; }
.befund dd { margin: 0; }
@media (max-width: 560px) { .befund dl { grid-template-columns: 1fr; } .befund dt { margin-top: .4rem; } }
.marke-sicher { display: inline-block; font-size: .8rem; font-weight: 700; padding: .1em .55em; border-radius: 999px; background: var(--primaer-hell); color: var(--primaer); vertical-align: middle; }
.marke-sicher.hoch { background: var(--gut-hell); color: var(--gut); }
.marke-sicher.mittel { background: var(--warn-hell); color: var(--warn); }
.marke-sicher.niedrig { background: var(--rot-hell); color: var(--rot); }
.befund details { margin-top: .4rem; }
.befund details summary { cursor: pointer; color: var(--primaer); font-weight: 600; }
.wartezeit-karte.entscheidend { border: 2px solid var(--gut); background: var(--gut-hell); }
.checkliste { list-style: none; padding: 0; }
.checkliste li { margin-bottom: .5rem; }
.brief { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; min-height: 32em; line-height: 1.45; }
.schrittkarte { counter-increment: sk; }
.schrittkarte h3::before { content: counter(sk) ". "; color: var(--primaer); }
#ergebnis-inhalt { counter-reset: sk; }
.rueckmeldung { border: 2px solid var(--primaer); }
.sterne { display: flex; gap: .5rem; flex-wrap: wrap; }
.sterne label { display: inline-flex; align-items: center; gap: .3em; border: 1.5px solid var(--linie); border-radius: 8px; padding: .35em .7em; cursor: pointer; }
.sterne input { width: 1.1em; height: 1.1em; }
.ausfuell li { margin-bottom: .6rem; }

/* Kurz gesagt */
.kurz { border: 2px solid var(--primaer); }
.kurz h2 { font-size: 1.25rem; }
.kurz li { margin-bottom: .5rem; }

/* Zeitstrahl */
.zeitstrahl { display: grid; grid-template-columns: 3.2em repeat(12, minmax(0, 1fr)); gap: 2px; max-width: 520px; margin-top: .5rem; }
.zs-jahr { font-size: .7rem; color: var(--leise); line-height: 11px; }
.zs-monat { display: inline-block; height: 11px; border-radius: 2px; background: transparent; }
.zs-belegt { background: #7aa7d6; }
.zs-befund { background: #e8590c; }
.zs-erklaert { background: repeating-linear-gradient(45deg, #f0a202, #f0a202 3px, #fde8b5 3px, #fde8b5 6px); }
.zs-luecke { background: #c92a2a; }
.zs-leer { background: var(--bg); }
.zs-legende { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .85rem; }
.zs-legende li { display: flex; align-items: center; gap: .4em; margin: 0; }
.zs-legende .zs-monat { width: 14px; height: 14px; }
.glossar dl { margin: .6rem 0 0; }
.glossar dt { font-weight: 700; margin-top: .5rem; }
.glossar dd { margin: 0; }

/* Druck */
pre.nur-druck { white-space: pre-wrap; font: 11pt/1.45 Georgia, "Times New Roman", serif; margin: 0; }
@media print {
  textarea.brief { display: none !important; }
  body.druck-brief #ansicht-ergebnis > h1,
  body.druck-brief #ergebnis-inhalt > *:not(.brief-abschnitt),
  body.druck-brief .brief-abschnitt > *:not(#brief-druck) { display: none !important; }
  body.druck-brief .brief-abschnitt { border: 0; padding: 0; margin: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .kopf, .fuss, .schritte, .knopfreihe, .nicht-drucken, .rueckmeldung, button { display: none !important; }
  .karte { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .befund details { display: block; }
  .befund details > summary { display: none; }
  details:not([open]) > *:not(summary) { display: block; }
  a { color: #000; }
  .nur-druck { display: block !important; }
  textarea.brief { border: 0; min-height: 0; height: auto; }
}
.nur-druck { display: none; }

/* Unterseiten */
.seite { padding-top: 1.5rem; padding-bottom: 2rem; }
.seite h2 { margin-top: 1.6rem; font-size: 1.2rem; }
.admin table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--karte); }
.admin th, .admin td { border: 1px solid var(--linie); padding: .4rem .5rem; vertical-align: top; text-align: left; }
.admin td.lang { white-space: pre-wrap; max-width: 22em; }
