:root {
    --bg: #07111f;
    --bg-soft: #0c192b;
    --surface: rgba(17, 31, 51, 0.94);
    --surface-strong: #13243b;
    --surface-light: #182c47;

    --text: #f3f7fc;
    --text-soft: #b5c4d8;
    --text-muted: #8295ad;

    --accent: #56b4ff;
    --accent-strong: #238fe8;
    --accent-soft: rgba(86, 180, 255, 0.14);

    --success: #55d6a5;
    --success-soft: rgba(85, 214, 165, 0.14);

    --warning: #f0c76e;
    --warning-soft: rgba(240, 199, 110, 0.14);

    --danger: #ff7b85;
    --danger-soft: rgba(255, 123, 133, 0.13);

    --border: rgba(157, 184, 214, 0.16);
    --border-strong: rgba(157, 184, 214, 0.28);

    --shadow:
        0 22px 55px rgba(0, 0, 0, 0.28);

    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 10px;

    --max-width: 1240px;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--text);

    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(48, 145, 230, 0.16),
            transparent 32rem
        ),
        radial-gradient(
            circle at 88% 18%,
            rgba(52, 198, 165, 0.08),
            transparent 30rem
        ),
        var(--bg);

    line-height: 1.6;
}

button,
a,
audio {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}


/* Accessibility */

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;

    padding: 10px 14px;

    color: #08111d;
    background: #ffffff;

    border-radius: 8px;

    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}


/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;

    border-bottom: 1px solid var(--border);

    background:
        rgba(7, 17, 31, 0.86);

    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(
        calc(100% - 40px),
        var(--max-width)
    );

    margin: 0 auto;

    min-height: 88px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    color: #07111f;
    background:
        linear-gradient(
            135deg,
            #76c5ff,
            #56d7b4
        );

    border-radius: 14px;

    font-weight: 900;
    letter-spacing: -0.03em;

    box-shadow:
        0 8px 28px rgba(65, 173, 240, 0.22);
}

.brand h1 {
    margin: 1px 0 0;

    font-size: clamp(
        1.05rem,
        2vw,
        1.4rem
    );

    line-height: 1.2;
    letter-spacing: -0.025em;
}

.eyebrow {
    margin: 0 0 5px;

    color: var(--accent);

    font-size: 0.73rem;
    font-weight: 800;

    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    padding: 8px 13px;

    color: var(--text-soft);

    background: rgba(255, 255, 255, 0.035);

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 0.88rem;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;

    background: var(--success);

    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(85, 214, 165, 0.12);
}


/* Main layout */

.page-shell {
    width: min(
        calc(100% - 40px),
        var(--max-width)
    );

    margin: 0 auto;

    padding: 64px 0 80px;
}

.hero {
    display: grid;
    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(280px, 0.75fr);

    gap: 38px;

    align-items: center;

    margin-bottom: 52px;
}

.hero-copy h2 {
    max-width: 830px;

    margin: 0;

    font-size: clamp(
        2.4rem,
        6vw,
        5rem
    );

    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-description {
    max-width: 800px;

    margin: 26px 0 0;

    color: var(--text-soft);

    font-size: clamp(
        1rem,
        1.7vw,
        1.16rem
    );
}

.hero-actions {
    margin-top: 30px;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.primary-button {
    min-height: 50px;

    padding: 0 20px;

    color: #06101d;

    background:
        linear-gradient(
            135deg,
            #6ec2ff,
            #63dfbd
        );

    border-radius: 12px;

    cursor: pointer;

    font-weight: 850;

    box-shadow:
        0 10px 34px rgba(69, 178, 239, 0.18);

    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.primary-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 14px 38px rgba(69, 178, 239, 0.26);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    opacity: 0.58;
    cursor: wait;
}

.secondary-link {
    color: var(--accent);

    font-weight: 750;
    text-decoration: none;
}

.secondary-link:hover {
    text-decoration: underline;
}

.hero-policy-card {
    padding: 26px;

    background:
        linear-gradient(
            145deg,
            rgba(26, 47, 76, 0.96),
            rgba(13, 28, 47, 0.96)
        );

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);
}

.hero-policy-card h3 {
    margin: 0;

    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.policy-list {
    margin: 22px 0 0;
    padding: 0;

    display: grid;
    gap: 14px;

    list-style: none;
}

.policy-list li {
    position: relative;

    padding-left: 28px;

    color: var(--text-soft);
}

.policy-list li::before {
    content: "✓";

    position: absolute;
    left: 0;
    top: 0;

    color: var(--success);

    font-weight: 900;
}


/* State panels */

.state-panel {
    margin: 0 0 34px;

    padding: 22px 24px;

    display: flex;
    align-items: center;
    gap: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow);
}

.state-panel h2 {
    margin: 0 0 3px;

    font-size: 1rem;
}

.state-panel p {
    margin: 0;

    color: var(--text-soft);
}

.error-panel {
    border-color: rgba(255, 123, 133, 0.36);
    background: var(--danger-soft);
}

.spinner {
    width: 26px;
    height: 26px;

    flex: 0 0 auto;

    border:
        3px solid rgba(255, 255, 255, 0.15);

    border-top-color: var(--accent);

    border-radius: 50%;

    animation:
        spin 900ms linear infinite;
}

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


/* Results */

.results {
    display: grid;
    gap: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;
}

.metric-card {
    min-height: 132px;

    padding: 20px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.18);
}

.metric-label {
    color: var(--text-muted);

    font-size: 0.76rem;
    font-weight: 800;

    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.metric-value {
    color: var(--text);

    font-size: clamp(
        1.65rem,
        3vw,
        2.35rem
    );

    line-height: 1;
    letter-spacing: -0.05em;
    text-transform: capitalize;
}

.content-card {
    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.19);
}

.executive-card {
    border-color:
        rgba(86, 180, 255, 0.30);

    background:
        linear-gradient(
            140deg,
            rgba(21, 45, 72, 0.98),
            rgba(15, 31, 52, 0.96)
        );
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;

    font-size: clamp(
        1.3rem,
        2.5vw,
        1.7rem
    );

    letter-spacing: -0.03em;
}

.section-intro {
    margin: -8px 0 24px;

    max-width: 900px;

    color: var(--text-soft);
}

.briefing-text {
    margin: 0;

    color: #e5edf8;

    font-size: 1.04rem;
}

.badge {
    flex: 0 0 auto;

    padding: 7px 11px;

    color: var(--success);

    background: var(--success-soft);

    border:
        1px solid rgba(85, 214, 165, 0.26);

    border-radius: 999px;

    font-size: 0.76rem;
    font-weight: 800;
}

.two-column-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 24px;
}


/* Evidence */

#recall-title {
    margin: 0 0 26px;

    font-size: 1.18rem;
    line-height: 1.45;
}

.evidence-group {
    margin: 0 0 24px;
}

.evidence-group h4 {
    margin: 0 0 8px;

    color: var(--accent);

    font-size: 0.76rem;
    font-weight: 850;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.evidence-group p {
    margin: 0 0 8px;

    color: var(--text-soft);
}

.source-link {
    display: inline-flex;
    align-items: center;

    margin-top: 4px;

    color: var(--accent);

    font-weight: 800;
    text-decoration: none;
}

.source-link::after {
    content: "↗";

    margin-left: 6px;
}

.source-link:hover {
    text-decoration: underline;
}


/* Explainability */

.score-ring {
    --score: 0;

    width: 76px;
    height: 76px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            var(--surface-strong) 58%,
            transparent 60%
        ),
        conic-gradient(
            var(--accent)
            calc(var(--score) * 1%),
            rgba(255, 255, 255, 0.08)
            0
        );
}

.score-ring span {
    font-size: 1.22rem;
    font-weight: 900;
}

.factor-list {
    display: grid;
    gap: 12px;
}

.factor-item {
    padding: 15px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.factor-topline {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 6px;
}

.factor-name {
    font-weight: 800;
}

.factor-points {
    color: var(--accent);

    font-weight: 900;
}

.factor-explanation {
    margin: 0;

    color: var(--text-soft);

    font-size: 0.91rem;
}

.methodology-notice {
    margin: 20px 0 0;

    padding: 14px;

    color: var(--warning);

    background: var(--warning-soft);

    border:
        1px solid rgba(240, 199, 110, 0.22);

    border-radius: var(--radius-sm);

    font-size: 0.86rem;
}


/* Audio */

.audio-segments {
    display: grid;
    gap: 10px;
}

.audio-segment {
    display: grid;
    grid-template-columns:
        42px minmax(0, 1fr) auto;

    gap: 14px;

    align-items: center;

    padding: 14px 16px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 12px;
}

.audio-sequence {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    color: var(--text-soft);
    background: var(--surface-light);

    border-radius: 9px;

    font-size: 0.78rem;
    font-weight: 900;
}

.audio-copy {
    min-width: 0;
}

.audio-copy p {
    margin: 0;

    color: var(--text);
}

.audio-status {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 0.76rem;
}

.audio-segment audio {
    width: 230px;
    max-width: 100%;
    height: 36px;
}

.audio-unavailable {
    color: var(--text-muted);

    font-size: 0.78rem;
    font-weight: 750;
}


/* Governance */

.detail-list {
    margin: 0;

    display: grid;
    gap: 4px;
}

.detail-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 0.85fr)
        minmax(0, 1.15fr);

    gap: 18px;

    padding: 13px 0;

    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row dt {
    color: var(--text-muted);

    font-size: 0.84rem;
    font-weight: 750;
}

.detail-row dd {
    margin: 0;

    color: var(--text);

    text-align: right;

    overflow-wrap: anywhere;
}

.tool-trace {
    display: grid;
    gap: 12px;
}

.trace-item {
    position: relative;

    padding: 15px 15px 15px 46px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.trace-sequence {
    position: absolute;
    top: 15px;
    left: 14px;

    width: 23px;
    height: 23px;

    display: grid;
    place-items: center;

    color: var(--accent);

    background: var(--accent-soft);

    border-radius: 50%;

    font-size: 0.72rem;
    font-weight: 900;
}

.trace-title {
    margin: 0;

    font-weight: 850;
}

.trace-meta {
    margin: 3px 0 0;

    color: var(--text-muted);

    font-size: 0.82rem;
}


/* Metadata */

.metadata-grid {
    margin: 0;

    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 1px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.metadata-grid > div {
    min-width: 0;

    padding: 17px;

    background: rgba(255, 255, 255, 0.025);
}

.metadata-grid dt {
    margin-bottom: 6px;

    color: var(--text-muted);

    font-size: 0.72rem;
    font-weight: 800;

    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.metadata-grid dd {
    margin: 0;

    color: var(--text-soft);

    font-size: 0.85rem;

    overflow-wrap: anywhere;
}


/* Footer */

.site-footer {
    width: min(
        calc(100% - 40px),
        var(--max-width)
    );

    margin: 0 auto;

    padding: 28px 0 42px;

    display: flex;
    justify-content: space-between;
    gap: 28px;

    color: var(--text-muted);

    border-top: 1px solid var(--border);

    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}


/* Focus */

button:focus-visible,
a:focus-visible,
audio:focus-visible {
    outline:
        3px solid rgba(86, 180, 255, 0.72);

    outline-offset: 3px;
}


/* Responsive */

@media (max-width: 980px) {
    .hero,
    .two-column-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 680px) {
    .header-inner {
        width: min(
            calc(100% - 28px),
            var(--max-width)
        );

        min-height: 80px;
    }

    .system-status {
        display: none;
    }

    .page-shell {
        width: min(
            calc(100% - 28px),
            var(--max-width)
        );

        padding-top: 42px;
    }

    .hero {
        gap: 26px;
    }

    .hero-copy h2 {
        font-size: clamp(
            2.25rem,
            14vw,
            4rem
        );
    }

    .summary-grid,
    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .content-card {
        padding: 21px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .audio-segment {
        grid-template-columns:
            36px minmax(0, 1fr);
    }

    .audio-segment audio,
    .audio-unavailable {
        grid-column: 2;
        width: 100%;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-row dd {
        text-align: left;
    }

    .site-footer {
        width: min(
            calc(100% - 28px),
            var(--max-width)
        );

        flex-direction: column;
        gap: 10px;
    }
}

@media (
    prefers-reduced-motion: reduce
) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ---------------------------------------------------------
   Compact agent workflow
   --------------------------------------------------------- */

.workflow-strip {
    margin-top: 30px;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    color: var(--text-soft);
}

.workflow-step {
    min-height: 42px;

    padding: 9px 13px;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    background: rgba(255, 255, 255, 0.035);

    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 0.82rem;
    font-weight: 750;
}

.workflow-number {
    color: var(--accent);

    font-size: 0.7rem;
    font-weight: 900;

    letter-spacing: 0.08em;
}

.workflow-arrow {
    color: var(--text-muted);

    font-size: 1rem;
    font-weight: 900;
}


/* ---------------------------------------------------------
   Governed narration summary
   --------------------------------------------------------- */

.audio-summary {
    margin: 0 0 22px;

    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;
}

.audio-summary-item {
    padding: 15px 16px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 12px;
}

.audio-summary-item strong {
    color: var(--accent);

    font-size: 1.35rem;
    line-height: 1;
}

.audio-summary-item span {
    color: var(--text-muted);

    font-size: 0.77rem;
    font-weight: 750;
}


/* Approved audio stays immediately visible */

.approved-audio-segments {
    margin-bottom: 20px;
}


/* ---------------------------------------------------------
   Collapsed text-only evidence
   --------------------------------------------------------- */

.withheld-audio-details {
    margin-top: 18px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.018);

    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.withheld-audio-details summary {
    min-height: 58px;

    padding: 15px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    color: var(--text);

    cursor: pointer;

    font-weight: 800;

    list-style: none;
}

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

.withheld-audio-details summary::after {
    content: "+";

    margin-left: 10px;

    color: var(--accent);

    font-size: 1.25rem;
    font-weight: 900;
}

.withheld-audio-details[open] summary::after {
    content: "−";
}

.withheld-audio-details[open] summary {
    border-bottom: 1px solid var(--border);
}

.withheld-count {
    margin-left: auto;

    color: var(--text-muted);

    font-size: 0.76rem;
    font-weight: 750;
}

.withheld-count span {
    color: var(--warning);

    font-weight: 900;
}

.withheld-explanation {
    margin: 0;

    padding: 16px 18px 5px;

    color: var(--text-muted);

    font-size: 0.84rem;
}

.text-only-audio-segments {
    padding: 12px 16px 16px;
}

.text-only-segment {
    opacity: 0.78;
}


/* ---------------------------------------------------------
   Responsive additions
   --------------------------------------------------------- */

@media (max-width: 760px) {
    .workflow-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .workflow-arrow {
        display: none;
    }

    .workflow-step {
        width: 100%;
    }

    .audio-summary {
        grid-template-columns: 1fr;
    }

    .withheld-audio-details summary {
        align-items: flex-start;
    }
}
