/* ================================================================
   Magis 3D — Dark Minimal Style (inspired by gr8brite.ru)
   Palette: deep dark bg, warm gold accent (#c4a574)
   Fonts: JetBrains Mono + Syne
   ================================================================ */

:root {
    /* Colors */
    --bg-deep: #060607;
    --bg: #0c0c0e;
    --bg-elevated: #121214;
    --bg-hover: #1a1a1d;
    --fg: #f0eeeb;
    --fg-soft: #c8c4bc;
    --muted: #8a8680;
    --dim: #5c5955;
    --line: rgba(240, 238, 235, 0.09);
    --line-strong: rgba(240, 238, 235, 0.16);
    --accent: #c4a574;
    --accent-dim: rgba(196, 165, 116, 0.35);
    --accent-glow: rgba(196, 165, 116, 0.12);
    --danger: #e74c3c;
    --danger-dim: rgba(231, 76, 60, 0.2);
    --info: #3498db;
    --info-dim: rgba(52, 152, 219, 0.2);
    
    /* Radii */
    --radius-sm: 2px;
    --radius: 4px;
    --radius-lg: 6px;
    --radius-pill: 9999px;
    
    /* Typography */
    --font-display: "Syne", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    
    /* Easing */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    accent-color: var(--accent);
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: rgba(196, 165, 116, 0.42);
    color: #141210;
}

::-moz-selection {
    background: rgba(196, 165, 116, 0.42);
    color: #141210;
}

body {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 400;
    background: var(--bg-deep);
    color: var(--fg);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 80% at 50% -30%, var(--accent-glow), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 20%, rgba(80, 70, 90, 0.08), transparent),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(60, 55, 50, 0.12), transparent);
    pointer-events: none;
    z-index: -1;
}

a, a:visited, a:active {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

input, select, textarea {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
}

/* ================================================================
   Typography
   ================================================================ */

.mono {
    font-family: var(--font-mono);
}

.display {
    font-family: var(--font-display);
}

.accent {
    color: var(--accent);
}

.eyebrow {
    font-size: clamp(0.72rem, 2.2vw, 0.88rem);
    font-weight: 600;
    letter-spacing: 0.34em;
    color: var(--accent);
    margin-bottom: 1.1rem;
    text-transform: uppercase;
}

/* ================================================================
   Layout
   ================================================================ */

.wrap {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 1.1rem;
}

@media (min-width: 768px) {
    .wrap {
        padding: 0 2rem;
    }
}

/* ================================================================
   Header (Glass)
   ================================================================ */

.glass-header {
    --glass-x: 50%;
    --glass-y: 50%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    background: rgba(6, 6, 7, 0.42);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: backdrop-filter 0.45s var(--ease), background 0.45s var(--ease);
}

.glass-header::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.008) 42%, transparent 100%),
        radial-gradient(160% 200% at var(--glass-x) var(--glass-y), rgba(255, 248, 235, 0.06) 0%, rgba(255, 255, 255, 0.015) 32%, transparent 62%);
    opacity: 0.28;
    transition: opacity 0.5s var(--ease);
}

.header-inner {
    position: relative;
    z-index: 1;
    max-width: 68rem;
    margin: 0 auto;
    padding: 0.7rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header-inner {
        padding: 0.85rem 2rem;
    }
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
    transition: color 0.25s var(--ease);
}

.logo:hover {
    color: var(--accent);
}

.logo-accent {
    color: var(--accent);
}

.nav-pills {
    display: flex;
    gap: 1.5rem;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
}

.nav-pills a {
    transition: color 0.25s var(--ease);
}

.nav-pills a:hover {
    color: var(--fg);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    font-size: 0.7rem;
}

.user-avatar {
    font-size: 0.9rem;
}

.user-name {
    color: var(--fg-soft);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
    padding: 0.2rem;
}

.logout-btn:hover {
    opacity: 1;
    color: var(--danger);
}

/* ================================================================
   Hero / Top Banner
   ================================================================ */

.top-glass-banner {
    position: relative;
    width: 100%;
    height: clamp(11rem, 38vh, 22rem);
    overflow: hidden;
    isolation: isolate;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

@media (min-width: 768px) {
    .top-glass-banner {
        height: clamp(13rem, 42vh, 26rem);
    }
}

.top-glass-banner__bg {
    position: absolute;
    top: -8px;
    right: 0;
    bottom: -8px;
    left: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 50%, rgba(60, 60, 70, 0.4) 0%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 70% 30%, rgba(196, 165, 116, 0.08) 0%, transparent 50%);
    filter: saturate(0.88) brightness(0.9);
}

.top-glass-banner__tint {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(255, 228, 196, 0.08) 0%, rgba(120, 100, 80, 0.08) 45%, rgba(0, 0, 0, 0.35) 100%);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.top-glass-banner__glass {
    --glass-x: 50%;
    --glass-y: 50%;
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: auto;
    backdrop-filter: blur(3px) saturate(1.08);
    -webkit-backdrop-filter: blur(3px) saturate(1.08);
    background: linear-gradient(180deg, rgba(255, 250, 240, 0.04) 0%, rgba(12, 11, 10, 0.1) 45%, rgba(6, 6, 7, 0.38) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 40px -18px rgba(0, 0, 0, 0.45);
}

/* ================================================================
   Hero Section
   ================================================================ */

.hero {
    padding: 4.5rem 0 3rem;
    text-align: center;
    position: relative;
}

@media (min-width: 768px) {
    .hero {
        padding: 5.5rem 0 4rem;
    }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 10vw, 4.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.65rem;
    background: linear-gradient(180deg, var(--fg) 0%, var(--fg-soft) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@supports not (background-clip: text) {
    .hero-title {
        color: var(--fg);
        background: none;
    }
}

/* Compact Hero (for workspace layout) */
.hero-compact {
    padding: 1.5rem 0 1rem;
    padding-top: calc(1.5rem + 56px); /* header height offset */
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg) 0%, rgba(6, 6, 7, 0.5) 100%);
}

.hero-title-small {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fg);
    margin-bottom: 0.35rem;
}

.hero-title-small .accent {
    color: var(--accent);
}

.tagline-small {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.tagline {
    font-family: var(--font-mono);
    font-size: clamp(0.8125rem, 2.4vw, 0.9375rem);
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.03em;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.bio {
    max-width: 28rem;
    margin: 0 auto 2rem;
    font-size: 0.78rem;
    color: var(--dim);
    line-height: 1.75;
}

/* ================================================================
   Sections
   ================================================================ */

section {
    border-top: 1px solid var(--line);
    padding: 3.5rem 0 4.5rem;
}

@media (min-width: 768px) {
    section {
        padding: 4.5rem 0 6rem;
    }
}

.sec-head {
    text-align: center;
    margin-bottom: 2.75rem;
}

.sec-head.compact {
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .sec-head {
        margin-bottom: 3.5rem;
    }
}

.sec-title {
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.36em;
    color: var(--accent);
    margin-bottom: 0.65rem;
    text-transform: uppercase;
}

.sec-sub {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 4.2vw, 2.35rem);
    font-weight: 600;
    color: var(--fg-soft);
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.sec-sub.small {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

/* ================================================================
   Workspace Layout (Blender-style)
   ================================================================ */

.workspace-section {
    padding: 0;
    border-top: 1px solid var(--line);
}

.workspace-wrap {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 200px);
}

@media (min-width: 1024px) {
    .workspace-wrap {
        grid-template-columns: 1fr 340px;
    }
}

@media (min-width: 1400px) {
    .workspace-wrap {
        grid-template-columns: 1fr 380px;
    }
}

/* ================================================================
   Viewer Wrapper (Large - Blender Style)
   ================================================================ */

.viewer-wrapper {
    position: relative;
    min-height: 600px;
    height: calc(100vh - 180px);
    padding: 1rem;
}

@media (min-width: 1024px) {
    .viewer-wrapper {
        min-height: 700px;
        height: calc(100vh - 160px);
    }
}

.viewer-glass {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 40px rgba(0, 0, 0, 0.5);
}

.viewer-glass:hover {
    border-color: var(--line-strong);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 60px rgba(0, 0, 0, 0.6);
}

.viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Canvas стили - Three.js автоматически создает canvas */
.viewer-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

/* ================================================================
   Blender-Style Overlay Controls
   ================================================================ */

.viewer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.viewer-overlay > * {
    pointer-events: auto;
}

/* Top Left: View Controls */
.overlay-views {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.35rem;
    background: rgba(6, 6, 7, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.4rem;
}

.overlay-btn {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--fg-soft);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-transform: uppercase;
}

.overlay-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.overlay-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-deep);
}

.overlay-btn.icon {
    font-size: 0.9rem;
    padding: 0.4rem;
}

/* Top Right: Actions */
.overlay-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.35rem;
    background: rgba(6, 6, 7, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.4rem;
}

/* Bottom Left: Stats */
.viewer-stats-glass {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(6, 6, 7, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.viewer-stats-glass .stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.viewer-stats-glass .stat-value {
    font-size: 0.85rem;
    color: var(--fg);
    font-weight: 600;
}

/* Bottom Right: Numpad Help (Blender Style) */
.numpad-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(6, 6, 7, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1.2rem);
    gap: 0.25rem;
    justify-content: center;
}

.numpad-grid span {
    width: 1.2rem;
    height: 1.2rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--dim);
}

.numpad-grid span:nth-child(1),
.numpad-grid span:nth-child(7),
.numpad-grid span:nth-child(9) {
    background: var(--accent-glow);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.numpad-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.15rem;
    font-size: 0.5rem;
    color: var(--dim);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.numpad-info {
    font-size: 0.55rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

/* ================================================================
   Workspace & Sidebar
   ================================================================ */

.workspace-section {
    padding: 0;
    border-top: 1px solid var(--line);
}

.workspace-wrap {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 200px);
}

@media (min-width: 1024px) {
    .workspace-wrap {
        grid-template-columns: 1fr 340px;
    }
}

@media (min-width: 1400px) {
    .workspace-wrap {
        grid-template-columns: 1fr 380px;
    }
}

/* Sidebar */
.controls-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-left: 1px solid var(--line);
    min-height: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

@media (max-width: 1023px) {
    .controls-sidebar {
        border-left: none;
        border-top: 1px solid var(--line);
        max-height: none;
    }
}

/* Compact Controls Glass */
.controls-sidebar .controls-glass {
    flex: 0 0 auto;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.controls-sidebar .controls-glass .tab-bar.compact {
    margin-bottom: 0.75rem;
    flex-direction: column;
    gap: 0.35rem;
}

.controls-sidebar .controls-glass .tab-bar.compact .tab-pill {
    padding: 0.45rem 0.75rem;
    font-size: 0.6rem;
    text-align: left;
    width: 100%;
}

/* Surfaces List in Sidebar */
.surfaces-glass {
    flex: 1 1 auto;
    min-height: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.surfaces-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.surfaces-title {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--muted);
}

.surfaces-glass .surfaces-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.5rem;
}

.surfaces-list.compact .surface-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
}

.empty-state.small {
    padding: 1rem;
}

.empty-state.small .empty-icon {
    font-size: 1.5rem;
}

/* Old Glass Panels (for compatibility) */
.controls-glass {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.controls-glass:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.about-glass {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    max-width: 48rem;
    margin: 0 auto;
    transition: border-color 0.4s var(--ease);
}

.about-glass:hover {
    border-color: var(--line-strong);
}

/* ================================================================
   Tabs
   ================================================================ */

.tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tab-pill {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 0.45rem 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
    text-transform: uppercase;
}

.tab-pill:hover {
    border-color: var(--accent-dim);
    color: var(--fg);
    background: var(--accent-glow);
}

.tab-pill.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Auth modal tabs */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

/* Tab panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ================================================================
   Inputs
   ================================================================ */

.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group.compact {
    margin-bottom: 0.75rem;
}

.input-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.mono-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg);
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.mono-input:hover {
    border-color: var(--line-strong);
}

.mono-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.mono-input.small {
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
}

.mono-input.tiny {
    width: 4rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    text-align: center;
}

.styled-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg);
    cursor: pointer;
    transition: border-color 0.25s var(--ease);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8680' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
}

.styled-select:hover, .styled-select:focus {
    border-color: var(--accent);
    outline: none;
}

.styled-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 0 0 1px var(--line-strong);
    cursor: pointer;
    transition: transform 0.15s var(--ease), box-shadow 0.15s;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.styled-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 0 0 1px var(--line-strong);
    cursor: pointer;
}

/* ================================================================
   Equations
   ================================================================ */

.equations-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.equation-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eq-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    min-width: 4rem;
    text-transform: uppercase;
}

/* ================================================================
   Parameters
   ================================================================ */

.params-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.param-row {
    margin-bottom: 0.5rem;
}

.param-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.param-label-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.param-label-row .param-label {
    margin-bottom: 0;
}

.param-help {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    cursor: help;
    line-height: 1;
    position: relative;
}

/* Custom tooltip for param-help */
.param-help::before {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: 260px;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--fg-soft);
    line-height: 1.45;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
}

.param-help:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Custom spinners - always visible, styled */
input[type="number"].mono-input.small::-webkit-outer-spin-button,
input[type="number"].mono-input.small::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    margin: 0;
    width: 1.1rem;
    height: 100%;
    cursor: pointer;
    filter: invert(0.8) sepia(0.3) saturate(0.5) hue-rotate(350deg);
}

input[type="number"].mono-input.small::-webkit-inner-spin-button:hover,
input[type="number"].mono-input.small::-webkit-outer-spin-button:hover {
    filter: invert(0.6) sepia(0.5) saturate(2) hue-rotate(350deg);
}

input[type="number"].mono-input.small {
    -moz-appearance: textfield;
}

input[type="number"].mono-input.small:hover {
    -moz-appearance: number-input;
}

/* Global custom tooltip style for data-tooltip */
[data-tooltip] {
    position: relative;
    cursor: default;
}

[data-tooltip]:not(.param-help)::before {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.5rem);
    transform: translateX(-50%);
    width: max-content;
    max-width: 200px;
    padding: 0.5rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--fg-soft);
    line-height: 1.4;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

[data-tooltip]:not(.param-help):hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

/* Overlay buttons tooltip goes down (they're at top of viewport) */
.overlay-btn[data-tooltip]::before {
    left: 50% !important;
    bottom: auto !important;
    top: calc(100% + 0.5rem) !important;
    transform: translateX(-50%) !important;
}

.overlay-btn[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(2px) !important;
}

.range-pair {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-sep {
    color: var(--dim);
}

.slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slider-value {
    font-size: 0.75rem;
    color: var(--accent);
    min-width: 2rem;
    text-align: right;
}

/* ================================================================
   Presets
   ================================================================ */

.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* Compact versions for sidebar */
.equations-grid.compact {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.equations-grid.compact .equation-row {
    gap: 0.4rem;
}

.equations-grid.compact .eq-label {
    font-size: 0.65rem;
    min-width: 2.5rem;
}

.preset-grid.compact {
    gap: 0.35rem;
    margin: 0.75rem 0;
}

.preset-grid.compact .preset-pill {
    padding: 0.35rem 0.5rem;
    font-size: 0.55rem;
}

.preset-pill {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--fg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.3s var(--ease), background 0.3s, color 0.3s;
    text-transform: uppercase;
}

.preset-pill:hover {
    border-color: var(--accent-dim);
    background: var(--accent-glow);
    color: var(--fg);
}

/* ================================================================
   Buttons (Pills)
   ================================================================ */

.action-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.primary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--bg-deep);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.2rem;
    transition: transform 0.15s var(--ease), box-shadow 0.25s, background 0.25s;
    text-transform: uppercase;
}

.primary-pill:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
    background: #d4b584;
}

.primary-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-pill.large {
    padding: 0.75rem 1.5rem;
    font-size: 0.65rem;
}

.primary-pill.small {
    padding: 0.45rem 0.9rem;
}

.secondary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--fg-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    text-transform: uppercase;
}

.secondary-pill:hover {
    border-color: var(--accent-dim);
    background: var(--accent-glow);
    color: var(--fg);
}

.secondary-pill.small {
    padding: 0.45rem 0.9rem;
}

.danger-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--danger);
    border: 1px solid var(--danger-dim);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.2rem;
    background: var(--danger-dim);
    transition: background 0.3s, border-color 0.3s;
    text-transform: uppercase;
}

.danger-pill:hover {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.3);
}

.danger-pill.small {
    padding: 0.45rem 0.9rem;
}

.accent-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.2rem;
    background: var(--accent-glow);
    transition: border-color 0.3s, background 0.3s;
    text-transform: uppercase;
}

.accent-pill:hover {
    border-color: var(--accent);
    background: rgba(196, 165, 116, 0.2);
}

.btn-icon {
    font-size: 1.1em;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.link-row.center {
    justify-content: center;
}

/* ================================================================
   CSV Panel
   ================================================================ */

.csv-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hint-box {
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: var(--fg-soft);
    line-height: 1.6;
}

.hint-box strong {
    color: var(--accent);
}

.file-row {
    margin-bottom: 0.5rem;
}

.file-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.file-pill input[type="file"] {
    display: none;
}

.file-btn {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: var(--radius);
    padding: 0.5rem 0.9rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--info);
    transition: background 0.2s;
    text-transform: uppercase;
}

.file-pill:hover .file-btn {
    background: rgba(52, 152, 219, 0.25);
}

.file-name {
    font-size: 0.75rem;
    color: var(--dim);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.palette-row {
    margin-bottom: 0.5rem;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .palette-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.palette-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.6rem 0.4rem 0.5rem;
    cursor: pointer;
    transition: all 0.18s var(--ease);
}

.palette-btn:hover {
    border-color: var(--accent-dim);
    background: rgba(255, 255, 255, 0.04);
}

.palette-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.palette-strip {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 2px;
    overflow: hidden;
}

.palette-strip span {
    flex: 1;
}

.palette-label {
    font-size: 0.6rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.palette-btn.active .palette-label {
    color: var(--accent);
}

.info-banner {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
    color: #aedfc0;
}

.error-banner {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    font-size: 0.75rem;
    color: #f1a9a0;
}

/* ================================================================
   Viewer Stats & Panel
   ================================================================ */

.viewer-stats {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(6, 6, 7, 0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.35rem 0.6rem;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    backdrop-filter: blur(4px);
}

.stat-value {
    font-size: 0.8rem;
    color: var(--fg);
    font-weight: 600;
}

.surface-panel {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: min(280px, calc(100% - 1.5rem));
    background: rgba(12, 12, 14, 0.95);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 1rem;
    z-index: 20;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.surface-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fg-soft);
}

.close-btn {
    font-size: 1.25rem;
    color: var(--muted);
    transition: color 0.2s;
    width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
}

.close-btn:hover {
    color: var(--fg);
    background: var(--bg-hover);
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-row {
    display: flex;
    gap: 1rem;
}

.color-group {
    flex: 1;
}

.color-pill {
    width: 100%;
    height: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.2rem;
    cursor: pointer;
    background: transparent;
}

.color-pill::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-pill::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.position-row {
    margin-top: 0.5rem;
}

.coord-row {
    display: flex;
    gap: 0.5rem;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

/* ================================================================
   Surfaces List
   ================================================================ */

.surfaces-section {
    margin-top: 2rem;
}

.surfaces-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.surface-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}

.surface-item:hover {
    border-color: var(--line-strong);
    background: var(--bg-hover);
}

.surface-item.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.surface-info {
    flex: 1;
    min-width: 0;
}

.surface-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surface-item.selected .surface-name {
    color: var(--accent);
}

.surface-equation {
    font-size: 0.65rem;
    color: var(--dim);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surface-controls {
    display: flex;
    gap: 0.35rem;
}

.surface-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}

.surface-btn:hover {
    opacity: 1;
    border-color: var(--accent);
    background: var(--accent-glow);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--dim);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-surfaces {
    text-align: center;
    padding: 1rem;
    color: var(--dim);
    font-size: 0.8rem;
}

/* ================================================================
   Modal (Auth)
   ================================================================ */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 7, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

/* Auth forms show/hide */
.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
}

/* Modal inputs — apply same style as .mono-input */
.modal-glass input[type="text"],
.modal-glass input[type="email"],
.modal-glass input[type="password"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg);
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
    box-sizing: border-box;
}

.modal-glass input[type="text"]:hover,
.modal-glass input[type="email"]:hover,
.modal-glass input[type="password"]:hover {
    border-color: var(--line-strong);
}

.modal-glass input[type="text"]:focus,
.modal-glass input[type="email"]:focus,
.modal-glass input[type="password"]:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

/* Password field needs room for the toggle button */
.input-group input[type="password"] {
    padding-right: 2.5rem;
}

/* Buttons full-width inside auth forms */
.auth-form .primary-pill,
.auth-form .secondary-pill,
.guest-option .secondary-pill {
    width: 100%;
    justify-content: center;
}

/* Hint box inside auth form — extra top margin */
.auth-form .hint-box {
    margin-top: 1rem;
}

.modal-glass {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin: auto;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.modal-sub {
    font-size: 0.8rem;
    color: var(--muted);
}

.modal .input-group {
    margin-bottom: 1rem;
}

.password-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.terms-row {
    margin: 1rem 0;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--fg-soft);
    cursor: pointer;
}

.checkbox-pill input {
    display: none;
}

.checkmark {
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.checkbox-pill input:checked + .checkmark {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.checkbox-pill input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.65rem;
    color: var(--accent);
}

.guest-option {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.guest-note {
    font-size: 0.7rem;
    color: var(--dim);
    margin-top: 0.5rem;
}

.password-strength {
    margin-top: 0.4rem;
}

.strength-bars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}

.strength-bars span {
    flex: 1;
    height: 3px;
    background: var(--line);
    border-radius: 2px;
    transition: background 0.3s;
}

.password-strength.level-1 .strength-bars span:nth-child(1) { background: var(--danger); }
.password-strength.level-2 .strength-bars span:nth-child(-n+2) { background: var(--accent); }
.password-strength.level-3 .strength-bars span:nth-child(-n+3) { background: var(--accent); }
.password-strength.level-4 .strength-bars span { background: #27ae60; }

.strength-text {
    font-size: 0.6rem;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.field-error {
    font-size: 0.7rem;
    color: var(--danger);
    margin-top: 0.35rem;
}

/* ================================================================
   About / Features
   ================================================================ */

.feature-list {
    list-style: none;
    margin: 1rem 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    color: var(--fg-soft);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ================================================================
   Utility Classes
   ================================================================ */

.hidden {
    display: none !important;
}

.app.hidden {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dim);
}

/* ================================================================
   Footer
   ================================================================ */

footer {
    border-top: 1px solid var(--line);
    padding: 2.25rem 1.1rem;
    text-align: center;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--dim);
    text-transform: uppercase;
}

/* ================================================================
   Scenes Wall (existing, styled to match)
   ================================================================ */

.scenes-wall-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 7, 0.92);
    backdrop-filter: blur(12px);
    z-index: 1001;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.scenes-wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
}

.scenes-wall-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--fg);
}

.scenes-wall-close {
    font-size: 1.5rem;
    color: var(--muted);
    transition: color 0.2s;
}

.scenes-wall-close:hover {
    color: var(--fg);
}

.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.scene-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}

.scene-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-4px);
}

.scene-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-elevated);
}

.scene-card-content {
    padding: 1rem;
}

.scene-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--fg);
    margin-bottom: 0.25rem;
}

.scene-card p {
    font-size: 0.7rem;
    color: var(--dim);
}

.scene-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

/* Export Modal */
.export-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 7, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1002;
}

.export-modal-content {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
}

.export-option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.25s, background 0.25s;
    text-align: left;
}

.export-option-btn:hover {
    border-color: var(--accent-dim);
    background: var(--accent-glow);
}

.format-icon {
    font-size: 1.5rem;
}

.format-name {
    font-weight: 600;
    color: var(--fg);
}

.format-desc {
    font-size: 0.7rem;
    color: var(--muted);
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 767px) {
    .nav-pills {
        display: none;
    }
    
    .generator-grid {
        grid-template-columns: 1fr;
    }
    
    .viewer-glass {
        min-height: 300px;
    }
    
    .surface-panel {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }
    
    .palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .modal-glass {
        padding: 1.25rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .sec-sub {
        font-size: 1.2rem;
    }
    
    .preset-grid {
        gap: 0.35rem;
    }
    
    .preset-pill {
        padding: 0.35rem 0.6rem;
        font-size: 0.55rem;
    }
}
