:root {
    --accent-cyan: #4dd0c8;
    --accent-cyan-soft: rgba(77, 208, 200, 0.16);
    --accent-green: #7bd389;
    --accent-green-bg: rgba(123, 211, 137, 0.2);
    --accent-amber: #ffb347;
    --accent-amber-bg: rgba(255, 179, 71, 0.18);
    --accent-red: #ff8593;
    --accent-red-bg: rgba(255, 110, 127, 0.22);
    --accent-violet: #c792ea;
    --surface-1: rgba(255, 255, 255, 0.05);
    --surface-2: rgba(255, 255, 255, 0.09);
    --surface-dock: rgba(0, 5, 54, 0.93);
    --border-subtle: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.35);
    --dock-offset: 13.5rem;
}

* {
    box-sizing: border-box;
}

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

.viz-shell {
    max-width: 82rem;
    margin: 2.5rem auto 3rem;
    padding: 0 1.5rem;
}

@media screen and (min-width: 64em) {
    .viz-shell {
        padding: 0 2.5rem;
    }
}

.viz-hero {
    margin-bottom: 1.15rem;
}

.viz-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.viz-hero h1 {
    margin: 0 0 0.35rem;
    font-size: 1.85rem;
    letter-spacing: -0.01em;
}

.viz-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    max-width: 50rem;
    font-size: 0.98rem;
}

.viz-kbd-hint {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: right;
    opacity: 0.88;
}

.viz-kbd-hint kbd {
    display: inline-block;
    padding: 0.08rem 0.38rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--fg);
}

/* Sticky Top Timeline Dock */
.timeline-dock {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-dock);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 0.85rem 1.1rem 0.8rem;
    margin-bottom: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 2, 24, 0.65);
}

.timeline-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline-nav-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.tl-btn {
    background: var(--surface-2);
    color: var(--fg);
    border: 1px solid var(--border-subtle);
    border-radius: 0.42rem;
    padding: 0.36rem 0.72rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}

.tl-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--border-strong);
}

.tl-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.tl-btn[aria-pressed="true"] {
    background: var(--accent-cyan-soft);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.step-select {
    background: var(--code-bg);
    color: var(--fg);
    border: 1px solid var(--border-strong);
    border-radius: 0.42rem;
    padding: 0.36rem 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
    max-width: 17.5rem;
    cursor: pointer;
}

.step-select:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 1px;
}

.timeline-meta-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.meta-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    color: var(--muted);
    white-space: nowrap;
}

.date-pill {
    color: var(--accent-cyan);
    border-color: rgba(77, 208, 200, 0.4);
    background: rgba(77, 208, 200, 0.1);
    font-weight: 600;
}

.view-mode-group {
    display: inline-flex;
    background: var(--code-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 0.45rem;
    overflow: hidden;
}

.mode-btn {
    background: transparent;
    color: var(--muted);
    border: none;
    border-right: 1px solid var(--border-subtle);
    padding: 0.32rem 0.62rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.mode-btn:last-child {
    border-right: none;
}

.mode-btn:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
    background: rgba(211, 214, 255, 0.18);
    color: var(--fg);
    font-weight: 600;
}

/* Scrubber & Impulse Bars */
.timeline-scrubber-wrap {
    position: relative;
    margin-top: 0.65rem;
    padding-top: 0.1rem;
}

.timeline-bars {
    display: grid;
    grid-template-columns: repeat(102, 1fr);
    align-items: end;
    height: 1.55rem;
    gap: 1px;
    padding: 0 6px;
    margin-bottom: -2px;
}

.tl-bar {
    height: 100%;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
}

.tl-bar-fill {
    width: 100%;
    min-height: 3px;
    border-radius: 2px 2px 0 0;
    background: rgba(211, 214, 255, 0.26);
    transition: background 0.12s ease, transform 0.12s ease;
}

.tl-bar:hover .tl-bar-fill {
    background: var(--accent-amber);
}

.tl-bar.passed .tl-bar-fill {
    background: rgba(77, 208, 200, 0.52);
}

.tl-bar.active .tl-bar-fill {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(77, 208, 200, 0.85);
}

.timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    outline: none;
    margin: 0.2rem 0 0.15rem;
    cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(77, 208, 200, 0.8);
    cursor: grab;
    transition: transform 0.1s ease;
}

.timeline-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.18);
}

.timeline-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(77, 208, 200, 0.8);
    cursor: grab;
}

.timeline-tooltip {
    position: absolute;
    top: -2.2rem;
    transform: translateX(-50%);
    background: var(--code-bg);
    color: var(--fg);
    border: 1px solid var(--border-strong);
    border-radius: 0.38rem;
    padding: 0.24rem 0.55rem;
    font-size: 0.76rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 60;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.timeline-ticks {
    position: relative;
    height: 1.05rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.78;
    margin: 0 6px;
}

.tl-tick-label {
    position: absolute;
    transform: translateX(-50%);
    top: 0;
    white-space: nowrap;
}

.tl-tick-label.tick-start,
.tl-tick-label:first-child {
    transform: translateX(0);
}

.tl-tick-label.tick-end,
.tl-tick-label:last-child {
    transform: translateX(-100%);
}

/* Summary & Changes Strip */
.timeline-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.step-summary {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--fg);
    flex: 1;
}

.step-stats {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
}

.stat-badge {
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.stat-added {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.stat-modified {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
}

.stat-repealed {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.changes-strip-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.changes-strip-wrap[hidden] {
    display: none !important;
}

.changes-hop-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.changes-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    margin-right: 0.15rem;
}

.hop-btn {
    background: var(--surface-2);
    color: var(--fg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    width: 1.55rem;
    height: 1.5rem;
    line-height: 1;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
}

.hop-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--border-strong);
}

.change-counter {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--muted);
    min-width: 2.9rem;
    text-align: center;
}

.changes-pills {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.change-pill {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
    padding: 0.18rem 0.52rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-1);
    color: var(--fg);
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.change-pill:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.change-pill.op-added {
    border-color: rgba(123, 211, 137, 0.5);
    color: var(--accent-green);
}

.change-pill.op-modified {
    border-color: rgba(255, 179, 71, 0.5);
    color: var(--accent-amber);
}

.change-pill.op-repealed {
    border-color: rgba(255, 133, 147, 0.5);
    color: var(--accent-red);
}

.change-pill.focused {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px #ffffff;
    font-weight: 700;
}

/* Reader Two-Column Workspace */
.mobile-toc-bar {
    display: none;
    margin-bottom: 0.9rem;
}

.mobile-toc-btn {
    width: 100%;
    text-align: left;
}

.reader-layout {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

/* Sidebar TOC */
.toc-sidebar {
    position: sticky;
    top: var(--dock-offset);
    max-height: calc(100vh - var(--dock-offset) - 1.5rem);
    display: flex;
    flex-direction: column;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 0.7rem;
    overflow: hidden;
}

.search-box-wrap {
    position: relative;
    padding: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 5, 54, 0.55);
}

.search-input {
    width: 100%;
    background: var(--code-bg);
    color: var(--fg);
    border: 1px solid var(--border-subtle);
    border-radius: 0.4rem;
    padding: 0.42rem 0.6rem;
    font-size: 0.84rem;
}

.search-input::placeholder {
    color: rgba(211, 214, 255, 0.55);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.search-results {
    position: absolute;
    left: 0.65rem;
    right: 0.65rem;
    top: calc(100% - 0.2rem);
    max-height: 18rem;
    overflow-y: auto;
    background: var(--code-bg);
    border: 1px solid var(--border-strong);
    border-radius: 0.45rem;
    z-index: 40;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
}

.search-hit {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fg);
    padding: 0.48rem 0.65rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.search-hit:last-child {
    border-bottom: none;
}

.search-hit:hover {
    background: var(--surface-2);
}

.search-hit-title {
    font-weight: 600;
    color: var(--accent-cyan);
    display: block;
}

.search-hit-snippet {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.12rem;
}

.toc-list {
    overflow-y: auto;
    padding: 0.45rem 0;
    scrollbar-width: thin;
}

.toc-group-label {
    padding: 0.45rem 0.8rem 0.22rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    opacity: 0.75;
}

.toc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--muted);
    padding: 0.34rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.toc-item:hover {
    background: var(--surface-2);
    color: var(--fg);
}

.toc-item.has-change {
    border-left-color: var(--accent-amber);
    color: var(--fg);
    background: rgba(255, 179, 71, 0.07);
}

.toc-item.is-repealed {
    opacity: 0.55;
    text-decoration: line-through;
}

.toc-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
    color: var(--fg);
    font-weight: 600;
    margin-right: 0.25rem;
}

.toc-change-badge {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    padding: 0.06rem 0.38rem;
    border-radius: 999px;
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
    font-weight: 700;
}

/* Main Constitution Document Stream */
.doc-pane {
    min-width: 0;
}

.loading-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.85rem;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.doc-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: var(--dock-offset);
}

.part-banner {
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.1rem;
    background: rgba(255, 255, 255, 0.045);
    border-left: 3px solid var(--fg);
    border-radius: 0 0.5rem 0.5rem 0;
    scroll-margin-top: var(--dock-offset);
}

.part-banner.part-repealed {
    border-left-color: var(--accent-red);
    opacity: 0.75;
}

.part-eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    font-weight: 700;
}

.part-title {
    margin: 0.2rem 0 0;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.chapter-heading {
    margin: 1.6rem 0 0.6rem;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.3rem;
}

.section-subheading {
    margin: 1.15rem 0 0.55rem;
    font-size: 0.96rem;
    font-style: italic;
    color: var(--muted);
}

/* Unit Cards (Preamble, Articles, Schedules) */
.unit-card {
    background: var(--card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.65rem;
    padding: 1.05rem 1.25rem;
    margin-bottom: 0.95rem;
    scroll-margin-top: var(--dock-offset);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.unit-card.preamble-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.26);
    padding: 1.35rem 1.6rem;
}

.unit-card.unit-repealed {
    opacity: 0.68;
    background: rgba(255, 255, 255, 0.03);
}

.unit-card.changed-added {
    border-color: rgba(123, 211, 137, 0.72);
    box-shadow: 0 0 0 1px rgba(123, 211, 137, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35);
}

.unit-card.changed-modified {
    border-color: rgba(255, 179, 71, 0.72);
    box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35);
}

.unit-card.changed-repealed {
    border-color: rgba(255, 133, 147, 0.72);
    box-shadow: 0 0 0 1px rgba(255, 133, 147, 0.25), 0 6px 20px rgba(0, 0, 0, 0.35);
    opacity: 0.94;
}

.unit-card.spotlight-pulse {
    animation: cardPulse 1.4s ease-out;
}

@keyframes cardPulse {
    0% {
        box-shadow: 0 0 0 3px var(--accent-cyan), 0 0 28px rgba(77, 208, 200, 0.55);
    }
    100% {
        box-shadow: 0 0 0 1px rgba(77, 208, 200, 0.2);
    }
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.unit-title-group {
    flex: 1;
    min-width: 14rem;
}

.unit-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-right: 0.4rem;
    font-size: 0.98rem;
}

.unit-heading {
    margin: 0;
    font-size: 1.04rem;
    line-height: 1.38;
    display: inline;
}

.unit-subtitle {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.unit-badges {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    flex-wrap: wrap;
}

.op-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.14rem 0.48rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.op-badge.added {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.op-badge.modified {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
}

.op-badge.repealed {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.hist-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.hist-chip:hover {
    background: rgba(77, 208, 200, 0.16);
    border-color: var(--accent-cyan);
    color: var(--fg);
}

.hist-chip.current {
    background: rgba(77, 208, 200, 0.22);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Clause & Paragraph Typography */
.unit-body {
    line-height: 1.72;
    font-size: 0.97rem;
}

.unit-para {
    margin: 0 0 0.55rem;
}

.unit-para:last-child {
    margin-bottom: 0;
}

.unit-para.subclause {
    padding-left: 1.5rem;
}

.unit-para.subsubclause {
    padding-left: 2.75rem;
}

.unit-para.proviso,
.unit-para.explanation {
    padding-left: 1.1rem;
    border-left: 2px solid rgba(211, 214, 255, 0.25);
    color: #eef0ff;
}

.preamble-card .unit-para {
    font-size: 1.03rem;
    line-height: 1.8;
}

/* Inline Diff Highlighting */
ins.diff-add {
    text-decoration: none;
    background: var(--accent-green-bg);
    color: #c6ffd0;
    border-bottom: 1px solid rgba(123, 211, 137, 0.75);
    padding: 0.04rem 0.2rem;
    border-radius: 3px;
}

del.diff-del {
    text-decoration: line-through;
    background: var(--accent-red-bg);
    color: #ffb8c1;
    padding: 0.04rem 0.2rem;
    border-radius: 3px;
    opacity: 0.92;
}

.para-added {
    background: rgba(123, 211, 137, 0.1);
    border-left: 3px solid var(--accent-green);
    padding: 0.35rem 0.65rem;
    border-radius: 0 4px 4px 0;
}

.para-removed {
    background: rgba(255, 110, 127, 0.1);
    border-left: 3px solid var(--accent-red);
    padding: 0.35rem 0.65rem;
    border-radius: 0 4px 4px 0;
}

/* Schedule Structured Tables & Lists */
.related-arts {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.related-art-link {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.sched-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0;
    border: 1px solid var(--border-subtle);
    border-radius: 0.45rem;
}

.sched-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: rgba(0, 5, 54, 0.4);
}

.sched-table th,
.sched-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    vertical-align: top;
}

.sched-table th {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 700;
}

.sched-table tr:last-child td {
    border-bottom: none;
}

.ascii-table {
    background: var(--code-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 0.45rem;
    padding: 0.75rem 0.9rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0.65rem 0;
}

.empty-filter-state {
    padding: 2rem 1.25rem;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 0.65rem;
    color: var(--muted);
    text-align: center;
}

.viz-footer {
    margin-top: 3rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.viz-footer p {
    margin-top: 1rem;
}

/* Responsive adjustments */
@media screen and (max-width: 58em) {
    .viz-shell {
        padding: 0 1rem;
        margin-top: 1.25rem;
    }

    .viz-kbd-hint {
        display: none;
    }

    .mobile-toc-bar {
        display: block;
    }

    .reader-layout {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        display: none;
        position: static;
        max-height: 24rem;
        margin-bottom: 1rem;
    }

    .toc-sidebar.open {
        display: flex;
    }

    .step-select {
        max-width: 13.5rem;
    }

    .tally-pill {
        display: none;
    }

    .changes-strip-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .changes-pills {
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
}

@media screen and (max-width: 40em) {
    .timeline-dock {
        padding: 0.72rem 0.82rem 0.7rem;
    }

    .step-select-wrap {
        flex: 1 1 8.5rem;
        min-width: 0;
    }

    .step-select {
        width: 100%;
        max-width: none;
    }

    .timeline-ticks {
        font-size: 0.66rem;
    }

    .timeline-summary-row {
        flex-wrap: wrap;
        gap: 0.35rem 0.75rem;
    }

    .unit-title-group {
        min-width: 0;
    }
}
