.viewer-route-page {
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 3rem);
    background: var(--color-base);
    color: var(--color-text);
}

.viewer-route-nav {
    margin: 0 auto 1rem;
    max-width: 72rem;
}

.model-viewer-shell {
    display: grid;
    gap: 1rem;
    max-width: 72rem;
    margin: 0 auto;
}

.model-viewer-header,
.model-viewer-boundary,
.viewer-demo-controls {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.model-viewer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.model-viewer-header h1,
.model-viewer-header p {
    margin: 0;
}

.viewer-eyebrow {
    font-family: var(--font-mono);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.viewer-status-pill {
    white-space: nowrap;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.35rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.viewer-demo-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
}

.viewer-demo-button {
    border: 1px solid var(--color-border);
    background: var(--color-base);
    color: var(--color-text);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
}

.viewer-demo-button:hover,
.viewer-demo-button.is-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.model-viewer-boundary {
    position: relative;
    overflow: hidden;
    min-height: min(72vh, 42rem);
}

.model-viewer-stage {
    position: relative;
    min-height: min(72vh, 42rem);
    display: grid;
    grid-template-rows: minmax(24rem, min(56vh, 34rem)) auto;
    background:
        linear-gradient(135deg, rgb(255 255 255 / 0.06), transparent 30%),
        radial-gradient(circle at 50% 35%, rgb(255 255 255 / 0.12), transparent 24%),
        var(--color-base);
}

.model-viewer-canvas {
    display: block;
    width: 100%;
    min-height: 0;
    height: 100%;
    grid-row: 1;
    grid-column: 1;
    touch-action: none;
    cursor: grab;
}

.model-viewer-preview {
    grid-row: 1;
    grid-column: 1;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.model-preview-shadow { fill: rgb(0 0 0 / 0.22); }
.model-preview-body { fill: color-mix(in srgb, var(--color-primary) 38%, transparent); stroke: var(--color-primary); stroke-width: 4; }
.model-preview-cut { fill: color-mix(in srgb, var(--color-base) 80%, transparent); stroke: var(--color-border); stroke-width: 3; }
.model-preview-line { fill: none; stroke: color-mix(in srgb, var(--color-primary) 70%, var(--color-text)); stroke-width: 3; }
.model-preview-label { fill: var(--color-muted); font-family: var(--font-mono); font-size: 18px; }

.model-viewer-overlay {
    position: relative;
    margin: 1rem;
    max-width: none;
    padding: 1rem;
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.model-viewer-overlay h2,
.model-viewer-overlay p,
.viewer-mesh-summary {
    margin: 0;
}

.model-viewer-overlay p + .viewer-mesh-summary,
.viewer-mesh-summary + .viewer-lifecycle-note {
    margin-top: 0.75rem;
}

.viewer-mesh-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}

.viewer-mesh-summary div {
    display: grid;
    gap: 0.15rem;
}

.viewer-mesh-summary dt {
    color: var(--color-subtle);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.viewer-mesh-summary dd {
    margin: 0;
}

.viewer-lifecycle-note {
    color: var(--color-subtle);
    font-size: 0.85rem;
}
