:root {
  --bg: #ffffff;
  --elevated: #f7f7f7;
  --panel: #ffffff;
  --border: #000000;
  --border-soft: #d0d0d0;
  --text: #000000;
  --muted: #666666;
  --muted-2: #999999;
  --primary: #000000;
  --primary-text: #ffffff;
  --danger: #cc0000;
  --ok: #0a7a2f;
  --warn-bg: #fff6d6;
  --info-bg: #eef6ff;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand h1 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand span {
  font-size: 11px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}
.header-actions[hidden] {
  display: none !important;
}

main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* PDFs tab: use almost the full viewport — dual viewers side by side */
main.pdfs-active {
  width: min(100%, calc(100vw - 16px));
  max-width: none;
  padding-left: 10px;
  padding-right: 10px;
}

/* Footer like Immo Bilder Studio: centered black Datenschutz button */
footer[role="contentinfo"] {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}
a.btn-privacy,
.btn-privacy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  background: #000000;
  color: #ffffff !important;
  border: 1px solid #000000;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
}
a.btn-privacy:hover,
a.btn-privacy:focus-visible,
.btn-privacy:hover,
.btn-privacy:focus-visible {
  background: #111111;
  color: #ffffff !important;
  outline: 2px solid #000;
  outline-offset: 2px;
}
a.btn-privacy:active {
  background: #000000;
}

.muted { color: var(--muted); }
.view[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: #000;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 11px;
}
.btn:hover { background: #f0f0f0; }
.btn-primary {
  background: #000;
  color: #fff;
}
.btn-primary:hover { background: #222; color: #fff; }
/* Dead-CTA guard: never show hidden add-second buttons */
#btnCompareAdd[hidden],
#btnAddSecond[hidden],
#headerActions[hidden] {
  display: none !important;
}
.btn-ghost {
  border-color: var(--border-soft);
  text-transform: none;
  font-weight: 500;
  font-size: 12px;
}
.btn-block { width: 100%; min-height: 44px; }

/* Empty hero */
.hero {
  max-width: 520px;
  margin: 48px auto 0;
  text-align: center;
}
.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.hero h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hero-sub {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.5;
}
.empty-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(360px, 100%);
  margin: 0 auto;
}
.hint {
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--mono);
}

.upload-field {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed #000;
  background: #fff;
  cursor: pointer;
  color: #000;
  transition: background 0.1s ease, border-style 0.1s ease;
}
.upload-field:hover,
.upload-field.dragover {
  background: #f0f0f0;
  border-style: solid;
}
.upload-field .upload-icon { width: 28px; height: 28px; }
.upload-field .upload-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.upload-field .upload-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.upload-field .upload-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.upload-hero {
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 160px;
  padding: 28px 24px;
}
.upload-hero .upload-copy { align-items: center; text-align: center; }

/* Loading */
.loading-card {
  max-width: 480px;
  margin: 64px auto 0;
  border: 1px solid var(--border);
  padding: 24px;
  background: #fff;
}
.loading-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.loading-top h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #ddd;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted-2);
}
.steps li.active { color: #000; font-weight: 500; }
.steps li.done { color: var(--ok); }
.steps .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
}
.steps li.active .dot { background: #000; }
.steps li.done .dot { background: var(--ok); }

.progress {
  height: 3px;
  background: #eee;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: #000;
  transition: width 0.35s ease;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: #000; }
.tab.active {
  color: #000;
  border-bottom-color: #000;
}

/* Offer switcher — only visible on Übersicht / LV when ≥2 offers */
.contract-switch-wrap {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft, #e5e5e5);
  background: #fafafa;
}
.contract-switch-wrap[hidden] {
  display: none !important;
}
.contract-switch-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contract-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.contract-context {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #111;
}
.contract-context .muted {
  color: var(--muted);
  font-size: 12px;
}
.pill {
  border: 1.5px solid #111;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.pill:hover {
  background: #f0f0f0;
}
.pill.active {
  border-color: #000;
  background: #000;
  color: #fff;
  font-weight: 600;
}
.pill .pill-name {
  font-weight: 600;
  line-height: 1.25;
}
.pill .pill-sum,
.pill small {
  opacity: 0.75;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
}
.pill.active .pill-sum {
  opacity: 0.85;
}
.offer-view-banner {
  border: 1px solid #000;
  background: #fff;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.offer-view-banner[hidden] {
  display: none !important;
}
.offer-view-banner strong {
  font-weight: 700;
}

/* Cards / grids */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  border: 1px solid var(--border);
  padding: 14px;
  background: #fff;
}
.stat .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.stat .value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.card {
  border: 1px solid var(--border);
  padding: 16px;
  background: #fff;
  margin-bottom: 14px;
}
.card h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.meta-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.meta-list strong {
  display: inline-block;
  min-width: 9rem;
  font-weight: 600;
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
td.num, th.num { text-align: right; white-space: nowrap; }
tr.neg td.num { color: var(--danger); }
tr.up td.delta-pos { color: var(--danger); }
tr.down td.delta-neg { color: var(--ok); }

.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: #fff;
  margin-left: 4px;
}
.badge.warn { background: var(--warn-bg); border-color: #e0c35a; }
.badge.info { background: var(--info-bg); border-color: #9bb8d9; }
.badge.danger { background: #ffe8e8; border-color: var(--danger); color: var(--danger); }

/* LV */
.lv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.search-wrap { flex: 1; min-width: 200px; }
.lv-toolbar input[type="search"],
.lv-toolbar select,
.compare-filters input[type="search"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  padding: 0 12px;
  font: inherit;
  background: #fff;
}
.lv-toolbar select { max-width: 200px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.lv-tree { display: flex; flex-direction: column; gap: 8px; }
.lv-pair-chrome {
  margin-bottom: 16px;
}
.lv-pair-chrome[hidden],
.lv-toggle-b[hidden],
#lvDiffOnlyWrap[hidden],
#lvCompareAddWrap[hidden] {
  display: none !important;
}
.lv-compare-add {
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fff;
}
.lv-compare-add .btn { margin-top: 8px; }

/* Leaf with A | B | Δ columns */
.leaf-cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(90px, 0.7fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 700px) {
  .leaf-cmp-grid { grid-template-columns: 1fr; }
}
.leaf-cmp-col {
  border: 1px solid var(--border-soft);
  background: #fafafa;
  padding: 8px 10px;
}
.leaf-cmp-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.leaf-cmp-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.leaf-cmp-val small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.leaf-cmp-delta { background: #fff; }
.leaf-cmp.up { border-color: #f0c0c0; }
.leaf-cmp.down { border-color: #b8e0c4; }
.acc-head .sum-pair {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.acc-head .sum-a { color: #111; }
.acc-head .sum-b { color: #555; }
.acc-head .sum-d.up { color: var(--danger); }
.acc-head .sum-d.down { color: var(--ok); }

.acc {
  border: 1px solid var(--border);
  background: #fff;
}
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.acc-head:hover { background: var(--elevated); }
.acc-head .nr { font-weight: 600; font-family: var(--mono); font-size: 12px; }
.acc-head .title { flex: 1; min-width: 120px; }
.acc-head .sum {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.acc-body {
  border-top: 1px solid var(--border-soft);
  padding: 10px 12px 12px;
  background: #fafafa;
}
.acc.closed .acc-body { display: none; }
.acc-chevron {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #000;
  transition: transform 0.15s;
}
.acc.closed .acc-chevron { transform: rotate(-90deg); }

.leaf {
  border: 1px solid var(--border-soft);
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.leaf:hover {
  border-color: #000;
}
.leaf.is-selected {
  border-color: #000;
  box-shadow: 3px 3px 0 #000;
  background: #fffef8;
}
.leaf:last-child { margin-bottom: 0; }
.leaf-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.leaf .nr { font-weight: 600; font-family: var(--mono); font-size: 12px; }
.leaf .title { flex: 1; min-width: 140px; }
.btn-leaf-pdf {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1.5px solid #000 !important;
  background: #fff !important;
  color: #000 !important;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.btn-leaf-pdf:hover {
  background: #111 !important;
  color: #fff !important;
}
.btn-lv-pdf {
  margin-left: auto;
  font-weight: 600;
  border: 1.5px solid #000 !important;
}
.btn-lv-pdf:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.leaf-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.leaf-meta strong { color: #000; }
.leaf details {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.leaf details summary {
  cursor: pointer;
  color: #000;
  font-weight: 500;
}
.leaf details pre {
  white-space: pre-wrap;
  margin-top: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 11px;
}

/* ── Hardcoded pair demo (clock + scrollable PDFs) ───────── */
/* Clock sits under headline/body — same column as other step content */
.demo-wait {
  margin: 8px 0 14px;
  padding: 0;
  border: 0;
}
.demo-clock {
  text-align: left;
  margin: 0;
}
.demo-clock-face {
  font-size: clamp(40px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  color: #000;
}
.demo-clock-meta {
  font-size: 13px;
  color: var(--muted, #666);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.demo-clock-bar {
  height: 4px;
  border-radius: 999px;
  background: #eee;
  overflow: hidden;
  margin: 12px 0 0;
  max-width: 240px;
}
.demo-clock-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: #111;
  transition: width 0.15s linear;
}
/* PDF previews only on result tab — never in loading story */
/*
 * PDF search chrome — ONE row, same height:
 *   [↑][↓]  ────────  [ search ]  ────────  [↑][↓]
 * Arrows sit in the horizontal center of each 50% PDF column.
 */
.pdf-search-tree {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 8px;
  position: sticky;
  top: 52px;
  z-index: 25;
  background: var(--bg);
  padding: 8px 0 8px;
  border-bottom: 1px solid var(--border-soft, #e5e5e5);
  box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.18);
}

/*
 * Grid mirrors the dual PDF row:
 * left half = A column (arrows centered), right half = B column.
 * Search is absolutely centered on the full bar so it sits mid-screen.
 * Lines run from search edge out to each arrow pair.
 */
.pdf-search-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; /* match .demo-pdf-row */
  width: 100%;
  min-height: 44px;
  align-items: center;
  position: relative;
}

/* A: arrows + line-to-search (line is right half of A column) */
.pdf-side-nav-a {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  z-index: 2;
}
/* B: arrows (left half of B is the line) */
.pdf-side-nav-b {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  z-index: 2;
}

/* Horizontal rails: from mid of each column toward the search field */
.pdf-search-line {
  display: none; /* drawn via pseudo on the row instead */
}

/* Left rail: center of col A → left edge of search */
.pdf-search-row::before,
/* Right rail: right edge of search → center of col B */
.pdf-search-row::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 2px;
  background: #111;
  z-index: 1;
  pointer-events: none;
  transform: translateY(-50%);
}
/* col A center ≈ 25% of full width; search is ~420px centered */
.pdf-search-row::before {
  left: 25%;
  right: calc(50% + min(210px, 21vw) + 4px);
}
.pdf-search-row::after {
  left: calc(50% + min(210px, 21vw) + 4px);
  right: 25%;
}

.pdf-search-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 42vw);
  max-width: 420px;
  z-index: 3;
  margin: 0;
  background: var(--bg);
}
.pdf-search-center input {
  width: 100%;
  min-height: 44px;
  border: 2px solid #000;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  text-align: center;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
}
.pdf-search-center input:focus {
  /* no second ring on focus — keep only the solid box border */
  outline: none;
  outline-offset: 0;
}
.pdf-search-status {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
  max-width: 100%;
}
.pdf-search-status.is-hit {
  color: #111;
  font-weight: 600;
}
.pdf-search-status.is-miss {
  color: var(--danger, #cc0000);
}

.pdf-side-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  background: var(--bg); /* covers the rail under the buttons */
  border: 0;
  min-width: 0;
  position: relative;
  z-index: 2;
}
.pdf-side-btn {
  min-width: 40px;
  min-height: 36px;
  font-size: 16px;
  font-weight: 700;
  padding: 0 10px;
  border: 1.5px solid #000 !important;
  background: #fff !important;
}
.pdf-side-btn:hover:not(:disabled) {
  background: #111 !important;
  color: #fff !important;
}
.pdf-side-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pdf-side-count {
  display: none !important;
}

@media (max-width: 720px) {
  .pdf-search-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .pdf-search-row::before,
  .pdf-search-row::after {
    display: none;
  }
  .pdf-search-center {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: none;
    order: -1;
  }
  .pdf-side-nav-a,
  .pdf-side-nav-b {
    grid-column: auto;
    justify-self: auto;
  }
}
.pdf-page-hit {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid #000;
  padding: 2px 6px;
  background: #fff;
  margin-left: auto;
}
.pdf-page-hit[hidden] {
  display: none !important;
}

/* «Nach Oben» — same row as ↑↓, right edge of the search bar */
.btn-nach-oben {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px 0 12px;
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
}
.btn-nach-oben:hover {
  background: #111;
  color: #fff;
}
.btn-nach-oben:active {
  transform: translateY(-50%) translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}
.btn-nach-oben-arrow {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  animation: nach-oben-bob 1.1s ease-in-out infinite;
}
.btn-nach-oben-label {
  white-space: nowrap;
}
@keyframes nach-oben-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
@media (max-width: 720px) {
  .btn-nach-oben {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: auto;
  }
  .btn-nach-oben:active {
    transform: translate(1px, 1px);
  }
}

.demo-pdf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  /* grid children must be allowed to shrink so inner overflow works */
  align-items: stretch;
}
@media (max-width: 800px) {
  .demo-pdf-row { grid-template-columns: 1fr; }
}
.demo-pdf-card {
  border: 1px solid var(--border-soft, #e5e5e5);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  min-width: 0; /* allow grid column to shrink/grow fully */
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* card height is driven by the scrollport, not by all PDF pages */
  height: min(78vh, 880px);
  max-height: min(78vh, 880px);
}
.demo-pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft, #e5e5e5);
  background: #fafafa;
  flex-shrink: 0;
}
.demo-pdf-head a {
  color: #111;
  font-weight: 500;
  white-space: nowrap;
}
.demo-pdf-frame {
  width: 100%;
  height: 280px;
  border: 0;
  background: #f3f3f3;
}
/*
 * Critical for scroll: flex item min-height defaults to content size.
 * Without min-height:0 + max-height, the viewer grows to all pages → no scroll.
 */
.demo-pdf-frame-tall {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto;
  max-height: none;
}
/* PDF.js scroll viewer — canvas & highlight layer share exact CSS pixel size */
.pdf-js-scroll {
  width: 100%;
  overflow: auto !important;
  overflow-x: auto;
  overflow-y: auto;
  background: #dcdcdc;
  position: relative;
  /* auto: at top, further scroll-up can chain to the page (JS also handles wheel) */
  overscroll-behavior-y: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pan-x;
}
.pdf-page-wrap {
  position: relative;
  /* Horizontal: fill viewer (scale set in JS); small vertical gap only */
  margin: 6px auto;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  background: #fff;
  /* width/height set in JS to viewport CSS pixels — never CSS-scale canvas */
  flex-shrink: 0;
  overflow: hidden;
}
.pdf-page-wrap canvas {
  display: block;
  /* must match wrap — no max-width scaling (that broke highlights) */
  width: 100%;
  height: 100%;
}

#panel-pdfs {
  width: 100%;
}
.pdf-hl-layer {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 2;
  /* width/height set in JS to match viewport */
}
/* Soft highlights: all hits blue · current hit faded red (clear focus) */
.pdf-hl {
  position: absolute;
  background: rgba(37, 99, 235, 0.32);
  border: none;
  border-radius: 2px;
  box-sizing: border-box;
  box-shadow: none;
  pointer-events: none;
}
.pdf-hl.is-current {
  background: rgba(220, 50, 50, 0.38);
  border: none;
  box-shadow: none;
  z-index: 3;
}
.pdf-page-wrap.is-active-page {
  outline: none;
}
.result-pdf-row {
  margin-top: 4px;
}



/* Final wait step: headline left + CTA slides out to the right from behind the copy */
.story-head-row {
  display: flex;
  align-items: flex-start;
  gap: 12px 20px;
  position: relative;
  margin-bottom: 8px;
}
.story-head-main {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 2;
  background: var(--bg, #fff);
}
.demo-reveal-slot {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 22px; /* align near headline */
  position: relative;
  z-index: 1;
  /* start tucked under / behind the text, then slide out right */
  opacity: 0;
  transform: translateX(-72%);
  pointer-events: none;
  transition:
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.45s ease;
}
.demo-reveal-slot[hidden] {
  display: none !important;
}
.demo-reveal-slot.is-in {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 3;
}
.demo-reveal-btn {
  min-width: 0;
  white-space: nowrap;
  font-size: 13px;
  padding: 10px 16px;
  box-shadow: 4px 4px 0 #000;
}
/* Below full story — right-aligned with story stage width */
.demo-skip-wrap {
  width: 100%;
  max-width: 960px;
  margin: 20px auto 8px;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  box-sizing: border-box;
}
.demo-skip-wrap[hidden] {
  display: none !important;
}
.demo-skip-btn {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  min-height: 36px;
  padding: 0 14px;
  opacity: 0.85;
  margin: 0;
}
.demo-skip-btn:hover {
  opacity: 1;
}
@media (max-width: 760px) {
  .demo-skip-wrap {
    justify-content: flex-end;
    padding: 0 4px;
  }
}
/* Hide skip when split-end is active (loading still visible with end layout) */
.view-story:has(.story-stage.is-split-end) .demo-skip-wrap {
  display: none !important;
}
.demo-reveal-hint {
  font-size: 12px;
  color: var(--muted, #666);
  margin: 10px 0 0;
}
.demo-reveal-hint[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .story-head-row {
    flex-direction: column;
    align-items: stretch;
  }
  .demo-reveal-slot {
    margin-top: 4px;
    align-self: flex-end;
    transform: translateX(-40%);
  }
  .demo-reveal-slot.is-in {
    transform: translateX(0);
  }
}

.compare-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.compare-filters input[type="search"] { max-width: 280px; }

.compare-table th:nth-child(1),
.compare-table td:nth-child(1) {
  font-family: var(--mono);
  white-space: nowrap;
}

.compare-commercial {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fafafa;
}
.compare-kond {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .compare-kond { grid-template-columns: 1fr; }
}
.compare-kond h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.compare-kond ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.match-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.match-exact { background: #e8f7ee; color: #0b6b33; border-color: #b7e0c5; }
.match-npk { background: #e8f0ff; color: #1d4ed8; border-color: #bfdbfe; }
.match-qty { background: #fff7e6; color: #9a6700; border-color: #f5d78e; }
.match-fuzzy { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.match-only { background: #f3f4f6; color: #4b5563; }
.cmp-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .hero h2 { font-size: 22px; }
  .meta-list strong { display: block; min-width: 0; margin-bottom: 2px; }
}

/* ── Hero purpose (empty) ─────────────────────────────── */
.hero-wide { max-width: 640px; }
.hero-purpose {
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-sub-big {
  font-size: 15px;
  line-height: 1.55;
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}
.hero-sub-big strong { color: #000; font-weight: 600; }

.purpose-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 28px;
}
.purpose-pills span {
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drop-visual {
  margin-bottom: 4px;
}
.mini-pdf {
  position: relative;
  width: 56px;
  height: 72px;
  border: 1.5px solid #000;
  background: #fff;
  margin: 0 auto 4px;
  box-shadow: 4px 4px 0 #000;
}
.mini-pdf-fold {
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #eee 50%, #fff 50%);
  border-left: 1px solid #000;
  border-bottom: 1px solid #000;
}
.mini-pdf-label {
  position: absolute;
  top: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.mini-pdf-lines {
  position: absolute;
  left: 8px; right: 8px; bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mini-pdf-lines i {
  display: block;
  height: 2px;
  background: #ddd;
}
.mini-pdf-lines i:nth-child(1) { width: 100%; }
.mini-pdf-lines i:nth-child(2) { width: 85%; }
.mini-pdf-lines i:nth-child(3) { width: 92%; }
.mini-pdf-lines i:nth-child(4) { width: 60%; }

.upload-hero { min-height: 200px; }

/* ── Story / loading stage ────────────────────────────── */
.view-story {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding-bottom: 24px;
}
.story-stage {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 40px 48px;
  align-items: center;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 0 0;
}
@media (max-width: 760px) {
  .story-stage {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .story-steps { text-align: left; }
  .pdf-stage { margin: 0 auto; }
}

.pdf-stage {
  position: relative;
  width: 240px;
  height: 320px;
  overflow: visible;
}
/* Dual-doc layout when B is visible */
.pdf-stage[data-scene="fly_b"] .pdf-doc,
.pdf-stage[data-scene="lv_tree_b"] .pdf-doc,
.pdf-stage[data-scene="match"] .pdf-doc,
.pdf-stage[data-scene="delta"] .pdf-doc,
.pdf-stage[data-scene="terms"] .pdf-doc,
.pdf-stage[data-scene="wait_mail"] .pdf-doc {
  left: 28%;
  width: 120px;
  margin-left: -60px;
  top: 48px;
  height: 170px;
  padding: 12px 10px 10px;
}
.pdf-stage[data-scene="fly_b"] .pdf-doc-b,
.pdf-stage[data-scene="lv_tree_b"] .pdf-doc-b,
.pdf-stage[data-scene="match"] .pdf-doc-b,
.pdf-stage[data-scene="delta"] .pdf-doc-b,
.pdf-stage[data-scene="terms"] .pdf-doc-b,
.pdf-stage[data-scene="wait_mail"] .pdf-doc-b {
  display: block !important;
  opacity: 1;
  left: 72%;
  width: 120px;
  margin-left: -60px;
  top: 56px;
  height: 170px;
  padding: 12px 10px 10px;
  z-index: 2;
}
.pdf-drop-target {
  position: absolute;
  inset: 24px 12px 12px;
  border: 2px dashed #000;
  background: #fafafa;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.pdf-drop-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.2s ease;
}
/* Once the PDF is in: no dashed cage, no “Analyse-Zone” under the doc */
.pdf-drop-target.receiving,
.pdf-drop-target.working {
  border-color: transparent;
  background: transparent;
  animation: none;
  box-shadow: none;
}
.pdf-drop-target.receiving .pdf-drop-label,
.pdf-drop-target.working .pdf-drop-label {
  opacity: 0;
  pointer-events: none;
}
@keyframes pulse-target {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0.08); }
  50% { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
}

.pdf-doc {
  position: absolute;
  left: 50%;
  top: -40%;
  width: 150px;
  height: 200px;
  margin-left: -75px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 8px 8px 0 #000;
  padding: 18px 14px 14px;
  opacity: 0;
  transform: translateY(-80px) rotate(-8deg) scale(0.85);
  z-index: 2;
  overflow: hidden;
  filter: none;
}
.pdf-doc.fly-in {
  animation: pdf-fly-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pdf-doc.landed {
  opacity: 1;
  top: 42px;
  transform: translateY(0) rotate(-1.5deg) scale(1);
  box-shadow: 8px 8px 0 #000;
  animation: pdf-settle 0.4s ease;
  filter: none;
}
.pdf-doc.scanning .pdf-scan {
  opacity: 1;
  animation: scan-line 1.5s linear infinite;
}
.pdf-doc.exploding {
  /* sharp end pose — never fade/blur */
  opacity: 1;
  top: 42px;
  transform: translateY(0) rotate(-1deg) scale(1);
  box-shadow: 8px 8px 0 #000;
  animation: none;
  filter: none;
}

@keyframes pdf-fly-in {
  0% {
    opacity: 0;
    top: -45%;
    transform: translateY(-90px) rotate(-10deg) scale(0.82);
  }
  60% {
    opacity: 1;
    top: 30px;
    transform: translateY(0) rotate(2deg) scale(1.03);
  }
  100% {
    opacity: 1;
    top: 42px;
    transform: translateY(0) rotate(-1.5deg) scale(1);
  }
}
@keyframes pdf-settle {
  0% { transform: translateY(0) rotate(-1.5deg) scale(1.02); }
  100% { transform: translateY(0) rotate(-1.5deg) scale(1); }
}

.pdf-fold {
  position: absolute;
  top: 0; right: 0;
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #e8e8e8 50%, #fff 50%);
  border-left: 1.5px solid #000;
  border-bottom: 1.5px solid #000;
}
.pdf-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 1px solid #000;
  padding: 2px 6px;
  margin-bottom: 10px;
}
.pdf-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin-bottom: 6px;
}
.pdf-meta {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 12px;
  word-break: break-all;
}
.pdf-page-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pdf-page-lines i {
  display: block;
  height: 3px;
  background: #e4e4e4;
}
.pdf-page-lines i:nth-child(odd) { width: 100%; }
.pdf-page-lines i:nth-child(even) { width: 78%; }
.pdf-page-lines i:nth-child(3) { width: 92%; background: #ccc; }
.pdf-page-lines i:nth-child(6) { width: 55%; }

.pdf-scan {
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: #000;
  opacity: 0;
  top: 20%;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0,0,0,0.35);
}
@keyframes scan-line {
  0% { top: 12%; }
  50% { top: 88%; }
  100% { top: 12%; }
}

/* ── Per-step stage scenes ──────────────────────────────── */
.pdf-doc-b {
  position: absolute;
  left: 50%;
  top: 56px;
  width: 120px;
  height: 170px;
  margin-left: -60px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 #000;
  padding: 12px 10px 10px;
  opacity: 0;
  transform: translateY(-60px) rotate(8deg) scale(0.85);
  z-index: 2;
  overflow: hidden;
  display: none;
}
.pdf-doc-b.fly-in-b {
  display: block !important;
  animation: pdf-fly-in-b 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.pdf-doc-b.landed {
  display: block !important;
  opacity: 1;
  transform: translateY(0) rotate(2deg) scale(1);
}
@keyframes pdf-fly-in-b {
  0% {
    opacity: 0;
    transform: translate(40px, -70px) rotate(12deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(2deg) scale(1);
  }
}

.pdf-cover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pdf-cover[hidden] { display: none !important; }
.pdf-cover-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9px;
  animation: cover-row-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.pdf-cover-row:nth-child(1) { animation-delay: 0.1s; }
.pdf-cover-row:nth-child(2) { animation-delay: 0.22s; }
.pdf-cover-row:nth-child(3) { animation-delay: 0.34s; }
.pdf-cover-row span {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.pdf-cover-row strong {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
@keyframes cover-row-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* OCR: sequential line flash */
.pdf-stage[data-scene="ocr"] .pdf-page-lines i {
  animation: ocr-line 1.8s ease-in-out infinite;
}
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(1) { animation-delay: 0s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(2) { animation-delay: 0.12s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(3) { animation-delay: 0.24s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(4) { animation-delay: 0.36s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(5) { animation-delay: 0.48s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(6) { animation-delay: 0.6s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(7) { animation-delay: 0.72s; }
.pdf-stage[data-scene="ocr"] .pdf-page-lines i:nth-child(8) { animation-delay: 0.84s; }
@keyframes ocr-line {
  0%, 100% { background: #e4e4e4; }
  40%, 55% { background: #111; }
}

.scene-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
}
.scene-chip {
  position: absolute;
  padding: 3px 7px;
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  animation: scene-chip-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes scene-chip-pop {
  from { opacity: 0; transform: scale(0.7) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* LV tree */
.scene-tree {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 168px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}
.scene-tree .t-row {
  border: 1.5px solid #000;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
  padding: 4px 6px;
  margin-bottom: 4px;
  opacity: 0;
  animation: tree-row-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.scene-tree .t-row:nth-child(1) { animation-delay: 0.05s; margin-left: 0; }
.scene-tree .t-row:nth-child(2) { animation-delay: 0.2s; margin-left: 10px; width: calc(100% - 10px); }
.scene-tree .t-row:nth-child(3) { animation-delay: 0.35s; margin-left: 20px; width: calc(100% - 20px); }
.scene-tree .t-row:nth-child(4) { animation-delay: 0.5s; margin-left: 20px; width: calc(100% - 20px); }
@keyframes tree-row-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Match columns */
.scene-match {
  position: absolute;
  inset: 12px 4px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}
.scene-match .col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.scene-match .col-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.scene-match .m-chip {
  border: 1.5px solid #000;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
  padding: 3px 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  animation: match-snap 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.scene-match .m-chip:nth-child(2) { animation-delay: 0.1s; }
.scene-match .m-chip:nth-child(3) { animation-delay: 0.2s; }
.scene-match .m-chip:nth-child(4) { animation-delay: 0.3s; }
.scene-match .m-chip.linked {
  background: #111;
  color: #fff;
}
@keyframes match-snap {
  0% { opacity: 0; transform: scale(0.8); }
  70% { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
.scene-match .bridges {
  position: absolute;
  left: 50%;
  top: 28px;
  bottom: 8px;
  width: 2px;
  background: #000;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  animation: bridge-grow 0.7s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes bridge-grow {
  to { transform: translateX(-50%) scaleY(1); }
}

/* Price deltas */
.scene-delta {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 190px;
}
.scene-delta .d-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1.5px solid #000;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  opacity: 0;
  animation: delta-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.scene-delta .d-row:nth-child(1) { animation-delay: 0.1s; }
.scene-delta .d-row:nth-child(2) { animation-delay: 0.22s; }
.scene-delta .d-row:nth-child(3) { animation-delay: 0.34s; }
.scene-delta .d-up { color: #cc0000; }
.scene-delta .d-down { color: #0a7a2f; }
@keyframes delta-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Terms cards */
.scene-terms {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 180px;
}
.scene-terms .term {
  border: 1.5px solid #000;
  background: #fff;
  box-shadow: 2px 2px 0 #000;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  animation: term-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.scene-terms .term:nth-child(1) { animation-delay: 0.08s; }
.scene-terms .term:nth-child(2) { animation-delay: 0.2s; }
.scene-terms .term:nth-child(3) { animation-delay: 0.32s; }
.scene-terms .term small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 9px;
  margin-top: 1px;
}
@keyframes term-slide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Wait step: clean SVG mail badge under dual PDFs (no X, no orbit junk) */
.scene-mail-badge {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #000;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
  padding: 6px 10px 6px 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  animation: mail-badge-float 2.2s ease-in-out infinite;
}
.scene-mail-badge svg {
  width: 28px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}
@keyframes mail-badge-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}
.pdf-stage[data-scene="wait_mail"] .pdf-doc,
.pdf-stage[data-scene="wait_mail"] .pdf-doc-b {
  animation: pdf-float-soft 2.6s ease-in-out infinite;
}

/*
 * Demo end = Split-Clock (chosen layout):
 * Left grey stage with dual PDFs + mail badge · Right: Fertig / Wartezeit / 30 Min / CTA
 */
.story-stage.is-split-end {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  gap: 0;
  max-width: 960px;
  align-items: stretch;
  border: 3px solid #000;
  box-shadow: 10px 10px 0 #000;
  background: #fff;
  overflow: hidden;
  padding: 0;
}
.story-stage.is-split-end .pdf-stage {
  width: 100%;
  height: auto;
  min-height: 320px;
  margin: 0;
  background: #f4f4f4;
  border-right: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 16px 48px;
  box-sizing: border-box;
}
.story-stage.is-split-end .pdf-drop-target {
  display: none !important;
}
/* Dual docs centered in left pane */
.story-stage.is-split-end[data-scene="wait_mail"] .pdf-doc,
.story-stage.is-split-end .pdf-doc {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
  width: 118px;
  height: 158px;
  transform: rotate(-3deg);
  opacity: 1;
  display: block;
  flex-shrink: 0;
  animation: none;
}
.story-stage.is-split-end .pdf-doc-b,
.story-stage.is-split-end[data-scene="wait_mail"] .pdf-doc-b {
  position: relative;
  left: auto;
  top: auto;
  margin: 0 0 0 -12px;
  width: 118px;
  height: 158px;
  transform: rotate(3deg);
  opacity: 1;
  display: block !important;
  flex-shrink: 0;
  animation: none;
}
.story-stage.is-split-end .pdf-stage {
  /* host becomes flex row for the two docs + badge via overlay */
}
.story-stage.is-split-end .scene-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  top: auto;
  height: auto;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.story-stage.is-split-end .scene-mail-badge {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  animation: mail-badge-float-split 2.2s ease-in-out infinite;
}
@keyframes mail-badge-float-split {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
/* Inner wrap: place both docs side by side — pdf-stage needs a row container.
   We use absolute positioning of docs relative to stage center. */
.story-stage.is-split-end .pdf-doc {
  position: absolute;
  left: calc(50% - 118px);
  top: 50%;
  margin-top: -90px;
  margin-left: 0;
}
.story-stage.is-split-end .pdf-doc-b {
  position: absolute;
  left: calc(50% - 8px);
  top: 50%;
  margin-top: -82px;
  margin-left: 0;
}
.story-stage.is-split-end .story-copy {
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
}
.story-stage.is-split-end .story-head-row {
  display: block;
  margin-bottom: 0;
}
.story-stage.is-split-end .story-head-main {
  background: transparent;
}
.story-stage.is-split-end .story-kicker {
  margin-bottom: 10px;
}
.story-stage.is-split-end .story-headline {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
/* body becomes the line under the big clock */
.story-stage.is-split-end .story-body {
  display: none;
}
.story-stage.is-split-end .demo-wait {
  margin: 0 0 16px;
  order: 0;
}
.story-stage.is-split-end .demo-clock-face {
  font-size: clamp(48px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}
.story-stage.is-split-end .demo-clock-meta {
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}
.story-stage.is-split-end .demo-clock-bar {
  max-width: 200px;
  height: 5px;
  margin-top: 12px;
  background: #eee;
}
.story-stage.is-split-end .demo-clock-bar i {
  background: #000;
}
/* CTA under clock — solid black like the chosen mock */
.story-stage.is-split-end .demo-reveal-slot {
  position: static !important;
  display: block !important;
  margin: 12px 0 0;
  opacity: 1 !important;
  transform: none !important;
  z-index: 2;
  pointer-events: auto;
  align-self: flex-start;
  transition: none;
}
.story-stage.is-split-end .demo-reveal-slot[hidden] {
  display: none !important;
}
.story-stage.is-split-end .demo-reveal-slot.is-in {
  opacity: 1 !important;
  transform: none !important;
}
.story-stage.is-split-end .demo-reveal-btn {
  min-width: 200px;
  min-height: 48px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #333;
}
/* Hide chrome on end screen */
.story-stage.is-split-end .story-loader,
.story-stage.is-split-end .story-steps,
.story-stage.is-split-end .progress,
.story-stage.is-split-end .story-file,
.story-stage.is-split-end .demo-reveal-hint,
.story-stage.is-split-end .compare-offer,
.story-stage.is-split-end .end-gallery-link {
  display: none !important;
}
/* Reorder: kicker+headline, then clock, then CTA — use flex on story-copy */
.story-stage.is-split-end .story-copy {
  display: flex;
  flex-direction: column;
}
.story-stage.is-split-end .story-head-row {
  order: 1;
}
.story-stage.is-split-end .demo-wait {
  order: 2;
}
.story-stage.is-split-end .demo-reveal-slot {
  order: 3;
}
/* Move CTA out of head-row visually: head-row only shows kicker+headline */
.story-stage.is-split-end .story-head-row .demo-reveal-slot {
  /* still inside head-row in DOM — pull it with grid on story-copy instead */
}
@media (max-width: 760px) {
  .story-stage.is-split-end {
    grid-template-columns: 1fr;
  }
  .story-stage.is-split-end .pdf-stage {
    border-right: 0;
    border-bottom: 2px solid #000;
    min-height: 260px;
  }
}

.story-copy { min-width: 0; }
.story-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  will-change: transform, opacity;
}
.story-headline {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 14px;
  will-change: transform, opacity;
}
.story-body {
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 36em;
  margin-bottom: 22px;
  will-change: transform, opacity;
}
.story-body strong { color: #000; font-weight: 600; }

/* Swipe R→L + exponential ease-out fade (no step checklist) */
.story-kicker,
.story-headline,
.story-body {
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Out: exit left + fade */
.story-kicker.swap-out,
.story-headline.swap-out,
.story-body.swap-out {
  opacity: 0;
  transform: translateX(-28px);
}
/* In: enter from right + fade (set before paint, then remove) */
.story-kicker.swap-in,
.story-headline.swap-in,
.story-body.swap-in {
  opacity: 0;
  transform: translateX(48px);
  transition: none;
}
.story-kicker.swap-in-active,
.story-headline.swap-in-active,
.story-body.swap-in-active {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Loading spinner under story copy */
.story-loader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  min-height: 28px;
}
.story-loader[hidden] {
  display: none !important;
}
.story-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #e5e5e5;
  border-top-color: #000;
  border-radius: 50%;
  animation: story-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.story-loader-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes story-spin {
  to { transform: rotate(360deg); }
}

/* Step list retired (kept in DOM for legacy live path, always hidden) */
.story-steps,
.story-steps[hidden] {
  display: none !important;
}
.story-file {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
}

/* Result banner */
.result-banner {
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: 20px;
  background: #fff;
}
.result-banner-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.result-banner-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 40em;
  line-height: 1.45;
}

.upload-field.drag-pulse {
  animation: drop-pulse 0.7s ease infinite;
  border-style: solid;
  background: #f5f5f5;
}
.upload-field.drag-pulse .mini-pdf {
  animation: mini-pdf-bounce 0.7s ease infinite;
}
@keyframes drop-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0.12); }
  50% { box-shadow: 0 0 0 12px rgba(0,0,0,0); }
}
@keyframes mini-pdf-bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* Ghost PDF that appears when dragging over empty hero */
.upload-field.dragover .upload-title::after {
  content: " — loslassen";
}

/* Toast + full-page drop */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(520px, 92vw);
  padding: 12px 16px;
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  border: 1px solid #000;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}
.toast.error { background: #fff; color: var(--danger); border-color: var(--danger); }
.toast.ok { background: #000; color: #fff; }

/* Default OFF — never leave this stuck on top of the UI */
.page-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(255,255,255,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.page-drop-overlay[hidden] {
  display: none !important;
}
/* Only while a file is being dragged over the window */
body.dragging-pdf .page-drop-overlay {
  display: flex;
}
.page-drop-card {
  border: 2px dashed #000;
  background: #fff;
  padding: 36px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 8px 8px 0 #000;
}
.page-drop-card strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.page-drop-card span {
  font-size: 13px;
  color: var(--muted);
}

/* Immo-style empty actions */
.empty-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(380px, 100%);
  margin: 28px auto 0;
}
.empty-actions .upload-hero {
  width: 100%;
  min-height: 180px;
}

.empty-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.empty-divider::before,
.empty-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}
.empty-divider span { flex-shrink: 0; }

/* Solid black demo CTA — same idea as Immo Studio */
.btn-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-demo:hover,
.btn-demo:focus-visible {
  background: #222;
  outline: none;
}
.btn-demo .demo-hint {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #bbb;
  font-family: var(--mono);
}


/* ── Live wait: subtle motion, never washed out ─────────── */
.pdf-doc.working,
.pdf-doc.pulse {
  opacity: 1;
  filter: none;
  box-shadow: 8px 8px 0 #000;
  animation: pdf-float-soft 2.6s ease-in-out infinite;
}
@keyframes pdf-float-soft {
  0%, 100% { transform: translateY(0) rotate(-1.5deg) scale(1); }
  50% { transform: translateY(-6px) rotate(-1deg) scale(1); }
}

/*
 * NPK chips: pop out of the PDF body, fan left/right, float UP.
 * Solid black/white the whole way — no washed-out pile under the doc.
 */
.wait-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
}
.wait-particles.hidden,
.pdf-stage[hidden] {
  display: none !important;
}
.story-stage:has(.pdf-stage[hidden]) {
  grid-template-columns: 1fr;
  max-width: 560px;
}
.wait-chip {
  position: absolute;
  left: calc(50% + var(--x, 0px));
  top: calc(48% + var(--y0, 0px));
  padding: 4px 8px;
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 2px 2px 0 #000;
  opacity: 0;
  z-index: 7;
  transform: translate(-50%, -50%) scale(0.7) rotate(var(--rot, 0deg));
  animation: chip-pop-rise 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}
@keyframes chip-pop-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.55) rotate(var(--rot, 0deg));
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--rot, 0deg));
  }
  72% {
    opacity: 1;
    transform: translate(
        calc(-50% + var(--drift, 0px)),
        calc(-50% - var(--rise, 118px))
      )
      scale(1)
      rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--drift, 0px)),
        calc(-50% - var(--rise, 138px))
      )
      scale(0.96)
      rotate(var(--rot, 0deg));
  }
}

.progress-bar.indeterminate {
  width: 40% !important;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}
.progress { overflow: hidden; }



/* ── Parallel compare offer (while first analyze runs) ── */
.compare-offer {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid #000;
  background: #fff;
  max-width: 36em;
}
.compare-offer[hidden] { display: none !important; }
.compare-offer-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.compare-offer-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.compare-offer-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
}
.compare-offer-jobs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
}
.compare-offer-jobs .job-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.compare-offer-jobs .job-status {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-offer-jobs .job-status.run { color: #000; }
.compare-offer-jobs .job-status.ok { color: var(--ok); }
.compare-offer-jobs .job-status.err { color: var(--danger); }
.compare-offer-drop {
  width: 100%;
  min-height: 110px !important;
  margin-bottom: 10px;
}
.compare-offer-skip {
  width: 100%;
  text-transform: none;
  font-weight: 500;
}

/* ── Live job status / logs ─────────────────────────────────── */
.view-job {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.job-panel {
  border: 1px solid #000;
  background: #fff;
  padding: 22px 22px 20px;
}
.job-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.job-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}
.job-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.job-sub {
  margin: 6px 0 0;
  color: #555;
  font-size: 14px;
}
.job-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.job-badge {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  border: 1px solid #000;
  padding: 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.job-badge-status[data-status="running"],
.job-badge-status[data-status="queued"] {
  background: #111;
  color: #fff;
}
.job-badge-status[data-status="done"] {
  background: #0a7a3e;
  color: #fff;
  border-color: #0a7a3e;
}
.job-badge-status[data-status="error"] {
  background: #b00020;
  color: #fff;
  border-color: #b00020;
}
.job-meta-row {
  margin-top: 14px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  color: #333;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.job-dot { color: #999; }
.job-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
}
.job-steps li {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid #ccc;
  color: #888;
  padding: 5px 8px;
  font-weight: 600;
}
.job-steps li.is-done {
  border-color: #000;
  color: #000;
  background: #f3f3f3;
}
.job-steps li.is-active {
  border-color: #000;
  color: #fff;
  background: #000;
}
.job-current {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid #000;
  background: #fafafa;
  font-size: 14px;
  line-height: 1.45;
  min-height: 1.4em;
}
.job-log-wrap {
  margin-top: 18px;
  border: 1px solid #000;
}
.job-log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #000;
  background: #f6f6f6;
  font-size: 12px;
}
.job-log {
  margin: 0;
  padding: 12px 12px 16px;
  max-height: min(52vh, 520px);
  overflow: auto;
  background: #0d0d0d;
  color: #e8e8e8;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.job-log .log-line { display: block; }
.job-log .log-ts { color: #888; }
.job-log .log-stage {
  display: inline-block;
  min-width: 4.6em;
  color: #7dd3fc;
  font-weight: 600;
}
.job-log .log-stage.xai { color: #fbbf24; }
.job-log .log-stage.json { color: #86efac; }
.job-log .log-stage.error { color: #f87171; }
.job-log .log-stage.done { color: #4ade80; }
.job-log .log-stage.email { color: #c4b5fd; }
.job-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.job-error {
  margin-top: 14px;
  color: #b00020;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Notify email (job status page) ─────────────────────────── */
.notify-email-field {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: left;
}
.job-notify-field {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border: 1px solid #000;
  background: #fafafa;
}
.job-notify-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.job-notify-row .notify-email-input {
  flex: 1 1 220px;
  min-width: 0;
}
.job-notify-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.notify-email-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 6px;
}
.notify-email-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #000;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #111;
}
.notify-email-input:focus {
  outline: 2px solid #000;
  outline-offset: 1px;
}
.notify-email-input.is-invalid {
  border-color: #b00020;
  background: #fff8f8;
}
.notify-email-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* ── Multi-job board ────────────────────────────────────────── */
.view-jobs { max-width: 960px; margin: 0 auto; padding: 28px 20px 64px; }
.jobs-panel { border: 1px solid #000; background: #fff; padding: 20px; }
.jobs-head {
  display: flex; justify-content: space-between; gap: 16px;
  align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px;
}
.jobs-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.jobs-table-wrap { overflow-x: auto; }
.jobs-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.jobs-table th, .jobs-table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e5e5;
  vertical-align: top;
}
.jobs-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #666;
}
.jobs-table .st {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.jobs-table .st.run { color: #000; }
.jobs-table .st.ok { color: #0a7a3e; }
.jobs-table .st.err { color: #b00020; }
.upload-multi-hint {
  margin: 8px 0 0; font-size: 12px; text-align: center;
}
.upload-multi-hint a { color: inherit; font-weight: 600; }

/* Single uploaded PDF — use full width */
.result-pdf-row.is-single {
  grid-template-columns: 1fr;
}
.result-pdf-row.is-single .demo-pdf-card:nth-child(2) {
  display: none !important;
}

/* ── Email gate (mandatory before analyze) ──────────────────── */
.view-email-gate {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.email-gate-panel {
  border: 1px solid #000;
  background: #fff;
  padding: 24px 22px;
}
.gate-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 18px;
}
.gate-slot {
  border: 1px solid #000;
  padding: 12px 14px;
  background: #fafafa;
}
.gate-slot-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 6px;
}
.gate-slot-body {
  font-size: 13px;
  font-family: var(--mono, ui-monospace, monospace);
  word-break: break-all;
  line-height: 1.4;
}
.gate-slot-body.gate-slot-empty {
  font-family: inherit;
}
.gate-slot-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.gate-slot-remove {
  flex-shrink: 0;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #fff;
  padding: 4px 8px;
  cursor: pointer;
}
.gate-slot-remove:hover { border-color: #000; }
.gate-add-b {
  width: 100%;
  text-transform: none;
  font-weight: 600;
  border-style: dashed !important;
}
.gate-slot-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
}
.email-gate-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.notify-email-input:read-only {
  background: #f5f5f5;
  color: #333;
}
