/* Pitch-Demo — bewusst schlank und groß. Projektor-tauglich: hoher Kontrast,
   große Schrift, wenig Fläche pro Bildschirm. Kein Framework, kein Build. */

:root {
  --ink: #16202b;
  --ink-soft: #5b6b7c;
  --line: #d8e0e8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --blue: #1a5fb4;
  --blue-dark: #14498a;
  --green: #1f7a3d;
  --green-bg: #e8f5ec;
  --red: #b3261e;
  --red-bg: #fdecea;
  --amber: #8a6100;
  --amber-bg: #fdf3d8;
  /* Höhe des Kopfbereichs — demo.js schreibt den gemessenen Wert hinein,
     damit die mitlaufende Knopfleiste exakt darunter einrastet. */
  --topbar: 68px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .93em; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Kopf */
.top {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 32px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.stepper { display: flex; gap: 8px; flex: 1; }
.step {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid transparent; background: none; cursor: pointer;
  font: inherit; font-size: 16px; color: var(--ink-soft);
  padding: 7px 15px; border-radius: 22px;
}
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #e6ebf1; color: var(--ink-soft); font-size: 14px; font-weight: 700;
}
.step:hover:not(:disabled) { background: #eef2f7; }
.step.active { color: var(--ink); font-weight: 650; background: #e8f0fb; border-color: #cfe0f7; }
.step.active .num { background: var(--blue); color: #fff; }
.step.done .num { background: var(--green); color: #fff; }
.step:disabled { opacity: .42; cursor: not-allowed; }
.topright { display: flex; align-items: center; gap: 16px; }
.akte { font-size: 14px; color: var(--ink-soft); font-family: ui-monospace, Menlo, monospace; }

/* ------------------------------------------------------------- Flächen */
.screen { max-width: 1180px; margin: 0 auto; padding: 34px 32px 90px; }
h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.4px; }
h2 { font-size: 19px; margin: 30px 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 26px; max-width: 760px; }
.hint { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }

/* ------------------------------------------------------------ Elemente */
.bigform { display: flex; gap: 12px; max-width: 700px; }
.bigform input {
  flex: 1; font: inherit; font-size: 22px; letter-spacing: .5px;
  padding: 14px 18px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--card);
}
.bigform input:focus { outline: none; border-color: var(--blue); }

button.primary, button.ghost {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 13px 26px; border-radius: 10px; border: 1px solid transparent;
}
button.primary { background: var(--blue); color: #fff; font-size: 17px; }
button.primary:hover:not(:disabled) { background: var(--blue-dark); }
button.primary.big { font-size: 19px; padding: 15px 34px; }
button.primary:disabled { background: #b6c3d2; cursor: not-allowed; }
button.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
button.ghost:hover { background: #eef2f7; }
button.small { font-size: 14px; padding: 7px 14px; }
.linkbtn {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--blue); text-decoration: underline; cursor: pointer;
}
.actionbar { display: flex; align-items: center; gap: 14px; margin: 24px 0 4px; flex-wrap: wrap; }
.timer { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Mitlaufende Knopfleiste: der Knopf bleibt erreichbar, während unten die
   Auslegungstabelle gelesen wird. */
.stickybar {
  position: sticky; top: var(--topbar); z-index: 10;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin: 0 0 18px;
  box-shadow: 0 2px 10px rgba(22, 32, 43, .07);
}
.barnote { font-size: 14.5px; color: var(--ink-soft); max-width: 620px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 22px; margin: 18px 0;
}

/* Meldungen — jede Sackgasse bekommt hier einen Weg nach vorn. */
.errbox, .statebox, .warnbox, .okbox {
  border-radius: 10px; padding: 16px 18px; margin: 18px 0;
  border: 1px solid; font-size: 15.5px;
}
.errbox { background: var(--red-bg); border-color: #f2b8b5; color: var(--red); }
.warnbox { background: var(--amber-bg); border-color: #e8d08a; color: var(--amber); }
.okbox { background: var(--green-bg); border-color: #bcdfc8; color: var(--green); }
.statebox { background: #eef4fc; border-color: #cfe0f7; color: var(--blue-dark); }
.errbox strong, .warnbox strong, .okbox strong, .statebox strong { display: block; margin-bottom: 4px; }
.errbox .fix, .warnbox .fix { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }

#banner-host .errbox, #banner-host .warnbox {
  max-width: 1180px; margin: 14px auto 0; border-radius: 10px;
}

/* Ladeanzeige */
.spinner {
  display: inline-block; width: 15px; height: 15px; margin-right: 9px;
  border: 2.5px solid #b9cdea; border-top-color: var(--blue);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress {
  height: 26px; background: #e6ebf1; border-radius: 13px;
  position: relative; overflow: hidden; margin: 16px 0;
}
.progress-fill { height: 100%; background: var(--blue); width: 0; transition: width .3s; }
.progress-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}

/* --------------------------------------------------------- Bibliografie */
.biblio-title { font-size: 22px; font-weight: 650; margin-bottom: 4px; }
.biblio-grid { display: grid; grid-template-columns: 168px 1fr; gap: 6px 18px; margin-top: 14px; font-size: 15px; }
.biblio-grid dt { color: var(--ink-soft); }
.biblio-grid dd { margin: 0; }

/* ------------------------------------------------- Merkmalsgliederung */
.claims { display: grid; gap: 14px; }
.claim { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.claim-head { font-weight: 650; margin-bottom: 10px; }
.claim-head .tag {
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px;
  background: #e8f0fb; color: var(--blue-dark); margin-left: 8px;
}
.feat { display: grid; grid-template-columns: 62px 1fr; gap: 4px 12px; font-size: 15px; padding: 3px 0; }
.feat .fid { font-family: ui-monospace, Menlo, monospace; color: var(--blue-dark); font-weight: 600; }

/* ------------------------------------------------------------ Auslegung */
.itable { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); }
.itable th, .itable td { border: 1px solid var(--line); padding: 9px 11px; vertical-align: top; text-align: left; }
.itable th { background: #eef2f7; font-size: 13.5px; }
.itable td.fid { font-family: ui-monospace, Menlo, monospace; font-weight: 600; color: var(--blue-dark); white-space: nowrap; }
.itable td.verb { width: 34%; }
.itable td, .itable th { overflow-wrap: anywhere; }
.tablewrap { overflow-x: auto; }

/* Solange die Auslegung unbestätigt ist, ist die mitlaufende Leiste das Gate —
   deshalb sticht sie dann farblich heraus. */
.stickybar.gate { background: #fff8e6; border: 2px solid #e8c96a; }
.confirmed {
  background: var(--green-bg); border: 2px solid #9ed0b0; border-radius: 12px;
  padding: 18px 22px; margin: 26px 0; font-size: 16px;
}
.confirmed strong { color: var(--green); display: block; margin-bottom: 4px; }

/* ---------------------------------------------------- Stand der Technik */
.drop {
  border: 2.5px dashed #b6c6d8; border-radius: 14px; background: var(--card);
  padding: 46px 20px; text-align: center; cursor: pointer; transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: #eef4fc; }
.drop-big { font-size: 21px; font-weight: 600; }
.drop-small { font-size: 14.5px; color: var(--ink-soft); margin-top: 7px; }

.dtable { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); }
.dtable th, .dtable td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: middle; }
.dtable th { background: #eef2f7; font-size: 13.5px; }
.dtable tr.nodate { background: var(--amber-bg); }
.dtable tr.excluded td { opacity: .55; }
.dtable input[type=date] { font: inherit; font-size: 14px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; }

.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pill.neutral { background: #e6ebf1; color: var(--ink-soft); }

/* Rangliste */
.rank { display: grid; gap: 12px; margin: 16px 0 30px; }
.rankrow {
  display: grid; grid-template-columns: 46px 1fr 130px 190px; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: 10px; padding: 13px 16px;
}
.rankrow.t-hoch { border-left-color: var(--red); }
.rankrow.t-mittel { border-left-color: #d98c00; }
.rankrow.t-niedrig { border-left-color: #97a6b6; }
.rankrow .pos { font-size: 22px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.rankrow .doc { font-weight: 600; }
.rankrow .doc small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.rankrow .score { font-size: 30px; font-weight: 700; text-align: right; line-height: 1.1; }
.rankrow .verdict { font-size: 13.5px; }
.rankrow .tierlabel {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-soft);
}
.rankrow.t-hoch .score { color: var(--red); }
.rankrow.t-mittel .score { color: #b3720a; }

/* Die Begründung der Wertung — der eigentliche Punkt der Rangliste: die Zahl
   soll nicht geglaubt, sondern nachgelesen werden. */
.reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip {
  display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.5;
  padding: 1px 8px; border-radius: 9px; background: #eef2f7; color: var(--ink-soft);
  border: 1px solid #e0e7ee;
}

/* Merkmalsmatrix: Merkmale von Anspruch 1 (Zeilen) über die Dokumente (Spalten).
   Die Kopfzeile mit den Nummern wird gekippt, sonst wird die Tabelle so breit
   wie die Publikationsnummern. */
.matrix { border-collapse: collapse; font-size: 14px; background: var(--card); }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 6px 8px; }
.matrix th.mf, .matrix td.mf {
  text-align: left; vertical-align: top; width: 380px; min-width: 300px;
  font-size: 13px; line-height: 1.45; position: sticky; left: 0;
  background: var(--card); z-index: 1;
}
.matrix th.mf { background: #eef2f7; }
.matrix th.mdoc { height: 128px; padding: 0; white-space: nowrap; background: #eef2f7; }
.matrix th.mdoc span {
  display: block; transform: rotate(-90deg); transform-origin: center;
  font-size: 12px; font-weight: 600; font-family: ui-monospace, Menlo, monospace;
  width: 128px; margin-left: -50px;
}
.matrix th.mscore { font-size: 13px; font-weight: 700; background: #eef2f7; }
.matrix th.mscore.t-hoch { color: var(--red); }
.matrix th.mscore.t-mittel { color: #b3720a; }
.matrix td.mcell { text-align: center; font-size: 16px; line-height: 1; cursor: help; }
.matrix td.mcell.s-disclosed { background: #dff2e4; color: var(--green); }
.matrix td.mcell.s-partial { background: #fdf3d8; color: var(--amber); }
.matrix td.mcell.s-not_disclosed { background: #fbdedb; color: var(--red); }

/* Claim Chart */
.chart { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; background: var(--card); }
.chart th, .chart td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
.chart th { background: #eef2f7; font-size: 13px; }
.chart td, .chart th { overflow-wrap: anywhere; }
.chart td.fid { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
/* Feste Spaltenbreiten: sonst zieht die Fundstellen-Spalte den Wortlaut
   zu einem Streifen zusammen und die Zeilen werden meterhoch. */
.chart col.c-id { width: 9%; }
.chart col.c-verb { width: 26%; }
.chart col.c-status { width: 10%; }
.chart col.c-ref { width: 18%; }
.chart col.c-reason { width: 37%; }
.chart tr.s-disclosed td.fid { background: #dff2e4; }
.chart tr.s-partial td.fid { background: #fdf3d8; }
.chart tr.s-not_disclosed td.fid { background: #fbdedb; }
.chart .ref { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

details.docdetail { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
details.docdetail > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 16px;
  list-style: none; display: flex; align-items: center; gap: 12px;
}
details.docdetail > summary::-webkit-details-marker { display: none; }
details.docdetail > summary::before { content: "▸"; color: var(--ink-soft); }
details.docdetail[open] > summary::before { content: "▾"; }
details.docdetail > .body { padding: 0 18px 18px; }

.verdictline { margin: 12px 0; font-size: 15px; }
.verdictline b { font-weight: 650; }
.psa { font-size: 14.5px; }
.psa dt { color: var(--ink-soft); margin-top: 8px; font-size: 13.5px; }
.psa dd { margin: 2px 0 0; }

ul.plain { margin: 8px 0; padding-left: 20px; }
ul.plain li { margin: 3px 0; }
