/* ==========================================================================
   MicrowaveStudio RF — Professional EDA Design System (Adjustable Split View)
   ========================================================================== */

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

:root {
    /* Apple Glass / VisionOS Translucent Spatial Design Tokens */
    --bg-root: #030712;
    --bg-stage: #040817;
    --bg-card: rgba(13, 19, 36, 0.65);
    --bg-card-hover: rgba(20, 30, 58, 0.75);
    --bg-header: rgba(8, 14, 28, 0.75);
    --bg-input: rgba(4, 8, 18, 0.65);
    --bg-modal-overlay: rgba(3, 7, 18, 0.82);

    /* Apple Glass Specular Highlights and Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(56, 189, 248, 0.7);

    /* Text & High-Vibrancy Legibility */
    --text-primary: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.75);
    --text-muted: rgba(148, 163, 184, 0.7);

    /* Apple Vibrant Semantic Accents */
    --accent-blue: #38bdf8;
    --accent-primary: #0ea5e9;
    --accent-blue-hover: #0284c7;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;

    /* Apple Squircle Continuous Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;

    /* Apple Glass Elevation & Specular Shadows */
    --shadow-glass-sm: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
    --shadow-glass-md: 0 12px 32px -4px rgba(0, 0, 0, 0.55), inset 0 1px 1px 0 rgba(255, 255, 255, 0.16);
    --shadow-glass-lg: 0 24px 64px -8px rgba(0, 0, 0, 0.75), 0 0 35px rgba(56, 189, 248, 0.12), inset 0 1px 1px 0 rgba(255, 255, 255, 0.22);
    --shadow-dropdown: 0 16px 40px -4px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

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

body {
    background-color: var(--bg-root);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.14) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header Bar
   ========================================================================== */

.app-header {
    height: 44px;
    background: rgba(8, 14, 28, 0.72);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 4px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 20;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    user-select: none;
}

.brand-logo .logo-icon-svg {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.45));
}

.badge-version {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 9px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.status-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.engine-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 28px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: default;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.badge-mini {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-dropdown {
    width: 230px;
    height: 28px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 11px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.15s ease;
}

.preset-dropdown:focus {
    border-color: var(--border-focus);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-run-sim {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    height: 28px;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.45), 0 4px 16px rgba(14, 165, 233, 0.38);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-run-sim:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 6px 22px rgba(14, 165, 233, 0.55);
    transform: translateY(-1px);
}

.btn-run-sim:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-tutorial {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tutorial:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.3);
    transform: translateY(-0.5px);
}

.workspace-view-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    padding: 3px;
    gap: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.view-switch-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    height: 24px;
    padding: 0 11px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-switch-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.view-switch-btn.active {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* File Dropdown Container & Menu */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 16px 40px -4px rgba(0, 0, 0, 0.7);
    min-width: 200px;
    z-index: 1000;
    padding: 6px;
    animation: fadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-dropdown-menu.show {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    height: 28px;
    padding: 0 13px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.4), 0 4px 16px rgba(14, 165, 233, 0.35);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 6px 20px rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
}

.btn-primary-sm {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    height: 24px;
    padding: 0 10px;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.35), 0 2px 10px rgba(14, 165, 233, 0.3);
    transition: all 0.15s ease;
}

.btn-primary-sm:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-secondary-sm {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.09);
    font-size: 10px;
    font-weight: 500;
    height: 23px;
    padding: 0 8px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
}

.btn-secondary-sm:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   Workspace Layout (Left Schematic + Bottom Sweep | Splitter | Right Plots)
   ========================================================================== */

.app-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    width: 100vw;
    user-select: none;
}

/* 1. Left Schematic + Sweep Area */
.schematic-area {
    width: 55%;
    min-width: 320px;
    max-width: 80%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-stage);
    padding: 8px 0 8px 8px;
    gap: 8px;
}

.stage-card {
    background-color: rgba(11, 17, 33, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 8px 28px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.schematic-top-card {
    flex: 1 1 0px;
    min-height: 200px;
    position: relative;
    overflow: visible;
}

.card-header {
    height: 34px;
    background-color: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}

.header-left-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-hint {
    font-size: 10px;
    color: var(--text-muted);
}

/* Bottom Sweep Area */
.sweep-bottom-card {
    height: 136px;
    flex-shrink: 0;
    background-color: rgba(11, 17, 33, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 8px 28px rgba(0, 0, 0, 0.4);
}

.sweep-header {
    height: 32px;
    padding: 0 10px;
    background-color: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sweep-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sweep-type-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    padding: 2px;
    gap: 2px;
}

.sweep-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sweep-tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
}

.sweep-tab-btn.active {
    color: #ffffff;
    background-color: rgba(14, 165, 233, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(14, 165, 233, 0.25);
}

.sweep-panes-body {
    flex: 1;
    display: flex;
    padding: 6px 10px;
    background-color: rgba(6, 10, 22, 0.4);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.sweep-layers-container {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: min-content;
}

.sweep-layer-card {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    min-width: 320px;
    max-width: 440px;
    flex: 1;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.18s ease;
}

.sweep-layer-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 16px rgba(56, 189, 248, 0.15);
}

.sweep-layer-card.layer-outer {
    border-left: 3px solid var(--accent-amber);
}

.sweep-layer-card.layer-inner {
    border-left: 3px solid var(--accent-blue);
}

.sweep-layer-card.layer-middle {
    border-left: 3px solid var(--accent-emerald);
}

.layer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.layer-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
}

.layer-badge.outer {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.layer-badge.inner {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.layer-badge.middle {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.layer-reorder-btns {
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-layer-reorder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    padding: 0;
    transition: all 0.15s ease;
}

.btn-layer-reorder:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-layer-reorder:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.btn-layer-remove {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #f43f5e;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0;
    margin-left: 3px;
    transition: all 0.15s ease;
}

.btn-layer-remove:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
}

.layer-card-body {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.layer-field-group {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
}

.layer-target-select {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    height: 24px;
    padding: 2px 6px;
    max-width: 170px;
    background: #090e1a;
    border-color: var(--border-medium);
}

.input-layer-num {
    width: 54px;
    height: 24px;
    padding: 2px 4px;
    font-size: 10px;
    text-align: right;
}

.input-layer-pts {
    width: 44px;
    height: 24px;
    padding: 2px 4px;
    font-size: 10px;
    text-align: right;
}

.layer-unit-tag {
    font-size: 9.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
}

.layer-seq-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 900;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.layer-seq-num.outer {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
}

.layer-seq-num.inner {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1.5px solid rgba(56, 189, 248, 0.4);
}

.layer-seq-num.middle {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1.5px solid rgba(16, 185, 129, 0.4);
}

.layer-range-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.layer-range-arrow {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0 1px;
}

.layer-pts-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.sweep-layer-card.drag-over {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.sweep-layer-card[draggable=true] {
    cursor: grab;
}

.sweep-layer-card[draggable=true]:active {
    cursor: grabbing;
}

.btn-sweep-param-import {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-sweep-param-import:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--accent-blue);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

/* Global Variables Table Modal */
.global-vars-table-container {
    background: #090e1a;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 8px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.var-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.var-row input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    height: 26px;
}

.var-name-input {
    width: 110px;
    font-weight: 700;
    color: var(--accent-amber);
}

.var-val-input {
    flex: 1;
}

.var-desc-tag {
    font-size: 9.5px;
    color: var(--text-muted);
}

/* Dynamic Variable Binding & Tuning UI */
.var-bind-picker {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    height: 24px;
    padding: 1px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.var-bind-picker:hover, .var-bind-picker:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}

.var-bind-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    margin-top: 3px;
    font-size: 9.5px;
    color: #38bdf8;
}

.var-live-tuning-box {
    margin-top: 4px;
    background: rgba(15, 23, 42, 0.65);
    padding: 5px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-tune-step {
    padding: 0 6px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-subtle);
    color: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-tune-step:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

.var-tune-slider {
    flex: 1;
    accent-color: #38bdf8;
    cursor: pointer;
    height: 4px;
}

/* 2. Workspace Splitter (Horizontal Drag Handle) */
.workspace-splitter {
    width: 10px;
    background-color: var(--bg-root);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 15;
    transition: background-color 0.15s ease;
}

.workspace-splitter:hover,
.workspace-splitter.dragging {
    background-color: rgba(56, 189, 248, 0.15);
}

.splitter-grip {
    width: 3px;
    height: 32px;
    background-color: var(--border-medium);
    border-radius: 2px;
    transition: background-color 0.15s ease;
}

.workspace-splitter:hover .splitter-grip,
.workspace-splitter.dragging .splitter-grip {
    background-color: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
}

/* 3. Right Integrated Performance Panel */
.performance-panel {
    flex: 1;
    min-width: 380px;
    background-color: rgba(11, 17, 33, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.14), 0 8px 28px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 8px 8px 8px 0;
    min-height: 0;
}

.perf-tabs-header {
    min-height: 42px;
    height: auto;
    background-color: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 6px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.perf-tabs-header::-webkit-scrollbar {
    height: 3px;
}

.perf-tabs-header::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 2px;
}

.perf-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    height: 29px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.perf-tab-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-0.5px);
}

.perf-tab-btn.active {
    color: #ffffff;
    background-color: rgba(14, 165, 233, 0.28);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(56, 189, 248, 0.28);
}

.perf-tab-btn.tab-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.35);
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.perf-tab-btn.tab-disabled:hover {
    background: rgba(15, 23, 42, 0.35);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    box-shadow: none;
}

.tab-disabled-badge {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin-left: 3px;
    letter-spacing: 0.04em;
}

.passive-pane-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 10, 20, 0.88);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10;
    text-align: center;
    gap: 8px;
}

.passive-pane-overlay-icon {
    font-size: 28px;
    color: var(--accent-blue);
    opacity: 0.8;
}

.passive-pane-overlay-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.passive-pane-overlay-desc {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    max-width: 440px;
    line-height: 1.5;
}

.perf-content-area {
    flex: 1 1 0px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-stage);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    min-height: 0;
}

.perf-tab-pane {
    display: none;
    flex-direction: column;
    flex: 1 1 0px;
    background-color: var(--bg-header);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    min-height: 0;
}

.perf-tab-pane.active {
    display: flex;
}

.perf-pane-toolbar {
    height: 30px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    flex-shrink: 0;
}

.pane-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pane-actions {
    display: flex;
    gap: 10px;
}

.checkbox-label {
    font-size: 10px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--accent-blue);
}

.plot-canvas-wrapper {
    flex: 1 1 0px;
    position: relative;
    overflow: hidden;
    min-height: 0;
    width: 100%;
}

.plot-canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Dual Scope in Integrated Sub-Tab */
.dual-scope-vertical {
    flex: 1 1 0px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    width: 100%;
}

.scope-panel-v {
    flex: 1 1 0px;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    min-height: 0;
    width: 100%;
}

.scope-panel-v:last-child {
    border-bottom: none;
}

.scope-panel-v canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Active Device Scope Selector Bar in Load Line Tab */
.active-dev-selector-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background-color: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.active-dev-bar-label {
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.active-dev-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.active-dev-pill {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.active-dev-pill:hover {
    color: var(--text-primary);
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.active-dev-pill.active {
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--accent-blue);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}

.active-dev-pill.combined {
    border-color: rgba(236, 72, 153, 0.4);
}

.active-dev-pill.combined.active {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.18);
    border-color: #ec4899;
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.25);
}

.scope-panel-label {
    position: absolute;
    top: 6px;
    left: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    z-index: 2;
    pointer-events: none;
}

.pane-metrics-inline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.pane-metrics-inline strong {
    color: var(--text-muted);
}

.metric-summary-strip {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    flex-shrink: 0;
}

.distortion-metrics-box {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 6px 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    flex-shrink: 0;
}

.dist-item {
    display: flex;
    justify-content: space-between;
}

.d-lbl { color: var(--text-muted); }
.d-val { font-weight: 600; color: var(--text-primary); }
.d-val.highlight { color: var(--accent-blue); }
.d-val.amber { color: var(--accent-amber); }

/* Matching Controls & Solution Cards */
.matching-controls-bar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    flex-shrink: 0;
}

.solutions-scroll-area {
    flex: 1 1 0px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* ==========================================================================
   Floating On-Demand Contextual Inspector & Modal Drawers
   ========================================================================== */

.floating-inspector {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 290px;
    background-color: rgba(11, 18, 36, 0.85);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 16px 48px rgba(0, 0, 0, 0.65);
    z-index: 90;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inspector-header {
    height: 32px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    border-radius: 14px 14px 0 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.inspector-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 420px;
    overflow-y: auto;
}

.inspector-metrics-hud {
    background: rgba(4, 8, 18, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.hud-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hud-label {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.hud-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-val.highlight {
    color: #38bdf8;
}

.hud-val.green {
    color: #10b981;
}

.hud-val.amber {
    color: #f59e0b;
}

.hud-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
}

/* Universal Modal Overlays & Centered Drawers */
.modal-overlay,
.modal-backdrop,
.theory-modal-backdrop,
.modal-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.theory-modal {
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(36px) saturate(200%);
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 24px 72px -8px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.theory-modal-header {
    height: 42px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #f8fafc;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
    padding: 2px 5px;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.drawer-card {
    width: 360px;
    background-color: rgba(11, 18, 36, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 20px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-header {
    height: 36px;
    background-color: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.control-row-horizontal {
    display: flex;
    align-items: center;
    gap: 6px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.control-label {
    font-size: 10.5px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-val {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 4px 6px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--border-focus);
}

.input-num {
    width: 58px;
    text-align: right;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-blue);
    height: 4px;
    cursor: pointer;
}

.doherty-box {
    background: rgba(56, 189, 248, 0.04);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   Footer Status Bar
   ========================================================================== */

.app-statusbar {
    height: 24px;
    background: rgba(8, 14, 28, 0.72);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.statusbar-left,
.statusbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-highlight {
    color: var(--accent-blue);
    font-weight: 600;
}

/* ==========================================================================
   RF Theory & Engineering Guide Modal Styling
   ========================================================================== */

.drawer-card.modal-large {
    width: 680px;
    max-width: 90vw;
    margin: auto;
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(36px) saturate(200%);
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 24px 72px -8px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.12);
}

.guide-tabs-header {
    display: flex;
    align-items: center;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    padding: 4px 8px 0 8px;
    gap: 4px;
}

.guide-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.guide-tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(56, 189, 248, 0.05);
}

.guide-tab-btn.active {
    color: var(--accent-blue);
    background-color: var(--bg-card);
    border-color: var(--border-subtle);
    border-bottom-color: var(--bg-card);
    font-weight: 700;
}

.guide-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.guide-pane {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.guide-pane.active {
    display: flex;
}

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

.guide-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.guide-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pill-class {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.guide-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

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

.formula-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formula-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-blue);
}

.formula-math {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 6px 8px;
    color: #38bdf8;
    text-align: center;
}

.formula-desc {
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.shortcuts-table th {
    text-align: left;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.shortcuts-table tr:hover td {
    background-color: rgba(56, 189, 248, 0.04);
}

kbd {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.3);
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    display: inline-block;
}

/* ====================================================
   TIME-DOMAIN TRANSIENT OSCILLOSCOPE STYLES
   ==================================================== */
.transient-source-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    font-size: 11px;
}

.transient-ctrl-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.input-num-sm {
    width: 60px;
    height: 22px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
}

.select-sm {
    height: 22px;
    padding: 2px 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
}

.scope-channels-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(10, 15, 26, 0.85);
    border-bottom: 1px solid var(--border-subtle);
}

.scope-ch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.scope-ch-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.scope-ch-pill input {
    margin: 0;
    cursor: pointer;
}

.scope-ch-pill.ch1.active {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(56, 189, 248, 0.6);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(56, 189, 248, 0.2);
}

.scope-ch-pill.ch2.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
    color: #f59e0b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(245, 158, 11, 0.2);
}

.scope-ch-pill.ch3.active {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
    color: #10b981;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(16, 185, 129, 0.2);
}

.scope-ch-pill.ch4.active {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.6);
    color: #a855f7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(168, 85, 247, 0.2);
}

.scope-canvas-wrapper {
    flex: 1 1 0px;
    position: relative;
    background: #060b13;
    min-height: 220px;
}

.scope-measurements-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(10, 15, 26, 0.95);
    border-top: 1px solid var(--border-subtle);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    flex-wrap: wrap;
    gap: 8px;
}

.scope-meas-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.scope-meas-item .m-lbl {
    color: var(--text-muted);
}

.scope-meas-item .m-val {
    color: #e2e8f0;
    font-weight: 700;
}

.scope-meas-item .m-val.ch1 {
    color: #38bdf8;
}

.scope-meas-item .m-val.ch2 {
    color: #f59e0b;
}

.scope-meas-item .m-val.highlight {
    color: #10b981;
}

/* ===================================================================
   Open Device-Model Kit panel
   =================================================================== */

.kit-disclaimer {
    padding: 10px 12px;
    background-color: rgba(245, 158, 11, 0.08);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--text-secondary);
    font-size: 10.5px;
    line-height: 1.5;
}

.kit-disclaimer strong { color: #f59e0b; }
.kit-disclaimer em { color: var(--text-primary); font-style: normal; font-weight: 600; }

.kit-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kit-status {
    font-size: 10.5px;
    color: var(--text-secondary);
    margin-left: auto;
    max-width: 320px;
    text-align: right;
}

.kit-meta-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 16px;
    padding: 8px 10px;
    background-color: var(--bg-header);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.kit-meta-row { display: flex; gap: 8px; font-size: 10.5px; min-width: 0; }
.kit-meta-k { color: var(--text-secondary); flex: 0 0 76px; }
.kit-meta-v { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kit-split { display: flex; gap: 10px; align-items: flex-start; }

.kit-device-list {
    flex: 0 0 240px;
    max-height: 46vh;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-header);
}

.kit-device-row {
    padding: 6px 9px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.kit-device-row:hover { background-color: rgba(56, 189, 248, 0.06); }
.kit-device-row.selected { background-color: rgba(56, 189, 248, 0.12); }

.kit-device-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kit-device-name { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; color: var(--text-primary); }
.kit-device-sub { font-size: 9.5px; color: var(--text-secondary); margin-top: 2px; }

.kit-badge-refused {
    font-size: 9px; padding: 1px 5px; border-radius: 3px;
    background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.35);
}

.kit-badge-warn {
    font-size: 9px; padding: 1px 5px; border-radius: 3px;
    background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.35);
}

.kit-detail {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 46vh;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-header);
}

.kit-detail-head { display: flex; align-items: center; gap: 8px; }
.kit-detail-name { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 700; color: var(--text-primary); }
.kit-detail-sub { font-size: 10px; color: var(--text-secondary); margin: 4px 0 8px 0; line-height: 1.45; }

.kit-place-btn { margin-bottom: 10px; }
.kit-remove-btn { margin-top: 10px; }

.kit-refusal {
    padding: 8px 10px; margin-bottom: 10px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 10.5px; line-height: 1.5;
}
.kit-refusal strong { color: #f87171; }

.kit-param-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.kit-param-table th {
    text-align: left; color: var(--text-secondary); font-weight: 600;
    border-bottom: 1px solid var(--border-subtle); padding: 3px 6px;
}
.kit-param-table td { padding: 2px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.kit-param-k { font-family: 'JetBrains Mono', monospace; color: #38bdf8; }
.kit-param-v { font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.kit-param-note { color: var(--text-secondary); font-size: 9.5px; text-align: right; }
.kit-param-unapplied .kit-param-k,
.kit-param-unapplied .kit-param-v { opacity: 0.55; }
.kit-param-unapplied .kit-param-note { color: #f59e0b; }
.kit-param-input { height: 20px; font-size: 10.5px; padding: 1px 5px; }

.kit-meta-block { margin-top: 10px; font-size: 10.5px; color: var(--text-primary); line-height: 1.5; }
.kit-meta-block .kit-meta-k { display: block; color: var(--text-secondary); font-weight: 600; margin-bottom: 2px; }

.kit-warn-head { font-size: 10.5px; color: var(--text-secondary); margin-bottom: 4px; display: flex; gap: 10px; }
.kit-warn-list { margin: 0; padding-left: 16px; font-size: 10px; line-height: 1.55; }
.kit-warn-list code { font-family: 'JetBrains Mono', monospace; opacity: 0.8; }
.kit-warn-list em { font-style: normal; font-weight: 600; }

.kit-warnings, .kit-review {
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background-color: var(--bg-header);
    max-height: 46vh;
    overflow-y: auto;
}

.kit-build-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }

.kit-empty { padding: 12px; font-size: 10.5px; color: var(--text-secondary); line-height: 1.5; }
.kit-detail-hint { flex: 1 1 auto; padding: 12px; font-size: 10.5px; color: var(--text-secondary); }

/* ==========================================================================
/* ==========================================================================
   UI Friendliness & Apple Glass Modern Toast System
   ========================================================================== */

/* Toast Notifications Container */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    max-width: 360px;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(11, 18, 36, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 16px 40px -6px rgba(0, 0, 0, 0.7);
    font-size: 11.5px;
    line-height: 1.4;
    animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.2s ease;
}

.toast-item.toast-leaving {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-item.toast-success {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(6, 26, 20, 0.85);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 16px 40px -6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(16, 185, 129, 0.15);
}
.toast-item.toast-success .toast-icon { color: #10b981; }

.toast-item.toast-error {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(28, 11, 14, 0.85);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 16px 40px -6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(239, 68, 68, 0.15);
}
.toast-item.toast-error .toast-icon { color: #ef4444; }

.toast-item.toast-warning {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(28, 20, 7, 0.85);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 16px 40px -6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.15);
}
.toast-item.toast-warning .toast-icon { color: #f59e0b; }

.toast-item.toast-info {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(8, 22, 40, 0.85);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 16px 40px -6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.15);
}
.toast-item.toast-info .toast-icon { color: #38bdf8; }

.toast-icon {
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 11.5px;
    margin-bottom: 2px;
    color: #ffffff;
}

.toast-body {
    font-size: 11px;
    color: #cbd5e1;
}

.toast-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    margin-left: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.toast-close:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Pro EDA Context Menu - macOS Sequoia Glass Style
   ========================================================================== */
.eda-context-menu {
    position: fixed;
    z-index: 999999;
    min-width: 190px;
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 16px 40px -4px rgba(0, 0, 0, 0.7);
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: contextMenuPop 0.14s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contextMenuPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.eda-context-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 11.5px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    width: 100%;
}

.eda-context-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.eda-context-item.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.eda-context-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.eda-context-icon {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.eda-context-label {
    flex: 1;
    font-weight: 500;
}

.eda-context-hotkey {
    font-size: 9.5px;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
}

.eda-context-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* ==========================================================================
   Component Property Inspector HUD - Apple Glass Style
   ========================================================================== */
.component-inspector-hud {
    position: fixed;
    z-index: 9999;
    width: 260px;
    background: rgba(11, 18, 36, 0.85);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 16px 48px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: inspectorFadeIn 0.15s ease forwards;
}

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

.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #0d1527;
    border-bottom: 1px solid #1e293b;
}

.inspector-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f8fafc;
}

.inspector-type-badge {
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 1px 5px;
    border-radius: 3px;
}

.inspector-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.insp-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.insp-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.insp-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.inspector-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.inspector-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inspector-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.inspector-input-wrap {
    display: flex;
    align-items: center;
}

.inspector-input {
    width: 100%;
    background: #040711;
    border: 1px solid #1e293b;
    border-radius: 4px;
    color: #f8fafc;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 6px;
    outline: none;
    transition: border-color 0.15s ease;
}

.inspector-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Tier Badges, Upgrade & Share Modals (FluxEDA System)
   ========================================================================== */

.engine-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    cursor: default;
    user-select: none;
}

.engine-badge-btn.cpu-mode {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.btn-upgrade-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-upgrade-pro:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: #3b82f6;
    color: #93c5fd;
}

.btn-share-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #0f1523;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-share-link:hover {
    background: #182235;
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.modal-pricing-card {
    width: 960px !important;
    max-width: 95vw !important;
}

.pricing-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 860px) {
    .pricing-tier-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: #080c18;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 100%;
}

.pricing-card.featured {
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #f59e0b;
    color: #040711;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.pricing-header h3 {
    font-size: 16px;
    color: #f8fafc;
    margin-bottom: 4px;
}

.pricing-price {
    font-size: 24px;
    font-weight: 800;
    color: #38bdf8;
    margin: 10px 0;
}

.pricing-price span {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.pricing-features li {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pricing-features li span {
    color: #10b981;
    font-weight: bold;
}

/* ==========================================================================
   Global Command Palette (Spotlight / VS Code style Ctrl+K)
   ========================================================================== */

.command-palette-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 12vh;
    animation: fadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-palette-card {
    width: 640px;
    max-width: 92vw;
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(36px) saturate(200%);
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 24px 72px -8px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cmd-palette-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.5);
}

.cmd-palette-search-icon {
    font-size: 16px;
    color: #38bdf8;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

.cmd-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    font-size: 15px;
    color: #f8fafc;
}

.cmd-palette-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
    font-size: 13.5px;
}

.cmd-palette-hotkey-chip {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 7px;
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}

.cmd-palette-cat-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 12px 4px 12px;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.cmd-palette-item:hover,
.cmd-palette-item.selected {
    background: rgba(56, 189, 248, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.cmd-palette-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cmd-palette-icon {
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.cmd-palette-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.cmd-palette-item.selected .cmd-palette-title {
    color: #ffffff;
    font-weight: 600;
}

.cmd-palette-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmd-palette-badge {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}

.cmd-palette-type-tag {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cmd-palette-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 14, 28, 0.6);
    font-size: 10.5px;
    color: var(--text-muted);
}

/* ==========================================================================
   Floating Schematic Canvas Heads-Up Display (HUD) - VisionOS Glass Capsule
   ========================================================================== */

.schematic-floating-hud {
    position: absolute;
    top: 10px;
    left: 12px;
    right: auto;
    background: rgba(10, 16, 32, 0.82);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px -4px rgba(0, 0, 0, 0.65);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    z-index: 100;
    pointer-events: auto;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.hud-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hud-pill-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 4px;
    cursor: pointer;
}

.hud-pill-label:hover {
    color: var(--accent-blue);
}

.hud-info-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
}

.hud-badge-tag {
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 6px;
}

.hud-solver-badge {
    font-size: 10.5px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hud-solver-badge.live {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.hud-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.hud-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.hud-action-btn.active {
    background: rgba(14, 165, 233, 0.3);
    border-color: rgba(56, 189, 248, 0.55);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   Schematic Mini-Map Navigator Box - Apple Glass Style
   ========================================================================== */

.schematic-minimap-box {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 170px;
    background: rgba(9, 14, 28, 0.82);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 28px rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    overflow: hidden;
    z-index: 95;
    user-select: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.minimap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.minimap-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0 3px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.minimap-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.minimap-canvas-wrap {
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;
}

#schematicMiniMapCanvas {
    display: block;
    width: 158px;
    height: 98px;
    border-radius: 6px;
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Electrical Rule Check (ERC) Diagnostics Modal - Apple Glass Style
   ========================================================================== */

.erc-dialog-card {
    width: 600px;
    max-width: 90vw;
    background: rgba(10, 16, 32, 0.88);
    backdrop-filter: blur(36px) saturate(200%);
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 24px 72px -8px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.erc-issue-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    background: #090d16;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.erc-issue-icon {
    font-size: 14px;
    padding-top: 1px;
}

.erc-issue-content {
    flex: 1;
}

.erc-issue-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.erc-issue-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.erc-issue-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.erc-action-btn-sm {
    background: #0f1523;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.12s ease;
}

.erc-action-btn-sm:hover {
    background: #182235;
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* ==========================================================================
   Marker Control Bar for Cartesian S-Param & Scope Plots
   ========================================================================== */

.plot-marker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(10, 16, 30, 0.9);
    border-top: 1px solid rgba(30, 41, 59, 0.8);
    font-size: 11px;
    gap: 10px;
    flex-wrap: wrap;
}

.marker-pills-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.marker-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.marker-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.marker-toggle-btn.m1.active {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(56, 189, 248, 0.6);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(56, 189, 248, 0.2);
}

.marker-toggle-btn.m2.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
    color: #f59e0b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(245, 158, 11, 0.2);
}

.marker-search-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.marker-search-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.marker-search-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Small Screen & Laptop Viewport Ergonomics (1366x768 & Narrower)
   ========================================================================== */
@media (max-width: 1400px) {
    .preset-dropdown {
        width: 180px;
    }
    #shareModalBtn, #guideModalBtn, #feedbackModalBtn {
        padding: 0 6px;
        font-size: 10px;
    }
}

@media (max-width: 1200px) {
    .app-header {
        padding: 0 8px;
    }
    #shareModalBtn, #feedbackModalBtn {
        display: none;
    }
    .badge-version {
        display: none;
    }
    .workspace-view-switcher .view-switch-btn {
        padding: 0 6px;
        font-size: 10px;
    }
}

@media (max-height: 800px) {
    .sweep-bottom-card {
        height: 110px;
    }
    .floating-inspector {
        max-height: calc(100% - 20px);
    }
    .inspector-body {
        max-height: 260px;
    }
}

