/* Soul — gemeinsames Stylesheet für die Soul-Sektion von nextool.app.
 *
 * Dark-only. Fonts kommen aus dem bestehenden /fonts/-Verzeichnis des
 * nextool-Repos, damit das Bundle keine Binärdateien mitschleppt.
 */

@font-face {
  font-family: 'InterV';
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'JBMono';
  src: url('/fonts/JetBrainsMono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  font-style: normal;
}

:root {
  /* Flächen */
  --bg: #050505;
  --bg-1: #0a0a0c;
  --bg-2: #101014;
  --bg-3: #16161c;
  --line: #1e1e26;
  --line-2: #2b2b35;
  --line-3: #3a3a47;

  /* Text */
  --tx: #ececf1;
  --tx-2: #a1a1ad;
  --tx-3: #6e6e7c;

  /* Akzent: Indigo */
  --acc: #4f46e5;
  --acc-2: #6d66ee;
  --acc-3: #a5a0f5;
  --acc-soft: rgba(79, 70, 229, 0.12);
  --acc-line: rgba(79, 70, 229, 0.32);

  /* Zustandsfarben */
  --live: #34d399;
  --live-soft: rgba(52, 211, 153, 0.12);
  --warn: #f5b544;
  --warn-soft: rgba(245, 181, 68, 0.12);
  --err: #f4666f;
  --err-soft: rgba(244, 102, 111, 0.12);

  --sans: 'InterV', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JBMono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --w: 72rem;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 32px 80px -44px rgba(0, 0, 0, 0.95);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-image: radial-gradient(52rem 38rem at 78% -12%, rgba(79, 70, 229, 0.09), transparent 62%),
    radial-gradient(38rem 30rem at 8% 8%, rgba(79, 70, 229, 0.05), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--acc);
  color: #fff;
}

h1,
h2,
h3,
h4 {
  font-family: var(--sans);
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin: 0;
  font-weight: 650;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

img,
svg {
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 4vw, 2.5rem);
}

section {
  padding: clamp(3.5rem, 6.5vw, 6.5rem) 0;
}

/* Sprungziele dürfen nicht unter der klebenden Navigationsleiste landen. */
section[id],
[id]:target {
  scroll-margin-top: 5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--acc);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--r) 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  z-index: 300;
}
.skip:focus {
  left: 0;
}

/* ---------- Fortschrittsbalken ---------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--acc), var(--acc-3));
  z-index: 200;
  transition: width 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
  .progress {
    transition: none;
  }
}

/* ---------- Navigation ---------- */

nav.bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border-bottom: 1px solid var(--line);
}
nav.bar .in {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0.8rem clamp(1.15rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: -0.01em;
  flex: none;
}
.brand .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
  flex: none;
}
.brand .sub {
  color: var(--tx-3);
  font-weight: 400;
}
nav.bar .links {
  display: flex;
  gap: 1.35rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
nav.bar .links a {
  color: var(--tx-2);
  transition: color 0.2s;
  white-space: nowrap;
}
nav.bar .links a:hover,
nav.bar .links a.active {
  color: var(--tx);
}
/* Die Schaltfläche steht neben .links, nicht darin — Schriftschnitt und
 * Grösse müssen deshalb hier stehen. */
nav.bar .cta {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 0.55rem 0.85rem;
  color: var(--tx) !important;
  transition: 0.2s;
}
nav.bar .cta:hover {
  border-color: var(--acc);
  color: var(--acc-3) !important;
  background: var(--acc-soft);
}
nav.bar .cta.solid {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff !important;
  font-weight: 600;
}
nav.bar .cta.solid:hover {
  background: var(--acc-2);
  color: #fff !important;
}
nav.bar .cta {
  flex: none;
}

/* Auf schmalen Displays bleibt die Leiste einzeilig: die Abschnittslinks
 * scrollen waagrecht, die Anmelde-Schaltfläche bleibt immer sichtbar. */
@media (max-width: 860px) {
  nav.bar .in {
    gap: 0.75rem;
  }
  nav.bar .links {
    gap: 1.05rem;
    font-size: 0.66rem;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Etwas Luft, damit der Fokusrahmen nicht abgeschnitten wird. */
    padding: 0.25rem 0;
  }
  nav.bar .links::-webkit-scrollbar {
    display: none;
  }
  nav.bar .cta {
    font-size: 0.66rem;
    padding: 0.5rem 0.7rem;
  }
  .brand .sub {
    display: none;
  }
}

/* ---------- Typografische Bausteine ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc-3);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}
.eyebrow::before {
  content: '';
  width: 1.9rem;
  height: 1px;
  background: var(--acc);
  flex: none;
}

.shead {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2.6rem;
  max-width: 58ch;
}
.shead .kx {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.shead h2 {
  font-size: clamp(1.65rem, 1.2rem + 1.9vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.032em;
  font-weight: 700;
}
.shead p {
  color: var(--tx-2);
  margin: 0;
  font-size: 1.04rem;
}

.lede {
  color: var(--tx-2);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.28rem);
  line-height: 1.55;
  margin: 1.5rem 0 0;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--tx-2);
  background: var(--bg-2);
  white-space: nowrap;
}
.badge .bdot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge.live {
  color: var(--live);
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--live-soft);
}
.badge.wip {
  color: var(--warn);
  border-color: rgba(245, 181, 68, 0.3);
  background: var(--warn-soft);
}
.badge.plan {
  color: var(--tx-3);
  border-color: var(--line-2);
  border-style: dashed;
}
.badge.acc {
  color: var(--acc-3);
  border-color: var(--acc-line);
  background: var(--acc-soft);
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 0.81rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--tx);
  text-align: center;
}
.btn.primary {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) {
  background: var(--acc-2);
  transform: translateY(-1px);
}
.btn.ghost:hover:not(:disabled) {
  border-color: var(--acc);
  color: var(--acc-3);
  background: var(--acc-soft);
}
.btn.danger {
  border-color: rgba(244, 102, 111, 0.35);
  color: var(--err);
}
.btn.danger:hover:not(:disabled) {
  background: var(--err-soft);
  border-color: var(--err);
}
.btn.sm {
  font-size: 0.73rem;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
}
.btn.block {
  width: 100%;
}
/* Gesperrte Schaltflächen sollen nicht nur blasser, sondern erkennbar inaktiv
 * sein — eine halbdurchsichtige Volltonfläche liest sich weiter als klickbar. */
.btn:disabled {
  cursor: not-allowed;
  background: var(--bg-2) !important;
  border-color: var(--line) !important;
  color: var(--tx-3) !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.1rem;
}

/* ---------- Terminal-Mock ---------- */

.term {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: var(--mono);
}
.term .top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}
.term .top .b {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 50%;
  background: #2c2c36;
  flex: none;
}
.term .top .t {
  margin-left: 0.6rem;
  font-size: 0.71rem;
  color: var(--tx-3);
}
.term .body {
  padding: 1.1rem 1.15rem 1.3rem;
  font-size: 0.81rem;
  line-height: 1.75;
  overflow-x: auto;
}
.term .cmd {
  color: var(--tx-2);
}
.term .cmd .p {
  color: var(--acc-3);
  user-select: none;
}
.term .out {
  color: var(--tx);
}
.term .k {
  color: var(--tx-3);
}
.term .v {
  color: var(--acc-3);
}
.term .s {
  color: var(--live);
}
.term .w {
  color: var(--warn);
}
.term .note {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line-2);
  font-size: 0.67rem;
  color: var(--tx-3);
  line-height: 1.6;
}

/* ---------- Code-Block ---------- */

.code-block {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.95rem 1.05rem;
  background: var(--bg-1);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--tx-2);
  overflow-x: auto;
  margin: 1rem 0;
  white-space: pre;
  tab-size: 2;
}
.code-block .s {
  color: var(--live);
}
.code-block .k {
  color: var(--tx-3);
}
.code-block .v {
  color: var(--acc-3);
}
.code-block .str {
  color: #8fd3a6;
}

code.inline {
  font-size: 0.88em;
  color: var(--acc-3);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  border-radius: 5px;
  padding: 0.08em 0.38em;
  white-space: nowrap;
}

/* Kopier-Button auf Code-Blöcken */
.copywrap {
  position: relative;
}
.copywrap .copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  padding: 0.28rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--tx-3);
  cursor: pointer;
  opacity: 0;
  transition: 0.18s;
}
.copywrap:hover .copy,
.copywrap .copy:focus-visible {
  opacity: 1;
}
.copywrap .copy:hover {
  color: var(--acc-3);
  border-color: var(--acc-line);
}
.copywrap .copy.done {
  color: var(--live);
  border-color: rgba(52, 211, 153, 0.35);
  opacity: 1;
}

/* ---------- Kennzahlen-Streifen ---------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
/* Der Streifen teilt die Randabstände von .wrap, damit die erste Kennzahl
 * exakt unter der Überschrift beginnt. Die Trennlinien sitzen deshalb auf den
 * Zellen, nicht auf dem Rasterhintergrund. */
.strip .in {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 860px) {
  .strip .in {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat {
  min-height: 8.4rem;
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  /* Oben ausgerichtet, nicht zentriert: die Beschriftungen sind
   * unterschiedlich lang, zentriert würden die Mono-Indizes je nach
   * Zeilenumbruch auf verschiedenen Höhen sitzen. */
  justify-content: flex-start;
  gap: 0.5rem;
  position: relative;
  border-right: 1px solid var(--line);
}
.stat:first-child {
  padding-left: 0;
}
.stat:last-child {
  padding-right: 0;
  border-right: 0;
}
/* Zweispaltiges Raster: die rechte Spalte braucht keine Trennlinie, die
 * obere Reihe dafür eine untere. */
@media (max-width: 859px) {
  .stat:nth-child(2n) {
    border-right: 0;
    padding-right: 0;
  }
  .stat:nth-child(2n + 1) {
    padding-left: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}
/* Mono-Index je Kennzahl — greift die Sprache der Karten ("01 — Provenance")
 * auf und gibt dem Streifen Rhythmus, ohne Bildzeichen einzuführen. */
.stat .ix {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--tx-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat .ix::after {
  content: '';
  height: 1px;
  width: 1.35rem;
  background: var(--acc-line);
}
.stat .n {
  font-size: clamp(1.8rem, 1.3rem + 1.7vw, 2.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0.12em;
}
.stat .n .u {
  color: var(--acc-3);
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
}
.stat .l {
  font-family: var(--mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx-3);
  line-height: 1.45;
  margin: 0;
}
.stat .src {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #55555f;
  line-height: 1.4;
}

/* ---------- Karten & Grids ---------- */

.grid {
  display: grid;
  gap: 1rem;
}

/* Raster- und Flex-Kinder haben von Haus aus min-width:auto und werden damit
 * von breitem Inhalt (Code-Blöcke mit white-space:pre) auseinandergedrückt.
 * min-width:0 lässt stattdessen den Inhalt in seiner eigenen Box scrollen. */
.grid > *,
.line > *,
.hero-grid > *,
.docs-layout > *,
.strip .in > *,
.panel .ph > * {
  min-width: 0;
}
@media (min-width: 780px) {
  .grid.g2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid.g3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 620px) and (max-width: 779px) {
  .grid.g3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-1);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .card:hover {
    transform: none;
  }
}
.card .i {
  font-family: var(--mono);
  color: var(--acc-3);
  font-size: 0.75rem;
  margin-bottom: 0.9rem;
  letter-spacing: 0.03em;
}
.card h3 {
  font-size: 1.13rem;
  margin: 0 0 0.5rem;
  font-weight: 620;
  letter-spacing: -0.012em;
}
.card p {
  color: var(--tx-2);
  font-size: 0.95rem;
  margin: 0;
}
.card p + p {
  margin-top: 0.7rem;
}

/* ---------- Aufklappbare Details ---------- */

.item {
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.item + .item {
  margin-top: 0.85rem;
}
.item:hover {
  border-color: var(--line-3);
}
.item-title {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 1.45rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
}
.item-title::-webkit-details-marker {
  display: none;
}
.item-title h3 {
  font-size: clamp(1.12rem, 1.05rem + 0.4vw, 1.35rem);
  font-weight: 620;
  grid-column: 1;
  line-height: 1.2;
  letter-spacing: -0.016em;
  margin: 0;
}
.item-title .tz {
  grid-column: 1;
  color: var(--tx-2);
  font-size: 0.94rem;
  margin: 0;
  max-width: 62ch;
}
.item-title .chev {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--tx-2);
  font-size: 1.1rem;
  transition: 0.3s;
  flex: none;
  grid-row: 1 / span 2;
  grid-column: 2;
}
.item[open] .chev {
  transform: rotate(45deg);
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.item-reveal {
  padding: 0 1.45rem 1.5rem;
  display: grid;
  gap: 1rem;
}
.item-reveal p,
.item-reveal ul {
  margin: 0;
  color: var(--tx-2);
  font-size: 0.98rem;
  max-width: 68ch;
}
.item-reveal ul {
  padding-left: 1.15rem;
}
.item-reveal li + li {
  margin-top: 0.35rem;
}

/* ---------- Zeitstrahl (Entwicklungslinie) ---------- */

.line {
  display: grid;
  gap: 0;
  position: relative;
}
@media (min-width: 900px) {
  .line {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}
.node {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-1);
}
.node + .node {
  margin-top: 1rem;
}
@media (min-width: 900px) {
  .node + .node {
    margin-top: 0;
  }
}
.node.now {
  border-color: var(--acc-line);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.06), var(--bg-1));
}
.node.future {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}
.node .v {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tx);
  letter-spacing: -0.01em;
  display: block;
  margin: 0.75rem 0 0.3rem;
}
.node h3 {
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--tx);
}
.node p {
  color: var(--tx-2);
  font-size: 0.92rem;
  margin: 0;
}
.node .arrow {
  display: none;
}
@media (min-width: 900px) {
  .node .arrow {
    display: block;
    position: absolute;
    right: -0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    color: var(--line-3);
    font-size: 0.9rem;
    z-index: 2;
  }
  .node:last-child .arrow {
    display: none;
  }
}

/* ---------- Nachweis-Tabelle ---------- */

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-1);
}
table.proof {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 40rem;
}
table.proof th,
table.proof td {
  text-align: left;
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.proof thead th {
  font-family: var(--mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx-3);
  font-weight: 500;
  background: var(--bg-2);
  white-space: nowrap;
}
table.proof tbody tr:last-child td {
  border-bottom: 0;
}
table.proof td.what {
  color: var(--tx);
  font-weight: 500;
}
table.proof td.res {
  font-family: var(--mono);
  color: var(--acc-3);
  white-space: nowrap;
}
table.proof td.src {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--tx-3);
  line-height: 1.55;
}
table.proof td.lim {
  color: var(--tx-3);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* ---------- Hinweisboxen ---------- */

.note-box {
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--tx-3);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--bg-1);
  padding: 1.05rem 1.25rem;
  color: var(--tx-2);
  font-size: 0.94rem;
  margin: 1.25rem 0;
}
.note-box strong {
  color: var(--tx);
}
.note-box.wip {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, var(--warn-soft), var(--bg-1) 40%);
}
.note-box.acc {
  border-left-color: var(--acc);
  background: linear-gradient(90deg, var(--acc-soft), var(--bg-1) 40%);
}
.note-box.err {
  border-left-color: var(--err);
  background: linear-gradient(90deg, var(--err-soft), var(--bg-1) 40%);
}
.note-box .h {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx);
  margin-bottom: 0.5rem;
}
.note-box p {
  margin: 0;
}
.note-box p + p {
  margin-top: 0.6rem;
}

/* ---------- Formulare / Auth ---------- */

.auth-shell {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
  padding: clamp(2rem, 5vw, 4rem) 0;
}
.auth-card {
  width: min(27rem, 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.auth-card h1 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  font-weight: 700;
}
.auth-card .sub {
  color: var(--tx-2);
  font-size: 0.95rem;
  margin: 0 0 1.6rem;
}

.field {
  display: block;
  margin-bottom: 0.9rem;
}
.field > span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx-3);
  margin-bottom: 0.4rem;
}
.field input,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--tx);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input::placeholder {
  color: #4d4d58;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.field-row {
  display: grid;
  gap: 0.9rem;
}
@media (min-width: 420px) {
  .field-row.two {
    grid-template-columns: 1fr 1fr;
  }
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.4rem 0;
  font-family: var(--mono);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tx-3);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth {
  display: grid;
  gap: 0.65rem;
}
.oauth .btn {
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.72rem 1rem;
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 500;
}
.oauth .btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.auth-alt {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--tx-2);
}
.auth-alt a {
  color: var(--acc-3);
  border-bottom: 1px solid var(--acc-line);
}
.auth-alt a:hover {
  color: var(--acc-2);
}

.msg {
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.1rem;
  border: 1px solid;
  display: none;
}
.msg.show {
  display: block;
}
.msg.error {
  color: #ffb3b8;
  border-color: rgba(244, 102, 111, 0.35);
  background: var(--err-soft);
}
.msg.ok {
  color: #9ee9c4;
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--live-soft);
}
.msg.info {
  color: var(--tx-2);
  border-color: var(--line-2);
  background: var(--bg-2);
}

.legal {
  font-size: 0.78rem;
  color: var(--tx-3);
  line-height: 1.55;
  margin: 1.1rem 0 0;
  text-align: center;
}
.legal a {
  color: var(--tx-2);
  border-bottom: 1px solid var(--line-2);
}

/* ---------- Dashboard ---------- */

.dash-head {
  padding: clamp(2rem, 4vw, 3.25rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}
.dash-head h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  letter-spacing: -0.033em;
  margin: 0.55rem 0 0.4rem;
  font-weight: 700;
}
.dash-head .who {
  color: var(--tx-2);
  margin: 0;
  font-size: 0.98rem;
}
.dash-head .who code {
  color: var(--tx-3);
  font-size: 0.88em;
}

/* Auch als <section> verwendet — die globale Abschnitts-Polsterung muss hier
 * ausdrücklich zurückgenommen werden. */
.panel {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-1);
  overflow: hidden;
}
.panel + .panel {
  margin-top: 1.25rem;
}
.panel .ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.panel .ph h2 {
  font-size: 1.02rem;
  font-weight: 620;
  margin: 0;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.panel .ph p {
  margin: 0.3rem 0 0;
  color: var(--tx-3);
  font-size: 0.85rem;
  flex-basis: 100%;
}
.panel .pb {
  padding: 1.35rem;
}
.panel .pb.flush {
  padding: 0;
}

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.keys th,
.keys td {
  text-align: left;
  padding: 0.8rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.keys thead th {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx-3);
  font-weight: 500;
}
.keys tbody tr:last-child td {
  border-bottom: 0;
}
.keys td.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--tx-2);
}
.keys td.act {
  text-align: right;
  white-space: nowrap;
}

.empty {
  padding: 2.5rem 1.35rem;
  text-align: center;
  color: var(--tx-3);
}
.empty .big {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--tx-2);
  /* auto links/rechts, sonst hebt die höhere Spezifität das margin-inline
   * von .empty p auf und die Zeile klebt links. */
  margin: 0 auto 0.5rem;
}
.empty p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 42ch;
  margin-inline: auto;
  line-height: 1.6;
}

.reveal-key {
  font-family: var(--mono);
  font-size: 0.86rem;
  background: var(--bg);
  border: 1px solid var(--acc-line);
  border-radius: 9px;
  padding: 0.75rem 0.9rem;
  color: var(--acc-3);
  word-break: break-all;
  margin: 0.75rem 0;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-3);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: -0.15em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.5s;
  }
}

/* ---------- Docs ---------- */

.docs-layout {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 960px) {
  .docs-layout {
    grid-template-columns: 15rem 1fr;
    gap: 3rem;
  }
}
/* Das Verzeichnis ist auf schmalen Displays zusammenklappbar, ab 960px steht
 * es dauerhaft offen und klebt beim Scrollen mit. */
.toc-wrap > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--tx-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-1);
}
.toc-wrap > summary::-webkit-details-marker {
  display: none;
}
.toc-wrap > summary::after {
  content: '+';
  font-size: 1rem;
  color: var(--tx-3);
}
.toc-wrap[open] > summary {
  margin-bottom: 1.1rem;
}
.toc-wrap[open] > summary::after {
  content: '−';
}

.toc {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
}
@media (min-width: 960px) {
  .toc-wrap > summary {
    display: none;
  }
  .toc-wrap {
    position: sticky;
    top: 5rem;
    /* Ohne align-self:start füllt das Rasterkind die ganze Zeilenhöhe und
     * hat damit keinen Weg, an dem es kleben könnte. */
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}
.toc .grp {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--tx-3);
  margin: 1.5rem 0 0.6rem;
}
.toc .grp:first-child {
  margin-top: 0;
}
.toc a {
  display: block;
  color: var(--tx-2);
  padding: 0.32rem 0 0.32rem 0.75rem;
  border-left: 1px solid var(--line);
  transition: 0.18s;
}
.toc a:hover {
  color: var(--tx);
  border-left-color: var(--line-3);
}
.toc a.active {
  color: var(--acc-3);
  border-left-color: var(--acc);
}

.doc h2 {
  font-size: 1.5rem;
  letter-spacing: -0.028em;
  margin: 0 0 0.8rem;
  scroll-margin-top: 5.5rem;
  font-weight: 680;
}
.doc h3 {
  font-size: 1.08rem;
  margin: 2.1rem 0 0.6rem;
  scroll-margin-top: 5.5rem;
  color: var(--tx);
  font-weight: 620;
}
.doc h2:not(:first-child) {
  margin-top: 3.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}
.doc p,
.doc li {
  color: var(--tx-2);
  font-size: 0.98rem;
}
.doc p {
  margin: 0 0 0.9rem;
  max-width: 70ch;
}
.doc ul,
.doc ol {
  max-width: 70ch;
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}
.doc li + li {
  margin-top: 0.35rem;
}
.doc .step {
  counter-increment: step;
  margin: 1.4rem 0;
}

/* Die Doku-Tabellen brauchen auf schmalen Displays einen eigenen
 * Scrollbereich — ohne ihn schieben sie die ganze Seite waagrecht auf.
 * display:block macht die Tabelle zu einer scrollbaren Box; die Zeilen
 * werden weiterhin als Tabelle gesetzt. */
.params {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin: 1rem 0 1.5rem;
}
.params thead,
.params tbody {
  /* Ohne diese Angabe verlieren die Gruppen im Block-Kontext ihre
   * Tabellenbreite und die Spalten fluchten nicht mehr. */
  display: table;
  width: 100%;
  min-width: 30rem;
}
.params th,
.params td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.params thead th {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx-3);
  font-weight: 500;
  background: var(--bg-2);
}
.params td:first-child {
  font-family: var(--mono);
  color: var(--acc-3);
  white-space: nowrap;
}
.params td:nth-child(2) {
  font-family: var(--mono);
  color: var(--tx-3);
  font-size: 0.82em;
  white-space: nowrap;
}
.params td:last-child {
  color: var(--tx-2);
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 0.7rem 0.95rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.endpoint .m {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  background: var(--acc);
  color: #fff;
  flex: none;
}
.endpoint .m.get {
  background: var(--live);
  color: #04170f;
}
.endpoint .u {
  color: var(--tx);
  word-break: break-all;
}

/* ---------- Footer ---------- */

footer.site {
  border-top: 1px solid var(--line);
  padding: 3rem 0 3.5rem;
  margin-top: 2rem;
}
footer.site .th {
  font-size: 1.3rem;
  color: var(--tx);
  max-width: 40ch;
  margin: 0 0 1.6rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
footer.site .th .em {
  color: var(--acc-3);
}
footer.site .cols {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2.25rem;
}
@media (min-width: 640px) {
  footer.site .cols {
    grid-template-columns: repeat(3, 1fr);
  }
}
footer.site .col h4 {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--tx-3);
  margin: 0 0 0.75rem;
  font-weight: 500;
}
footer.site .col a {
  display: block;
  color: var(--tx-2);
  font-size: 0.9rem;
  padding: 0.24rem 0;
  transition: color 0.18s;
}
footer.site .col a:hover {
  color: var(--acc-3);
}
footer.site .fine {
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--tx-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

/* ---------- Scroll-Reveal ---------- */

.rev {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rev.vis {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .rev {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Fokus ---------- */

/* Sichtbarer Fokusring für Tastatur-Navigation.
 *
 * Bewusst --acc-3 statt --acc: das kräftigere Indigo hebt sich auf #050505
 * deutlich ab, das dunklere ginge im Hintergrund unter. Der zusätzliche
 * Schein trennt den Ring von umliegenden Rahmen.
 *
 * Hier wird KEIN border-radius gesetzt — das würde die Ecken des fokussierten
 * Elements verformen. Der Umriss folgt von selbst der vorhandenen Rundung. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
details:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--acc-3);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.25);
}

/* Eingabefelder haben im Ruhezustand schon einen Rahmen; bei Tastaturfokus
 * bekommen sie zusätzlich den Umriss, damit sie sich vom Mausfokus abheben. */
.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--acc-3);
}

/* Der Sprunglink muss auch auf dunklem Grund sofort ins Auge fallen. */
.skip:focus-visible {
  outline-color: #fff;
}

/* ---------- Hilfsklassen ---------- */

.mono {
  font-family: var(--mono);
}
.dim {
  color: var(--tx-3);
}
.nowrap {
  white-space: nowrap;
}
.mt0 {
  margin-top: 0;
}
.pt0 {
  padding-top: 0;
}
.hidden {
  display: none !important;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.35rem;
}
