/* GitPulse workspace UI — GitLab brand theme (about.gitlab.com style) */

:root {
  --page: #fdfbf9;
  --page-soft: #fffaf6;
  --surface: #ffffff;
  --surface-muted: #faf8f6;
  --surface-warm: #fff5ee;
  --ink: #171321;
  --ink-soft: #3a3540;
  --muted: #615d66;
  --muted-warm: #7a5c4a;
  --border: #e7e4e1;
  --border-warm: #f0ddcd;
  --purple: #c2410c;
  --purple-soft: #fff0e7;
  --purple-border: #f8d3bb;
  --gitlab-orange: #fc6d26;
  --gitlab-red: #e24329;
  --gitlab-amber: #fca326;
  --cyan: #0e7490;
  --cyan-soft: #e6f7fb;
  --green: #047857;
  --green-soft: #e9f8ef;
  --amber: #a97935;
  --amber-soft: #fff4d7;
  --rose: #be123c;
  --rose-soft: #fff1f2;
  --code-bg: #171321;
  --code-surface: #110d1a;
  --code-text: #ece9f1;
  --shadow: 0 18px 48px rgba(23, 19, 33, 0.08);
  --shadow-soft: 0 10px 26px rgba(23, 19, 33, 0.06);
  --radius: 16px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body.pulse-dark {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 560px at 92% -4%, rgba(252, 109, 38, 0.18), transparent 62%),
    radial-gradient(820px 540px at 70% 12%, rgba(252, 163, 38, 0.1), transparent 60%),
    radial-gradient(760px 560px at -6% 104%, rgba(226, 67, 41, 0.12), transparent 60%),
    radial-gradient(640px 460px at 8% 86%, rgba(236, 72, 153, 0.07), transparent 60%),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  padding: 20px;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(252, 109, 38, 0.32);
  outline-offset: 2px;
}

code,
.font-mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

.hackathon-banner {
  width: min(1440px, 100%);
  margin: 0 auto 14px;
  padding: 9px 14px;
  border: none;
  border-radius: 12px;
  background:
    radial-gradient(420px 120px at 96% 50%, rgba(110, 73, 203, 0.55), transparent 70%),
    linear-gradient(90deg, #1f1733, #2a1a45 55%, #171321);
  color: #efe9fb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}

.pulse-header {
  width: min(1440px, 100%);
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.laser-cyan {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gitlab-red), var(--gitlab-orange) 55%, var(--gitlab-amber));
  box-shadow: 0 10px 22px rgba(252, 109, 38, 0.32);
  flex: 0 0 auto;
  position: relative;
}

.laser-cyan::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 5px;
}

.logo-text {
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--ink);
}

.logo-text span,
.logo-text strong {
  color: var(--purple);
}

.badge-tag {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-tabs .btn-primary,
.workspace-tabs .btn-secondary {
  min-width: 126px;
}

.theme-toggle {
  min-width: 76px !important;
}

.btn-primary,
.btn-scan-all,
.btn-mr-submit,
.btn-secondary {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.btn-primary,
.btn-scan-all,
.btn-mr-submit {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(23, 19, 33, 0.18);
}

.btn-primary:hover,
.btn-scan-all:hover,
.btn-mr-submit:hover {
  transform: translateY(-1px);
  background: #2c2438;
  border-color: #2c2438;
  box-shadow: 0 14px 24px rgba(23, 19, 33, 0.26);
}

.btn-secondary {
  background: #fff;
  color: var(--ink-soft);
  border-color: #cfcbd4;
  border-radius: 999px;
}

.btn-secondary:hover {
  background: var(--surface-muted);
  border-color: var(--purple-border);
  color: var(--purple);
}

.user-connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.glassmorphic {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.container,
.pulse-grid,
.pulse-footer {
  width: min(1440px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.workspace-page {
  width: 100%;
}

.workspace-page:not(.active) {
  display: none;
}

.auth-shell {
  margin-bottom: 16px;
  padding: 20px;
  background:
    radial-gradient(560px 260px at 96% 0%, rgba(252, 109, 38, 0.14), transparent 65%),
    radial-gradient(420px 240px at 78% 100%, rgba(252, 163, 38, 0.1), transparent 65%),
    radial-gradient(380px 220px at 0% 100%, rgba(236, 72, 153, 0.06), transparent 65%),
    rgba(255, 255, 255, 0.94);
}

.auth-intro,
.demo-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-intro {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.auth-intro h2 {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0 6px;
}

.demo-toolbar h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.auth-shell .user-gitlab-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-shell .user-gitlab-copy {
  max-width: 760px;
}

.auth-shell .user-gitlab-actions.hidden,
.auth-shell .user-gitlab-connected.hidden {
  display: none !important;
}

.auth-shell #userGitLabUnauthed.user-gitlab-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.auth-shell .user-gitlab-connected {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(320px, 1fr);
  grid-template-areas:
    "identity label"
    "identity select"
    "identity actions";
  align-items: start;
  gap: 8px 16px;
}

.auth-shell .user-gitlab-connected .real-label {
  grid-area: label;
}

.auth-shell .user-project-select {
  grid-area: select;
  width: 100%;
  max-width: 560px;
}

.auth-shell .user-gitlab-connected .user-gitlab-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 700px;
}

.auth-shell .user-gitlab-connected .user-gitlab-actions > * {
  width: 100%;
  min-width: 0;
}

.auth-shell .user-gitlab-identity {
  grid-area: identity;
}

.demo-toolbar {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.demo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pulse-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
  gap: 16px;
  margin-bottom: 16px;
}

.grid-card {
  min-width: 0;
  min-height: 650px;
  max-height: 78vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.card-header,
.real-case-header,
.risk-dash-header,
.judge-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-header h2,
.real-case-header h2,
.risk-dash-header h2,
.judge-header h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--ink);
}

.section-desc {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.engine-badge,
.status-val,
.risk-badge-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--purple-border);
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  white-space: nowrap;
}

.engine-badge[data-tone="pass"],
.status-val.pass {
  background: var(--green-soft);
  border-color: #b7e4c7;
  color: var(--green);
}

.engine-badge[data-tone="warn"],
.status-val.warn {
  background: var(--amber-soft);
  border-color: #f1d58b;
  color: #8a5b12;
}

.status-val.error {
  background: var(--rose-soft);
  border-color: #fecdd3;
  color: var(--rose);
}

.status-val.neutral {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--muted);
}

.matrix-status[data-tone="pass"] {
  color: var(--green);
}

.matrix-status[data-tone="warn"] {
  color: #8a5b12;
}

.agent-stage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.agent-stage-strip span {
  min-width: 0;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 8px;
}

.agent-stage-strip span.firing {
  color: var(--purple);
  border-color: var(--purple-border);
  background: var(--purple-soft);
}

.agent-stage-strip span.done {
  color: var(--green);
  border-color: #b7e4c7;
  background: var(--green-soft);
}

.agent-stage-strip span.done::after {
  content: " ok";
  font-weight: 800;
}

.file-inspector-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.file-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-dropdown label,
.real-label,
.spec-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.styled-select,
.real-question-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
}

.styled-select {
  max-width: 100%;
}

.real-question-input {
  resize: vertical;
  min-height: 82px;
  margin: 8px 0 14px;
  line-height: 1.45;
}

.terminal-screen {
  height: 158px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #1f2937;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-text);
}

.term-line {
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.term-line.system { color: var(--gitlab-amber); }
.term-line.info { color: #cbd5e1; }
.term-line.warning { color: #fbbf24; }
.term-line.critical { color: #fb7185; }

.code-view-container {
  min-width: 0;
  min-height: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.code-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-pre-block {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 14px;
  background: var(--code-surface);
  color: var(--code-text);
  font-size: 12px;
  line-height: 1.52;
}

.vuln-highlight {
  background: rgba(244, 63, 94, 0.18);
  border-left: 3px solid #fb7185;
  padding-left: 5px;
}

.secret-highlight {
  background: rgba(251, 191, 36, 0.2);
  border-left: 3px solid #f59e0b;
  padding-left: 5px;
}

.gemini-insight-box,
.patch-actions-wrapper,
.real-summary-box,
.user-gitlab-card,
.real-plan-box,
.compliance-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 12px;
}

.gemini-insight-box {
  margin-bottom: 12px;
  max-height: 240px;
  overflow: auto;
  flex: 0 0 auto;
}

.findings-tools {
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}

.real-findings-tools {
  margin-bottom: 0;
}

.findings-tools label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.issue-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.issue-search-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
}

.issue-search-count {
  min-width: 128px;
  text-align: center;
  border: 1px solid var(--purple-border);
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.issue-hidden {
  display: none !important;
}

.issue-search-empty {
  margin-top: 10px;
  flex: 0 0 auto;
}

.insight-kicker,
.real-case-kicker,
.real-pack-header code,
.matrix-tool {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.insight-copy,
.insight-markdown {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}

.insight-markdown pre,
.insight-markdown code,
.insight-copy pre,
.insight-copy code {
  display: block;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.insight-note {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insight-action-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.detail-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.detail-box-head label {
  margin-bottom: 0 !important;
}

.detail-expand-btn {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--purple-border);
  border-radius: 999px;
  background: #fff;
  color: var(--purple);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.detail-expand-btn:hover {
  background: var(--purple-soft);
  border-color: var(--purple);
  transform: translateY(-1px);
}

.insight-meta,
.real-plan-meta,
.real-finding-meta,
.granted-scope-list,
.risk-files-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.insight-meta span,
.real-plan-meta span,
.real-finding-meta code,
.granted-scope-list span,
.risk-file-chip,
.sev-dot {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.vulnerabilities-list,
.real-findings-list {
  flex: 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.vulnerabilities-list::-webkit-scrollbar,
.real-findings-list::-webkit-scrollbar,
.terminal-screen::-webkit-scrollbar,
.code-pre-block::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.vulnerabilities-list::-webkit-scrollbar-thumb,
.real-findings-list::-webkit-scrollbar-thumb,
.terminal-screen::-webkit-scrollbar-thumb,
.code-pre-block::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.no-vuln-banner,
.real-empty-state {
  border: 1px dashed var(--border-warm);
  border-radius: 14px;
  background: var(--surface-warm);
  color: var(--muted-warm);
  padding: 18px;
  font-size: 13px;
  font-weight: 600;
}

.no-vuln-banner {
  text-align: center;
  margin-top: 18px;
}

.vuln-item-card,
.real-finding-card,
.real-rule-card,
.risk-metric-card,
.matrix-row,
.status-item,
.remediation-step,
.gitlab-scope-option {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.vuln-item-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-left-width: 4px;
}

.vuln-item-card.critical { border-left-color: var(--rose); }
.vuln-item-card.high { border-left-color: #ea580c; }
.vuln-item-card.medium { border-left-color: #d97706; }

.vuln-item-header,
.real-finding-head,
.user-gitlab-head,
.gitlab-scope-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vuln-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.vuln-title,
.real-finding-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.vuln-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.vuln-badge.critical,
.real-finding-card.critical .real-finding-head span {
  background: var(--rose-soft);
  color: var(--rose);
}

.vuln-badge.high,
.real-finding-card.high .real-finding-head span {
  background: #fff7ed;
  color: #c2410c;
}

.vuln-badge.medium,
.real-finding-card.medium .real-finding-head span {
  background: var(--amber-soft);
  color: #8a5b12;
}

.vuln-desc-text,
.real-finding-body p,
.user-gitlab-copy,
.compliance-box p,
.remediation-step span:last-child,
.gitlab-scope-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.vuln-metric-row,
.patch-details-box,
.remediation-flow,
.risk-metrics-row {
  display: grid;
  gap: 8px;
}

.vuln-metric-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-pill,
.patch-spec {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-pill span,
.spec-val {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.vuln-poc-box,
.vuln-evidence-box,
.vuln-fix-box {
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.vuln-fix-box {
  background: var(--green-soft);
  border-color: #b7e4c7;
}

.vuln-poc-box label,
.vuln-evidence-box label,
.vuln-fix-box label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.vuln-poc-box code,
.vuln-evidence-box code,
.vuln-fix-box code {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cve-tag {
  color: var(--rose);
  background: var(--rose-soft);
  border-radius: 6px;
  padding: 1px 5px;
}

.patch-actions-wrapper {
  margin-top: 12px;
}

.mr-action-header {
  margin-bottom: 10px;
}

.mr-action-header h3,
.compliance-box h4 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.patch-details-box {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin: 10px 0;
}

.remediation-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.remediation-step {
  padding: 10px;
}

.step-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  margin-right: 6px;
}

.remediation-step strong {
  color: var(--ink);
  font-size: 13px;
}

.risk-dashboard,
.real-case-section,
.judge-section {
  margin-bottom: 16px;
  padding: 16px;
}

.risk-dashboard.hidden,
.judge-section:not(.active) {
  display: none;
}

.risk-metrics-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.risk-metric-card {
  min-width: 0;
  padding: 14px;
}

.risk-metric-val {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.risk-metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

.risk-metric-card.critical .risk-metric-val { color: var(--rose); }
.risk-metric-card.high .risk-metric-val { color: #c2410c; }
.risk-metric-card.cost .risk-metric-val { color: var(--green); }

.risk-files-row {
  margin-top: 12px;
}

.risk-chip-name {
  color: var(--ink-soft);
}

.sev-dot.critical { color: var(--rose); background: var(--rose-soft); border-color: #fecdd3; }
.sev-dot.high { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.sev-dot.medium { color: #8a5b12; background: var(--amber-soft); border-color: #f1d58b; }

.real-case-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.74fr) minmax(0, 1.26fr);
  gap: 16px;
  align-items: start;
}

.real-control-panel,
.real-results-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.real-control-panel {
  gap: 12px;
}

.real-results-panel {
  gap: 12px;
}

.real-summary-box {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.real-summary-box > strong,
.real-summary-box > span {
  grid-column: 1 / -1;
}

.real-summary-box > strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.real-summary-box > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.real-summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.real-summary-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.real-summary-row code {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-gitlab-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-gitlab-connected,
.user-gitlab-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-gitlab-actions:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-shell .user-gitlab-actions:last-child {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.user-gitlab-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.user-gitlab-identity > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.user-gitlab-identity strong {
  color: var(--ink);
}

.user-gitlab-identity code,
.gitlab-scope-picker-head code {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.gitlab-scope-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gitlab-scope-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px;
}

.gitlab-scope-option strong {
  color: var(--ink);
  font-size: 13px;
}

.gitlab-scope-option small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.gitlab-scope-option code {
  color: var(--muted);
  font-size: 11px;
}

.real-pack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.real-pack-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.real-pack-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-soft);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--purple);
}

.real-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.real-actions .btn-mr-submit {
  grid-column: 1 / -1;
}

.real-plan-box {
  min-height: 78px;
}

.real-rule-card {
  padding: 10px;
  margin-top: 8px;
}

.real-rule-card strong {
  color: var(--purple);
  font-size: 13px;
}

.real-rule-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0;
}

.real-rule-card code {
  color: var(--muted);
  font-size: 11px;
}

.real-findings-list {
  max-height: 760px;
}

.real-finding-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-left-width: 4px;
}

.real-finding-card.critical { border-left-color: var(--rose); }
.real-finding-card.high { border-left-color: #ea580c; }
.real-finding-card.medium { border-left-color: #d97706; }

.real-finding-body {
  min-width: 0;
}

.real-finding-head span {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.real-finding-body pre {
  overflow: auto;
  max-height: 190px;
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.real-remediation {
  border-radius: 12px;
  background: var(--green-soft);
  color: #14532d;
  border: 1px solid #b7e4c7;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
}

.judge-section.active {
  display: block;
}

.btn-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.judge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.judge-col {
  min-width: 0;
}

.judge-col h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.mcp-matrix,
.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.matrix-row,
.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.matrix-status,
.status-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.mr-modal-overlay.hidden {
  display: none;
}

.mr-modal-card {
  width: min(560px, 100%);
  padding: 18px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.mr-modal-header,
.mr-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mr-modal-header {
  margin-bottom: 14px;
}

.mr-modal-header h3 {
  flex: 1;
  color: var(--ink);
  font-size: 18px;
}

.mr-info-row {
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mr-label {
  min-width: 80px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mr-value,
.mr-link {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mr-link {
  color: var(--purple);
  text-decoration: none;
}

.mr-ci-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.ci-check {
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid #b7e4c7;
  color: var(--green);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
}

.mr-status-banner {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.detail-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.detail-modal-overlay.hidden {
  display: none;
}

.detail-modal-card {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.detail-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.detail-modal-kicker {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.detail-modal-header h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.detail-modal-body {
  overflow: auto;
  padding: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.detail-markdown,
.detail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-markdown strong {
  color: var(--ink);
}

.detail-code {
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.6;
}

.finding-modal-summary {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}

.finding-modal-summary .vuln-badge {
  align-self: center;
  justify-self: start;
}

.finding-modal-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 14px;
  margin-top: 12px;
}

.finding-modal-section h4 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}

.finding-modal-section p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.finding-modal-section .detail-code {
  margin: 0;
}

.pulse-footer {
  margin-top: 18px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border-warm);
  color: var(--muted-warm);
  text-align: center;
  font-size: 12px;
}

body.theme-dark {
  --page: #0e0a16;
  --page-soft: #0e0a16;
  --surface: rgba(28, 22, 40, 0.84);
  --surface-muted: rgba(28, 22, 40, 0.58);
  --surface-warm: rgba(70, 38, 18, 0.3);
  --ink: #f7f4fb;
  --ink-soft: #d9d2e3;
  --muted: #a39bb0;
  --muted-warm: #f3c5a8;
  --border: rgba(252, 109, 38, 0.2);
  --border-warm: rgba(252, 109, 38, 0.2);
  --purple: #fc8d4e;
  --purple-soft: rgba(252, 109, 38, 0.12);
  --purple-border: rgba(252, 109, 38, 0.42);
  --cyan: #fc8d4e;
  --cyan-soft: rgba(252, 109, 38, 0.12);
  --green: #34d399;
  --green-soft: rgba(34, 197, 94, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --rose: #ef4444;
  --rose-soft: rgba(239, 68, 68, 0.14);
  --code-bg: #0a0712;
  --code-surface: #0a0712;
  --code-text: #f1ecf7;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.34);
  background-color: #0e0a16;
  background-image:
    radial-gradient(circle at 90% 0%, rgba(252, 109, 38, 0.14) 0%, transparent 38%),
    radial-gradient(circle at 5% 100%, rgba(226, 67, 41, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 40% 40%, rgba(110, 73, 203, 0.1) 0%, transparent 45%);
  color: var(--ink);
}

body.theme-dark .pulse-header,
body.theme-dark .glassmorphic,
body.theme-dark .demo-toolbar {
  background: rgba(24, 18, 36, 0.74);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark .hackathon-banner {
  color: #efe9fb;
}

body.theme-dark .laser-cyan {
  background: linear-gradient(135deg, var(--gitlab-red), var(--gitlab-orange) 55%, var(--gitlab-amber));
  box-shadow: 0 0 18px rgba(252, 109, 38, 0.5);
}

body.theme-dark .logo-text,
body.theme-dark .auth-intro h2,
body.theme-dark .demo-toolbar h2,
body.theme-dark .card-header h2,
body.theme-dark .real-case-header h2,
body.theme-dark .risk-dash-header h2,
body.theme-dark .judge-header h2,
body.theme-dark .mr-action-header h3,
body.theme-dark .compliance-box h4,
body.theme-dark .judge-col h3,
body.theme-dark .mr-modal-header h3 {
  color: var(--ink);
}

body.theme-dark .badge-tag,
body.theme-dark .section-desc {
  color: var(--ink-soft);
}

body.theme-dark .btn-primary,
body.theme-dark .btn-scan-all,
body.theme-dark .btn-mr-submit {
  background: linear-gradient(135deg, var(--gitlab-red), var(--gitlab-orange));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(252, 109, 38, 0.34);
}

body.theme-dark .btn-primary:hover,
body.theme-dark .btn-scan-all:hover,
body.theme-dark .btn-mr-submit:hover {
  background: linear-gradient(135deg, var(--gitlab-orange), var(--gitlab-amber));
  border-color: transparent;
  box-shadow: 0 0 24px rgba(252, 109, 38, 0.58);
}

body.theme-dark .btn-secondary,
body.theme-dark .btn-close,
body.theme-dark .detail-expand-btn {
  background: rgba(14, 10, 22, 0.44);
  color: var(--ink);
  border-color: var(--border);
}

body.theme-dark .btn-secondary:hover,
body.theme-dark .btn-close:hover,
body.theme-dark .detail-expand-btn:hover {
  background: rgba(252, 109, 38, 0.1);
  border-color: var(--purple-border);
  color: var(--purple);
}

body.theme-dark .engine-badge,
body.theme-dark .status-val,
body.theme-dark .risk-badge-total,
body.theme-dark .issue-search-count,
body.theme-dark .step-kicker,
body.theme-dark .mr-status-banner {
  background: var(--purple-soft);
  border-color: var(--purple-border);
  color: var(--purple);
}

body.theme-dark .engine-badge[data-tone="pass"],
body.theme-dark .status-val.pass,
body.theme-dark .ci-check {
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.32);
  color: #86efac;
}

body.theme-dark .engine-badge[data-tone="warn"],
body.theme-dark .status-val.warn {
  background: var(--amber-soft);
  border-color: rgba(251, 191, 36, 0.34);
  color: var(--amber);
}

body.theme-dark .status-val.error {
  background: var(--rose-soft);
  border-color: rgba(239, 68, 68, 0.34);
  color: #fca5a5;
}

body.theme-dark .status-val.neutral {
  background: rgba(2, 6, 23, 0.36);
  border-color: var(--border);
  color: var(--muted);
}

body.theme-dark .matrix-status[data-tone="pass"] {
  color: #86efac;
}

body.theme-dark .matrix-status[data-tone="warn"] {
  color: #fde68a;
}

body.theme-dark .agent-stage-strip span,
body.theme-dark .file-inspector-bar,
body.theme-dark .code-header,
body.theme-dark .gemini-insight-box,
body.theme-dark .patch-actions-wrapper,
body.theme-dark .real-summary-box,
body.theme-dark .user-gitlab-card,
body.theme-dark .real-plan-box,
body.theme-dark .compliance-box,
body.theme-dark .metric-pill,
body.theme-dark .patch-spec,
body.theme-dark .vuln-poc-box,
body.theme-dark .vuln-evidence-box,
body.theme-dark .vuln-fix-box,
body.theme-dark .real-remediation {
  background: var(--surface-muted);
  border-color: var(--border);
}

body.theme-dark .styled-select,
body.theme-dark .real-question-input,
body.theme-dark .code-view-container,
body.theme-dark .findings-tools,
body.theme-dark .issue-search-input,
body.theme-dark .insight-meta span,
body.theme-dark .real-plan-meta span,
body.theme-dark .real-finding-meta code,
body.theme-dark .granted-scope-list span,
body.theme-dark .risk-file-chip,
body.theme-dark .sev-dot,
body.theme-dark .vuln-item-card,
body.theme-dark .real-finding-card,
body.theme-dark .real-rule-card,
body.theme-dark .risk-metric-card,
body.theme-dark .matrix-row,
body.theme-dark .status-item,
body.theme-dark .remediation-step,
body.theme-dark .gitlab-scope-option,
body.theme-dark .real-pack-list label,
body.theme-dark .user-gitlab-identity,
body.theme-dark .mr-modal-card,
body.theme-dark .detail-modal-card {
  background: rgba(14, 10, 22, 0.46);
  border-color: var(--border);
  color: var(--ink);
}

body.theme-dark select option {
  background: #0e0a16;
  color: var(--ink);
}

body.theme-dark .terminal-screen,
body.theme-dark .real-finding-body pre {
  border-color: rgba(252, 109, 38, 0.24);
  background: #0a0712;
  color: #f1ecf7;
}

body.theme-dark .agent-stage-strip span.firing {
  background: rgba(252, 109, 38, 0.14);
  border-color: var(--purple-border);
  color: var(--purple);
}

body.theme-dark .agent-stage-strip span.done {
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.3);
  color: #86efac;
}

body.theme-dark .no-vuln-banner,
body.theme-dark .real-empty-state {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.26);
  color: #fde68a;
}

body.theme-dark .vuln-badge.critical,
body.theme-dark .real-finding-card.critical .real-finding-head span,
body.theme-dark .cve-tag,
body.theme-dark .sev-dot.critical {
  background: var(--rose-soft);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fca5a5;
}

body.theme-dark .vuln-badge.high,
body.theme-dark .real-finding-card.high .real-finding-head span,
body.theme-dark .sev-dot.high {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.32);
  color: #fdba74;
}

body.theme-dark .vuln-badge.medium,
body.theme-dark .real-finding-card.medium .real-finding-head span,
body.theme-dark .sev-dot.medium {
  background: var(--amber-soft);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

body.theme-dark .vuln-fix-box,
body.theme-dark .real-remediation {
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.3);
  color: #bbf7d0;
}

body.theme-dark .vuln-poc-box code,
body.theme-dark .vuln-evidence-box code,
body.theme-dark .vuln-fix-box code,
body.theme-dark .real-summary-row code,
body.theme-dark .user-gitlab-identity code,
body.theme-dark .gitlab-scope-picker-head code,
body.theme-dark .real-rule-card strong,
body.theme-dark .mr-link,
body.theme-dark .insight-kicker,
body.theme-dark .real-case-kicker,
body.theme-dark .issue-search-count,
body.theme-dark .real-pack-header code,
body.theme-dark .matrix-tool {
  color: var(--purple);
}

body.theme-dark .real-remediation,
body.theme-dark .ci-check {
  color: #bbf7d0;
}

body.theme-dark .mr-modal-overlay,
body.theme-dark .detail-modal-overlay {
  background: rgba(14, 10, 22, 0.72);
}

body.theme-dark .vulnerabilities-list::-webkit-scrollbar-thumb,
body.theme-dark .real-findings-list::-webkit-scrollbar-thumb,
body.theme-dark .terminal-screen::-webkit-scrollbar-thumb,
body.theme-dark .code-pre-block::-webkit-scrollbar-thumb {
  background: rgba(252, 109, 38, 0.34);
}

@media (max-width: 1180px) {
  .pulse-grid,
  .real-case-grid {
    grid-template-columns: 1fr;
  }

  .grid-card {
    max-height: none;
    min-height: 560px;
  }

  .real-summary-box,
  .risk-metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.pulse-dark {
    padding: 12px;
  }

  .header-container,
  .auth-intro,
  .demo-toolbar,
  .card-header,
  .real-case-header,
  .risk-dash-header,
  .judge-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .auth-shell .user-gitlab-card,
  .auth-shell .user-gitlab-actions,
  .auth-shell .user-gitlab-connected,
  .file-inspector-bar,
  .agent-stage-strip,
  .real-summary-box,
  .real-pack-list,
  .real-actions,
  .issue-search-row,
  .risk-metrics-row,
  .finding-modal-summary,
  .judge-grid,
  .patch-details-box,
  .remediation-flow,
  .user-gitlab-actions:last-child {
    grid-template-columns: 1fr;
  }

  .header-actions {
    display: grid;
  }

  .auth-shell .user-gitlab-connected .real-label,
  .auth-shell .user-gitlab-identity,
  .auth-shell .user-project-select,
  .auth-shell .user-gitlab-connected .user-gitlab-actions {
    grid-area: auto;
    grid-column: auto;
    grid-row: auto;
  }

  .logo-wrapper {
    align-items: flex-start;
  }

  .grid-card {
    padding: 12px;
    min-height: auto;
  }

  .terminal-screen {
    height: 190px;
  }

  .real-finding-head,
  .vuln-item-header,
  .matrix-row,
  .status-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Scanning button state + live scan popover ---- */

@property --scan-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.is-scanning {
  --scan-angle: 0deg;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent !important;
  background:
    linear-gradient(var(--ink, #171321), var(--ink, #171321)) padding-box,
    conic-gradient(from var(--scan-angle), var(--gitlab-red), var(--gitlab-orange), var(--gitlab-amber), var(--gitlab-red)) border-box !important;
  color: #fff !important;
  animation: scan-ring-spin 1.1s linear infinite, scan-glow-pulse 1.6s ease-in-out infinite;
}

.is-scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  animation: scan-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

.scan-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: -2px;
  animation: scan-spin 0.7s linear infinite;
}

.scan-popover {
  position: fixed;
  z-index: 1300;
  width: 390px;
  max-width: calc(100vw - 24px);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 24px 64px rgba(23, 19, 33, 0.2),
    0 0 0 1px rgba(252, 109, 38, 0.08),
    0 0 44px rgba(252, 109, 38, 0.1);
  animation: scan-pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scan-popover.hidden {
  display: none;
}

.scan-pop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.scan-live-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gitlab-orange);
  box-shadow: 0 0 10px rgba(252, 109, 38, 0.65);
  animation: scan-dot-pulse 1.2s ease-in-out infinite;
}

.scan-live-dot.idle {
  animation: none;
  background: var(--green);
  box-shadow: 0 0 8px rgba(4, 120, 87, 0.4);
}

.scan-pop-titles {
  flex: 1;
  min-width: 0;
}

.scan-pop-titles strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.scan-pop-titles code {
  display: block;
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-pop-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 9px;
}

.scan-pop-badge.live {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.scan-pop-badge.done {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #b7e4c7;
}

.scan-pop-badge.error {
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid #fecdd3;
}

.scan-pop-stages {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-stage {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

.scan-stage-icon {
  position: relative;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.45;
}

.scan-stage.active {
  background: var(--purple-soft);
  color: var(--purple);
}

.scan-stage.active .scan-stage-icon {
  border-color: rgba(252, 109, 38, 0.28);
  border-top-color: var(--gitlab-orange);
  opacity: 1;
  animation: scan-spin 0.8s linear infinite;
}

.scan-stage.done {
  color: var(--green);
}

.scan-stage.done .scan-stage-icon {
  border-color: transparent;
  background: var(--green-soft);
  opacity: 1;
}

.scan-stage.done .scan-stage-icon::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.scan-stage.failed {
  background: var(--rose-soft);
  color: var(--rose);
}

.scan-stage.failed .scan-stage-icon {
  border-color: transparent;
  opacity: 1;
}

.scan-stage.failed .scan-stage-icon::after {
  content: '×';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.scan-pop-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 108px;
  overflow: auto;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--code-bg);
  color: #d8d2e3;
  font-size: 11px;
  line-height: 1.5;
}

.scan-pop-log span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: scan-log-in 0.25s ease both;
}

.scan-pop-log .log-time {
  color: var(--gitlab-amber);
  font-style: normal;
  margin-right: 4px;
}

.scan-pop-log::-webkit-scrollbar {
  width: 6px;
}

.scan-pop-log::-webkit-scrollbar-thumb {
  background: rgba(252, 109, 38, 0.35);
  border-radius: 999px;
}

.scan-pop-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.scan-pop-results.hidden {
  display: none;
}

.scan-result-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  animation: scan-log-in 0.3s ease both;
}

.scan-result-num {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.scan-result-pill.critical .scan-result-num { color: var(--rose); }
.scan-result-pill.high .scan-result-num { color: #c2410c; }
.scan-result-pill.medium .scan-result-num { color: #8a5b12; }

.scan-pop-footnote {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

body.theme-dark .scan-popover {
  background: rgba(24, 18, 36, 0.96);
  border-color: var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.theme-dark .scan-result-pill {
  background: rgba(14, 10, 22, 0.46);
}

body.theme-dark .is-scanning {
  background:
    linear-gradient(#241a38, #241a38) padding-box,
    conic-gradient(from var(--scan-angle), var(--gitlab-red), var(--gitlab-orange), var(--gitlab-amber), var(--gitlab-red)) border-box !important;
}

@keyframes scan-ring-spin {
  to { --scan-angle: 360deg; }
}

@keyframes scan-glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(252, 109, 38, 0.35); }
  50% { box-shadow: 0 0 26px rgba(252, 109, 38, 0.65); }
}

@keyframes scan-shimmer {
  0% { left: -80%; }
  100% { left: 140%; }
}

@keyframes scan-spin {
  to { transform: rotate(360deg); }
}

@keyframes scan-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

@keyframes scan-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes scan-log-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .is-scanning,
  .is-scanning::after,
  .scan-spinner,
  .scan-live-dot,
  .scan-stage-icon,
  .scan-popover,
  .scan-pop-log span,
  .scan-result-pill {
    animation: none !important;
  }
}

/* ---- SaaS layer: usage meter, scan history, pricing modal ---- */

.usage-meter {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 12px;
}

.usage-meter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.usage-plan-badge {
  border: 1px solid var(--purple-border);
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  white-space: nowrap;
}

.usage-count {
  flex: 1;
  min-width: 160px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.usage-count.exhausted {
  color: var(--rose);
}

.usage-upgrade-btn {
  min-height: 30px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.usage-upgrade-btn:hover {
  transform: translateY(-1px);
  background: #2c2438;
  box-shadow: 0 8px 18px rgba(23, 19, 33, 0.22);
}

.usage-bar {
  margin-top: 9px;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 19, 33, 0.08);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gitlab-red), var(--gitlab-orange), var(--gitlab-amber));
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.usage-bar-fill.warn {
  background: linear-gradient(90deg, var(--gitlab-orange), var(--gitlab-amber));
}

.usage-bar-fill.exhausted {
  background: linear-gradient(90deg, #be123c, var(--gitlab-red));
}

.usage-billing-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.scan-history-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 12px;
}

.scan-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.scan-history-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.scan-history-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.scan-history-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-top: 6px;
  font-size: 12px;
}

.history-type {
  flex: 0 0 auto;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
}

.history-type.scan {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.history-type.mr {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #b7e4c7;
}

.history-main {
  flex: 1;
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main a {
  color: var(--purple);
  text-decoration: none;
}

.history-counts {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}

.history-counts em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 5px;
}

.history-counts em.critical { background: var(--rose-soft); color: var(--rose); }
.history-counts em.high { background: #fff7ed; color: #c2410c; }
.history-counts em.medium { background: var(--amber-soft); color: #8a5b12; }
.history-counts em.clean { background: var(--green-soft); color: var(--green); }

.history-when {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.quota-banner {
  border: 1px solid var(--purple-border);
  border-radius: 14px;
  background:
    radial-gradient(360px 160px at 90% 0%, rgba(252, 109, 38, 0.12), transparent 65%),
    var(--purple-soft);
  padding: 18px;
  text-align: center;
}

.quota-banner strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.quota-banner p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.pricing-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 19, 33, 0.46);
  backdrop-filter: blur(10px);
}

.pricing-modal-overlay.hidden {
  display: none;
}

.pricing-modal-card {
  width: min(1020px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(560px 220px at 96% 0%, rgba(252, 109, 38, 0.12), transparent 65%),
    #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: scan-pop-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pricing-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.pricing-modal-header h3 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2px 0 4px;
}

.pricing-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pricing-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.pricing-plan-card.featured {
  border-color: var(--gitlab-orange);
  box-shadow: 0 12px 32px rgba(252, 109, 38, 0.16);
}

.pricing-plan-card.current {
  border-color: var(--purple-border);
  background: var(--purple-soft);
}

.plan-flag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gitlab-red), var(--gitlab-orange));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  white-space: nowrap;
}

.plan-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.plan-price {
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-price em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-blurb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  min-height: 30px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 2px 0 10px;
  flex: 1;
}

.plan-features li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 800;
}

.plan-select-btn {
  width: 100%;
  min-height: 36px;
}

.pricing-note {
  margin-top: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.pricing-note.ok {
  background: var(--green-soft);
  border: 1px solid #b7e4c7;
  color: var(--green);
}

.pricing-note.warn {
  background: var(--amber-soft);
  border: 1px solid #f1d58b;
  color: #8a5b12;
}

.pricing-note.hidden {
  display: none;
}

body.theme-dark .usage-meter,
body.theme-dark .scan-history-box {
  background: var(--surface-muted);
  border-color: var(--border);
}

body.theme-dark .scan-history-row,
body.theme-dark .pricing-plan-card {
  background: rgba(14, 10, 22, 0.46);
  border-color: var(--border);
}

body.theme-dark .usage-bar {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .usage-upgrade-btn {
  background: linear-gradient(135deg, var(--gitlab-red), var(--gitlab-orange));
}

body.theme-dark .pricing-modal-card {
  background:
    radial-gradient(560px 220px at 96% 0%, rgba(252, 109, 38, 0.1), transparent 65%),
    rgba(24, 18, 36, 0.97);
}

body.theme-dark .pricing-plan-card.current {
  background: rgba(252, 109, 38, 0.08);
}

body.theme-dark .quota-banner {
  background:
    radial-gradient(360px 160px at 90% 0%, rgba(252, 109, 38, 0.12), transparent 65%),
    rgba(252, 109, 38, 0.07);
}

@media (max-width: 1000px) {
  .pricing-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .pricing-plans {
    grid-template-columns: 1fr;
  }

  .scan-history-row {
    flex-wrap: wrap;
  }
}
