:root {
    color-scheme: dark;
    --bg: #070a12;
    --surface: #0e1421;
    --surface-raised: #121a2a;
    --surface-soft: #171f31;
    --line: #253047;
    --text: #f8fafc;
    --muted: #a6b0c3;
    --subtle: #77839a;
    --primary: #9b7cf7;
    --primary-bright: #b49aff;
    --accent: #f5b942;
    --success: #3dd6a0;
    --danger: #fb7185;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 78% 5%, rgba(139, 92, 246, .12), transparent 27rem),
        radial-gradient(circle at 12% 20%, rgba(245, 185, 66, .05), transparent 24rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
svg { display: block; width: 1.25rem; height: 1.25rem; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--text); color: var(--bg); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.site-header { border-bottom: 1px solid rgba(37, 48, 71, .72); background: rgba(7, 10, 18, .78); backdrop-filter: blur(18px); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--primary-bright); background: rgba(155, 124, 247, .1); border: 1px solid rgba(180, 154, 255, .24); border-radius: 11px; }
.brand-mark svg { width: 25px; height: 25px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .96rem; letter-spacing: .01em; }
.brand small { color: var(--subtle); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.version { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(61, 214, 160, .1); }
.operator-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--text); font-size: .84rem; font-weight: 650; text-decoration: none; transition: color 180ms ease; }
.operator-link:hover { color: var(--primary-bright); }
.operator-link:focus-visible, .brand:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 5px; border-radius: 4px; }

.main-content { padding-block: 5rem 4rem; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 7rem; align-items: end; margin-bottom: 4rem; }
.eyebrow, .kicker { margin: 0 0 .8rem; color: var(--accent); font-size: .7rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 7vw, 6.4rem); font-weight: 680; letter-spacing: -.065em; line-height: .92; }
.hero-copy { padding-bottom: .45rem; }
.hero-copy > p { margin: 0 0 1.4rem; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.guardrail { display: flex; align-items: flex-start; gap: .7rem; color: #ced5e3; font-size: .78rem; line-height: 1.45; }
.guardrail span { flex: none; width: 8px; height: 8px; margin-top: .24rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(245, 185, 66, .1); }

.metrics-grid { display: grid; grid-template-columns: 1.55fr repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.metric-card { position: relative; min-height: 154px; padding: 1.5rem; background: var(--surface); }
.metric-featured { background: linear-gradient(145deg, rgba(155, 124, 247, .17), rgba(14, 20, 33, .95) 62%); }
.metric-label { margin-bottom: .7rem; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .03em; }
.metric-value { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 660; letter-spacing: -.055em; line-height: 1; }
.metric-value span { margin-right: .2rem; color: var(--primary-bright); font-size: .72rem; letter-spacing: .08em; vertical-align: top; }
.metric-value.small { margin-top: 1.5rem; font-size: clamp(1.4rem, 2vw, 2rem); }
.metric-meta { margin-top: .85rem; color: var(--subtle); font-size: .7rem; }
.metric-icon { position: absolute; right: 1.25rem; top: 1.25rem; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.metric-icon.income { color: var(--success); background: rgba(61, 214, 160, .1); }
.metric-icon.expense { color: var(--danger); background: rgba(251, 113, 133, .1); }
.metric-icon.neutral { color: var(--primary-bright); background: rgba(155, 124, 247, .1); }

.operating-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.agent-status-panel { margin-bottom: 1.25rem; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: var(--line); }
.status-grid div { padding: 1.15rem 1.4rem; background: var(--surface); }
.status-grid dt { color: var(--subtle); font-size: .68rem; }
.status-grid dd { margin: .3rem 0 0; color: var(--text); font-size: .82rem; font-weight: 650; }
.content-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(14, 20, 33, .88); box-shadow: 0 16px 45px rgba(0, 0, 0, .14); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.45rem 1.55rem; border-bottom: 1px solid var(--line); }
.panel-header .kicker { margin-bottom: .35rem; color: var(--subtle); }
.panel h2 { margin: 0; font-size: 1rem; font-weight: 660; letter-spacing: -.015em; }
.count { padding: .32rem .58rem; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; font-size: .68rem; }
.experiment-body { padding: 1.65rem 1.55rem; }
.experiment-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.experiment-title-row h3 { margin: 0; font-size: 1.35rem; }
.experiment-body > p { max-width: 650px; margin: .75rem 0 1.65rem; color: var(--muted); }
.experiment-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0; }
.live-experiment-stats { grid-template-columns: repeat(4, 1fr); }
.experiment-stats div { padding-left: 1rem; border-left: 1px solid var(--line); }
.experiment-stats dt { color: var(--subtle); font-size: .68rem; }
.experiment-stats dd { margin: .2rem 0 0; font-size: 1rem; font-weight: 650; }
.shield { display: grid; place-items: center; width: 42px; height: 42px; color: var(--success); background: rgba(61, 214, 160, .08); border: 1px solid rgba(61, 214, 160, .2); border-radius: 13px; }
.shield svg { width: 24px; height: 24px; }
.safety-list { display: grid; gap: 1rem; margin: 0; padding: 1.5rem; list-style: none; }
.safety-list li { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .82rem; }
.safety-list span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.badge { display: inline-flex; align-items: center; white-space: nowrap; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .64rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.badge-active, .badge-successful, .badge-completed, .badge-approved, .badge-succeeded { color: #81e8c2; border-color: rgba(61, 214, 160, .25); background: rgba(61, 214, 160, .08); }
.badge-building, .badge-validating, .badge-action_pending, .badge-pending, .badge-medium { color: #c4afff; border-color: rgba(155, 124, 247, .3); background: rgba(155, 124, 247, .1); }
.badge-researching, .badge-low, .badge-recorded { color: #8dd9fb; border-color: rgba(56, 189, 248, .25); background: rgba(56, 189, 248, .08); }
.badge-high, .badge-paused { color: #ffd27b; border-color: rgba(245, 185, 66, .3); background: rgba(245, 185, 66, .09); }
.badge-prohibited, .badge-blocked, .badge-failed, .badge-error, .badge-rejected { color: #fda4b4; border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .09); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid rgba(37, 48, 71, .75); }
th { color: var(--subtle); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--muted); }
td strong { display: block; max-width: 280px; overflow: hidden; color: var(--text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
td small { display: block; margin-top: .15rem; color: var(--subtle); }
tbody tr:last-child td { border-bottom: 0; }
.timeline { margin: 0; padding: .5rem 1.45rem 1rem; list-style: none; }
.timeline li { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: start; padding: 1rem 0; border-bottom: 1px solid rgba(37, 48, 71, .72); }
.timeline li:last-child { border-bottom: 0; }
.timeline-marker { width: 8px; height: 8px; margin-top: .35rem; border-radius: 50%; background: var(--accent); }
.timeline-marker.run-succeeded { background: var(--success); }
.timeline-marker.run-failed { background: var(--danger); }
.timeline strong { display: -webkit-box; overflow: hidden; font-size: .78rem; font-weight: 600; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.timeline p, .timeline time { margin: .25rem 0 0; color: var(--subtle); font-size: .65rem; }
.timeline time { white-space: nowrap; }
.decisions-panel { margin-bottom: 1.25rem; }
.opportunities-panel { margin-bottom: 1.25rem; }
.proposed-experiments { margin-bottom: 1.25rem; }
.proposed-experiments table { min-width: 1800px; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { margin: 0 0 .7rem; font-size: clamp(2.6rem, 6vw, 5rem); letter-spacing: -.055em; line-height: 1; }
.page-heading > p:not(.eyebrow) { max-width: 720px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.detail-card { padding: 1.5rem; }
.detail-card h2 { margin-bottom: 1rem; color: var(--primary-bright); }
.detail-card p { color: var(--muted); }
.evidence-item { padding: 1rem 0; border-top: 1px solid var(--line); }
.evidence-item a, .source-list a, .detail-card > p a { color: var(--primary-bright); overflow-wrap: anywhere; }
.source-list { padding-left: 1.25rem; }
.source-list li { margin-bottom: 1.25rem; }
.source-list small { display: block; margin-top: .25rem; color: var(--subtle); }
.scores dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.scores dl div { padding: .8rem; background: var(--surface-soft); border-radius: 10px; }
.scores dt { color: var(--subtle); font-size: .7rem; }
.scores dd { margin: .2rem 0 0; font-size: 1.2rem; font-weight: 700; }
.muted { color: var(--subtle) !important; }
.evidence-type { display: inline-block; margin: .1rem; padding: .15rem .35rem; color: var(--muted); background: var(--surface-soft); border-radius: 5px; font-size: .62rem; }
.score-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.score-summary div { padding: 1rem; background: var(--surface); }
.score-summary span { display: block; color: var(--subtle); font-size: .68rem; }
.score-summary strong { display: block; margin-top: .3rem; font-size: 1rem; }
.missing-evidence { border-color: rgba(245, 185, 66, .35); }
.missing-evidence li { margin-bottom: .5rem; color: var(--muted); }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.decision-card { min-height: 190px; padding: 1.4rem; background: var(--surface); }
.decision-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.decision-meta time { color: var(--subtle); font-size: .64rem; }
.decision-card h3 { margin: 1.25rem 0 .55rem; font-size: .95rem; }
.decision-card p { display: -webkit-box; overflow: hidden; margin: 0 0 1rem; color: var(--muted); font-size: .76rem; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.experiment-tag { color: var(--primary-bright); font-size: .65rem; }
.empty-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; min-height: 150px; padding: 2rem; color: var(--subtle); text-align: center; }
.empty-state p { margin: 0; font-size: .8rem; }
.empty-state code { padding: .3rem .5rem; color: var(--primary-bright); background: var(--surface-soft); border-radius: 5px; font-size: .68rem; }
.empty-state.compact { justify-content: flex-start; min-height: 152px; text-align: left; }
.empty-state.compact svg { width: 34px; height: 34px; color: var(--primary); }
.empty-state h3 { margin: 0 0 .3rem; color: var(--text); font-size: .88rem; }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .shell { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.7rem; color: var(--subtle); font-size: .68rem; }
.site-footer p { margin: 0; }

@media (max-width: 900px) {
    .main-content { padding-top: 3.5rem; }
    .hero { grid-template-columns: 1fr; gap: 2rem; margin-bottom: 3rem; }
    .hero-copy { max-width: 620px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .operating-grid, .content-grid, .detail-grid { grid-template-columns: 1fr; }
    .status-grid { grid-template-columns: repeat(2, 1fr); }
    .decision-grid { grid-template-columns: repeat(2, 1fr); }
    .score-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 24px, 1180px); }
    .header-inner { min-height: 70px; }
    .version { display: none; }
    .operator-link { font-size: .75rem; }
    .hero h1 { font-size: clamp(2.75rem, 15vw, 4.2rem); }
    .metrics-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 132px; }
    .experiment-stats { grid-template-columns: repeat(2, 1fr); }
    .decision-grid { grid-template-columns: 1fr; }
    .score-summary { grid-template-columns: 1fr; }
    .status-grid { grid-template-columns: 1fr; }
    .panel-header, .experiment-body { padding-inline: 1.1rem; }
    .timeline { padding-inline: 1.1rem; }
    .timeline li { grid-template-columns: auto 1fr; }
    .timeline time { grid-column: 2; }
    .site-footer .shell { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
