/* ==========================================================
   I-HEAR: Awwwards-Caliber Assistive Telemetry & 3D Web Studio
   Design System: High Contrast, OKLCH Dark Immersive, WCAG 2.1 AAA
   ========================================================== */

@property --border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

:root {
    /* --- OKLCH Modern Color System --- */
    --bg-dark: oklch(0.12 0.015 260);
    --bg-dark-radial: radial-gradient(circle at 50% 20%, oklch(0.17 0.025 255) 0%, oklch(0.10 0.012 260) 100%);
    --card-bg: oklch(0.16 0.018 260 / 0.82);
    --card-bg-elevated: oklch(0.20 0.022 260 / 0.90);
    --card-border: oklch(1 0 0 / 0.12);
    --card-border-active: oklch(0.88 0.18 95);
    
    --text-primary: oklch(0.98 0 0);
    --text-secondary: oklch(0.72 0.02 250);
    --text-muted: oklch(0.50 0.02 250);
    
    --accent-cyan: oklch(0.82 0.16 205);
    --accent-cyan-glow: oklch(0.82 0.16 205 / 0.35);
    --accent-yellow: oklch(0.88 0.18 95);
    --accent-yellow-glow: oklch(0.88 0.18 95 / 0.35);
    
    --color-safe: oklch(0.78 0.18 145);
    --color-caution: oklch(0.80 0.19 65);
    --color-danger: oklch(0.65 0.24 25);
    --color-danger-glow: oklch(0.65 0.24 25 / 0.45);
    
    --font-sans: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --tap-min-height: 48px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Accessibility Focus Indicator (WCAG 2.1 AAA) */
:focus-visible {
    outline: 3px solid var(--accent-yellow) !important;
    outline-offset: 3px !important;
}

/* Base Reset & Fluid Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: clip;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    background-image: var(--bg-dark-radial);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.45;
    overflow-x: clip;
    user-select: none;
    -webkit-user-select: none;
}

/* Large Font Mode for Low-Vision Accessibility */
body.font-enlarged {
    font-size: 118%;
}

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

.skip-link {
    position: absolute;
    top: -60px;
    left: 10px;
    background: var(--accent-yellow);
    color: #000;
    padding: 10px 16px;
    font-weight: 700;
    z-index: 1000;
    border-radius: var(--radius-sm);
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 10px;
}

/* Responsive Adaptive App Shell */
.app-layout-shell {
    display: flex;
    flex-direction: column;
    max-width: 620px;
    margin: 0 auto;
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: max-width 0.3s var(--ease-out-expo);
}

@media (min-width: 1024px) {
    .app-layout-shell {
        max-width: 1240px;
    }
}

/* ==========================================================
   VIEW TRANSITIONS API ENHANCEMENT
   ========================================================== */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.24s;
    animation-timing-function: var(--ease-out-expo);
}

/* ==========================================================
   TOP NAVIGATION BAR (Sticky in Firefox via overflow-x: clip)
   ========================================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: oklch(0.14 0.015 260 / 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radar-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-cyan);
    position: relative;
    box-shadow: 0 0 10px var(--accent-cyan-glow);
}
.radar-pulse::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-cyan);
    animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-ping {
    0% { transform: scale(0.8); opacity: 0.9; }
    80%, 100% { transform: scale(2.2); opacity: 0; }
}

.nav-brand h1 {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand .tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: var(--radius-sm);
    letter-spacing: 0.06em;
}

.nav-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
}

.status-pill.sim-mode {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.status-pill.online {
    background: rgba(0, 230, 118, 0.15);
    border-color: rgba(0, 230, 118, 0.4);
    color: var(--color-safe);
}

.status-pill.connecting {
    background: rgba(255, 145, 0, 0.15);
    border-color: rgba(255, 145, 0, 0.4);
    color: var(--color-caution);
}

.status-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.bt-badge {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--card-border);
    color: var(--text-secondary);
}

.tool-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tool-btn:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
}

/* ==========================================================
   APP TAB NAVIGATION (3-Pill Switcher)
   ========================================================== */
.app-tab-nav {
    display: flex;
    background: oklch(0.14 0.015 260 / 0.95);
    padding: 6px 14px;
    gap: 8px;
    border-bottom: 1px solid var(--card-border);
    overflow-x: auto;
}

.tab-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    min-height: var(--tap-min-height);
    white-space: nowrap;
}

.tab-pill:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
    background: var(--card-bg-elevated);
}

.tab-pill.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.16) 0%, rgba(0, 140, 255, 0.25) 100%);
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}

/* ==========================================================
   VIEW 1: SIMULATION SANDBOX & RADAR COCKPIT
   ========================================================== */
.view-panel {
    display: none;
    animation: fadeIn 0.25s var(--ease-out-expo);
}
.view-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Simulator Presets & Tools Bar */
.sim-presets-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sim-top-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sim-mode-toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 4px;
    flex-shrink: 0;
}

.sim-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.80rem;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sim-toggle-btn.active {
    background: var(--card-bg-elevated);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.presets-scroll-track {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex: 1;
}

.preset-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 2px;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.preset-chip.active {
    background: rgba(255, 229, 0, 0.15);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    box-shadow: 0 0 10px rgba(255, 229, 0, 0.2);
}

.preset-tool-btn {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--accent-cyan);
    padding: 6px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}
.preset-tool-btn:hover {
    background: var(--accent-cyan);
    color: #000;
}

.sim-hint-strip {
    font-size: 0.74rem;
    color: var(--text-secondary);
    background: rgba(0, 229, 255, 0.05);
    border-left: 3px solid var(--accent-cyan);
    padding: 5px 10px;
    border-radius: 4px;
}

/* ==========================================================
   RADAR COCKPIT: DUAL COLUMN DESKTOP / STACKED MOBILE
   ========================================================== */
.radar-cockpit-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 16px;
}

@media (min-width: 980px) {
    .radar-cockpit-grid {
        display: grid;
        grid-template-columns: minmax(360px, 480px) 1fr;
        gap: 20px;
        align-items: start;
        padding: 16px 20px;
    }
}

.radar-col-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radar-col-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 60 FPS Polar Radar Canvas Section & PiP */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background: radial-gradient(circle at center, oklch(0.18 0.02 260) 0%, oklch(0.11 0.015 260) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    cursor: crosshair;
}

#radar-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.radar-overlay-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.overlay-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(14, 18, 25, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.overlay-btn:hover {
    border-color: var(--accent-cyan);
    transform: scale(1.05);
}

.overlay-btn.active {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow-glow);
}

/* Picture-in-Picture Mini 3D Hat Viewer */
.pip-container {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 160px;
    height: 180px;
    background: rgba(14, 18, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(0, 229, 255, 0.12);
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.pip-title {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.pip-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
}
.pip-close:hover {
    color: #fff;
}

.pip-body {
    flex: 1;
    width: 100%;
    min-height: 120px;
    position: relative;
}

.pip-body model-viewer {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: block;
}

.pip-footer {
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    font-size: 0.60rem;
    color: var(--text-secondary);
}

/* Audio Announcement Feed Banner */
.speech-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.10) 0%, rgba(22, 27, 34, 0.8) 100%);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: var(--radius-md);
}

.banner-icon {
    font-size: 1.3rem;
}

.banner-content {
    display: flex;
    flex-direction: column;
}

.banner-sub {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-cyan);
    letter-spacing: 0.06em;
    font-family: var(--font-mono);
}

.banner-text {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Telemetry HUD Bar */
.telemetry-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.telemetry-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.telemetry-sub {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.telemetry-main {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.telemetry-detail {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Threat Alert States */
.threat-safe {
    border-color: rgba(0, 230, 118, 0.35);
}
.threat-safe .telemetry-main {
    color: var(--color-safe);
}

.threat-caution {
    border-color: rgba(255, 145, 0, 0.5);
    background: rgba(255, 145, 0, 0.08);
}
.threat-caution .telemetry-main {
    color: var(--color-caution);
}

.threat-danger {
    border-color: var(--color-danger);
    background: rgba(255, 42, 85, 0.15);
    box-shadow: 0 0 20px var(--color-danger-glow);
    animation: threat-pulse 1.2s infinite alternate;
}
.threat-danger .telemetry-main {
    color: var(--color-danger);
}

@keyframes threat-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.02); }
}

.mode-card-highlight {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.35);
}
.mode-card-highlight .telemetry-main {
    color: var(--accent-cyan);
    font-size: 1.05rem;
    white-space: nowrap;
}
.mode-card-highlight .telemetry-detail {
    color: var(--accent-yellow);
    font-weight: 700;
}

/* Quick Tactile Controls Surface */
.quick-controls-surface {
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.surface-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.surface-title-row h2 {
    font-size: 1.05rem;
    font-weight: 800;
}

.surface-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tactile-mode-grid {
    display: grid;
    gap: 8px;
}

.tactile-mode-grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

.tactile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--ease-out-expo);
    min-height: var(--tap-min-height);
}

.tactile-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.tactile-btn.active {
    background: rgba(255, 229, 0, 0.12);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 15px var(--accent-yellow-glow);
}

.tactile-btn.active strong {
    color: var(--accent-yellow);
}

.tactile-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tactile-text {
    display: flex;
    flex-direction: column;
}

.tactile-text strong {
    font-size: 0.88rem;
    font-weight: 800;
}

.tactile-text small {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.action-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lang-toggle-box {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 4px;
}

.toggle-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.80rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-pill.active {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
}

.audition-pill {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15) 0%, rgba(0, 140, 255, 0.25) 100%);
    border: 1px solid var(--accent-cyan);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.audition-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.35);
}

.quick-slider-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.80rem;
    font-weight: 700;
}

.slider-val {
    color: var(--accent-yellow);
    font-family: var(--font-mono);
}

.accessible-slider {
    width: 100%;
    accent-color: var(--accent-yellow);
    height: 8px;
    border-radius: 4px;
    background: #222836;
    cursor: pointer;
}

.btn-link-settings {
    background: transparent;
    border: 1px dashed var(--card-border);
    border-radius: var(--radius-md);
    color: var(--accent-cyan);
    padding: 10px;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-link-settings:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--accent-cyan);
}

/* ==========================================================
   VIEW 2: 3D HARDWARE SHOWCASE, DIGITAL TWIN & CAD VAULT
   ========================================================== */
.showcase-3d-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

/* 6-Model Selector Bento Dock */
.model-bento-dock {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 600px) {
    .model-bento-dock {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1024px) {
    .model-bento-dock {
        grid-template-columns: repeat(6, 1fr);
    }
}

.dock-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--ease-out-expo);
    min-height: 48px;
}

.dock-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--card-bg-elevated);
}

.dock-btn.active {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.18) 0%, rgba(31, 111, 235, 0.3) 100%);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 14px rgba(0, 229, 255, 0.25);
}

.dock-btn.active strong {
    color: var(--accent-cyan);
}

.dock-icon {
    font-size: 1.3rem;
}

.dock-text {
    display: flex;
    flex-direction: column;
}

.dock-text strong {
    font-size: 0.82rem;
    font-weight: 800;
}

.dock-text small {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* Main 3D Viewport Stage Wrapper */
.stage-3d-wrapper {
    position: relative;
    width: 100%;
    height: 520px;
    background: radial-gradient(circle at center, #1b222d 0%, #0d1117 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.7), 0 12px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .stage-3d-wrapper {
        height: 640px;
    }
}

#main-model-viewer {
    width: 100%;
    height: 100%;
    outline: none;
}

/* 3D Interactive Hotspot Pins */
.hotspot-pin {
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
}

.hotspot-core {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
    position: relative;
    transition: transform 0.2s ease;
}

.hotspot-pin::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-cyan);
    animation: hotspot-pulse 1.8s infinite;
}

@keyframes hotspot-pulse {
    0% { transform: scale(0.8); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}

.hotspot-pin:hover .hotspot-core {
    transform: scale(1.3);
    background: var(--accent-yellow);
    box-shadow: 0 0 16px var(--accent-yellow);
}

.hotspot-annotation {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 18, 25, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.hotspot-annotation strong {
    display: block;
    font-size: 0.76rem;
    color: var(--accent-cyan);
}

.hotspot-annotation span {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.hotspot-pin:hover .hotspot-annotation,
.hotspot-pin:focus .hotspot-annotation {
    display: block;
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
}
.update-bar {
    background-color: var(--accent-cyan);
    width: 0%;
    height: 100%;
    transition: width 0.3s ease;
}

/* Mobile AR Button */
.btn-ar-launch {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(14, 18, 26, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-full);
    color: #fff;
    padding: 8px 16px;
    font-size: 0.80rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}
.btn-ar-launch:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* 3D Stage Floating Controls Overlay */
.controls-overlay-3d {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 27, 34, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10;
    white-space: nowrap;
}

.ctrl-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.ctrl-chip input[type="checkbox"] {
    accent-color: var(--accent-cyan);
}

.exposure-chip input[type="range"] {
    width: 70px;
    accent-color: var(--accent-cyan);
}

.ctrl-btn-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ctrl-btn-action:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* Floating Glassmorphic Specification Panel */
.spec-card-glass {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(22, 27, 34, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    max-width: 310px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.spec-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.spec-header .badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-cyan);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.spec-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.spec-card-glass p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.spec-list {
    margin-top: 8px;
    margin-left: 16px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.spec-actions {
    margin-top: 12px;
}

.btn-download-cad {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15) 0%, rgba(0, 140, 255, 0.3) 100%);
    border: 1px solid var(--accent-cyan);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-download-cad:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* 3D Printable STEP CAD Vault Drawer */
.cad-vault-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
}

.cad-vault-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
}

.cad-vault-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
}

.cad-vault-header p {
    font-size: 0.80rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cad-vault-pill {
    background: rgba(0, 230, 118, 0.15);
    color: var(--color-safe);
    border: 1px solid rgba(0, 230, 118, 0.35);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.70rem;
    font-weight: 800;
    white-space: nowrap;
}

.cad-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 600px) {
    .cad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .cad-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.cad-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: border-color 0.2s ease;
}
.cad-card:hover {
    border-color: rgba(0, 229, 255, 0.4);
}

.cad-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cad-card-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
    word-break: break-all;
}

.cad-badge {
    margin-left: auto;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.cad-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.70rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-cad-download {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-cad-download:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* ==========================================================
   VIEW 3: ACCESSIBLE SETTINGS PAGE STYLES
   ========================================================== */
.settings-page {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
}

.settings-intro h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.settings-intro p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-title-row h3 {
    font-size: 0.98rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--accent-cyan);
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 50%;
}

.card-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.radio-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--tap-min-height);
}

.radio-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.radio-card input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--accent-yellow);
    width: 18px;
    height: 18px;
}

.radio-card:has(input[type="radio"]:checked) {
    background: rgba(255, 229, 0, 0.08);
    border-color: var(--accent-yellow);
}

.radio-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-name {
    font-size: 0.90rem;
    font-weight: 700;
}

.radio-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.control-text {
    display: flex;
    flex-direction: column;
}

.control-text label {
    font-size: 0.88rem;
    font-weight: 700;
}

.control-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.control-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.val-pill {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-cyan);
    min-width: 54px;
    text-align: right;
}

.control-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.accessible-checkbox {
    width: 24px;
    height: 24px;
    accent-color: var(--accent-yellow);
    cursor: pointer;
}

.action-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-height: var(--tap-min-height);
}

.btn-primary {
    background: var(--accent-yellow);
    color: #000;
    box-shadow: 0 4px 14px var(--accent-yellow-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-yellow-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--card-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-nav-back {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--card-border);
}
.btn-nav-back:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* ==========================================================
   MODAL DIALOGS (Hotkeys, Siri, Host Settings)
   ========================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    background: oklch(0.16 0.02 260);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modalScale 0.2s var(--ease-out-expo);
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
}
.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 18px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--card-border);
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcuts-table td {
    padding: 8px 4px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcuts-table kbd {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

/* ==========================================================
   SIRI-LIKE VOICE ASSISTANT STYLING
   ========================================================== */
.voice-assistant-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #1E2330 0%, #0F121A 100%);
    border: 2px solid var(--accent-cyan);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
    min-height: 52px;
    transition: all 0.2s ease;
}

.voice-assistant-fab:hover {
    transform: scale(1.04);
    border-color: var(--accent-yellow);
    box-shadow: 0 6px 24px var(--accent-yellow-glow);
}

.voice-assistant-fab.listening {
    border-color: var(--color-danger);
    box-shadow: 0 0 25px var(--color-danger-glow);
    animation: fab-listening-pulse 1s infinite alternate;
}

@keyframes fab-listening-pulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 42, 85, 0.4); }
    100% { transform: scale(1.08); box-shadow: 0 0 30px rgba(255, 42, 85, 0.8); }
}

.siri-glow-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 10px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.siri-center-orb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-cyan) 0%, #1f6feb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 0 25px var(--accent-cyan);
    z-index: 2;
}

.siri-wave {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    animation: siri-ripple 2s infinite ease-out;
}
.wave-1 { width: 70px; height: 70px; animation-delay: 0s; }
.wave-2 { width: 90px; height: 90px; animation-delay: 0.6s; }

@keyframes siri-ripple {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.4); opacity: 0; }
}

.assistant-current-mode-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.assistant-status-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-align: center;
}

.assistant-transcript-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    margin: 4px 0 12px;
}

.assistant-response-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-yellow);
    text-align: center;
    margin-bottom: 12px;
}

.assistant-chips-category {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin: 8px 0 4px;
    text-transform: uppercase;
}

.assistant-chips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.assistant-chip {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}
.assistant-chip:hover {
    background: rgba(255, 255, 255, 0.12);
}

.assistant-chip.chip-highlight {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.3);
    color: var(--accent-cyan);
}

.assistant-input-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.assistant-input-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #fff;
    font-size: 0.85rem;
}

.assistant-https-box {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 145, 0, 0.1);
    border: 1px solid rgba(255, 145, 0, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    color: var(--text-secondary);
}

/* ==========================================================
   REDUCED MOTION SUPPORT (WCAG 2.1 AAA)
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
