/* gradetools
   Idee: eine kräftige, fröhliche Lern-App. Ein Band in sattem Kobaltblau hinter Kopf und Überschrift, das Tool
   liegt als großes weißes Blatt halb darüber. Das Ergebnis steht weiß auf einem blauen Feld, die Zahl sehr groß.
   Sonnenblumengelb ist die Zweitfarbe: Hervorhebung (Antwort, Note, "Any score"), Fokus und Auswahl.
   Zustände: durchgestrichen und gedimmt = nicht mehr möglich, gelbes Abzeichen mit Haken = jede Punktzahl reicht,
   gelbe Pille = die hervorgehobene Antwort. Das Beispiel ist gestrichelt und nur umrandet statt gefüllt.
   Die Rotstift-SVGs, die core.js einsetzt, sind hier ausgeblendet (.pen); .draw löst stattdessen ein kurzes
   Aufspringen der Pille oder des Abzeichens aus.
   Schriften: Figtree (geometrisch, freundlich) schwer für Überschriften und Zahlen, DM Sans für Text. Beide
   SIL OFL, selbst gehostet. Kleine Icons (Haken, Pfeile, Chevrons): Heroicons, MIT, als data-URI.
   Farben und Abstände aus der Tailwind-Standardpalette. */

@font-face { font-family: 'Figtree'; font-weight: 300 900; font-style: normal; font-display: swap; src: url(/fonts/figtree.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 100 1000; font-style: normal; font-display: swap; src: url(/fonts/dm-sans.woff2) format('woff2'); }

:root {
  /* Marke: Kobalt (Tailwind blue-700) und Sonnenblume (yellow-300) */
  --brand: #1447e6;
  --brand-hover: #193cb8;
  --brand-deep: #193cb8;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bedbff;
  --brand-300: #8ec5ff;
  --night: #162456;
  --yellow: #ffdf20;
  --yellow-soft: #fef9c2;

  /* Neutrale Töne: zinc */
  --ink: #09090b;
  --text: #27272a;
  --muted: #52525c;
  --subtle: #71717b;
  --placeholder: #696973;
  --line: rgb(9 9 11 / .09);
  --line-strong: rgb(9 9 11 / .16);

  /* Flächen */
  --page: #f4f7fd;
  --field: #edf1fa;
  --field-hover: #e4eaf7;
  --well: #f4f7fd;

  --red: #c10007;
  --red-soft: #fef2f2;
  --red-on-blue: #ffc9c9;
  --ok: #016630;
  --ok-soft: #dcfce7;

  --display: 'Figtree', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --max: 72rem;
  --gutter: 1rem;
  --overlap: 2rem;

  --shadow-sheet: 0 1px 2px rgb(16 32 96 / .06), 0 12px 24px -10px rgb(16 32 96 / .12), 0 40px 80px -28px rgb(16 32 96 / .28);
  --shadow-card: 0 0 0 1px rgb(16 32 96 / .05), 0 1px 2px rgb(16 32 96 / .05), 0 6px 16px -8px rgb(16 32 96 / .14);
  --shadow-card-hover: 0 0 0 1px rgb(16 32 96 / .06), 0 2px 4px rgb(16 32 96 / .06), 0 16px 32px -12px rgb(16 32 96 / .26);

  /* Fokus: auf hellem Grund gelber Hof mit blauer Linie, auf Blau eine gelbe Linie */
  --ring: var(--brand);
  --ring-w: 2px;
  --halo: var(--yellow);

  color-scheme: light;
}
@media (min-width: 640px) { :root { --gutter: 1.5rem; } }
@media (min-width: 1024px) { :root { --gutter: 2rem; --overlap: 4.5rem; } }

/* Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--page); color: var(--text);
  font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
a { color: var(--brand); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: var(--ring-w) solid var(--ring); outline-offset: 4px; box-shadow: 0 0 0 4px var(--halo); }
header.site, .head, .paper, footer.site { --ring: var(--yellow); --ring-w: 3px; --halo: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 20; display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.25rem;
  background: var(--yellow); color: var(--ink); border-radius: 999px; font: 700 1rem var(--display); text-decoration: none;
}
.skip:focus { top: .75rem; }
.num, .tab { font-variant-numeric: tabular-nums; }

/* Das blaue Band: Kopf und Seitenüberschrift */
header.site {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem max(var(--gutter), (100% - var(--max)) / 2);
  background: var(--brand); color: #fff;
}
@media (min-width: 1024px) { header.site { padding-top: 1.25rem; padding-bottom: 1.25rem; } }
.brand {
  display: inline-flex; align-items: center; gap: .625rem; min-height: 3rem; border-radius: 999px;
  color: #fff; text-decoration: none; font: 800 1.375rem/1 var(--display); letter-spacing: -.03em;
}
.logo { width: 2.25rem; height: 2.25rem; flex: none; }
.logo path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo .ink { stroke: #fff; stroke-width: 7; }
.logo .plus { stroke: var(--yellow); stroke-width: 6.5; }

.menu { position: relative; }
.menu summary {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1rem 0 1.25rem;
  border-radius: 999px; background: rgb(255 255 255 / .14); color: #fff;
  font: 700 1rem/1 var(--display); white-space: nowrap; cursor: pointer; user-select: none; list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after {
  content: ''; width: 1.25rem; height: 1.25rem; background: currentColor; transition: transform .2s;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}
.menu summary:hover { background: rgb(255 255 255 / .22); }
.menu[open] summary { background: #fff; color: var(--brand); }
.menu[open] summary::after { transform: rotate(180deg); }
.menu nav {
  --ring: var(--brand); --ring-w: 2px; --halo: var(--yellow);
  position: absolute; right: 0; top: calc(100% + .625rem); z-index: 5;
  width: min(21rem, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 6rem); overflow-y: auto;
  padding: .5rem; background: #fff; color: var(--text); border-radius: 1.5rem;
  box-shadow: 0 0 0 1px rgb(16 32 96 / .06), 0 24px 48px -12px rgb(16 32 96 / .35);
}
.menu-group { padding: .75rem .75rem .375rem; color: var(--subtle); font: 600 .875rem/1.2 var(--sans); }
.menu ul { list-style: none; display: grid; gap: .125rem; }
.menu ul + .menu-group { margin-top: .375rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.menu a {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3rem; padding: .5rem .875rem;
  border-radius: 1rem; color: var(--ink); text-decoration: none; font: 600 1rem/1.25 var(--sans);
}
.menu a:hover { background: var(--brand-50); color: var(--brand); }
.menu a[aria-current] { background: var(--brand-50); color: var(--brand); }
.menu a[aria-current]::after { content: ''; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); }

/* Seite: volle Breite für das Band, sonst eine Spalte mit max. 72rem */
main {
  display: grid; grid-template-columns: minmax(var(--gutter), 1fr) minmax(0, var(--max)) minmax(var(--gutter), 1fr);
  align-content: start; padding-bottom: 5rem;
}
main > * { grid-column: 2; min-width: 0; }
.head {
  grid-column: 1 / -1; position: relative; overflow: clip;
  display: grid; gap: .875rem; align-content: start;
  padding: 1rem max(var(--gutter), (100% - var(--max)) / 2) 3rem;
  background: var(--brand); color: #fff;
}
.head:has(+ .tool, + .home-groups) { padding-bottom: calc(2rem + var(--overlap)); }
@media (min-width: 1024px) {
  .head { padding-top: 2.5rem; padding-bottom: 4.5rem; gap: 1.25rem; }
  .head:has(+ .tool, + .home-groups) { padding-bottom: calc(3.5rem + var(--overlap)); }
}
/* Spielerische Formen im Band, nur auf breiten Schirmen über einem Tool: gelber Kreis und ein Plus wie im Logo */
@media (min-width: 1200px) {
  .head:has(+ .tool, + .home-groups)::before, .head:has(+ .tool, + .home-groups)::after { content: ''; position: absolute; pointer-events: none; }
  .head:has(+ .tool, + .home-groups)::before {
    right: calc(max(var(--gutter), (100% - var(--max)) / 2) + 1rem); top: 2rem; width: 8.5rem; height: 8.5rem; border-radius: 50%; background: var(--yellow);
  }
  .head:has(+ .tool, + .home-groups)::after {
    right: calc(max(var(--gutter), (100% - var(--max)) / 2) + 10.75rem); top: 6.25rem; width: 3.75rem; height: 3.75rem; background: #fff; rotate: -12deg;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M3 12h18' stroke='black' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
h1 {
  max-width: 20ch; color: #fff; font: 800 clamp(2.375rem, 1.5rem + 2.9vw, 3.75rem)/1.04 var(--display);
  letter-spacing: -.035em; text-wrap: balance;
}
.lede { max-width: 44ch; color: var(--brand-100); font-size: 1.125rem; line-height: 1.55; text-wrap: pretty; }
@media (min-width: 640px) { .lede { font-size: 1.3125rem; } }

/* Das Blatt: Eingaben und blaues Ergebnisfeld, liegt über dem Band */
.tool {
  --r: 1.5rem; --inset: .5rem; --pad: 1.25rem;
  position: relative; z-index: 1; display: grid; align-items: start;
  margin-top: calc(var(--overlap) * -1); padding: var(--inset);
  background: #fff; border-radius: var(--r); box-shadow: var(--shadow-sheet);
}
@media (min-width: 640px) { .tool { --r: 2rem; --inset: .625rem; --pad: 2rem; } }
@media (min-width: 960px) {
  .tool { --inset: .75rem; --pad: 2.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
  /* Zeilen-Editoren brauchen mehr Platz links, das Ergebnis dort ist kürzer */
  .tool:has(.grid-rows) { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .tool > .paper { position: sticky; top: 1rem; }
}
.inputs {
  container: inputs / inline-size;
  display: grid; gap: 1.5rem; align-content: start; min-width: 0; padding: calc(var(--pad) - var(--inset)) calc(var(--pad) - var(--inset)) var(--pad);
}
@media (min-width: 960px) { .tool > .inputs { padding-bottom: calc(var(--pad) - var(--inset)); } }
.field { display: grid; gap: .5rem; align-content: start; }
.field > label, .label { color: var(--ink); font: 600 1rem/1.3 var(--sans); }
.hint { color: var(--muted); font-size: 1rem; font-weight: 400; line-height: 1.5; }
@media (min-width: 640px) { .hint { font-size: .9375rem; } }
.field > label .hint { font-weight: 400; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); align-items: end; gap: 1.25rem 1rem; }
/* Zwei Spalten mit drei Feldern: das dritte bekommt die ganze Breite statt einer halben Zeile */
@container inputs (max-width: 29rem) { .pair > :nth-child(3):last-child { grid-column: 1 / -1; } }

.unit { position: relative; display: block; }
.unit > span { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font: 600 1rem/1 var(--display); pointer-events: none; }
.unit > input { padding-right: 2.5rem; }
input[type=text], input[type=number], select {
  width: 100%; height: 3.5rem; padding: 0 1rem; margin: 0;
  background: var(--field); color: var(--ink);
  border: 2px solid transparent; border-radius: 1rem;
  font: 700 1.25rem/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  appearance: none; -webkit-appearance: none; -moz-appearance: textfield;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder { color: var(--placeholder); font-weight: 500; opacity: 1; }
input:hover, select:hover { background-color: var(--field-hover); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--brand); background-color: #fff; box-shadow: 0 0 0 4px var(--yellow); }
input[aria-invalid=true] { border-color: var(--red); background-color: var(--red-soft); }
select {
  padding-right: 2.75rem; font-size: 1.125rem; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2352525c' fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .875rem center; background-size: 1.25rem;
}
select:has(option[value=""]:checked) { color: var(--placeholder); font-weight: 500; }

/* Umschalter als Pille */
.seg {
  display: inline-flex; flex-wrap: wrap; justify-self: start; width: fit-content; max-width: 100%;
  gap: .25rem; margin: 0; padding: .25rem; border: 0; border-radius: 1.75rem; background: var(--field);
}
.seg label {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.25rem;
  border-radius: 999px; color: var(--muted); font: 700 1rem/1.1 var(--display); text-align: center; cursor: pointer; user-select: none;
}
.seg label:hover { color: var(--ink); background: rgb(255 255 255 / .7); }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgb(20 71 230 / .3), 0 6px 14px -6px rgb(20 71 230 / .6); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; box-shadow: 0 0 0 3px var(--yellow); }
.seg-small { border-radius: 1.5rem; }
.seg-small label { min-height: 2.5rem; padding: 0 1rem; font-size: .9375rem; }
@media (pointer: coarse) { .seg-small label { min-height: 3rem; } }
@media (max-width: 479px) {
  .seg:not(.seg-small) { display: flex; width: 100%; }
  .seg:not(.seg-small) label { flex: 1 1 auto; padding: 0 .875rem; font-size: .9375rem; }
}

/* Kontrollkästchen */
.check { display: inline-flex; align-items: center; gap: .75rem; min-height: 3rem; color: var(--ink); font: 600 1rem/1.3 var(--sans); cursor: pointer; }
.check input {
  flex: none; width: 1.5rem; height: 1.5rem; margin: 0; border-radius: .5rem; cursor: pointer;
  appearance: none; -webkit-appearance: none; background: #fff; box-shadow: inset 0 0 0 2px var(--subtle);
}
.check input:hover { box-shadow: inset 0 0 0 2px var(--muted); }
.check input:checked {
  box-shadow: none; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' fill-rule='evenodd' d='M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / 1.125rem no-repeat;
}
.check input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; box-shadow: 0 0 0 3px var(--yellow); }
.check input:checked:focus-visible { box-shadow: 0 0 0 3px var(--yellow); }
.check.tall { min-height: 3.5rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }

/* Knöpfe */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: 0 1.5rem;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff;
  font: 700 1rem/1 var(--display); text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(20 71 230 / .3), 0 8px 18px -8px rgb(20 71 230 / .7);
}
.button:hover { background: var(--brand-hover); }
.button:active { translate: 0 1px; }
.button-quiet { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.button-quiet:hover { background: var(--brand-100); }
.button-quiet[data-add] { padding-left: 1rem; }
.button-quiet[data-add]::before {
  content: ''; width: 1.25rem; height: 1.25rem; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' d='M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.link-button {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--brand);
  font: 600 1rem/1.2 var(--sans); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; border-radius: .5rem;
}
.link-button:hover { text-decoration-thickness: 2px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.status { color: var(--muted); font-size: .9375rem; }

/* Notenskala und aufklappbare Zusatzfelder: helle Mulden im Blatt */
.scale, .box { background: var(--well); border-radius: 1.25rem; }
.scale { padding: 0 1rem; }
.scale summary, details.box > summary {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .625rem;
  min-height: 3.5rem; padding: 1rem 2.75rem 1rem 0; cursor: pointer; list-style: none; border-radius: .75rem;
}
.scale summary::-webkit-details-marker, details.box > summary::-webkit-details-marker { display: none; }
.scale summary::after, details.box > summary::after {
  content: ''; position: absolute; right: 0; top: 50%; width: 2rem; height: 2rem; margin-top: -1rem; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%231447e6' fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
  box-shadow: 0 1px 2px rgb(16 32 96 / .1); transition: transform .2s;
}
.scale[open] summary::after, details.box[open] > summary::after { transform: rotate(180deg); }
.scale summary:hover .scale-label, details.box > summary:hover .label { color: var(--brand); }
.scale-label { color: var(--ink); font: 700 1.0625rem/1.3 var(--display); }
.scale-sum { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.scale-body { display: grid; gap: 1rem; justify-items: start; padding-bottom: 1.25rem; }
.scale-body .seg { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .625rem .75rem; width: 100%; }
.scale-grid label { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: .25rem; color: var(--ink); font: 800 1.125rem/1 var(--display); }
.scale-grid .unit > input { height: 2.75rem; padding-left: .625rem; padding-right: 1.75rem; font-size: 1.0625rem; border-radius: .75rem; }
.scale-grid .unit > span { right: .625rem; font-size: .875rem; }
:is(.scale, .box) :is(input[type=text], select) { background-color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
:is(.scale, .box) :is(input[type=text], select):hover { box-shadow: inset 0 0 0 1px var(--subtle); }
:is(.scale, .box) :is(input[type=text], select):focus-visible { box-shadow: 0 0 0 4px var(--yellow); }
:is(.scale, .box) input[aria-invalid=true] { background-color: var(--red-soft); }

.box { display: grid; gap: 1rem; padding: 1.25rem; }
.box > .label { font-family: var(--display); font-weight: 700; font-size: 1.0625rem; }
details.box { display: block; padding: 0 1rem; }
details.box > summary .label { font-family: var(--display); font-weight: 700; font-size: 1.0625rem; }
details.box[open] { padding-bottom: 1.25rem; }
details.box[open] > summary { margin-bottom: .25rem; }
details.box > .hint { margin-top: 1rem; }

/* Zeilen-Editor (Notenrechner, GPA) */
.grid-rows { display: grid; gap: .625rem; }
.grid-row { display: grid; grid-template-columns: var(--cols); gap: .5rem; align-items: center; }
.grid-row.labels { color: var(--muted); font: 600 .875rem/1.2 var(--sans); }
.grid-row input, .grid-row select { height: 3.25rem; padding: 0 .75rem; font-size: 1.125rem; border-radius: .875rem; }
.grid-row select { padding-right: 2.25rem; font-size: 1.0625rem; background-position: right .625rem center; }
.grid-row input.name { font-weight: 600; font-size: 1.0625rem; letter-spacing: 0; }
.grid-row .unit > input { padding-right: 1.75rem; }
.grid-row .unit > span { right: .625rem; font-size: .875rem; }
.remove {
  position: relative; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; justify-self: center;
  border: 0; border-radius: 50%; background: none; color: var(--subtle);
}
.remove:hover { background: var(--red-soft); color: var(--red); }
.remove svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (pointer: coarse) { .remove::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3rem; height: 3rem; translate: -50% -50%; } }
.cols-grade { --cols: minmax(0, 1fr) 6.25rem 5rem 2.5rem; }
.cols-gpa { --cols: minmax(0, 1fr) 6.5rem 5rem 2.5rem; }
.cols-hs { --cols: minmax(0, 1fr) 6.5rem 7.25rem 4.75rem 2.5rem; }
/* Schmale Eingabespalte (Handy): engere Spalten. Container-Abfrage, damit es auch in schmalen Tool-Spalten greift. */
@container inputs (max-width: 30rem) {
  .cols-grade { --cols: minmax(0, 1fr) 5.5rem 4.25rem 2rem; }
  .cols-gpa { --cols: minmax(0, 1fr) 5.5rem 4.25rem 2rem; }
  .grid-row { gap: .375rem; }
  .grid-row input, .grid-row select { padding: 0 .5rem; font-size: 1.0625rem; border-radius: .75rem; }
  .grid-row select { padding-right: 1.75rem; background-position: right .375rem center; background-size: 1.125rem; }
  .grid-row .unit > input { padding-right: 1.5rem; }
  .grid-row .unit > span { right: .5rem; }
  .remove { width: 2rem; height: 2rem; }
}
/* Sehr schmal (unter ca. 370 px Bildschirmbreite): Name in eine eigene Zeile, auch in der Kopfzeile */
@container inputs (max-width: 18.5rem) {
  :is(.cols-grade, .cols-gpa) .grid-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2rem; grid-template-areas: "name name x" "grade weight weight"; row-gap: .375rem; }
  :is(.cols-grade, .cols-gpa) > .grid-rows { gap: .875rem; }
  :is(.cols-grade, .cols-gpa) .grid-row > :nth-child(1) { grid-area: name; }
  :is(.cols-grade, .cols-gpa) .grid-row > :nth-child(2) { grid-area: grade; }
  :is(.cols-grade, .cols-gpa) .grid-row > :nth-child(3) { grid-area: weight; }
  :is(.cols-grade, .cols-gpa) .grid-row > :nth-child(4) { grid-area: x; }
}
/* High school GPA in schmaler Spalte: jede Klasse als Kärtchen, Name oben, Note, Niveau und Credits darunter */
@container inputs (max-width: 33rem) {
  .cols-hs .grid-row.labels { display: none; }
  .cols-hs > .grid-rows { gap: .75rem; }
  .cols-hs .grid-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 2rem 2rem;
    grid-template-areas: "name name name x" "grade level credits credits"; gap: .375rem;
    padding: .5rem; border-radius: 1.125rem; background: var(--well);
  }
  .cols-hs .grid-row :is(input, select) { background-color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
  .cols-hs .grid-row :is(input, select):focus-visible { box-shadow: 0 0 0 4px var(--yellow); }
  .cols-hs .grid-row :is(input, select)[aria-invalid=true] { background-color: var(--red-soft); }
  .cols-hs .grid-row > :nth-child(1) { grid-area: name; }
  .cols-hs .grid-row > :nth-child(2) { grid-area: grade; }
  .cols-hs .grid-row > :nth-child(3) { grid-area: level; }
  .cols-hs .grid-row > :nth-child(4) { grid-area: credits; }
  .cols-hs .grid-row > :nth-child(5) { grid-area: x; }
}

/* Das Ergebnisfeld: Kobalt, weiße Schrift, sehr große Zahl */
.paper {
  container: paper / inline-size;
  position: relative; min-width: 0; padding: 1.5rem 1.25rem 1.75rem;
  background: var(--brand); color: #fff; border-radius: calc(var(--r, 1.5rem) - var(--inset, 0px));
  font-size: 1rem; line-height: 1.5;
}
@media (min-width: 640px) { .paper { padding: 2rem 2rem 2.25rem; } }
@media (min-width: 960px) { .paper { padding: 2.25rem 2.5rem 2.5rem; } }
.paper-head { color: var(--brand-100); font: 600 1rem/1.4 var(--sans); }
.paper [data-head], .paper [data-rest-head], .paper [data-miss-head] { color: #fff; font: 700 1.125rem/1.35 var(--display); text-wrap: balance; }
.paper > .paper-head, .paper > [data-open] > .paper-head, .paper > [data-rest] > .paper-head { margin-bottom: .75rem; }
.paper-note { margin-top: 1rem; color: var(--brand-100); font-size: 1rem; line-height: 1.6; text-wrap: pretty; }
.paper-note:empty { display: none; }
.paper .gap { height: 1.5rem; }
.paper-actions { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .16); }
.paper .link-button {
  min-height: 3rem; padding: 0 1.25rem; gap: .5rem; border-radius: 999px; background: rgb(255 255 255 / .14); color: #fff;
  font: 700 1rem/1 var(--display); text-decoration: none; transition: background-color .3s, color .3s;
}
.paper .link-button:hover { background: rgb(255 255 255 / .24); }
.paper .link-button.copied { background: var(--ok-soft); color: var(--ok); }
.paper .link-button .copy-label > span:first-child { text-decoration: none; }

/* Tabelle "für Note X brauchst du Y" */
.rows { list-style: none; }
.rows li {
  display: grid; grid-template-columns: 2.5rem 3.5rem minmax(0, 1fr); align-items: center; column-gap: .5rem;
  min-height: 3.75rem; padding-block: .5rem; border-top: 1px solid rgb(255 255 255 / .16);
}
.rows .letter { font: 800 1.5rem/1 var(--display); letter-spacing: -.02em; }
.rows .min { color: var(--brand-200); font: 500 .9375rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.rows .val { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem; min-width: 0; }
.rows .need { font: 800 1.75rem/1.1 var(--display); letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 960px) { .rows .need { font-size: 2rem; } .rows li { min-height: 4.25rem; } }
.rows .sub, .blank-line .sub { color: var(--brand-200); font: 500 .9375rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.rows li.blank .need { color: var(--brand-300); font-weight: 600; }
@container paper (max-width: 17.5rem) {
  .rows li { grid-template-columns: 2rem 2.75rem minmax(0, 1fr); column-gap: .375rem; }
  .rows .need { font-size: 1.5rem; }
  .rows .letter { font-size: 1.375rem; }
}

/* Nicht mehr möglich: gedimmt und durchgestrichen, "not possible" als umrandetes Etikett */
:is(.rows li, .blank-line .val).out .need {
  color: var(--brand-200); font-weight: 700;
  text-decoration: line-through; text-decoration-thickness: .09em; text-decoration-color: rgb(255 255 255 / .9);
}
:is(.rows, .blank-line) .note {
  display: inline-flex; align-items: center; min-height: 1.75rem; padding: 0 .75rem; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .4); color: var(--brand-100);
  font: 600 .875rem/1 var(--sans); white-space: nowrap;
}
/* Jede Punktzahl reicht: gelbes Abzeichen mit Haken */
.rows li.safe .val, .blank-line .val.safe {
  display: inline-flex; flex-wrap: nowrap; align-items: center; justify-self: start; width: fit-content; gap: .375rem;
  padding: .375rem .875rem .375rem .375rem; border-radius: 999px; background: var(--yellow); color: var(--ink);
}
.rows li.safe .val::before, .blank-line .val.safe::before {
  content: ''; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23ffdf20' fill-rule='evenodd' d='M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / 1rem no-repeat;
}
:is(.rows li.safe, .blank-line .val.safe) .need { color: var(--ink); font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; }
/* Die Stift-Zeichnungen des alten Entwurfs werden durch Abzeichen und Pillen ersetzt */
.pen { display: none; }
.circled { position: relative; display: inline-block; }

/* Großes Ergebnis: Note im gelben Kreis und die Zahl */
.verdict { display: flex; align-items: center; gap: 1rem 1.25rem; padding-block: .25rem .5rem; }
@container paper (min-width: 24rem) { .verdict { gap: 1.5rem; } }
.verdict .mark {
  flex: none; display: grid; place-items: center; width: 4.75rem; height: 4.75rem; border-radius: 50%;
  background: var(--yellow); color: var(--ink); font: 900 2.5rem/1 var(--display); letter-spacing: -.04em; text-align: center;
}
.verdict .mark:empty { background: none; box-shadow: inset 0 0 0 3px rgb(255 255 255 / .35); }
@container paper (min-width: 24rem) { .verdict .mark { width: 6rem; height: 6rem; font-size: 3.125rem; } }
.verdict .score { display: grid; gap: .375rem; min-width: 0; }
.verdict .big { font: 900 clamp(2.75rem, 17cqi, 4.75rem)/.95 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict .small { color: var(--brand-100); font-size: 1rem; line-height: 1.4; }
.verdict.blank .mark { background: none; box-shadow: inset 0 0 0 3px rgb(255 255 255 / .35); color: var(--brand-300); }
.verdict.blank .big { color: var(--brand-300); }

/* Lückentext im Ergebnisfeld: eigene Kärtchen in dunklerem Blau */
.blank-line {
  padding: .5rem 1rem; border-radius: 1.25rem; background: var(--brand-deep); font-size: 1.0625rem; line-height: 1.6; text-wrap: pretty;
}
.blank-line + .blank-line { margin-top: .5rem; }
.blank-line input {
  display: inline-block; vertical-align: middle; width: 4.75rem; height: 3rem; margin: .25rem .125rem; padding: 0 .5rem; text-align: center;
  background: #fff; color: var(--ink); border: 0; border-radius: .875rem;
  font: 800 1.25rem/1 var(--display);
}
.blank-line input:hover { background: var(--brand-50); }
.blank-line input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: none; background: #fff; }
.blank-line input[aria-invalid=true] { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); }
.blank-line strong { font: 800 1.375rem/1.2 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.blank-line strong, .blank-line > span { white-space: nowrap; }
.blank-line .val { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; vertical-align: middle; }
.blank-line .need { position: relative; display: inline-block; white-space: nowrap; }
.blank-line .val.safe .need { font-size: 1.0625rem; }
/* Die hervorgehobene Antwort: gelbe Pille */
.need.circled, .blank-line .hand {
  display: inline-block; padding: .25rem .625rem; border-radius: 999px; background: var(--yellow); color: var(--ink);
}
.blank-line .hand { margin-left: .125rem; vertical-align: middle; min-width: 2.25rem; text-align: center; font: 900 1.25rem/1.1 var(--display); }

/* GPA: zwei Zahlen nebeneinander, die wichtigere als gelbe Pille */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-block: .25rem .5rem; }
.duo > div { display: grid; align-content: start; justify-items: start; gap: .625rem; min-width: 0; }
.duo .paper-head { color: var(--brand-100); font: 600 1rem/1.3 var(--sans); }
.gpa { font: 900 clamp(2.5rem, 14cqi, 4rem)/1 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.gpa.circled { padding: .1em .3em .08em; margin-left: -.15em; border-radius: 999px; background: var(--yellow); color: var(--ink); }
.gpa.circled.off { padding-inline: 0; margin-left: 0; background: none; color: inherit; }

/* Beispiel statt echtem Ergebnis: gestrichelt, Zahlen gedimmt, Hervorhebungen nur umrandet */
.paper.example::after {
  content: ''; position: absolute; inset: .5rem; border: 2px dashed rgb(255 255 255 / .3); border-radius: calc(var(--r, 1.5rem) - var(--inset, 0px) - .5rem); pointer-events: none;
}
.paper.example [data-head] {
  width: fit-content; padding: .375rem .875rem; border-radius: 1rem; background: rgb(255 255 255 / .12);
  color: #fff; font: 600 .9375rem/1.4 var(--sans);
}
.paper.example :is(.need, .big, .gpa, .letter) { color: var(--brand-300); }
.paper.example .rows li.safe .val, .paper.example .verdict .mark, .paper.example .gpa.circled:not(.off) {
  background: none; color: var(--yellow); box-shadow: inset 0 0 0 2.5px var(--yellow);
}
.paper.example .rows li.safe .val::before { background-color: transparent; box-shadow: inset 0 0 0 2px var(--yellow); }
.paper.example .rows li.safe .need { color: var(--yellow); }
.paper.example .chart-row .p { color: var(--brand-200); }

/* Kleiner Auftritt statt Rotstift: Abzeichen und Pillen springen kurz an */
@keyframes pop { from { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } to { transform: none; } }
@keyframes strike { from { text-decoration-color: transparent; color: #fff; } }
.rows li.safe.draw .val, .blank-line .val.draw.safe, .blank-line .val.draw .circled, .blank-line .circled.draw, .verdict .mark.draw, .gpa.circled.draw {
  animation: pop .4s cubic-bezier(.3, .8, .4, 1) both;
}
.rows li.out.draw .need, .blank-line .val.out.draw .need { animation: strike .5s ease-out both; }
.rows li.safe.draw .val, .verdict .mark.draw { transform-origin: left center; }
.verdict .mark.draw { transform-origin: center; }

/* Notentabelle (Easy Grader, Druckblatt). Läuft spaltenweise wie die Papier-Schieber. */
.chart { columns: 10rem; column-gap: 1.5rem; margin-top: .25rem; }
.chart .chart-row { break-inside: avoid; }
.chart-row {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) 2rem; column-gap: .5rem; align-items: center; height: 2.375rem; padding-inline: .625rem;
  border-bottom: 1px solid rgb(255 255 255 / .12); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.chart-row .w { color: var(--brand-100); white-space: nowrap; }
.chart-row .p { font-weight: 700; text-align: right; }
.chart-row .g { font: 800 1.0625rem/1 var(--display); text-align: right; }
.chart-row.hit { border-radius: .75rem; border-bottom-color: transparent; background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 1px var(--yellow); }
.chart-row.hit .w { color: var(--ink); }
.chart-row.fail .p, .chart-row.fail .g { color: var(--red-on-blue); }
.chart-row.fail.hit .p, .chart-row.fail.hit .g { color: var(--red); }
.chart-row.chart-head { border-bottom-color: rgb(255 255 255 / .3); }
.chart-row.chart-head > span { color: var(--brand-200); font: 600 .875rem/1.2 var(--sans); }
.paper.no-letters .chart-row .g { visibility: hidden; }
.paper > .paper-head.no-print { margin-top: 1.75rem; }

.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 2rem 1.25rem; }
.sheet h3 { height: 2.5rem; color: #fff; font: 800 1.125rem/2.5rem var(--display); letter-spacing: -.015em; white-space: nowrap; }
.sheet .chart-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 2fr) 2rem; height: 2.125rem; padding-inline: .25rem; font-size: .9375rem; }
.sheet .chart-row .g { font-size: 1rem; }

/* Druckblatt: Eingaben oben, Blatt in voller Breite */
@media (min-width: 960px) {
  .tool-wide { grid-template-columns: minmax(0, 1fr); }
  .tool-wide > .inputs { max-width: 50rem; }
  .tool-wide > .paper { position: relative; top: auto; }
}
.print-title { display: none; }
.noscript { padding: .875rem 1.125rem; border-radius: 1rem; background: var(--yellow); color: var(--ink); font-weight: 600; }

/* Teilen-Leiste */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 3rem; }
.share-line { color: var(--ink); font: 800 1.25rem/1.3 var(--display); letter-spacing: -.015em; }
.share-buttons { display: flex; flex-wrap: wrap; gap: .625rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; height: 3rem; padding: 0 1.25rem 0 1rem;
  border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  font: 700 1rem/1 var(--display); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-card);
}
.chip:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.chip svg { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip svg.filled { fill: currentColor; stroke: none; }
/* Teilen ist eine Nebenaktion: weiches Blau, damit der Hauptknopf der Seite (z. B. "Print chart") der einzige gefüllte bleibt */
.chip-main { background: var(--brand-100); color: var(--brand-hover); box-shadow: none; }
.chip-main:hover { background: var(--brand-200); color: var(--brand-hover); }
/* Netzwerke: runde Knöpfe in der Markenfarbe (Werte aus Simple Icons), E-Mail in Kobalt */
.chip-net {
  --net: var(--brand); width: 3rem; padding: 0; justify-content: center; border-radius: 50%;
  background: var(--net); color: #fff; box-shadow: 0 6px 14px -8px rgb(9 9 11 / .6); transition: transform .15s, background-color .15s;
}
.chip-net:hover { background: color-mix(in srgb, var(--net) 85%, #000); color: #fff; transform: translateY(-2px); }
.chip-net svg { width: 1.25rem; height: 1.25rem; }
.chip-classroom { --net: #0f9d58; }
.chip-facebook { --net: #0866ff; }
.chip-pinterest { --net: #bd081c; }
.chip-whatsapp { --net: #25d366; }
.chip-x { --net: #000; }
.chip-x:hover { background: #333; }
.chip-telegram { --net: #26a5e4; }
.home-groups + .share { margin-top: 3rem; }

/* Kopieren bestätigen (core.js, copyText): Der Knopf wird gut 2 s lang grün, das Link-Symbol dreht sich weg,
   ein Haken zeichnet sich, und die Beschriftung gleitet von "Copy link" zu "Copied". */
.copy-label { display: inline-grid; }
.copy-label > span { grid-area: 1 / 1; transition: opacity .25s, transform .4s cubic-bezier(.2, .8, .2, 1); }
.copy-label > span + span { display: flex; align-items: center; gap: .3rem; opacity: 0; transform: translateY(.6em); }
.copied .copy-label > span:first-child { opacity: 0; transform: translateY(-.6em); }
.copied .copy-label > span + span { opacity: 1; transform: none; }
.copy-icon { display: grid; }
.copy-icon > svg { grid-area: 1 / 1; transition: opacity .25s, transform .4s cubic-bezier(.2, .8, .2, 1); }
.copy-icon > .copy-check { opacity: 0; transform: scale(.5); }
.copied .copy-icon > svg:first-child { opacity: 0; transform: rotate(-90deg) scale(.5); }
.copied .copy-icon > .copy-check { opacity: 1; transform: none; }
svg.copy-check { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; }
.copy-check path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .2s; }
.copied .copy-check path { stroke-dashoffset: 0; transition: stroke-dashoffset .45s .1s cubic-bezier(.5, 0, .2, 1); }
.chip-copy { position: relative; transition: background-color .3s, color .3s, box-shadow .3s, transform .15s; }
.chip-copy:active { transform: scale(.97); }
.chip-copy.copied { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); }
.chip-copy::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.chip-copy.copied::after, .paper .link-button.copied::after { animation: copied-ring .7s ease-out; }
.paper .link-button { position: relative; }
.paper .link-button::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
@keyframes copied-ring {
  from { box-shadow: 0 0 0 0 rgb(34 197 94 / .45); }
  to { box-shadow: 0 0 0 .5rem rgb(34 197 94 / 0); }
}
.link-button[data-share] { transition: color .3s, background-color .3s; }
.link-button.copied { color: var(--ok); }
.link-button .copy-label > span:first-child { text-decoration: underline 1px; text-underline-offset: .2em; }
.link-button:hover .copy-label > span:first-child { text-decoration-thickness: 2px; }
.link-button svg.copy-check { width: 1.15em; height: 1.15em; }

/* Erklärtext unter dem Tool: helle Seite, gut lesbare Spalte */
.prose { justify-self: start; width: 100%; max-width: 42rem; margin-top: 4.5rem; color: var(--text); font-size: 1.0625rem; line-height: 1.75; }
.head + .prose { margin-top: 3.5rem; }
.prose > * + * { margin-top: 1.25rem; }
.prose h2, .faq h2, .related h2 {
  color: var(--ink); font: 800 1.75rem/1.15 var(--display); letter-spacing: -.03em; text-wrap: balance;
}
@media (min-width: 640px) { .prose h2, .faq h2, .related h2 { font-size: 2rem; } }
.prose > h2:not(:first-child) { margin-top: 3.5rem; }
.prose > h2 + * { margin-top: 1rem; }
.prose h3 { color: var(--ink); font: 800 1.25rem/1.3 var(--display); letter-spacing: -.015em; }
.prose > h3:not(:first-child) { margin-top: 2.25rem; }
.prose > h3 + * { margin-top: .625rem; }
.prose p { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.375rem; }
.prose li { padding-left: .375rem; }
.prose li + li { margin-top: .5rem; }
.prose ul > li::marker { color: var(--brand); font-size: 1.1em; }
.prose ol > li::marker { color: var(--brand); font-family: var(--display); font-weight: 800; }
.prose strong { color: var(--ink); font-weight: 700; }
/* Ergebnisse in den Rechenbeispielen: gelber Marker */
.prose li strong, .formula strong {
  text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .42em;
  text-underline-offset: -.24em; text-decoration-skip-ink: none;
}
.prose a { color: var(--brand); font-weight: 500; }
.prose code { padding: .125rem .375rem; border-radius: .375rem; background: var(--brand-50); color: var(--brand-hover); font: 600 .9375em var(--sans); }
.prose .small { color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.formula {
  padding: 1.25rem 1.5rem; border-radius: 1.25rem; background: #fff; box-shadow: var(--shadow-card);
  color: var(--ink); font: 700 1.125rem/1.5 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.005em;
  border-left: 0;
}
.formula span { display: block; margin-top: .375rem; color: var(--muted); font: 400 1rem/1.5 var(--sans); letter-spacing: 0; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 1rem; line-height: 1.4; }
table.data th, table.data td { padding: .75rem 1.25rem .75rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
table.data thead th { color: var(--muted); font: 600 .875rem/1.2 var(--sans); white-space: nowrap; border-bottom: 2px solid var(--line-strong); }
table.data tbody th { color: var(--ink); font: 800 1.0625rem/1.2 var(--display); white-space: nowrap; }
table.data tbody tr:last-child > * { border-bottom: 0; }

/* Häufige Fragen: weiße Kärtchen zum Aufklappen */
.faq { justify-self: start; width: 100%; max-width: 42rem; margin-top: 4.5rem; }
.faq h2 { margin-bottom: 1.5rem; }
.faq details { border-radius: 1.25rem; background: #fff; box-shadow: var(--shadow-card); }
.faq details + details { margin-top: .75rem; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; padding: 1.125rem 1.25rem;
  border-radius: 1.25rem; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { color: var(--ink); font: 700 1.125rem/1.35 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.faq summary:hover h3 { color: var(--brand); }
.faq summary::after {
  content: ''; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; transition: transform .2s, background-color .2s;
  background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%231447e6' d='M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
}
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--yellow); }
.faq .answer { padding: 0 1.25rem 1.375rem; color: var(--text); font-size: 1.0625rem; line-height: 1.7; }
.faq .answer p { text-wrap: pretty; }
.faq .answer p + p { margin-top: .75rem; }
.faq .answer strong { color: var(--ink); }

/* Verwandte Tools: Kacheln */
.related { justify-self: start; width: 100%; max-width: 42rem; margin-top: 4.5rem; }
.related h2 { margin-bottom: 1.5rem; }
.toollist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.toollist li {
  position: relative; display: grid; align-content: start; gap: .25rem; min-height: 6.5rem; padding: 1.125rem 3.75rem 1.25rem 1.25rem;
  border-radius: 1.25rem; background: #fff; box-shadow: var(--shadow-card); transition: transform .2s, box-shadow .2s;
}
.toollist li::after {
  content: ''; position: absolute; right: 1rem; top: 1rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; pointer-events: none;
  background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%231447e6' fill-rule='evenodd' d='M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
}
.toollist a { color: var(--ink); font: 800 1.1875rem/1.25 var(--display); letter-spacing: -.015em; text-decoration: none; }
.toollist a::before { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.toollist span { color: var(--muted); font-size: 1rem; line-height: 1.45; }
.toollist li:has(a:hover) { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.toollist li:has(a:hover) a { color: var(--brand); }
.toollist li:has(a:hover)::after { background-color: var(--yellow); }
.toollist a:focus-visible { outline: none; box-shadow: none; }
.toollist li:has(a:focus-visible) { outline: 2px solid var(--brand); outline-offset: 4px; box-shadow: 0 0 0 4px var(--yellow); }

/* Startseite: große Kacheln in zwei Gruppen auf dem weißen Blatt */
.home-groups {
  position: relative; z-index: 1; display: grid; gap: 2.25rem; margin-top: calc(var(--overlap) * -1); padding: 1.25rem 1rem 1.5rem;
  background: #fff; border-radius: 1.5rem; box-shadow: var(--shadow-sheet);
}
@media (min-width: 640px) { .home-groups { padding: 2rem; border-radius: 2rem; } }
@media (min-width: 960px) { .home-groups { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; padding: 2.5rem; } }
.home-groups h2 { display: flex; align-items: center; gap: .625rem; margin-bottom: 1rem; color: var(--ink); font: 800 1.375rem/1.2 var(--display); letter-spacing: -.02em; }
.home-groups h2::before { content: ''; flex: none; width: .75rem; height: .75rem; border-radius: 50%; background: var(--brand); }
.home-groups section:last-child h2::before { background: var(--yellow); box-shadow: inset 0 0 0 2px rgb(9 9 11 / .12); }
.home-list { list-style: none; display: grid; gap: .75rem; }
@media (min-width: 640px) { .home-groups section:first-child .home-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 959px) { .home-groups section:last-child .home-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-list li { display: grid; }
.home-list a {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: .75rem; min-height: 6.5rem;
  padding: 1.125rem 4rem 1.125rem 1.25rem; border-radius: 1.25rem; background: var(--brand-50); color: var(--ink); text-decoration: none;
}
@media (min-width: 640px) { .home-list a { gap: 1.25rem; min-height: 10rem; padding: 1.5rem 4.25rem 1.375rem 1.5rem; } }
.home-list a::after {
  content: ''; position: absolute; right: 1.25rem; top: 1.25rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%231447e6' fill-rule='evenodd' d='M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
  box-shadow: 0 1px 2px rgb(16 32 96 / .12); transition: transform .2s;
}
.home-list .q { font: 800 1.375rem/1.2 var(--display); letter-spacing: -.025em; text-wrap: balance; }
@media (min-width: 640px) { .home-list .q { font-size: 1.5rem; } }
.home-list .t { color: var(--brand); font: 600 1rem/1.3 var(--sans); }
.home-list a:hover { background: var(--brand); color: #fff; }
.home-list a:hover .t { color: var(--brand-100); }
.home-list a:hover::after { background-color: var(--yellow); transform: translateX(3px); }
.home-groups section:last-child .home-list a { background: var(--yellow-soft); }
.home-groups section:last-child .home-list a:hover { background: var(--yellow); color: var(--ink); }
.home-groups section:last-child .home-list a:hover .t { color: var(--brand-hover); }
.home-groups section:last-child .home-list a:hover::after { background-color: #fff; }

/* Fuß: dunkles Kobalt */
footer.site {
  padding: 3.5rem max(var(--gutter), (100% - var(--max)) / 2) 3rem;
  background: var(--night); color: var(--brand-100); font-size: 1rem;
}
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2rem; }
.foot-head { margin-bottom: .5rem; color: #fff; font: 800 1.0625rem/1.3 var(--display); letter-spacing: -.01em; }
footer.site ul { list-style: none; }
footer.site a { display: inline-flex; align-items: center; min-height: 2.5rem; color: var(--brand-100); text-decoration: none; border-radius: .375rem; }
footer.site a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 1px; }
@media (min-width: 640px) { footer.site a { min-height: 2.125rem; } }
.foot-note { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .14); color: var(--brand-200); font-size: .9375rem; }

/* Weniger Bewegung */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chip-net:hover, .toollist li:has(a:hover), .home-list a:hover::after, .button:active, .chip-copy:active { transform: none; translate: none; }
  .copy-label > span, .copy-icon > svg { transform: none !important; }
}

/* Drucken: nur das Blatt, schwarz auf weiß */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10pt; min-height: 0; }
  header.site, footer.site, .head, .inputs, .prose, .faq, .related, .paper-actions, .no-print, .share { display: none !important; }
  main { display: block; padding: 0; max-width: none; }
  .tool { display: block; margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; }
  .paper { --l: 1.45rem; position: static; padding: 0; border-radius: 0; background: none; color: #000; box-shadow: none; }
  .paper::after { display: none; }
  .paper * { color: #000 !important; }
  .print-title { display: block; margin-bottom: .5rem; font: 800 13pt/1.3 var(--display); }
  .chart-row, .sheet .chart-row { height: var(--l); padding-inline: 0; border-bottom: .5pt solid #c8d3e3; border-radius: 0; font-size: 10pt; }
  .chart-row.hit { background: none; box-shadow: none; border-bottom-color: #c8d3e3; }
  .chart-row.chart-head { border-bottom-color: #8b9bb4; }
  .chart-row.chart-head > span { font: 600 8.5pt/1 var(--sans); }
  .chart-row .g { font-size: 10pt; }
  .sheet { break-inside: avoid; }
  .sheet h3 { height: var(--l); font-size: 10.5pt; line-height: var(--l); }
  .sheets { grid-template-columns: repeat(5, 1fr); gap: 0 5mm; }
  .chart { columns: 4; }
  .chart-row.fail .p, .chart-row.fail .g { color: #000; font-style: italic; }
}
