:root {
  --bg: #070b14;
  --bg-2: #0a1120;
  --panel: rgba(17, 27, 47, 0.82);
  --panel-solid: #0f1729;
  --panel-2: #0b1424;
  --line: rgba(122, 152, 214, 0.16);
  --line-strong: rgba(122, 152, 214, 0.32);
  --text: #e8eefb;
  --muted: #8ea3c7;
  --faint: #5e7397;
  --accent: #5b8cff;
  --accent-2: #37e0c8;
  --violet: #8b7bff;
  --good: #3ddc97;
  --warn: #f5b544;
  --bad: #ff6b7d;
  --radius: 18px;
  --radius-sm: 12px;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(91, 140, 255, 0.13), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(55, 224, 200, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22314f; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2e4168; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 238px;
  flex: 0 0 238px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 18, 33, 0.9), rgba(7, 11, 20, 0.92));
  backdrop-filter: blur(14px);
  z-index: 20;
}

.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.9), rgba(139, 123, 255, 0.85));
  color: #fff; box-shadow: 0 8px 22px rgba(91, 140, 255, 0.35);
}
.logo-mark svg { width: 19px; height: 19px; }
.logo-text { font-size: 17px; font-weight: 750; letter-spacing: 0.02em; }
.logo-text em {
  font-style: normal; font-weight: 500; margin-left: 5px;
  background: linear-gradient(90deg, #7ea4ff, #37e0c8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.85; }
.nav-item:hover { background: rgba(91, 140, 255, 0.08); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.18), rgba(139, 123, 255, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.25);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 22%;
  width: 3px; height: 56%; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-item.active svg { opacity: 1; color: #8fb0ff; }

.sidebar-foot {
  margin-top: auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 10px 2px; color: var(--faint); font-size: 11.5px;
  border-top: 1px solid var(--line);
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.16);
}

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 34px 14px;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.92), rgba(7, 11, 20, 0.55));
  backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 21px; }
.page-sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.llm-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(15, 23, 41, 0.7);
  color: var(--muted); font-size: 12px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.llm-chip:hover { border-color: var(--line-strong); color: var(--text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.llm-chip.on .status-dot { background: var(--good); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18); }
.llm-chip.on { color: #b9f5d9; border-color: rgba(61, 220, 151, 0.35); }
.llm-chip.off .status-dot { background: var(--warn); }

.view {
  padding: 10px 34px 56px;
  width: 100%; max-width: 1320px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(19, 29, 52, 0.88), rgba(12, 19, 35, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  animation: rise 0.32s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.panel-title { font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
.panel-title .tick {
  width: 4px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.panel-sub { color: var(--faint); font-size: 12.5px; margin-top: 4px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 34px 36px;
  border-radius: 22px;
  border: 1px solid rgba(91, 140, 255, 0.25);
  background:
    radial-gradient(600px 260px at 85% -20%, rgba(55, 224, 200, 0.14), transparent 60%),
    radial-gradient(700px 320px at 8% 120%, rgba(139, 123, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #101a30, #0b1322);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: rise 0.32s ease both;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(122, 152, 214, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 152, 214, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(500px 260px at 70% 0%, #000, transparent 70%);
  pointer-events: none;
}
.hero h2 { font-size: 27px; line-height: 1.3; max-width: 640px; }
.hero h2 span {
  background: linear-gradient(90deg, #8fb0ff, #37e0c8 60%, #9df0e1);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 10px; max-width: 620px; font-size: 13.5px; }
.hero-form {
  position: relative; z-index: 1;
  display: flex; gap: 10px; margin-top: 22px; max-width: 760px;
}
.hero-form input { flex: 1; min-width: 0; }

/* ---------- Forms ---------- */
input[type="text"], input[type="password"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  background: #0a1322;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
input::placeholder, textarea::placeholder { color: #4d6183; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(91, 140, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.13);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.65; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; justify-content: space-between; gap: 8px; }
.field > label em { font-style: normal; color: var(--faint); font-weight: 400; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.hint a { color: #8fb0ff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; color: var(--muted); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 38px; height: 21px; border-radius: 999px; background: #1b2943;
  border: 1px solid var(--line-strong); position: relative; transition: all 0.2s ease; flex: 0 0 auto;
}
.toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #7b8fb3; transition: all 0.2s ease;
}
.toggle input:checked + .track { background: rgba(91, 140, 255, 0.35); border-color: rgba(91, 140, 255, 0.7); }
.toggle input:checked + .track::after { left: 19px; background: #bcd0ff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(22, 34, 58, 0.7);
  color: var(--text); font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { border-color: rgba(122, 152, 214, 0.55); background: rgba(30, 45, 76, 0.8); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  border: none; color: #fff;
  background: linear-gradient(135deg, #5b8cff, #7a6bff);
  box-shadow: 0 10px 26px rgba(91, 140, 255, 0.3);
}
.btn.primary:hover { background: linear-gradient(135deg, #6d9aff, #8879ff); box-shadow: 0 12px 30px rgba(91, 140, 255, 0.42); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #0a1322; border: 1px solid var(--line);
  border-radius: 12px; flex-wrap: wrap;
  scroll-margin-top: 96px;
}
.tab {
  padding: 7px 14px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: all 0.16s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: linear-gradient(135deg, rgba(91, 140, 255, 0.28), rgba(139, 123, 255, 0.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.3); }
.tab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 550;
  background: rgba(122, 152, 214, 0.12); color: var(--muted);
  border: 1px solid transparent;
}
.chip.pass, .chip.good { background: rgba(61, 220, 151, 0.12); color: #7df0bd; border-color: rgba(61, 220, 151, 0.25); }
.chip.warn { background: rgba(245, 181, 68, 0.12); color: #f7cb7e; border-color: rgba(245, 181, 68, 0.25); }
.chip.fail, .chip.bad { background: rgba(255, 107, 125, 0.12); color: #ff9aa7; border-color: rgba(255, 107, 125, 0.28); }
.chip.skip { background: rgba(122, 152, 214, 0.08); color: var(--faint); }
.chip.info { background: rgba(91, 140, 255, 0.14); color: #a9c1ff; border-color: rgba(91, 140, 255, 0.28); }
.chip.violet { background: rgba(139, 123, 255, 0.14); color: #c0b6ff; border-color: rgba(139, 123, 255, 0.28); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 9px; border-radius: 7px;
  background: rgba(122, 152, 214, 0.1); color: var(--muted);
}
.badge.done { background: rgba(61, 220, 151, 0.12); color: #7df0bd; }
.badge.running { background: rgba(91, 140, 255, 0.14); color: #a9c1ff; }
.badge.failed { background: rgba(255, 107, 125, 0.12); color: #ff9aa7; }
.badge.queued { background: rgba(245, 181, 68, 0.1); color: #f7cb7e; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: linear-gradient(180deg, rgba(19, 29, 52, 0.8), rgba(12, 19, 35, 0.9));
  border: 1px solid var(--line); border-radius: 15px;
  padding: 16px 18px; position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.16), transparent 70%);
}
.stat-label { font-size: 11.5px; color: var(--faint); letter-spacing: 0.02em; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.stat-value.good { color: #7df0bd; }
.stat-value.warn { color: #f7cb7e; }
.stat-value.bad { color: #ff9aa7; }
.stat-value.blue { color: #a9c1ff; }

/* ---------- Pipeline strip ---------- */
.pipeline-strip { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0; }
.pipe-step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 150px; }
.pipe-num {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
  background: rgba(91, 140, 255, 0.13); color: #a9c1ff;
  border: 1px solid rgba(91, 140, 255, 0.28);
}
.pipe-body { min-width: 0; }
.pipe-body strong { font-size: 13px; display: block; }
.pipe-body span { font-size: 11.5px; color: var(--faint); display: block; line-height: 1.45; }
.pipe-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(91, 140, 255, 0.4), rgba(55, 224, 200, 0.2)); margin: 0 12px; min-width: 14px; align-self: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; }
table.table th {
  text-align: left; font-size: 11.5px; font-weight: 550; color: var(--faint);
  padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table td { padding: 12px; border-bottom: 1px solid rgba(122, 152, 214, 0.08); font-size: 13px; vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: rgba(91, 140, 255, 0.035); }
.td-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-muted { color: var(--faint); font-size: 12px; }

/* ---------- Score ring ---------- */
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { position: relative; width: var(--size, 138px); height: var(--size, 138px); flex: 0 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .ring-bg { stroke: rgba(122, 152, 214, 0.12); }
.ring .ring-val { stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.ring-label strong { font-size: 30px; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--faint); }
.score-compare { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.score-arrow { color: var(--faint); font-size: 20px; }
.delta-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 650;
}
.delta-pill.up { background: rgba(61, 220, 151, 0.14); color: #7df0bd; }
.delta-pill.down { background: rgba(255, 107, 125, 0.14); color: #ff9aa7; }
.delta-pill.flat { background: rgba(122, 152, 214, 0.1); color: var(--muted); }
.score-side { display: flex; flex-direction: column; gap: 6px; }
.grade-big { font-size: 26px; font-weight: 750; }
.verdict { color: var(--muted); font-size: 12.5px; max-width: 360px; }

/* ---------- Dimension list ---------- */
.dimension-list { display: flex; flex-direction: column; gap: 13px; }
.dim-row { display: grid; grid-template-columns: 108px 1fr 82px; align-items: center; gap: 12px; }
.dim-label { font-size: 12.5px; color: var(--muted); }
.dim-bar { height: 8px; background: rgba(10, 19, 34, 0.9); border-radius: 999px; overflow: hidden; position: relative; }
.dim-marker {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: rgba(232, 238, 251, 0.75); transform: translateX(-1px);
}
.dim-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #5b8cff, #37e0c8);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.dim-fill.warn { background: linear-gradient(90deg, #f5b544, #f7cb7e); }
.dim-fill.bad { background: linear-gradient(90deg, #ff6b7d, #ff9aa7); }
.dim-score { font-size: 12px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.dim-score b { color: var(--text); font-size: 13px; }
.dim-delta { font-size: 11px; margin-left: 6px; }

/* ---------- Checks ---------- */
.checks { display: flex; flex-direction: column; }
.check-dim-title { font-size: 12.5px; color: var(--faint); margin: 18px 0 2px; display: flex; align-items: center; gap: 8px; }
.check-dim-title:first-child { margin-top: 0; }
.check-dim-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check-row {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 11px;
  padding: 11px 2px; border-bottom: 1px dashed rgba(122, 152, 214, 0.1);
  align-items: flex-start;
}
.check-row:last-child { border-bottom: none; }
.check-dot {
  width: 18px; height: 18px; border-radius: 6px; margin-top: 1px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
}
.check-dot.pass { background: rgba(61, 220, 151, 0.15); color: #7df0bd; }
.check-dot.warn { background: rgba(245, 181, 68, 0.15); color: #f7cb7e; }
.check-dot.fail { background: rgba(255, 107, 125, 0.14); color: #ff9aa7; }
.check-dot.skip { background: rgba(122, 152, 214, 0.08); color: var(--faint); }
.check-title { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-title .fix-tag {
  font-size: 10px; padding: 1px 7px; border-radius: 5px;
  background: rgba(55, 224, 200, 0.1); color: #7ce8d8; border: 1px solid rgba(55, 224, 200, 0.22);
  font-weight: 500;
}
.check-detail { font-size: 12px; color: var(--faint); margin-top: 3px; line-height: 1.6; }
.check-weight { font-size: 11px; color: var(--faint); white-space: nowrap; padding-top: 2px; }

/* ---------- Suggestions ---------- */
.suggestions { display: flex; flex-direction: column; gap: 10px; }
.suggestion {
  display: flex; gap: 13px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(10, 19, 34, 0.45);
}
.sug-rank {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 8px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  background: rgba(91, 140, 255, 0.14); color: #a9c1ff;
}
.sug-body strong { font-size: 13px; }
.sug-body p { font-size: 12px; color: var(--faint); margin-top: 2px; }
.sug-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- Job / stages ---------- */
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.job-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.job-head h3 { font-size: 15px; }
.stages { display: flex; list-style: none; margin: 0 0 18px; padding: 0; gap: 0; overflow-x: auto; }
.stage { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 118px; position: relative; }
.stage .stage-dot {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: #0a1322;
  display: grid; place-items: center; font-size: 10px; color: var(--faint);
  position: relative; z-index: 1; transition: all 0.25s ease;
}
.stage .stage-label { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.stage::after {
  content: ""; position: absolute; left: 22px; right: 8px; top: 11px; height: 1.5px;
  background: var(--line); z-index: 0;
}
.stage:last-child::after { display: none; }
.stage.done .stage-dot { border-color: rgba(61, 220, 151, 0.6); color: #7df0bd; background: rgba(61, 220, 151, 0.12); }
.stage.done::after { background: rgba(61, 220, 151, 0.35); }
.stage.done .stage-label { color: #9ad9bd; }
.stage.current .stage-dot {
  border-color: var(--accent); color: #cfe0ff; background: rgba(91, 140, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.14);
  animation: pulseDot 1.6s ease-in-out infinite;
}
.stage.current .stage-label { color: #bcd0ff; }
.stage.current::after { background: linear-gradient(90deg, rgba(91, 140, 255, 0.6), var(--line)); }
.stage.failed .stage-dot { border-color: rgba(255, 107, 125, 0.6); color: #ff9aa7; background: rgba(255, 107, 125, 0.1); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.12); }
  50% { box-shadow: 0 0 0 7px rgba(91, 140, 255, 0.05); }
}
.console {
  background: #050a13; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; max-height: 190px; overflow-y: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.8; color: #9db3d6;
}
.console .console-line { display: flex; gap: 10px; }
.console .console-time { color: #465a7d; flex: 0 0 auto; }
.console .console-msg { word-break: break-word; }

.progress-line { height: 4px; border-radius: 99px; background: #0a1322; overflow: hidden; margin: 14px 0 4px; }
.progress-line > div { height: 100%; background: linear-gradient(90deg, #5b8cff, #37e0c8); transition: width 0.4s ease; border-radius: 99px; }

/* ---------- Alerts / notes ---------- */
.alert { padding: 12px 15px; border-radius: 12px; font-size: 12.5px; border: 1px solid transparent; line-height: 1.65; }
.alert.bad { background: rgba(255, 107, 125, 0.08); border-color: rgba(255, 107, 125, 0.25); color: #ffb3bc; }
.alert.info { background: rgba(91, 140, 255, 0.08); border-color: rgba(91, 140, 255, 0.22); color: #b8caff; }
.alert.warn { background: rgba(245, 181, 68, 0.08); border-color: rgba(245, 181, 68, 0.22); color: #f7d79a; }
.alert a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: 12px; color: var(--faint); line-height: 1.65; display: flex; gap: 8px; align-items: flex-start; }
.note svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 3px; }

/* ---------- Report ---------- */
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.report-title { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.changes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.change-card {
  display: flex; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(10, 19, 34, 0.45);
}
.change-icon {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(55, 224, 200, 0.12); color: #7ce8d8;
}
.change-icon svg { width: 14px; height: 14px; }
.change-card strong { font-size: 12.5px; display: block; }
.change-card p { font-size: 11.5px; color: var(--faint); margin-top: 3px; line-height: 1.6; }

.pane { display: none; }
.pane.active { display: block; }
.code {
  background: #050a13; border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px; max-height: 430px; overflow: auto;
  font-family: var(--mono); font-size: 11.8px; line-height: 1.7;
  color: #b9cbe8; white-space: pre-wrap; word-break: break-word; margin: 0;
}
.download-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Plan cards ---------- */
.plan-list { display: flex; flex-direction: column; gap: 11px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: rgba(10, 19, 34, 0.45);
}
.plan-card h4 { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.plan-card .why { font-size: 12px; color: var(--faint); margin-top: 5px; }
.plan-card .example {
  margin-top: 9px; padding: 10px 12px; border-radius: 9px;
  background: #071020; border: 1px dashed rgba(122, 152, 214, 0.25);
  font-size: 12px; color: #a9bdd9; font-family: var(--mono); line-height: 1.65;
}

/* ---------- Visibility ---------- */
.vis-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 6px; }
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q-card { border: 1px solid var(--line); border-radius: 13px; background: rgba(10, 19, 34, 0.42); padding: 15px 17px; }
.q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.q-question { font-size: 13.5px; font-weight: 550; display: flex; gap: 9px; align-items: flex-start; }
.q-question .qidx {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; margin-top: 1px;
  display: grid; place-items: center; font-size: 10.5px;
  background: rgba(139, 123, 255, 0.14); color: #c0b6ff; font-weight: 650;
}
.q-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mention-yes { color: #7df0bd; }
.mention-no { color: #ff9aa7; }
.q-snippet { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.75; border-left: 2px solid rgba(91, 140, 255, 0.35); padding-left: 12px; }
.q-recs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rec-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(122, 152, 214, 0.09); color: var(--muted); }
.q-answer { margin-top: 10px; }
.q-answer summary { cursor: pointer; font-size: 12px; color: #8fb0ff; }
.q-answer .code { margin-top: 8px; max-height: 260px; }
.competitor-list { display: flex; flex-direction: column; gap: 10px; }
.comp-row { display: grid; grid-template-columns: 120px 1fr 34px; gap: 12px; align-items: center; }
.comp-name { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-bar { height: 7px; background: rgba(10, 19, 34, 0.9); border-radius: 99px; overflow: hidden; }
.comp-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(139, 123, 255, 0.8), rgba(91, 140, 255, 0.7)); }
.comp-count { font-size: 12px; color: var(--faint); text-align: right; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--faint); font-size: 13px; }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(91, 140, 255, 0.09); border: 1px solid rgba(91, 140, 255, 0.2);
  color: #8fb0ff;
}
.empty-icon svg { width: 24px; height: 24px; }
.empty strong { display: block; color: var(--muted); font-size: 14px; margin-bottom: 4px; font-weight: 550; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 26px; bottom: 26px; z-index: 100;
  padding: 12px 18px; border-radius: 12px;
  background: #15233d; border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  max-width: 420px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(61, 220, 151, 0.4); }
.toast.err { border-color: rgba(255, 107, 125, 0.4); }

/* ---------- Misc ---------- */
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--faint); }
.mono { font-family: var(--mono); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.right { margin-left: auto; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

@media (max-width: 1100px) {
  .stats, .vis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .changes { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0;
    flex-direction: row; align-items: center; gap: 6px;
    padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .logo { padding: 0 8px 0 0; }
  .logo-text { font-size: 15px; }
  .logo-mark { width: 30px; height: 30px; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1; gap: 2px; }
  .nav-item { padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .nav-item svg { width: 17px; height: 17px; }
  .sidebar-foot { display: none; }
  .topbar { padding: 14px 16px 10px; position: static; }
  .topbar h1 { font-size: 18px; }
  .page-sub { display: none; }
  .view { padding: 8px 16px 44px; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 21px; }
  .hero-form { flex-direction: column; }
  .panel { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .dim-row { grid-template-columns: 86px 1fr 70px; gap: 8px; }
  .comp-row { grid-template-columns: 90px 1fr 30px; }
  .ring { --size: 118px; }
  .ring-label strong { font-size: 25px; }
}

@media (max-width: 560px) {
  .stats, .vis-kpis { grid-template-columns: 1fr 1fr; }
  .top-actions .btn { display: none; }
  .score-compare { gap: 12px; }
  .stage { min-width: 96px; }
  .stage .stage-label { font-size: 10.5px; }
}

/* ---------- Scan compare / artifacts ---------- */
.scan-compare, #scanFiles { scroll-margin-top: 92px; }
.scan-compare .dimension-list { margin-top: 4px; }

/* ---------- Site health ---------- */
.site-health { scroll-margin-top: 92px; }
.health-list { display: flex; flex-direction: column; gap: 10px; }
.health-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(10, 17, 31, 0.5); }
.health-item > .chip { flex: none; margin-top: 2px; }
.health-body { flex: 1; min-width: 0; }
.health-body strong { font-size: 13.5px; }
.health-body p { color: var(--muted); font-size: 12.5px; margin: 4px 0 9px; }
.health-urls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.health-roadmap { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.roadmap-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; }
.roadmap-row + .roadmap-row { border-top: 1px dashed rgba(148, 163, 184, 0.12); }
.roadmap-label { flex: 1; min-width: 0; font-size: 12.5px; }
.roadmap-label em { display: block; color: var(--faint); font-style: normal; font-size: 11.5px; margin-top: 2px; }
.roadmap-score { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.roadmap-score b { color: var(--good); font-size: 13px; }
