body {
    --mono: "Consolas", "Courier New", monospace;
    --serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
    --sans: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: var(--space-5);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
        linear-gradient(180deg, #0e1215 0%, #090c0f 100%);
}

.viewer-page {
    max-width: 1480px;
    margin: 0 auto;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.viewer-eyebrow,
.section-label,
.choice-group legend,
.viewer-links a,
.sync-card,
.state-list {
    font-family: var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.viewer-eyebrow {
    margin: 0 0 var(--space-3);
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
}

.viewer-heading h1 {
    max-width: 10ch;
    margin-bottom: var(--space-3);
    font-family: var(--serif);
    font-size: clamp(3rem, 4.2vw, 4.9rem);
    font-weight: 500;
    letter-spacing: -0.06em;
    line-height: 0.92;
}

.viewer-intro {
    max-width: 64ch;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.72;
}

.viewer-links {
    display: grid;
    gap: var(--space-2);
    justify-items: end;
}

.viewer-links a {
    color: rgba(255, 255, 255, 0.76);
    font-size: 11px;
    text-decoration: none;
}

.viewer-links a:hover {
    color: rgba(255, 255, 255, 0.98);
}

.viewer-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
}

.viewer-panel,
.viewer-stage {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.viewer-panel {
    position: sticky;
    top: var(--space-4);
    padding: var(--space-5);
}

.panel-section + .panel-section {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-label {
    margin: 0 0 var(--space-3);
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
}

.sync-card {
    margin: 0 0 var(--space-3);
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
}

.section-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: var(--text-sm);
    line-height: 1.66;
}

.choice-group {
    padding: 0;
    margin: 0;
    border: 0;
}

.choice-group legend {
    padding: 0;
    margin-bottom: var(--space-3);
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

#languageChoices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-grid-stacked {
    grid-template-columns: 1fr;
}

.choice-option {
    display: grid;
}

.choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-option span {
    display: block;
    padding: 12px 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    line-height: 1.45;
    cursor: pointer;
}

.choice-option strong {
    display: block;
    margin-bottom: 6px;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.choice-option input:checked + span {
    border-color: rgba(242, 193, 112, 0.5);
    background: rgba(242, 193, 112, 0.12);
}

.toggle-list {
    display: grid;
    gap: var(--space-2);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--text-sm);
}

.toggle-row input {
    accent-color: var(--accent);
}

.slide-note h2 {
    margin-bottom: var(--space-2);
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.slide-summary {
    margin-bottom: var(--space-4);
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.68;
}

.state-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.state-list li {
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
}

.viewer-stage {
    padding: 12px;
}

.viewer-frame {
    display: block;
    width: 100%;
    min-height: 980px;
    border: 0;
    background: #0d1114;
}

@media (max-width: 1180px) {
    .viewer-header,
    .viewer-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .viewer-links {
        justify-items: start;
    }

    .viewer-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    body {
        padding: var(--space-4);
    }

    .viewer-panel,
    .viewer-stage {
        padding: var(--space-4);
    }

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

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

    .viewer-frame {
        min-height: 840px;
    }
}
