/**
 * workspace.css
 * CubeSat.gr - Professional Workspace Styles
 * Separate from style.css (landing page) to keep concerns isolated.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* =====================
   CSS Custom Properties
===================== */
:root {
    --ws-bg: #1a212e;
    --ws-surface: #151d29;
    --ws-surface2: #1c2635;
    --ws-border: rgba(255, 255, 255, 0.12);
    --ws-border-hi: rgba(0, 210, 255, 0.5);
    --ws-accent: #00d2ff;
    --ws-accent2: #9d50bb;
    --ws-success: #2dce89;
    --ws-warn: #fb6340;
    --ws-text: #f4f7fa;
    --ws-text-muted: #8a9bb0;
    --ws-mono: 'JetBrains Mono', monospace;
    --ws-sans: 'Outfit', sans-serif;
    --ws-sidebar-w: 72px;
    --ws-topbar-h: 56px;
    --ws-panel-w: 340px;
    --ws-transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =====================
   Reset & Base
===================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: var(--ws-sans);
    background: var(--ws-bg);
    color: var(--ws-text);
    font-size: 14px;
}

/* =====================
   App Shell Layout
===================== */
#ws-app {
    display: grid;
    grid-template-columns: var(--ws-sidebar-w) var(--ws-panel-w) 1fr;
    grid-template-rows: var(--ws-topbar-h) 1fr;
    grid-template-areas:
        "sidebar topbar  topbar"
        "sidebar panel   viewport";
    height: 100vh;
    width: 100vw;
}

/* =====================
   Top Bar
===================== */
.ws-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--ws-surface);
    border-bottom: 1px solid var(--ws-border);
    z-index: 50;
}

.ws-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
}

.ws-module-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ws-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ws-topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ws-mission-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.3rem 0.8rem;
    transition: border-color var(--ws-transition);
}

.ws-mission-name-wrap:focus-within {
    border-color: var(--ws-accent);
}

.ws-mission-name-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--ws-text);
    font-family: var(--ws-sans);
    font-size: 0.95rem;
    font-weight: 600;
    width: 250px;
    text-align: center;
}

.ws-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    justify-content: flex-end;
}

.ws-status {
    font-size: 0.72rem;
    color: var(--ws-success);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: color 0.3s ease;
    min-width: 190px;
    text-align: right;
    justify-content: flex-end;
}

.ws-status[style*="cursor: pointer"]:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ws-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    border: none;
    font-family: var(--ws-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ws-transition);
    letter-spacing: 0.3px;
}

.ws-btn-primary {
    background: linear-gradient(135deg, var(--ws-accent), var(--ws-accent2));
    color: white;
}

.ws-btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.ws-btn-secondary {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    color: var(--ws-text-muted);
}

.ws-btn-secondary:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

/* =====================
   Sidebar
===================== */
.ws-sidebar {
    grid-area: sidebar;
    width: var(--ws-sidebar-w);
    background: var(--ws-surface);
    border-right: 1px solid var(--ws-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 60;
    gap: 0;
}

.ws-sidebar-logo {
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--ws-border);
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-logo-link {
    color: var(--ws-accent);
    font-size: 1.4rem;
    text-decoration: none;
    transition: all var(--ws-transition);
}

.sidebar-logo-link:hover {
    color: var(--ws-accent2);
    transform: scale(1.1);
}

.ws-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    flex: 1;
    width: 100%;
    align-items: center;
}

.sidebar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ws-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--ws-transition);
    position: relative;
}

.sidebar-btn:hover {
    background: var(--ws-surface2);
    color: var(--ws-text);
    border-color: var(--ws-border);
}

.sidebar-btn.active {
    background: rgba(0, 210, 255, 0.1);
    color: var(--ws-accent);
    border-color: var(--ws-border-hi);
}

.sidebar-btn-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--ws-sans);
}

.ws-sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    width: 100%;
    align-items: center;
    border-top: 1px solid var(--ws-border);
}

/* =====================
   Left Panel (Module Panels)
===================== */
.ws-panel {
    grid-area: panel;
    background: var(--ws-surface);
    border-right: 1px solid var(--ws-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 40;
}

.ws-panel-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--ws-border);
    flex-shrink: 0;
}

.ws-panel-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ws-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ws-panel-header h2 i {
    color: var(--ws-accent);
}

.ws-panel-header p {
    font-size: 0.78rem;
    color: var(--ws-text-muted);
    margin-top: 0.25rem;
}

/* Removed duplicate ws-panel-body - see the canonical rule below */

.assembly-steps-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 1.5rem;
}

.assembly-steps-list::-webkit-scrollbar {
    width: 4px;
}

.assembly-steps-list::-webkit-scrollbar-thumb {
    background: var(--ws-border);
    border-radius: 2px;
}

.asm-step {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ws-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--ws-border) transparent;
}

.ws-panel-body::-webkit-scrollbar {
    width: 4px;
}

.ws-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.ws-panel-body::-webkit-scrollbar-thumb {
    background: var(--ws-border);
    border-radius: 2px;
}

/* Panel module visibility */
.ws-panel-module {
    display: none;
}

.ws-panel-module.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Locked state for initialization */
.module-locked .ws-section:not(:first-child),
.module-locked .ws-panel-header p {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
    transition: all 0.5s ease;
}

.module-locked::after {
    content: 'Select a Form Factor to begin engineering';
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    padding: 1rem;
    background: rgba(0, 210, 255, 0.1);
    border: 1px dashed var(--ws-accent);
    border-radius: 8px;
    color: var(--ws-accent);
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
    pointer-events: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* =====================
   3D Viewport
===================== */
.ws-viewport {
    grid-area: viewport;
    position: relative;
    background: var(--ws-bg);
    overflow: hidden;
}

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

/* Viewport overlays */
.ws-viewport-hud {
    position: absolute;
    pointer-events: none;
}

.ws-hud-tl {
    top: 1.25rem;
    left: 1.25rem;
}

.ws-hud-tr {
    top: 1.25rem;
    right: 1.25rem;
}

.ws-hud-bl {
    bottom: 1.25rem;
    left: 1.25rem;
}

.ws-hud-br {
    bottom: 1.25rem;
    right: 1.25rem;
}

.ws-hud-tag {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    font-family: var(--ws-mono);
    color: var(--ws-text-muted);
    backdrop-filter: blur(6px);
    line-height: 1.6;
}

.ws-hud-tag strong {
    color: var(--ws-accent);
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

/* Stats panel bottom right */
#hud-stats span {
    display: block;
}

#hud-stats .stat-name {
    color: var(--ws-text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
}

#hud-stats .stat-val {
    color: var(--ws-text);
    font-size: 0.78rem;
    font-weight: 500;
}

/* Viewport camera controls hint */
.ws-controls-hint {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    pointer-events: none;
}

.ws-ctrl {
    background: rgba(13, 17, 23, 0.75);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    color: var(--ws-text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    backdrop-filter: blur(4px);
}

.ws-ctrl kbd {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 3px;
    padding: 0 0.3rem;
    font-family: var(--ws-mono);
    font-size: 0.6rem;
    color: var(--ws-text);
}

/* =====================
   Common Panel UI Components
===================== */
.ws-section {
    margin-bottom: 1.75rem;
}

.ws-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ws-text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--ws-border);
}

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

.ws-label {
    display: block;
    font-size: 0.75rem;
    color: var(--ws-text-muted);
    margin-bottom: 0.35rem;
}

.ws-input,
.ws-select {
    width: 100%;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--ws-text);
    font-family: var(--ws-sans);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--ws-transition);
}

.ws-input:focus,
.ws-select:focus {
    border-color: var(--ws-accent);
}

.ws-select option {
    background: var(--ws-surface);
}

/* Option cards (e.g., form factor selector) */
.ws-option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.ws-option-card {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--ws-transition);
    position: relative;
}

.ws-option-card:hover {
    border-color: var(--ws-border-hi);
    background: rgba(0, 210, 255, 0.05);
}

.ws-option-card.selected {
    border-color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.08);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.1);
}

.ws-option-card .opt-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ws-text);
}

.ws-option-card .opt-sub {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
    margin-top: 0.15rem;
}

/* Info key-value rows */
.ws-kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
}

.ws-kv-row:last-child {
    border-bottom: none;
}

.ws-kv-key {
    color: var(--ws-text-muted);
}

.ws-kv-val {
    font-family: var(--ws-mono);
    color: var(--ws-text);
    font-size: 0.78rem;
}

.ws-kv-val.ok {
    color: var(--ws-success);
}

.ws-kv-val.warn {
    color: var(--ws-warn);
}

.ws-kv-val.err {
    color: #ff4444;
}

.ws-kv-val.info {
    color: var(--ws-accent);
}

/* Tooltip styles */
.ws-tooltip-trigger {
    color: var(--ws-accent);
    font-size: 0.7rem;
    cursor: help;
    margin-left: 0.3rem;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity var(--ws-transition);
}

.ws-tooltip-trigger:hover {
    opacity: 1;
}

/* Tooltip implementation using title attribute is basic, 
   but for premium look we could add custom JS tooltips. 
   For now, styling the trigger. */

/* View Toggle Button (Top right of viewport) */
.ws-view-controls {
    position: absolute;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    z-index: 100;
}

.view-btn {
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    color: var(--ws-text-muted);
    font-family: var(--ws-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ws-transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.view-btn.active {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.view-btn:hover:not(.active) {
    color: var(--ws-text);
    border-color: var(--ws-accent);
    background: var(--ws-surface2);
}

/* Contextual actions floating right (Next to the CubeSat) */
.ws-viewport-actions {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.action-btn {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--ws-border);
    border-radius: 16px;
    padding: 0.8rem;
    color: var(--ws-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--ws-transition);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90px;
    height: 90px;
    animation: slideInRight 0.5s ease backwards;
}

.action-btn:hover {
    border-color: var(--ws-accent);
    background: rgba(13, 17, 23, 0.95);
    transform: scale(1.05);
}

.action-btn.active {
    border-color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.15);
}

.action-btn-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--ws-accent);
    transition: all var(--ws-transition);
}

.action-btn:hover .action-btn-icon,
.action-btn.active .action-btn-icon {
    background: var(--ws-accent);
    color: white;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.action-btn span {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ws-text-muted);
}

.action-btn:hover span,
.action-btn.active span {
    color: var(--ws-text);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation for internal view */
.transparent-body {
    opacity: 0.3;
}

/* Progress bar */
.ws-progress-wrap {
    background: var(--ws-bg);
    border-radius: 4px;
    height: 6px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.ws-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to right, var(--ws-accent), var(--ws-accent2));
    transition: width 0.5s ease;
}

/* Notification toast */
#ws-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--ws-surface);
    border: 1px solid var(--ws-border-hi);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    color: var(--ws-text);
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 999;
    animation: slideUp 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================
   Module 2: Subsystems
===================== */
.stack-summary-bars {
    display: flex;
    flex-direction: column;
}

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

.stack-bar-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ws-text-muted);
    width: 38px;
    flex-shrink: 0;
}

.stack-bar-val {
    font-size: 0.68rem;
    font-family: var(--ws-mono);
    color: var(--ws-text-muted);
    white-space: nowrap;
}

.subsystem-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stack-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--ws-text-muted);
    font-size: 0.78rem;
    text-align: center;
    border: 1px dashed var(--ws-border);
    border-radius: 12px;
}

.stack-empty i {
    font-size: 1.5rem;
    opacity: 0.3;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    border-left-width: 3px;
    transition: all var(--ws-transition);
}

.stack-item:hover {
    background: var(--ws-surface2);
}

.stack-item-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

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

.stack-item-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ws-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack-item-vendor {
    display: block;
    font-size: 0.65rem;
    color: var(--ws-text-muted);
}

.stack-item-specs {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.65rem;
    font-family: var(--ws-mono);
    color: var(--ws-text-muted);
    gap: 0.1rem;
}

.stack-remove-btn {
    background: transparent;
    border: none;
    color: var(--ws-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--ws-transition);
    flex-shrink: 0;
}

.stack-remove-btn:hover {
    color: var(--ws-warn);
}

.sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.sub-tab {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-family: var(--ws-sans);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ws-text-muted);
    cursor: pointer;
    transition: all var(--ws-transition);
}

.sub-tab:hover {
    border-color: var(--ws-accent);
    color: var(--ws-text);
}

.sub-tab.active {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    color: white;
}

.component-library {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-card {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    border-left-width: 3px;
    transition: all var(--ws-transition);
}

.component-card:hover {
    background: var(--ws-surface2);
}

.component-card.in-stack {
    opacity: 0.6;
}

.comp-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.comp-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ws-text);
    line-height: 1.3;
}

.comp-vendor {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
    white-space: nowrap;
    margin-left: 0.5rem;
    padding: 0.15rem 0.4rem;
    background: var(--ws-surface2);
    border-radius: 4px;
    flex-shrink: 0;
}

.comp-card-specs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    font-family: var(--ws-mono);
    color: var(--ws-text-muted);
}

.comp-card-specs span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comp-card-specs i {
    color: var(--ws-accent);
}

.comp-desc {
    font-size: 0.7rem;
    color: var(--ws-text-muted);
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.comp-card-actions {
    display: flex;
    justify-content: flex-end;
}

.comp-btn {
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    border: none;
    font-family: var(--ws-sans);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ws-transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.comp-btn-add {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--ws-border-hi);
    color: var(--ws-accent);
}

.comp-btn-add:hover {
    background: rgba(0, 210, 255, 0.2);
}

.comp-btn-remove {
    background: rgba(251, 99, 64, 0.1);
    border: 1px solid rgba(251, 99, 64, 0.4);
    color: var(--ws-warn);
}

.comp-btn-remove:hover {
    background: rgba(251, 99, 64, 0.2);
}

.sub-color-eps {
    border-left-color: #ffd700;
}

.sub-color-obc {
    border-left-color: #00cc88;
}

.sub-color-adcs {
    border-left-color: #ff6b35;
}

.sub-color-comms {
    border-left-color: #cc44ff;
}

.sub-color-payload {
    border-left-color: #ff4466;
}

.sub-color-thermal {
    border-left-color: #aaaaaa;
}

.sub-dot-eps {
    background: #ffd700;
}

.sub-dot-obc {
    background: #00cc88;
}

.sub-dot-adcs {
    background: #ff6b35;
}

.sub-dot-comms {
    background: #cc44ff;
}

.sub-dot-payload {
    background: #ff4466;
}

.sub-dot-thermal {
    background: #aaaaaa;
}

#module-subsystems.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* =====================
   Mobile Responsiveness
===================== */
@media (max-width: 768px) {
    #ws-app {
        grid-template-columns: 1fr;
        grid-template-rows: var(--ws-topbar-h) 1fr;
        grid-template-areas:
            "topbar"
            "viewport";
    }

    /* Hide sidebar on mobile, or move it? Let"s hide it and integrate into panel */
    .ws-sidebar {
        display: none;
    }

    /* Topbar adjustments */
    .ws-topbar {
        padding: 0 1rem;
    }

    .ws-mission-name-input {
        width: 150px;
        font-size: 0.85rem;
    }

    .ws-topbar-left {
        min-width: 0;
        flex: 0 0 auto;
    }

    /* Hide module title text on mobile - no room */
    #ws-module-title #active-module-label {
        display: none;
    }

    .ws-topbar-center {
        flex: 1;
        min-width: 0;
        margin: 0 0.5rem;
    }

    .ws-mission-name-wrap {
        max-width: 100%;
        gap: 4px;
    }

    .ws-mission-name-input {
        width: 100%;
        max-width: 110px;
        font-size: 0.8rem;
    }

    .ws-topbar-right {
        min-width: 0;
        flex: 0 0 auto;
        gap: 0.4rem;
        display: flex;
        align-items: center;
    }

    #topbar-reset {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
    }

    #topbar-reset span {
        display: none;
        /* Hide 'Reset' text on mobile */
    }

    /* Panel adjustments - Overlay drawer pattern */
    .ws-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        z-index: 200;
        border-right: none;
        border-top: 1px solid var(--ws-border);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }

    .ws-panel.mobile-open {
        transform: translateY(0);
    }

    .ws-panel-header {
        padding: 1rem 1.25rem;
    }

    /* Viewport adjustments */
    .ws-viewport {
        height: 100%;
    }

    /* Mobile FAB */
    .mobile-panel-fab {
        display: flex;
        position: absolute;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--ws-accent);
        color: white;
        border: none;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
        z-index: 300;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    .mobile-panel-fab:active {
        transform: scale(0.9);
    }

    /* HUD adjustments for mobile */
    .ws-hud-tl,
    .ws-hud-tr,
    .ws-hud-br {
        top: 0.75rem;
        left: 0.75rem;
    }

    .ws-hud-tr {
        left: auto;
        right: 0.75rem;
    }

    .ws-hud-br {
        top: auto;
        bottom: 5rem;
        right: 0.75rem;
    }

    /* Lifted above FAB */

    .ws-hud-tag {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }

    .ws-view-controls {
        top: auto;
        bottom: 1.5rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        padding: 0.35rem;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
        max-width: calc(100% - 80px);
        /* Leave room for FAB */
        scrollbar-width: none;
    }

    .ws-view-controls::-webkit-scrollbar {
        display: none;
    }

    .view-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .ws-controls-hint {
        display: none;
        /* No space for hints on mobile */
    }

    /* Floating actions on mobile */
    .ws-viewport-actions {
        right: 1rem;
        top: auto;
        bottom: 7rem;
        transform: none;
        gap: 0.75rem;
    }

    .action-btn {
        width: 72px;
        height: 72px;
        padding: 0.5rem;
        border-radius: 12px;
    }

    .action-btn-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .action-btn span {
        font-size: 0.55rem;
    }
}

@media (min-width: 769px) {
    .mobile-panel-fab {
        display: none;
    }
}

.mobile-module-nav {
    display: none;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--ws-border);
}

@media (max-width: 768px) {
    .mobile-module-nav {
        display: block;
    }
}

/* =====================
   Module 3: Budgets
===================== */
.budget-table {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.5rem;
}

.budget-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.budget-row:last-child {
    border-bottom: none;
}

.budget-row.header {
    font-weight: 700;
    color: var(--ws-accent);
    border-bottom: 1px solid var(--ws-border);
    margin-bottom: 0.25rem;
}

.budget-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.budget-card-stat {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.budget-card-stat .label {
    display: block;
    font-size: 0.6rem;
    color: var(--ws-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.budget-card-stat .val {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--ws-mono);
}

.budget-card-stat .val.ok {
    color: var(--ws-success);
}

.budget-card-stat .val.warn {
    color: var(--ws-warn);
}

/* =====================
   Mobile View Fix
===================== */
@media (max-width: 768px) {
    #ws-app {
        display: block;
        /* Disable grid on mobile for simpler stacking */
        position: relative;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .ws-topbar {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: var(--ws-topbar-h);
        z-index: 500;
    }

    .ws-viewport {
        position: absolute;
        top: var(--ws-topbar-h);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--ws-topbar-h));
        z-index: 10;
        background: radial-gradient(circle at center, #1a2233 0%, #07090d 100%);
    }

    #ws-canvas {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }

    .ws-sidebar {
        display: none !important;
    }

    .ws-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70vh;
        /* Slightly taller for better interaction */
        z-index: 1000;
        background: rgba(13, 17, 23, 0.95);
        backdrop-filter: blur(20px);
        transform: translateY(calc(100% - 60px));
        /* Peak out header */
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 24px 24px 0 0;
        border-top: 1px solid var(--ws-border-hi);
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
    }

    .ws-panel.mobile-open {
        transform: translateY(0);
    }

    /* Add a "drag handle" visual on mobile panel */
    .ws-panel::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }

    /* Click-outside overlay - shown behind open panel */
    .ws-panel-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 999;
        background: transparent;
    }

    .ws-panel-backdrop.active {
        display: block;
    }

    /* Drag handle strip doubles as collapse tap target */
    .ws-panel-handle-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 0 6px;
        cursor: pointer;
        flex-shrink: 0;
        position: relative;
    }

    .ws-panel-handle-bar::before {
        content: '';
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 2px;
    }

    .mobile-panel-fab {
        bottom: calc(30vh + 1.5rem);
        transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* =====================
   Mobile Interaction Fixes
===================== */
@media (max-width: 768px) {
    .mobile-panel-fab {
        z-index: 2000;
        /* Ensure it is ALWAYS on top */
    }

    .ws-panel-header {
        cursor: pointer;
        /* Hint that it is clickable */
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Add a close/down arrow indicator in the header for mobile */
    .mobile-close-hint {
        display: block;
        color: var(--ws-accent);
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }

    .ws-panel.mobile-open .mobile-close-hint {
        transform: rotate(180deg);
    }
}

@media (min-width: 769px) {
    .mobile-close-hint {
        display: none;
    }
}

/* =====================
   Mobile Scrolling Fix
===================== */
@media (max-width: 768px) {
    .ws-panel {
        display: flex !important;
        flex-direction: column !important;
    }

    .ws-panel-module.active {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        height: auto !important;
        /* Let flex handle it */
        min-height: 0;
        overflow: hidden;
    }

    .ws-panel-body {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: 80px;
        /* Extra space to ensure bottom items are reachable */
    }

    /* Ensure the component library itself doesn"t block scrolling */
    .component-library {
        pointer-events: auto;
    }

    /* Adjusting the mobile nav to ensure it doesn"t swallow all touches */
    .mobile-module-nav {
        flex-shrink: 0;
        z-index: 1001;
    }
}

@media (max-width: 768px) {
    .sub-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
    }

    .sub-tabs::-webkit-scrollbar {
        display: none;
    }

    .sub-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* =====================
   Module 4: Orbit
===================== */
.orbit-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.orbit-stat-box {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.orbit-stat-box i {
    font-size: 1.25rem;
    color: var(--ws-accent);
    opacity: 0.8;
}

.orbit-stat-box .stat-info {
    display: flex;
    flex-direction: column;
}

.orbit-stat-box .lbl {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.orbit-stat-box .val {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--ws-mono);
}

.orbit-stat-box .val.warn {
    color: var(--ws-warn);
}

.orbit-stat-box .val.info {
    color: var(--ws-success);
}

/* =====================
   Module 5: Export
===================== */
.readiness-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
}

.readiness-item i {
    font-size: 1.1rem;
}

.readiness-item.success i {
    color: var(--ws-success);
}

.readiness-item.warning i {
    color: var(--ws-warn);
}

.readiness-item.danger i {
    color: #ff0000;
}

.readiness-item.success {
    border-left: 3px solid var(--ws-success);
}

.readiness-item.warning {
    border-left: 3px solid var(--ws-warn);
}

.readiness-item.danger {
    border-left: 3px solid #ff0000;
}

/* Drag and Drop Reordering */
.stack-item {
    transition: transform 0.2s, background 0.2s;
}

.stack-item.drag-over {
    background: var(--ws-surface2);
    border: 2px dashed var(--ws-accent);
    transform: scale(1.02);
}

/* =====================
   Onboarding Modal
===================== */
/* Cleanup duplicate modal definitions */
.ws-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ws-modal-content {
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 210, 255, 0.1);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}


.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 2rem;
}

.mode-card {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: var(--ws-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mode-card:hover {
    border-color: var(--ws-accent);
    transform: translateY(-5px);
    background: radial-gradient(circle at top right, rgba(0, 210, 255, 0.1), transparent);
}

.mode-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 210, 255, 0.1);
    color: var(--ws-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.preset-item {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: var(--ws-transition);
}

.preset-item:hover {
    border-color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.05);
}

.preset-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-desc {
    font-size: 0.85rem;
    color: var(--ws-text-muted);
    line-height: 1.4;
}

@media (max-width: 600px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================
   Button System
===================== */
.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-family: var(--ws-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ws-transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.ws-btn-primary {
    background: var(--ws-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.2);
}

.ws-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 210, 255, 0.3);
}

.ws-btn-secondary {
    background: var(--ws-surface2);
    border-color: var(--ws-border);
    color: var(--ws-text);
}

.ws-btn-secondary:hover {
    border-color: var(--ws-accent);
    background: rgba(255, 255, 255, 0.05);
}

.ws-btn-danger {
    background: rgba(251, 99, 64, 0.1);
    border-color: rgba(251, 99, 64, 0.2);
    color: var(--ws-warn);
}

.ws-btn-danger:hover {
    background: var(--ws-warn);
    color: white;
}

/* =====================
   Module 6: Internal Layout
===================== */
.layout-layer-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.layer-filter-btn {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    color: var(--ws-text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--ws-transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.layer-filter-btn.active {
    border-color: var(--ws-accent);
    color: var(--ws-text);
    background: rgba(0, 210, 255, 0.08);
}

/* Volume occupancy bar */
.layout-occ-bar-wrap {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
    height: 20px;
    overflow: hidden;
    display: flex;
}

.layout-occ-bar-inner {
    width: 100%;
    display: flex;
    height: 100%;
}

.layout-occ-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.layout-occ-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--ws-text-muted);
}

.occ-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

/* PC/104 slot grid */
.layout-slot-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.layout-rail-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(74, 158, 255, 0.1);
    border: 1px dashed rgba(74, 158, 255, 0.4);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    color: #4a9eff;
}

.layout-board-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-left-width: 3px;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
    cursor: grab;
    transition: var(--ws-transition);
    user-select: none;
}

.layout-board-slot:hover {
    background: var(--ws-surface2);
    border-color: var(--ws-border-hi);
}

.layout-board-slot.layer-hidden {
    opacity: 0.25;
}

.layout-slot-empty {
    opacity: 0.45;
    cursor: default;
    border-left-color: var(--ws-border) !important;
    border-style: dashed;
}

.layout-slot-num {
    min-width: 22px;
    font-size: 0.65rem;
    color: var(--ws-text-muted);
    text-align: center;
}

.layout-slot-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.layout-slot-name {
    font-weight: 600;
    color: var(--ws-text);
}

.layout-slot-meta {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
}

.layout-slot-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

/* CoM visualization */
.layout-com-display {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    margin-top: 0.5rem;
}

.layout-com-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 40px;
}

.layout-com-label-top,
.layout-com-label-bot {
    font-size: 0.6rem;
    color: var(--ws-text-muted);
}

.layout-com-bar {
    flex: 1;
    width: 16px;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    position: relative;
    min-height: 100px;
}

.layout-com-center-line {
    position: absolute;
    top: 50%;
    left: -4px;
    right: -4px;
    height: 1px;
    background: rgba(0, 210, 255, 0.3);
}

.layout-com-marker {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 6px;
    background: var(--ws-accent);
    border-radius: 3px;
    transition: top 0.5s ease;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

.layout-com-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
}

/* Mount type summary */
.layout-mount-summary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.layout-mount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
}

.layout-mount-count {
    color: var(--ws-accent);
    font-family: var(--ws-mono);
    font-size: 0.72rem;
}

/* Collision / connector warnings */
.layout-connector-ok {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ws-success);
    font-size: 0.8rem;
    padding: 0.5rem;
}

.layout-collision-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--ws-warn);
    font-size: 0.78rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 179, 0, 0.06);
    border: 1px solid rgba(255, 179, 0, 0.25);
    border-radius: 8px;
    margin-bottom: 0.35rem;
}

.layout-collision-warn i {
    margin-top: 2px;
    flex-shrink: 0;
}

.layout-connector-list,
.layout-collision-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* =====================
   Module 7: Assembly
===================== */
.assembly-view-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.assembly-view-btn {
    flex: 1;
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    color: var(--ws-text-muted);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ws-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.assembly-view-btn.active {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

/* Assembly panel body scrolls as one unit - no inner max-height */
.assembly-panel-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Assembly step list - no fixed height, natural flow */
.assembly-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-right: 2px;
}

.asm-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.6rem 0.75rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--ws-transition);
}

.asm-step:hover {
    border-color: var(--ws-border-hi);
}

.asm-step.asm-step-active {
    border-color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(0, 210, 255, 0.1);
}

.asm-step.asm-step-done {
    opacity: 0.55;
}

/* Phase badge */
.asm-phase-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid;
    margin-left: 0.5rem;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

/* Toolkit section */
.asm-toolkit-label {
    font-size: 0.72rem;
    color: var(--ws-text-muted);
    margin: 0.6rem 0 0.35rem;
    font-weight: 600;
}

.asm-toolkit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.asm-toolkit-item {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    color: var(--ws-text-muted);
    line-height: 1.3;
}

/* Tip callout */
.asm-tip {
    font-size: 0.72rem;
    color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* Step action row */
.asm-step-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ws-border);
}

/* Mission complete block */
.asm-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at center, rgba(255, 107, 53, 0.08), transparent 70%);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
}

.asm-complete>i {
    font-size: 3rem;
    color: #ff6b35;
    margin-bottom: 1rem;
    animation: launch-pulse 1.5s ease-in-out infinite;
}

.asm-complete h3 {
    font-size: 1.2rem;
    color: var(--ws-text);
    margin-bottom: 0.5rem;
}

.asm-complete p {
    font-size: 0.82rem;
    color: var(--ws-text-muted);
    line-height: 1.5;
    max-width: 260px;
}

@keyframes launch-pulse {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Layout empty state */
.layout-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ws-text-muted);
    background: var(--ws-bg);
    border: 1px dashed var(--ws-border);
    border-radius: 10px;
}

.layout-empty-state>i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.layout-empty-state p {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* Slot category badge */
.layout-slot-cat-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    border: 1px solid;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mount name in mount summary */
.layout-mount-name {
    font-size: 0.78rem;
    color: var(--ws-text);
}

.asm-step-num {
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    background: var(--ws-surface2);
    flex-shrink: 0;
}

.asm-step-body {
    flex: 1;
    min-width: 0;
}

.asm-step-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ws-text);
}

.asm-step-detail {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: var(--ws-text-muted);
    line-height: 1.5;
}

.asm-step-parts {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.asm-part-tag {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 5px;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    color: var(--ws-text-muted);
}

/* Harness routing */
.assembly-harness-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.asm-harness-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.6rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
}

.asm-harness-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.asm-harness-info {
    display: flex;
    flex-direction: column;
}

.asm-harness-type {
    font-size: 0.78rem;
    font-weight: 600;
}

.asm-harness-spec {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
}

/* Fasteners grid */
.assembly-fasteners-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.asm-fastener-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
}

.asm-fastener-item i {
    color: var(--ws-text-muted);
    width: 14px;
}

.asm-fastener-item span {
    flex: 1;
    color: var(--ws-text-muted);
}

.asm-fastener-item strong {
    color: var(--ws-accent);
    font-family: var(--ws-mono);
}

/* Deployables */
.assembly-deploy-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.asm-deploy-item {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.75rem;
}

.asm-deploy-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.asm-deploy-name {
    font-size: 0.8rem;
    font-weight: 600;
    flex: 1;
}

.asm-deploy-mech {
    font-size: 0.65rem;
    color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.asm-deploy-desc {
    font-size: 0.72rem;
    color: var(--ws-text-muted);
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

/* Build metrics */
.assembly-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.asm-metric-card {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.asm-metric-card>i {
    font-size: 1.1rem;
    color: var(--ws-accent);
    opacity: 0.7;
}

.asm-metric-info {
    display: flex;
    flex-direction: column;
}

.asm-metric-val {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--ws-mono);
    color: var(--ws-text);
}

.asm-metric-label {
    font-size: 0.6rem;
    color: var(--ws-text-muted);
    text-transform: uppercase;
}

/* Deployer checks */
.assembly-deployer-check {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.asm-check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    padding: 0.45rem 0.6rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 6px;
}

.asm-check-info {
    display: flex;
    flex-direction: column;
}

.asm-check-label {
    font-weight: 600;
    color: var(--ws-text);
}

.asm-check-detail {
    font-size: 0.65rem;
    color: var(--ws-text-muted);
}

/* =====================
   Engineering Warnings Panel
===================== */
.warn-all-clear {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ws-success);
    padding: 1.25rem;
    background: rgba(30, 203, 123, 0.05);
    border: 1px solid rgba(30, 203, 123, 0.2);
    border-radius: 10px;
    font-size: 0.85rem;
}

.warn-all-clear i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.warn-item {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: var(--ws-transition);
}

.warn-item.warn-error {
    border-left: 4px solid var(--ws-danger, #ff4444);
}

.warn-item.warn-warning {
    border-left: 4px solid var(--ws-warn);
}

.warn-item-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.warn-item.warn-error .warn-item-header i {
    color: var(--ws-danger, #ff4444);
}

.warn-item.warn-warning .warn-item-header i {
    color: var(--ws-warn);
}

.warn-short {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ws-text);
}

.warn-why {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ws-text-muted);
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 0.6rem;
}

/* Sidebar warn badge styling */
.sidebar-btn-warn {
    position: relative;
}

/* =====================
   Mission Review Modal
===================== */
.review-score-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.review-grade {
    font-size: 4rem;
    font-weight: 900;
    font-family: var(--ws-mono);
    width: 80px;
    height: 80px;
    border: 3px solid;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.review-score-meta {
    text-align: left;
}

.review-score-num {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--ws-mono);
    line-height: 1;
}

.review-score-num span {
    font-size: 1rem;
    color: var(--ws-text-muted);
}

.review-score-label {
    font-size: 0.85rem;
    color: var(--ws-text-muted);
    margin-top: 0.2rem;
}

.review-mission-name {
    font-size: 0.75rem;
    color: var(--ws-text-muted);
    margin-top: 0.25rem;
    font-family: var(--ws-mono);
}

.review-section {
    margin-bottom: 1.25rem;
}

.review-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ws-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-section h4 i {
    color: var(--ws-accent);
}

.review-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.review-breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.review-breakdown-label {
    min-width: 130px;
    font-size: 0.75rem;
    color: var(--ws-text-muted);
}

.review-breakdown-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--ws-bg);
    border-radius: 4px;
    overflow: hidden;
}

.review-breakdown-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.review-breakdown-score {
    min-width: 28px;
    font-size: 0.75rem;
    font-family: var(--ws-mono);
    font-weight: 700;
    text-align: right;
}

.review-risk-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.35rem;
    background: var(--ws-bg);
    border-radius: 8px;
}

.review-risk-level {
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 60px;
    flex-shrink: 0;
}

.review-risk-text {
    font-size: 0.78rem;
    color: var(--ws-text-muted);
    line-height: 1.4;
}

.review-allclear {
    color: var(--ws-success);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
}

.review-recs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.review-rec-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--ws-text-muted);
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--ws-border);
    line-height: 1.4;
}

.review-margins-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.review-margin-card {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.review-margin-val {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--ws-mono);
}

.review-margin-label {
    font-size: 0.6rem;
    color: var(--ws-text-muted);
    text-transform: uppercase;
}

.review-assembly-info {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.75rem;
}

@media (max-width: 480px) {
    .review-margins-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .review-grade {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
    }

    .review-score-num {
        font-size: 1.5rem;
    }
}

/* =====================
   Sidebar Divider
===================== */
.sidebar-divider {
    width: 32px;
    border: none;
    border-top: 1px solid var(--ws-border);
    margin: 0.4rem 0;
    opacity: 0.6;
}

/* =====================
   Simulation Lab
===================== */
.sim-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sim-selector-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--ws-border);
    background: var(--ws-bg);
    color: var(--ws-text-muted);
    cursor: pointer;
    transition: all var(--ws-transition);
    font-family: var(--ws-sans);
}

.sim-selector-btn i {
    font-size: 1.2rem;
}

.sim-selector-btn span {
    font-size: 0.78rem;
    font-weight: 700;
}

.sim-selector-btn small {
    font-size: 0.6rem;
    color: var(--ws-text-muted);
}

.sim-selector-btn:hover {
    border-color: var(--ws-accent);
    color: var(--ws-text);
}

.sim-selector-btn.active {
    border-color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.08);
    color: var(--ws-accent);
}

/* Launcher button row */
.sim-launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.sim-launcher-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.55rem 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--ws-border);
    background: var(--ws-bg);
    color: var(--ws-text-muted);
    cursor: pointer;
    font-family: var(--ws-sans);
    font-size: 0.65rem;
    font-weight: 600;
    transition: all var(--ws-transition);
}

.sim-launcher-btn i {
    font-size: 0.9rem;
}

.sim-launcher-btn:hover {
    border-color: var(--ws-accent);
    color: var(--ws-text);
}

.sim-launcher-btn.active {
    border-color: var(--ws-warn);
    background: rgba(251, 99, 64, 0.1);
    color: var(--ws-warn);
}

/* Sim stats grid */
.sim-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.sim-stat-box {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sim-stat-box i {
    font-size: 1rem;
    flex-shrink: 0;
}

.sim-stat-box .stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sim-stat-box .lbl {
    font-size: 0.6rem;
    color: var(--ws-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sim-stat-box .val {
    font-family: var(--ws-mono);
    font-size: 0.78rem;
    color: var(--ws-text);
    font-weight: 600;
}

/* Vibration stress bar */
.sim-stress-bar-wrap {
    padding: 0.25rem 0;
}

.sim-stress-bar {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    position: relative;
    overflow: hidden;
}

.sim-stress-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--ws-success);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
}

.sim-stress-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* TVAC thermal bar */
.sim-thermal-bar-wrap {
    position: relative;
    padding: 0.25rem 0 1rem;
}

.sim-thermal-bar {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right,
            #00aaff 0%,
            #00d2ff 25%,
            #2dce89 50%,
            #fb6340 75%,
            #ff4444 100%);
    border: 1px solid var(--ws-border);
}

.sim-thermal-needle {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 18px;
    background: white;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Result box */
.sim-result-box {
    background: var(--ws-surface2);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--ws-text-muted);
}

.sim-result-pass {
    border-color: var(--ws-success);
    background: rgba(45, 206, 137, 0.05);
}

.sim-result-fail {
    border-color: var(--ws-warn);
    background: rgba(251, 99, 64, 0.05);
}

.sim-result-box strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--ws-text);
    font-size: 0.82rem;
}

/* ── Sidebar divider (hr line) ── */
.sidebar-divider {
    display: block;
    width: 36px;
    height: 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 0.5rem auto;
    flex-shrink: 0;
    align-self: center;
}

/* ── Simulation canvas wrap ── */
.sim-canvas-wrap {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
}

.sim-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── 4-col selector grid ── */
.sim-selector-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Telemetry log ── */
.sim-telemetry-log {
    background: var(--ws-bg);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    max-height: 130px;
    overflow-y: auto;
    font-family: var(--ws-mono);
    font-size: 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: var(--ws-border) transparent;
}

.sim-telemetry-line {
    color: var(--ws-text-muted);
    padding: 0.15rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    line-height: 1.5;
}

.sim-telemetry-line.warn {
    color: var(--ws-warn);
}

.sim-telemetry-line.dim {
    opacity: 0.4;
}

/* ── Fix step list ── */
.sim-fix-steps {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--ws-border);
}

.sim-fix-title {
    font-weight: 700;
    color: var(--ws-text);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.sim-fix-steps ol {
    margin: 0;
    padding-left: 1.2rem;
}

.sim-fix-steps li {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--ws-text-muted);
}

.sim-fix-steps li strong {
    color: var(--ws-text);
    display: inline;
    font-size: inherit;
    margin-bottom: 0;
}

/* ── Quick-fix action button inside result boxes ── */
.sim-fix-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--ws-accent);
    background: rgba(0, 210, 255, 0.08);
    color: var(--ws-accent);
    font-family: var(--ws-sans);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--ws-transition);
    letter-spacing: 0.2px;
}

.sim-fix-btn:hover {
    background: var(--ws-accent);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

/* ── Restricted sidebar button styling for anonymous users ── */
.sidebar-btn.restricted,
.ws-btn.restricted {
    opacity: 0.45;
    filter: grayscale(1);
}

.sidebar-btn.restricted:hover,
.ws-btn.restricted:hover {
    opacity: 0.65;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

/* ── Glowing Focus Pulse Animation (Issue 4 - 3D Subsystem Click) ────────── */
@keyframes pulseGlowFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.8), 0 0 0 0 rgba(0, 210, 255, 0.4);
    }

    40% {
        box-shadow: 0 0 18px 6px rgba(0, 210, 255, 0.6), 0 0 40px 12px rgba(0, 210, 255, 0.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0), 0 0 0 0 rgba(0, 210, 255, 0);
    }
}

.component-card.glowing-focus {
    animation: pulseGlowFocus 1.1s ease-out forwards;
    outline: 2px solid rgba(0, 210, 255, 0.7);
    outline-offset: 2px;
    border-color: var(--ws-accent) !important;
    transition: border-color 0s;
}

/* =====================
   Mission Control Dashboard
===================== */
#mission-control-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    color: var(--ws-text);
    animation: fadeIn 0.4s ease forwards;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.mc-header h2 {
    font-size: 1.5rem;
    color: var(--ws-accent);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-auto-rows: min-content;
    gap: 1.5rem;
    flex: 1;
}

.mc-card {
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mc-map-card {
    height: 300px;
}

@media (min-width: 1000px) {
    .mc-map-card {
        grid-column: span 2;
    }
}

.mc-card-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ws-text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Pseudo Ground Track Map */
.mc-map-container {
    flex: 1;
    position: relative;
    background-color: #050a12;
    background-image: url('../assets/world-map.svg');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.9;
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    overflow: hidden;
}

#mc-map-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Telemetry Card */
.mc-telemetry {
    display: flex;
    flex-direction: column;
}

.mc-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.mc-data-box {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.75rem;
    font-family: var(--ws-mono);
}

.mc-data-box span:first-child {
    font-size: 0.7rem;
    color: var(--ws-text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mc-data-box .mc-val {
    font-size: 1.1rem;
    color: var(--ws-accent);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

.mc-data-box .mc-val.ok {
    color: var(--ws-success);
    text-shadow: 0 0 8px rgba(45, 206, 137, 0.4);
}

.mc-data-box .mc-val.warn {
    color: var(--ws-warn);
    text-shadow: 0 0 8px rgba(251, 99, 64, 0.4);
}

/* Mission Control 2.0 Additions */
.mc-console {
    background: #05070a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.75rem;
    font-family: var(--ws-mono);
    font-size: 0.85rem;
    height: 100%;
    min-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.mc-console-line {
    color: var(--ws-text-muted);
}

.mc-console-line .ts {
    color: var(--ws-accent);
    margin-right: 0.5rem;
}

.mc-console-line.warn {
    color: var(--ws-warn);
}

.mc-console-line.ok {
    color: var(--ws-success);
}

.mc-subsystems-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mc-sub-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--ws-mono);
    font-size: 0.9rem;
}

.mc-sub-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ws-success);
    box-shadow: 0 0 8px var(--ws-success);
}

.mc-sub-status.inactive {
    background: #555;
    box-shadow: none;
}

.mc-notes-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    color: var(--ws-text-muted);
    font-size: 0.9rem;
}

.mc-notes-content p {
    margin: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.mc-notes-content i {
    color: var(--ws-accent);
    margin-top: 0.2rem;
}

/* -- Mission Control 5.0 Panels --------------------------------------- */

/* Map Legend */
.mc-map-legend {
    position: absolute;
    bottom: 0.5rem;
    left: 0.75rem;
    display: flex;
    gap: 1.2rem;
    font-family: var(--ws-mono);
    font-size: 0.68rem;
    color: var(--ws-text-muted);
    background: rgba(10, 14, 20, 0.7);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    z-index: 5;
}

/* Mission Clock large display */
.mc-clock-main {
    font-family: var(--ws-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ws-accent);
    text-align: center;
    letter-spacing: 0.08em;
    padding: 1.2rem 0 0.5rem;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

/* Signal Strength Bar */
.mc-signal-bar-wrap {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mc-signal-bar-bg {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.mc-signal-bar {
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, #2dce89, #00d2ff);
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s ease;
}

.mc-signal-bar.weak {
    background: linear-gradient(90deg, #fb6340, #f5a623);
}

.mc-signal-bar.los {
    background: rgba(255, 255, 255, 0.1);
    width: 5%;
}

/* mc-card-title icon spacing */
.mc-card-title i {
    margin-right: 0.4rem;
    opacity: 0.7;
}

/* -- Terminal Scrollbar & Fixed Height ------------------------------ */
.mc-console {
    max-height: 220px;
}

.mc-console::-webkit-scrollbar {
    width: 8px;
}

.mc-console::-webkit-scrollbar-track {
    background: #0f151e;
    border-radius: 4px;
}

.mc-console::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.3);
    border-radius: 4px;
}

.mc-console::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 210, 255, 0.5);
}

/* ==========================================================================
   Component 3D Preview Modal & Info Plaque (Premium Cyber Aesthetics)
   ========================================================================== */
.comp-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 15, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.comp-preview-modal-content {
    background: rgba(18, 24, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 210, 255, 0.15);
    border-radius: 16px;
    width: 95%;
    max-width: 1100px;
    height: 80vh;
    max-height: 750px;
    display: flex;
    overflow: hidden;
    position: relative;
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.comp-preview-left {
    width: 60%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at center, #1b2635 0%, #0c1017 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.comp-preview-right {
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
}

.comp-preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.comp-preview-canvas:active {
    cursor: grabbing;
}

/* Viewport HUD Overlays */
.comp-preview-hud-title {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.comp-preview-hud-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.comp-preview-hud-title span {
    font-family: var(--ws-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ws-accent);
}

.comp-preview-actions-overlay {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.comp-preview-action-btn {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    color: var(--ws-text-muted);
    font-family: var(--ws-sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ws-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comp-preview-action-btn:hover {
    color: #fff;
    border-color: var(--ws-accent);
    background: var(--ws-surface2);
}

.comp-preview-action-btn.active {
    color: #fff;
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

/* Right spec column header */
.comp-preview-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.comp-preview-header-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.comp-preview-header-info p {
    font-size: 0.8rem;
    color: var(--ws-text-muted);
    margin-top: 0.25rem;
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.comp-preview-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ws-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ws-transition);
}

.comp-preview-close:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
    color: #ff4d6d;
    transform: rotate(90deg);
}

/* Plaque Scroll Body */
.comp-preview-plaque-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.comp-preview-plaque-body::-webkit-scrollbar {
    width: 4px;
}

.comp-preview-plaque-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Plaque Sections */
.comp-plaque-sec {
    margin-bottom: 1.75rem;
}

.comp-plaque-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ws-accent);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(0, 210, 255, 0.2);
}

.comp-plaque-desc {
    font-size: 0.88rem;
    color: var(--ws-text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.comp-plaque-heritage-badge {
    background: rgba(45, 206, 137, 0.12);
    border: 1px solid rgba(45, 206, 137, 0.3);
    color: var(--ws-success);
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Specs Table */
.comp-plaque-table {
    width: 100%;
    border-collapse: collapse;
}

.comp-plaque-tr {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.comp-plaque-tr:last-child {
    border-bottom: none;
}

.comp-plaque-label {
    color: var(--ws-text-muted);
    font-size: 0.82rem;
}

.comp-plaque-val {
    font-family: var(--ws-mono);
    color: #fff;
    font-size: 0.8rem;
    text-align: right;
    font-weight: 500;
}

/* Preview button in card */
.comp-preview-btn-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ws-text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--ws-sans);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--ws-transition);
}

.comp-preview-btn-card:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
    background: rgba(0, 210, 255, 0.05);
}

/* Coming soon state for card preview buttons */
.comp-preview-btn-card.coming-soon {
    opacity: 0.55 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--ws-text-muted) !important;
    cursor: pointer;
}

.comp-preview-btn-card.coming-soon:hover {
    opacity: 0.85 !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--ws-text) !important;
    box-shadow: none !important;
}