/* ================================================================
   MCP Security Scanner – Web UI Stylesheet
   Dark theme inspired by MCP Trust Registry
   ================================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
:root[data-theme="dark"] {
    /* Surfaces */
    --bg-base:      #0b0f19;
    --bg-surface:   #131a2b;
    --bg-card:      #182235;
    --bg-card-alt:  #1c2840;
    --border:       #2a3550;
    --border-subtle:#1f2941;
    /* Text */
    --text:         #e0e6f0;
    --text-strong:  #ffffff;
    --text-muted:   #9aa6bd;
    /* Brand / accent */
    --accent:       #4f8cff;
    --accent-hover: #6da1ff;
    --accent-pressed:#3d75e8;
    --accent-ring:  rgba(79,140,255,.45);
    --accent-soft:  rgba(79,140,255,.12);
    /* Reserve gradient for charts/data viz only */
    --gradient-l:   #4f8cff;
    --gradient-r:   #a855f7;
    /* Severity */
    --critical:     #ef4444;
    --critical-bg:  rgba(239,68,68,.12);
    --high:         #f97316;
    --high-bg:      rgba(249,115,22,.12);
    --medium:       #eab308;
    --medium-bg:    rgba(234,179,8,.12);
    --low:          #22c55e;
    --low-bg:       rgba(34,197,94,.12);
    /* Geometry */
    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;
    --transition:   .15s ease;
    /* Elevation (dark) */
    --shadow-sm:    0 1px 2px rgba(0,0,0,.4);
    --shadow-md:    0 4px 16px rgba(0,0,0,.35), inset 0 1px 0 0 rgba(255,255,255,.03);
    --shadow-lg:    0 24px 60px -20px rgba(0,0,0,.6), inset 0 1px 0 0 rgba(255,255,255,.04);
    /* Layout */
    --page-max:     1440px;
    --content-max:  1200px;
    --gutter:       clamp(1rem, 3vw, 2rem);
    /* Form controls */
    --control-h:    44px;
    --control-h-lg: 48px;
}

:root[data-theme="light"] {
    --bg-base:      #f6f8fc;
    --bg-surface:   #ffffff;
    --bg-card:      #ffffff;
    --bg-card-alt:  #f1f4fa;
    --border:       #d6dde8;
    --border-subtle:#e6ebf2;
    --text:         #0f1729;
    --text-strong:  #050a16;
    --text-muted:   #5b6680;
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --accent-pressed:#1e40af;
    --accent-ring:  rgba(37,99,235,.35);
    --accent-soft:  rgba(37,99,235,.08);
    --critical-bg:  rgba(239,68,68,.10);
    --high-bg:      rgba(249,115,22,.10);
    --medium-bg:    rgba(234,179,8,.14);
    --low-bg:       rgba(34,197,94,.12);
    --shadow-sm:    0 1px 2px rgba(15,23,42,.06);
    --shadow-md:    0 4px 16px rgba(15,23,42,.08);
    --shadow-lg:    0 20px 50px -16px rgba(15,23,42,.18);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

code {
    background: var(--bg-card-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .88em;
    word-break: break-all;
}

/* ---------- Skip link + Focus ring (a11y) ---------- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 999;
    background: var(--accent);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}
.skip-link:focus { top: .75rem; color: #fff; outline: none; }

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.scan-input:focus-visible,
.compare-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ---------- Navbar ---------- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg-base) 88%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-container {
    max-width: var(--page-max); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem var(--gutter);
    gap: 1.25rem;
}
.nav-brand {
    display: inline-flex; align-items: center; gap: .55rem;
    font-weight: 700; font-size: 1.05rem; color: var(--text-strong);
    letter-spacing: -.005em;
}
.nav-brand:hover { color: var(--accent); }
.brand-mark {
    width: 26px; height: 26px;
    color: var(--accent);
    flex-shrink: 0;
}
.brand-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-strong);
    letter-spacing: -.01em;
}
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-link {
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    padding: .35rem 0;
    position: relative;
    transition: color var(--transition);
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text-strong); }
.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -.85rem;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Footer ---------- */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    padding: 1.25rem var(--gutter);
    background: var(--bg-surface);
    font-size: .82rem;
    color: var(--text-muted);
}
.footer-container {
    max-width: var(--page-max); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.footer-left { display: inline-flex; align-items: center; gap: .5rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    height: var(--control-h);
    padding: 0 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: .92rem;
    line-height: 1;
    border: 1px solid var(--border);
    background: var(--bg-card-alt);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn-outline { background: transparent; }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 .75rem; font-size: .82rem; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: var(--control-h-lg); padding: 0 1.4rem; font-size: .95rem; }
.btn-scan { white-space: nowrap; }
.btn-icon { font-size: 1rem; }

/* ---------- Layout ---------- */
.main-content { flex: 1; }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 3.5rem 0; }
.section-tight { padding: 2rem 0; }
.section-alt { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.section-title {
    text-align: center; font-size: 1.6rem; font-weight: 700;
    letter-spacing: -.015em; color: var(--text-strong);
    margin-bottom: 2rem;
}
.eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .75rem;
}

/* ---------- Hero (console-style) ---------- */
.hero {
    padding: 3rem var(--gutter) 2.5rem;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, var(--accent-soft), transparent 70%);
    border-bottom: 1px solid var(--border-subtle);
}
.hero-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}
.hero-title { font-size: 2.1rem; font-weight: 700; line-height: 1.15; margin-bottom: .75rem; color: var(--text-strong); letter-spacing: -.02em; }
.hero-subtitle {
    font-size: 1rem; color: var(--text-muted);
    max-width: 640px; margin: 0 0 1.75rem;
    line-height: 1.55;
}
.gradient-text {
    color: var(--accent);
}

/* ---------- Scan Form ---------- */
.scan-form-card {
    max-width: 760px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}
.compare-form-card { max-width: 1100px; overflow: hidden; }
.scan-form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: .5rem;
    letter-spacing: -.005em;
}
.input-group {
    display: flex; gap: .5rem;
    align-items: stretch;
}
.scan-input {
    flex: 1;
    height: var(--control-h-lg);
    padding: 0 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--text); font-size: .95rem;
    outline: none;
    transition: var(--transition);
}
.scan-input::placeholder { color: var(--text-muted); }
.scan-input:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.scan-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input-group .btn { height: var(--control-h-lg); }
.input-hint { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.compare-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .75rem;
    align-items: end;
    width: 100%;
}
.compare-form-grid > div { min-width: 0; }
.compare-select {
    display: block;
    box-sizing: border-box;
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    width: 100%;
    min-width: 0;
    max-width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compare-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,140,255,.25); }
.compare-actions {
    margin-top: .85rem;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
.compare-btn {
    white-space: nowrap;
}

/* ---------- Alert ---------- */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: var(--critical-bg); border: 1px solid var(--critical); color: var(--critical); }
.alert-info { background: rgba(79,140,255,.12); border: 1px solid var(--accent); color: var(--text); }

/* ---------- Steps ---------- */
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.step-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius); padding: 1.5rem;
    transition: var(--transition);
}
.step-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.step-number {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem; font-weight: 700;
    margin-bottom: .85rem;
}
.step-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-strong); letter-spacing: -.005em; }
.step-card p { color: var(--text-muted); font-size: .88rem; line-height: 1.5; }

/* ---------- Features ---------- */
.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius); padding: 1.25rem;
    transition: var(--transition);
}
.feature-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.feature-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    margin-bottom: .75rem;
}
.feature-icon svg { width: 18px; height: 18px; }
.feature-card h4 { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; color: var(--text-strong); letter-spacing: -.005em; }
.feature-card p { color: var(--text-muted); font-size: .85rem; line-height: 1.5; }

/* ---------- OWASP Grid ---------- */
.owasp-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: .5rem; max-width: 960px; margin: 0 auto;
}
.owasp-item {
    display: flex; align-items: center; gap: .75rem;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm); padding: .65rem .9rem;
    font-size: .88rem; color: var(--text);
    transition: var(--transition);
}
.owasp-item:hover { border-color: var(--border); background: var(--bg-card-alt); }
.owasp-tag {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700; font-size: .7rem;
    letter-spacing: .05em;
    padding: .2rem .5rem; border-radius: 4px; white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.scan-table {
    width: 100%; border-collapse: collapse;
    font-size: .9rem;
}
.scan-table th {
    text-align: left; padding: .75rem 1rem;
    color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.scan-table td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
}
.scan-table tbody tr:hover { background: var(--bg-card-alt); }
.cell-name { font-weight: 600; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { color: var(--text-muted); white-space: nowrap; }

.score-badge {
    display: inline-block; padding: .15rem .6rem;
    border-radius: 4px; font-weight: 700; font-size: .85rem;
}
.score-critical, .risk-critical { background: var(--critical-bg); color: var(--critical); }
.score-high,     .risk-high     { background: var(--high-bg);     color: var(--high); }
.score-medium,   .risk-medium   { background: var(--medium-bg);   color: var(--medium); }
.score-low,      .risk-low      { background: var(--low-bg);      color: var(--low); }
.risk-label { font-weight: 600; font-size: .82rem; }

/* ---------- Scanning Page ---------- */
.scanning-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 3rem 2rem;
}
.spinner {
    width: 52px; height: 52px; margin: 0 auto 1.5rem;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scan-url {
    color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem;
    word-break: break-all;
}
.progress-bar-wrap {
    height: 8px; border-radius: 4px;
    background: var(--bg-base); overflow: hidden;
    margin-bottom: 1rem;
}
.progress-bar {
    height: 100%; width: 5%;
    background: linear-gradient(90deg, var(--gradient-l), var(--gradient-r));
    border-radius: 4px;
    transition: width .5s ease;
}
.progress-error { background: var(--critical) !important; }
.progress-done  { background: var(--low) !important; }

.status-text { font-size: .95rem; font-weight: 600; }
.muted { color: var(--text-muted); font-size: .85rem; }

.scan-log {
    margin-top: 1.5rem; text-align: left;
    max-height: 180px; overflow-y: auto;
    background: var(--bg-base); border-radius: var(--radius-sm);
    padding: .75rem 1rem; font-size: .82rem; color: var(--text-muted);
}
.scan-log p { margin-bottom: .25rem; }

/* ---------- Results Page ---------- */
.results-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.results-title { font-size: 1.8rem; font-weight: 700; }
.results-meta { color: var(--text-muted); font-size: .88rem; margin-top: .25rem; }
.results-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}
.inline-action-form { display: inline-flex; }

/* Insight strip */
.insight-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1.25rem;
}
.insight-card {
    background: linear-gradient(180deg, rgba(79,140,255,.11), rgba(168,85,247,.06));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .8rem .95rem;
}
.insight-label {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}
.insight-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Score row */
.score-row {
    display: grid; grid-template-columns: 240px 1fr 1fr;
    gap: 1.25rem; margin-bottom: 3rem;
}
@media (max-width: 840px) { .score-row { grid-template-columns: 1fr; } }

.score-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem;
}
.score-card h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-muted); }
.score-card-main { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Gauge */
.gauge-wrap { position: relative; width: 120px; height: 120px; margin-bottom: .75rem; }
.gauge-svg { transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.gauge-low      { stroke: var(--low); }
.gauge-medium   { stroke: var(--medium); }
.gauge-high     { stroke: var(--high); }
.gauge-critical { stroke: var(--critical); }
.gauge-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
}
.gauge-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.gauge-unit { font-size: .75rem; color: var(--text-muted); }

.risk-badge {
    padding: .3rem 1rem; border-radius: 20px;
    font-weight: 700; font-size: .85rem; text-transform: uppercase;
}
.risk-critical { background: var(--critical-bg); color: var(--critical); }
.risk-high     { background: var(--high-bg);     color: var(--high); }
.risk-medium   { background: var(--medium-bg);   color: var(--medium); }
.risk-low      { background: var(--low-bg);      color: var(--low); }

/* Severity bars */
.severity-bars { display: flex; flex-direction: column; gap: .6rem; }
.sev-row { display: flex; align-items: center; gap: .5rem; }
.sev-label { width: 70px; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.sev-bar-wrap { flex: 1; height: 10px; background: var(--bg-base); border-radius: 5px; overflow: hidden; }
.sev-bar { height: 100%; border-radius: 5px; transition: width .6s ease; min-width: 2px; }
.sev-bar-critical { background: var(--critical); }
.sev-bar-high     { background: var(--high); }
.sev-bar-medium   { background: var(--medium); }
.sev-bar-low      { background: var(--low); }
.sev-count { width: 28px; text-align: right; font-weight: 700; font-size: .9rem; }

.sev-critical { color: var(--critical); }
.sev-high     { color: var(--high); }
.sev-medium   { color: var(--medium); }
.sev-low      { color: var(--low); }

/* Stat list */
.stat-list { display: flex; flex-direction: column; gap: 1rem; }
.stat-item { display: flex; align-items: baseline; gap: .5rem; }
.stat-num { font-size: 1.6rem; font-weight: 800; }
.stat-label { color: var(--text-muted); font-size: .85rem; }

/* Executive brief */
.report-brief-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.brief-text {
    color: var(--text);
    margin-bottom: .9rem;
}
.action-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.action-item {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    color: var(--text-muted);
    font-size: .9rem;
}
.action-bullet {
    color: var(--accent);
    line-height: 1.2;
}

.domain-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.domain-row {
    display: flex;
    align-items: center;
    gap: .55rem;
}
.domain-tag {
    width: 62px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--text-muted);
}
.domain-bar-wrap {
    flex: 1;
    height: 10px;
    background: var(--bg-base);
    border-radius: 999px;
    overflow: hidden;
}
.domain-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gradient-l), var(--gradient-r));
    border-radius: 999px;
}
.domain-count {
    width: 28px;
    text-align: right;
    font-weight: 700;
}

/* Priority section */
.priority-section { margin-bottom: 1.5rem; }
.priority-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .75rem;
}
.priority-item {
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .85rem .9rem;
    background: var(--bg-card-alt);
}
.priority-critical { border-left-color: var(--critical); }
.priority-high { border-left-color: var(--high); }
.priority-medium { border-left-color: var(--medium); }
.priority-low { border-left-color: var(--low); }
.priority-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .45rem;
}
.priority-name {
    font-size: .9rem;
    font-weight: 700;
}
.priority-details {
    color: var(--text-muted);
    font-size: .84rem;
    margin-bottom: .4rem;
}
.priority-location {
    font-size: .8rem;
}

/* ---------- Findings ---------- */
.findings-section h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }

.no-findings {
    text-align: center; padding: 3rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.no-findings-icon { font-size: 2.5rem; margin-bottom: .5rem; display: block; }

.filter-bar {
    display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.filter-btn {
    padding: .4rem .9rem; border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
    background: var(--accent); border-color: var(--accent); color: #fff;
}

.findings-list { display: flex; flex-direction: column; gap: .75rem; }

.finding-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    transition: var(--transition);
}
.finding-card:hover { border-color: var(--accent); }
.finding-critical { border-left-color: var(--critical); }
.finding-high     { border-left-color: var(--high); }
.finding-medium   { border-left-color: var(--medium); }
.finding-low      { border-left-color: var(--low); }

.finding-header {
    display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; flex-wrap: wrap;
}
.finding-sev {
    padding: .15rem .55rem; border-radius: 4px;
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
}
.finding-sev.sev-critical { background: var(--critical-bg); color: var(--critical); }
.finding-sev.sev-high     { background: var(--high-bg);     color: var(--high); }
.finding-sev.sev-medium   { background: var(--medium-bg);   color: var(--medium); }
.finding-sev.sev-low      { background: var(--low-bg);      color: var(--low); }

.finding-name { font-weight: 700; font-size: .95rem; }
.finding-details { font-size: .88rem; color: var(--text-muted); margin-bottom: .4rem; }
.finding-location { font-size: .82rem; margin-bottom: .4rem; }
.finding-rec {
    margin-top: .5rem; padding: .6rem .8rem;
    background: var(--bg-base); border-radius: var(--radius-sm);
    font-size: .85rem;
}
.finding-rec p { color: var(--text-muted); margin-top: .2rem; }

/* ---------- Enterprise Report Layout ---------- */
.report-shell { max-width: 1360px; }
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.05rem;
    margin-bottom: 1.1rem;
}
.summary-card {
    background: #f8fafc;
    border: 1px solid #d9e1ee;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    color: #1f2937;
}
.summary-card h3 {
    color: #6b7280;
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: .45rem;
}
.summary-description {
    color: #111827;
    margin-bottom: .95rem;
    font-size: 1rem;
}
.status-rail {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: .2rem 0 1rem;
}
.status-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}
.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
}
.status-dot.active {
    border-color: #1e293b;
    background: #1e293b;
}
.status-line {
    flex: 1;
    min-width: 58px;
    height: 2px;
    background: #cbd5e1;
}
.status-line.done { background: #94a3b8; }
.status-pill {
    font-size: .8rem;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: .13rem .55rem;
    background: #fff;
}
.status-pill.active {
    background: #0a8a1f;
    border-color: #0a8a1f;
    color: #fff;
}
.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
    margin-bottom: .8rem;
}
.metric-label {
    display: block;
    color: #6b7280;
    font-size: .86rem;
    margin-bottom: .05rem;
}
.metric-value {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.06;
    color: #111827;
}
.risk-band {
    border-radius: 8px;
    padding: .52rem .75rem;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .01em;
    text-transform: uppercase;
    margin-bottom: .95rem;
}
.risk-band-critical { background: #e40046; color: #fff; }
.risk-band-high { background: #ea580c; color: #fff; }
.risk-band-medium { background: #fbbf24; color: #111827; }
.risk-band-low { background: #16a34a; color: #fff; }

.meta-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .78rem 1.2rem;
}
.meta-label {
    display: block;
    font-size: .83rem;
    color: #6b7280;
    margin-bottom: .15rem;
}
.meta-value {
    display: block;
    color: #111827;
    font-weight: 700;
}
.meta-mono {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: .88rem;
    word-break: break-all;
}
.tight-list {
    padding-left: 1.2rem;
    color: #1f2937;
}
.tight-list li { margin-bottom: .45rem; }

.tag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .9rem;
    margin-bottom: 1.35rem;
}
.tag-card {
    background: #f8fafc;
    border: 1px solid #d9e1ee;
    border-radius: 10px;
    padding: .85rem 1rem;
}
.tag-card h4 {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: .45rem;
}
.chip-row {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.chip {
    border-radius: 999px;
    padding: .2rem .62rem;
    font-size: .86rem;
    font-weight: 700;
}
.chip-owner { background: #ea580c; color: #fff; }
.chip-lang { background: #e2e8f0; color: #1f2937; }
.chip-transport { background: #16a34a; color: #fff; }

.findings-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}
.issue-accordion {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.issue-group {
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.issue-summary {
    display: flex;
    align-items: center;
    gap: .65rem;
    list-style: none;
    padding: .9rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #edf2f8;
}
.issue-summary::-webkit-details-marker { display: none; }
.finding-state {
    font-size: .77rem;
    font-weight: 800;
    border-radius: 999px;
    padding: .2rem .62rem;
    background: #e40046;
    color: #fff;
    letter-spacing: .02em;
}
.issue-summary-title {
    flex: 1;
    font-size: 1.07rem;
    font-weight: 700;
    color: #0f172a;
}
.issue-count {
    font-size: .86rem;
    font-weight: 700;
    color: #64748b;
}
.priority-chip {
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    padding: .15rem .58rem;
    text-transform: lowercase;
}
.priority-high { background: #1d4ed8; color: #fff; }
.priority-medium { background: #38bdf8; color: #083344; }
.summary-chip-row { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.summary-chip {
    background: #e2e8f0;
    border-radius: 7px;
    padding: .15rem .48rem;
    font-size: .9rem;
    color: #334155;
}
.issue-body {
    padding: .95rem 1rem 1rem;
}
.issue-brief-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .95rem;
    margin-bottom: .8rem;
}
.finding-context-card h4,
.finding-block h4,
.evidence-block h4 {
    color: #6b7280;
    margin-bottom: .35rem;
    font-size: 1.02rem;
}
.finding-block { margin-top: .75rem; }
.finding-block:first-child { margin-top: 0; }
.evidence-card {
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}
.evidence-header {
    display: grid;
    grid-template-columns: 1fr 140px 160px;
    gap: .75rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid #dbe4f0;
}
.evidence-snippet pre {
    margin: 0;
    padding: .75rem .85rem;
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: .9rem;
    white-space: pre-wrap;
    background: #eef2f7;
    color: #111827;
}
.framework-row {
    margin-top: .7rem;
}
.group-evidence-list {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-top: .95rem;
}
.group-evidence-item {
    border-radius: 10px;
    border: 1px solid #dce4f0;
    background: #ffffff;
    overflow: hidden;
}
.group-evidence-item.finding-critical { border-left: 4px solid #e40046; }
.group-evidence-item.finding-high { border-left: 4px solid #ea580c; }
.group-evidence-item.finding-medium { border-left: 4px solid #fbbf24; }
.group-evidence-item.finding-low { border-left: 4px solid #16a34a; }
.group-evidence-head {
    display: grid;
    grid-template-columns: 160px 1fr 120px;
    gap: .8rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid #edf2f8;
    background: #f8fafd;
}
.group-evidence-head p {
    margin: 0;
    color: #0f172a;
    font-weight: 700;
}

body .results-title a { color: #1e64c8; text-decoration: underline; }
body .results-meta { color: #6b7280; }
body .findings-section h2 { color: #111827; }
body .finding-sev.sev-critical { background: #e40046; color: #fff; }
body .finding-sev.sev-high { background: #ea580c; color: #fff; }
body .finding-sev.sev-medium { background: #fbbf24; color: #111827; }
body .finding-sev.sev-low { background: #16a34a; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .hero-title { font-size: 1.8rem; }
    .input-group { flex-direction: column; }
    .scan-input { width: 100%; }
    .nav-links { gap: .75rem; }
    .score-row { grid-template-columns: 1fr; }
    .insight-strip { grid-template-columns: 1fr 1fr; }
    .report-brief-grid { grid-template-columns: 1fr; }
    .compare-form-grid { grid-template-columns: 1fr; }
    .compare-btn { width: 100%; justify-content: center; }
    .compare-actions { justify-content: stretch; }
    .summary-grid { grid-template-columns: 1fr; }
    .tag-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .meta-facts { grid-template-columns: 1fr; }
    .issue-brief-grid { grid-template-columns: 1fr; }
    .evidence-header { grid-template-columns: 1fr; }
    .issue-summary { flex-wrap: wrap; }
    .summary-chip-row { width: 100%; }
    .group-evidence-head { grid-template-columns: 1fr; }
}

/* ---------- Results Experience v3 ---------- */
.results-section-premium {
    background:
        radial-gradient(1200px 600px at 88% -5%, rgba(79, 140, 255, .18), transparent 55%),
        radial-gradient(900px 500px at 12% -12%, rgba(22, 163, 74, .12), transparent 55%),
        var(--bg-base);
}
.results-kicker {
    display: inline-block;
    font-size: .76rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9fb6da;
    margin-bottom: .4rem;
}
.report-shell {
    max-width: 1400px;
}
.results-title {
    line-height: 1.2;
}

.decision-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(160px, 1fr));
    gap: .85rem;
    margin: 1.2rem 0;
}
.decision-card {
    background: linear-gradient(165deg, rgba(18, 27, 44, .95), rgba(16, 23, 38, .95));
    border: 1px solid #2b3d5c;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}
.decision-card-primary {
    background:
        radial-gradient(520px 220px at 100% 0, rgba(79, 140, 255, .22), transparent 60%),
        linear-gradient(165deg, rgba(18, 27, 44, .95), rgba(16, 23, 38, .95));
}
.decision-label {
    color: #9fb6da;
    font-size: .76rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: .25rem;
}
.decision-title {
    color: #f5f8ff;
    font-size: 1.28rem;
    line-height: 1.2;
    margin-bottom: .35rem;
}
.decision-copy {
    color: #d3deef;
    font-size: .92rem;
    margin-bottom: .75rem;
}
.decision-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
    color: #f7fbff;
}
.decision-sub {
    color: #8fa4c4;
    font-size: .84rem;
    margin-top: .2rem;
}
.decision-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}
.decision-micro {
    color: #8fa4c4;
    font-size: .8rem;
}
.severity-pill {
    border-radius: 999px;
    padding: .2rem .66rem;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}
.severity-pill.sev-critical { background: rgba(239, 68, 68, .18); color: #fecaca; }
.severity-pill.sev-high { background: rgba(249, 115, 22, .2); color: #fdba74; }
.severity-pill.sev-medium { background: rgba(234, 179, 8, .2); color: #fde68a; }
.severity-pill.sev-low { background: rgba(34, 197, 94, .2); color: #bbf7d0; }

.context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: .9rem;
}
.context-card {
    background: #f8fafc;
    border: 1px solid #d9e3f0;
    border-radius: 10px;
    padding: .9rem 1rem;
    color: #0f172a;
}
.context-card h3,
.context-card h4 {
    font-size: 1.02rem;
    margin-bottom: .45rem;
    color: #425674;
}

.taxonomy-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: .85rem;
    margin: 1rem 0 1.2rem;
}
.taxonomy-card {
    background: #f8fafc;
    border: 1px solid #d9e3f0;
    border-radius: 10px;
    padding: .75rem .9rem;
}
.taxonomy-label {
    display: block;
    color: #64748b;
    font-size: .8rem;
    margin-bottom: .35rem;
}

.findings-section h2 {
    color: #e5edf8;
}
.findings-section .muted {
    color: #9fb0cb;
}

.filter-bar {
    margin: .6rem 0 1rem;
}
.filter-btn {
    border: 1px solid #2a3b57;
    color: #9eb1cc;
}
.filter-btn:hover {
    color: #dce7f8;
    border-color: #3d5e91;
}
.filter-btn.active {
    background: #2f5ca7;
    border-color: #2f5ca7;
}

.issue-accordion {
    gap: .75rem;
}
.issue-category {
    border: 1px solid #dde6f3;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.issue-category-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    list-style: none;
    padding: .95rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e7edf6;
}
.issue-category-summary::-webkit-details-marker {
    display: none;
}
.issue-summary-main h3 {
    font-size: 1.1rem;
    color: #0f172a;
    line-height: 1.25;
    margin: .16rem 0;
}
.issue-summary-main p {
    color: #64748b;
    font-size: .87rem;
}
.issue-state-pill {
    display: inline-block;
    background: #e8f1ff;
    color: #1d4ed8;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: .16rem .58rem;
}
.issue-summary-stats {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.issue-stat-pill {
    border-radius: 999px;
    background: #edf2f9;
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
    padding: .14rem .52rem;
}

.issue-category-body {
    padding: .9rem 1rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.issue-guidance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
    margin-bottom: .7rem;
}
.issue-context-card {
    background: #f8fafc;
}
.issue-taxonomy {
    margin-bottom: .75rem;
}
.issue-taxonomy .chip-row {
    margin-top: .4rem;
}
.summary-chip {
    background: #e9eff8;
    color: #334155;
}

.finding-evidence-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .7rem;
}
.finding-evidence-card {
    border: 1px solid #dbe4f0;
    border-left: 4px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}
.finding-evidence-card.finding-critical { border-left-color: #e11d48; }
.finding-evidence-card.finding-high { border-left-color: #ea580c; }
.finding-evidence-card.finding-medium { border-left-color: #eab308; }
.finding-evidence-card.finding-low { border-left-color: #16a34a; }
.finding-evidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .65rem;
    padding: .75rem .85rem;
    border-bottom: 1px solid #ebf0f7;
    background: #f8fbff;
}
.finding-evidence-title {
    font-weight: 700;
    color: #0f172a;
}
.finding-evidence-badges {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.finding-evidence-meta {
    display: grid;
    grid-template-columns: 1fr 130px 130px;
    gap: .7rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid #edf2f8;
}
.finding-evidence-meta p {
    color: #0f172a;
    font-weight: 700;
}
.finding-evidence-body {
    padding: .75rem .85rem .85rem;
}
.evidence-detail {
    color: #1f2937;
    margin-bottom: .5rem;
    line-height: 1.45;
}
.evidence-remediation {
    color: #0f172a;
    background: #f2f7ff;
    border: 1px solid #d8e5fa;
    border-radius: 8px;
    padding: .5rem .65rem;
    font-size: .9rem;
}

body .results-title a {
    color: #9ec4ff;
    text-decoration: underline;
}
body .results-meta {
    color: #9fb0cb;
}

@media (max-width: 1180px) {
    .decision-grid {
        grid-template-columns: 1fr 1fr;
    }
    .taxonomy-row {
        grid-template-columns: 1fr;
    }
    .context-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .nav-container {
        padding: .75rem 1rem;
        gap: .75rem;
    }
    .nav-brand {
        gap: .65rem;
    }
    .brand-text {
        font-size: .95rem;
    }
    .nav-links {
        gap: .85rem;
    }
    .hero {
        padding: 3.5rem 1rem 3rem;
    }
    .decision-grid {
        grid-template-columns: 1fr;
    }
    .issue-category-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    .issue-summary-stats {
        justify-content: flex-start;
    }
    .issue-guidance-grid {
        grid-template-columns: 1fr;
    }
    .finding-evidence-meta {
        grid-template-columns: 1fr;
    }
}

/* ---------- Empty state ---------- */
.empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 560px;
    margin: 2.5rem auto;
    box-shadow: var(--shadow-sm);
}
.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 1rem;
}
.empty-state__icon svg { width: 26px; height: 26px; }
.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: -.01em;
    margin-bottom: .35rem;
}
.empty-state p {
    color: var(--text-muted);
    font-size: .92rem;
    margin-bottom: 1.5rem;
    line-height: 1.55;
}
.empty-state__actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Page header (history/compare) ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.page-header__titles h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: -.015em;
    margin-bottom: .25rem;
}
.page-header__titles p {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.4;
}
.page-header__actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

/* ---------- Inline / lucide-style icons ---------- */
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-inline { vertical-align: -3px; margin-right: .35em; }

/* ---------- Reduced motion (a11y) ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
}

/* ---------- Forced colors / Windows High Contrast ---------- */
@media (forced-colors: active) {
    .brand-text, .gradient-text {
        color: CanvasText !important;
        background: transparent !important;
        -webkit-text-fill-color: CanvasText !important;
    }
    .btn-primary { border: 1px solid ButtonText; }
}
