/* Vispal Customer Platform — Freunde Messebau brand system.
   Light + dark themes (toggle in the header, saved in localStorage), a flat
   conventional card UI, and report-style KPI cards.
   Mobile-first, dependency-free. Mirrors the internal platform's look, tuned
   to the FM palette. */

/* ── Tokens: light is the default; dark + explicit light override it ────────── */
:root {
  --primary: #3b6ef0;        /* button base */
  --accent: #3b6ef0;         /* labels, links, section headers */
  --primary-ink: #fff;
  --primary-soft: #eef3fb;   /* pale KPI card fill */
  --ink: #1e2235;            /* headings + hero numbers (dark on light) */
  --bg: #f0f4fb;
  --surface: #ffffff;
  --text: #1e2235;
  --muted: #5a6a8a;
  --border: #d3dcee;
  --tile-border: #e6ecf8;
  --track: #dfe8f7;          /* bar / stepper-dot track */
  --dot-bg: #eef3fb;
  --green: #0ca30c;
  --amber: #b07800;
  --shadow: 0 1px 3px rgba(30, 34, 53, .06), 0 6px 20px rgba(30, 34, 53, .05);
  --shadow-lg: 0 12px 44px rgba(30, 34, 53, .20);
  --radius: 14px;
  --tap: 48px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4f7cff; --accent: #4f7cff; --primary-soft: rgba(70, 130, 240, .14);
    --ink: #e2e8f0; --bg: #0f1117; --surface: #1a1d27;
    --text: #e2e8f0; --muted: #8494b0; --border: #2e3250;
    --tile-border: #252943; --track: #2b3048; --dot-bg: #22263a;
    --green: #0ca30c; --amber: #fab219;
    --shadow: 0 1px 3px rgba(0, 0, 0, .30), 0 6px 20px rgba(0, 0, 0, .28);
    --shadow-lg: 0 12px 44px rgba(0, 0, 0, .60);
    color-scheme: dark;
  }
}
html[data-theme="dark"] {
  --primary: #4f7cff; --accent: #4f7cff; --primary-soft: rgba(70, 130, 240, .14);
  --ink: #e2e8f0; --bg: #0f1117; --surface: #1a1d27;
  --text: #e2e8f0; --muted: #8494b0; --border: #2e3250;
  --tile-border: #252943; --track: #2b3048; --dot-bg: #22263a;
  --green: #0ca30c; --amber: #fab219;
  --shadow: 0 1px 3px rgba(0, 0, 0, .30), 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .60);
  color-scheme: dark;
}
html[data-theme="light"] {
  --primary: #3b6ef0; --accent: #3b6ef0; --primary-soft: #eef3fb;
  --ink: #1e2235; --bg: #f0f4fb; --surface: #ffffff;
  --text: #1e2235; --muted: #5a6a8a; --border: #d3dcee;
  --tile-border: #e6ecf8; --track: #dfe8f7; --dot-bg: #eef3fb;
  --green: #0ca30c; --amber: #b07800;
  --shadow: 0 1px 3px rgba(30, 34, 53, .06), 0 6px 20px rgba(30, 34, 53, .05);
  --shadow-lg: 0 12px 44px rgba(30, 34, 53, .20);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
h1, h2, h3 { letter-spacing: -.01em; }

/* Buttons */
.btn {
  /* inline-flex so a link styled as a button (<a class="btn">) also honours
     width:100% (btn-block) and clips its ::after sheen — a bare inline <a>
     would shrink to its text and let the hover glow leak outside the box. */
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #0a63e6 0%, var(--primary) 100%);
  color: var(--primary-ink); border-color: transparent;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .28) 50%, transparent 60%);
  transition: transform .6s ease;
}
.btn-primary:hover { box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); transform: translateY(-1px); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Logo mark — CSS mask driven by the PNG's alpha channel, colour comes from
   the stylesheet so it stays legible in dark mode. The mask is an empty <i>,
   not a real <img>, so `width: auto` alone never sizes to the asset's shape —
   `aspect-ratio` (source PNG is 760x280, i.e. 19:7) is what makes width follow
   height correctly. Without it, a fixed square box just crops most of the
   mark's own transparent padding down to a sliver. */
.fm-logo {
  display: inline-block;
  aspect-ratio: 19 / 7;
  background: var(--accent);
  -webkit-mask: url("/static/freunde-logo.png") no-repeat left center / contain;
  mask: url("/static/freunde-logo.png") no-repeat left center / contain;
}
.brand-logo.fm-logo { height: 64px; width: auto; margin: 0 auto 14px; }
.topbar-logo.fm-logo { height: 44px; width: auto; }

/* Login */
.login-view {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(150deg, #4f7cff 0%, #3b6ef0 48%, #2451c4 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 26px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.brand-logo { height: 64px; width: auto; margin: 0 auto 14px; display: block; border-radius: 12px; }
.brand-sub { color: var(--muted); margin-bottom: 22px; font-size: .95rem; }
#login-form { text-align: left; }
#login-form label { display: block; font-size: .85rem; color: var(--muted); margin: 14px 0 6px; }
#login-form input {
  width: 100%; min-height: var(--tap); padding: 12px 14px; font-size: 1rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
}
#login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#login-form button { margin-top: 32px; }
.error { color: #dc2626; font-size: .9rem; margin-top: 12px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.topbar-brand { display: flex; align-items: center; gap: 11px; cursor: pointer; flex: 0 0 auto; }
.topbar-logo { height: 44px; width: auto; border-radius: 10px; }
.topbar-title {
  color: var(--ink); font-weight: 700;
  font-size: 1.05rem; white-space: nowrap; letter-spacing: -.01em;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }
.company-name { color: var(--muted); font-size: .9rem; max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header quick theme toggle — sun/moon swapped by data-theme, no JS icon logic. */
.theme-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--accent);
  cursor: pointer; transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.theme-btn:hover { background: var(--primary-soft); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 16%, transparent); }
.theme-btn:active { transform: scale(.95); }
.theme-btn .theme-ico { display: none; }
html[data-theme="dark"] .theme-btn .theme-ico-sun { display: block; }
html[data-theme="light"] .theme-btn .theme-ico-moon { display: block; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .theme-btn .theme-ico-sun { display: block; } }
@media (prefers-color-scheme: light) { html:not([data-theme]) .theme-btn .theme-ico-moon { display: block; } }

/* Header contact button — labelled so its purpose is obvious. */
.contact-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.contact-btn:hover { background: var(--primary-soft); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 16%, transparent); }
.contact-btn:active { transform: scale(.96); }

@media (max-width: 600px) {
  .topbar { gap: 12px; }
  .topbar-title, .company-name { display: none; }
  .contact-btn span { display: none; }
  .contact-btn { padding: 0; width: 40px; justify-content: center; }
}

.content { max-width: 920px; margin: 0 auto; padding: 20px 16px 40px; }
.section-h {
  color: var(--accent); font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 12px;
}
.back-btn { margin-bottom: 14px; padding-left: 4px; }

/* Projects list header — the first section heading, the "this refreshes itself"
   note, and the manual control. Baseline-aligned so the button reads as part of
   the heading row rather than a floating action; the .section-h margin is what
   sets the row's spacing, so it is not repeated here. */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.list-live { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.list-note { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.refresh-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.refresh-btn:hover { background: var(--primary-soft); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 16%, transparent); }
.refresh-btn:active { transform: scale(.96); }
.refresh-btn:disabled { cursor: default; opacity: .7; }
/* Spins only while a fetch is actually open. The request usually answers in
   well under a full turn, so this is a sign of life, not a progress bar. */
.refresh-btn.busy svg { animation: refresh-spin .9s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  /* The note is the first thing to go: the icon plus its label already say the
     list is refreshable, and the note repeats what the button implies. */
  .list-note { display: none; }
  .refresh-btn span { display: none; }
  .refresh-btn { padding: 0; width: 36px; justify-content: center; }
}

/* ── Embedded Vision dashboard ───────────────────────────────────────────────
   With a dashboard to show, the project page stops being a centred column of
   cards and becomes a frame around it: full width, full remaining height, and
   the dashboard scrolls inside itself so the page never grows a second
   scrollbar. --embed-top is the frame's measured distance from the top of the
   document, set in app.js on mount and on resize — the block above it is a
   different height on a phone, and taller again when a long project name
   wraps, so a hard-coded offset puts the bottom of the dashboard below the
   fold. The fallback covers only the instant before that measure runs. */
:root { --embed-top: 187px; }
body.vision-mode .content { max-width: none; padding: 0; }
/* The dashboard owns the viewport in this view, and the page footer's only
   link (Kontakt) is already in the header. Leaving it in costs an outer
   scrollbar under a frame that scrolls itself — two scrollbars, one page. It
   comes back on every other view. */
body.vision-mode .site-foot { display: none; }
body.vision-mode .detail-head { margin: 0; padding: 10px 16px 12px; }

.detail-head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; min-width: 0; max-width: 100%;
  /* Höhe und Schriftgrade ändern sich beim Einklappen; ohne Übergang springt
     der Rahmen darunter. */
  transition: padding .18s ease;
}
.detail-head-row > #detail-head { display: flex; align-items: flex-start; gap: 6px; min-width: 0; flex: 1 1 260px; }
.detail-head-row #detail-head h1, .detail-head-row .head-title { min-width: 0; }
.detail-actions { flex: 0 0 auto; padding-top: 2px; }
/* Der eigenständige Rückweg über dem Kopf entfällt, sobald er IM Kopf steht —
   sonst stünde er zweimal da und kostete die Zeile, die er sparen soll. */
body.vision-mode .back-btn { display: none; }

.vision-embed {
  /* The frame fills what is left of the viewport under the sticky header, the
     back link and the project title block. */
  height: calc(100dvh - var(--embed-top));
  /* A floor, but never one that exceeds the space actually available: a long
     project name (production names run to "MEYLE_AG_Automechanika_Frankfurt_
     2026-09-08") wraps the title over three lines on a small phone, and a fixed
     420px floor would then push the frame past the fold and produce the second
     scrollbar this layout exists to avoid. */
  min-height: min(420px, 60dvh);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.vision-frame { display: block; width: 100%; height: 100%; border: 0; }

/* Offered, never forced: a newer analysis exists. Sits in the header row beside
   the PDF action — deliberately not floating over the frame, which has its own
   drawer and overlay panels this could never be pushed behind. */
.vision-refresh {
  margin-right: 10px; padding: 8px 14px;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--primary-soft); color: var(--accent);
  font: 600 .85rem/1 var(--font); cursor: pointer; white-space: nowrap;
}
.vision-refresh:hover { background: var(--accent); color: var(--primary-ink); }

/* Analysis is on, but has not produced its first dashboard yet. */
.vision-panel {
  margin: 22px 0 0; padding: 26px 22px;
  background: var(--surface); border: 1px solid var(--tile-border);
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: center;
}
.vision-panel-mark {
  width: 38px; height: 38px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--track); border-top-color: var(--accent);
  animation: vision-spin 1.1s linear infinite;
}
@keyframes vision-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .vision-panel-mark { animation: none; border-top-color: var(--accent); }
}
.vision-panel h2 {
  font-size: 1.15rem; font-weight: 800; color: var(--ink); margin-bottom: 8px;
}
.vision-panel p { color: var(--muted); max-width: 52ch; margin: 0 auto; }
.vision-panel-note { margin-top: 10px !important; font-size: .9rem; }

/* Project cards */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card-company {
  margin: 0 0 2px; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent);
}
@media (min-width: 680px) { .card-grid { grid-template-columns: 1fr 1fr; } }

/* Auf dem Telefon zählt jede Zeile über dem Dashboard. */
@media (max-width: 600px) {
  body.vision-mode .detail-head { padding: 8px 12px 10px; }
  /* Das interne Vorschauband steht ÜBER der Kundenseite und darf ihr auf einem
     390-px-Schirm nicht zwei Zeilen wegnehmen. */
  .review-ribbon { margin-bottom: 10px; padding: 7px 12px; font-size: .78rem; gap: 6px; }
  /* "· aktualisiert automatisch" steht im Dashboard darunter noch einmal und
     brach die Meta-Zeile auf 390 px in zwei. */
  .head-meta .meta-auto { display: none; }
  .detail-head-row { gap: 10px; }
  .head-meta { font-size: .8rem; }
  /* Die Aktionen rutschen neben den Titel statt darunter — bei zwei Elementen
     (PDF, ggf. "Neue Auswertung laden") passt das auch auf 320 px. */
  .detail-actions { padding-top: 0; }
}
.pcard {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .06s ease, box-shadow .18s ease, border-color .18s ease;
}
.pcard:active { transform: scale(.99); }
.pcard:hover { border-color: var(--accent); box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 16%, transparent); transform: translateY(-3px); }
.pcard h3 { margin: 0 0 8px; font-size: 1.12rem; color: var(--ink); }
.pcard .meta { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); padding: 14px 2px; }

/* Status pill */
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill.waiting { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.pill.processing { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); }
.pill.completed { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green); }
.pill.testphase { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); margin-left: 8px; }

/* Detail — der Kopf über dem Dashboard.
   Er trug einmal eine dreizeilige Überschrift ("MEYLE AG – Automechanika
   Frankfurt 2026"), darunter den Zeitraum doppelt ("05.09.2026 – 05.09.2026"),
   darunter den Stand, darunter die PDF-Schaltfläche: auf einem iPhone 13
   waren das 59 % des Schirms, bevor das Dashboard anfing. Jetzt: Firma klein
   darüber, Messe als Überschrift, alles Übrige in EINER Zeile — und beim
   Scrollen faltet er sich zu einer Zeile zusammen (.compact). */
.detail-head { margin-bottom: 18px; }
.detail-head h1 {
  font-size: clamp(1.15rem, 4.2vw, 1.6rem); line-height: 1.22;
  margin: 0; color: var(--ink); font-weight: 800; overflow-wrap: anywhere;
}
.head-title { min-width: 0; }
.head-company {
  margin: 0 0 3px; font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent);
}
/* Die Rechtsform gehört zum Namen, ist aber keine Information, die groß
   gesetzt gehört — sie steht wie ein Zusatzzeichen daneben. */
.head-company .legal, .card-company .legal {
  font-size: .72em; font-weight: 600; letter-spacing: .02em; opacity: .7; margin-left: .3em;
}
.head-meta { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.detail-head .dates { color: var(--muted); }
.live-status { color: var(--muted); font-size: .85rem; margin-top: 4px; }
/* Der Rückweg sitzt im Kopf, nicht in einer eigenen Zeile darüber: eine Zeile
   weniger über dem Dashboard, und der Daumen findet ihn oben links. */
.head-back {
  flex: 0 0 auto; width: 36px; height: 36px; margin-right: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); font-size: 1.1rem; line-height: 1; cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.head-back:hover { background: var(--primary-soft); }
.head-back:active { transform: scale(.94); }
/* Der eingeklappte Zustand: nur noch Rückweg und Messename, mit Auslassung
   statt Umbruch. Zeitraum und Stand fallen weg (beides steht im Dashboard
   selbst noch einmal), die Firma steht in der Kopfleiste und der PDF-Knopf in
   der Leiste des Dashboards — es bleibt eine schmale Zeile. */
.detail-head-row.compact { padding-top: 0; padding-bottom: 2px; }
.detail-head-row.compact .head-title {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
}
/* Schrumpfbar, nicht nur kurz: "Internationale Messebau und
   Ausstellungstechnik GmbH & Co. KG" schob die eingeklappte Zeile sonst auf
   501 px und damit den ganzen Kundenbereich seitlich aus dem Schirm
   (gemessen 2026-09-06 auf 390 px). */
.detail-head-row.compact .head-company {
  /* Nicht schrumpfen, nur deckeln: der Firmenname ist kurz und soll GANZ
     dastehen ("MEYLE AG", nicht "MEY…"); die Überschrift daneben ist die
     lange und kürzt sich selbst. Der Deckel fängt den Ausreißer ab —
     "Internationale Messebau … GmbH & Co. KG" schob die Zeile sonst auf
     501 px (gemessen 2026-09-06 auf 390 px). */
  margin: 0; font-size: .72rem; white-space: nowrap; flex: 0 0 auto;
  min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis;
}
.detail-head-row.compact h1 {
  font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.detail-head-row.compact .head-meta { display: none; }
.detail-head-row.compact .pill.testphase { display: none; }
.detail-head-row.compact .head-back { width: 32px; height: 32px; font-size: 1rem; }
/* Eingeklappt darf nichts mehr umbrechen — sonst gewinnt der Kopf die Zeile
   zurück, die er gerade abgegeben hat. */
.detail-head-row.compact { flex-wrap: nowrap; align-items: center; }
.detail-head-row.compact .detail-actions { padding-top: 0; }
/* Die Rechtsform und der Testphase-Hinweis sitzen auf der Firmenzeile: der
   Hinweis kostete als Anhängsel der Überschrift eine eigene Zeile. */
/* Der Testphase-Hinweis steht in der Meta-Zeile, wo neben dem Datum Platz
   ist — an der Überschrift hängend brach er auf dem Telefon in eine eigene
   Zeile um. */
.head-meta .pill.testphase, .pcard .meta .pill.testphase {
  margin-right: 8px; vertical-align: baseline; white-space: nowrap;
}

/* Pipeline stepper */
.stepper {
  display: flex; flex-direction: column; gap: 0; margin: 20px 0;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px; display: grid; place-items: center;
  background: var(--dot-bg); color: var(--muted); font-size: .78rem; font-weight: 700; border: 2px solid var(--border);
}
.step.done .dot { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.current .dot { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse 2.2s ease-in-out infinite; }
.step .label { font-size: .95rem; }
.step.upcoming .label { color: var(--muted); }
.stepper-caption { text-align: center; color: var(--muted); font-size: .9rem; margin: -8px 0 16px; }
.step.current .label { font-weight: 700; color: var(--ink); }
@media (min-width: 680px) {
  .stepper { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .step { flex-direction: column; text-align: center; gap: 8px; flex: 1; }
  .step .label { font-size: .78rem; }
}

/* Metric tiles — report-style KPIs */
.tiles { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
@media (min-width: 520px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 60%, transparent), color-mix(in srgb, var(--primary-soft) 88%, transparent));
  border: 1px solid var(--tile-border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 14%, transparent); }
.tile .k { color: var(--accent); font-size: .9rem; font-weight: 700; }
.tile .v { font-size: 2.3rem; font-weight: 800; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile-stat { display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; min-height: 128px; }
.tile-stat .v { font-size: 2.7rem; margin-top: 10px; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; }
.bar-name { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--track); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill {
  width: var(--w, 0%); height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #0a63e6, #0052CC);
  transform-origin: left; animation: grow .7s cubic-bezier(.22, .61, .36, 1) both;
}
.bar-val { font-weight: 700; font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Footer */
.site-foot {
  max-width: 920px; margin: 8px auto 0; padding: 22px 16px 30px;
  border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 14px;
  align-items: center; justify-content: space-between; color: var(--muted); font-size: .8rem;
}
.site-foot a { color: var(--accent); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* Toasts */
.toasts { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: .9rem; box-shadow: var(--shadow-lg); color: var(--text); }
.toast.error { border-color: #dc2626; color: #dc2626; }

/* Dialogs */
.modal-overlay { position: fixed; inset: 0; background: rgba(8, 20, 44, .55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; opacity: 0; transition: opacity .18s ease; }
.modal-overlay.open { opacity: 1; }
.modal {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-lg); text-align: center; color: var(--text);
  transform: translateY(8px) scale(.98); transition: transform .22s cubic-bezier(.22, .61, .36, 1);
}
.modal-overlay.open .modal { transform: none; }
.modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.modal-msg { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }

/* Contact card — report closing-page treatment: blue ground, white type. */
.modal-contact {
  max-width: 420px; padding: 30px 26px; text-align: left; color: #fff; border-color: transparent;
  background: linear-gradient(150deg, #0a63e6 0%, #0052CC 52%, #003a99 100%);
}
.ct-hero { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin-bottom: 22px; }
.ct-label { font-size: 1.02rem; margin-bottom: 8px; }
.ct-person { display: flex; flex-direction: column; gap: 3px; margin-bottom: 22px; }
.ct-name { font-weight: 700; margin-bottom: 2px; }
.ct-line { color: rgba(255, 255, 255, .9); text-decoration: none; font-size: .95rem; min-height: 28px; display: flex; align-items: center; }
.ct-line:hover { color: #fff; text-decoration: underline; }
.ct-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .22); margin-bottom: 20px; }
.ct-foot-item { display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, .88); text-decoration: none; font-size: .82rem; }
.ct-foot-item svg { opacity: .85; flex: 0 0 auto; }
.ct-foot-item:hover { color: #fff; }
.ct-close {
  width: 100%; min-height: var(--tap); border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .12);
  color: #fff; font-size: 1rem; font-weight: 600; transition: background .15s ease;
}
.ct-close:hover { background: rgba(255, 255, 255, .2); }

/* Accent selection + slim branded scrollbar */
::selection { background: color-mix(in srgb, var(--accent) 85%, transparent); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }

/* Entrance reveals */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 8%, transparent); }
}
.pcard, .tile { animation: rise .45s ease both; }
.pcard:nth-child(2), .tile:nth-child(2) { animation-delay: .06s; }
.pcard:nth-child(3), .tile:nth-child(3) { animation-delay: .12s; }
.pcard:nth-child(4), .tile:nth-child(4) { animation-delay: .18s; }
.pcard:nth-child(n+5) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body::before { animation: none; }
  .pcard:hover, .tile:hover, .btn-primary:hover { transform: none; }
}

/* ── Release layer (2026-09-06) ────────────────────────────────────────────
   Three pieces: the internal review ribbon, the maintenance banner a paused
   project shows, and the statement card that stands in for the numbers while
   an analysis is still in Vorbereitung. */

/* The ribbon is the one element on this portal that is NOT for the customer.
   It reads as an annotation over the page rather than part of it — full-bleed
   tint, small caps tag, no card shadow — so a reviewer can never mistake it
   for something the customer is looking at. */
.review-ribbon {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 9px 14px;
  border: 1px dashed color-mix(in srgb, var(--amber) 55%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  color: var(--ink); font-size: .85rem;
}
.review-ribbon-tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber);
}
.review-ribbon-text { color: var(--muted); }

/* Maintenance notice for a paused project. Deliberately quiet — nothing is
   wrong and nothing has been taken away, so it must not look like a warning. */
.notice-banner {
  margin: 0 0 16px; padding: 11px 15px; border-radius: var(--radius);
  border: 1px solid var(--tile-border);
  background: var(--primary-soft); color: var(--muted); font-size: .88rem;
}

/* The statement that replaces the numbers while an analysis is in preparation.
   Same visual family as .vision-panel (the other "this will fill in by itself"
   state) so the two read as one idea rather than two different apologies. */
.statement-card {
  margin-top: 22px; padding: 26px 24px; border-radius: var(--radius);
  border: 1px solid var(--tile-border); background: var(--surface);
  box-shadow: var(--shadow); text-align: center;
}
.statement-mark {
  width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--primary-soft);
  animation: pulse 2.6s ease-in-out infinite;
}
.statement-card p {
  margin: 0 auto; max-width: 54ch; color: var(--muted); font-size: .98rem; line-height: 1.6;
}
/* The pill a card in preparation wears: it names the pipeline STEP, so it must
   not borrow waiting/processing/completed's colours, which mean something else. */
.pill.preparing {
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.card-statement { color: var(--muted); font-size: .85rem; margin-top: 10px; line-height: 1.5; }
/* Staff-only line on a card: whose project, and which release. */
.card-staff {
  color: var(--muted); font-size: .78rem; margin: -2px 0 6px;
  letter-spacing: .02em;
}
.company-group { grid-column: 1 / -1; }
.company-group-h {
  margin: 18px 0 10px; font-size: .82rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}

/* Hinweis statt Anmeldeformular unter /vorschau (2026-09-07). */
.vorschau-hinweis { margin: 8px 0 4px; font-weight: 600; }
.vorschau-hinweis-klein { margin: 0; font-size: 13px; color: var(--muted, #667); line-height: 1.5; }
