/* =====================================================================
   Etyma, „Werkbank“
   Achromatisch: Schwarz, Weiß, drei Grau. Farbe erscheint ausschließlich
   dort, wo sie Information trägt, Ampel, frei/belegt. Damit kann keine
   Dekorfarbe mit einer Statusfarbe verwechselt werden.
   Archivo (Bedienung) · Instrument Serif (nur die Namen) · Plex Mono (Zahlen)
   ===================================================================== */

/* ---------- Farb- & Design-Token: Tag ---------- */
:root {
  --paper:        #ffffff;
  --paper-raised: #ffffff;
  --paper-sunken: #f5f5f3;
  --ink:          #14161a;
  --ink-2:        #5c6068;
  --ink-3:        #8b9099;

  --line:         #e6e6e2;
  --line-strong:  #c9c9c3;

  /* „Marke“ ist hier die Tinte selbst: Knöpfe, aktive Zustände, Fokus. */
  --brand:        #14161a;
  --brand-2:      #000000;
  --brand-ink:    #ffffff;
  --brand-tint:   #f0f0ee;
  --brand-tint-2: #e4e4e0;

  /* Auszeichnung (Kurator, Favorit): kein Farbakzent, nur Kontrast. */
  --gold:         #14161a;
  --gold-2:       #3c4046;
  --gold-tint:    #f0f0ee;

  --go:           #1f7a4d;
  --go-tint:      #e6f2ea;
  --warn:         #8a6206;
  --warn-tint:    #f7eeda;
  --stop:         #a8341f;
  --stop-tint:    #f8e6e1;

  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");

  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05);
  --shadow:    0 1px 2px rgba(20, 22, 26, .04);
  --shadow-pop:0 12px 34px -10px rgba(20, 22, 26, .28);

  --radius:    9px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  /* Instrument Serif trägt ausschließlich die Namen, das Produkt selbst.
     Alles Bedienbare läuft in Archivo, Zahlen in Plex Mono. */
  --font-display: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --font-ui:      "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ring: 0 0 0 3px rgba(20, 22, 26, .14);
  --scrim: rgba(20, 22, 26, .40);
}

/* ---------- Farb-Token: Nacht ----------
   Zweimal notiert, damit beide Wege funktionieren:
   1) System steht auf dunkel UND der Nutzer hat nicht ausdrücklich „hell" gewählt
   2) Der Nutzer hat ausdrücklich „dunkel" gewählt
   (CSS kann Deklarationsblöcke nicht teilen, daher die bewusste Dopplung.) */
:root[data-theme="dark"] {
  --paper:        #121316;
  --paper-raised: #17191d;
  --paper-sunken: #0d0e10;
  --ink:          #ececea;
  --ink-2:        #a4a8ae;
  --ink-3:        #767b83;

  --line:         #292b30;
  --line-strong:  #3b3f45;

  --brand:        #ececea;
  --brand-2:      #ffffff;
  --brand-ink:    #121316;
  --brand-tint:   #232629;
  --brand-tint-2: #2c2f33;

  --gold:         #ececea;
  --gold-2:       #c3c6ca;
  --gold-tint:    #232629;

  --go:           #4fbe86;
  --go-tint:      #16261e;
  --warn:         #d9a544;
  --warn-tint:    #2a2313;
  --stop:         #e07059;
  --stop-tint:    #2d1a15;

  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121316' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 1px 2px rgba(0, 0, 0, .4);
  --shadow-pop:0 14px 36px -12px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgba(236, 236, 234, .2);
  --scrim: rgba(0, 0, 0, .62);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #121316;
    --paper-raised: #17191d;
    --paper-sunken: #0d0e10;
    --ink:          #ececea;
    --ink-2:        #a4a8ae;
    --ink-3:        #767b83;

    --line:         #292b30;
    --line-strong:  #3b3f45;

    --brand:        #ececea;
    --brand-2:      #ffffff;
    --brand-ink:    #121316;
    --brand-tint:   #232629;
    --brand-tint-2: #2c2f33;

    --gold:         #ececea;
    --gold-2:       #c3c6ca;
    --gold-tint:    #232629;

    --go:           #4fbe86;
    --go-tint:      #16261e;
    --warn:         #d9a544;
    --warn-tint:    #2a2313;
    --stop:         #e07059;
    --stop-tint:    #2d1a15;

    --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121316' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 1px 2px rgba(0, 0, 0, .4);
    --shadow-pop:0 14px 36px -12px rgba(0, 0, 0, .75);
    --ring: 0 0 0 3px rgba(236, 236, 234, .2);
    --scrim: rgba(0, 0, 0, .62);
  }
}

/* ---------- Reset / Basis ---------- */
* { box-sizing: border-box; }

/* Inline-SVG-Grundgröße: verhindert riesige Icons in Kontexten ohne
   explizite Maße. Spezifischere Regeln (.btn svg, .icon-btn svg …) gewinnen. */
svg { width: 1em; height: 1em; flex: none; vertical-align: middle; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; transition: max-width .3s ease; }
/* Listen und Prüfkarten brauchen Breite; das Eingabeformular liest sich schmal besser. */
body[data-step="3"] .wrap, body[data-step="4"] .wrap { max-width: 1240px; }

/* Dachzeilen in Kapitälchen sind ersatzlos entfallen; die Klasse bleibt
   wirkungslos definiert, falls sie irgendwo noch im Markup steht. */
.eyebrow { display: none; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

::selection { background: color-mix(in srgb, var(--ink) 15%, transparent); }

/* Nur für Screenreader */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Sprungmarke für Tastaturnutzer, erscheint erst bei Fokus */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 60;
  transform: translateY(-160%);
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 13px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; box-shadow: var(--shadow-pop);
  transition: transform .18s;
}
.skip-link:focus-visible { transform: translateY(0); outline: none; box-shadow: var(--shadow-pop), var(--ring); }

/* Kopfzeilen-Werkzeuge */
.header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: .15s;
}
.ghost-btn:hover { border-color: var(--ink); color: var(--ink); }
.ghost-btn:active { transform: translateY(1px); }
.ghost-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.ghost-btn svg { width: 15px; height: 15px; }
.btn-text-short { display: none; }

/* ---------- Kopf ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
/* Das Lockup ist als Wörterbuch-Eintrag gesetzt, Stichwort, Wortart,
   Bedeutung. Die Marke erklärt sich mit genau dem Mittel, das das Produkt
   anwendet; „Werkstatt für Markennamen" ist dadurch Teil des Zeichens
   statt einer angehängten Dachzeile. */
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { width: 21px; height: 21px; flex: none; align-self: center; color: var(--ink); }
.brand-mark svg { width: 21px; height: 21px; display: block; }
.brand-name { font-family: var(--font-ui); font-size: 18px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.brand-pos { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--ink-3); letter-spacing: 0; }
.brand-gloss { font-size: 13px; color: var(--ink-2); }

/* ---------- Trichter / Stepper ---------- */
.funnel {
  list-style: none; display: flex; align-items: center;
  padding: 0; margin: 32px 0 26px; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
}
.funnel::-webkit-scrollbar { display: none; }
.funnel li {
  display: flex; align-items: center; gap: 10px; flex: none;
  font-family: var(--font-ui); font-size: 13px; letter-spacing: 0;
  color: var(--ink-3); white-space: nowrap; transition: color .2s;
}
.funnel li:not(:last-child) { flex: 1; min-width: 0; }
/* Jeder Schritt ist ein Button: erledigte Schritte lassen sich anspringen. */
.funnel li button {
  display: flex; align-items: center; gap: 10px;
  font: inherit; letter-spacing: inherit; color: inherit;
  background: none; border: 0; padding: 3px 6px 3px 3px;
  border-radius: 999px; cursor: pointer; transition: color .2s;
}
.funnel li button:disabled { cursor: default; }
.funnel li button:not(:disabled):hover { color: var(--ink); }
.funnel li button:not(:disabled):hover span { transform: scale(1.09); }
.funnel li button:focus-visible { outline: none; box-shadow: var(--ring); }
.funnel .fl { font-style: normal; }
.funnel li span {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--paper); color: var(--ink-3);
  border: 1px solid var(--line-strong); transition: .2s;
}
.funnel li:not(:last-child)::after {
  content: ""; height: 1px; flex: 1; min-width: 16px;
  background: var(--line); margin-left: 2px; transition: .3s;
}
.funnel li.active { color: var(--ink); }
.funnel li.active span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.funnel li.done { color: var(--ink-2); }
.funnel li.done span { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.funnel li.done::after { background: var(--line-strong); }

/* ---------- Karten / Abschnitte ---------- */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px 32px;
  margin-bottom: 24px;
}
/* Schritt 1 trägt die Aufmerksamkeit allein durch Weißraum: kein Rahmen. */
#step1.card { border: 0; padding: 44px 0 0; }

.sec-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.sec-index { display: none; }
.sec-head h2 { font-family: var(--font-ui); font-size: 25px; font-weight: 600; margin: 0; line-height: 1.2; letter-spacing: -.028em; }
.sec-head .sec-copy { flex: 1; min-width: 0; }
.sec-lead { color: var(--ink-2); font-size: 14.5px; margin: 6px 0 0; max-width: 62ch; }

/* ---------- Formularfelder ---------- */
textarea, input[type="text"], input[type="search"], select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--paper-raised); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 13px 15px; resize: vertical;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { line-height: 1.6; min-height: 132px; }
textarea::placeholder { color: var(--ink-3); }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: var(--ring); background: var(--paper-raised);
}
select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d867d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}

/* ---------- Bedienelemente ---------- */
.controls-grid { display: grid; grid-template-columns: 1fr; gap: 22px; margin: 24px 0 4px; }
.control-block { min-width: 0; }
.control-head { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; }
.control-label { font-family: var(--font-ui); font-size: 13px; letter-spacing: 0; color: var(--ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip.toggle {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; padding: 8px 14px 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--paper);
  color: var(--ink-2); cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
}
.chip.toggle:hover { border-color: var(--ink); color: var(--ink); }
.chip.toggle:has(input:checked):hover { color: var(--paper); }
.chip.toggle:active { transform: translateY(1px); }
.chip.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip.toggle::before {
  content: ""; width: 17px; height: 17px; flex: none; border-radius: 5px;
  border: 1.6px solid var(--line-strong); background: var(--paper) center / 0 no-repeat;
  transition: background-color .15s, border-color .15s;
}
.chip.toggle:has(input:checked) {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.chip.toggle:has(input:checked)::before {
  background-color: transparent; border-color: var(--paper);
  background-image: var(--check); background-size: 12px; background-position: center;
}
.chip.toggle:has(input:focus-visible) { box-shadow: var(--ring); }

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: 500; font-size: 14px; min-width: 30px; text-align: center;
  color: var(--ink); background: var(--paper-sunken); border-radius: var(--radius-sm); padding: 3px 8px;
}
input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--paper-sunken); border: 1px solid var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--paper);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid var(--paper); cursor: pointer; }

/* Sprachen-Ausklapp */
.lang-details { margin-top: 20px; border-top: 1px solid var(--line); padding: 0; }
.lang-details summary { cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 14px 4px; list-style: none; display: flex; align-items: center; gap: 8px; }
.lang-details summary::-webkit-details-marker { display: none; }
.lang-details summary::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; color: var(--ink-3); transition: transform .2s; }
.lang-details[open] summary::before { transform: rotate(90deg); }
.lang-chips { margin: 4px 0 14px; }
.lang-chips .chip.toggle { font-size: 12.5px; padding: 6px 11px 6px 10px; }
.lang-actions { display: flex; gap: 8px; padding-bottom: 16px; }
.link-btn { font-family: var(--font-ui); background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink-2); cursor: pointer; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; transition: .15s; }
.link-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Buttons ---------- */
.step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.btn {
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 9px; transition: .16s; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--ink); color: var(--paper); margin-left: auto; }
.btn.primary:hover { background: var(--brand-2); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary:disabled { background: var(--line-strong); color: var(--paper-raised); cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn.subtle { background: transparent; color: var(--ink-3); padding-left: 8px; }
.btn.subtle:hover { color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Konzepte ---------- */
.concept-list { display: flex; flex-wrap: wrap; gap: 10px; }
.concept {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 8px 8px 15px; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.concept:hover { border-color: var(--ink); }
.concept .term { font-weight: 600; font-family: var(--font-ui); font-size: 14.5px; letter-spacing: -.01em; }
.concept .icon-btn.remove { width: 21px; height: 21px; }
.add-concept { display: flex; gap: 10px; margin-top: 18px; }
.add-concept input { flex: 1; }

.icon-btn {
  border: none; background: var(--paper-sunken); color: var(--ink-3); cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; padding: 0; transition: .13s; flex: none;
}
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn:hover { background: var(--stop); color: #fff; }
.icon-btn.info { background: transparent; color: var(--ink-3); width: 18px; height: 18px; }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.info:hover { color: var(--ink); background: var(--paper-sunken); }

/* ---------- Tooltip-System (bespoke, viewport-sicher) ---------- */
.tip-trigger { cursor: help; }
.tip-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 18px; height: 18px; border-radius: 50%; border: none; padding: 0; cursor: help;
  background: transparent; color: var(--ink-3); transition: .13s;
}
.tip-btn svg { width: 16px; height: 16px; }
.tip-btn:hover, .tip-btn:focus-visible { color: var(--ink); outline: none; }
.tip-btn:focus-visible { box-shadow: var(--ring); }

/* Alle erklärenden Nebensätze der Anwendung liegen hier: ein ruhiger,
   lesbarer Kasten statt Fließtext neben jedem Bedienelement. */
#tipLayer {
  position: fixed; z-index: 200; max-width: 320px; pointer-events: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); font-size: 13px; line-height: 1.58;
  letter-spacing: -.005em; white-space: pre-line;
  padding: 12px 15px; border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(5px) scale(.985); transform-origin: bottom center;
  transition: opacity .15s, transform .15s;
}
#tipLayer.show { opacity: 1; transform: translateY(0) scale(1); }
#tipLayer::after {
  content: ""; position: absolute; top: 100%; left: var(--caret, 50%); transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--ink);
}
#tipLayer.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
#tipLayer.below { transform-origin: top center; }

/* ---------- Ergebnis-Tabelle ---------- */
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.results-tools { display: flex; gap: 10px; align-items: center; }
.results-tools .search-wrap { position: relative; }
.results-tools .search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.results-tools input[type="search"] { width: 170px; padding-left: 36px; }
.results-tools select { width: auto; }
.results-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }

.table-scroll { overflow-x: auto; margin: 0 -6px; }
table.results { width: 100%; border-collapse: collapse; font-size: 14px; }
table.results th {
  text-align: left; font-family: var(--font-ui); font-size: 12px; letter-spacing: 0;
  color: var(--ink-3); font-weight: 500; padding: 0 12px 10px; border-bottom: 1px solid var(--line-strong);
}
table.results td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.results tbody tr { transition: background .12s; }
table.results tbody tr:hover { background: var(--paper-sunken); }
.col-fav { width: 40px; }
.col-name { width: 260px; }
.col-score { width: 150px; }

.name-cell { display: flex; align-items: baseline; gap: 8px; }
/* Instrument Serif kennt nur einen Schnitt, jedes font-weight über 400
   erzwingt einen künstlichen Fettdruck. Deshalb überall bewusst 400. */
.name-cell .the-name { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: -.01em; line-height: 1.1; }
.name-copy { opacity: 0; transition: opacity .13s; }
tr:hover .name-copy, tr:focus-within .name-copy { opacity: 1; }
.name-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; row-gap: 6px; margin-top: 5px; }
.build-tag { white-space: nowrap; font-family: var(--font-ui); font-size: 11px; letter-spacing: 0; color: var(--ink-3); background: var(--paper-sunken); border-radius: 4px; padding: 2px 7px; }
.warn-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--stop); }
.warn-badge svg { width: 13px; height: 13px; }

/* ---------- Kurator (Creative-Director-Stufe) ---------- */
.curator-badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-family: var(--font-ui); font-size: 11px; font-weight: 500; letter-spacing: 0;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 2px 9px 2px 7px; cursor: help;
}
.curator-badge svg { width: 11px; height: 11px; color: var(--ink-2); }
.curator-badge.strong { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.curator-badge.strong svg { color: var(--paper); }
.curator-note {
  margin-top: 6px; max-width: 260px;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2);
}
/* Die Empfehlung wird durch eine Kante markiert, nicht durch eine Fläche, farbige Flächen sind für die Ampel reserviert. */
tr.is-pick td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.meta-pick { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; }
.meta-pick svg { width: 12px; height: 12px; color: var(--ink-2); }
.chip.toggle.classical { border-style: dashed; }

.origin-lang { font-weight: 600; }
/* Fremdsprachiges Wort kursiv, die typografische Konvention, die auch
   jedes Wörterbuch anwendet. */
.origin-word { color: var(--ink-3); font-style: italic; font-family: var(--font-display); font-size: 15.5px; }
.meaning-cell { color: var(--ink-2); max-width: 320px; }

.fav-star {
  cursor: pointer; font-size: 21px; color: var(--line-strong); line-height: 1;
  background: none; border: none; transition: .13s;
  /* Tap-Fläche 40px, ohne die Zeile auseinanderzuziehen */
  width: 40px; height: 40px; margin: -9px 0 0 -10px;
  display: grid; place-items: center; border-radius: 50%;
}
.fav-star:hover { color: var(--ink); transform: scale(1.1); }
.fav-star:focus-visible { outline: none; box-shadow: var(--ring); }
.fav-star.on { color: var(--ink); }

.score-wrap { display: flex; align-items: center; gap: 10px; }
.score-num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 15px; min-width: 26px; color: var(--ink); }
.score-bar { flex: 1; height: 5px; background: var(--paper-sunken); border-radius: 3px; overflow: hidden; min-width: 44px; }
.score-bar > i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.dims { display: flex; gap: 3px; margin-top: 7px; cursor: help; }
.dims i { height: 4px; flex: 1; border-radius: 2px; background: var(--paper-sunken); }
.dims i.f { background: var(--ink-2); }

.empty-row td { text-align: center; color: var(--ink-3); padding: 30px; font-size: 14px; }

/* ---------- Screening ---------- */
.disclaimer {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.5px; color: var(--ink-2); background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 20px;
}
.disclaimer svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; margin-top: 1px; }
.screen-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); align-items: start; }
.screen-card { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--paper-raised); box-shadow: var(--shadow-sm); }
.screen-card > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; background: color-mix(in srgb, var(--brand) 6%, var(--paper-raised));
  border-bottom: 1px solid var(--line);
}
.screen-card h3 { font-family: var(--font-display); font-size: 30px; font-weight: 400; margin: 0; letter-spacing: -.01em; line-height: 1.1; }
.screen-card > header .hd-left { display: flex; align-items: center; gap: 10px; }
.screen-body { padding: 20px; display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }

.screen-block h4 { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 12px; letter-spacing: 0; color: var(--ink-3); margin: 0 0 10px; font-weight: 500; }
.avail-row { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 4px 0; }
.avail-row .dom { font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.dot.frei { background: var(--go); color: var(--go); }
.dot.belegt { background: var(--stop); color: var(--stop); }
.dot.unklar { background: var(--ink-3); color: var(--ink-3); }
.dot.wohl { background: var(--warn); color: var(--warn); }
.status-txt { color: var(--ink-2); }

.ampel { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-weight: 600; font-size: 13px; padding: 7px 15px; border-radius: 999px; white-space: nowrap; }
.ampel .lamp { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.ampel.gruen { background: var(--go-tint); color: var(--go); }
.ampel.gelb { background: var(--warn-tint); color: var(--warn); }
.ampel.rot { background: var(--stop-tint); color: var(--stop); }

.tm-detail { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; }
.tm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tm-head strong { color: var(--ink); font-size: 13px; font-family: var(--font-ui); font-weight: 600; letter-spacing: 0; display: inline-flex; align-items: center; gap: 6px; }
.tm-dist { font-size: 12px; color: var(--ink-2); }
.tm-dist b { color: var(--ink); }
.tm-summary { margin: 10px 0 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--font-mono); font-size: 10.5px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 9px; color: var(--ink-2); }
.tm-none { margin-top: 12px; color: var(--go); font-size: 13px; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.tm-none svg { width: 16px; height: 16px; }

.tm-marks { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }
.tm-marks th { text-align: left; font-family: var(--font-ui); font-size: 11.5px; letter-spacing: 0; color: var(--ink-3); font-weight: 500; padding: 4px 8px 8px; border-bottom: 1px solid var(--line-strong); }
.tm-marks td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tm-marks a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); font-weight: 600; }
.tm-marks a:hover { text-decoration: underline; }
.tm-simcell { white-space: nowrap; width: 70px; }
.tm-sim { display: inline-block; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--paper-sunken); color: var(--ink-2); }
.tm-sim.warm { background: var(--warn-tint); color: var(--warn); }
.tm-sim.hot { background: var(--stop-tint); color: var(--stop); }
.tm-phon { display: inline-flex; vertical-align: middle; color: var(--ink-2); margin-left: 4px; cursor: help; }
.tm-simcell { display: flex; align-items: center; gap: 2px; }
.tm-namecell { font-weight: 600; color: var(--ink); }
.tm-overlap { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--stop); background: var(--stop-tint); border-radius: 5px; padding: 1px 7px; margin-left: 5px; }
.tm-fieldcell { color: var(--ink-2); max-width: 260px; }
.tm-src { display: inline-block; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin-right: 3px; }
.tm-coverage { margin-top: 14px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }

.links-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.links-row a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 5px 11px; transition: .14s; }
.links-row a:hover { border-color: var(--ink); color: var(--ink); }
.links-row a svg { width: 11px; height: 11px; opacity: .6; }
.links-group-label { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0; color: var(--ink-3); align-self: center; margin: 0 2px 0 6px; }
.links-group-label:first-child { margin-left: 0; }

/* ---------- Ladekarte ----------
   Ein blasser Papierschleier über weißem Grund war kaum zu sehen. Jetzt
   dunkelt der Hintergrund ab und die Karte steht als eigenes Blatt davor. */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: fadein .16s ease;
}
.loader {
  width: min(430px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 24px 26px 20px;
  text-align: left;
}
.loader-head { display: flex; align-items: center; gap: 15px; }
.loader-copy { min-width: 0; flex: 1; }
.loader-text { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.loader-time {
  margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.loader-hint { opacity: .85; }

/* Der Stempel wechselt lateinische Schriftzeichen: dieselbe Serif wie die
   Namen, damit im Ladebild keine fremde Systemschrift auftaucht. */
.loader-stamp {
  position: relative; width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px; background: var(--paper-sunken);
  border: 1px solid var(--line);
}
#loaderGlyph {
  font-family: var(--font-display); font-size: 30px; font-weight: 400;
  color: var(--ink); line-height: 1; animation: glyphpop .22s ease;
}
@keyframes glyphpop { from { opacity: 0; transform: scale(.86) translateY(2px); } to { opacity: 1; transform: none; } }

.loader-bar {
  position: relative; overflow: hidden;
  height: 3px; border-radius: 2px; background: var(--paper-sunken);
  margin: 20px 0 0;
}
.loader-bar > i {
  position: absolute; inset: 0 auto 0 0; display: block;
  width: 38%; background: var(--ink); border-radius: 2px;
  animation: barsweep 1.5s cubic-bezier(.5, 0, .5, 1) infinite;
}
/* Sobald echte Phasen laufen, zeigt der Balken den wirklichen Stand. */
.loader-bar.known > i { animation: none; transition: width .45s cubic-bezier(.3, .8, .3, 1); }
@keyframes barsweep {
  0% { left: -40%; } 100% { left: 100%; }
}

.loader-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.loader-dots { display: inline-flex; gap: 5px; }
.loader-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); animation: dotpulse 1.2s infinite; }
.loader-dots i:nth-child(2) { animation-delay: .18s; }
.loader-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotpulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(0);
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); padding: 13px 20px; border-radius: 11px;
  font-size: 14px; z-index: 120; box-shadow: var(--shadow-pop); max-width: 90%;
  animation: toastin .28s cubic-bezier(.2, .9, .3, 1.2);
}
.toast svg { width: 17px; height: 17px; flex: none; }
@keyframes toastin { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }

.site-footer {
  color: var(--ink-3); font-size: 12px; padding: 22px 24px 34px; margin-top: 30px;
  border-top: 1px solid var(--line);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px;
}
.site-footer .foot-brand { color: var(--ink-2); }
.site-footer .foot-sp { flex: 1; }
.site-footer a {
  color: var(--ink-2); text-decoration: none;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; transition: .14s;
}
.site-footer a:hover { color: var(--ink); border-color: var(--ink); }
.site-footer a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 2px; }

/* ---------- Zeichenzähler in der Ecke des Eingabefeldes ---------- */
.ta-count {
  position: absolute; right: 14px; bottom: 11px; pointer-events: none;
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3);
  background: var(--paper); padding: 1px 4px; border-radius: 4px;
  opacity: 0; transition: opacity .16s;
}
.ta-count.show { opacity: 1; }
.ta-count #descCount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ta-count.ok #descCount { color: var(--ink-2); font-weight: 500; }

/* Kandidat aus wiederhergestellter Sitzung */
.meta-restored { color: var(--ink-3); }

/* Herkunft/Bedeutung unter dem Namen, nur auf schmalen Schirmen */
.name-mobile { display: none; }

/* ---------- Theme-Umschalter ---------- */
/* Ein einziger Knopf, der zwischen System, Hell und Dunkel weiterschaltet.
   Der Zustand steht im Tooltip, nicht in drei dauerhaft sichtbaren Schaltern. */
.theme-toggle {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-3); cursor: pointer; transition: .15s;
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Verfügbarkeits-Abzeichen ---------- */
.avail-badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  border-radius: 999px; padding: 2px 9px 2px 7px; cursor: help;
  border: 1px solid transparent;
}
.avail-badge svg { width: 11px; height: 11px; }
.avail-badge.free  { color: var(--go);   background: var(--go-tint);   border-color: color-mix(in srgb, var(--go) 30%, transparent); }
.avail-badge.part  { color: var(--warn); background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.avail-badge.taken { color: var(--stop); background: var(--stop-tint); border-color: color-mix(in srgb, var(--stop) 28%, transparent); }

.name-more { opacity: 0; transition: opacity .13s; }
tr:hover .name-more, tr:focus-within .name-more { opacity: 1; }
/* Ohne Hover (Touch) gibt es kein Aufdecken, dort dauerhaft zeigen */
@media (hover: none) {
  .name-copy, .name-more { opacity: 1; }
}

/* ---------- Phasenliste in der Ladekarte ---------- */
.phase-list {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px; text-align: left;
}
.phase-list li {
  font-family: var(--font-ui); font-size: 13px; color: var(--ink-3);
  display: flex; align-items: center; gap: 10px; transition: color .2s;
}
.phase-list li::before {
  content: ""; width: 15px; height: 15px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--paper);
  transition: .2s;
}
.phase-list li.active { color: var(--ink); font-weight: 500; }
.phase-list li.active::before {
  border-color: var(--ink);
  background: radial-gradient(circle at center, var(--ink) 0 3.5px, transparent 3.6px);
}
.phase-list li.done { color: var(--ink-2); }
.phase-list li.done::before {
  border-color: var(--ink); background: var(--ink) var(--check) center / 10px no-repeat;
}

/* ---------- Vergleichsansicht ---------- */
.ghost-btn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.compare-panel { margin: 4px 0 22px; }
.cmp-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.cmp-col {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 16px 16px;
}
.cmp-col.is-pick { border-color: var(--ink); }
.cmp-col header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cmp-col h4 { font-family: var(--font-display); font-size: 28px; font-weight: 400; margin: 0; line-height: 1.1; }
.cmp-origin { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.cmp-meaning { font-size: 13px; color: var(--ink-2); margin: 8px 0 12px; }
.cmp-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.cmp-score b { font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.cmp-score span { font-family: var(--font-ui); font-size: 11.5px; letter-spacing: 0; color: var(--ink-3); }
.cmp-dims { margin: 0 0 10px; display: grid; gap: 3px; }
.cmp-dims > div { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.cmp-dims dt { color: var(--ink-3); margin: 0; }
.cmp-dims dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cmp-avail { font-family: var(--font-ui); font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.cmp-note { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); margin: 0 0 10px; }
.cmp-story { width: 100%; justify-content: center; }
.cmp-storybox:not(:empty) { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.st-origin { font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px; }
.st-story { font-size: 13px; margin: 0 0 8px; }
.st-pitch {
  font-family: var(--font-display); font-size: 15px; line-height: 1.4;
  border-left: 2px solid var(--gold); margin: 0 0 8px; padding-left: 10px; color: var(--ink);
}
.st-watch { font-size: 11.5px; color: var(--warn); display: flex; gap: 5px; align-items: flex-start; margin: 0; }
.st-watch svg { width: 12px; height: 12px; flex: none; margin-top: 2px; }

/* ---------- Verlaufs-Blatt ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 55;
  background: color-mix(in srgb, #0b0f11 55%, transparent);
  backdrop-filter: blur(3px);
  display: grid; place-items: start center; padding: 60px 20px 20px;
  animation: fadein .16s ease;
}
.sheet-inner {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  width: min(620px, 100%); max-height: 76vh; overflow: auto; padding: 20px 22px 22px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0; }
.history-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 2px; border-top: 1px solid var(--line);
}
.history-main { flex: 1; min-width: 0; }
.history-names { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.history-desc { display: block; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- Responsiv ---------- */
@media (min-width: 660px) {
  .controls-grid { grid-template-columns: 2fr 1fr; }
}
@media (max-width: 640px) {
  .card { padding: 24px 20px 26px; }
  .sec-head h2 { font-size: 23px; }
  .screen-body { grid-template-columns: 1fr; }
  /* Spalten ausblenden, aber den Inhalt unter den Namen holen statt ihn zu verlieren */
  .col-origin, .col-meaning { display: none; }
  .name-mobile {
    display: block; margin-top: 6px; font-size: 12.5px;
    color: var(--ink-2); line-height: 1.4; max-width: 42ch;
  }
  .name-mobile .origin-lang { color: var(--ink-3); font-weight: 600; }
  .col-name { width: auto; }
  .curator-note { max-width: none; }
  .results-tools { flex-wrap: wrap; }
  .results-tools input[type="search"] { width: 130px; }
  .header-inner { padding: 14px 16px; }
  /* Die Glosse des Lockups tritt auf schmalen Schirmen zurück, Zeichen,
     Stichwort und Wortart tragen die Marke auch allein. */
  .brand-gloss { display: none; }
  /* Nur die Ziffern: die Überschrift der Karte darunter benennt den Schritt ohnehin */
  .funnel { gap: 6px; margin: 24px 0 20px; }
  .funnel li .fl { display: none; }
  .funnel li:not(:last-child)::after { min-width: 6px; }
  .score-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto; }
}

/* =====================================================================
   Ausbaustufe 4, Ergebnis-Bühne, Filter, Aktionsleiste, Abschluss
   ===================================================================== */

/* ---------- Bühne: die Empfehlungen des Kurators ---------- */
/* 60 gleichförmige Zeilen verstecken das Ergebnis. Die stärksten Namen
   bekommen darum eigene Karten über der Liste. */
.pick-stage { margin: 2px 0 26px; }
.pick-stage-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
}
.pick-stage-head h3 {
  font-family: var(--font-ui); font-size: 14px; letter-spacing: -.01em;
  color: var(--ink); font-weight: 600; margin: 0;
}
.pick-stage-head .muted { font-size: 12px; }
.pick-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pick-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 18px 18px 16px;
  background: var(--paper);
  transition: border-color .18s;
}
.pick-card:hover { border-color: var(--ink); }
.pick-card .pick-rank {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  position: absolute; top: 18px; right: 18px; line-height: 1;
}
.pick-card .pick-name {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 38px; font-weight: 400; line-height: 1.05;
  margin: 0 40px 3px 0; word-break: break-word; letter-spacing: -.01em;
}
.pick-card .pick-name .icon-btn { opacity: 0; transition: opacity .13s; }
.pick-card:hover .pick-name .icon-btn, .pick-card:focus-within .pick-name .icon-btn { opacity: 1; }
.pick-origin { font-size: 12px; color: var(--ink-3); margin: 0 0 8px; }
.pick-origin i { font-family: var(--font-display); font-size: 14px; }
/* Die Notiz des Kurators bekommt eine Kante statt einer Farbfläche. */
.pick-note {
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
  margin: 0 0 14px; padding-left: 11px; border-left: 2px solid var(--ink);
}
.pick-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pick-score {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
  background: var(--paper-sunken); border-radius: 999px; padding: 3px 9px;
}
.pick-fav {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: .15s;
}
.pick-fav:hover { border-color: var(--ink); color: var(--ink); }
.pick-fav:focus-visible { outline: none; box-shadow: var(--ring); }
.pick-fav.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Facetten-Filter ---------- */
.facets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.facets .facet-label {
  font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0;
  color: var(--ink-3); margin-right: 2px;
}
.facet {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.facet:hover { border-color: var(--ink); color: var(--ink); }
.facet:focus-visible { outline: none; box-shadow: var(--ring); }
.facet[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.facet .facet-n { font-family: var(--font-mono); font-size: 10.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.facet.gold[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.facet svg { width: 12px; height: 12px; }

/* ---------- Sticky Aktionsleiste (Favoriten) ---------- */
/* Der Weg zum nächsten Schritt darf nicht am Ende von 60 Zeilen liegen. */
.fav-bar {
  position: sticky; bottom: 0; z-index: 30;
  margin: 18px -6px -8px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  animation: favbarin .22s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes favbarin { from { opacity: 0; transform: translateY(10px); } }
.fav-bar-title {
  font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0;
  color: var(--ink-3); flex: none;
}
/* Einzeilig und scrollbar: zehn Favoriten dürfen die Leiste nicht aufblähen. */
.fav-bar-list {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: thin;
}
.fav-bar-list .fav-pill { flex: none; }
.fav-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: 19px; font-weight: 400; line-height: 1.2;
  background: var(--paper-sunken); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 6px 2px 13px;
}
.fav-pill button {
  border: 0; background: none; cursor: pointer; color: var(--ink-3);
  line-height: 1; padding: 4px; border-radius: 50%; display: grid; place-items: center;
}
.fav-pill button:hover { background: var(--line); color: var(--ink); }
.fav-pill button:focus-visible { outline: none; box-shadow: var(--ring); }
.fav-pill svg { width: 11px; height: 11px; }
.fav-bar-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }

/* ---------- Ladeoverlay: Abbrechen ---------- */
.overlay-cancel {
  margin-left: auto; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
  color: var(--ink-3); background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; cursor: pointer; transition: .15s;
}
.overlay-cancel:hover { color: var(--stop); border-color: var(--stop); }
.overlay-cancel:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Fehler mit Ausweg statt flüchtigem Toast ---------- */
/* Ein Lauf kostet knapp eine Minute, ein Fehler darf nicht nach 4 s verschwinden. */
.run-error {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid color-mix(in srgb, var(--stop) 40%, var(--line));
  background: var(--stop-tint); color: var(--ink);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 18px 0 0;
}
.run-error svg { width: 18px; height: 18px; color: var(--stop); flex: none; margin-top: 1px; }
.run-error .re-body { flex: 1; min-width: 0; }
.run-error strong { display: block; font-size: 14px; margin-bottom: 2px; }
.run-error p { margin: 0; font-size: 13px; color: var(--ink-2); word-break: break-word; }
.run-error .re-actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 10px; }

/* ---------- Schritt 4: Überblick, Entscheidung, Export ---------- */
.screen-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); padding: 12px 16px; margin: 0 0 18px;
}
.screen-summary .ss-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-2);
}
.screen-summary .ss-lamp { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ss-lamp.gruen { background: var(--go); }
.ss-lamp.gelb  { background: var(--warn); }
.ss-lamp.rot   { background: var(--stop); }
.ss-lamp.offen { background: var(--line-strong); }
.screen-summary .ss-spacer { flex: 1; }

.decision-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 18px;
}
.decision-banner .db-eyebrow {
  font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0;
  color: var(--ink-3); display: block; margin-bottom: 1px;
}
.decision-banner .db-name { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1.05; }
.decision-banner .db-actions { margin-left: auto; display: flex; gap: 8px; }

.decide-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: .15s;
}
.decide-btn:hover { border-color: var(--ink); color: var(--ink); }
.decide-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.decide-btn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.decide-btn svg { width: 13px; height: 13px; }
.screen-card.is-chosen { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.screen-card > header .hd-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.screen-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Responsiv (Nachtrag) ---------- */
@media (max-width: 900px) {
  .screen-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Der Kopf lief bei 375px über den Rand hinaus, Werkzeuge in eine
     eigene, schmale Zeile legen und kompakter setzen. */
  /* Die Werkzeuge bleiben in der Kopfzeile, solange sie passen, und rutschen
     erst dann in eine eigene Zeile. Eine halbleere zweite Zeile ist keine. */
  .header-inner { flex-wrap: wrap; row-gap: 10px; }
  .header-tools { gap: 8px; }
  .brand-name { font-size: 17px; }
  .ghost-btn { padding: 6px 11px; font-size: 11.5px; white-space: nowrap; }
  /* Schmale Schirme: Verlauf nur als Symbol, „Neu anfangen" gekürzt */
  #btnHistory .btn-text { display: none; }
  #btnReset .btn-text { display: none; }
  #btnReset .btn-text-short { display: inline; }
  .header-tools .ghost-btn { margin-left: auto; }
  .header-tools .ghost-btn + .ghost-btn { margin-left: 0; }

  .pick-card .pick-name { font-size: 32px; }
  .pick-cards { grid-template-columns: 1fr; }
  .fav-bar { margin: 16px -10px -12px; border-radius: var(--radius) var(--radius) 0 0; padding: 10px 12px; }
  .fav-bar-title { display: none; }
  .fav-bar-actions { width: 100%; }
  .fav-bar-actions .btn { flex: 1; justify-content: center; }
  .decision-banner .db-actions { margin-left: 0; width: 100%; }
  .facets { gap: 6px; }
  /* Touch braucht Fläche: die kleinen Pillen wachsen auf Fingergröße. */
  .facet, .pick-fav, .decide-btn { min-height: 40px; font-size: 13px; padding: 8px 14px; }
  .site-footer { flex-direction: column; gap: 10px; align-items: flex-start; }
  .site-footer .foot-sp { display: none; }
}

/* =====================================================================
   Redesign „Werkbank“, Startscreen mit gestufter Offenlegung
   Schritt 1 zeigt Frage, Feld und Knopf. Anzahl, Macharten, Sprachen und
   Gewichtung liegen hinter einer Zeile, die ihren Stand im Klartext trägt, sichtbar, aber nicht im Weg.
   ===================================================================== */
.step-title {
  font-family: var(--font-ui); font-size: 30px; font-weight: 600;
  letter-spacing: -.03em; line-height: 1.15; margin: 0 0 10px;
}
.step-lede {
  font-size: 15.5px; line-height: 1.6; color: var(--ink-2);
  margin: 0 0 26px; max-width: 52ch;
}

/* Einstellungen als Pillen: jede trägt ihren Wert und öffnet ein eigenes
   kleines Feld. Nichts ist versteckt, nichts nimmt Platz weg. */
/* Bezugspunkt ist die Reihe, nicht die einzelne Pille: so klappt jedes
   Feld an derselben Kante auf und kann nirgends aus dem Satzspiegel laufen. */
.pills { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill { position: static; }
.pill > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 15px; transition: .15s;
}
.pill > summary::-webkit-details-marker { display: none; }
.pill > summary b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill > summary:hover { border-color: var(--ink); color: var(--ink); }
.pill > summary:focus-visible { outline: none; box-shadow: var(--ring); }
.pill[open] > summary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill[open] > summary b { color: var(--paper); }

.pop {
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 45;
  width: 342px; max-width: min(92vw, 460px);
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 17px 17px 15px;
  box-shadow: var(--shadow-pop);
  animation: popin .16s cubic-bezier(.2, .9, .3, 1.1);
}
.pop-wide { width: 440px; }
@keyframes popin { from { opacity: 0; transform: translateY(-5px); } }
.pop-t { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.pop-hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); margin: 13px 0 0; }
.pop .range-row { margin-bottom: 2px; }
.pop .lang-chips { max-height: 232px; overflow-y: auto; margin: 0; padding-right: 2px; }
.pop .lang-actions { padding: 12px 0 0; align-items: center; }
.pop .lang-actions .muted { font-size: 12px; margin-left: auto; }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.step-head .step-title { margin: 0; }

/* Eingabefeld: ein Feld soll wie ein Feld aussehen. Der Platzhalter bleibt
   eine Zeile, die Schreibhilfe steht als unaufdringliche Zeile darunter. */
.ta-field { position: relative; }
.ta-field textarea { min-height: 168px; }
.field-help {
  margin: 10px 2px 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3);
}
.link-inline {
  font: inherit; color: var(--ink-2); background: none; border: 0; padding: 0;
  margin-left: 6px; cursor: pointer;
  border-bottom: 1px solid var(--line-strong);
}
.link-inline:hover { color: var(--ink); border-color: var(--ink); }
.link-inline:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 2px; }

.start-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.start-actions .btn.primary { margin-left: 0; }

@media (max-width: 640px) {
  .step-title { font-size: 25px; }
  #step1.card { padding: 28px 0 0; }
  /* Popover über die volle Breite: 340 px passen hier nicht mehr daneben */
  .pop, .pop-wide { position: fixed; left: 12px; right: 12px; top: auto; width: auto; max-width: none; }
}

/* ---------- Rechtsseiten (Impressum, Datenschutz) ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: 52px 24px 20px; }
.legal h1 { font-family: var(--font-ui); font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 26px; }
.legal h2 { font-family: var(--font-ui); font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin: 30px 0 8px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.legal p { margin: 0 0 12px; max-width: 68ch; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin: 3px 0; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.legal .placeholder {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 0 0 12px; color: var(--ink-2); font-size: 14px;
}
.legal .placeholder b { color: var(--ink); }
.legal-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); text-decoration: none; margin-bottom: 26px; }
.legal-back:hover { color: var(--ink); }

/* Die Hinweiszeile des Popovers übernimmt die Erläuterung des Chips, über
   dem die Maus steht. Feste Mindesthöhe, damit nichts springt. */
.pop-hint { min-height: 3.2em; transition: color .12s; }
.pop-hint.is-chip { color: var(--ink-2); }
