* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #090b14;
    --bg-deep: #060810;
    --panel: #111625;
    --panel-raised: #171d30;
    --panel-soft: #0d1220;
    --panel-hover: #1c2339;
    --line: rgba(166, 176, 221, 0.16);
    --line-strong: rgba(166, 176, 221, 0.3);
    --text: #f3f5ff;
    --text-soft: #c7cce2;
    --muted: #969fbd;
    --muted-dark: #8b94b0;
    --indigo: #858cff;
    --indigo-bright: #b0b4ff;
    --indigo-soft: rgba(133, 140, 255, 0.14);
    --observation: #ff6476;
    --observation-soft: rgba(255, 100, 118, 0.13);
    --success: #62d6a0;
    --success-soft: rgba(98, 214, 160, 0.13);
    --danger: #ff7182;
    --danger-soft: rgba(255, 113, 130, 0.13);
    --warning: #edc46d;
    --warning-soft: rgba(237, 196, 109, 0.12);
    --phase-color: var(--muted);
    --radius-lg: 18px;
    --radius-md: 13px;
    --radius-sm: 9px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.2);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

html {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--bg-deep);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: clamp(14px, 1.6vw, 26px);
    overflow-x: hidden;
    background:
        radial-gradient(circle at 9% -8%, rgba(113, 120, 235, 0.18), transparent 31rem),
        radial-gradient(circle at 93% 7%, rgba(88, 100, 194, 0.11), transparent 27rem),
        linear-gradient(152deg, #0b0e19 0%, var(--bg) 46%, #0a0d17 100%);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(150, 158, 205, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(150, 158, 205, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    content: "";
    pointer-events: none;
}

body[data-mission-phase="dropping"],
body[data-mission-phase="analyzing"] {
    --phase-color: var(--indigo);
}

body[data-mission-phase="identifying"] {
    --phase-color: var(--warning);
}

body[data-mission-phase="launching-correct"],
body[data-mission-phase="revealed"],
body[data-mission-phase="complete"] {
    --phase-color: var(--success);
}

body[data-mission-phase="launching-incorrect"],
body[data-mission-phase="crashed"] {
    --phase-color: var(--danger);
}

::selection {
    background: rgba(133, 140, 255, 0.34);
    color: #ffffff;
}

button,
input,
output {
    font: inherit;
}

button,
input[type="range"],
input[type="checkbox"] {
    accent-color: var(--indigo);
}

button,
a,
input,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(176, 180, 255, 0.78);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    margin: -1px !important;
    white-space: nowrap !important;
}

.app-shell {
    width: min(100%, 1500px);
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px 3px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 160ms ease, transform 160ms ease;
}

.back-link span:first-child {
    color: var(--indigo-bright);
    font-size: 1rem;
    transition: transform 160ms ease;
}

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

.back-link:hover span:first-child {
    transform: translateX(-2px);
}

.mission-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: 16px 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(90deg, rgba(133, 140, 255, 0.075), transparent 34%),
        linear-gradient(145deg, rgba(24, 30, 49, 0.96), rgba(13, 17, 29, 0.96));
    box-shadow: var(--shadow-soft);
}

.mission-header::before {
    position: absolute;
    top: 0;
    right: 18px;
    left: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(176, 180, 255, 0.65), transparent);
    content: "";
}

.brand-lockup {
    min-width: 0;
}

.product-kicker,
.section-index,
.micro-label {
    margin: 0;
    color: var(--indigo-bright);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    line-height: 1.25;
    text-transform: uppercase;
}

.brand-lockup h1 {
    margin: 3px 0 2px;
    font-size: clamp(2rem, 3.1vw, 3.15rem);
    font-weight: 760;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.tagline {
    margin: 0;
    color: var(--text-soft);
    font-size: clamp(0.83rem, 1.15vw, 1rem);
    letter-spacing: 0.015em;
}

.mission-actions {
    display: flex;
    min-width: 0;
    align-items: stretch;
    gap: 10px;
}

.mission-status-card {
    display: flex;
    min-width: 178px;
    flex-direction: column;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(7, 10, 18, 0.56);
}

.mission-status-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.mission-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--phase-color);
    box-shadow: 0 0 0 4px rgba(150, 159, 189, 0.08);
    transition: background-color 180ms ease, box-shadow 180ms ease;
}

body[data-mission-phase="dropping"] .mission-status-dot,
body[data-mission-phase="launching-correct"] .mission-status-dot,
body[data-mission-phase="launching-incorrect"] .mission-status-dot {
    animation: signal-pulse 1.2s ease-in-out infinite;
}

#missionStatus {
    margin-top: 2px;
    overflow: hidden;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace {
    display: grid;
    grid-template-areas:
        "scene experiment analysis"
        "scene experiment decision";
    grid-template-columns: minmax(310px, 400px) minmax(300px, 0.82fr) minmax(380px, 1.18fr);
    align-items: start;
    gap: 16px;
}

.panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, rgba(23, 29, 48, 0.96), rgba(14, 18, 31, 0.97));
    box-shadow: var(--shadow);
}

.panel::before {
    position: absolute;
    z-index: 0;
    top: 0;
    right: 14px;
    left: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(187, 192, 230, 0.25), transparent);
    content: "";
    pointer-events: none;
}

.panel > * {
    position: relative;
    z-index: 1;
}

.scene-panel {
    position: sticky;
    top: 14px;
    grid-area: scene;
    padding: 14px;
}

.experiment-panel {
    grid-area: experiment;
    padding: 15px;
}

.analysis-panel {
    grid-area: analysis;
    padding: 15px;
}

.decision-panel {
    grid-area: decision;
    padding: 15px;
}

.panel-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.panel-heading > div,
.block-heading > div {
    min-width: 0;
}

.panel-heading h2,
.block-heading h3,
.identify-block h3,
.subsection-heading h3,
.mission-outcome h3,
.guess-history h4 {
    margin: 0;
    color: var(--text);
    line-height: 1.18;
}

.panel-heading h2 {
    margin-top: 2px;
    font-size: 1.12rem;
    letter-spacing: -0.018em;
}

.panel-chip {
    display: inline-flex;
    min-height: 24px;
    max-width: 48%;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(8, 11, 20, 0.55);
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.panel-chip--live {
    border-color: rgba(133, 140, 255, 0.28);
    background: var(--indigo-soft);
    color: var(--indigo-bright);
}

.scene-frame {
    position: relative;
    display: grid;
    width: 100%;
    place-items: center;
    padding: 6px;
    overflow: hidden;
    border: 1px solid rgba(155, 166, 218, 0.22);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 15%, rgba(90, 99, 184, 0.11), transparent 47%),
        #080b14;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        inset 0 -30px 50px rgba(0, 0, 0, 0.2);
}


#scene {
    display: block;
    width: min(100%, 420px, 52.6svh);
    max-width: 100%;
    height: auto;
    aspect-ratio: 420 / 900;
    border: 1px solid rgba(177, 185, 226, 0.12);
    border-radius: 11px;
    background: #070a13;
    cursor: crosshair;
    touch-action: manipulation;
    transition: border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

body[data-mission-phase="dropping"] #scene {
    border-color: rgba(133, 140, 255, 0.48);
    box-shadow: 0 0 24px rgba(133, 140, 255, 0.12);
}

body[data-mission-phase="launching-correct"] #scene,
body[data-mission-phase="revealed"] #scene,
body[data-mission-phase="complete"] #scene {
    border-color: rgba(98, 214, 160, 0.48);
    box-shadow: 0 0 26px rgba(98, 214, 160, 0.12);
}

body[data-mission-phase="launching-incorrect"] #scene,
body[data-mission-phase="crashed"] #scene {
    border-color: rgba(255, 113, 130, 0.46);
    box-shadow: 0 0 24px rgba(255, 113, 130, 0.1);
}

.scene-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
    color: var(--muted-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    line-height: 1.25;
    text-transform: uppercase;
}

.clock-console {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(133, 140, 255, 0.23);
    border-radius: var(--radius-md);
    background:
        linear-gradient(90deg, rgba(133, 140, 255, 0.08), transparent 60%),
        var(--panel-soft);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.22);
}

.clock-label {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.25;
    text-transform: uppercase;
}

.clock {
    color: var(--indigo-bright);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(2rem, 3vw, 2.65rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -0.075em;
    line-height: 0.9;
    text-shadow: 0 0 22px rgba(133, 140, 255, 0.2);
}

.clock .unit {
    margin-left: 7px;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
}

.clock.flash {
    color: var(--observation);
}

.experiment-status-grid,
.analysis-metrics,
.truth-details {
    display: grid;
    margin: 0;
}

.experiment-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
}

.status-card,
.analysis-metric {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(8, 11, 20, 0.46);
}

.status-card {
    padding: 8px 7px;
    text-align: center;
}

.status-card dt,
.analysis-metric dt,
.truth-details dt {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 750;
    letter-spacing: 0.035em;
    line-height: 1.25;
    text-transform: uppercase;
}

.status-card dd,
.analysis-metric dd,
.truth-details dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.status-card dd {
    margin-top: 3px;
    overflow: hidden;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instruction {
    margin: 0 0 10px;
    padding: 9px 11px 9px 30px;
    border: 1px solid rgba(133, 140, 255, 0.19);
    border-radius: 10px;
    background: rgba(133, 140, 255, 0.07);
    color: var(--text-soft);
    font-size: 0.73rem;
    line-height: 1.45;
}

.instruction::before {
    position: absolute;
    top: 13px;
    left: 12px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--indigo-bright);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(133, 140, 255, 0.1);
    content: "";
}

.control-fieldset {
    min-width: 0;
    margin: 0 0 13px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(8, 11, 20, 0.34);
}

.control-fieldset legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.range-control {
    margin-bottom: 8px;
}

.control-label-row,
.range-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.control-label-row {
    margin-bottom: 3px;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 650;
}

#speedLabel {
    color: var(--indigo-bright);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.73rem;
    font-weight: 800;
}

#speed {
    display: block;
    width: 100%;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

.range-scale {
    margin-top: -2px;
    color: var(--muted-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.53rem;
}

.toggle-control {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.toggle-control:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.toggle-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.toggle-track {
    position: relative;
    width: 33px;
    height: 19px;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #252b3e;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.toggle-track span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: transform 160ms ease, background-color 160ms ease;
}

.toggle-control input:checked + .toggle-track {
    border-color: rgba(133, 140, 255, 0.58);
    background: rgba(133, 140, 255, 0.26);
}

.toggle-control input:checked + .toggle-track span {
    background: var(--indigo-bright);
    transform: translateX(14px);
}

.toggle-control--markers input:checked + .toggle-track {
    border-color: rgba(255, 100, 118, 0.58);
    background: var(--observation-soft);
}

.toggle-control--markers input:checked + .toggle-track span {
    background: var(--observation);
}

.toggle-control input:focus-visible + .toggle-track {
    outline: 3px solid rgba(176, 180, 255, 0.78);
    outline-offset: 3px;
}

.toggle-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.toggle-copy strong {
    color: var(--text-soft);
    font-size: 0.69rem;
    line-height: 1.25;
}

.toggle-copy small {
    margin-top: 1px;
    overflow: hidden;
    color: var(--muted-dark);
    font-size: 0.59rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-actions,
.outcome-actions {
    display: grid;
    gap: 7px;
}

.control-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.btn {
    display: inline-flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition: transform 100ms ease, border-color 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

.btn:disabled {
    cursor: not-allowed;
    filter: saturate(0.55);
    opacity: 0.43;
}

.btn-primary {
    border-color: rgba(133, 140, 255, 0.54);
    background: linear-gradient(145deg, #777fe9, #656cd4);
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(91, 98, 207, 0.18);
}

.btn-primary:hover:not(:disabled) {
    border-color: rgba(193, 196, 255, 0.68);
    background: linear-gradient(145deg, #878ef2, #7077dc);
    box-shadow: 0 9px 22px rgba(91, 98, 207, 0.25);
}

.btn-secondary {
    border-color: var(--line);
    background: rgba(29, 35, 56, 0.82);
    color: var(--text-soft);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--panel-hover);
    color: var(--text);
}

.btn-danger {
    border-color: rgba(255, 113, 130, 0.48);
    background: var(--danger-soft);
    color: #ffb5be;
}

.btn-danger:hover:not(:disabled) {
    border-color: rgba(255, 113, 130, 0.68);
    background: rgba(255, 113, 130, 0.2);
    color: #ffd8dd;
}

.btn-success {
    border-color: rgba(98, 214, 160, 0.48);
    background: var(--success-soft);
    color: #a9f0ce;
}

.btn-success:hover:not(:disabled) {
    border-color: rgba(98, 214, 160, 0.7);
    background: rgba(98, 214, 160, 0.2);
    color: #d8ffec;
}

.subsection-heading,
.block-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.subsection-heading {
    margin-bottom: 7px;
}

.subsection-heading h3,
.block-heading h3,
.identify-block h3 {
    font-size: 0.86rem;
}

.subsection-heading p,
.block-copy {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.63rem;
    line-height: 1.4;
}

.data-format {
    color: var(--muted-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-scroll {
    min-width: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(6, 9, 16, 0.42);
    scrollbar-color: rgba(133, 140, 255, 0.48) rgba(10, 13, 23, 0.75);
    scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(10, 13, 23, 0.75);
}

.table-scroll::-webkit-scrollbar-thumb {
    border: 2px solid rgba(10, 13, 23, 0.75);
    border-radius: 999px;
    background: rgba(133, 140, 255, 0.45);
}

.measurement-table-wrap {
    height: clamp(150px, 20vh, 210px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-soft);
    font-size: 0.69rem;
    font-variant-numeric: tabular-nums;
}

.measurement-table {
    min-width: 0;
    table-layout: fixed;
}

.measurement-table th:nth-child(1) {
    width: 14%;
}

.measurement-table th:nth-child(2) {
    width: 14%;
}

.measurement-table th:nth-child(3) {
    width: 28%;
}

.measurement-table th:nth-child(4) {
    width: 44%;
}

.data-table th,
.data-table td {
    padding: 7px 5px;
    border-bottom: 1px solid rgba(166, 176, 221, 0.11);
    text-align: right;
    white-space: nowrap;
}

.data-table thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: #171c2d;
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.25;
    text-transform: uppercase;
}

.measurement-table thead th {
    vertical-align: top;
    white-space: normal;
}

.measurement-table thead .table-unit {
    display: block;
    margin-top: 1px;
    line-height: 1.15;
}

.data-table thead th:first-child,
.data-table tbody th:first-child,
.data-table tbody td:first-child {
    text-align: left;
}

.data-table tbody tr:last-child > * {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.data-table tbody tr:hover {
    background: rgba(133, 140, 255, 0.05);
}

.table-unit,
.cell-unit {
    color: var(--muted-dark);
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.analysis-metrics {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.35fr) minmax(0, 0.7fr);
    gap: 5px;
    margin-bottom: 10px;
}

.analysis-metrics.is-delay-model {
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(0, 0.95fr)
        minmax(0, 1.25fr)
        minmax(0, 0.7fr);
}

.analysis-metric {
    display: grid;
    min-height: 55px;
    grid-template-rows: auto auto;
    align-content: start;
    padding: 5px;
}

.analysis-metric dt {
    min-height: 1.25em;
    white-space: nowrap;
}

.analysis-metric dt span {
    color: var(--muted-dark);
    text-transform: none;
}

.analysis-metric dd {
    margin-top: 3px;
    overflow: hidden;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(0.88rem, 1.45vw, 1.15rem);
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-metric--primary {
    border-color: rgba(133, 140, 255, 0.28);
    background: var(--indigo-soft);
}

.analysis-metric--primary dd {
    color: var(--indigo-bright);
}

.analysis-metric-range {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-frame {
    position: relative;
    width: 100%;
    height: clamp(215px, 24vh, 280px);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        linear-gradient(rgba(150, 158, 205, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(150, 158, 205, 0.025) 1px, transparent 1px),
        rgba(6, 9, 16, 0.56);
    background-size: 24px 24px;
}

.chart-frame canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.chart-note {
    margin: 9px 2px 0;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.45;
}

.decision-grid {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.decision-block {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(8, 11, 20, 0.38);
}

.block-heading {
    align-items: center;
}

.catalog-symbol {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(133, 140, 255, 0.26);
    border-radius: 50%;
    background: var(--indigo-soft);
    color: var(--indigo-bright);
    font-family: Georgia, serif;
    font-size: 1rem;
    font-style: italic;
}

.block-copy {
    margin-bottom: 8px;
}

.catalog-table-wrap {
    max-width: 100%;
}

.catalog-table {
    min-width: 450px;
}

.catalog-table tbody th {
    color: var(--text);
    font-weight: 750;
}

.catalog-table tbody td:last-child,
.catalog-table thead th:last-child {
    text-align: right;
}

.catalog-table tbody tr.is-confirmed {
    background: var(--success-soft);
    box-shadow: inset 3px 0 0 var(--success);
}

.catalog-table tbody tr.is-confirmed th {
    color: #b8f3d7;
}

.identify-block h3 {
    margin-top: 2px;
    margin-bottom: 10px;
}

#worldGuessForm {
    min-width: 0;
}

.guess-label {
    display: inline-block;
    margin-bottom: 2px;
    color: var(--text);
    font-size: 0.77rem;
    font-weight: 750;
}

.field-hint {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 0.62rem;
    line-height: 1.4;
}

.guess-entry-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

#worldGuess {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: 0;
    background: rgba(5, 8, 15, 0.7);
    color: var(--text);
    font-size: 0.75rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

#worldGuess::placeholder {
    color: var(--muted-dark);
}

#worldGuess:hover:not(:disabled) {
    border-color: rgba(176, 180, 255, 0.42);
}

#worldGuess:focus {
    border-color: rgba(133, 140, 255, 0.78);
    background: rgba(8, 11, 21, 0.9);
    box-shadow: 0 0 0 4px rgba(133, 140, 255, 0.1);
}

#worldGuess:disabled {
    cursor: not-allowed;
    opacity: 0.47;
}

#worldGuess[aria-invalid="true"],
#worldGuess.is-error {
    border-color: rgba(255, 113, 130, 0.72);
    box-shadow: 0 0 0 4px rgba(255, 113, 130, 0.09);
}

#worldGuess.is-success {
    border-color: rgba(98, 214, 160, 0.7);
    box-shadow: 0 0 0 4px rgba(98, 214, 160, 0.09);
}

#programLaunchBtn {
    min-width: 118px;
}

.form-feedback {
    min-height: 1.35em;
    margin: 6px 2px 0;
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 650;
    line-height: 1.35;
}

.form-feedback.is-error,
.is-error .form-feedback {
    color: #ffacb6;
}

.form-feedback.is-success,
.is-success .form-feedback {
    color: #a7eecc;
}

.guess-history {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.guess-history h4 {
    color: var(--muted);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guess-history ol {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
}

.guess-history li {
    padding: 4px 7px;
    border: 1px solid rgba(255, 113, 130, 0.25);
    border-radius: 999px;
    background: var(--danger-soft);
    color: #ffb4bd;
    font-size: 0.6rem;
    font-weight: 700;
}

.mission-outcome {
    margin-top: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(7, 10, 18, 0.7);
    box-shadow: inset 4px 0 0 var(--phase-color);
}

.mission-outcome:focus-visible {
    outline-offset: 4px;
}

.mission-outcome h3 {
    margin-top: 2px;
    font-size: 1rem;
}

#outcomeMessage {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.5;
}

.mission-outcome.outcome--success {
    border-color: rgba(98, 214, 160, 0.38);
    background: linear-gradient(135deg, var(--success-soft), rgba(7, 10, 18, 0.75));
    box-shadow: inset 4px 0 0 var(--success);
}

.mission-outcome.outcome--success h3 {
    color: #b8f3d7;
}

.mission-outcome.outcome--failure {
    border-color: rgba(255, 113, 130, 0.38);
    background: linear-gradient(135deg, var(--danger-soft), rgba(7, 10, 18, 0.75));
    box-shadow: inset 4px 0 0 var(--danger);
}

.mission-outcome.outcome--failure h3 {
    color: #ffc0c7;
}

.truth-details {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
}

.truth-details > div {
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(98, 214, 160, 0.2);
    border-radius: 8px;
    background: rgba(98, 214, 160, 0.06);
}

.truth-details dd {
    min-height: 1.2em;
    margin-top: 3px;
    overflow: hidden;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.69rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outcome-actions {
    grid-template-columns: minmax(0, max-content);
    margin-top: 10px;
}

.is-success {
    --phase-color: var(--success);
}

.is-error {
    --phase-color: var(--danger);
}

.panel.is-success,
.decision-block.is-success,
.mission-status-card.is-success {
    border-color: rgba(98, 214, 160, 0.42);
    box-shadow: inset 3px 0 0 var(--success), var(--shadow-soft);
}

.panel.is-error,
.decision-block.is-error,
.mission-status-card.is-error {
    border-color: rgba(255, 113, 130, 0.42);
    box-shadow: inset 3px 0 0 var(--danger), var(--shadow-soft);
}

.is-revealed {
    animation: reveal-in 360ms ease-out both;
}

.truth-details.is-revealed,
.decision-block.is-revealed {
    border-color: rgba(98, 214, 160, 0.36);
}

@keyframes signal-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(133, 140, 255, 0.08), 0 0 0 rgba(133, 140, 255, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(133, 140, 255, 0.14), 0 0 14px var(--phase-color);
    }
}

@keyframes reveal-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1101px) {
    body {
        padding: 16px;
    }

    .workspace {
        grid-template-areas:
            "scene experiment"
            "scene analysis"
            "scene decision";
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    }

    .analysis-metric dd {
        font-size: 1rem;
    }

    .catalog-table {
        min-width: 500px;
    }
}

@media (max-width: 760px) {
    body {
        padding: 10px;
    }

    .back-link {
        margin-bottom: 7px;
    }

    .mission-header {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
        margin-bottom: 12px;
    }

    .mission-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .mission-status-card {
        min-width: 0;
    }

    .workspace {
        grid-template-areas:
            "scene"
            "experiment"
            "analysis"
            "decision";
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .scene-panel {
        position: static;
        width: min(100%, 460px);
        justify-self: center;
    }

    #scene {
        width: min(100%, 420px);
    }

    .experiment-panel,
    .analysis-panel,
    .decision-panel {
        padding: 14px;
    }

    .measurement-table-wrap {
        height: 215px;
    }

    .chart-frame {
        height: clamp(250px, 48vw, 340px);
    }

    .catalog-table {
        min-width: 520px;
    }

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

    .truth-details > div:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 390px) {
    body {
        padding: 8px;
    }

    .mission-header {
        padding: 14px;
        border-radius: 15px;
    }

    .brand-lockup h1 {
        font-size: 1.92rem;
    }

    .tagline {
        max-width: 31ch;
        font-size: 0.78rem;
    }

    .mission-actions {
        grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
        gap: 7px;
    }

    .mission-status-card {
        padding-inline: 10px;
    }

    #missionStatus {
        font-size: 0.82rem;
    }

    .panel,
    .scene-frame {
        border-radius: 14px;
    }

    .scene-panel,
    .experiment-panel,
    .analysis-panel,
    .decision-panel {
        padding: 11px;
    }

    .panel-heading {
        gap: 8px;
        margin-bottom: 11px;
    }

    .panel-heading h2 {
        font-size: 1rem;
    }

    .panel-chip {
        max-width: 44%;
        padding-inline: 7px;
        font-size: 0.54rem;
    }

    .scene-frame {
        padding: 4px;
    }

    .scene-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .clock-console {
        padding: 10px;
    }

    .clock {
        font-size: 2rem;
    }

    .experiment-status-grid {
        gap: 5px;
    }

    .status-card {
        padding-inline: 4px;
    }

    .status-card dt {
        font-size: 0.53rem;
    }

    .status-card dd {
        font-size: 0.82rem;
    }

    .instruction {
        padding-left: 28px;
        font-size: 0.69rem;
    }

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

    #csvBtn {
        grid-column: 1 / -1;
    }

    .toggle-copy small {
        white-space: normal;
    }

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

    .analysis-metric--count {
        grid-column: 1 / -1;
    }

    .analysis-metrics.is-delay-model .analysis-metric--count {
        grid-column: auto;
    }

    .chart-frame {
        height: 240px;
    }

    .decision-block {
        padding: 10px;
    }

    .catalog-table {
        min-width: 460px;
    }

    .guess-entry-row {
        grid-template-columns: minmax(0, 1fr);
    }

    #programLaunchBtn {
        width: 100%;
        min-width: 0;
    }

    .truth-details,
    .outcome-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .truth-details > div:first-child {
        grid-column: auto;
    }
}

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

    *,
    *::before,
    *::after {
        animation-delay: 0s !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}

/* Compact, viewport-filling instrument layout. */
.trial-toolbar {
    margin-bottom: 11px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(8, 11, 20, 0.34);
}

.trial-toolbar .toggle-control {
    margin-bottom: 7px;
    padding-block: 4px;
}

.trial-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 7px;
}

.trial-toggles .toggle-control {
    gap: 7px;
    margin-bottom: 0;
    padding-inline: 4px;
}

.trial-toggles .toggle-copy small {
    white-space: normal;
}

.navigation-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.navigation-actions .panel-chip {
    max-width: none;
}

.navigation-actions .btn {
    min-height: 30px;
    padding: 6px 9px;
}

.mission-status-inline {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(7, 10, 18, 0.52);
}

.mission-status-inline .mission-status-label {
    flex: 0 0 auto;
}

.mission-status-inline #missionStatus {
    min-width: 0;
    margin: 0;
    font-size: 0.78rem;
}

.identify-block {
    min-width: 0;
}

.guess-history h3 {
    margin: 0;
    color: var(--muted);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    line-height: 1.18;
    text-transform: uppercase;
}

@media (min-width: 1102px) {
    body {
        height: 100vh;
        height: 100svh;
        padding: 10px;
        overflow: hidden;
    }

    .app-shell,
    .workspace {
        height: 100%;
    }

    .workspace {
        grid-template-columns:
            clamp(340px, calc(46.667svh - 18px), 440px)
            340px
            minmax(390px, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        align-items: stretch;
        gap: 12px;
    }

    .scene-panel,
    .experiment-panel {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
        padding: 12px;
    }

    .scene-panel {
        position: static;
    }

    .scene-frame {
        min-height: 0;
        flex: 1;
    }

    #scene {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: calc(100svh - 120px);
    }

    .experiment-panel .panel-heading,
    .experiment-panel .clock-console,
    .experiment-panel .experiment-status-grid,
    .experiment-panel .trial-toolbar,
    .experiment-panel .subsection-heading {
        flex: 0 0 auto;
    }

    .measurement-table-wrap {
        height: auto;
        min-height: 260px;
        flex: 1;
    }

    .analysis-panel,
    .decision-panel {
        padding: 12px;
    }

    .analysis-panel {
        display: flex;
        min-height: 0;
        flex-direction: column;
        overflow: auto;
    }

    .analysis-panel .panel-heading,
    .analysis-panel .analysis-metrics,
    .analysis-panel .chart-note {
        flex: 0 0 auto;
    }

    .chart-frame {
        height: auto;
        min-height: 185px;
        flex: 1;
    }

    .decision-panel {
        align-self: end;
    }

    body[data-mission-phase="launching-correct"] .identify-block,
    body[data-mission-phase="revealed"] .identify-block,
    body[data-mission-phase="complete"] .identify-block {
        display: none;
    }

    .decision-heading {
        align-items: center;
        margin-bottom: 8px;
    }

    .mission-outcome {
        margin-top: 8px;
        padding: 10px;
    }

    .truth-details {
        gap: 5px;
        margin-top: 8px;
    }

    .truth-details > div {
        padding: 6px;
    }
}

@media (min-width: 1400px) {
    .workspace {
        grid-template-columns:
            clamp(400px, calc(46.667svh - 18px), 440px)
            350px
            minmax(0, 1fr);
    }

    .analysis-metrics.is-delay-model {
        grid-template-columns:
            minmax(171px, 1.2fr)
            minmax(140px, 0.95fr)
            minmax(180px, 1.25fr)
            minmax(96px, 0.7fr);
    }

    .analysis-metric {
        min-height: 55px;
    }
}

@media (max-width: 1101px) {
    body {
        overflow-y: auto;
    }

    .app-shell,
    .workspace {
        height: auto;
    }

    .scene-panel,
    .experiment-panel {
        height: auto;
    }

    #scene {
        width: min(100%, 420px, calc((100svh - 90px) * 420 / 760));
    }

    .measurement-table-wrap {
        height: clamp(280px, 42vh, 430px);
    }
}

@media (max-width: 760px) {
    #scene {
        width: min(100%, 420px);
    }

    .measurement-table-wrap {
        height: 320px;
    }

    .navigation-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 390px) {
    .decision-heading {
        align-items: flex-start;
    }

    .navigation-actions {
        max-width: 48%;
    }

    .navigation-actions .panel-chip {
        max-width: 100%;
    }

    .navigation-actions .btn {
        width: 100%;
    }
}
