/* Auswertungen XXL — Werkstattpapier.
   Ein Werkzeug, das den ganzen Tag offen ist: warmer Papiergrund statt Weiss,
   technische Monospace fuer alles Gerechnete, genau ein Signalton (Orange).
   Das Navy ist dasselbe wie im Kopf der erzeugten PDFs — Oberflaeche und
   Dokument sollen erkennbar zusammengehoeren. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Fahrrad XXL: das Rot stammt aus dem Logo (#CD042E), das Schiefergrau
     (#485156) ebenfalls. Rot ist das Signal und wird sparsam eingesetzt —
     Knoepfe, die etwas ausloesen, und der Datenteil der Diagramme. Alles
     Tragende ist Schiefer. */
  --papier: #f3f2ef;
  --papier-tief: #e9e7e2;
  --blatt: #ffffff;
  --tinte: #1b1e20;
  --tinte-weich: #545c61;
  --tinte-zart: #8b9297;
  --schiefer: #485156;
  --schiefer-hell: #5d686e;
  --rot: #cd042e;
  --rot-dunkel: #a80325;
  --rot-weich: #fdeaee;
  --linie: #dcd9d3;
  --linie-zart: #e8e6e1;
  --gruen: #2b6b41;

  --serifenlos: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --grotesk: 'Archivo', var(--serifenlos);
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --seite: 264px;
  --spalte: 780px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--papier);
  /* Feines Raster wie auf Millimeterpapier — nur zu ahnen, nicht zu sehen. */
  background-image:
    linear-gradient(var(--linie-zart) 1px, transparent 1px),
    linear-gradient(90deg, var(--linie-zart) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--tinte);
  font-family: var(--serifenlos);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Gerüst ──────────────────────────────────────────────────────────────── */

.rahmen { display: flex; height: 100vh; overflow: hidden; }

.seite {
  width: var(--seite);
  flex: 0 0 var(--seite);
  border-right: 1px solid var(--linie);
  background: var(--papier-tief);
  display: flex;
  flex-direction: column;
}

.marke {
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--linie);
  background: var(--blatt);
}

.marke img {
  display: block;
  width: 150px;
  height: auto;
}

.marke p {
  margin: 9px 0 0;
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--tinte-weich);
}

.marke p span {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinte-zart);
  margin-top: 2px;
}

.neu {
  margin: 14px 16px 10px;
  padding: 10px 14px;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--blatt);
  background: var(--schiefer);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background 0.14s ease, transform 0.14s ease;
}

.neu:hover { background: var(--schiefer-hell); }
.neu:active { transform: translateY(1px); }
.neu span { font-family: var(--mono); font-weight: 400; opacity: 0.8; }

.verlauf { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }

.verlauf-titel {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tinte-zart);
  padding: 10px 8px 6px;
}

.eintrag-reihe { display: flex; align-items: stretch; gap: 2px; }

.eintrag-reihe .weg {
  flex: 0 0 auto;
  width: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  color: var(--tinte-zart);
  cursor: pointer;
  border-radius: 2px;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.12s, width 0.12s, color 0.12s;
}

/* Loeschen taucht erst beim Hinsehen auf — es soll da sein, aber nicht dauernd
   die Aufmerksamkeit von den Namen abziehen. */
.eintrag-reihe:hover .weg,
.eintrag-reihe:focus-within .weg { opacity: 1; width: 24px; }
.eintrag-reihe .weg:hover { color: var(--rot); background: rgba(255,255,255,0.6); }

.eintrag {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font: inherit;
  padding: 8px 10px;
  border-radius: 2px;
  cursor: pointer;
  color: var(--tinte-weich);
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.eintrag:hover { background: rgba(255,255,255,0.55); color: var(--tinte); }

.eintrag[aria-current='true'] {
  background: var(--blatt);
  border-left-color: var(--rot);
  color: var(--tinte);
}

.eintrag b {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.eintrag time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tinte-zart);
  letter-spacing: 0.04em;
}

.fuss {
  border-top: 1px solid var(--linie);
  padding: 10px 20px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--tinte-zart);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fuss .punkt::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--tinte-zart);
  vertical-align: 1px;
}

.fuss .punkt.gut::before { background: var(--gruen); }
.fuss .punkt.schlecht::before { background: var(--rot); }

/* ── Hauptspalte ─────────────────────────────────────────────────────────── */

.haupt { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.strom {
  flex: 1;
  overflow-y: auto;
  padding: 40px 40px 24px;
  scroll-behavior: smooth;
}

.bahn { max-width: var(--spalte); margin: 0 auto; }

/* Leerer Zustand */
.start { max-width: var(--spalte); margin: 8vh auto 0; animation: auf 0.5s ease both; }

.start h2 {
  font-family: var(--grotesk);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 10px;
  max-width: 17ch;
}

.start h2 em { font-style: normal; color: var(--rot); }

.start > p { margin: 0 0 30px; color: var(--tinte-weich); max-width: 56ch; }

.vorschlaege { display: grid; gap: 8px; }

.vorschlag {
  text-align: left;
  font: inherit;
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--linie);
  border-radius: 2px;
  padding: 12px 15px;
  cursor: pointer;
  color: var(--tinte-weich);
  transition: border-left-color 0.15s, transform 0.15s, color 0.15s;
  animation: auf 0.5s ease both;
}

.vorschlag:nth-child(1) { animation-delay: 0.05s; }
.vorschlag:nth-child(2) { animation-delay: 0.11s; }
.vorschlag:nth-child(3) { animation-delay: 0.17s; }
.vorschlag:nth-child(4) { animation-delay: 0.23s; }

.vorschlag:hover {
  border-left-color: var(--rot);
  transform: translateX(3px);
  color: var(--tinte);
}

.vorschlag b { font-weight: 600; color: var(--tinte); }
.vorschlag span { display: block; font-family: var(--mono); font-size: 11px; color: var(--tinte-zart); margin-top: 3px; }

/* Frage */
.frage {
  margin: 30px 0 22px;
  padding-left: 16px;
  border-left: 3px solid var(--rot);
  font-family: var(--grotesk);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  animation: auf 0.35s ease both;
}

/* Arbeitsschritte */
.schritte { margin: 0 0 18px; border-left: 1px solid var(--linie); padding-left: 16px; }

.schritt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tinte-weich);
  padding: 3px 0;
  animation: auf 0.3s ease both;
}

.schritt .art {
  display: inline-block;
  min-width: 62px;
  color: var(--schiefer);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.schritt .art::before { content: '› '; color: var(--tinte-zart); }
.schritt.fehlt .art { color: var(--rot); }

.schritt .zeigen {
  font: inherit;
  border: none;
  background: none;
  color: var(--tinte-zart);
  cursor: pointer;
  padding: 0 0 0 8px;
  text-decoration: underline dotted;
}

.schritt .zeigen:hover { color: var(--rot); }

.schritt pre {
  margin: 6px 0 10px;
  padding: 11px 13px;
  background: var(--tinte);
  color: #e8e4d9;
  border-radius: 2px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre;
}

.denkt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tinte-zart);
  padding: 3px 0;
  font-style: italic;
}

.puls::after {
  content: '▌';
  color: var(--rot);
  animation: blinken 1.05s steps(2) infinite;
  margin-left: 1px;
}

@keyframes blinken { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes auf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Antwort */
.antwort {
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-radius: 2px;
  padding: 22px 26px 6px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 rgba(27,30,32,0.04), 0 8px 22px -18px rgba(27,30,32,0.5);
  animation: auf 0.35s ease both;
}

.antwort > *:first-child { margin-top: 0; }
.antwort p { margin: 0 0 15px; }
.antwort strong { font-weight: 600; }

.antwort h2, .antwort h3, .antwort h4 {
  font-family: var(--grotesk);
  letter-spacing: -0.02em;
  margin: 26px 0 10px;
  line-height: 1.25;
}

.antwort h2 { font-size: 20px; }
.antwort h3 { font-size: 16.5px; }
.antwort h4 { font-size: 14.5px; color: var(--tinte-weich); }

.antwort ul, .antwort ol { margin: 0 0 15px; padding-left: 20px; }
.antwort li { margin-bottom: 5px; }

.antwort code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--papier-tief);
  padding: 1px 5px;
  border-radius: 2px;
}

.antwort pre {
  background: var(--tinte);
  color: #e8e4d9;
  padding: 13px 15px;
  border-radius: 2px;
  overflow-x: auto;
  margin: 0 0 15px;
}

.antwort pre code { background: none; color: inherit; padding: 0; font-size: 12px; }

.antwort table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 18px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.antwort th {
  background: var(--schiefer);
  color: var(--blatt);
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 7px 10px;
}

.antwort td { padding: 6px 10px; border-bottom: 1px solid var(--linie-zart); }
.antwort tbody tr:nth-child(even) { background: rgba(27,30,32,0.025); }
.antwort th.zahl, .antwort td.zahl { text-align: right; font-family: var(--mono); font-size: 12.5px; }

.antwort blockquote {
  margin: 0 0 15px;
  padding-left: 14px;
  border-left: 2px solid var(--linie);
  color: var(--tinte-weich);
}

/* Diagramme */

.diagramm {
  margin: 0 0 22px;
  padding: 0;
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-radius: 2px;
  overflow: hidden;
  animation: auf 0.35s ease both;
}

.diagramm svg { display: block; width: 100%; height: auto; }

/* Dateien */
.dateien { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }

.datei {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px 11px 12px;
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-radius: 2px;
  text-decoration: none;
  color: var(--tinte);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  animation: auf 0.35s ease both;
}

.datei:hover {
  transform: translateY(-2px);
  border-color: var(--schiefer);
  box-shadow: 0 10px 20px -14px rgba(27,30,32,0.6);
}

.datei .art {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 7px;
  border-radius: 2px;
  color: var(--blatt);
  background: var(--schiefer);
}

.datei.excel .art { background: var(--gruen); }
.datei b { display: block; font-weight: 600; font-size: 13.5px; }
.datei span { font-family: var(--mono); font-size: 10.5px; color: var(--tinte-zart); }

.stoerung {
  border-left: 3px solid var(--rot);
  background: var(--rot-weich);
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 2px;
  font-size: 14px;
}

.stoerung b { font-family: var(--grotesk); display: block; margin-bottom: 2px; }

/* ── Eingabe ─────────────────────────────────────────────────────────────── */

.eingabe {
  border-top: 1px solid var(--linie);
  background: linear-gradient(to bottom, rgba(242,239,231,0.7), var(--papier) 40%);
  backdrop-filter: blur(6px);
  padding: 16px 40px 20px;
}

/* ── Beigelegte Tabellen ─────────────────────────────────────────────────── */

.beilagen {
  max-width: var(--spalte);
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.beilage {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-left: 3px solid var(--gruen);
  border-radius: 2px;
  padding: 6px 8px 6px 11px;
  animation: auf 0.25s ease both;
}

.beilage b { display: block; font-weight: 600; font-size: 12.5px; }
.beilage span { display: block; font-family: var(--mono); font-size: 10px; color: var(--tinte-zart); }

.beilage .weg {
  border: none;
  background: none;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  color: var(--tinte-zart);
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 2px;
}

.beilage .weg:hover { color: var(--rot); background: var(--papier-tief); }

.beilage.wartet {
  border-left-color: var(--tinte-zart);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tinte-zart);
  padding: 9px 12px;
}

.klammer {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 1px;
  border: none;
  background: none;
  color: var(--tinte-zart);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.14s, background 0.14s;
}

.klammer:hover { color: var(--schiefer); background: var(--papier-tief); }

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

/* Waehrend eine Datei ueber dem Fenster haengt, soll sichtbar sein, dass sie
   hier hingehoert — sonst laesst man sie versehentlich daneben fallen. */
body.faellt .eingabe form {
  border-color: var(--gruen);
  box-shadow: 0 0 0 3px rgba(47,107,63,0.13);
}

body.faellt .eingabe::after {
  content: 'Tabelle hier fallen lassen';
  display: block;
  max-width: var(--spalte);
  margin: 8px auto 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gruen);
  text-align: center;
}

.eingabe form {
  max-width: var(--spalte);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-radius: 2px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.eingabe form:focus-within {
  border-color: var(--schiefer);
  box-shadow: 0 0 0 3px rgba(72,81,86,0.14);
}

.eingabe textarea {
  flex: 1;
  border: none;
  background: none;
  resize: none;
  font: inherit;
  line-height: 1.55;
  color: var(--tinte);
  padding: 7px 0;
  max-height: 220px;
  outline: none;
}

.eingabe textarea::placeholder { color: var(--tinte-zart); }

.senden {
  border: none;
  background: var(--rot);
  color: #fff;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  padding: 10px 17px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.14s, transform 0.14s;
}

.senden:hover:not(:disabled) { background: var(--rot-dunkel); }
.senden:active:not(:disabled) { transform: translateY(1px); }
.senden:disabled { background: var(--linie); color: var(--tinte-zart); cursor: default; }

/* Waehrend eines Laufs wird aus dem Absende- der Abbruchknopf: gedeckt statt
   signalfarben, damit er nicht zum Drücken einlädt. */
.senden.abbrechen { background: var(--tinte-weich); }
.senden.abbrechen:hover { background: var(--tinte); }

.vermerk {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tinte-zart);
  border-left: 2px solid var(--linie);
  padding: 2px 0 2px 14px;
  margin: 0 0 20px;
}

.hinweis {
  max-width: var(--spalte);
  margin: 8px auto 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--tinte-zart);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.hinweis kbd {
  font-family: var(--mono);
  background: var(--papier-tief);
  border: 1px solid var(--linie);
  border-bottom-width: 2px;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 10px;
}

/* ── Anmeldung ───────────────────────────────────────────────────────────── */

.tor {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.tor form {
  width: min(360px, 100%);
  background: var(--blatt);
  border: 1px solid var(--linie);
  border-top: 3px solid var(--rot);
  border-radius: 2px;
  padding: 30px 30px 26px;
  box-shadow: 0 20px 50px -34px rgba(27,30,32,0.8);
  animation: auf 0.45s ease both;
}

.tor img {
  display: block;
  width: 170px;
  height: auto;
  margin: 0 0 14px;
}

.tor h1 {
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--schiefer);
}
.tor p { margin: 0 0 20px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tinte-zart); }

.tor input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-radius: 2px;
  background: var(--papier);
  outline: none;
  margin-bottom: 12px;
}

.tor input:focus { border-color: var(--schiefer); box-shadow: 0 0 0 3px rgba(72,81,86,0.14); }
.tor button { width: 100%; }
.tor .fehler { color: var(--rot); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ── Schmale Fenster ─────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .rahmen { flex-direction: column; }
  .seite { width: 100%; flex: 0 0 auto; max-height: 40vh; }
  .strom { padding: 24px 18px 16px; }
  .eingabe { padding: 12px 18px 16px; }
  .start { margin-top: 4vh; }
  .start h2 { font-size: 27px; }
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--linie); border: 3px solid var(--papier); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--tinte-zart); }
