/* ============================================================
   Curagent — Light App stylesheet
   Shared by all authenticated (light) pages: Register, Login,
   Dashboard, Analyze, Report, Billing, admin, share.
   Dark landing/developers pages keep their own CSS untouched.
   ============================================================ */

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

:root {
    /* four surface levels — the key to "pop" on light */
    --bg: #ECEEEA;          /* page: tinted, so white cards lift */
    --surface: #FFFFFF;     /* card level */
    --recessed: #F0F2EE;    /* evidence / inset block: recessed */
    --ink: #16110C;
    --ink2: #4A4640;
    --muted: #8A8C86;
    --line: #E2E5DF;
    --line2: #D2D6CE;
    /* pine green working accent */
    --accent: #1F4B3F;
    --accent-dim: rgba(31,75,63,0.07);
    --accent-line: rgba(31,75,63,0.25);
    /* saturated state colors */
    --green: #2E9E6B;
    --amber: #C98A2B;
    --red: #D2503A;
    --blue: #4172C4;
    --bronze: #B87333;
    --font-serif: 'DM Serif Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'DM Mono', monospace;
    /* shared elevation */
    --shadow-card: 0 1px 2px rgba(22,17,12,0.04), 0 14px 40px rgba(22,17,12,0.14);
    --shadow-item: 0 1px 2px rgba(22,17,12,0.03), 0 8px 24px rgba(22,17,12,0.13);
    --shadow-pop: 0 12px 32px rgba(22,17,12,0.16);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ NAV ============ */
.app-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.app-nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 40px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: #0E0E10; display: flex; align-items: center; justify-content: center; color: var(--bronze); font-family: var(--font-serif); font-size: 16px; }
.logo-text { font-family: var(--font-serif); font-size: 20px; color: var(--bronze); letter-spacing: -0.3px; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-link { font-size: 13.5px; color: var(--ink2); text-decoration: none; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--accent); font-weight: 600; }
.nav-balance { font-family: var(--font-mono); font-size: 12px; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: 100px; padding: 5px 12px; text-decoration: none; }

/* ============ LAYOUT ============ */
.app { max-width: 1080px; margin: 0 auto; padding: 44px 40px 90px; }
.page-title { font-family: var(--font-serif); font-size: 40px; font-weight: 400; letter-spacing: -0.5px; margin-bottom: 4px; }
.page-sub { font-size: 14.5px; color: var(--muted); margin-bottom: 28px; }

/* ============ BUTTONS ============ */
.btn { display: inline-block; width: 100%; text-align: center; font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 13px 16px; border-radius: 9px; border: 1px solid var(--accent-line); background: rgba(31,75,63,0.20); color: var(--accent); cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: rgba(31,75,63,0.32); opacity: 1; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-inline { width: auto; padding: 9px 16px; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line2); color: var(--ink); font-weight: 500; }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); opacity: 1; }
.btn-sm { padding: 9px 15px; font-size: 13px; }
.btn-auto { width: auto; }

/* ============ CARD ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); }

/* ============ FORMS ============ */
.form-field { margin-bottom: 16px; }
.form-label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.form-input {
    display: block; width: 100%;
    background: var(--surface);
    border: 1px solid var(--line2);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }

/* validation summary / field errors (ASP.NET Identity) */
.validation-summary-errors { color: var(--red); font-size: 13px; margin-bottom: 14px; }
.validation-summary-errors ul { list-style: none; }
.field-validation-error { display: block; color: var(--red); font-size: 12px; margin-top: 5px; }

/* ============ MISC ============ */
.muted { color: var(--muted); }
.dash-placeholder { padding: 44px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); }

/* ============ DASHBOARD ============ */
.dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.dash-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 6px;
}

.onboard-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: rgba(31,75,63,0.20);
    border: 1px solid var(--accent-line);
    border-radius: 12px;
}

.onboard-title {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 4px;
}

.onboard-text {
    font-size: 14px;
    color: var(--ink2);
    line-height: 1.5;
}

.onboard-banner .btn {
    flex-shrink: 0;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-row {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 22px;
    text-decoration: none;
    box-shadow: var(--shadow-item);
    transition: border-color .15s;
}

    .report-row:hover {
        border-color: var(--accent-line);
    }

.row-main {
    flex: 1;
}

.row-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 3px;
}

.row-meta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
}

.row-verdict {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

    .row-verdict:not(.verdict-approve):not(.verdict-reject) {
        background: rgba(201,138,43,0.10);
        color: var(--amber);
        border: 1px solid rgba(201,138,43,0.3);
    }

.verdict-approve {
    background: rgba(46,158,107,0.12);
    color: var(--green);
    border: 1px solid rgba(46,158,107,0.35);
}

.verdict-reject {
    background: rgba(210,80,58,0.12);
    color: var(--red);
    border: 1px solid rgba(210,80,58,0.35);
}

.row-score {
    font-family: var(--font-serif);
    font-size: 26px;
    min-width: 44px;
    text-align: right;
}

/* ============ ANALYZE UPLOAD ============ */
.analyze-upload {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
}

.upload-drop {
    display: block;
    border: 1.5px dashed var(--line2);
    border-radius: 10px;
    padding: 48px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

    .upload-drop:hover, .upload-drop.dragover {
        border-color: var(--accent-line);
        background: var(--accent-dim);
    }

.file-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--recessed);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13.5px;
}

    .file-item .remove {
        background: none;
        border: none;
        color: var(--muted);
        font-size: 18px;
        cursor: pointer;
        line-height: 1;
    }

        .file-item .remove:hover {
            color: var(--red);
        }

.analyze-upload .btn {
    margin-top: 14px;
}

/* ============ REPORT TOOLBAR ============ */
.report-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 18px;
}

.report-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-toolbar-note {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
}

.share-wrap {
    position: relative;
}

.share-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--line2);
    border-radius: 10px;
    padding: 16px;
    z-index: 50;
    box-shadow: var(--shadow-pop);
}

.share-popover-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
}

.share-popover-row {
    display: flex;
    gap: 8px;
}

    .share-popover-row input {
        flex: 1;
        background: var(--recessed);
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 8px 10px;
        color: var(--ink);
        font-family: var(--font-mono);
        font-size: 12px;
        outline: none;
    }

        .share-popover-row input:focus {
            border-color: var(--accent-line);
        }

/* ============ REPORT OUTPUT ============ */
.result-area {
    margin-top: 4px;
}

.report-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 26px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.report-verdict-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.report-verdict {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

    .report-verdict:not(.verdict-approve):not(.verdict-reject) {
        background: rgba(201,138,43,0.12);
        color: var(--amber);
        border: 1px solid rgba(201,138,43,0.35);
    }

.report-meta {
    font-size: 13px;
    color: var(--muted);
}

    .report-meta .meta-label {
        font-family: var(--font-mono);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-right: 6px;
    }

.report-summary {
    font-size: 15.5px;
    color: var(--ink2);
    line-height: 1.6;
}

.report-section {
    margin-bottom: 32px;
}

.section-heading {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.4px;
    margin-bottom: 18px;
}

.action-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    align-items: start;
    box-shadow: var(--shadow-item);
}

.action-bucket {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 100px;
    text-align: center;
    height: fit-content;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bucket-blocker {
    background: rgba(210,80,58,0.12);
    color: var(--red);
    border: 1px solid rgba(210,80,58,0.35);
}

.bucket-delay {
    background: rgba(201,138,43,0.13);
    color: var(--amber);
    border: 1px solid rgba(201,138,43,0.38);
}

.bucket-review, .action-bucket:not(.bucket-blocker):not(.bucket-delay):not(.bucket-reference) {
    background: rgba(65,114,196,0.11);
    color: var(--blue);
    border: 1px solid rgba(65,114,196,0.34);
}

.action-bucket.bucket-reference {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-line);
}

.action-title {
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.action-text {
    font-size: 13.5px;
    color: var(--ink2);
    line-height: 1.55;
}

.cluster {
    margin-bottom: 18px;
}

.cluster-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.cluster-title {
    font-family: var(--font-serif);
    font-size: 21px;
    color: var(--ink);
}

.cluster-summary {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 16px;
}

.finding {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-item);
}

    .finding:last-child {
        margin-bottom: 0;
    }

.finding-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.finding-rule {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink2);
}

.finding-sev-right {
    margin-left: auto;
}

.finding-cat {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
    border-radius: 100px;
    padding: 3px 10px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.finding-pts {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
    margin-left: auto;
}

.cure-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

    .cure-check input {
        accent-color: var(--accent);
        cursor: pointer;
        width: 15px;
        height: 15px;
    }

.finding-msg {
    font-size: 15px;
    font-weight: 600;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.45;
}

.finding-evidence {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink2);
    line-height: 1.6;
    background: var(--recessed);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

    .finding-evidence .ev-label {
        display: block;
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: var(--muted);
        margin-bottom: 6px;
        font-weight: 500;
    }

.finding-cure {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.6;
    background: rgba(31,75,63,0.20);
    border: 1px solid var(--accent-line);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.cure-badge {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border-radius: 100px;
    padding: 3px 9px;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.cure-badge-rule {
    background: var(--muted);
}

/* verdict states shared (approve/reject) already defined in dashboard section */

/* analyze error */
.analyze-error {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-item);
}

.analyze-error-upgrade {
    border-color: var(--accent-line);
    background: var(--accent-dim);
}

.analyze-error-msg {
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 14px;
}

.back-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}

    .back-link:hover {
        color: var(--accent);
    }

/* ============ BILLING ============ */
.billing-status {
    margin-bottom: 28px;
    font-size: 14px;
    color: var(--ink2);
}

.bundle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bundle-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-item);
}

.bundle-featured {
    border-color: var(--accent-line);
    box-shadow: var(--shadow-card);
}

.bundle-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: var(--accent);
    padding: 4px 12px;
    border-radius: 100px;
}

.bundle-name {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin-bottom: 14px;
}

.bundle-credits {
    font-size: 14px;
    color: var(--ink2);
    margin-bottom: 6px;
}

.bundle-price {
    font-family: var(--font-serif);
    font-size: 48px;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 22px;
}

.buy-btn {
    width: 100%;
}

/* ============ MOBILE ============ */
    @media (max-width: 720px) {
        .app-nav-inner {
            flex-wrap: wrap;
            height: auto;
            padding: 12px 20px;
            gap: 12px;
            position: relative;
        }

        .app-nav-links {
            flex: 1 1 100%;
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: nowrap;
        }

        #navBalance {
            position: absolute;
            top: 16px;
            right: 20px;
            white-space: nowrap;
            font-size: 11px;
            padding: 4px 10px;
        }

        .dash-head {
            flex-direction: column;
            gap: 16px;
        }

        .dash-actions {
            width: 100%;
            padding-top: 0;
        }

            .dash-actions .btn {
                flex: 1;
            }

        .bundle-grid {
            grid-template-columns: 1fr;
        }

        .action-item {
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .action-bucket {
            justify-self: start;
        }

        .finding {
            padding: 16px 16px;
        }

        .finding-top {
            flex-wrap: wrap;
            gap: 8px;
        }

        .share-popover {
            width: calc(100vw - 40px);
            right: auto;
            left: 0;
        }
    }

    .share-popover-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    #shareExpiry {
        font-family: var(--font-mono);
        font-size: 11px;
        color: var(--muted);
    }

    .share-revoke {
        font-family: var(--font-mono);
        font-size: 11px;
        color: var(--accent);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        text-decoration: none;
    }

        .share-revoke:hover {
            text-decoration: underline;
        }

        .share-revoke:disabled {
            color: var(--muted);
            cursor: default;
            text-decoration: none;
        }

    /* ============ SEVERITY BADGES ============ */
    .finding-sev {
        font-family: var(--font-mono);
        font-size: 10px;
        font-weight: 600;
        padding: 3px 9px;
        border-radius: 100px;
        letter-spacing: 0.4px;
        text-transform: uppercase;
    }

    .sev-critical {
        background: rgba(210,80,58,0.10);
        color: var(--red);
        border: 1px solid rgba(210,80,58,0.3);
    }

    .sev-warning {
        background: rgba(201,138,43,0.10);
        color: var(--amber);
        border: 1px solid rgba(201,138,43,0.3);
    }

    .sev-info {
        background: rgba(65,114,196,0.10);
        color: var(--blue);
        border: 1px solid rgba(65,114,196,0.3);
    }

    /* ============ ANALYZING SPINNER ============ */
    .analyzing {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 60px 24px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow-card);
    }

    .spinner {
        width: 34px;
        height: 34px;
        border: 3px solid var(--line2);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

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

    .analyzing-text {
        font-family: var(--font-mono);
        font-size: 13px;
        color: var(--muted);
    }

/* ============ STICKY SCORE BAR ============ */
.sticky-scores {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line2);
    box-shadow: 0 4px 16px rgba(22,17,12,0.08);
    padding: 14px 40px;
}

    .sticky-scores.visible {
        display: flex;
    }

.sticky-score {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 1080px;
}

.sticky-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    flex-shrink: 0;
}

.sticky-value {
    font-family: var(--font-serif);
    font-size: 30px;
    line-height: 1;
    color: var(--ink);
    flex-shrink: 0;
}

.sticky-bar {
    flex: 1;
    height: 7px;
    background: var(--recessed);
    border-radius: 100px;
    overflow: hidden;
}

.sticky-fill {
    display: block;
    height: 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
}

    .report-actions {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    /* ============ RISK SCORE CARD (single) ============ */
    .scores-row {
        display: block;
        margin-bottom: 32px;
    }

.risk-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 30px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 30px;
}

    .risk-left {
        display: flex;
        align-items: baseline;
        gap: 10px;
        flex-shrink: 0;
    }

    .risk-label {
        font-family: var(--font-mono);
        font-size: 10px;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 6px;
    }

    .risk-value {
        font-family: var(--font-serif);
        font-size: 34px;
        line-height: 1;
    }

    .risk-slash {
        font-size: 16px;
        color: var(--muted);
    }

.risk-right {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

    .risk-bar {
        height: 8px;
        background: var(--recessed);
        border-radius: 100px;
        overflow: hidden;
        margin-bottom: 8px;
    }

    .risk-fill {
        height: 100%;
        border-radius: 100px;
        transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    }

.risk-scale {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 8.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 5px;
}

/* ============ RISK LEVEL HERO (tier 1) ============ */
.level-hero {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 30px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
}

.level-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.level-cap {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
}

.level-word {
    font-family: var(--font-serif);
    font-size: 40px;
    line-height: 1;
}

.level-right {
    text-align: right;
    max-width: 46%;
}

.level-note {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.45;
}

.lvl-severe {
    border-left: 5px solid var(--red);
}

    .lvl-severe .level-word {
        color: var(--red);
    }

.lvl-high {
    border-left: 5px solid var(--red);
}

    .lvl-high .level-word {
        color: var(--red);
    }

.lvl-moderate {
    border-left: 5px solid var(--amber);
}

    .lvl-moderate .level-word {
        color: var(--amber);
    }

.lvl-low {
    border-left: 5px solid var(--green);
}

    .lvl-low .level-word {
        color: var(--green);
    }

.requirements-details {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.requirements-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .65rem;
    list-style: none;
    user-select: none;
}

    .requirements-summary::-webkit-details-marker {
        display: none;
    }

    .requirements-summary::marker {
        content: '';
    }

    /* Chevron drawn in CSS so it inherits colour and rotates on open. */
    .requirements-summary::before {
        content: '';
        width: .5rem;
        height: .5rem;
        border-right: 2px solid var(--muted);
        border-bottom: 2px solid var(--muted);
        transform: rotate(-45deg);
        transition: transform .22s ease;
        flex: 0 0 auto;
    }

.requirements-details[open] .requirements-summary::before {
    transform: rotate(45deg);
}

.requirements-badge {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: .02em;
}

.requirements-note {
    font-size: .875rem;
    color: var(--ink2);
    margin: .75rem 0 1.5rem;
    max-width: 62ch;
    line-height: 1.55;
}

.requirement-group-head {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 .85rem .15rem;
}

.requirement-count {
    display: none;
}

.requirement {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-item);
}

.requirement-num {
    flex: 0 0 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 600;
    margin-top: .1rem;
}

.requirement-text {
    flex: 1;
    line-height: 1.55;
    font-size: .925rem;
    color: var(--ink);
}

/* ============ API KEYS ============ */
.keys-alert {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.keys-alert-ok {
    background: rgba(46,158,107,0.09);
    border: 1px solid rgba(46,158,107,0.3);
    color: var(--green);
}

.keys-alert-err {
    background: rgba(210,80,58,0.09);
    border: 1px solid rgba(210,80,58,0.3);
    color: var(--red);
}

.key-reveal {
    border-color: var(--accent-line);
    padding: 20px 22px;
    margin-bottom: 24px;
}

.key-reveal-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.key-reveal-note {
    font-size: 13.5px;
    color: var(--ink2);
    margin-bottom: 14px;
}

.key-reveal-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .key-reveal-row .finding-evidence {
        flex: 1;
        margin: 0;
        word-break: break-all;
    }

.key-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 28px;
}

    .key-form .form-field {
        flex: 1;
        max-width: 280px;
        margin-bottom: 0;
    }

.key-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--recessed);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.key-row-revoked {
    opacity: .55;
}

.key-row-main {
    flex: 1;
}

.key-name {
    font-weight: 600;
    font-size: 14.5px;
}

.key-prefix {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 3px;
}

.key-meta {
    font-size: 12.5px;
    color: var(--muted);
    text-align: right;
    min-width: 150px;
}

.key-revoked-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
    margin-left: 8px;
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid rgba(210,80,58,0.35);
    font-weight: 500;
}

    .btn-danger:hover {
        background: rgba(210,80,58,0.06);
        opacity: 1;
    }

.key-usage {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink2);
    text-align: right;
    min-width: 90px;
}

.key-usage-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 2px;
}

.key-active-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--green);
    margin-left: 8px;
}

.key-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.key-pager-info {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
}

.key-pager a, .key-pager span.disabled {
    font-family: var(--font-mono);
    font-size: 11.5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--ink2);
}

    .key-pager a:hover {
        border-color: var(--accent-line);
        color: var(--accent);
    }

.key-pager span.disabled {
    opacity: .4;
}

/* ============ DEVELOPERS ============ */
.dev-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 26px 28px;
    margin-top: 28px;
}

.dev-section-title {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--ink);
    margin: 0 0 6px;
}

.dev-section-sub {
    font-size: 14px;
    color: var(--ink2);
    margin: 0 0 20px;
    max-width: 62ch;
    line-height: 1.55;
}

.dev-code {
    background: var(--recessed);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink);
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 14px;
}

.dev-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--ink2);
    margin-bottom: 8px;
    margin-top: 20px;
}

    .dev-label:first-of-type {
        margin-top: 0;
    }

.dev-note {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.dev-jump {
    display: flex;
    gap: 8px;
    margin: 18px 0 4px;
    flex-wrap: wrap;
}

    .dev-jump a {
        font-family: var(--font-mono);
        font-size: 11.5px;
        letter-spacing: .5px;
        color: var(--ink2);
        text-decoration: none;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 999px;
        padding: 7px 14px;
        transition: border-color .15s ease, color .15s ease;
    }

        .dev-jump a:hover {
            border-color: var(--accent-line);
            color: var(--accent);
        }

/* Stops a jumped-to section landing under the fixed nav. */
.dev-section {
    scroll-margin-top: 80px;
}