:root {
    --ink: #0b1721;
    --muted: #5c6b76;
    --line: #dfe7e3;
    --surface: #ffffff;
    --soft: #f1f7f4;
    --brand: #0a9f5a;
    --brand-dark: #057341;
    --navy: #071b25;
    --danger: #d92d4b;
    --warning: #d97706;
    --shadow: 0 24px 70px rgba(7, 27, 37, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.public-shell {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(16, 185, 129, .13), transparent 31rem),
        linear-gradient(180deg, #f8fbfa 0, #fff 42rem);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

.public-header {
    width: min(1180px, calc(100% - 40px));
    height: 84px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
body.public-shell { padding-top: 72px; }
.public-brand img { width: 184px; display: block; }
.public-header nav { display: flex; align-items: center; gap: 28px; }
.public-header a { color: #28404b; text-decoration: none; font-weight: 600; font-size: .93rem; }
.public-header a[aria-current="page"] { color: var(--brand-dark); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, #0bbf6c, #087743); box-shadow: 0 12px 28px rgba(10, 159, 90, .24); }
.button-ghost { border-color: #b8ccc2; background: rgba(255,255,255,.72); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.scanner-hero {
    min-height: 640px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: clamp(42px, 7vw, 94px);
    padding: 64px 0 82px;
}
.eyebrow { color: var(--brand-dark); font-size: .78rem; letter-spacing: .14em; font-weight: 800; text-transform: uppercase; }
.scanner-copy h1 { max-width: 760px; margin: 18px 0 22px; font-size: clamp(2.7rem, 5.8vw, 5.25rem); line-height: .98; letter-spacing: -.055em; }
.scanner-copy p { max-width: 620px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.18rem); }
.scanner-panel { padding: clamp(26px, 4vw, 42px); border: 1px solid rgba(10,159,90,.16); border-radius: 24px; background: rgba(255,255,255,.86); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.scanner-panel label { display: block; margin-bottom: 10px; color: #263b45; font-weight: 700; }
.scan-input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.scan-input-row input { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid #b8cbc2; border-radius: 12px; background: white; font: inherit; color: var(--ink); }
.scan-input-row input:focus { outline: 3px solid rgba(10,159,90,.16); border-color: var(--brand); }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }
.scan-status { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.status-line { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 10px; color: #334b55; font-size: .9rem; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e4eee9; }
.progress-track span { display: block; width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0bbf6c, #37d899); transition: width .35s ease; }

.scan-results { scroll-margin-top: 30px; padding: 70px 0 90px; border-top: 1px solid var(--line); }
.result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.result-heading h2 { margin: 8px 0 4px; font-size: clamp(1.8rem, 3vw, 2.8rem); word-break: break-word; }
.result-heading p { margin: 0; color: var(--muted); }
.score-ring { flex: 0 0 116px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; color: white; background: conic-gradient(#10b981 0 82%, #dbe9e2 82%); box-shadow: inset 0 0 0 10px white, 0 12px 34px rgba(7,27,37,.12); }
.score-ring strong { display: block; color: var(--ink); font-size: 2rem; line-height: 1; }
.score-ring span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.summary-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.summary-card strong { display: block; font-size: 1.7rem; line-height: 1.2; }
.summary-card span { color: var(--muted); font-size: .83rem; }
.summary-card.severity-critical strong, .summary-card.severity-high strong { color: var(--danger); }
.summary-card.severity-medium strong { color: var(--warning); }
.result-grid { display: grid; grid-template-columns: minmax(260px, .36fr) minmax(0, 1fr); gap: 22px; }
.result-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 12px 40px rgba(7,27,37,.06); }
.result-card h3 { margin: 0 0 22px; }
.card-title-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.pill { padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.facts-list { display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; margin: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; text-align: right; font-weight: 700; }
.finding-list { display: grid; gap: 12px; }
.finding { padding: 18px; border: 1px solid var(--line); border-left: 4px solid #7a8b93; border-radius: 12px; background: #fbfdfc; }
.finding.severity-critical, .finding.severity-high { border-left-color: var(--danger); }
.finding.severity-medium { border-left-color: var(--warning); }
.finding.severity-low { border-left-color: #2d7dd2; }
.finding-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.finding h4 { margin: 0; font-size: .98rem; }
.finding-head span { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.finding p { margin: 7px 0 0; color: var(--muted); font-size: .86rem; }
.notice { margin-top: 18px; padding: 16px 18px; border-radius: 12px; font-size: .9rem; }
.notice-error { color: #8f1930; background: #fff0f3; border: 1px solid #f4bdc8; }
.notice-info { color: #1f4f63; background: #eef8fc; border: 1px solid #c8e4ed; }

.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 80px 0 110px; }
.trust-grid article { padding: 28px; border-top: 1px solid var(--line); }
.trust-grid article > span { color: var(--brand); font-size: .78rem; font-weight: 800; }
.trust-grid h3 { margin: 16px 0 8px; }
.trust-grid p { margin: 0; color: var(--muted); font-size: .93rem; }
.public-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 36px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }

[hidden] { display: none !important; }
@media (max-width: 850px) {
    .public-header nav a:not(.button) { display: none; }
    .scanner-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 52px; }
    .result-grid { grid-template-columns: 1fr; }
    .trust-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .public-header, main, .public-footer { width: min(100% - 24px, 1180px); }
    .public-brand img { width: 148px; }
    .scan-input-row { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .result-heading { align-items: flex-start; }
    .score-ring { flex-basis: 92px; }
    .public-footer { display: grid; gap: 5px; }
}

