/* Perkfolio — Gestaltung
   Idee: Das Ergebnis ist ein Kontoauszug. Ruhiges Wertpapier-Papier,
   eine Akzentfarbe (Tanne), Haarlinien statt Kästen, tabellarische
   Ziffern, Doppelstrich vor der Endsumme. */

@font-face { font-family: "PlexSans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexSans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PlexSans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PlexSerif"; src: url("fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --papier: #f3f5f1;
  --ink: #1c2420;
  --ink-60: #556059;
  --ink-40: #8a938d;
  --linie: #d7ddd5;
  --tanne: #0c5b48;
  --tanne-dunkel: #094536;
  --tanne-hauch: #e4eee9;
  --warn: #935816;
  --serif: "PlexSerif", Georgia, "Times New Roman", serif;
  --sans: "PlexSans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "PlexMono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--papier);
  accent-color: var(--tanne);
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

a { color: var(--tanne); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--tanne-dunkel); }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--tanne); outline-offset: 2px; }

/* ————— Kopf ————— */

.kopf { padding: 44px 0 28px; border-bottom: 1px solid var(--ink); }
.kopf-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wortmarke { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.wortmarke .punkt { color: var(--tanne); }
.kopf-aktionen { display: flex; gap: 20px; }
.textknopf {
  font-size: 13.5px; color: var(--ink-60);
  text-decoration: underline; text-decoration-color: var(--linie); text-underline-offset: 3px;
}
.textknopf:hover { color: var(--tanne); text-decoration-color: var(--tanne); }
.claim { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; line-height: 1.2; margin-top: 26px; max-width: 21em; letter-spacing: -0.012em; }
.unterclaim { margin-top: 12px; max-width: 46em; color: var(--ink-60); font-size: 15px; }
.unterclaim strong { color: var(--ink); font-weight: 500; }

/* ————— Hauptraster ————— */

.haupt { display: grid; grid-template-columns: 332px minmax(0, 1fr); gap: 0; align-items: start; }
.profil {
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
  padding: 28px 32px 48px 0; border-right: 1px solid var(--linie);
  scrollbar-width: thin;
}
.ergebnis { padding: 28px 0 48px 40px; min-height: 60vh; }

/* ————— Profil-Panel ————— */

.profil-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.panel-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-60); }
.profil-status { font-size: 12.5px; color: var(--ink-40); }
.profil-status button { color: var(--ink-60); text-decoration: underline; text-underline-offset: 2px; font-size: 12.5px; }
.profil-status button:hover { color: var(--tanne); }

.block { border-top: 1px solid var(--linie); padding: 18px 0 20px; }
.block:first-of-type { border-top: none; }
.block-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.block-titel { font-weight: 600; font-size: 15px; }
.block-frage { font-size: 13px; color: var(--ink-60); margin-top: 2px; }
.block-inhalt { margin-top: 14px; display: grid; gap: 14px; }
.block-inhalt[hidden] { display: none; }

.feld { display: grid; gap: 6px; }
.feld-label { font-size: 13.5px; color: var(--ink-60); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.feld-hinweis { font-size: 12px; color: var(--ink-40); }

/* Regler mit gekoppeltem Zahlenfeld */
.regler { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--linie); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px;
  border-radius: 50%; background: var(--tanne); border: none;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--linie); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--tanne); border: none; }

input[type="number"], input[type="email"] {
  font-family: var(--mono); font-size: 13.5px; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid var(--linie);
  padding: 3px 2px; width: 90px; text-align: right;
}
input[type="number"]:focus, input[type="email"]:focus { outline: none; border-bottom-color: var(--tanne); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.einheit { font-size: 12px; color: var(--ink-40); margin-left: 4px; }

/* Schalter (Master-Toggle) */
.schalter { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; }
.schalter input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; margin: 0; }
.schalter .bahn {
  position: absolute; inset: 0; background: var(--linie); border-radius: 10px;
  transition: background 0.15s ease; pointer-events: none;
}
.schalter .bahn::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(28, 36, 32, 0.25);
}
.schalter input:checked + .bahn { background: var(--tanne); }
.schalter input:checked + .bahn::after { transform: translateX(14px); }
.schalter input:focus-visible + .bahn { outline: 2px solid var(--tanne); outline-offset: 2px; }

/* Zeilen-Toggles und Checkboxen */
.wahl { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.wahl input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; flex: none; }
.wahl .wahl-text { flex: 1; }
.wahl .wahl-sub { display: block; font-size: 12px; color: var(--ink-40); }
.wahl-betrag { display: flex; align-items: baseline; }
.wahl-betrag input { width: 64px; }

.radiozeile { display: flex; gap: 18px; flex-wrap: wrap; }
.radiozeile label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* ————— Ergebnis ————— */

.ergebnis-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.laufhinweis { font-size: 12.5px; color: var(--ink-40); font-variant-numeric: tabular-nums; }

.setup { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 14px; padding: 26px 0 24px; border-top: 1px solid var(--linie); }
.setup:first-of-type { border-top: none; }
.setup.top { padding-top: 18px; }

.rang { font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--ink-40); line-height: 1; padding-top: 4px; }
.setup.top .rang { color: var(--tanne); }

.setup-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.setup-titel { font-size: 19px; font-weight: 600; line-height: 1.3; }
.setup-titel .plus { color: var(--ink-40); font-weight: 400; padding: 0 2px; }
.setup-sub { font-size: 13px; color: var(--ink-60); margin-top: 3px; }

.summe { text-align: right; flex: none; }
.summe-zahl { font-family: var(--serif); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.summe-zahl.gut { color: var(--tanne); }
.summe-label { font-size: 12px; color: var(--ink-60); margin-top: 1px; }

.aufklappen { margin-top: 10px; font-size: 13.5px; color: var(--ink-60); }
.aufklappen:hover { color: var(--tanne); }
.aufklappen::before { content: "▸ "; font-size: 11px; }
.setup.offen .aufklappen::before { content: "▾ "; }

/* Der Kontoauszug */
.auszug { margin-top: 16px; }
.auszug table { width: 100%; border-collapse: collapse; }
.auszug caption { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); padding-bottom: 8px; }
.auszug td { padding: 6px 0; border-top: 1px solid var(--linie); vertical-align: top; font-size: 14px; }
.auszug tr:first-child td { border-top: none; }
.auszug td.betrag {
  font-family: var(--mono); font-size: 13.5px; text-align: right; white-space: nowrap;
  padding-left: 18px; width: 1%; font-variant-numeric: tabular-nums;
}
.auszug td.betrag.gut { color: var(--tanne); font-weight: 500; }
.auszug .posten-hinweis { display: block; font-size: 12px; color: var(--ink-40); }
.auszug .eigener-wert { font-size: 11px; color: var(--tanne); border: 1px solid var(--tanne-hauch); background: var(--tanne-hauch); padding: 0 4px; margin-left: 6px; white-space: nowrap; }
.auszug tr.gesamt td { border-top: 3px double var(--ink); font-weight: 600; padding-top: 8px; font-size: 14.5px; }
.auszug tr.gesamt td.betrag { font-weight: 500; font-size: 14.5px; }

.abschnitt-titel { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); margin: 20px 0 8px; }

.earn-zeile { border-top: 1px solid var(--linie); padding: 8px 0; font-size: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; }
.earn-zeile:first-of-type { border-top: none; }
.earn-formel { font-family: var(--mono); font-size: 13px; color: var(--ink-60); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.earn-grund { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-40); }

.nebenliste { font-size: 13px; color: var(--ink-60); display: grid; gap: 4px; }
.nebenliste .grund { color: var(--ink-40); }

.warnung { border-left: 2px solid var(--warn); padding: 2px 0 2px 12px; font-size: 13.5px; color: var(--warn); margin-top: 8px; }

.bonus-info { font-size: 13px; color: var(--ink-60); margin-top: 14px; }
.bonus-info em { font-style: normal; color: var(--ink-40); }

.setup-fuss { margin-top: 16px; font-size: 12px; color: var(--ink-40); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setup-fuss a { color: var(--ink-60); }
.werbelink { font-size: 13.5px; }
.werbelink .kennzeichen { font-size: 11px; color: var(--ink-40); margin-left: 4px; }

.mehr-knopf { margin-top: 22px; padding: 10px 0; width: 100%; text-align: center; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); font-size: 14px; color: var(--ink-60); }
.mehr-knopf:hover { color: var(--tanne); }

.leer-hinweis { padding: 48px 0; color: var(--ink-60); font-size: 15px; max-width: 34em; }

.nicht-bewertet { margin-top: 28px; font-size: 12.5px; color: var(--ink-40); }

/* ————— E-Mail ————— */

.alarm { margin-top: 44px; border-top: 1px solid var(--ink); padding-top: 24px; max-width: 34em; }
.alarm h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.alarm p { margin-top: 6px; font-size: 14px; color: var(--ink-60); }
.alarm form { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.alarm input[type="email"] { flex: 1; min-width: 220px; text-align: left; font-size: 14px; padding: 8px 2px; }
.alarm button[type="submit"] {
  background: var(--tanne); color: #fff; font-weight: 500; font-size: 14px;
  padding: 9px 20px; border-radius: 2px;
}
.alarm button[type="submit"]:hover { background: var(--tanne-dunkel); }
.alarm .alarm-status { font-size: 13px; margin-top: 8px; color: var(--tanne); }
.alarm .alarm-status.fehler { color: var(--warn); }

/* ————— Fuß ————— */

.fuss { margin-top: 56px; border-top: 1px solid var(--ink); padding: 28px 0 60px; font-size: 13px; color: var(--ink-60); }
.fuss h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60); margin-bottom: 10px; }
.fuss ol { margin: 0 0 20px 18px; display: grid; gap: 6px; max-width: 56em; }
.fuss .klein { font-size: 12px; color: var(--ink-40); display: flex; gap: 18px; flex-wrap: wrap; }

/* ————— Mobile ————— */

.mobil-leiste { display: none; }

@media (max-width: 979px) {
  .haupt { grid-template-columns: 1fr; }
  .profil { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--ink); padding: 24px 0 28px; }
  .ergebnis { padding: 24px 0 96px; }
  .setup { grid-template-columns: 36px minmax(0, 1fr); }
  .rang { font-size: 26px; }
  .summe-zahl { font-size: 25px; }
  .mobil-leiste {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    background: var(--ink); color: var(--papier);
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    justify-content: space-between; align-items: baseline; gap: 12px;
    font-size: 14px; cursor: pointer; border: none; width: 100%; text-align: left;
  }
  .mobil-leiste .ml-setup { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobil-leiste .ml-summe { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
  .mobil-leiste .ml-summe.gut { color: #9fd6c3; }
}

/* ————— Druck ————— */

@media print {
  body { background: #fff; }
  .profil, .kopf-aktionen, .alarm, .mehr-knopf, .mobil-leiste, .aufklappen { display: none !important; }
  .haupt { grid-template-columns: 1fr; }
  .ergebnis { padding-left: 0; }
  .setup { break-inside: avoid; }
}
