:root {
    --bg: #f5f6f8;
    --ink: #202634;
    --muted: #7b8493;
    --border: #e5e8ee;
    --purple: #7660d9
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif
}

header {
    height: 82px;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: #fff
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 12px
}

.brand .muted {
    font-weight: 400;
    letter-spacing: 0
}

.logo {
    background: var(--ink);
    color: white;
    border-radius: 10px;
    font-size: 25px;
    letter-spacing: -3px;
    padding: 0 12px 5px 9px
}

.divider {
    color: #ccd0d8;
    margin: 0 6px
}

.badge,
.tag {
    font-size: 10px;
    letter-spacing: 1px;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 5px
}

.badge {
    color: #6e62ad;
    background: #f7f5fd
}

main {
    max-width: 1500px;
    margin: auto;
    padding: 42px 5% 20px
}

.intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 700;
    color: var(--muted)
}

h1 {
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 550;
    letter-spacing: -1.8px;
    margin: 8px 0
}

h2 {
    font-size: 19px;
    font-weight: 600;
    margin: 0
}

h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 600
}

.muted,
.subtle {
    color: var(--muted)
}

.subtle {
    font-size: 11px;
    line-height: 1.7
}

.edition {
    font-size: 10px;
    letter-spacing: 2px;
    color: #939aa7;
    line-height: 2
}

.edition b {
    font-size: 32px;
    display: block;
    color: #d1d5de;
    font-weight: 400
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 12px
}

.toolbar strong {
    font-size: 12px
}

.toolbar small {
    display: block;
    color: var(--muted);
    margin: 4px 0 0 15px;
    font-size: 10px
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #43ad91;
    border-radius: 50%;
    margin-right: 8px
}

.controls {
    display: flex;
    gap: 8px
}

button,
select {
    font: inherit;
    font-size: 11px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    color: var(--ink);
    cursor: pointer
}

button:hover,
select:hover {
    border-color: #999
}

button:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid #b0a5ed;
    outline-offset: 3px
}

.primary {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
    min-width: 112px
}

.progress {
    height: 3px;
    background: #e8e6f2;
    margin-top: 14px;
    border-radius: 5px
}

.progress div {
    height: 100%;
    background: var(--purple);
    transition: width .2s
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
    margin: 9px 0 24px
}

.case-grid {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 20px
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px
}

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.scan {
    height: 230px;
    background: #11151b;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ccc
}

.scan img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.image-caption {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
    margin-top: 13px
}

.question-panel h2 {
    font-size: 23px;
    line-height: 1.5;
    margin: 20px 0;
    letter-spacing: -.5px
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    max-height: 215px;
    overflow: auto
}

.option {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 12px;
    font-size: 12px
}

.option b {
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--muted)
}

.option.truth {
    background: #f0f8f5;
    border-color: #bfe0d3
}

.option.truth:after {
    content: '✓';
    color: #38957b;
    margin-left: auto
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px
}

.section-title>.muted {
    font-size: 11px
}

.section-title p {
    font-size: 12px;
    margin: 6px 0 0
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px
}

.model-card {
    background: white;
    border: 1px solid var(--border);
    border-top: 3px solid var(--color);
    padding: 19px;
    border-radius: 10px;
    min-height: 235px
}

.model-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 650
}

.model-sub {
    font-size: 10px;
    color: var(--muted);
    min-height: 32px;
    margin-top: 5px
}

.verdict {
    font-size: 9px;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 4px;
    background: #edf7f2;
    color: #378468
}

.verdict.wrong {
    background: #fcf0f0;
    color: #ba6262
}

.verdict.missing {
    background: #f2f3f6;
    color: #9098a5
}

.prediction {
    font-size: 18px;
    margin: 15px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.card-stats {
    display: flex;
    justify-content: space-between
}

.card-stats strong {
    font-size: 21px;
    letter-spacing: -.6px;
    font-weight: 550
}

.card-stats small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .3px
}

.confidence-track {
    height: 4px;
    background: #f0f1f4;
    border-radius: 4px;
    margin-top: 17px;
    overflow: hidden
}

.confidence-track div {
    height: 100%;
    background: var(--color)
}

.legend {
    display: flex;
    gap: 15px;
    font-size: 10px;
    color: var(--muted)
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    background: var(--color)
}

.plots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.plots canvas {
    width: 100%;
    height: 240px;
    display: block
}

.table-panel {
    margin-top: 20px
}

.table-scroll {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 12px
}

th {
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
    padding: 12px;
    border-bottom: 1px solid var(--border)
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f1f4;
    font-variant-numeric: tabular-nums
}

th:first-child,
td:first-child {
    text-align: left
}

tr:last-child td {
    border: 0
}

.methodology {
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8
}

.methodology summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 600
}

footer {
    display: flex;
    justify-content: space-between;
    color: #9aa2af;
    font-size: 9px;
    letter-spacing: 1.3px;
    padding: 28px 0 5px
}

footer span {
    letter-spacing: 0
}

.tooltip {
    position: fixed;
    background: #252b38;
    color: white;
    padding: 10px;
    border-radius: 7px;
    font-size: 11px;
    pointer-events: none;
    z-index: 10;
    white-space: pre-line;
    box-shadow: 0 4px 20px #0002
}

@media(max-width:1000px) {
    .toolbar {
        align-items: flex-start;
        flex-direction: column
    }

    .cards {
        grid-template-columns: 1fr 1fr
    }

    .legend {
        gap: 8px
    }

    .edition {
        display: none
    }
}

@media(max-width:650px) {
    header {
        height: 65px
    }

    .brand .muted,
    .badge {
        display: none
    }

    main {
        padding: 25px 16px
    }

    .case-grid,
    .plots {
        grid-template-columns: 1fr
    }

    .controls {
        flex-wrap: wrap
    }

    .cards {
        gap: 10px
    }

    .model-card {
        padding: 13px
    }

    .card-stats strong {
        font-size: 18px
    }

    .section-title {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column
    }

    .stream-meta {
        gap: 10px
    }

    .options {
        grid-template-columns: 1fr
    }

    footer span {
        display: none
    }
}

.model-count {
    margin: 12px 0 8px;
    font-variant-numeric: tabular-nums
}

.model-count strong {
    font-size: 30px;
    font-weight: 550
}

.model-count span {
    font-size: 11px;
    color: var(--muted)
}

.race-track {
    height: 5px;
    background: #edf1f4;
    border-radius: 5px;
    overflow: hidden
}

.race-track i {
    height: 100%;
    display: block;
    background: var(--color)
}

.inspect-model {
    margin-top: 12px;
    width: 100%;
    text-align: left;
    color: var(--color);
    background: #fafbfd
}

.race-note {
    font-size: 12px;
    color: #547169;
    background: #edf5f2;
    border: 1px solid #d9e9e2;
    border-radius: 8px;
    padding: 12px 16px
}

.throughput-panel {
    margin-top: 22px
}

.throughput-panel canvas {
    width: 100%;
    height: 240px;
    display: block
}

[hidden] {
    display: none !important
}

/* Observatory refresh */
:root {
    --bg: #f3f5f8;
    --ink: #192d39;
    --muted: #72818d;
    --border: #e0e7ec;
    --purple: #267c78
}

header {
    height: 72px
}

.logo {
    background: #216b65
}

.badge {
    background: #edf7f4;
    color: #327970;
    border-color: #d7e9e2
}

main {
    padding-top: 36px
}

.intro {
    margin-bottom: 28px
}

h1 {
    font-weight: 600;
    letter-spacing: -2px
}

.intro .eyebrow {
    color: #37847a
}

.edition {
    color: #789289
}

.edition b {
    color: #b5cbc4
}

.overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0 0 24px;
    background: linear-gradient(120deg, #183c3c, #244d48);
    color: #f4faf8;
    border-radius: 14px;
    padding: 24px 10px;
    box-shadow: 0 8px 28px #153e3910
}

.overview>div {
    padding: 0 25px;
    border-right: 1px solid #ffffff1f
}

.overview>div:last-child {
    border: 0
}

.overview .eyebrow {
    color: #a3c7bd;
    font-size: 9px;
    display: block
}

.overview strong {
    display: block;
    font-weight: 500;
    font-size: 28px;
    letter-spacing: -.6px;
    margin: 5px 0
}

.overview small {
    font-size: 10px;
    color: #b2cdc5
}

.toolbar {
    box-shadow: 0 3px 16px #192d3903
}

.primary {
    background: #226c65;
    border-color: #226c65
}

.primary:hover {
    background: #18584f
}

.panel {
    box-shadow: 0 4px 20px #172f3e03
}

.case-grid {
    grid-template-columns: .8fr 1.2fr
}

.scan {
    position: relative;
    height: 270px;
    background: radial-gradient(ellipse at center, #222c35, #10181e)
}

.scan-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    font-size: 8px;
    letter-spacing: 1.6px;
    color: #b1c6cf;
    background: #15202ac9;
    border: 1px solid #ffffff16;
    padding: 5px 8px;
    border-radius: 4px
}

.scan img {
    transition: opacity .18s ease
}

.scan img[hidden] {
    display: none
}

#imageError {
    padding: 30px;
    text-align: center;
    color: #a9bbc5;
    max-width: 390px;
    font-size: 13px
}

.image-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 1px
}

.image-actions button {
    font-size: 10px;
    color: #267b70;
    border-color: #d8e9e3;
    background: #f4f9f7
}

.question-panel h2 {
    font-size: 21px;
    font-weight: 550;
    margin-top: 24px;
    line-height: 1.55;
    max-height: 330px;
    overflow: auto
}

.options {
    max-height: 250px
}

.option {
    background: #fafbfd;
    transition: border-color .2s
}

.option.truth {
    background: #eef8f3;
    border-color: #b5dbcb
}

.model-card {
    box-shadow: 0 3px 15px #172f3e04;
    transition: transform .18s, box-shadow .18s
}

.model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 24px #172f3e0b
}

.prediction {
    border-bottom: 1px solid #edf1f4;
    padding-bottom: 15px
}

.card-stats strong {
    font-size: 24px
}

.section-title h2 {
    letter-spacing: -.4px
}

.table-panel tbody tr:hover {
    background: #f7faf9
}

#seek {
    cursor: pointer;
    height: 5px
}

button:disabled {
    opacity: .4;
    cursor: default
}

.plots canvas {
    height: 250px
}

#nextImage[hidden] {
    display: none
}

@media(max-width:1100px) {
    .controls {
        flex-wrap: wrap
    }

    .toolbar {
        align-items: stretch
    }

    .overview>div {
        padding: 0 15px
    }
}

@media(max-width:650px) {
    .overview {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
        padding: 20px 5px
    }

    .overview>div:nth-child(2) {
        border: 0
    }

    .overview strong {
        font-size: 24px
    }

    .case-grid {
        grid-template-columns: 1fr
    }

    .scan {
        height: 260px
    }

    h1 {
        letter-spacing: -1px
    }

    .question-panel h2 {
        max-height: none;
        font-size: 19px
    }

    .card-stats strong {
        font-size: 20px
    }
}

.panel,
.model-card,
.case-grid>*,
.plots>* {
    min-width: 0
}

.controls {
    max-width: 100%;
    flex-wrap: wrap
}

.options,
.option {
    min-width: 0;
    overflow-wrap: anywhere
}

.toolbar>div {
    min-width: 0
}

.stream-meta {
    overflow-wrap: anywhere
}

.scan {
    max-width: 100%
}

.overview>div {
    min-width: 0
}

canvas {
    max-width: 100%
}

@media(max-width:650px) {
    .toolbar {
        padding: 14px
    }

    .controls select {
        max-width: 100%
    }

    .panel {
        padding: 17px
    }

    .card-stats {
        gap: 6px
    }

    .model-sub {
        overflow-wrap: anywhere
    }

    .table-scroll {
        max-width: 100%
    }
}

/* Mechanism panel */
.mechanism-panel {
    margin-top: 14px;
    position: relative;
    padding: 26px 28px;
    background: linear-gradient(180deg, #fbfcfd, #f6f9fa)
}

.mechanism-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px
}

.mechanism-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px 22px;
    background: #fff;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}

.mechanism-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color), transparent 72%);
    opacity: .85
}

.mechanism-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px #172f3e14;
    border-color: #d6dee6
}

.mechanism-card .mc-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px
}

.mechanism-card .mc-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color) 16%, transparent);
    flex: none
}

.mechanism-card .mc-name {
    font-weight: 680;
    font-size: 14.5px;
    letter-spacing: -.25px
}

.mechanism-card .mc-chip {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--color) 78%, #1c2b36);
    background: color-mix(in srgb, var(--color) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--color) 34%, #fff);
    padding: 4.5px 9px;
    border-radius: 999px;
    margin-bottom: 12px
}

.mechanism-card .mc-note {
    font-size: 11.5px;
    line-height: 1.6;
    color: #4a5866;
    margin: 0 0 14px
}

.mechanism-card svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 6px #172f3e0c)
}

.mechanism-card .mc-steps {
    margin: 16px 0 0;
    padding: 14px 16px 4px;
    background: #fafbfd;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.62;
    color: #3a4754;
    counter-reset: mcstep
}

.mechanism-card .mc-steps li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 9px;
    list-style: none;
    counter-increment: mcstep
}

.mechanism-card .mc-steps li:last-child {
    margin-bottom: 2px
}

.mechanism-card .mc-steps li::before {
    content: counter(mcstep);
    position: absolute;
    left: 0;
    top: .75em;
    height: 16px;
    width: 16px;
    margin-top: -8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color) 13%, #fff);
    border: 1px solid color-mix(in srgb, var(--color) 45%, #fff);
    color: color-mix(in srgb, var(--color) 72%, #1c2b36);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 14px;
    text-align: center
}

.mechanism-card.github-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: linear-gradient(180deg, #fff 55%, color-mix(in srgb, var(--color) 6%, #fff))
}

.mechanism-card .github-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #1c2b36;
    color: #fff;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 11.5px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .2px;
    transition: background .15s, transform .15s;
    width: fit-content
}

.mechanism-card .github-cta:hover {
    background: #267c78;
    transform: translateX(2px)
}

.mechanism-card .github-arrow {
    font-size: 13px;
    line-height: 1
}

/* Decision stream (one row per decision, newest first) */
.stream-panel {
    margin-top: 22px
}

.decision-stream {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px
}

.decision-stream::-webkit-scrollbar {
    width: 6px
}

.decision-stream::-webkit-scrollbar-thumb {
    background: #d3dde4;
    border-radius: 3px
}

.decision {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    background: #fafbfd;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 12px;
    animation: slidein .18s ease
}

@keyframes slidein {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.decision .d-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0
}

.decision .d-sw {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex: none
}

.decision .d-name {
    font-weight: 700;
    letter-spacing: -.2px;
    flex: none
}

.decision .d-ans {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 34ch
}

.decision .d-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    flex: none
}

.decision .d-conf {
    font-weight: 700;
    color: var(--ink)
}

.decision .d-lat {
    min-width: 52px;
    text-align: right
}

.decision.ok {
    border-left: 3px solid #43ad91
}

.decision.bad {
    border-left: 3px solid #c0563f
}