:root {
  --text: #19212e;
  --muted: #5e6b7e;
  --primary: #2f6bff;
  --primary-d: #1c52e0;
  --accent: #18c2c9;
  --success: #0f8a5f;
  --warn: #b5790a;
  --error: #d2453a;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(255, 255, 255, 0.7);
  --stroke: rgba(110, 125, 160, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 34px rgba(28, 40, 84, 0.10);
  --shadow-lg: 0 18px 54px rgba(28, 40, 84, 0.20);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  background:
    radial-gradient(1100px 720px at 8% -12%, #cfe0ff 0%, rgba(207, 224, 255, 0) 55%),
    radial-gradient(950px 650px at 102% -6%, #ffd9ec 0%, rgba(255, 217, 236, 0) 52%),
    radial-gradient(950px 760px at 50% 118%, #c9f6e6 0%, rgba(201, 246, 230, 0) 55%),
    linear-gradient(180deg, #eef2fb 0%, #f5f2fb 100%);
  background-attachment: fixed;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 23px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.success { color: var(--success); font-weight: 500; }
.error { color: var(--error); font-weight: 500; }

/* Glas-Oberflächen */
.panel, .card, .finding, .intent-card, .login-card, .form {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inset);
}
.panel { padding: 18px 20px; margin: 0 0 18px; }
.panel.nopad { padding: 0; overflow: hidden; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 60px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 6px 24px rgba(28, 40, 84, 0.07);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 9px; box-shadow: 0 3px 10px rgba(47, 107, 255, 0.35); flex: 0 0 auto; }
.brand-name { font-weight: 500; letter-spacing: -0.01em; font-size: 16px; color: var(--muted); }
.brand-name b { font-weight: 700; color: var(--text); }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 999px; font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.45); text-decoration: none; }
.topbar nav a.active { color: var(--primary-d); background: rgba(255, 255, 255, 0.7); box-shadow: var(--inset); }
.topbar .user { display: flex; gap: 12px; align-items: center; }
.topbar .who { color: var(--muted); font-size: 13.5px; }

.container { max-width: 1000px; margin: 0 auto; padding: 26px 22px 60px; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer;
  background: linear-gradient(180deg, #4c7cf0, var(--primary));
  color: #fff; border: 0; border-radius: 11px;
  padding: 10px 17px; font: 500 14.5px var(--font);
  box-shadow: 0 6px 16px rgba(59, 111, 224, 0.32), var(--inset);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(59, 111, 224, 0.4); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--glass-strong); color: var(--primary-d);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), var(--inset);
}
.btn.ghost:hover { background: #fff; }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; }
.exports { display: flex; gap: 8px; }
.cell-action { text-align: right; white-space: nowrap; }

/* Filterleiste (Läufe, Test-Intent, Lauf-Detail) */
.filterbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.filter-search {
  width: auto; min-width: 260px; flex: 1; max-width: 420px; margin: 0;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 11px; padding: 9px 13px;
}
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  cursor: pointer; border: 1px solid var(--glass-border); background: var(--glass-strong);
  color: var(--muted); border-radius: 999px; padding: 7px 14px; font: 500 13px var(--font);
  box-shadow: var(--inset); transition: background 0.15s, color 0.15s, transform 0.1s;
}
.chip:hover { transform: translateY(-1px); color: var(--text); }
.chip.active { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(47, 107, 255, 0.3); }
.filter-empty { margin-top: 14px; }

/* Sektions-Navigation im Lauf-Detail */
.subnav {
  position: sticky; top: 60px; z-index: 10; display: flex; gap: 6px; flex-wrap: wrap;
  margin: 10px 0 8px; padding: 8px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: var(--shadow);
}
.subnav a { color: var(--muted); padding: 6px 13px; border-radius: 999px; font-size: 13.5px; }
.subnav a:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); text-decoration: none; }
h2[id^="sec-"] { scroll-margin-top: 132px; }

/* Karten / Kennzahlen */
.cards { display: flex; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.card { padding: 18px 22px; min-width: 130px; }
.card-num { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; }
.card-label { color: var(--muted); font-size: 14px; }
.card.actions { flex-direction: column; gap: 8px; justify-content: center; align-items: stretch; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.tbl th { background: rgba(255, 255, 255, 0.55); font-weight: 600; color: #344055; }
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.45); }
.tbl tr:last-child td { border-bottom: 0; }
.cell-page { font-weight: 500; }

/* Status-Badges */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.running { background: rgba(59, 111, 224, 0.15); color: var(--primary-d); }
.badge.completed { background: rgba(15, 138, 95, 0.16); color: var(--success); }
.badge.failed { background: rgba(210, 69, 58, 0.15); color: var(--error); }
.badge.baseline { background: rgba(140, 90, 230, 0.16); color: #6b46c8; }

.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 3px 8px; border-radius: 7px; font-weight: 600; }
.code.ok { background: rgba(15, 138, 95, 0.15); color: var(--success); }
.code.warn { background: rgba(181, 121, 10, 0.16); color: var(--warn); }
.code.err { background: rgba(210, 69, 58, 0.15); color: var(--error); }

.summary { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; margin: 0; }
.summary dt { color: var(--muted); font-size: 14px; }
.summary dd { margin: 0; font-size: 14px; word-break: break-all; }

/* Live-Log */
.log {
  background: rgba(15, 20, 30, 0.92); color: #d7dee8; border-radius: var(--radius);
  padding: 14px 16px; max-height: 320px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.55;
  box-shadow: var(--shadow);
}
.log .log-warn { color: #f0c674; }
.log .log-error { color: #ff8a80; }

/* Formulare */
.form { padding: 20px; max-width: 680px; }
fieldset { border: 1px solid var(--stroke); border-radius: var(--radius-sm); margin: 0 0 18px; padding: 14px 16px; }
legend { font-weight: 600; padding: 0 6px; }
label { display: block; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid var(--stroke); border-radius: 10px; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.7); transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 111, 224, 0.18); background: #fff;
}
label.check input { width: auto; margin-top: 0; }
small { display: block; color: var(--muted); margin-top: 4px; }

/* Test-Intent-Board */
.intent-group { margin: 0 0 26px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 16px; }
.inline-check { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 14px; }
.inline-check input { width: auto; margin: 0; }
.intent-list { display: grid; gap: 16px; }
.intent-card { padding: 16px 18px; max-width: 820px; }
.intent-card.excluded { opacity: 0.6; }
.intent-head { display: flex; align-items: baseline; justify-content: space-between; }
.intent-head h3 { margin: 0; font-size: 16px; text-transform: capitalize; }
.intent-head .src { color: var(--muted); font-size: 12px; }
.intent-card .journey { margin: 6px 0; }
.intent-controls { display: flex; gap: 24px; align-items: center; margin: 8px 0; }
.intent-controls label { margin: 0; }
.intent-controls select { width: auto; }
.routes { margin: 6px 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; }
.route-shots, .shots { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.rs { width: 150px; margin: 0; }
.rs img { width: 100%; height: 96px; object-fit: cover; object-position: top;
  border-radius: 10px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.rs figcaption { margin-top: 4px; word-break: break-all; }

/* Befund-Karten */
.findings td { vertical-align: top; }
.finding { padding: 16px 18px; margin: 0 0 14px; border-left: 4px solid var(--stroke); }
.finding.b-hoch { border-left-color: var(--error); }
.finding.b-mittel { border-left-color: #e0a516; }
.finding.b-info { border-left-color: rgba(110, 125, 160, 0.4); }
.finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding-head strong { font-size: 15px; }
.finding-was { margin: 8px 0 2px; font-weight: 500; }
.finding-meta { font-size: 13px; margin-top: 6px; }

.sev { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.sev.hoch { background: rgba(210, 69, 58, 0.15); color: var(--error); }
.sev.mittel { background: rgba(181, 121, 10, 0.16); color: var(--warn); }
.sev.info { background: rgba(110, 125, 160, 0.16); color: var(--muted); }
.pages .sev { margin: 0 4px 3px 0; }

.vbadge { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.vbadge.id { background: rgba(15, 138, 95, 0.15); color: var(--success); }
.vbadge.ch { background: rgba(181, 121, 10, 0.16); color: var(--warn); }
.vbadge.ai-echt { background: rgba(210, 69, 58, 0.15); color: var(--error); }
.vbadge.ai-fehlalarm { background: rgba(15, 138, 95, 0.15); color: var(--success); }
.vbadge.ai-unklar { background: rgba(110, 125, 160, 0.16); color: var(--muted); }

/* Vorher/Nachher */
.ba { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.ba figure { margin: 0; width: 300px; max-width: 46%; }
.ba figcaption { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.ba img { width: 100%; height: 165px; object-fit: cover; object-position: top; cursor: zoom-in;
  border-radius: 12px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); transition: transform 0.15s; }
.ba img:hover { transform: scale(1.01); }

/* Visueller Klickpfad */
.pw-wrap { margin-top: 12px; }
.pw-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pathway { display: flex; align-items: flex-start; gap: 6px; overflow-x: auto; padding: 6px 2px; }
.pw-step { margin: 0; width: 128px; flex: 0 0 auto; text-align: center; }
.pw-step figcaption { margin-top: 4px; font-size: 11px; color: var(--muted); word-break: break-all; }
.pw-thumb img { width: 128px; height: 84px; object-fit: cover; object-position: top; cursor: zoom-in;
  border-radius: 10px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); transition: transform 0.15s; }
.pw-thumb img:hover { transform: scale(1.03); }
.pw-arrow { align-self: center; color: var(--primary); font-size: 20px; flex: 0 0 auto; padding-top: 24px; }
.pw-noimg { width: 128px; height: 84px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px dashed var(--stroke); color: var(--muted); font-size: 11px; background: rgba(255, 255, 255, 0.35); }
.weg summary { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Screenshot-Thumbnail in Tabelle */
.thumb img { width: 120px; height: 76px; object-fit: cover; object-position: top; cursor: zoom-in;
  border-radius: 9px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); transition: transform 0.15s; }
.thumb img:hover { transform: scale(1.04); }

/* Prompt + KI-Urteil */
.prompt-form { margin-top: 12px; border-top: 1px solid var(--stroke); padding-top: 10px; }
.prompt-form label { display: block; margin-bottom: 4px; }
.prompt-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-verdict { margin-top: 10px; padding: 10px 13px; border-radius: 11px; font-size: 14px; background: rgba(140, 90, 230, 0.1); }
.ai-verdict.v-echt { background: rgba(210, 69, 58, 0.12); }
.ai-verdict.v-fehlalarm { background: rgba(15, 138, 95, 0.13); }
.ai-verdict.v-unklar { background: rgba(110, 125, 160, 0.13); }

/* Screenshot-Galerie */
.area-title { text-transform: capitalize; }
.shot { display: block; width: 220px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--glass-border); background: var(--glass); box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.shot:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.shot img { display: block; width: 100%; height: 150px; object-fit: cover; object-position: top; }
.shot span { display: block; padding: 7px 10px; font-size: 12.5px; color: var(--muted); word-break: break-all; }

.next ol { padding-left: 20px; }
.next li { margin: 4px 0; }

/* Login */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { padding: 32px; width: 340px; }
.login-card h1 { font-size: 19px; text-align: center; margin-bottom: 18px; }
.login-card label { color: var(--text); }
.login-card button { width: 100%; margin-top: 6px; }

/* Anker-Hervorhebung */
:target { scroll-margin-top: 80px; }
.finding:target { outline: 2px solid var(--primary); }
tr:target { outline: 2px solid var(--primary); }

/* Klick-Pin am Pfad-Thumbnail */
.pw-step { position: relative; }
.pw-pin { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--primary); color: #fff; font: 700 11px var(--font);
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }

/* Lightbox / Carousel */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 28px; background: rgba(15, 20, 35, 0.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 92vw; }
.lb-imgwrap { position: relative; display: inline-block; line-height: 0; }
.lb-imgwrap img { max-width: 80vw; max-height: 82vh; width: auto; height: auto;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.5); box-shadow: var(--shadow-lg); background: #fff; }
.lb-pin { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 999px; background: var(--primary); color: #fff; font: 700 13px var(--font);
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.35); }
.lightbox-overlay figcaption { color: #eef; text-align: center; font-size: 13px; font-family: ui-monospace, monospace; }
.lb-nav { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 28px; line-height: 1;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background 0.15s; }
.lb-nav:hover { background: rgba(255, 255, 255, 0.32); }
.lightbox-close {
  position: fixed; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.2); color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
