/* Farben und Schrift nach ioqo Designguide 1.0 – dunkle Variante (Logo invertiert auf Ink) */
:root {
  --ink: #0D111B;
  --ink-raised: #121726;
  --orange: #FA6303;
  --violet: #7B2FF5;
  --blue: #0763FF;
  --fg: #fff;
  --mute: #A9AEBC;
  --claim: #C9CDD8;
  --line: #262B3B;

  /* Verlauf des „q“ aus dem Logo */
  --q: linear-gradient(90deg, var(--orange), #F7581C 30%, #B63DA5 58%, var(--violet) 78%, var(--blue));

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  /* Gemeinsamer Schriftgrad für große Aussagen (Hero, Über uns) */
  --display: clamp(1.625rem, 3.4vw, 3rem);
  --max: 1280px;
  --measure: 60ch;
  --nav-h: 72px;
  /* Datenfarbe für Diagramme: geprüft gegen die dunkle Kartenfläche (Kontrast, Helligkeit) */
  --chart: #8F5BFF;
}

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

/* Versteckt bleibt versteckt – auch wenn eine Klasse display setzt */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--fg); text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--fg);
  color: var(--ink);
  padding: 8px 14px;
  z-index: 20;
}
.skip:focus { top: 12px; }

/* Navigation: bleibt oben stehen, Inhalt scheint gedämpft durch */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(13 17 27 / 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgb(38 43 59 / 0.7);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--nav-h);
}

.nav__brand img {
  display: block;
  width: 112px;
  height: auto;
  /* Der Punkt über dem „i“ zieht das Bild nach oben: so sitzen die Buchstaben auf der Mittellinie der Leiste */
  translate: 0 -8%;
}

.nav nav { margin-left: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mittig statt an der Grundlinie ausrichten, sonst hebt das Schloss „Intern“ an */
.nav__links li { display: flex; }

.nav__links a,
.nav__links button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--claim);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}
.nav__links button {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font);
  cursor: pointer;
}
.nav__links a:hover,
.nav__links button:hover,
.nav__links a[aria-current] { color: var(--fg); }

.nav__links form { margin: 0; }

/* Unauffälliger Anmelde-Button für Mitglieder: nur ein Schloss, ganz rechts */
.nav__login {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: clamp(4px, 1vw, 12px);
  border: 1px solid transparent;
  border-radius: 50%;
  color: #6B7286;
  transition: color 0.2s, border-color 0.2s;
}
.nav__login:hover,
.nav__login:focus-visible { color: var(--fg); border-color: var(--line); }

.nav__lock {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Sprachauswahl */
.lang {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0 0 0 clamp(8px, 2vw, 24px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.lang a {
  display: block;
  padding: 3px 9px;
  border-radius: 99px;
  color: var(--mute);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
.lang a:hover { color: var(--fg); }
.lang a[aria-current] { background: var(--fg); color: var(--ink); }

/* Buttons nach Designguide */
.btn {
  display: inline-block;
  font: 600 0.9375rem var(--font);
  border-radius: 99px;
  padding: 14px 28px;
  border: 0;
  background: var(--fg);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--blue); color: var(--fg); }

/* Hero: die Bildmarke „q“ als Blickfang */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(calc(100svh - var(--nav-h)), 900px);
  padding-block: clamp(64px, 12vh, 140px);
  overflow: hidden;
  isolation: isolate;
}

.hero__inner { position: relative; }

/* Das „q“ ist so hoch wie der Textblock: von der Überschrift bis zum Button */
.hero__mark {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  right: var(--gutter);
  aspect-ratio: 241 / 244;
  /* Beim Laden aus dem Hintergrund von ganz groß auf die eigentliche Größe einzoomen */
  animation: q-zoom 2.8s cubic-bezier(0.33, 1, 0.68, 1) 0.1s both;
}

.q-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  /* Neigt sich mit der Maus, Werte setzt app.js */
  transform: perspective(1000px) rotateY(var(--tilt-x, 0deg)) rotateX(var(--tilt-y, 0deg));
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ohne Maus (Handy, Tablet) dreht sich das „q“ stattdessen ganz langsam hin und her */
@media (hover: none), (pointer: coarse) {
  .q-mark { animation: q-sway 18s ease-in-out 2.5s infinite alternate; }
}

/* Ruhiger, kaum sichtbarer Farbschein hinter dem „q“ */
.hero__glow {
  position: absolute;
  inset: -8%;
  background: radial-gradient(closest-side, rgb(182 61 165 / 0.3), rgb(7 99 255 / 0.12) 60%, transparent);
  filter: blur(60px);
}

@keyframes q-zoom {
  from { opacity: 0; scale: 6; filter: blur(24px); }
  35% { opacity: 1; }
}

@keyframes q-sway {
  from { rotate: -4deg; }
  to { rotate: 4deg; }
}
}
}

.hero__inner > :not(.hero__mark) {
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Die Überschrift baut sich Wort für Wort auf, danach folgen Text und Buttons */
.hero__inner .hero__title { animation: none; }

.hero__title .word {
  display: inline-block;
  animation: word-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(0.15s + var(--i) * 0.05s);
}

.hero__inner .hero__lead { animation-delay: 0.75s; }
.hero__inner .hero__actions { animation-delay: 0.9s; }

@keyframes rise {
  from { opacity: 0; translate: 0 18px; }
}

@keyframes word-in {
  from { opacity: 0; translate: 0 0.3em; filter: blur(8px); }
}

/* Beim Scrollen: Text und „q“ gleiten langsamer weg und werden blasser */
@supports (animation-timeline: scroll()) {
  .hero__inner {
    animation: hero-drift linear both;
    animation-timeline: scroll(root);
    animation-range: 0 80vh;
  }

  @keyframes hero-drift {
    to { opacity: 0.25; translate: 0 -48px; }
  }

  /* Das „q“ zoomt beim Herunterscrollen wieder auf */
  .q-mark,
  .hero__glow {
    animation: q-grow linear both;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }

  @media (hover: none), (pointer: coarse) {
    .q-mark {
      animation: q-sway 18s ease-in-out 2.5s infinite alternate, q-grow linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 90vh;
    }
  }

  @keyframes q-grow {
    to { scale: 2.4; }
  }
}

.hero__title {
  font-size: var(--display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  max-width: 17ch;
  text-wrap: balance;
}

.hero__lead {
  color: var(--claim);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-width: 40ch;
  margin-top: clamp(24px, 4vh, 36px);
}

.hero__status {
  margin-top: 24px;
  color: var(--claim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(32px, 5vh, 48px);
}

/* Abschnittstitel: klein und ruhig, damit die Aussagen wirken */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: -0.01em;
}

/* Über uns */
.about {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 clamp(16px, 2vw, 32px);
  padding-block: clamp(80px, 16vh, 180px);
  border-top: 1px solid var(--line);
}

.about .section-title { grid-column: 1 / -1; margin-bottom: 28px; }

.about__statement {
  grid-column: 1 / span 11;
  font-size: var(--display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}

.about__text {
  grid-column: 6 / span 6;
  color: var(--mute);
  font-size: 1.125rem;
  max-width: var(--measure);
  margin-top: clamp(40px, 7vh, 72px);
}

/* Was wir tun: Bento-Raster, jede Kachel in einer Farbe aus dem Verlauf des „q“ */
.work {
  padding-block: 0 clamp(80px, 16vh, 180px);
}

.work .section-title { margin-bottom: 28px; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "try   try      discuss build"
    "share automate play    play";
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--ink-raised);
  overflow: hidden;
}

/* In den Bento-Kacheln steht das Symbol klein neben dem Titel */
.bento .tile {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 6px 10px;
}

.bento .tile p { grid-column: 1 / -1; }

.tile--try { grid-area: try; }
.tile--discuss { grid-area: discuss; }
.tile--build { grid-area: build; }
.tile--share { grid-area: share; }
.tile--automate { grid-area: automate; }
.tile--play { grid-area: play; }

.tile__icon {
  width: 20px;
  height: 20px;
  align-self: center;
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  hyphens: auto;
}

.tile p { color: var(--mute); font-size: 0.875rem; line-height: 1.5; max-width: 52ch; }

/* Kontakt-Popup */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--ink-raised);
  color: var(--fg);
  overflow-y: auto;
  opacity: 1;
  translate: 0 0;
  transition: opacity 0.25s, translate 0.35s cubic-bezier(0.16, 1, 0.3, 1), overlay 0.25s allow-discrete, display 0.25s allow-discrete;
}

/* Linie im Verlauf des „q“ oben am Popup */
.dialog::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--q);
}

.dialog:not([open]) { opacity: 0; translate: 0 16px; }

@starting-style {
  .dialog[open] { opacity: 0; translate: 0 16px; }
}

.dialog::backdrop {
  background: rgb(5 7 12 / 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
}
.dialog__close:hover { background: var(--line); color: var(--fg); }
.dialog__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.dialog__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  padding-right: 40px;
}
.dialog__title:focus { outline: none; }

.dialog__intro { color: var(--mute); margin: 8px 0 28px; }

.dialog [data-view="done"] .btn { margin-top: 4px; }

.form { display: grid; gap: 18px; }

.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { display: grid; gap: 6px; }

.field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claim);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--fg);
  font: 400 1rem/1.5 var(--font);
  transition: border-color 0.2s;
}

.field textarea { resize: vertical; min-height: 132px; }

.field input:hover,
.field textarea:hover { border-color: #3A4058; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 0;
  border-color: var(--violet);
  border-radius: 12px;
}

.field [aria-invalid] { border-color: var(--orange); }

.field__error {
  color: #FF8A3D;
  font-size: 0.875rem;
}
.field__error:empty { display: none; }

.form__privacy { color: var(--mute); font-size: 0.8125rem; line-height: 1.5; }

.form__status { color: #FF8A3D; font-size: 0.9375rem; }
.form__status:empty { display: none; }

.form .btn { justify-self: start; }
.form .btn:disabled { opacity: 0.6; cursor: progress; }
/* Interner Bereich */
.intern {
  padding-block: clamp(40px, 8vh, 96px) clamp(64px, 12vh, 140px);
}

.intern--narrow { max-width: calc(520px + 2 * var(--gutter)); }

.panel {
  position: relative;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--ink-raised);
  overflow: hidden;
}

/* Linie im Verlauf des „q“, wie beim Kontakt-Popup */
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--q);
}

.intern__title {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 8px;
}

.intern__intro { color: var(--mute); margin-bottom: 24px; }
.intern__hint { color: var(--mute); font-size: 0.875rem; margin-top: 24px; }

.intern__greeting {
  font-size: clamp(2.375rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.intern__lead {
  color: var(--claim);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-width: 48ch;
  margin-top: 20px;
}

.intern__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
  list-style: none;
  margin: clamp(40px, 7vh, 72px) 0 0;
  padding: 0;
}

.intern__links h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Die ganze Kachel ist klickbar */
.tile__link { color: var(--fg); text-decoration: none; }
.tile__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile:has(.tile__link):hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.tile:has(.tile__link:focus-visible) { outline: 3px solid var(--violet); outline-offset: 3px; }
.tile__link:focus-visible { outline: none; }

.intern__columns {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 32px;
}

.panel__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Brotkrümel über Projektseiten */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--mute);
}
.crumbs a { color: var(--claim); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }

/* Reiter innerhalb eines Projekts (Übersicht, Ausgaben, …) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: clamp(24px, 4vh, 40px);
  border-bottom: 1px solid var(--line);
}

.tabs__item {
  margin-bottom: -1px;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--mute);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.tabs__item:hover { color: var(--fg); }
.tabs__item[aria-current] { color: var(--fg); border-bottom-color: var(--orange); }
.tabs--sub { position: relative; margin: 0 0 20px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs--sub .tabs__item { flex: none; padding: 8px 12px; font-size: 0.875rem; }
.tabs__count { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--mute); font-size: 0.75rem; }
.tabs__item[aria-current] .tabs__count { color: var(--fg); }

.project__empty {
  margin-top: 24px;
  color: var(--mute);
}

.notice {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  background: var(--ink-raised);
  color: var(--claim);
  margin-bottom: 24px;
}

.notice--error { border-left-color: var(--orange); }
.notice--link { border-left-color: var(--violet); margin-top: 24px; }

.copy {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.copy__input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--ink);
  color: var(--claim);
  font: 400 0.875rem var(--font);
}

.copy__button { padding: 10px 20px; }

.field--choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--choice legend {
  width: 100%;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claim);
}

.field--choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 1rem;
  color: var(--fg);
}

.field--choice input { accent-color: var(--violet); width: 18px; height: 18px; }

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.person__info { display: grid; gap: 2px; min-width: 0; }
.person__info span { color: var(--mute); font-size: 0.9375rem; overflow-wrap: anywhere; }
.person__info .person__meta { font-size: 0.8125rem; }

.person__info .badge,
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--line);
  color: var(--claim);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: 2px;
}

.person__actions { display: flex; gap: 8px; }
.person__actions form { margin: 0; }

.person__button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--claim);
  font: 500 0.8125rem var(--font);
  cursor: pointer;
}
.person__button:hover { border-color: var(--fg); color: var(--fg); }
.person__button--danger:hover { border-color: var(--orange); color: var(--orange); }

code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--line);
  font-size: 0.875em;
}

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

.muted { color: var(--mute); }

.btn--ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover { background: var(--line); color: var(--fg); }
.btn--small { padding: 8px 16px; font-size: 0.875rem; }

.notice--top { margin-top: 24px; }
.notice p { margin: 0; }
.notice__list { margin: 8px 0 0; padding-left: 1.2em; font-size: 0.875rem; color: var(--mute); }

.panel__heading {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.project__panel { margin-top: 24px; }
.field__hint { margin: 4px 0 0; font-size: 0.8125rem; color: var(--mute); }
.field--stack { flex-direction: column; align-items: flex-start; }
.field--stack label { font-size: 0.9375rem; }

/* Ausgaben: Salden */
.balance {
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink-raised);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  overflow: hidden;
}
.balance th,
.balance td { padding: 10px 16px; text-align: right; border-bottom: 1px solid var(--line); }
.balance tbody tr:last-child > * { border-bottom: 0; }
.balance thead th { font-size: 0.8125rem; font-weight: 500; color: var(--mute); }
.balance th[scope="row"],
.balance thead th:first-child { text-align: left; font-weight: 600; }
.balance__me { background: rgb(255 255 255 / 0.03); }

/* Ausgaben: Unternavigation (Übersicht, Einträge, Beteiligte) mit Erfassen-Buttons */
.subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.subnav .segmented { margin-bottom: 0; }
.subnav__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Ausgaben: Übersicht */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  margin-top: 20px;
}
.dash__stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.dash__stats--parties { margin-top: 20px; }
.dash .panel { margin: 0; }
.dash__latest { grid-column: 1 / -1; }

.tile-stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink-raised);
}
.tile-stat--settle { grid-column: 1 / -1; }
.tile-stat__label { margin: 0 0 6px; font-size: 0.8125rem; color: var(--mute); }
.tile-stat__value { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-stat__main { margin: 0; font-size: clamp(1.125rem, 2vw, 1.375rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.35; }
.tile-stat__main strong { font-weight: 700; }
.tile-stat__hint { margin: 6px 0 0; font-size: 0.8125rem; color: var(--mute); }
.is-owing { color: #FF8A3D; }
.is-owed { color: #8FA6FF; }

.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel__more { font-size: 0.875rem; color: var(--claim); }

/* Säulendiagramm Monate: dünne Säulen, oben 4px rund, 2px Abstand, Wert beim Zeigen */
.colchart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 0 2px;
  height: 200px;
  padding: 0 0 22px 64px;
}
.colchart__grid {
  position: absolute;
  inset: 0 0 22px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.colchart__grid span {
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
  line-height: 1;
  padding-top: 3px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.colchart__grid span:last-child { border-top-style: solid; }
.colchart__col {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  outline-offset: 2px;
}
.colchart__bar {
  width: min(70%, 28px);
  height: var(--h);
  min-height: 1px;
  border-radius: 4px 4px 0 0;
  background: var(--chart);
  transition: opacity 0.15s;
}
.colchart:hover .colchart__bar { opacity: 0.55; }
.colchart__col:hover .colchart__bar,
.colchart__col:focus-visible .colchart__bar { opacity: 1; }
.colchart__label {
  position: absolute;
  bottom: -20px;
  font-size: 0.6875rem;
  color: var(--mute);
  white-space: nowrap;
}
.colchart__tip {
  position: absolute;
  bottom: calc(var(--h, 0%) + 6px);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--fg);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 1;
}
.colchart__col:hover .colchart__tip,
.colchart__col:focus-visible .colchart__tip { opacity: 1; }

.dash__table { margin-top: 14px; font-size: 0.875rem; color: var(--claim); }
.dash__table summary { cursor: pointer; }
.mini-table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.mini-table th,
.mini-table td { padding: 6px 16px 6px 0; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
.mini-table th:last-child,
.mini-table td:last-child { padding-right: 0; }
.mini-table th { font-weight: 500; color: var(--mute); }
.mini-table .num { text-align: right; }

.latest { list-style: none; margin: 0; padding: 0; }
.latest__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.latest__item:last-child { border-bottom: 0; }
.latest__date { color: var(--claim); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.latest__what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); text-decoration: none; }
.latest__what:hover strong { color: var(--blue); }
.latest__amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.legend-list { margin: 20px 0 0; display: grid; gap: 6px; font-size: 0.875rem; }
.legend-list div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.legend-list dt { font-weight: 600; color: var(--claim); }
.legend-list dd { margin: 0; color: var(--mute); }

/* Stromlaufplan */
.circuit {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  margin-top: 20px;
  align-items: start;
}
.circuit .panel { margin: 0; }
.circuit__side { display: grid; gap: 16px; }

.tree-group + .tree-group { margin-top: 20px; }
.tree-group__head { margin: 0 0 6px; }
.tree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--line);
}
.tree li { position: relative; padding: 5px 0 5px 12px; font-size: 0.9375rem; line-height: 1.5; }
.tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  border-top: 1px solid var(--line);
}
.tree .tree { margin-top: 4px; }
.tree__edit { margin-left: 6px; font-size: 0.8125rem; color: var(--claim); }

.chip {
  display: inline-block;
  min-width: 2.2em;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  vertical-align: 1px;
  border: 1px solid var(--line);
  color: var(--claim);
}
.chip--group,
.chip--breaker { background: var(--fg); color: var(--ink); border-color: var(--fg); }
.chip--knx { border-color: var(--chart); color: #C8B2FF; }
.chip--channel { border-style: dashed; }

.paths { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 0.9375rem; }
.paths__step { color: var(--fg); }
.paths__arrow { margin: 0 8px; color: var(--mute); }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.875rem; }
.checks__label {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--line);
  color: var(--claim);
}
.checks__item--warn .checks__label { background: rgb(250 99 3 / 0.18); color: #FF8A3D; }
.checks__ok { margin: 0 0 8px; color: var(--claim); }

.table-scroll { overflow-x: auto; }
.parts td,
.terminals td { vertical-align: top; }
.parts__links { white-space: nowrap; text-align: right; }
.parts__links a { margin-left: 10px; font-size: 0.875rem; color: var(--claim); }
.terminals__first td { border-top: 1px solid var(--claim); }
.terminals__clash td { color: #FF8A3D; }
.terminals__block th { padding-top: 22px; text-align: left; font-size: 1rem; font-weight: 700; }
.terminals__block:first-child th { padding-top: 6px; }
.terminals__block .muted { font-weight: 400; font-size: 0.875rem; }
.core {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid var(--line);
  vertical-align: 0;
}
.core--braun { background: #8B4A1E; }
.core--blau { background: #2F6BFF; }
.core--gruen { background: repeating-linear-gradient(90deg, #2FA84F 0 3px, #F2D31B 3px 6px); }
.core--grau { background: #9AA0AC; }
.core--schwarz { background: #000; border-color: var(--mute); }

/* KNX-Gerät: Aktor-Kanäle */
.channels { display: grid; gap: 12px; }
.channels__head { margin: 8px 0 0; font-size: 1rem; }
.channels__list { display: grid; gap: 12px; }
.channel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--violet, #7B2FF5);
  border-radius: 12px;
}
.channel legend { padding: 0 6px; font-weight: 600; }
.channel .field { gap: 6px; }

/* Leiter-Abschnitte im Kabel-Formular, links in Aderfarbe markiert */
.conductor {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 16px 16px 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--conductor, var(--line));
  border-radius: 12px;
}
.conductor legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 600; }
.conductor legend .core { margin: 0; }
.conductor--braun { --conductor: #8B4A1E; }
.conductor--grau { --conductor: #9AA0AC; }
.conductor--schwarz { --conductor: #4A4F5C; }
.cs-core { stroke: var(--ink); stroke-width: 1.5; }
/* Anschlussgrafik eines Bauteils */
.ports { margin: 8px 0 12px; }
.ports__head { margin: 16px 0 0; font-size: 1rem; }
.cs--ports { width: 100%; height: auto; }
.cs-line--path { fill: none; }
.cs-box--knxport { fill: rgb(143 91 255 / 0.12); stroke: var(--chart); }
.cs-box--self { fill: rgb(250 99 3 / 0.08); stroke: var(--orange); }
.cs-line--open { stroke: var(--mute); stroke-dasharray: 3 3; }
.ports-box { margin: 0 0 20px; }
.ports-box summary { cursor: pointer; font-weight: 600; }
.part-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; margin: 20px 0 0; }
.part-facts dt { font-size: 0.8125rem; color: var(--mute); }
.part-facts dd { margin: 2px 0 0; }
.cs-core--braun { fill: #8B4A1E; }
.cs-core--grau { fill: #9AA0AC; }
.cs-core--schwarz { fill: #000; stroke: var(--mute); }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.9375rem; }
.history__when { color: var(--mute); font-variant-numeric: tabular-nums; margin-right: 8px; }
.history__who { color: var(--claim); margin-right: 6px; }
.print-sheet__group { margin: 24px 0 6px; font-size: 1rem; }

/* Stromlaufplan: Grafik */
.cs-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 20px; }
.cs-toolbar .field__hint { margin: 0; max-width: 70ch; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.8125rem; color: var(--claim); }
.cs-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cs-legend svg { width: 22px; height: 22px; }
.cs-panel { padding: 16px; }
.cs-scroll { overflow-x: auto; }
.cs { display: block; font-family: var(--font); }
.cs-line { stroke: var(--claim); stroke-width: 1.5; }
.cs-line--thin { stroke-width: 1.5; }
.cs-line--knx { stroke: var(--chart); stroke-dasharray: 4 3; }
.cs-bus { stroke: var(--fg); stroke-width: 4; stroke-linecap: round; }
.cs-box { fill: var(--ink); stroke: var(--claim); stroke-width: 1.5; }
.cs-box--fi { stroke: var(--fg); stroke-width: 2; }
.cs-box--breaker { stroke: var(--fg); }
.cs-box--block { fill: var(--claim); stroke: none; }
.cs-box--knx { fill: rgb(143 91 255 / 0.15); stroke: var(--chart); }
.cs-symbol { fill: none; stroke: var(--fg); stroke-width: 1.6; }
.cs-symbol-line { stroke: var(--fg); stroke-width: 1.6; }
.cs-symbol-dot { fill: var(--fg); }
.cs-symbol-text { fill: var(--fg); font-size: 11px; font-weight: 700; }
.cs-label { fill: var(--fg); font-size: 13px; }
.cs-label--strong { font-weight: 700; font-size: 14px; }
.cs-label--title { font-weight: 600; font-size: 16px; }
.cs-label--meta { fill: var(--mute); font-size: 11.5px; }
.cs-label--small { font-size: 11px; fill: var(--claim); }
.cs-label--knx { fill: #C8B2FF; font-weight: 700; }
.cs-node { cursor: default; }
a.cs-node { cursor: pointer; }
.cs-node:hover .cs-box,
.cs-node:focus .cs-box { stroke: var(--orange); }
.cs-node:hover .cs-label:not(.cs-label--meta),
.cs-node:focus .cs-label:not(.cs-label--meta) { fill: #FFB27A; }
.cs-node:focus { outline: none; }
.cs-node--warn .cs-symbol,
.cs-node--warn .cs-symbol-line { stroke: #FF8A3D; }
.cs-node--warn .cs-symbol-dot { fill: #FF8A3D; }
.cs-node--warn .cs-label--meta { fill: #FF8A3D; }

/* Druck: nur der Inhalt, schwarz auf weiß */
@media print {
  .nav, .footer, .tabs, .crumbs, .no-print, .skip, .intern__greeting { display: none !important; }
  body, .panel, .intern { background: #fff !important; color: #000 !important; }
  .panel { border: 0 !important; padding: 0 !important; }
  .panel::before { display: none !important; }
  .mini-table th, .mini-table td { color: #000 !important; border-color: #999 !important; }
  .muted, .field__hint { color: #444 !important; }
  .cs-scroll { overflow: visible !important; }
  .cs { max-width: 100%; height: auto; }
  .cs-line, .cs-box, .cs-symbol, .cs-symbol-line { stroke: #000 !important; }
  .cs-bus, .cs-box--fi, .cs-box--breaker { stroke: #000 !important; }
  .cs-box { fill: #fff !important; }
  .cs-box--block, .cs-symbol-dot { fill: #000 !important; }
  .cs-label { fill: #000 !important; }
  .cs-label--meta { fill: #444 !important; }
  .cs-legend { color: #000 !important; }
}

/* Beschriftungsstreifen (Schutzschalter) – auf dem Bildschirm wie Papier */
.panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.labels__sheet { margin-top: 20px; padding: 16px; overflow-x: auto; background: #fff; border-radius: 10px; }
.labels__strip, .labels__ruler { display: block; margin-bottom: 6mm; }
.labels .toggle select { margin-left: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: inherit; }
@media print {
  .labels__sheet { padding: 0; overflow: visible; border-radius: 0; }
}

/* Ausgaben: Filter */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.filters input,
.filters select {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-raised);
  color: var(--fg);
  font: 400 0.9375rem var(--font);
}
.filters input { flex: 1 1 220px; }
.filters--toggles { align-items: center; margin: 0 0 16px; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-raised);
  font-size: 0.875rem;
  cursor: pointer;
}
.toggle:has(input:checked) { border-color: var(--orange); }
.filters .toggle input { flex: none; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--orange); }
.filters__reset { align-self: center; font-size: 0.875rem; color: var(--claim); }
.filters__result { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; font-size: 0.875rem; color: var(--mute); }
.filters__export { margin-left: auto; color: var(--claim); }

/* Ausgaben: Einträge */
.entries {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.entries th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mute);
  text-align: left;
  white-space: nowrap;
}
.entries td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entries .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry__date { white-space: nowrap; color: var(--claim); font-variant-numeric: tabular-nums; }
.entry__what strong { font-weight: 600; }
.entry__what .muted { display: block; }
.entry__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.entry__mobile-label { display: none; }
.entry--gutschrift .entry__amount { color: #6E8BFF; }
.entry--rueckzahlung { background: rgb(255 255 255 / 0.02); }
.entry__links { white-space: nowrap; text-align: right; }
.entry__receipt { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 2px; color: var(--claim); vertical-align: middle; }
.entry__receipt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entry__receipt:hover { color: var(--fg); }
.entry__edit { font-size: 0.875rem; color: var(--claim); }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--line);
  color: var(--claim);
  font-size: 0.75rem;
}
.tag--refund { background: rgb(7 99 255 / 0.18); color: #9DB4FF; }

/* Ausgaben: Balken je Kategorie (eine Datenreihe, eine Farbe) */
.bars { margin: 0; }
.bars__row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.bars__row:last-child { border-bottom: 0; }
.bars dt a { color: var(--fg); text-decoration: none; font-size: 0.9375rem; }
.bars dt a:hover { color: var(--blue); }
.bars dd .muted { white-space: nowrap; }
.bars dd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--claim);
  font-variant-numeric: tabular-nums;
}
.bars__bar {
  flex: none;
  width: calc(var(--share) * 0.7);
  min-width: 2px;
  height: 6px;
  border-radius: 0 4px 4px 0;
  background: var(--chart);
}
/* Ausgaben: Formular */
.field__add { justify-self: start; font-size: 0.8125rem; color: var(--claim); }

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claim);
}

/* Fest eingetragener Wert, z. B. das angemeldete Konto als Zahlende*r */
.field__fixed {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--fg);
}

fieldset.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
fieldset.field > legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--claim);
}

.expense-form { max-width: 760px; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 24px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.segmented a {
  padding: 6px 14px;
  border-radius: 99px;
  color: var(--mute);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.segmented a:hover { color: var(--fg); }
.segmented a[aria-current] { background: var(--fg); color: var(--ink); }
.segmented--small { margin: 0 0 16px; font-size: 0.8125rem; }

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--fg);
  font: 400 1rem/1.5 var(--font);
}

.split {
  margin: 0;
  padding: 0;
  border: 0;
}
.split legend { margin-bottom: 6px; font-size: 0.875rem; font-weight: 600; color: var(--claim); }
.split__mode { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.9375rem; color: var(--fg); }
.split__mode input { accent-color: var(--violet); width: 18px; height: 18px; }
.split__one,
.split__many { margin: 4px 0 8px 26px; }
.split__many { display: grid; gap: 8px; }
.split__share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--fg);
}
.split__sum { margin: 2px 0; font-size: 0.875rem; color: var(--mute); }
.split .btn { justify-self: start; }

.receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.receipt__remove { margin-left: auto; font-size: 0.875rem; color: var(--mute); }
.field input[type="file"] { padding: 10px 0; border: 0; background: none; color: var(--claim); }

.form__actions { display: flex; align-items: center; gap: 20px; }
.form__cancel { color: var(--claim); font-size: 0.9375rem; }
.form__delete { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form--inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--ink-raised);
  padding-block: 28px;
  font-size: 0.875rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--claim);
}

.footer a { color: var(--claim); text-decoration: none; }
.footer a:hover,
.footer a[aria-current="page"] { color: var(--fg); }

/* Rechtliche Seiten: bewusst kleine, ruhige Schrift */
.legal {
  padding-block: clamp(40px, 7vh, 80px) clamp(56px, 10vh, 112px);
  font-size: 0.875rem;
  line-height: 1.6;
}

.legal > * { max-width: 68ch; }

.legal h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 28px;
}

.legal h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 32px 0 6px;
}

.legal p,
.legal li { color: var(--mute); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 1.25em; }

.legal .legal__intro { font-size: 0.9375rem; color: var(--claim); }
.legal .legal__date { margin-top: 32px; font-size: 0.8125rem; }

/* Tablet */
@media (max-width: 960px) {
  /* Schmalerer Text, damit er dem „q“ nicht zu nahe kommt */
  .hero__lead { max-width: 26ch; }

  .about__text { grid-column: 3 / -1; }

  .intern__columns { grid-template-columns: 1fr; }

  .dash,
  .circuit { grid-template-columns: 1fr; }

  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "try      discuss"
      "build    share"
      "automate play";
  }
}

/* Mobil */
@media (max-width: 720px) {
  :root { --nav-h: 60px; }

  /* Auf dem Handy bleiben nur Kontakt bzw. im internen Bereich „Zur Website“ und Abmelden sichtbar */
  .nav__links li:not(.nav__keep) { display: none; }
  .nav__links { gap: 16px; }
  .nav__links a,
  .nav__links button { font-size: 0.875rem; }
  .lang { margin-left: auto; }
  .nav__brand img { width: 92px; }
  .nav__inner { gap: 10px; }
  .nav__login { margin-left: -4px; }

  .hero {
    align-items: end;
    min-height: auto;
    padding-top: 0;
  }

  /* Das „q“ steht über dem Text, rechtsbündig */
  .hero__mark {
    position: relative;
    top: auto;
    bottom: auto;
    right: auto;
    width: min(52vw, 240px);
    margin: 32px 0 32px auto;
  }

  .about__statement,
  .about__text { grid-column: 1 / -1; }

  /* Ausgaben auf dem Handy: jede Zeile als Karte */
  .form__row { grid-template-columns: 1fr; }
  .entries thead { display: none; }
  .entries,
  .entries tbody { display: block; }
  .entries tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .entries td { padding: 0; border: 0; }
  .entry__date { grid-column: 1; font-size: 0.8125rem; }
  .entry__amount { grid-column: 2; grid-row: 1; font-weight: 600; }
  .entry__what { grid-column: 1 / -1; }
  .entry__who { grid-column: 1 / -1; font-size: 0.875rem; color: var(--claim); }
  .entry__mobile-label { display: inline; margin-right: 6px; color: var(--mute); }
  .entry__links { grid-column: 1 / -1; text-align: left; }
  .filters__export { margin-left: 0; }
  .colchart { padding-left: 52px; }
  .colchart__label { font-size: 0.5625rem; transform: rotate(-45deg); transform-origin: top right; bottom: -18px; right: 50%; }
  .latest__item { grid-template-columns: minmax(0, 1fr) auto; }
  .latest__date { grid-column: 1 / -1; }
  .legend-list div { grid-template-columns: 1fr; gap: 0; }
  .bars__bar { width: calc(var(--share) * 0.5); }
  /* Salden auf dem Handy: Name und Saldo oben, Einzelwerte klein darunter */
  .balance thead { display: none; }
  .balance,
  .balance tbody { display: block; }
  .balance tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .balance tbody tr:last-child { border-bottom: 0; }
  .balance th,
  .balance td { padding: 0; border: 0; text-align: left; font-size: 0.8125rem; }
  .balance th[scope="row"] { font-size: 0.9375rem; }
  .balance .balance__saldo { grid-column: 2; grid-row: 1; font-size: 0.9375rem; font-weight: 600; text-align: right; }
  .balance td[data-label] { color: var(--mute); }
  .balance td[data-label]::before { content: attr(data-label) " "; }
  .split__share { grid-template-columns: minmax(0, 1fr) 110px; }

  .bento {
    grid-template-columns: 1fr;
    grid-template-areas: "try" "discuss" "build" "share" "automate" "play";
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero__mark,
  .hero__inner,
  .hero__inner > *,
  .hero__title .word,
  .q-mark,
  .hero__glow { animation: none; transition: none; }

  .dialog { transition: none; }
}

/* Passkeys */
.passkey-login { margin-top: 20px; }
.passkey-login__or { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--mute); font-size: 0.8125rem; }
.passkey-login__or::before,
.passkey-login__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-login__button { width: 100%; }
.passkey-login .notice { margin-top: 12px; }
.passkeys { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.passkeys__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.passkeys__item div { display: grid; gap: 2px; }
.passkeys__item .muted { font-size: 0.8125rem; }
.passkey-add { margin-top: 8px; }

/* Ausgleich anfordern */
.tile-stat__action { display: inline-block; margin: 2px 0 8px; font-size: 0.8125rem; color: var(--claim); }
.tile-stat__action:hover { color: var(--fg); }
.statement td .muted { display: block; font-size: 0.8125rem; }
.statement .num { text-align: right; white-space: nowrap; }
.statement__start td { color: var(--claim); }
.statement tfoot th, .statement tfoot td { padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.statement tfoot td.num { text-align: right; }

/* Verteilerschrank als oberste Ebene im Plan */
.cabinet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 20px 0 10px; font-size: 1rem; }
.cabinet-head:first-of-type { margin-top: 4px; }
.cabinet-head .muted { font-size: 0.8125rem; font-weight: 400; }
.cabinet-head--graphic { margin: 28px 0 0; font-size: 1.125rem; }
.chip--cabinet { background: rgb(250 99 3 / 0.18); color: #FF8A3D; }
.print-sheet__cabinet { margin: 28px 0 4px; font-size: 1.0625rem; }

/* KNX-Verkabelung: Stränge vom Verteilerschrank */
.chip--box { border-style: dashed; color: var(--fg); }
.chip--power { background: rgb(242 92 92 / 0.2); border-color: transparent; color: #FF8080; }
.chip--main { background: rgb(250 99 3 / 0.18); border-color: transparent; color: #FF8A3D; }
.strands { list-style: none; margin: 0 0 8px; padding: 0 0 0 18px; border-left: 1px solid var(--line); display: grid; gap: 10px; }
.strand { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding-left: 12px; font-size: 0.9375rem; line-height: 1.5; }
.strand::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; border-top: 1px solid var(--line); }
.strand__link { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: 0.75rem; }
.strand__link::after { content: "→"; font-size: 0.9375rem; }
.strand__point { white-space: nowrap; }
.strand__point .muted { font-size: 0.8125rem; }
.strand__add { margin-left: 4px; font-size: 0.8125rem; color: var(--claim); }
.strand__sum { margin-left: auto; font-size: 0.8125rem; }
.knx-link { margin: 0; padding: 12px 16px 4px; border: 1px solid var(--line); border-radius: 10px; }
.knx-link legend { padding: 0 6px; font-weight: 600; }

/* KNX-Verkabelung: Sternkarte je Stromversorgung */
.knx-map { overflow-x: auto; margin-top: 12px; }
.knx-map svg { display: block; width: 100%; min-width: 560px; height: auto; margin: 0 auto; font-family: inherit; }
.knx-map__link { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.knx-map__link:hover { stroke-width: 5; }
.knx-map__label { fill: var(--fg); font-size: 12px; text-anchor: middle; paint-order: stroke; stroke: var(--ink-raised); stroke-width: 4px; stroke-linejoin: round; }
.knx-map__label--strong { font-weight: 600; font-size: 13px; }
.knx-map__sub { fill: var(--mute); font-size: 10.5px; text-anchor: middle; paint-order: stroke; stroke: var(--ink-raised); stroke-width: 4px; stroke-linejoin: round; }
.knx-map__center { fill: var(--ink); font-size: 11px; font-weight: 700; text-anchor: middle; }
a.knx-map__point:hover .knx-map__label { text-decoration: underline; }
.knx-map__legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; font-size: 0.8125rem; color: var(--claim); }
.knx-map__legend li { display: inline-flex; align-items: center; gap: 6px; }
.chip--empty { border-style: dotted; color: var(--mute); }
.knx-tree { margin-bottom: 8px; }
.knx-tree__cable { color: var(--mute); font-size: 0.75rem; }
.knx-tree__cable::after { content: " →"; }
.knx-points .knx-points__name { padding-left: 28px; }
/* Typen deutlich getrennt: Abstand davor (Rand in Panelfarbe), Kopfzeile als Band mit Akzentlinie */
.knx-points .terminals__block th {
  padding: 9px 12px;
  border-top: 26px solid var(--ink-raised);
  border-bottom: 1px solid var(--claim);
  background: linear-gradient(rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.06)) padding-box;
  font-size: 0.9375rem;
}
.knx-points tbody:first-of-type .terminals__block th { border-top-width: 10px; }
.knx-points tbody tr:last-child td { border-bottom: 0; }
