:root {
    color-scheme: dark;
    --bg: #0a0c0f;
    --surface: #101318;
    --surface-2: #151a20;
    --surface-3: #1b2129;
    --line: #2b333d;
    --line-strong: #3c4652;
    --text: #f2f5f7;
    --muted: #8f9aa7;
    --muted-2: #626d79;
    --accent: #c7ff45;
    --accent-ink: #111705;
    --blue: #73a8ff;
    --cyan: #58d7d5;
    --amber: #ffc65c;
    --red: #ff6d68;
    --shadow: rgba(0, 0, 0, .42);
    --grid: rgba(255, 255, 255, .035);
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --radius: 6px;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #edf0f2;
    --surface: #f8f9fa;
    --surface-2: #ffffff;
    --surface-3: #e5e9ed;
    --line: #cbd2d9;
    --line-strong: #aeb8c1;
    --text: #15191e;
    --muted: #596571;
    --muted-2: #7b8792;
    --accent: #8cba00;
    --accent-ink: #ffffff;
    --blue: #2669cf;
    --cyan: #058b8a;
    --amber: #b36b00;
    --red: #c83d38;
    --shadow: rgba(31, 42, 52, .14);
    --grid: rgba(18, 28, 38, .055);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.shell { width: min(1440px, calc(100% - 48px)); margin-inline: auto; }
.w-full { width: 100%; }

.ambient-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.82) 45%, transparent 92%);
}
.ambient-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0 66%, color-mix(in srgb, var(--accent) 7%, transparent) 66% 66.4%, transparent 66.4%);
}

/* Header / brand */
.site-header,
.viewer-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header {
    min-height: 82px;
    border-bottom: 1px solid var(--line);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}
.brand:hover { color: var(--text); }
.brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    overflow: hidden;
}
.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--accent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 65%, transparent);
}
.brand-mark::before { left: 7px; top: 8px; }
.brand-mark::after { right: 7px; top: 13px; }
.brand-mark span::before { left: 14px; bottom: 7px; }
.brand-mark span::after { right: 10px; bottom: 11px; background: var(--blue); }
.brand-copy { display: grid; min-width: 0; line-height: 1.12; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.brand-copy small {
    margin-top: 5px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .055em;
    white-space: nowrap;
}
.header-actions,
.viewer-actions,
.site-footer nav,
.hero-links,
.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quiet-link,
.viewer-github {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.quiet-link { padding: 10px 8px; }
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.theme-switch:hover { border-color: var(--line-strong); color: var(--text); }
.theme-switch-track {
    position: relative;
    width: 30px;
    height: 14px;
    border: 1px solid var(--line-strong);
    background: var(--surface-3);
}
.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    transition: transform .18s ease;
}
html[data-theme="light"] .theme-switch-thumb { transform: translateX(16px); }

/* Landing */
.landing-main { padding: 72px 0 100px; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.13fr) minmax(420px, .87fr);
    gap: clamp(44px, 7vw, 112px);
    align-items: center;
    min-height: 640px;
}
.hero-copy { position: relative; padding: 30px 0 46px; }
.hero-copy::before {
    content: "OBS / 26.1.2";
    position: absolute;
    right: 0;
    top: 2px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    writing-mode: vertical-rl;
}
.eyebrow,
.console-kicker,
.sidebar-label,
.profile-id-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 30px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--muted-2); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
.status-dot.offline { background: var(--red); }
.hero-copy h1 {
    max-width: 860px;
    margin: 0;
    font-size: clamp(54px, 7.3vw, 108px);
    font-weight: 760;
    line-height: .91;
    letter-spacing: -.064em;
}
.hero-copy h1 em { color: var(--accent); font-style: normal; font-weight: 500; }
.hero-lead {
    max-width: 710px;
    margin: 34px 0 0;
    color: var(--muted);
    font-size: clamp(17px, 1.3vw, 20px);
    line-height: 1.65;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 730px;
    margin-top: 44px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.hero-stats div { padding: 18px 18px 19px 0; }
.hero-stats div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.hero-stats strong { display: block; font-family: var(--mono); font-size: 22px; line-height: 1; }
.hero-stats span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.hero-links { margin-top: 24px; }
.text-action {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-strong);
    font-size: 13px;
    font-weight: 700;
}
.text-action b { color: var(--accent); font-family: var(--mono); }
.text-action.muted { color: var(--muted); }

.upload-console {
    position: relative;
    padding: 26px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 18px 18px 0 color-mix(in srgb, var(--surface-3) 76%, transparent), 0 35px 90px var(--shadow);
}
.upload-console::before {
    content: "";
    position: absolute;
    inset: 8px -9px -9px 8px;
    z-index: -1;
    border-right: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
}
.console-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.console-head h2,
.project-statement h2,
.workflow-section h2,
.workspace-heading h1 {
    margin: 7px 0 0;
    font-size: clamp(24px, 2.4vw, 36px);
    line-height: 1.1;
    letter-spacing: -.035em;
}
.format-chip {
    padding: 5px 7px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .09em;
}
.dropzone {
    display: grid;
    justify-items: center;
    margin-top: 24px;
    padding: 45px 20px 39px;
    border: 1px dashed var(--line-strong);
    background:
        linear-gradient(90deg, transparent 0 49.8%, var(--grid) 49.8% 50.2%, transparent 50.2%),
        linear-gradient(transparent 0 49.8%, var(--grid) 49.8% 50.2%, transparent 50.2%);
    background-size: 28px 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging { border-color: var(--accent); outline: none; transform: translateY(-2px); }
.dropzone.has-file { border-color: var(--cyan); }
.dropzone-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
}
.dropzone-icon svg,
.square-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.dropzone strong { font-size: 16px; }
.dropzone > span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.dropzone small { margin-top: 18px; color: var(--muted-2); font-family: var(--mono); font-size: 10px; }
.file-selection {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 14px;
    padding: 12px;
    border-left: 3px solid var(--cyan);
    background: var(--surface-2);
}
.file-glyph {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 800;
}
.file-meta { display: grid; flex: 1; min-width: 0; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-meta span { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.icon-ghost {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
}
.icon-ghost:hover { color: var(--red); }
.upload-actions { display: grid; grid-template-columns: 1.25fr .9fr; gap: 10px; margin-top: 18px; }
.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 48px;
    padding: 0 17px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .025em;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}
.primary-action { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.primary-action:hover:not(:disabled) { color: var(--accent-ink); transform: translateY(-2px); }
.secondary-action { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.secondary-action:hover:not(:disabled) { border-color: var(--text); color: var(--text); transform: translateY(-2px); }
.primary-action:disabled,
.secondary-action:disabled { opacity: .36; cursor: not-allowed; }
.compact { min-height: 36px; padding-inline: 12px; font-size: 10px; }
.action-arrow { font-family: var(--mono); font-size: 16px; }
.progress-line { height: 2px; margin-top: 17px; overflow: hidden; background: var(--surface-3); }
.progress-line span { display: block; width: 35%; height: 100%; background: var(--accent); animation: scanning 1s linear infinite; }
@keyframes scanning { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
.upload-message { min-height: 21px; margin-top: 11px; color: var(--muted); font-size: 12px; }
.upload-message[data-state="error"] { color: var(--red); }
.upload-message[data-state="success"] { color: var(--accent); }
.upload-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 13px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
    background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
}
.upload-result > div:first-child { display: grid; }
.upload-result span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.upload-result strong { font-family: var(--mono); }

.project-statement {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) minmax(330px, .78fr);
    gap: 42px;
    align-items: start;
    margin-top: 118px;
    padding: 42px 0;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}
.statement-code {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .12em;
}
.statement-copy p { max-width: 760px; margin: 18px 0 0; color: var(--muted); }
.statement-copy strong { color: var(--text); }
.statement-links { display: grid; border-top: 1px solid var(--line); }
.statement-links a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.statement-links a span { font-weight: 750; font-size: 13px; }
.statement-links a small { grid-column: 1; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.statement-links a b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); }
.workflow-section { margin-top: 110px; }
.section-heading { display: grid; grid-template-columns: 80px 1fr; align-items: start; }
.section-index { color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }
.section-heading p { margin: 10px 0 0; color: var(--muted); }
.workflow-rail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 36px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}
.workflow-rail article { position: relative; min-height: 220px; padding: 30px 30px 32px 0; }
.workflow-rail article + article { padding-left: 30px; border-left: 1px solid var(--line); }
.workflow-rail article > span { color: var(--muted-2); font-family: var(--mono); font-size: 11px; }
.workflow-rail h3 { margin: 55px 0 10px; font-size: 18px; }
.workflow-rail p { margin: 0; color: var(--muted); font-size: 14px; }
.site-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    min-height: 126px;
    padding-top: 34px;
    padding-bottom: 34px;
    border-top: 1px solid var(--line);
}
.site-footer > div { display: grid; }
.site-footer strong { font-size: 13px; }
.site-footer span { margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.site-footer nav { flex-wrap: wrap; justify-content: flex-end; }
.site-footer a { color: var(--muted); font-size: 11px; }

/* Viewer */
.viewer-page { background: var(--bg); }
.profile-app { min-height: 100vh; }
.viewer-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line-strong); background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(14px); }
.viewer-header-main { min-height: 68px; padding: 0 22px; }
.compact-brand .brand-mark { width: 34px; height: 34px; }
.profile-identity {
    display: grid;
    margin-left: auto;
    margin-right: 28px;
    padding-left: 26px;
    border-left: 1px solid var(--line);
}
.profile-identity strong { margin-top: 3px; font-family: var(--mono); font-size: 13px; }
.viewer-actions { flex: none; }
.viewer-github { padding: 8px 4px; }
.icon-only [data-theme-label] { display: none; }
.square-action {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}
.square-action:hover { border-color: var(--accent); color: var(--accent); }
.viewer-context {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    min-height: 54px;
    padding: 0 22px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.context-item { display: grid; align-content: center; padding-right: 24px; }
.context-item + .context-item { padding-left: 24px; border-left: 1px solid var(--line); }
.context-item span { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.context-item strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.context-signature { align-self: center; color: var(--muted-2); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
.viewer-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 123px); }
.view-sidebar {
    position: sticky;
    top: 123px;
    align-self: start;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 123px);
    padding: 30px 18px 22px;
    border-right: 1px solid var(--line-strong);
    background: var(--surface);
}
.sidebar-label { padding: 0 12px 16px; }
.view-tabs { display: grid; gap: 3px; }
.view-tab {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 11px;
    align-items: center;
    min-height: 58px;
    padding: 8px 11px;
    border-left: 2px solid transparent;
    color: var(--muted);
}
.view-tab:hover { background: var(--surface-2); color: var(--text); }
.view-tab.active { border-left-color: var(--accent); background: var(--surface-3); color: var(--text); }
.tab-index { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.view-tab > span:last-child { display: grid; min-width: 0; }
.view-tab strong { font-size: 12px; }
.view-tab small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.sidebar-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 24px;
    padding: 16px 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}
.sidebar-note .status-dot { margin-top: 4px; flex: none; }
.sidebar-project {
    display: grid;
    margin-top: auto;
    padding: 17px 12px 0;
    border-top: 1px solid var(--line);
}
.sidebar-project strong { font-size: 11px; }
.sidebar-project span,
.sidebar-project small { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.sidebar-project div { display: flex; gap: 12px; margin-top: 10px; }
.sidebar-project a { color: var(--blue); font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.viewer-workspace { min-width: 0; padding: 26px; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); background: var(--surface); }
.summary-strip > div { min-height: 96px; padding: 18px; }
.summary-strip > div + div { border-left: 1px solid var(--line); }
.summary-card { display: grid; align-content: space-between; }
.summary-card span { color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.summary-card strong { margin-top: 12px; font-family: var(--mono); font-size: 26px; line-height: 1; }
.summary-card small { margin-top: 7px; color: var(--muted-2); font-size: 9px; }
.skeleton-summary > div { position: relative; overflow: hidden; }
.skeleton-summary > div::after { content: ""; position: absolute; inset: 18px; background: linear-gradient(90deg, var(--surface-3), var(--line), var(--surface-3)); background-size: 220% 100%; animation: skeleton 1.2s linear infinite; }
@keyframes skeleton { to { background-position: -220% 0; } }
.workspace-panel { margin-top: 18px; border: 1px solid var(--line-strong); background: var(--surface); }
.workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 26px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}
.workspace-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; color: var(--muted); font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.severity { display: inline-block; width: 12px; height: 3px; background: var(--muted); }
.severity.cool { background: var(--cyan); }
.severity.warm { background: var(--amber); }
.severity.hot { background: var(--red); }
#viewer { min-width: 0; }
.profile-loading {
    display: grid;
    justify-items: center;
    padding: 100px 20px;
    color: var(--muted);
    text-align: center;
}
.profile-loading strong { margin-top: 18px; color: var(--text); }
.profile-loading small { margin-top: 5px; }
.loader-ring { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-top-color: var(--accent); animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.profile-error { margin: 20px; padding: 20px; border-left: 3px solid var(--red); background: color-mix(in srgb, var(--red) 7%, var(--surface-2)); color: var(--red); }
.profile-search {
    width: calc(100% - 40px);
    margin: 20px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 0;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 11px;
}
.profile-search:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.profile-search::placeholder { color: var(--muted-2); }
.table-scroll { max-width: 100%; overflow: auto; }
.profile-table,
.aggregate-table,
.chunk-table,
.info-table { width: 100%; border-collapse: collapse; }
.profile-table { min-width: 760px; }
.profile-table td,
.profile-table th,
.aggregate-table td,
.chunk-table td,
.chunk-table th,
.info-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.profile-table tr:not(.dimension-row):hover td,
.aggregate-table tr:not(:first-child):hover td,
.chunk-table tr:not(:first-child):hover td { background: var(--surface-2); }
.dimension-row td { border-bottom-color: var(--line-strong); background: var(--surface-3); font-weight: 760; }
.dimension-toggle { cursor: pointer; user-select: none; }
.dimension-toggle span:last-child { color: var(--muted); font-weight: 400; font-size: 10px; }
.entry-name { overflow-wrap: anywhere; font-family: var(--mono); font-size: 11px; }
.time-column,
.aggregate-time { width: 190px; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.position-column { width: 340px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.position-value { display: inline-block; min-width: 210px; }
.metric {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 92px;
    color: var(--text);
    font-family: var(--mono);
}
.metric::before { content: ""; width: 4px; height: 14px; background: var(--cyan); }
.metric.warm::before { background: var(--amber); }
.metric.hot::before { background: var(--red); }
.visit-button,
.pager-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 10px;
}
.visit-button:hover,
.pager-button:hover { color: var(--accent); }
.pager-row td { padding: 15px 16px; }
.aggregate-table { min-width: 620px; }
.aggregate-table tr:first-child td,
.chunk-table th { color: var(--muted); font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.aggregate-name { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.chunk-table { min-width: 760px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0; }
.info-section { min-width: 0; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.info-section h2 { margin: 0 0 14px; font-size: 14px; }
.info-key { width: 36%; color: var(--muted); font-family: var(--mono); font-size: 9px; overflow-wrap: anywhere; }
.info-value { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 10px; }
.trace-search { margin-bottom: 0; }
.trace-entry { margin: 0; padding: 15px 20px; border-top: 1px solid var(--line); }
.trace-entry summary { cursor: pointer; font-family: var(--mono); font-size: 10px; }
.trace-tree { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.trace-tree li { margin: 5px 0; }
.empty-state { padding: 70px 24px; color: var(--muted); text-align: center; }
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    max-width: min(520px, calc(100vw - 48px));
    padding: 13px 16px;
    border-left: 3px solid var(--accent);
    background: var(--surface-3);
    box-shadow: 0 18px 60px var(--shadow);
    color: var(--text);
    font-family: var(--mono);
    font-size: 10px;
}
.error-stage {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 100vh;
    padding: 30px;
    text-align: center;
}
.error-code { color: var(--accent); font-family: var(--mono); font-size: 14px; letter-spacing: .2em; }
.error-stage h1 { margin: 12px 0 0; font-size: clamp(38px, 7vw, 76px); letter-spacing: -.06em; }
.error-stage p { color: var(--muted); }
.error-stage .primary-action { margin-top: 20px; }

@media (max-width: 1180px) {
    .hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .hero-copy { max-width: 920px; }
    .upload-console { width: min(760px, 100%); }
    .project-statement { grid-template-columns: 120px 1fr; }
    .statement-links { grid-column: 2; }
    .viewer-layout { grid-template-columns: 210px minmax(0, 1fr); }
    .viewer-workspace { padding: 18px; }
}

@media (max-width: 820px) {
    .shell { width: min(100% - 28px, 1440px); }
    .site-header { min-height: 70px; }
    .header-actions .quiet-link { display: none; }
    .landing-main { padding-top: 42px; }
    .hero-grid { min-height: 0; }
    .hero-copy h1 { font-size: clamp(48px, 16vw, 76px); }
    .hero-copy::before { display: none; }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-stats div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
    .upload-console { padding: 20px; box-shadow: 10px 10px 0 var(--surface-3); }
    .upload-actions { grid-template-columns: 1fr; }
    .project-statement { grid-template-columns: 1fr; gap: 22px; margin-top: 80px; }
    .statement-links { grid-column: 1; }
    .workflow-rail { grid-template-columns: 1fr; }
    .workflow-rail article { min-height: 160px; padding: 24px 0; }
    .workflow-rail article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
    .workflow-rail h3 { margin-top: 30px; }
    .site-footer { align-items: flex-start; flex-direction: column; }
    .site-footer nav { justify-content: flex-start; }

    .viewer-header { position: static; }
    .viewer-header-main { padding: 0 14px; }
    .compact-brand .brand-copy small { display: none; }
    .profile-identity { display: none; }
    .viewer-github { display: none; }
    .viewer-context { grid-template-columns: repeat(2, 1fr); padding: 0; }
    .context-item { padding: 11px 14px; border-bottom: 1px solid var(--line); }
    .context-item + .context-item { padding-left: 14px; }
    .context-signature { display: none; }
    .viewer-layout { display: block; }
    .view-sidebar { position: static; min-height: 0; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
    .sidebar-label, .sidebar-note, .sidebar-project { display: none; }
    .view-tabs { display: flex; min-width: max-content; }
    .view-tab { grid-template-columns: 20px auto; min-height: 48px; padding: 7px 11px; border-left: 0; border-bottom: 2px solid transparent; }
    .view-tab.active { border-left: 0; border-bottom-color: var(--accent); }
    .view-tab small { display: none; }
    .viewer-workspace { padding: 12px; }
    .summary-strip { grid-template-columns: repeat(2, 1fr); }
    .summary-strip > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
    .summary-strip > div:nth-child(4) { border-top: 1px solid var(--line); }
    .workspace-heading { align-items: flex-start; flex-direction: column; }
    .legend { justify-content: flex-start; }
}

@media (max-width: 520px) {
    .brand-copy strong { font-size: 13px; }
    .brand-copy small { font-size: 8px; }
    .theme-switch { padding-inline: 8px; }
    .theme-switch [data-theme-label] { display: none; }
    .landing-main { padding-bottom: 70px; }
    .hero-copy h1 { font-size: 47px; }
    .hero-lead { font-size: 15px; }
    .hero-links { align-items: flex-start; flex-direction: column; gap: 0; }
    .dropzone { padding: 34px 12px; }
    .upload-result { align-items: stretch; flex-direction: column; }
    .result-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .section-heading { grid-template-columns: 48px 1fr; }
    .summary-strip { grid-template-columns: 1fr; }
    .summary-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
    .profile-search { width: calc(100% - 24px); margin: 12px; }
    .workspace-heading { padding: 18px; }
}
