/* StockLife — Langtext-Seiten.
 *
 * Zusatzblatt zu `stocklife.css`, das immer daneben geladen wird. Hier stehen
 * ausschliesslich die Klassen der Dokumentseiten (AGB, Widerruf, Datenschutz,
 * Status, Konto …). Kein Token, kein Reset, keine `@font-face`, keine `.sl-*`
 * Regel — das alles kommt aus `stocklife.css` und wird hier nur benutzt.
 *
 * Die eine Falle, die schon einmal zugeschnappt ist: `--tx`/`--mut` gelten auf
 * den dunklen Karten, `--navtx`/`--navmut` auf der Seitenflaeche — und die ist
 * im hellen Theme weiss. Alles, was unmittelbar auf der Seite steht, nimmt das
 * `nav`-Paar; nur `.notice`, `.provenance`, `.form-block`, `.panel` und `.tile`
 * sind Karten und nehmen das andere.
 *
 * `--line` ist die Haarlinie *auf* einer Karte und in beiden Themes weisslich;
 * auf der weissen Seitenflaeche waere sie unsichtbar. Linien, die unmittelbar
 * auf der Seite liegen, nehmen deshalb `--rule` aus `stocklife.css` — dieselbe
 * Linie, die dort schon `.sl-head`, `.sl-foot` und `.sl-story` ziehen.
 */

/* ============================== Lesespalte ============================== */

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.page,
.legal-page {
  max-width: 760px;
  padding-block: 64px clamp(72px, 9vw, 112px);
  font: 300 16px/1.7 'Outfit', system-ui, sans-serif;
  color: var(--navmut);
}

.page > * + * { margin-top: 30px; }
.page > h2 { margin-top: 46px; }
.page > h2 + p, .page > p + p { margin-top: 16px; }

.page h1, .page h2, .page h3, .page p, .page li, .page dd { text-wrap: pretty; }

.page h1 {
  font: 600 44px/1.06 'Outfit', system-ui, sans-serif;
  letter-spacing: -2px;
  color: var(--navtx);
}
.page h2 {
  font: 600 26px/1.24 'Outfit', system-ui, sans-serif;
  letter-spacing: -.9px;
  color: var(--navtx);
}
.page h3 {
  font: 600 17.5px/1.35 'Outfit', system-ui, sans-serif;
  letter-spacing: -.4px;
  color: var(--navtx);
  margin-top: 12px;
}

.page ul, .page ol { margin: 0; padding-left: 22px; }
.page li { margin-bottom: 8px; }
.page li::marker { color: var(--fnt); }
.page li:last-child { margin-bottom: 0; }

/* `:not(.btn)`, damit eine Schaltflaeche ihre eigene Farbe behaelt: `--navtx`
   ist im hellen Theme fast schwarz und die Schaltflaeche eine dunkle Karte. */
.page a:not(.btn) {
  color: var(--navtx);
  text-decoration: underline;
  text-decoration-color: var(--ring);
  text-underline-offset: 3px;
}
.page code {
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--navpill);
  color: var(--navtx);
  font: .9em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.eyebrow {
  font: 600 10.5px/1 'Outfit', system-ui, sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--navmut);
}

.dek {
  font: 300 17px/1.62 'Outfit', system-ui, sans-serif;
  color: var(--navmut);
  max-width: 62ch;
}
.page > header .dek { margin-top: 16px; }
.page > header h1 { margin-top: 14px; }

/* ---- Abschnitt auf der Seitenflaeche, keine Karte: die Seiten sind lang. -- */

.data-section {
  display: grid;
  gap: 13px;
  padding-top: 30px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 88px;
}
.section-spaced { margin-top: 44px; }
.rc-subscription { gap: 15px; }

/* ============================== Karten ============================== */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--card-t);
  box-shadow: var(--edge);
  color: var(--tx);
}
.notice p { font: 400 14.5px/1.65 'Outfit', system-ui, sans-serif; color: var(--mut); }
.notice strong { color: var(--tx); font-weight: 600; }
.notice__icon {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 3px;
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.provenance {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--card-t);
  box-shadow: var(--edge);
  color: var(--mut);
  font: 400 14px/1.6 'Outfit', system-ui, sans-serif;
}
.provenance strong { display: block; margin-bottom: 6px; color: var(--tx); font-weight: 600; }

.form-block {
  padding: 20px;
  border-radius: 16px;
  background: var(--card-t);
  box-shadow: var(--edge);
  color: var(--mut);
  font: 400 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-x: auto;
}

.panel {
  padding: 26px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--edge);
  color: var(--tx);
}
.tile { padding: clamp(22px, 3.4vw, 36px); border-radius: 26px; }
.tile__lede { display: grid; gap: 10px; justify-items: center; text-align: center; margin-bottom: 24px; }
.tile__lede h2 { font: 600 26px/1.16 'Outfit', system-ui, sans-serif; letter-spacing: -1px; color: var(--tx); }
.tile__lede p { max-width: 46ch; font: 400 14.5px/1.6 'Outfit', system-ui, sans-serif; color: var(--mut); }

/* Text auf einer Karte bleibt hell — auch im hellen Theme, wo `--navtx` fast
   schwarz ist. Der Anlauf `.page` steht mit, damit die Regel die Zeile darueber
   schlaegt statt umgekehrt. */
.page .notice a, .page .panel a { color: var(--tx); text-decoration-color: var(--line); }

/* ============================== Schaltflaechen ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--edge);
  color: var(--tx);
  font: 500 14px/1 'Outfit', system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary {
  background: var(--lime);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--depth);
}
.btn--ghost { background: none; box-shadow: inset 0 0 0 1px var(--ring); color: var(--navtx); }
.btn--sm { height: 36px; padding: 0 15px; border-radius: 18px; font-size: 13px; }

/* ============================== Tabellen ============================== */

.table-scroll { overflow-x: auto; }

.legal-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font: 400 14px/1.55 'Outfit', system-ui, sans-serif;
}
.legal-table th, .legal-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  font: 600 10.5px/1.4 'Outfit', system-ui, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navtx);
}
.legal-table td { color: var(--navmut); }
.legal-table tr:last-child td { border-bottom: 0; }

.tabular {
  width: 100%;
  border-collapse: collapse;
  font: 400 14px/1.5 'Outfit', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.tabular th, .tabular td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: right; }
.tabular th:first-child, .tabular td:first-child { text-align: left; }
.tabular thead th {
  font: 600 10.5px/1.4 'Outfit', system-ui, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fnt);
}
.tabular tbody th { font-weight: 500; color: var(--tx); }
.tabular td { color: var(--mut); }
.tabular tr:last-child th, .tabular tr:last-child td { border-bottom: 0; }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.kv dt { color: var(--navmut); font-size: 14px; }
.kv dd { color: var(--navtx); font: 500 14px/1.5 'Outfit', system-ui, sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* ============================== Formulare ============================== */

.page form { display: grid; gap: 12px; justify-items: start; }
.page label { color: var(--navtx); font-size: 14px; }
.page input {
  width: min(100%, 400px);
  height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: var(--navpill);
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--navtx);
  font: 400 15px/1 'Outfit', system-ui, sans-serif;
}

.rc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-status { margin: 0; color: var(--navmut); }
/* Die drei Meldungsfarben stehen auf der Seitenflaeche, nicht auf einer Karte.
   Auf Weiss traegt keine von ihnen genug — deshalb im hellen Theme dunkler. */
.rc-status[data-kind='success'], [data-rc-entitlement][data-active='true'] { color: var(--up); }
.rc-status[data-kind='warning'] { color: #B98A12; }
.rc-status[data-kind='error'] { color: var(--down); }
[data-theme='light'] .rc-status[data-kind='success'],
[data-theme='light'] [data-rc-entitlement][data-active='true'] { color: #2F6B12; }
[data-theme='light'] .rc-status[data-kind='warning'] { color: #8A5F06; }
[data-theme='light'] .rc-status[data-kind='error'] { color: #B42318; }

/* ============================== Geteiltes Depot ========================== */

.intro { text-align: center; }
.intro__title { margin-top: 14px; font: 600 40px/1.08 'Outfit', system-ui, sans-serif; letter-spacing: -1.8px; color: var(--navtx); }
.intro__dek { max-width: 54ch; margin: 14px auto 0; font: 300 17px/1.6 'Outfit', system-ui, sans-serif; color: var(--navmut); }

.gauge__history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 14px 0 0; }
.gauge__history > div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.gauge__history dt { color: var(--fnt); font-size: 13px; }
.gauge__history dd { margin: 0; color: var(--tx); font-weight: 500; font-variant-numeric: tabular-nums; }
.gauge__note { margin: 12px 0 0; color: var(--fnt); font-size: 13px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================== Statusseite ==============================
 * `status.css` wird nach dieser Datei geladen und bringt das Raster mit. Es
 * greift auf `--muted`, `--faint` und `--line` zu — Namen aus `ledger.css`,
 * die es hier nicht gibt. Statt die Datei zu aendern, bekommt die Seite die
 * drei Namen auf sich selbst; ausserhalb von `<main>` bleibt alles unberuehrt.
 * Die Zustandsfarben dort haengen an `prefers-color-scheme`; wer von Hand
 * umschaltet, bekaeme sonst die Farbe des Systems. Deshalb hier noch einmal,
 * an `data-theme`, mit der hoeheren Spezifitaet. */

.status-page { --muted: var(--navmut); --faint: var(--navmut); --line: var(--rule); }
.status-page__meta { margin-top: 10px; }

.status-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.status-row { align-items: center; column-gap: 12px; display: grid; grid-template-columns: 10px 1fr auto; min-height: 56px; padding-block: 10px; }
.status-row__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--navmut); }
.status-row[data-state='ok'] .status-row__dot { background: #1F9D55; }
.status-row[data-state='degraded'] .status-row__dot { background: #C98A10; }
.status-row[data-state='down'] .status-row__dot { background: #C0392B; }
.status-row__name { color: var(--navtx); font-weight: 600; }
.status-row__badge { border-radius: 999px; color: var(--navmut); white-space: nowrap; }
.status-row__detail { grid-column: 2 / -1; }
[data-theme='light'] .status-row[data-state='degraded'] .status-row__badge { color: #8A5F06; }
[data-theme='light'] .status-row[data-state='down'] .status-row__badge { color: #A12E22; }
[data-theme='dark'] .status-row[data-state='degraded'] .status-row__badge { color: #F0C260; }
[data-theme='dark'] .status-row[data-state='down'] .status-row__badge { color: #FF9C8F; }

.status-legend { display: grid; gap: 4px 16px; grid-template-columns: auto 1fr; margin: 0; }
.status-legend dt { color: var(--navtx); font-weight: 600; }
.status-legend dd { margin: 0; }

/* ============================== Alte Huelle ==============================
 * Kopf- und Fussleiste sind auf allen zehn Seiten durch `.sl-head` und
 * `.sl-foot` ersetzt. Die Regeln bleiben trotzdem stehen: sie kosten wenig
 * und fangen eine Seite auf, die den Tausch verpasst. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  background: var(--lime);
  color: var(--ink);
  font: 600 14px/1 'Outfit', system-ui, sans-serif;
}
.skip-link:focus { left: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--rule);
}
.topbar__row { display: flex; align-items: center; gap: 20px; height: 68px; }
.topbar__actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.topbar__title { font: 600 14px/1 'Outfit', system-ui, sans-serif; color: var(--navtx); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font: 600 17px/1 'Outfit', system-ui, sans-serif;
  letter-spacing: -.4px;
  color: var(--navtx);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  flex: none;
  background: linear-gradient(180deg, #2A2C28, #0A0B09);
  color: #F2F3EE;
  font: 700 13px/1 'Outfit', system-ui, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.nav-primary { display: flex; align-items: center; gap: 2px; }
.nav-primary a {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: 17px;
  font: 500 14px/1 'Outfit', system-ui, sans-serif;
  color: var(--navmut);
  text-decoration: none;
}
.nav-primary a[aria-current] { background: var(--navpill); color: var(--navtx); }

.foot { margin-top: 88px; border-top: 1px solid var(--rule); }
.foot__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-block: 52px 36px; }
.foot__about { max-width: 280px; font: 400 13px/1.6 'Outfit', system-ui, sans-serif; color: var(--navmut); }
.foot__about .brand { margin-bottom: 14px; }
.foot__nav { display: grid; gap: 11px; align-content: start; font: 400 13.5px/1.35 'Outfit', system-ui, sans-serif; color: var(--navmut); }
.foot__nav b { font: 600 10.5px/1 'Outfit', system-ui, sans-serif; letter-spacing: 1.2px; text-transform: uppercase; }

/* ============================== Tableiste ============================== */

.tabbar {
  position: fixed;
  z-index: 70;
  inset: auto 0 max(12px, env(safe-area-inset-bottom, 0px)) 0;
  width: min(100% - 24px, 380px);
  margin-inline: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px;
  border-radius: 30px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 0 0 1px var(--ring), var(--depth);
}
.tabbar a {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 52px;
  border-radius: 24px;
  color: var(--navmut);
  font: 500 10px/1 'Outfit', system-ui, sans-serif;
}
.tabbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar [aria-current='page'] { background: var(--navpill); color: var(--navtx); }

/* ============================== Schmale Fenster ========================== */

@media (min-width: 900px) { .tabbar { display: none; } }

@media (max-width: 899px) { body:has(.tabbar) { padding-bottom: 84px; } }

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .page, .legal-page { padding-block: 44px 72px; }
  .page h1 { font-size: 32px; letter-spacing: -1.2px; }
  .page h2, .tile__lede h2 { font-size: 22px; letter-spacing: -.7px; }
  .intro__title { font-size: 30px; letter-spacing: -1.2px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { text-align: left; }
  .status-legend { grid-template-columns: 1fr; }
  .status-legend dd { margin-block-end: 8px; }
  .hide-sm { display: none !important; }
}
