/* KortzAnalytics für Freunde -- D-E252.
   Eine kühne Sache: die Suche als Satz mit Lücke. Alles andere ruhig. */

:root {
  --grund: #eef1f4;
  --flaeche: #ffffff;
  --tinte: #1b2430;
  --gedaempft: #5d6875;
  --linie: #d5dbe2;
  --akzent: #145c6b;
  --akzent-stark: #0e4552;
  --akzent-hell: #e3eff1;
  --kaufen: #2e7d4f;
  --kaufen-grund: #e5f2ea;
  --beobachten: #8f6208;
  --beobachten-grund: #f8eed7;
  --meiden: #a63d32;
  --meiden-grund: #f7e4e1;
  --offen: #5b6472;
  --offen-grund: #e9ecf0;
  --fehler: #a63d32;

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;

  --radius-klein: 6px;
  --radius: 10px;
  --schatten: 0 1px 2px rgb(16 24 40 / 0.06), 0 6px 20px -8px rgb(16 24 40 / 0.14);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12171d;
    --flaeche: #1a2129;
    --tinte: #e6eaef;
    --gedaempft: #9aa5b1;
    --linie: #2c3540;
    --akzent: #5fb3c4;
    --akzent-stark: #8ccbd8;
    --akzent-hell: #1c3239;
    --kaufen: #6cc28f;
    --kaufen-grund: #1b3326;
    --beobachten: #e2b357;
    --beobachten-grund: #362c17;
    --meiden: #ec8b7f;
    --meiden-grund: #3a211e;
    --offen: #aab3bf;
    --offen-grund: #262e38;
    --fehler: #ec8b7f;
    --schatten: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -10px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 400 1rem/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
p, li, dd { text-wrap: pretty; }
a { color: var(--akzent); }
b, strong { font-weight: 650; }

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

.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.sprungmarke {
  position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: var(--flaeche);
  border-radius: var(--radius-klein); z-index: 10;
}
.sprungmarke:focus { top: 12px; }

/* ── Kopf und Fuß ───────────────────────────────────────────────────────── */

.kopf, .inhalt, .fuss { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 22px; padding-bottom: 22px;
}

.marke {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--tinte); font-weight: 650; letter-spacing: -0.01em; min-height: 44px;
}
.marke-zeichen {
  width: 28px; height: 28px; fill: none; stroke: var(--akzent); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.marke-zusatz { color: var(--gedaempft); font-weight: 400; }

.abmelden { display: flex; align-items: center; gap: 12px; margin: 0; }
.wer { color: var(--gedaempft); font-size: 0.95rem; }

.inhalt { flex: 1; padding-bottom: 56px; }

.fuss { padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--linie); }
.fuss p { margin: 0; color: var(--gedaempft); font-size: 0.875rem; }

/* ── Knöpfe und Felder ──────────────────────────────────────────────────── */

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-klein);
  background: var(--akzent); color: #fff; font: 600 1rem/1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition-property: background-color, transform, box-shadow;
  transition-duration: 150ms; transition-timing-function: ease-out;
}
@media (prefers-color-scheme: dark) { .knopf { color: #0c1a1e; } }
.knopf:hover { background: var(--akzent-stark); }
.knopf:active { transform: scale(0.97); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.knopf-klein { min-height: 40px; padding: 0 16px; font-size: 0.95rem; }

.knopf-leise {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--linie); border-radius: var(--radius-klein); background: transparent;
  color: var(--tinte); font: 500 0.95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition-property: background-color, border-color; transition-duration: 150ms;
}
.knopf-leise:hover { background: var(--flaeche); border-color: var(--gedaempft); }

.formular { display: grid; gap: 18px; margin: 32px 0 20px; }
.feld { display: grid; gap: 6px; }
.feld-name { font-weight: 600; font-size: 0.95rem; }
.feld-hilfe { color: var(--gedaempft); font-size: 0.875rem; }
.feld input {
  min-height: 48px; padding: 0 14px; border: 1px solid var(--linie);
  border-radius: var(--radius-klein); background: var(--flaeche); color: var(--tinte);
  font: 400 1rem/1 var(--sans);
  transition-property: border-color, box-shadow; transition-duration: 150ms;
}
.feld input:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }

.meldung {
  margin: 20px 0 0; padding: 12px 16px; border-radius: var(--radius-klein);
  background: var(--akzent-hell); color: var(--tinte);
}
.meldung-fehler { background: var(--meiden-grund); color: var(--tinte); border-left: 3px solid var(--fehler); }
.leise { color: var(--gedaempft); font-size: 0.95rem; }

/* ── Anmelden, Einladung ────────────────────────────────────────────────── */

.tuer { padding-top: 6vh; max-width: 520px; }
.tuer-titel { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); letter-spacing: -0.015em; }
.tuer-text { color: var(--gedaempft); font-size: 1.075rem; margin: 14px 0 0; max-width: 34em; }

/* ── Die Satz-Suche ─────────────────────────────────────────────────────── */

.anfrage { padding: 28px 0 8px; }

.satz {
  margin: 0; font-family: var(--serif); font-size: clamp(1.8rem, 1rem + 3vw, 2.8rem);
  line-height: 1.25; letter-spacing: -0.02em; display: flex; flex-wrap: wrap;
  align-items: baseline; column-gap: 0.32em; row-gap: 0.1em;
}
.satz label { cursor: text; }
.satz-ende { color: var(--tinte); }

.luecke { position: relative; flex: 1 1 6.5em; min-width: 5em; max-width: 9.5em; }
.luecke-feld {
  width: 100%; padding: 0 0 0.06em; border: 0; border-bottom: 3px solid var(--akzent);
  background: transparent; color: var(--akzent-stark); font: inherit; letter-spacing: inherit;
  border-radius: 0;
  transition-property: border-color; transition-duration: 150ms;
}
.luecke-feld::placeholder { color: var(--gedaempft); opacity: 0.55; }
.luecke-feld:focus { outline: none; border-bottom-color: var(--akzent-stark); }
.luecke-feld:focus-visible { outline: none; }

.vorschlaege {
  position: absolute; z-index: 5; top: calc(100% + 10px); left: 0; width: max(100%, 20rem);
  max-width: calc(100vw - 40px);
  margin: 0; padding: 6px; list-style: none; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
  font: 400 1rem/1.35 var(--sans); letter-spacing: 0;
  animation: auftauchen 140ms ease-out;
}
.vorschlag {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 44px; padding: 8px 10px; border-radius: var(--radius-klein); cursor: pointer;
}
.vorschlag[aria-selected="true"], .vorschlag:hover { background: var(--akzent-hell); }
.vorschlag-leer { padding: 10px; color: var(--gedaempft); font-size: 0.95rem; }

@keyframes auftauchen {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.kuerzel {
  font: 600 0.78em/1 var(--sans); letter-spacing: 0.02em; color: var(--gedaempft);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.anfrage-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; }
.kontingent { margin: 0; color: var(--gedaempft); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.kontingent b { color: var(--tinte); }

.auswahl { margin-top: 24px; }
.auswahl-frage { margin: 0 0 10px; font-weight: 600; }
.auswahl-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.auswahl-liste form { margin: 0; }
.auswahl-knopf {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 48px; padding: 0 16px; border: 1px solid var(--linie); border-radius: var(--radius-klein);
  background: var(--flaeche); color: var(--tinte); font: 500 1rem/1.3 var(--sans); text-align: left;
  cursor: pointer; transition-property: border-color, background-color; transition-duration: 150ms;
}
.auswahl-knopf:hover { border-color: var(--akzent); background: var(--akzent-hell); }

/* ── Deine Analysen ─────────────────────────────────────────────────────── */

.analysen { margin-top: 56px; }
.analysen h2, .erklaerung h2 { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 18px; }

.analysen-liste {
  list-style: none; margin: 0; padding: 0; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
}
.analyse { padding: 18px 20px; display: grid; gap: 10px; }
.analyse + .analyse { border-top: 1px solid var(--linie); }

.analyse-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.analyse-firma { font-size: 1.25rem; }
.analyse-firma .kuerzel { margin-left: 6px; }
.analyse-zeit { margin: 0; color: var(--gedaempft); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.analyse-lauf { display: grid; gap: 8px; }
.analyse-text { margin: 0; color: var(--gedaempft); font-size: 0.95rem; }
.analyse-text-problem { color: var(--tinte); }

.balken {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0;
  border-radius: 99px; background: var(--offen-grund); overflow: hidden;
}
.balken::-webkit-progress-bar { background: var(--offen-grund); border-radius: 99px; }
.balken::-webkit-progress-value { background: var(--akzent); border-radius: 99px; transition: width 400ms ease-out; }
.balken::-moz-progress-bar { background: var(--akzent); border-radius: 99px; }

.analyse-ergebnis { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.stempel {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
  border-radius: 99px; font: 650 0.9rem/1 var(--sans); white-space: nowrap;
  border: 1.5px solid currentColor;
}
.stempel-kaufen { color: var(--kaufen); background: var(--kaufen-grund); }
.stempel-beobachten { color: var(--beobachten); background: var(--beobachten-grund); }
.stempel-meiden { color: var(--meiden); background: var(--meiden-grund); }
.stempel-offen { color: var(--offen); background: var(--offen-grund); }

.leer {
  margin: 0; padding: 22px 20px; border: 1px dashed var(--linie); border-radius: var(--radius);
  color: var(--gedaempft);
}

/* ── So entsteht eine Analyse ───────────────────────────────────────────── */

.erklaerung { margin-top: 64px; }

.schritte {
  list-style: none; margin: 0; padding: 0; counter-reset: schritt;
  display: grid; gap: 28px; grid-template-columns: repeat(3, 1fr);
}
.schritt { counter-increment: schritt; position: relative; padding-top: 52px; }
.schritt::before {
  content: counter(schritt); position: absolute; top: 0; left: 0;
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  background: var(--akzent); color: #fff; font: 600 1.05rem/1 var(--serif);
}
@media (prefers-color-scheme: dark) { .schritt::before { color: #0c1a1e; } }
.schritt:not(:last-child)::after {
  content: ""; position: absolute; top: 18px; left: 48px; right: -16px; height: 2px;
  background: var(--linie);
}
.schritt h3 { font-size: 1.2rem; margin-bottom: 6px; }
.schritt p { margin: 0; color: var(--gedaempft); font-size: 0.95rem; }

.urteile, .wissen { margin-top: 40px; }
.urteile h3, .wissen h3 { font-size: 1.2rem; margin-bottom: 14px; }
.urteile-liste { margin: 0; display: grid; gap: 12px; }
.urteile-liste > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; align-items: baseline; }
.urteile-liste dt { margin: 0; }
.urteile-liste dd { margin: 0; color: var(--gedaempft); }

.wissen ul { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; color: var(--gedaempft); }
.wissen li::marker { color: var(--akzent); }

/* ── Schmale Bildschirme ────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .kopf, .inhalt, .fuss { padding-left: 16px; padding-right: 16px; }
  .marke-zusatz { display: none; }
  .wer { display: none; }
  .luecke { flex-basis: 100%; max-width: none; order: 2; }
  .satz-ende { order: 3; }
  .schritte { grid-template-columns: 1fr; gap: 22px; }
  .schritt { padding-top: 0; padding-left: 52px; }
  .schritt:not(:last-child)::after { top: 44px; bottom: -14px; left: 17px; right: auto; width: 2px; height: auto; }
  .urteile-liste > div { grid-template-columns: 1fr; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
