/* MasterEye AR Mechanical Copilot Stylesheet */
:root {
    --bg-primary: #080c14;
    --bg-secondary: #0f172a;
    --bg-card: rgba(18, 26, 44, 0.85);
    --bg-card-hover: rgba(26, 38, 64, 0.95);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(245, 158, 11, 0.4);

    --hazard-red: #ef4444;
    --hazard-red-bg: rgba(239, 68, 68, 0.15);
    --hazard-amber: #f59e0b;
    --hazard-amber-bg: rgba(245, 158, 11, 0.15);
    --safety-green: #10b981;
    --safety-green-bg: rgba(16, 185, 129, 0.15);
    --hud-blue: #38bdf8;
    --hud-cyan: #00f0ff;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-amber: #fbbf24;

    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body.dark-mode {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.05) 0%, transparent 40%);
}

/* Header HUD - Single Clean Row */
.hud-header {
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Consolidated Second Bar Below Menu Bar */
.hud-sub-banner {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(20, 30, 55, 0.92) 50%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 90;
}

.sub-banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1680px;
    gap: 16px;
    text-align: center;
}

.sub-banner-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.sub-banner-truth-tag,
.viewport-truth-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.sub-banner-truth-tag .shield-icon,
.viewport-truth-tag .shield-icon {
    font-size: 11px;
    line-height: 1;
}

/* Engine Platform Selector Group (Clean container without outer oval enclosure) */
.engine-selector-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    flex-shrink: 1;
    min-width: 0;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-top-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
    position: relative;
    flex-shrink: 0;
}

.reticle-dot {
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 50%;
    border: 2px solid #fff;
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-title {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-amber);
    line-height: 1.1;
    margin: 0;
}

.brand-status-subline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.brand-subtitle {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.brand-subline-sep {
    color: rgba(255, 255, 255, 0.25);
    font-size: 8px;
}

.brand-safety-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1px 7px;
}

.brand-safety-tag .shield-icon {
    font-size: 10px;
}

.safety-status-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 8.5px;
}

.brand-safety-tag .status-value {
    font-size: 8.5px;
    letter-spacing: 0.3px;
}

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

.status-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.pulse-dot.active {
    background: var(--safety-green);
    box-shadow: 0 0 8px var(--safety-green);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-label {
    color: var(--text-muted);
    font-weight: 600;
}

.status-value {
    color: var(--text-primary);
    font-weight: 700;
}

.text-green { color: var(--safety-green); }
.text-amber { color: var(--hazard-amber); }
.text-red { color: var(--hazard-red); }

.icon-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    user-select: none;
}

.icon-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

/* Voice Button Active State (Cyan / Sky Blue) */
#toggle-voice-btn.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

#toggle-voice-btn.active:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Light Button Active State (Amber / Gold) */
#toggle-light-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

#toggle-light-btn.active:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.toggle-icon-svg {
    display: block;
    width: 15px;
    height: 15px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.icon-toggle-btn:hover .toggle-icon-svg {
    transform: scale(1.12);
}

/* Viewport Quick Actions next to Exploded View Slider */
.view-toggle-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 6px;
}

/* Workbench Container Layout */
.workbench-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    padding: 20px 24px;
    max-width: 1680px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

@media (max-width: 1150px) {
    .workbench-container {
        grid-template-columns: 1fr;
    }
}

/* Left: AR Viewport Section */
.ar-viewport-section {
    display: flex;
    flex-direction: column;
}

.viewport-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.viewport-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.viewport-controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.viewport-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-primary);
}

.live-rec-badge {
    background: var(--hazard-red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* X-Ray Cutaway Toolbar Button */
.viewport-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.xray-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid var(--hud-blue);
    color: var(--hud-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.xray-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.xray-btn.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(245, 158, 11, 0.3));
    border-color: var(--hud-cyan);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
    animation: pulseXray 2s infinite;
}

@keyframes pulseXray {
    0%, 100% { box-shadow: 0 0 12px rgba(0, 240, 255, 0.5); border-color: var(--hud-cyan); }
    50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.6); border-color: var(--hazard-amber); }
}

/* 3D Viewport Toolbar */
.viewport-3d-toolbar {
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.explosion-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

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

.slider-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.slider-val-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: var(--hazard-amber);
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.hud-slider {
    width: 180px;
    max-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #1e293b;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
}

.hud-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hazard-amber);
    box-shadow: 0 0 8px var(--hazard-amber);
    cursor: pointer;
    transition: transform 0.15s;
}

.hud-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

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

.preset-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 2px;
}

.cam-preset-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.cam-preset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.cam-preset-btn.active {
    background: var(--hazard-amber);
    color: #000;
    border-color: var(--hazard-amber);
}

.cam-preset-btn.reset-btn {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--hazard-red);
}

.cam-preset-btn.reset-btn:hover {
    background: var(--hazard-red);
    color: #fff;
}

/* AR Stage Container */
.ar-stage-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    min-height: 520px;
    background: #060910;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.webgl-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.webgl-viewport canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.webgl-viewport:active {
    cursor: grabbing;
}

/* AR Reticle Indicator */
.ar-reticle {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 20;
    transition: transform 0.05s linear;
    transform: translate(-50%, -50%);
}

.reticle-ring {
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(245, 158, 11, 0.5);
    border-radius: 50%;
    animation: rotateReticle 12s linear infinite;
}

@keyframes rotateReticle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.reticle-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--hazard-amber);
    border-style: solid;
}

.reticle-corner.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; }
.reticle-corner.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; }
.reticle-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.reticle-corner.bottom-right { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.reticle-center {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    top: calc(50% - 3px);
    left: calc(50% - 3px);
    box-shadow: 0 0 8px var(--hazard-amber);
}

.reticle-target-tag {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--hazard-amber);
    color: var(--hazard-amber);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Directional Clockwise RealityKit Arrow */
.ar-directional-indicator {
    position: absolute;
    z-index: 25;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transform: translate(-50%, -50%);
    transition: all 0.2s;
}

.rotational-arrow-container {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rotational-arrow-container.clockwise-anim {
    animation: rotateArrow 3s linear infinite;
}

@keyframes rotateArrow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ar-direction-badge {
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid #fff;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    white-space: nowrap;
}

.scanner-status-bar {
    background: rgba(15, 23, 42, 0.9);
    padding: 10px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.scan-beacon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hazard-amber);
    box-shadow: 0 0 10px var(--hazard-amber);
    animation: pulseGlow 1.5s infinite;
}

.orbit-hint-badge {
    margin-left: auto;
    font-size: 10px;
    color: var(--hud-blue);
    font-weight: 600;
}

/* Right: HUD Sidebar Section */
.hud-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hazard Card */
.hazard-card {
    background: var(--hazard-red-bg);
    border: 2px solid var(--hazard-red);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.25);
    animation: pulseBorder 1.8s infinite;
    display: none;
}

.hazard-card.active {
    display: block;
}

@keyframes pulseBorder {
    0%, 100% { border-color: var(--hazard-red); box-shadow: 0 0 24px rgba(239, 68, 68, 0.25); }
    50% { border-color: var(--hazard-amber); box-shadow: 0 0 32px rgba(245, 158, 11, 0.4); }
}

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

.hazard-icon {
    font-size: 24px;
}

.hazard-heading {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.hazard-subheading {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--hazard-amber);
}

.hazard-badge {
    margin-left: auto;
    background: var(--hazard-red);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
}

.hazard-direction-box {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.direction-symbol {
    font-size: 32px;
    color: var(--hazard-amber);
    font-weight: 900;
}

.direction-text strong {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--hazard-amber);
    display: block;
    margin-bottom: 4px;
}

.direction-text p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Fastener Specification Card */
.spec-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Part Number & Supersession Lineage Card */
.part-lineage-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid #3b82f6;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.part-oem-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oem-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-copy-oem-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hud-copy-oem-btn:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
    transform: scale(1.05);
}

.part-oem-badge {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: #60a5fa;
    letter-spacing: 0.5px;
}

.part-category-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.supersession-chain-row,
.cross-ref-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.chain-label,
.cross-label {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--text-muted);
    font-size: 10px;
    min-width: 65px;
}

.chain-pills,
.cross-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.chain-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chain-pill-current {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
    font-weight: 700;
}

.chain-arrow {
    font-size: 9px;
    color: var(--text-muted);
}

.cross-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

/* Fastener Specs Row */
.spec-fastener-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fastener-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.detail-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Reverse Thread Mandatory Confirmation Gate */
.reverse-gate-container {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: pulseBorder 2s infinite ease-in-out;
}

.gate-warning-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #fca5a5;
}

.reverse-gate-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.reverse-gate-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.55);
}

.reverse-gate-btn.confirmed {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    cursor: default;
}

.reverse-gate-btn.confirmed:hover {
    transform: none;
}

.spec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sequence-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: var(--hazard-amber);
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 4px;
}

.fastener-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.socket-callout {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spec-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.metric-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.metric-num {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 800;
    color: var(--hazard-amber);
    line-height: 1;
}

.metric-unit {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

.chemical-notice, .prompt-notice, .provenance-notice {
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.provenance-notice {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 11px;
}

.chemical-notice {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--hud-blue);
}

.prompt-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--text-amber);
}

.sequence-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    margin-top: 4px;
}

.hud-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hud-btn-primary {
    background: var(--hazard-amber);
    color: #000;
}

.hud-btn-primary:hover {
    background: #fbbf24;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.hud-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border-color);
}

.hud-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.hud-btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hud-btn-accent {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--hazard-amber);
    color: var(--hazard-amber);
}

.hud-btn-accent:hover {
    background: rgba(245, 158, 11, 0.3);
}

/* Embedded Fastener Sequence Roadmap (HUD Design #3) */
.embedded-sequence-roadmap {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.embedded-roadmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.embedded-roadmap-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.embedded-roadmap-title-group .roadmap-icon {
    font-size: 13px;
}

.embedded-roadmap-title-group .roadmap-title {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: 0.05em;
}

.roadmap-count-badge {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 2px 7px;
    border-radius: 4px;
}

.roadmap-quick-hint {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.embedded-roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.embedded-roadmap-list::-webkit-scrollbar {
    width: 4px;
}

.embedded-roadmap-list::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 2px;
}

.embedded-step-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.embedded-step-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.85);
    transform: translateX(2px);
}

.embedded-step-card.active {
    border-color: #00f0ff;
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.22), inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.embedded-step-card.completed {
    opacity: 0.85;
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(16, 185, 129, 0.25);
}

.embedded-step-card.reverse-step {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.embedded-step-card.reverse-step.active {
    border-color: #f59e0b;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.embedded-step-card.internal-step {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
}

.embedded-step-card.internal-step.active {
    border-color: #a855f7;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.embedded-step-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.embedded-step-num {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    flex-shrink: 0;
}

.embedded-step-card.active .embedded-step-num {
    background: #00f0ff;
    color: #000;
    border-color: #00f0ff;
    font-weight: 900;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.embedded-step-card.completed .embedded-step-num {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.embedded-step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.embedded-step-name {
    font-size: 12px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.embedded-step-meta {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.embedded-step-right {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.embedded-step-torque {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.embedded-torque-primary {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: 800;
    color: #fbbf24;
}

.embedded-torque-secondary {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    color: #94a3b8;
}

.embedded-step-badge {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.embedded-step-badge.status-active {
    background: rgba(0, 240, 255, 0.2);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.5);
    animation: status-pulse 1.8s infinite alternate;
}

@keyframes status-pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; box-shadow: 0 0 6px rgba(0, 240, 255, 0.4); }
}

.embedded-step-badge.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.embedded-step-badge.status-pending {
    background: rgba(255, 255, 255, 0.06);
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.embedded-step-badge.status-internal {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.45);
}

.embedded-roadmap-meta-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.roadmap-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
}

.roadmap-meta-item .meta-icon {
    font-size: 11px;
}

.roadmap-meta-item .meta-label {
    color: #64748b;
    font-weight: 700;
}

.roadmap-meta-item .meta-val {
    color: #cbd5e1;
    font-weight: 600;
}

/* Tribal Knowledge Card */
.tribal-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tribal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tribal-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tribal-title-group h4 {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.pin-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    border: 1px solid var(--hazard-amber);
    color: var(--hazard-amber);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.pin-btn:hover {
    background: var(--hazard-amber);
    color: #000;
}

.tribal-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.tribal-note-item {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--hazard-amber);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
}

.note-author {
    color: var(--text-amber);
    font-weight: 700;
}

.master-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--safety-green);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
}

.note-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Modal */
.modal-backdrop,
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.modal-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-input, .form-textarea {
    background: #090d16;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
}

.sample-slang-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.chip-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.slang-chip {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--hazard-amber);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.slang-chip:hover {
    background: var(--hazard-amber);
    color: #000;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Ground-Truth Spec Editor Specific Styling */
.spec-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-global-spec-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-blue);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.card-global-spec-btn:hover {
    background: var(--hud-blue);
    color: #000;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.edit-spec-btn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--text-amber);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.edit-spec-btn:hover {
    background: var(--hazard-amber);
    color: #000;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.modal-card-wide {
    max-width: 620px;
}

.modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-badge-source {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--hud-cyan);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.thread-direction-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.direction-option {
    cursor: pointer;
}

.direction-option input[type="radio"] {
    display: none;
}

.direction-card {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.direction-card .dir-icon {
    font-size: 20px;
    color: var(--text-secondary);
}

.direction-card .dir-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.direction-card .dir-info strong {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.direction-card .dir-info span {
    font-size: 10px;
    color: var(--text-muted);
}

.direction-option input[type="radio"]:checked + .direction-card {
    border-color: var(--hud-blue);
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.direction-option input[type="radio"]:checked + .direction-card .dir-icon {
    color: var(--hud-blue);
}

.direction-option input[type="radio"]:checked + .reverse-warning-card {
    border-color: var(--hazard-amber);
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.direction-option input[type="radio"]:checked + .reverse-warning-card .dir-icon {
    color: var(--hazard-amber);
}

.direction-option input[type="radio"]:checked + .reverse-warning-card .dir-info strong {
    color: var(--hazard-amber);
}

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

.form-row-3col {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 12px;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit .form-input {
    width: 100%;
    padding-right: 68px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

.input-with-unit .unit-badge {
    position: absolute;
    right: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.conversion-helper-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--hud-blue);
    margin-top: -8px;
    margin-bottom: 12px;
}

.form-select {
    background: #090d16;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    width: 100%;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--hud-blue);
}

/* ====================================================
   Global Fastener Specification Matrix Styles
   ==================================================== */

.global-spec-header-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: var(--text-amber);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.global-spec-header-btn:hover {
    background: var(--hazard-amber);
    color: #000;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    transform: translateY(-1px);
}

.modal-card.modal-card-matrix {
    max-width: 1540px !important;
    width: 96vw !important;
    max-height: 90vh !important;
    height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 16px 20px !important;
    gap: 10px !important;
    background: rgba(10, 15, 29, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(56, 189, 248, 0.12) !important;
    box-sizing: border-box !important;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.matrix-header-icon {
    font-size: 18px;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin: 0;
    color: #ffffff;
}

.modal-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 3px 0 0 0;
    line-height: 1.35;
}

.matrix-badge-oem {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 800;
    color: var(--hud-cyan);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.6px;
}

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

.matrix-print-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.matrix-print-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
    color: #fff;
}

/* KPI Summary Cards Banner */
.matrix-stats-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.matrix-stat-card {
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 40px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.matrix-stat-card:hover {
    border-color: var(--hud-blue);
}

.matrix-stat-card.stat-card-hazard {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stat-val-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.stat-num-hazard {
    color: var(--hazard-amber);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.stat-unit {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.stat-unit-hazard {
    color: var(--hazard-amber);
}

.stat-sub {
    display: none !important;
}

/* Matrix Toolbar & Filters */
.matrix-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
}

.matrix-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.matrix-search-input {
    width: 100%;
    padding: 6px 32px 6px 12px;
    font-size: 13px;
    font-family: var(--font-main);
    color: #ffffff;
    height: 34px;
    background: #070a12;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.matrix-search-input:focus {
    outline: none;
    border-color: var(--hud-blue);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.matrix-filter-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.matrix-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.matrix-filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 4px 12px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    height: 28px;
    display: inline-flex;
    align-items: center;
}

.matrix-filter-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.matrix-filter-chip.active {
    background: var(--hud-blue);
    color: #000;
    border-color: var(--hud-blue);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.matrix-filter-chip.chip-hazard.active {
    background: var(--hazard-amber);
    color: #000;
    border-color: var(--hazard-amber);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.matrix-filter-chip.chip-torque.active {
    background: #a855f7;
    color: #fff;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.matrix-filter-chip.chip-chem.active {
    background: #06b6d4;
    color: #000;
    border-color: #06b6d4;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.matrix-filter-chip.chip-multi.active {
    background: var(--safety-green);
    color: #000;
    border-color: var(--safety-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.matrix-comp-select {
    width: 220px;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 8px;
    height: 28px;
    border-radius: 5px;
    background: #070a12;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Scrollable Matrix Table */
.matrix-table-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #070a12;
}

.matrix-table {
    width: 100%;
    min-width: 1340px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
    table-layout: fixed;
}

#global-fasteners-table {
    min-width: 1320px;
}

#global-fasteners-table th:nth-child(1), #global-fasteners-table td:nth-child(1) { width: 13%; min-width: 140px; } /* Component */
#global-fasteners-table th:nth-child(2), #global-fasteners-table td:nth-child(2) { width: 15%; min-width: 170px; } /* Fastener */
#global-fasteners-table th:nth-child(3), #global-fasteners-table td:nth-child(3) { width: 9%; min-width: 110px; }  /* Direction */
#global-fasteners-table th:nth-child(4), #global-fasteners-table td:nth-child(4) { width: 7.5%; min-width: 90px; } /* Target Torque */
#global-fasteners-table th:nth-child(5), #global-fasteners-table td:nth-child(5) { width: 7%; min-width: 85px; }   /* Metric Limit */
#global-fasteners-table th:nth-child(6), #global-fasteners-table td:nth-child(6) { width: 7%; min-width: 85px; }   /* Pass / Stage */
#global-fasteners-table th:nth-child(7), #global-fasteners-table td:nth-child(7) { width: 9%; min-width: 115px; }  /* Socket Sizes */
#global-fasteners-table th:nth-child(8), #global-fasteners-table td:nth-child(8) { width: 9%; min-width: 115px; }  /* Chemical */
#global-fasteners-table th:nth-child(9), #global-fasteners-table td:nth-child(9) { width: 15.5%; min-width: 180px; }/* Safety & Gotcha */

#global-fasteners-table th:nth-child(10), #global-fasteners-table td:nth-child(10),
#global-fasteners-table th.th-actions, #global-fasteners-table td.td-actions { 
    position: sticky;
    right: 0;
    width: 205px; 
    min-width: 205px;
    max-width: 205px;
    text-align: center;
    overflow: visible;
    background: #090e1a;
    z-index: 5;
    box-shadow: -6px 0 16px rgba(0, 0, 0, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

#global-fasteners-table thead th.th-actions {
    z-index: 25;
    background: #0f172a;
}

#global-fasteners-table tbody tr:nth-child(even) td.td-actions {
    background: #0b1120;
}

#global-fasteners-table tbody tr:hover td.td-actions {
    background: #111d35;
}

#global-fasteners-table tbody tr.row-reverse-hazard td.td-actions {
    background: #141109;
}

#global-fasteners-table tbody tr.row-reverse-hazard:hover td.td-actions {
    background: #241a0c;
}

.matrix-table thead {
    position: sticky;
    top: 0;
    background: #0f172a;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.matrix-table th {
    padding: 10px 10px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.matrix-table th.th-actions {
    text-align: center;
}

.matrix-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    overflow: hidden;
    line-height: 1.4;
    font-size: 13px;
}

.matrix-table tbody tr {
    transition: background-color 0.12s;
}

.matrix-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.matrix-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.09);
}

.matrix-table tbody tr.row-reverse-hazard {
    background: rgba(245, 158, 11, 0.06);
}

.matrix-table tbody tr.row-reverse-hazard:hover {
    background: rgba(245, 158, 11, 0.14);
}

/* Badges & Text Elements in Cells */
.cell-component {
    display: flex;
    flex-direction: column;
    gap: 3px;
    white-space: normal;
}

.comp-badge {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    word-break: break-word;
}

.comp-oem {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
}

.cell-fastener {
    display: flex;
    flex-direction: column;
    gap: 3px;
    white-space: normal;
}

.fastener-label-text {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    word-break: break-word;
}

.fastener-seq-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #fbbf24;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.dir-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.dir-badge-standard {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.dir-badge-reverse {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
    animation: reversePulse 2s infinite;
}

@keyframes reversePulse {
    0%, 100% { box-shadow: 0 0 3px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.45); }
}

.torque-val-ftlbs {
    font-family: var(--font-mono);
    font-size: 14.5px;
    font-weight: 800;
    color: #f59e0b;
    white-space: nowrap;
}

.torque-val-ftlbs small {
    font-size: 10.5px;
    opacity: 0.85;
}

.torque-val-nm {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.torque-val-nm small {
    font-size: 10px;
    opacity: 0.85;
}

.pass-badge {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
    color: #e2e8f0;
    white-space: nowrap;
}

.socket-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.07);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.chem-tag {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #22d3ee;
    white-space: nowrap;
}

.cell-warning {
    font-size: 11.5px;
    color: #cbd5e1;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 52px;
}

.cell-warning.warning-hazard {
    color: #fbbf24;
    font-weight: 600;
}

.matrix-table td.td-actions {
    overflow: visible;
    padding: 6px 8px;
    text-align: center;
}

.cell-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    width: 100%;
}

.btn-locate-3d,
.btn-card-row,
.btn-edit-row {
    padding: 3px 6px;
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.2;
    box-sizing: border-box;
}

.btn-locate-3d {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-blue, #38bdf8);
}

.btn-locate-3d:hover {
    background: var(--hud-blue, #38bdf8);
    color: #000;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.btn-card-row {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.btn-card-row:hover {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.btn-edit-row {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--hazard-amber, #f59e0b);
}

.btn-edit-row:hover {
    background: var(--hazard-amber, #f59e0b);
    color: #000;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.matrix-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
    margin-top: 0px;
}

.matrix-footer-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #94a3b8;
}

.matrix-footer-info code {
    color: var(--hud-cyan);
    font-size: 11.5px;
}

.source-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--safety-green);
    box-shadow: 0 0 6px var(--safety-green);
}


/* Print Stylesheet for Printable Shop Torque Card */
@media print {
    body * {
        visibility: hidden;
    }
    #global-spec-modal, #global-spec-modal * {
        visibility: visible;
    }
    #global-spec-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: #fff !important;
        color: #000 !important;
        display: block !important;
        padding: 0;
        margin: 0;
    }
    .modal-card-matrix {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: #fff !important;
        color: #000 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 10px !important;
    }
    .matrix-toolbar, .modal-header-actions, .th-actions, .cell-actions, #close-global-matrix-btn {
        display: none !important;
    }
    .matrix-stat-card {
        background: #f8f9fa !important;
        border: 1px solid #ccc !important;
        color: #000 !important;
    }
    .stat-num {
        color: #000 !important;
    }
    .matrix-table {
        color: #000 !important;
        border: 1px solid #333 !important;
    }
    .matrix-table th {
        background: #eee !important;
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
    }
    .matrix-table td {
        border-bottom: 1px solid #ddd !important;
        color: #000 !important;
    }
}

/* OEM Workshop Manual Ingestion Modal Styles */
.ingest-header-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #c084fc;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.ingest-header-btn:hover {
    background: #a855f7;
    color: #fff;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.6);
    transform: translateY(-1px);
}

.ingest-icon {
    font-size: 13px;
}

.ingestion-modal-container {
    max-width: 920px;
    width: 95vw;
}

.badge-ingest {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.ingestion-stats-banner {
    margin-bottom: 16px;
}

.stat-card-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-num-green, .stat-unit-green {
    color: var(--safety-green) !important;
}

.ingestion-action-bar {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.ingestion-action-info {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ingestion-action-info .info-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c084fc;
    margin-top: 5px;
    flex-shrink: 0;
}

.ingestion-btn-group {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.batch-ingest-btn {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%) !important;
    border: 1px solid rgba(192, 132, 252, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4) !important;
}

.batch-ingest-btn:hover {
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.7) !important;
    transform: translateY(-1px);
}

.section-heading {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.manuals-list-section {
    margin-top: 14px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manuals-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.manuals-heading-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.manuals-heading-group .section-heading {
    margin: 0;
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.6px;
}

.manuals-count-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--hud-cyan);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

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

.manuals-search-box {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    gap: 8px;
    min-width: 280px;
}

.manuals-search-box .search-icon {
    font-size: 12px;
    opacity: 0.7;
}

.manuals-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    width: 100%;
}

.manuals-search-input::placeholder {
    color: var(--text-muted);
}

.batch-ingest-btn-compact {
    padding: 7px 14px;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.manuals-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.manuals-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

.manuals-table thead tr {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.manuals-table th {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.manuals-table th.th-actions {
    text-align: right;
}

.manuals-table tbody tr.manual-table-row {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.manuals-table tbody tr.manual-table-row:last-child {
    border-bottom: none;
}

.manuals-table tbody tr.manual-table-row:hover {
    background: rgba(30, 41, 59, 0.5);
}

.manuals-table tbody tr.manual-table-row.selected {
    background: rgba(14, 116, 144, 0.22) !important;
}

.manuals-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

.manual-doc-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.manual-doc-cell .manual-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.manual-doc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.manual-title-text {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.manual-filename-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 440px;
}

.benchmark-pill {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-cyan);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-left: 6px;
}

.cell-mono-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.cell-unit {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.manual-badge-protected {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.manual-badge-custom {
    display: inline-flex;
    align-items: center;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.table-action-btn-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.manual-action-btn {
    background: transparent;
    border: 1px solid var(--hud-blue);
    color: var(--hud-blue);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.manual-action-btn:hover {
    background: var(--hud-blue);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.manual-action-btn.action-selected {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.manual-delete-table-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.manual-delete-table-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.manuals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.manual-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.manual-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-1px);
}

.manual-card.manual-primary {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(14, 116, 144, 0.1);
}

.manual-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.manual-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.manual-meta-title {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.manual-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.manual-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.manual-badge-pages {
    background: rgba(56, 189, 248, 0.12);
    color: var(--hud-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.manual-badge-size {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.manual-badge-status {
    background: rgba(34, 197, 94, 0.12);
    color: var(--safety-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.manual-file-path {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    word-break: break-all;
}

.ingestion-console-section {
    background: #050811;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.console-header {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

.console-status {
    color: #c084fc;
}

.ingestion-console-output {
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.5;
    color: #38bdf8;
    max-height: 160px;
    overflow-y: auto;
    margin: 0;
    white-space: pre-wrap;
    background: #030712;
}

/* ==============================================================================
   ENGINE SELECTION DROPDOWN & PLATFORM COMPARISON STUDIO STYLES
   ============================================================================== */

.engine-dropdown-select {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--text-amber);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
    max-width: min(440px, 45vw);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.engine-dropdown-select:hover,
.engine-dropdown-select:focus {
    border-color: var(--text-amber);
    background: rgba(26, 38, 64, 0.95);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.engine-dropdown-select optgroup {
    background: #070d18;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.04em;
    padding: 6px 4px 4px 4px;
}

.engine-dropdown-select option {
    background: #0b1120;
    color: var(--text-primary);
    padding: 8px;
}

.engine-dropdown-select option.dropdown-action-option {
    background: #0f1f38;
    color: #38bdf8;
    font-weight: 700;
}

.compare-header-btn {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(192, 132, 252, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.compare-header-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(192, 132, 252, 0.35));
    border-color: var(--hud-cyan);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.badge-compare {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.2), rgba(56, 189, 248, 0.2));
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #c084fc;
}

/* Comparison Modal Layout */
.comparison-modal-container {
    max-width: 1400px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px;
    background: rgba(11, 17, 32, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
}

.comparison-stats-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

/* Engineering Summary Box */
.comparison-summary-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--text-amber);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.summary-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.summary-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: var(--text-amber);
    letter-spacing: 0.5px;
}

.summary-deltas-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    margin: 0;
    padding: 0;
}

.summary-deltas-list li {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
}

.summary-deltas-list li::before {
    content: "•";
    color: var(--hud-cyan);
    position: absolute;
    left: 4px;
    font-size: 14px;
}

/* Comparison Sections */
.comparison-section {
    margin-bottom: 24px;
}

.comparison-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.section-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Comparison Tables */
.comparison-matrix-table th,
.comparison-fasteners-table th {
    background: #090e1a;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
    white-space: nowrap;
}

.comparison-matrix-table td,
.comparison-fasteners-table td {
    padding: 9px 14px;
    font-size: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.spec-key-col {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--hud-cyan);
    background: rgba(15, 23, 42, 0.4);
    width: 220px;
    min-width: 200px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.th-engine-header {
    text-align: center !important;
    min-width: 200px;
}

.engine-header-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.engine-header-sub {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.load-engine-twin-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-cyan);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.load-engine-twin-btn:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: var(--hud-cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.load-engine-twin-btn.active-twin {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--safety-green);
    color: var(--safety-green);
    cursor: default;
}

/* Fastener Comparison Cells */
.fastener-spec-cell {
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1.4;
}

.spec-torque-val {
    font-weight: 800;
    color: var(--text-primary);
}

.spec-torque-nm {
    color: var(--text-muted);
    font-size: 9px;
}

.spec-socket-pill {
    display: inline-block;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.delta-badge-hazard {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--hazard-red);
    color: #fca5a5;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.delta-badge-high {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--hazard-amber);
    color: #fcd34d;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Unique Components Grid */
.unique-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.unique-comp-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s ease;
}

.unique-comp-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.unique-card-platform {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--hud-cyan);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.unique-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.unique-card-desc {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.unique-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.unique-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   Robotics 6-DoF Controller & Telemetry Studio Styles
   ========================================================================== */
.robotics-header-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.35));
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.robotics-header-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.5));
    border-color: #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.robot-plan-btn {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.robot-plan-btn:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.robotics-modal-card {
    max-width: 1240px;
    width: 95vw;
}

.robotics-header-icon {
    font-size: 24px;
}

.robotics-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: block;
    margin-top: 2px;
}

.robotics-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.robotics-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 18px;
}

.robotics-toolbar-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 8px 14px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.motor-sign-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.motor-sign-standard {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--hud-blue);
    color: #7dd3fc;
}

.motor-sign-reverse {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--hazard-amber);
    color: #fcd34d;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.atc-socket-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    background: rgba(147, 51, 234, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
    padding: 2px 7px;
    border-radius: 4px;
}

.status-badge-pass {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--hud-green);
    color: #6ee7b7;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-badge-fail {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--hazard-red);
    color: #fca5a5;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.coordinate-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   User Management, OAuth & Overflow Navigation Menu Styles
   ========================================================================== */

/* User Profile Button in Header */
.status-user {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(30, 58, 138, 0.25));
    border-color: rgba(56, 189, 248, 0.35);
    padding: 2px 8px 2px 4px;
}

.user-profile-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    height: 100%;
}

.user-avatar-mini {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    border-radius: 50% !important;
    background: #1e293b;
    border: 1.5px solid var(--hud-blue) !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.user-role-badge {
    background: var(--hazard-amber);
    color: #000;
    font-size: 8px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Overflow Menu Button in Header */
.status-menu {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
    border-color: rgba(245, 158, 11, 0.4);
    padding: 2px 8px;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--hazard-amber);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
}

.menu-toggle-btn:hover {
    color: #fff;
}

.menu-icon {
    font-size: 13px;
}

/* Slide-Over Workbench Navigation Menu Drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
    animation: fadeInBackdrop 0.25s ease-out;
}

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

.menu-drawer {
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: rgba(11, 17, 32, 0.98);
    border-left: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInDrawer 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDrawer {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
}

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

.drawer-logo-icon {
    font-size: 20px;
    color: var(--hazard-amber);
}

.drawer-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.8px;
    margin: 0;
}

.drawer-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.drawer-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.drawer-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--hazard-red);
    border-color: var(--hazard-red);
}

/* Drawer User Summary Card */
.drawer-user-card {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--hud-blue);
    background: #0f172a;
}

.drawer-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.drawer-user-role {
    font-size: 9px;
    font-weight: 800;
    color: var(--hazard-amber);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.drawer-user-org {
    font-size: 10px;
    color: var(--text-muted);
}

.drawer-auth-action-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--hud-cyan);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.drawer-auth-action-btn:hover {
    background: rgba(56, 189, 248, 0.3);
}

/* Drawer Menu Items List */
.drawer-sections-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    -webkit-overflow-scrolling: touch;
}

.drawer-section-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.drawer-menu-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-menu-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.drawer-menu-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateX(3px);
}

.drawer-menu-item .item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.drawer-menu-item .item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-menu-item .item-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-menu-item .item-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.drawer-menu-item.drawer-item-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--hazard-red);
}

.drawer-menu-item.drawer-item-danger .item-title {
    color: #fca5a5;
}

.drawer-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    text-align: center;
}

.drawer-version {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
}

/* Authentication Modal Styles */
.auth-modal-card {
    max-width: 480px;
    background: rgba(11, 17, 32, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.15);
}

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

.auth-modal-card .modal-header h3 {
    font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.2px;
    color: var(--text-primary, #f8fafc);
    margin: 0;
}

body.light-mode .auth-modal-card .modal-header h3 {
    color: #0f172a !important;
}

.auth-header-icon {
    font-size: 22px;
}

.auth-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.oauth-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.oauth-google-btn {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.oauth-google-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(66, 133, 244, 0.6);
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.25);
    transform: translateY(-1px);
}

.oauth-microsoft-btn {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.oauth-microsoft-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(5, 166, 240, 0.6);
    box-shadow: 0 4px 16px rgba(5, 166, 240, 0.25);
    transform: translateY(-1px);
}

.oauth-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider-text {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    gap: 8px;
}

.auth-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab-btn.active {
    color: var(--hazard-amber);
    border-bottom-color: var(--hazard-amber);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--hazard-red);
    color: #fca5a5;
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
}

.auth-offline-notice {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 6px;
    font-size: 10px;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

/* User Profile Modal */
.user-profile-card {
    max-width: 500px;
}

.profile-hero-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 16px;
}

.profile-modal-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--hud-blue);
    background: #090d16;
}

.profile-hero-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-hero-info h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin: 0;
}

.profile-pill-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.profile-provider-pill {
    font-size: 9px;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.profile-role-pill {
    font-size: 9px;
    font-weight: 800;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.profile-tier-pill {
    font-size: 9px;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.profile-modal-email {
    font-size: 11px;
    color: var(--text-secondary);
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   Monetization & Subscription Paywall Modal Styles
   -------------------------------------------------------------------------- */
.modal-card-subscription {
    max-width: 680px;
    width: 95%;
    background: #0b1120;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.1);
}

.sub-target-engine-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.12));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.sub-engine-lock-icon {
    font-size: 20px;
}

.sub-engine-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sub-engine-title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: var(--hazard-amber);
}

.sub-engine-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.sub-plans-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 14px;
    margin-bottom: 16px;
}

.sub-plan-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sub-plan-featured {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.sub-plan-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.sub-plan-badge.badge-popular {
    background: var(--hazard-amber);
    color: #000;
    border-color: var(--hazard-amber);
}

.sub-plan-title {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.sub-plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.price-num {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
}

.sub-plan-featured .price-num {
    color: var(--hud-cyan);
}

.price-term {
    font-size: 11px;
    color: var(--text-muted);
}

.sub-annual-discount {
    font-size: 10px;
    color: var(--hud-green);
    font-weight: 700;
    margin-bottom: 12px;
}

.sub-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
    flex: 1;
}

.sub-plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.sub-plan-features .check-icon {
    color: var(--hud-cyan);
    font-weight: 900;
}

.sub-plan-features .check-icon-pro {
    color: var(--hud-green);
    font-weight: 900;
}

.sub-plan-features .cross-icon {
    color: var(--text-muted);
}

.sub-plan-features .feat-disabled {
    color: var(--text-muted);
    opacity: 0.6;
}

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

.sub-btn-pro {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    justify-content: center;
}

.sub-btn-trial {
    width: 100%;
    padding: 8px;
    font-size: 10px;
    justify-content: center;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.sub-btn-free {
    width: 100%;
    padding: 8px;
    font-size: 11px;
    justify-content: center;
    margin-top: auto;
}

.sub-modal-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.sub-guarantee-text {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Drawer Toggle Switch Styles (Trial Mode Policy Bypass)
   -------------------------------------------------------------------------- */
.drawer-toggle-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 10px;
    color: var(--text-secondary);
}

.drawer-switch-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--hazard-red);
    color: #fca5a5;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.drawer-switch-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--hud-green);
    color: #6ee7b7;
}

.switch-knob {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}



/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Styles (iPhone, Android, iPad)
   ========================================================================== */

@media (max-width: 992px) {
    .hud-header {
        padding: 8px 14px;
        gap: 6px;
    }

    .hud-sub-banner {
        padding: 6px 14px;
    }

    .sub-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .sub-banner-text {
        font-size: 10px;
        line-height: 1.35;
    }

    .header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .header-top-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .brand {
        gap: 10px;
    }

    .brand-title {
        font-size: 18px;
    }

    .brand-subtitle {
        font-size: 8px;
    }

    .viewport-header {
        padding: 8px 12px;
        gap: 8px;
    }

    .viewport-controls-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
    }

    .status-pill {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 10px;
        padding: 4px 8px;
    }

    .engine-dropdown-select {
        max-width: 240px;
        font-size: 11px;
        padding: 3px 6px;
    }

    .workbench-container {
        grid-template-columns: 1fr;
        padding: 10px 12px;
        gap: 14px;
    }

    .ar-stage-container {
        min-height: 340px;
        height: 380px;
        aspect-ratio: auto;
    }

    .viewport-3d-toolbar {
        padding: 8px 12px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .explosion-control-group {
        width: 100%;
    }

    .viewport-actions-group {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .camera-presets-group {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        flex: 1;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .camera-presets-group::-webkit-scrollbar {
        display: none;
    }

    .cam-preset-btn {
        flex: 1;
        min-width: 52px;
        text-align: center;
        padding: 6px 4px;
        font-size: 10px;
    }
}

@media (max-width: 640px) {
    html, body.dark-mode, body.light-mode {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .hud-header {
        padding: 6px 10px;
        gap: 6px;
        position: relative; /* Avoid sticky header consuming too much mobile screen space */
        width: 100%;
        box-sizing: border-box;
    }

    .hud-sub-banner {
        padding: 5px 10px;
        text-align: center;
    }

    .sub-banner-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 4px;
        width: 100%;
    }

    .sub-banner-text {
        font-size: 8.5px;
        letter-spacing: 0.3px;
        line-height: 1.35;
        text-align: center;
    }

    .sub-banner-truth-tag {
        font-size: 8.5px;
        padding: 1px 6px;
    }

    .header-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .header-top-left {
        gap: 8px;
        min-width: 0;
    }

    .menu-toggle-btn {
        padding: 5px 8px;
        font-size: 10px;
        gap: 4px;
    }

    .brand {
        gap: 8px;
        min-width: 0;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }

    .brand-title {
        font-size: 15px;
        letter-spacing: 0.5px;
    }

    .brand-subtitle,
    .brand-subline-sep {
        display: none;
    }

    .header-top-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .hud-signup-btn {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }

    .theme-toggle-btn {
        padding: 4px 8px;
        border-radius: 16px;
    }

    #theme-toggle-label {
        display: none;
    }

    .status-user {
        padding: 3px 6px;
        gap: 4px;
    }

    #user-callsign-display,
    #user-role-badge {
        display: none;
    }

    .user-profile-btn {
        gap: 0;
        padding: 0;
    }

    .workbench-container {
        display: flex;
        flex-direction: column;
        padding: 6px 8px;
        gap: 10px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .ar-viewport-section,
    .hud-sidebar-section {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .viewport-card,
    .spec-card,
    .hazard-card,
    .tribal-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .ar-stage-container {
        min-height: 280px;
        height: 310px;
        aspect-ratio: auto;
        width: 100%;
        box-sizing: border-box;
    }

    .viewport-header {
        padding: 8px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .viewport-title {
        font-size: 11px;
    }

    .viewport-controls-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
    }

    .engine-selector-group {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }

    .engine-dropdown-select {
        flex: 1;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        font-size: 11px;
        padding: 4px 8px;
        box-sizing: border-box;
    }

    .viewport-truth-tag {
        align-self: flex-start;
        font-size: 9px;
        padding: 2px 7px;
        box-sizing: border-box;
    }

    /* Component Command Bar on Mobile */
    .component-command-bar {
        padding: 8px 10px;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .command-search-wrapper {
        flex: 1;
        min-width: 0;
    }

    .command-shortcut-hint {
        display: none;
    }

    .command-search-input {
        font-size: 12px;
        padding: 7px 28px 7px 32px;
        width: 100%;
        box-sizing: border-box;
    }

    .command-voice-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        flex-shrink: 0;
    }

    .command-card-quick-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        flex-shrink: 0;
        border-radius: 8px;
    }

    .command-card-quick-btn span:last-child {
        display: none;
    }

    /* 3D Viewport Controls Toolbar */
    .viewport-3d-toolbar {
        padding: 8px 10px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    .explosion-control-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
        box-sizing: border-box;
    }

    .hud-slider {
        flex: 1;
        min-width: 80px;
        max-width: 160px;
        width: auto;
    }

    .view-toggle-actions {
        margin-left: 0;
        gap: 6px;
        flex-shrink: 0;
    }

    .camera-presets-group {
        display: flex;
        align-items: center;
        gap: 3px;
        width: 100%;
        box-sizing: border-box;
    }

    .preset-label {
        font-size: 9px;
        margin-right: 1px;
        flex-shrink: 0;
    }

    .cam-preset-btn,
    .xray-btn {
        flex: 1;
        min-width: 0;
        padding: 5px 2px;
        font-size: 9px;
        text-align: center;
        justify-content: center;
        box-sizing: border-box;
        white-space: nowrap;
    }

    .xray-btn {
        gap: 2px;
    }

    /* 3D Scanner & Navigation Bar */
    .scanner-status-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    #scan-text {
        font-size: 10px;
        line-height: 1.3;
        word-break: break-word;
    }

    .orbit-hint-badge {
        margin-left: 0;
        font-size: 9px;
        color: var(--hud-blue);
    }

    /* Spec Card & Part Lineage */
    .spec-card {
        padding: 10px;
        gap: 10px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .part-lineage-card {
        padding: 8px 10px;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .part-lineage-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .part-oem-badge {
        font-size: 11px;
    }

    .supersession-chain-row,
    .cross-ref-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }

    .chain-label,
    .cross-label {
        font-size: 9px;
        min-width: 50px;
    }

    .chain-pills,
    .cross-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
    }

    .chain-pill,
    .cross-pill {
        font-size: 9px;
        padding: 2px 5px;
        max-width: 100%;
        word-break: break-word;
    }

    .spec-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .fastener-name {
        font-size: 15px;
    }

    /* 2x2 Grid for Spec Actions */
    .spec-actions-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .socket-callout,
    .card-component-dossier-btn,
    .card-global-spec-btn,
    .edit-spec-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 6px 4px;
        font-size: 10px;
        box-sizing: border-box;
    }

    .spec-fastener-details-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 8px;
        box-sizing: border-box;
    }

    .detail-label {
        font-size: 8px;
    }

    .detail-val {
        font-size: 11px;
    }

    .spec-metrics-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        box-sizing: border-box;
    }

    .metric-box {
        padding: 6px 2px;
        gap: 3px;
        text-align: center;
        align-items: center;
        box-sizing: border-box;
    }

    .metric-label {
        font-size: 8px;
    }

    .metric-num {
        font-size: 16px;
    }

    .metric-unit {
        font-size: 9px;
    }

    .provenance-notice,
    .chemical-notice,
    .prompt-notice {
        padding: 8px 10px;
        font-size: 10px;
        gap: 6px;
        box-sizing: border-box;
    }

    .sequence-controls {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        box-sizing: border-box;
    }

    .sequence-controls .hud-btn {
        padding: 8px 2px;
        font-size: 9.5px;
        min-height: 40px;
        box-sizing: border-box;
    }

    .tribal-card {
        padding: 10px;
        gap: 10px;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .tribal-title-group h4 {
        font-size: 11px;
    }

    .pin-btn {
        font-size: 10px;
        padding: 4px 6px;
    }

    /* Modals & sheets on mobile */
    .modal-backdrop,
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-card,
    .modal-card-wide,
    .modal-card-matrix,
    .comparison-modal-card,
    .comparison-modal-container,
    .robotics-modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 90vh !important;
        padding: 14px 12px !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-stats-bar,
    .matrix-stats-banner,
    .robotics-stats-bar {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .matrix-stat-card {
        padding: 8px !important;
    }

    .stat-num {
        font-size: 18px !important;
    }

    .summary-deltas-list {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    .matrix-filter-bar {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .matrix-filter-search {
        width: 100% !important;
        font-size: 14px !important;
    }

    .matrix-filter-pills {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        width: 100%;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .matrix-filter-pills::-webkit-scrollbar {
        display: none;
    }

    .matrix-pill {
        flex-shrink: 0;
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
}

/* ==========================================================================
   Custom Workshop Manual Upload & Privacy Sharing System
   ========================================================================== */

/* Top header buttons */
.icon-btn-highlight {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
}

.icon-btn-highlight:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35) 0%, rgba(59, 130, 246, 0.35) 100%) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

.status-share .icon-toggle-btn {
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
}

.status-share .icon-toggle-btn:hover {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

/* Upload Card in Ingestion Studio */
.manual-upload-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.6) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.manual-upload-header {
    margin-bottom: 14px;
}

.upload-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
}

.upload-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.upload-subbadge {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.upload-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: 0.02em;
}

.upload-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Dropzone */
/* Compact Dropzone */
.manual-dropzone {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px dashed rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 14px;
}

.manual-dropzone:hover,
.manual-dropzone.dragover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.dropzone-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.dropzone-left-col {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.dropzone-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.dropzone-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.dropzone-main-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--hud-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone-sub-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dropzone-browse-btn {
    pointer-events: auto !important;
    padding: 6px 14px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
}

.dropzone-browse-btn:hover {
    background: rgba(56, 189, 248, 0.28) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
    transform: translateY(-1px);
}

.dropzone-clear-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    white-space: nowrap;
}

.dropzone-repo-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(56, 189, 248, 0.2);
}

.repo-select-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.repo-quick-select {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.4;
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
}

@keyframes dropzone-pulse {
    0%, 100% { border-color: #f59e0b; box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
    50% { border-color: #fbbf24; box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
}

.manual-dropzone.dropzone-attention {
    animation: dropzone-pulse 0.8s ease-in-out infinite;
}

/* Manual Metadata Grid */
.manual-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.manual-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manual-input-group label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.manual-meta-input,
.manual-meta-select {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    padding: 7px 10px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.manual-meta-input:focus,
.manual-meta-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.manual-meta-input.field-autofilled {
    border-color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.12) !important;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.35) !important;
    color: #86efac !important;
    transition: all 0.35s ease;
}

.manual-upload-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.upload-status-indicator {
    font-size: 11px;
    font-family: var(--font-mono);
    color: #38bdf8;
}

/* Share Modal */
.share-modal-container {
    max-width: 580px;
    width: 92vw;
    background: #090e1a;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.share-modal-container .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    margin-bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.share-modal-container .modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin-top: 0;
    background: rgba(15, 23, 42, 0.75);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.modal-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-type-badge,
.modal-verified-badge,
.modal-badge-source {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.badge-share {
    background: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.4) !important;
}

.share-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-target-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-target-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
}

.share-target-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.share-target-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--hud-cyan);
    margin-left: auto;
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.visibility-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.visibility-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.visibility-option-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.05);
}

.visibility-option-card.selected {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.12);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.15);
}

.visibility-option-card input[type="radio"] {
    margin-top: 3px;
    accent-color: #c084fc;
}

.vis-option-content {
    flex: 1;
}

.vis-option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.vis-title-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.shared-emails-panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shared-emails-panel .input-field-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #c084fc;
}

.modal-text-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    padding: 8px 10px;
    outline: none;
    font-family: var(--font-mono);
}

.modal-text-input:focus {
    border-color: #c084fc;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.25);
}

.shared-recipients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.share-recipient-tag {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.share-system-notice {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    color: #7dd3fc;
    line-height: 1.4;
}

.share-status-message {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.share-status-message.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.share-status-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* ==========================================================================
   Engine Specification & Digital Twin Editor Modal
   ========================================================================== */
.editor-modal-container {
    max-width: 820px;
    width: 94vw;
    background: #090e1a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}

.editor-modal-container .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    margin-bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.editor-modal-container .modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin-top: 0;
    background: rgba(15, 23, 42, 0.75);
    border-top: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-edit {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
}

.editor-modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.editor-target-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.editor-target-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.editor-target-label {
    font-size: 10px;
    font-family: var(--font-mono);
    color: #38bdf8;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.editor-target-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.editor-target-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
}

.editor-switch-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 260px;
}

.editor-switch-group label {
    font-size: 10px;
    font-family: var(--font-mono);
    color: #94a3b8;
    font-weight: 600;
}

.editor-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-section-title {
    font-size: 11px;
    font-family: var(--font-mono);
    color: #38bdf8;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
}

.editor-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.editor-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.editor-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.editor-linked-manual-box {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-family: var(--font-mono);
}

.editor-linked-label {
    color: #94a3b8;
    font-weight: 600;
}

.editor-linked-val {
    color: #38bdf8;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-stat-pill {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.editor-stat-pill .stat-num {
    color: #38bdf8;
    font-size: 14px;
    font-weight: 700;
}

.editor-stat-pill .stat-txt {
    color: #94a3b8;
}

/* Danger Zone */
.editor-danger-zone {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.danger-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.danger-title {
    color: #f87171;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.danger-desc {
    font-size: 12px;
    color: #fca5a5;
    margin: 0;
    line-height: 1.4;
}

.danger-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #fca5a5;
    cursor: pointer;
    user-select: none;
}

.danger-checkbox-label input[type="checkbox"] {
    accent-color: #ef4444;
    cursor: pointer;
}

.editor-baseline-notice {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 11px;
    color: #7dd3fc;
}

.danger-confirm-card {
    background: rgba(220, 38, 38, 0.14);
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeIn 0.2s ease-out;
}

.danger-confirm-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.danger-confirm-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.danger-confirm-title {
    color: #fecaca;
    font-weight: 700;
    font-size: 13px;
}

.danger-confirm-desc {
    color: #fca5a5;
    font-size: 12px;
    line-height: 1.4;
}

.danger-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.hud-btn-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid #ef4444 !important;
    color: #fca5a5 !important;
    font-weight: 700 !important;
    padding: 9px 18px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.hud-btn-danger:hover {
    background: rgba(239, 68, 68, 0.4) !important;
    color: #fff !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.45) !important;
    transform: translateY(-1px) !important;
}

.editor-status-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.editor-status-message.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.editor-status-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Card Delete Button inside Ingestion Studio Manual Grid */
.manual-delete-card-btn {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.manual-delete-card-btn:hover {
    background: rgba(239, 68, 68, 0.5);
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
}

.manual-badge-protected {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: auto;
}

/* Ingestion Online Connectivity Guard Banner */
.ingest-network-guard-banner {
    border-radius: 8px;
    padding: 11px 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ingest-network-guard-banner.guard-online {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.22) 100%);
    border: 1px solid rgba(16, 185, 129, 0.45);
}

.ingest-network-guard-banner.guard-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(120, 53, 15, 0.22) 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.ingest-network-guard-banner.guard-offline {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(127, 29, 29, 0.28) 100%);
    border: 1px solid rgba(239, 68, 68, 0.55);
}

.network-guard-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-guard-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.network-guard-text strong {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: block;
    color: #f8fafc;
}

.ingest-network-guard-banner.guard-online .network-guard-text strong {
    color: #34d399;
}

.ingest-network-guard-banner.guard-warning .network-guard-text strong {
    color: #fbbf24;
}

.ingest-network-guard-banner.guard-offline .network-guard-text strong {
    color: #f87171;
}

.network-guard-text p {
    font-size: 11.5px;
    color: #94a3b8;
    margin: 2px 0 0 0;
    line-height: 1.4;
}

.dropzone-disabled {
    cursor: not-allowed !important;
    filter: grayscale(0.85);
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Gemini Multimodal Document Parser UI */
.gemini-status-card {
    background: linear-gradient(90deg, rgba(20, 25, 45, 0.85) 0%, rgba(30, 27, 75, 0.6) 100%);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.gemini-status-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gemini-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: #c084fc;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gemini-status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.gemini-config-btn {
    padding: 6px 12px !important;
    font-size: 11px !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
}

.gemini-config-btn:hover {
    border-color: #c084fc !important;
    color: #f3e8ff !important;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.3) !important;
}

.gemini-config-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    animation: fadeInSlide 0.2s ease forwards;
}

.gemini-config-inner {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gemini-config-feedback {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
}

/* ==========================================================================
   Component Command Bar (Quick Search, Voice Recognition & Card Invocation)
   ========================================================================== */
.component-command-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    z-index: 40;
}

.command-search-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.command-search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--hud-cyan, #38bdf8);
    pointer-events: none;
}

.command-search-input {
    width: 100%;
    padding: 8px 65px 8px 36px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    color: #f8fafc;
    font-family: var(--font-sans, sans-serif);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.command-search-input::-webkit-search-decoration,
.command-search-input::-webkit-search-cancel-button,
.command-search-input::-webkit-search-results-button,
.command-search-input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
}

.command-search-input:focus {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.command-clear-btn {
    position: absolute;
    right: 36px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

.command-clear-btn:hover {
    color: #f8fafc;
}

.command-shortcut-hint {
    position: absolute;
    right: 10px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    pointer-events: none;
}

.command-voice-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 8px;
    color: #fbbf24;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.command-voice-btn:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.command-voice-btn.listening {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
    animation: voice-pulse 1s infinite alternate;
}

@keyframes voice-pulse {
    0% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: 0 0 18px rgba(239, 68, 68, 0.8); }
}

.mic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mic-svg-icon {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.command-voice-btn:hover .mic-svg-icon {
    transform: scale(1.15);
}

.command-voice-btn.listening .mic-svg-icon {
    animation: mic-listening-pulse 0.6s infinite alternate ease-in-out;
}

@keyframes mic-listening-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.25); }
}

.command-card-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    color: #38bdf8;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.command-card-quick-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

/* Autocomplete Dropdown */
.component-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    padding: 6px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.search-res-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.search-res-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.search-res-meta {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-res-badge {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.search-res-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-res-dossier-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.search-res-dossier-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #fff;
    transform: scale(1.05);
}

.search-no-results {
    padding: 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ==========================================================================
   Component Card Modal (Interactive Component Dossier)
   ========================================================================== */
.component-card-modal-dialog {
    max-width: 820px !important;
    width: 92% !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #090e17 0%, #0f172a 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85) !important;
    border-radius: 14px;
    overflow: hidden;
}

.component-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 24px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.comp-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comp-badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comp-category-tag {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.comp-status-tag {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 2px 7px;
    border-radius: 4px;
}

.comp-interval-tag {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 7px;
    border-radius: 4px;
}

.comp-card-title {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    margin: 2px 0 0 0;
    letter-spacing: 0.02em;
}

.comp-engine-platform {
    font-size: 11px;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
}

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

.card-speak-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11px;
}

.component-card-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Safety & Reverse Thread Hazard Alert */
.card-hazard-banner {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 10px;
    animation: hazard-banner-glow 1.5s infinite alternate;
}

@keyframes hazard-banner-glow {
    0% { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 6px rgba(239, 68, 68, 0.2); }
    100% { border-color: rgba(239, 68, 68, 0.8); box-shadow: 0 0 16px rgba(239, 68, 68, 0.5); }
}

.hazard-alert-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.hazard-alert-content strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #fca5a5;
    margin-bottom: 2px;
}

.hazard-alert-content p {
    margin: 0;
    font-size: 11px;
    color: #fecaca;
    line-height: 1.4;
}

/* Part Dossier Section */
.card-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
}

.dossier-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 14px;
    margin-bottom: 12px;
}

.dossier-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dossier-label {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.dossier-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dossier-code {
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.04em;
}

.copy-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 10px;
    cursor: pointer;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: #38bdf8;
    color: #0f172a;
}

.citation-text {
    font-size: 11px;
    color: #cbd5e1;
    font-style: italic;
    line-height: 1.4;
}

.lineage-flow-row,
.cross-ref-flow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.flow-label {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.flow-pills,
.cross-pills-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Fastener Sequence Roadmap */
.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.05em;
}

.fastener-count-badge {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.fastener-sequence-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sequence-step-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sequence-step-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.sequence-step-card.reverse-step {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.step-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-num-badge {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-card-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-label {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.step-sublabel {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: #94a3b8;
}

.step-card-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-torque-block {
    text-align: right;
}

.step-torque-primary {
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    font-weight: 800;
    color: #34d399;
}

.step-torque-secondary {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: #94a3b8;
}

.step-socket-badge {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #e2e8f0;
    white-space: nowrap;
}

.sequence-meta-bar {
    display: flex;
    gap: 18px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.meta-label {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
}

.meta-val {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
}

/* Tribal Notes Section */
.card-add-gotcha-btn {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.card-add-gotcha-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

.card-tribal-note-item {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-left: 3px solid #c084fc;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 6px;
}

.card-note-author {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 2px;
}

.card-note-text {
    font-size: 11px;
    color: #e2e8f0;
    line-height: 1.4;
}

/* Modal Footer Actions */
.component-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.footer-actions-left,
.footer-actions-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.card-component-dossier-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 4px;
    color: #38bdf8;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-component-dossier-btn:hover {
    background: rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Voice Command Live Overlay / Listening Feedback
   ========================================================================== */
.voice-command-overlay {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(245, 158, 11, 0.3);
    border-radius: 30px;
    padding: 10px 20px;
    z-index: 9999;
    animation: fadeInSlide 0.25s ease forwards;
}

.voice-overlay-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.voice-anim-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 18px;
}

.v-bar {
    width: 3px;
    height: 8px;
    background: #f59e0b;
    border-radius: 2px;
    animation: v-bar-bounce 0.8s ease-in-out infinite alternate;
}

.v-bar:nth-child(2) { animation-delay: 0.15s; height: 14px; }
.v-bar:nth-child(3) { animation-delay: 0.3s; height: 18px; }
.v-bar:nth-child(4) { animation-delay: 0.45s; height: 12px; }
.v-bar:nth-child(5) { animation-delay: 0.6s; height: 6px; }

@keyframes v-bar-bounce {
    0% { transform: scaleY(0.4); background: #f59e0b; }
    100% { transform: scaleY(1.3); background: #ef4444; }
}

.voice-overlay-status {
    font-family: var(--font-sans, sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: #fbbf24;
}

.voice-overlay-transcript {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    color: #e2e8f0;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-cancel-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.voice-cancel-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   THEME TOGGLE BUTTON & SMOOTH TRANSITIONS
   ========================================================================== */
body, .hud-header, .hud-sub-banner, .viewport-card, .spec-card, .modal-card, .menu-drawer {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #f8fafc;
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   DAILY LIGHT MODE (DAYLIGHT / WORKSHOP HIGH-CONTRAST THEME)
   ========================================================================== */
body.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-glow: rgba(217, 119, 6, 0.2);

    --hazard-red: #dc2626;
    --hazard-red-bg: #fee2e2;
    --hazard-amber: #d97706;
    --hazard-amber-bg: #fef3c7;
    --safety-green: #059669;
    --safety-green-bg: #d1fae5;
    --hud-blue: #0284c7;
    --hud-cyan: #0891b2;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-amber: #b45309;

    background-color: #ffffff;
    color: var(--text-primary);
    background-image: none;
}

/* Header & Banner in Light Mode */
body.light-mode .hud-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.light-mode .brand-title {
    color: #0f172a;
}

body.light-mode .hud-sub-banner {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
}

body.light-mode .sub-banner-text {
    color: #475569;
}

body.light-mode .sub-banner-truth-tag,
body.light-mode .viewport-truth-tag {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

body.light-mode .status-value.text-green {
    color: #059669;
}

body.light-mode .user-profile-btn {
    color: #0f172a;
}

body.light-mode .user-role-badge {
    background: #0284c7;
    color: #ffffff;
}

/* Status Pills & Controls in Light Mode */
body.light-mode .theme-toggle-btn {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.9);
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-mode .theme-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

body.light-mode .status-pill {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-mode .status-label {
    color: #64748b;
}

body.light-mode .engine-dropdown-select {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(203, 213, 225, 0.85);
}

body.light-mode .engine-dropdown-select option {
    background: #ffffff;
    color: #0f172a;
}

body.light-mode .icon-toggle-btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

body.light-mode .icon-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

body.light-mode #toggle-voice-btn.active {
    background: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.5);
    color: #0284c7;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.18);
}

body.light-mode #toggle-voice-btn.active:hover {
    background: rgba(2, 132, 199, 0.2);
    border-color: #0284c7;
}

body.light-mode #toggle-light-btn.active {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.5);
    color: #d97706;
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.18);
}

body.light-mode #toggle-light-btn.active:hover {
    background: rgba(217, 119, 6, 0.2);
    border-color: #d97706;
}

body.light-mode .menu-toggle-btn {
    color: #0f172a;
    background: #ffffff;
}

/* 3D Viewport Card & Stage in Light Mode */
body.light-mode .viewport-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

body.light-mode .viewport-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

body.light-mode .ar-stage-container {
    background: #ffffff;
}

body.light-mode .scanner-status-bar {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    color: #475569;
}

body.light-mode .viewport-3d-toolbar {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

body.light-mode .slider-label {
    color: #64748b;
}

body.light-mode .slider-val-badge {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

body.light-mode .hud-slider {
    background: #cbd5e1;
}

body.light-mode .preset-label {
    color: #64748b;
}

body.light-mode .cam-preset-btn {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.light-mode .cam-preset-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.light-mode .cam-preset-btn.active {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

body.light-mode .xray-btn {
    background: #ffffff;
    color: #0284c7;
    border: 1px solid #cbd5e1;
}

body.light-mode .xray-btn:hover {
    background: #e0f2fe;
}

/* Component Command Bar in Light Mode */
body.light-mode .component-command-bar {
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

body.light-mode .command-search-input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

body.light-mode .command-search-input::placeholder {
    color: #94a3b8;
}

body.light-mode .command-search-icon {
    color: #64748b;
}

body.light-mode .command-shortcut-hint {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

body.light-mode .command-voice-btn {
    background: #ffffff;
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.4);
}

body.light-mode .command-card-quick-btn {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.light-mode .component-search-dropdown {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.light-mode .search-result-item {
    border-bottom: 1px solid #f1f5f9;
}

body.light-mode .search-result-item:hover {
    background: #f1f5f9;
}

body.light-mode .search-item-name {
    color: #0f172a;
}

body.light-mode .search-item-oem {
    color: #64748b;
}

/* Right HUD Sidebar in Light Mode (Pure White Surfaces & Semantic Text Colors) */
body.light-mode .spec-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

/* Part Lineage & OEM Number Header */
body.light-mode .part-lineage-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

body.light-mode .part-oem-badge {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0284c7 !important;
    font-weight: 700 !important;
}

body.light-mode .part-category-badge {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

body.light-mode .chain-label,
body.light-mode .cross-label {
    color: #64748b !important;
}

body.light-mode .chain-pill {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light-mode .chain-pill.chain-pill-current {
    background: #ffffff !important;
    border: 1px solid #bbf7d0 !important;
    color: #16a34a !important;
}

body.light-mode .chain-arrow {
    color: #cbd5e1 !important;
}

body.light-mode .cross-pill {
    background: #ffffff !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

/* Spec Header, Fastener Name & Action Buttons */
body.light-mode .spec-header {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-mode .sequence-badge {
    background: #ffffff !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

body.light-mode .fastener-name {
    color: #0f172a !important;
}

body.light-mode .socket-callout {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-mode .card-component-dossier-btn,
body.light-mode .card-global-spec-btn,
body.light-mode .edit-spec-btn,
body.light-mode .hud-copy-oem-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .card-component-dossier-btn:hover,
body.light-mode .card-global-spec-btn:hover,
body.light-mode .edit-spec-btn:hover,
body.light-mode .hud-copy-oem-btn:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Thread Specs & Tooling Dimensions Grid (Pure White, No Grey Box) */
body.light-mode .spec-fastener-details-row {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .detail-label {
    color: #64748b !important;
}

body.light-mode .detail-val {
    color: #0f172a !important;
}

/* Metric Readout Cards (Pure White Backgrounds, Text Color Indicates Data Type) */
body.light-mode .metric-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02) !important;
}

body.light-mode .metric-label {
    color: #64748b !important;
}

body.light-mode .metric-unit {
    color: #94a3b8 !important;
}

/* Target Torque in FT-LBS: Amber Text on White indicates target torque */
body.light-mode .metric-box.torque-ftlbs .metric-num {
    color: #d97706 !important;
}

/* Metric Limit in NM: Technical Blue Text on White indicates metric conversion */
body.light-mode .metric-box.torque-nm .metric-num {
    color: #0284c7 !important;
}

/* Tightening Pass: Primary Slate Text on White */
body.light-mode .metric-box.stage-box .metric-num {
    color: #0f172a !important;
}

/* Notices: Pure White Background with Semantic Border Accent & Text Colors */
body.light-mode .provenance-notice {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #16a34a !important;
    color: #16a34a !important;
}

body.light-mode .provenance-notice strong {
    color: #15803d !important;
}

body.light-mode .chemical-notice {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #0284c7 !important;
    color: #0284c7 !important;
}

body.light-mode .prompt-notice {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #f59e0b !important;
    color: #334155 !important;
}

body.light-mode .prompt-notice strong {
    color: #b45309 !important;
}

/* Sequence Controls (Buttons) */
body.light-mode .sequence-controls .hud-btn-primary {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25) !important;
}

body.light-mode .sequence-controls .hud-btn-primary:hover {
    background: #b45309 !important;
}

body.light-mode .sequence-controls .hud-btn-secondary {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .sequence-controls .hud-btn-secondary:hover:not(:disabled) {
    background: #f8fafc !important;
    color: #0f172a !important;
}

body.light-mode .sequence-controls .hud-btn-secondary:disabled {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #cbd5e1 !important;
}

body.light-mode .sequence-controls .hud-btn-accent {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #b45309 !important;
}

body.light-mode .sequence-controls .hud-btn-accent:hover {
    background: #f8fafc !important;
    border-color: #b45309 !important;
}

/* Embedded Fastener Sequence Roadmap (Pure White Container & Cards) */
body.light-mode .embedded-sequence-roadmap {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

body.light-mode .embedded-roadmap-header {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-mode .embedded-roadmap-title-group .roadmap-title {
    color: #0f172a !important;
}

body.light-mode .roadmap-count-badge {
    background: #ffffff !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
}

body.light-mode .roadmap-quick-hint {
    color: #94a3b8 !important;
}

body.light-mode .embedded-step-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

body.light-mode .embedded-step-card:hover {
    background: #fafafa !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .embedded-step-card.active {
    background: #ffffff !important;
    border: 2px solid #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08) !important;
}

body.light-mode .embedded-step-card.completed {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    opacity: 0.9 !important;
}

body.light-mode .embedded-step-card.reverse-step {
    background: #ffffff !important;
    border: 1px solid #fde68a !important;
    border-left: 3px solid #f59e0b !important;
}

body.light-mode .embedded-step-num {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0284c7 !important;
}

body.light-mode .embedded-step-card.active .embedded-step-num {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

body.light-mode .embedded-step-card.completed .embedded-step-num {
    background: #ffffff !important;
    border-color: #86efac !important;
    color: #16a34a !important;
}

body.light-mode .embedded-step-name {
    color: #0f172a !important;
}

body.light-mode .embedded-step-meta {
    color: #64748b !important;
}

body.light-mode .embedded-torque-primary {
    color: #d97706 !important;
}

body.light-mode .embedded-torque-secondary {
    color: #64748b !important;
}

body.light-mode .embedded-step-badge.status-active {
    background: #ffffff !important;
    border: 1px solid #7dd3fc !important;
    color: #0284c7 !important;
}

body.light-mode .embedded-step-badge.status-done {
    background: #ffffff !important;
    border: 1px solid #86efac !important;
    color: #16a34a !important;
}

body.light-mode .embedded-step-badge.status-pending {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #94a3b8 !important;
}

body.light-mode .embedded-roadmap-meta-bar {
    border-top: 1px solid #f1f5f9 !important;
}

body.light-mode .roadmap-meta-item .meta-label {
    color: #64748b !important;
}

body.light-mode .roadmap-meta-item .meta-val {
    color: #0f172a !important;
}

/* Master Tech Tribal Knowledge Twin (Pure White Container & Cards) */
body.light-mode .tribal-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .tribal-title-group h4 {
    color: #0f172a !important;
}

body.light-mode .pin-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #b45309 !important;
}

body.light-mode .pin-btn:hover {
    background: #fafafa !important;
    border-color: #b45309 !important;
}

body.light-mode .tribal-note-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #f59e0b !important;
}

body.light-mode .note-author {
    color: #b45309 !important;
}

body.light-mode .master-badge {
    background: #ffffff !important;
    border: 1px solid #86efac !important;
    color: #16a34a !important;
}

body.light-mode .note-text {
    color: #1e293b !important;
}

body.light-mode .tag-pill {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

/* Hazard Card in Light Mode */
body.light-mode .hazard-card {
    background: #ffffff !important;
    border: 1px solid #fca5a5 !important;
    border-left: 4px solid #dc2626 !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.06) !important;
}

body.light-mode .hazard-heading {
    color: #dc2626 !important;
}

body.light-mode .hazard-subheading {
    color: #991b1b !important;
}

body.light-mode .hazard-badge {
    background: #ffffff !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
}

body.light-mode .hazard-direction-box {
    background: #ffffff !important;
    border: 1px solid #fde68a !important;
    border-left: 3px solid #f59e0b !important;
}

body.light-mode .direction-symbol {
    color: #d97706 !important;
}

body.light-mode .direction-text strong {
    color: #b45309 !important;
}

body.light-mode .direction-text p {
    color: #475569 !important;
}

/* Navigation Drawer in Light Mode */
body.light-mode .menu-drawer {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.08);
}

body.light-mode .drawer-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.light-mode .drawer-title {
    color: #0f172a;
}

body.light-mode .drawer-subtitle {
    color: #64748b;
}

body.light-mode .drawer-user-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-mode .drawer-user-name {
    color: #0f172a;
}

body.light-mode .drawer-menu-item {
    background: transparent;
    color: #334155;
}

body.light-mode .drawer-menu-item:hover {
    background: #f1f5f9;
    color: #0284c7;
}

body.light-mode .item-title {
    color: #0f172a;
}

body.light-mode .item-desc {
    color: #64748b;
}

body.light-mode .drawer-section-title {
    color: #64748b;
}

body.light-mode .drawer-toggle-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-mode .toggle-title {
    color: #0f172a;
}

body.light-mode .toggle-desc {
    color: #64748b;
}

/* Universal Modal Backdrops in Light Mode */
body.light-mode .modal-backdrop,
body.light-mode .modal-overlay,
body.light-mode .drawer-backdrop {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(8px) !important;
}

/* Universal Modal Dialog Containers */
body.light-mode .modal-card,
body.light-mode .modal-card-wide,
body.light-mode .modal-card-matrix,
body.light-mode .comparison-modal-card,
body.light-mode .robotics-modal-card,
body.light-mode .ingestion-modal-container,
body.light-mode .editor-modal-container,
body.light-mode .share-modal-container,
body.light-mode .comparison-modal-container,
body.light-mode .component-card-modal-dialog,
body.light-mode .auth-modal-card,
body.light-mode .user-profile-card,
body.light-mode .modal-card-subscription {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

/* Universal Modal Headers & Footers in Light Mode */
body.light-mode .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-mode .modal-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light-mode .modal-container,
body.light-mode .share-modal-container,
body.light-mode .editor-modal-container {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18), 0 0 35px rgba(2, 132, 199, 0.08) !important;
}

body.light-mode .modal-container .modal-header,
body.light-mode .share-modal-container .modal-header,
body.light-mode .editor-modal-container .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 20px 24px !important;
    margin-bottom: 0 !important;
}

body.light-mode .modal-container .modal-footer,
body.light-mode .share-modal-container .modal-footer,
body.light-mode .editor-modal-container .modal-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 16px 24px !important;
    margin-top: 0 !important;
}

body.light-mode .modal-header-actions .modal-close-btn,
body.light-mode .modal-header .modal-close-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    font-size: 18px !important;
    padding: 6px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

body.light-mode .modal-header-actions .modal-close-btn:hover,
body.light-mode .modal-header .modal-close-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode .modal-title,
body.light-mode .modal-header h2,
body.light-mode .modal-header h3 {
    color: #0f172a !important;
}

body.light-mode .modal-subtitle {
    color: #64748b !important;
}

body.light-mode .modal-desc {
    color: #475569 !important;
}

body.light-mode .modal-type-badge,
body.light-mode .modal-verified-badge,
body.light-mode .modal-badge-source {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .badge-share {
    background: rgba(168, 85, 247, 0.08) !important;
    color: #9333ea !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

body.light-mode .badge-compare {
    background: rgba(147, 51, 234, 0.08) !important;
    color: #7e22ce !important;
    border: 1px solid rgba(147, 51, 234, 0.3) !important;
}

body.light-mode .badge-edit {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .share-system-notice {
    background: #ffffff !important;
    border: 1px solid #bae6fd !important;
    border-left: 3px solid #0284c7 !important;
    color: #0369a1 !important;
}

body.light-mode .form-input,
body.light-mode .form-select,
body.light-mode .form-textarea,
body.light-mode .modal-text-input,
body.light-mode .manual-meta-input,
body.light-mode .manual-meta-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .form-input:focus,
body.light-mode .form-select:focus,
body.light-mode .form-textarea:focus,
body.light-mode .modal-text-input:focus,
body.light-mode .manual-meta-input:focus,
body.light-mode .manual-meta-select:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

body.light-mode .form-group label,
body.light-mode .manual-input-group label {
    color: #475569 !important;
}

body.light-mode .hud-btn-secondary {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-mode .hud-btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-mode .hud-btn-primary {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25) !important;
}

body.light-mode .hud-btn-primary:hover:not(:disabled) {
    background: #b45309 !important;
}

body.light-mode .hud-btn-primary:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

body.light-mode .hud-btn-ghost {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

body.light-mode .hud-btn-ghost:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode .hud-btn-danger {
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
}

body.light-mode .hud-btn-danger:hover {
    background: #fecaca !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2) !important;
}

body.light-mode .matrix-stat-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-mode .stat-label {
    color: #64748b !important;
}

body.light-mode .stat-num {
    color: #0f172a !important;
}

body.light-mode .matrix-toolbar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .matrix-search-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .matrix-filter-chip {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .matrix-filter-chip.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

body.light-mode .matrix-comp-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .matrix-table-wrapper {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .matrix-table thead {
    background: #f1f5f9 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .matrix-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

body.light-mode .matrix-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .matrix-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
}

body.light-mode .matrix-table tbody tr:hover {
    background: #e0f2fe !important;
}

body.light-mode #global-fasteners-table th.th-actions {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    border-left: 1px solid #cbd5e1 !important;
}

body.light-mode #global-fasteners-table td.td-actions {
    background: #ffffff !important;
    border-left: 1px solid #cbd5e1 !important;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode #global-fasteners-table tbody tr:nth-child(even) td.td-actions {
    background: #f8fafc !important;
}

body.light-mode #global-fasteners-table tbody tr:hover td.td-actions {
    background: #e0f2fe !important;
}

body.light-mode .comp-badge {
    color: #0f172a !important;
}

body.light-mode .fastener-label-text {
    color: #0f172a !important;
}

body.light-mode .socket-pill {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .pass-badge {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .cell-warning {
    color: #475569 !important;
}

body.light-mode .matrix-print-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .matrix-print-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

body.light-mode .modal-close-btn {
    color: #64748b !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .modal-close-btn:hover {
    color: #0f172a !important;
    background: #e2e8f0 !important;
}

body.light-mode .drawer-close-btn {
    color: #64748b !important;
}

body.light-mode .drawer-close-btn:hover {
    color: #0f172a !important;
}

body.light-mode .form-input,
body.light-mode .form-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .matrix-badge-oem {
    background: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .matrix-footer-info {
    color: #64748b !important;
}

body.light-mode .matrix-footer-info code {
    color: #0284c7 !important;
}

/* --------------------------------------------------------------------------
   1. Workshop Manual Ingestion Studio Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .ingestion-action-bar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .ingestion-action-info {
    color: #334155 !important;
}

body.light-mode .gemini-status-card {
    background: #fdf4ff !important;
    border: 1px solid #f0abfc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .gemini-badge {
    color: #7e22ce !important;
    background: rgba(168, 85, 247, 0.12) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

body.light-mode .gemini-status-text {
    color: #475569 !important;
}

body.light-mode .gemini-config-panel {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

body.light-mode .section-heading {
    color: #334155 !important;
}

/* Light Mode Overrides for OEM Manuals Table */
body.light-mode .manuals-table-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .manuals-table thead tr {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .manuals-table th {
    color: #64748b !important;
}

body.light-mode .manuals-table tbody tr.manual-table-row {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-mode .manuals-table tbody tr.manual-table-row:hover {
    background: #f8fafc !important;
}

body.light-mode .manuals-table tbody tr.manual-table-row.selected {
    background: #f0f9ff !important;
    border-left: 3px solid #0284c7 !important;
}

body.light-mode .manual-title-text {
    color: #0f172a !important;
}

body.light-mode .manual-filename-text {
    color: #64748b !important;
}

body.light-mode .manuals-search-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .manuals-search-input {
    color: #0f172a !important;
}

body.light-mode .cell-mono-val {
    color: #0f172a !important;
}

body.light-mode .cell-unit {
    color: #64748b !important;
}

body.light-mode .manual-action-btn {
    background: #ffffff !important;
    border: 1px solid #0284c7 !important;
    color: #0284c7 !important;
}

body.light-mode .manual-action-btn:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
}

body.light-mode .manual-action-btn.action-selected {
    background: #ecfdf5 !important;
    border-color: #16a34a !important;
    color: #16a34a !important;
}

body.light-mode .manual-badge-protected {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light-mode .manual-badge-custom {
    background: #faf5ff !important;
    border-color: #e9d5ff !important;
    color: #7e22ce !important;
}

body.light-mode .manual-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .manual-card:hover {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .manual-card.manual-primary {
    background: #f0f9ff !important;
    border-color: #7dd3fc !important;
}

body.light-mode .manual-meta-title {
    color: #0f172a !important;
}

body.light-mode .manual-file-path {
    color: #64748b !important;
}

body.light-mode .manual-badge-pages {
    background: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
}

body.light-mode .manual-badge-size {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .manual-badge-status {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}

body.light-mode .manual-dropzone {
    background: #ffffff !important;
    border: 1.5px dashed #cbd5e1 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .manual-dropzone:hover,
body.light-mode .manual-dropzone.dragover {
    border-color: #0284c7 !important;
    background: #f0f9ff !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.15) !important;
}

body.light-mode .dropzone-main-text {
    color: #0284c7 !important;
}

body.light-mode .dropzone-sub-text {
    color: #64748b !important;
}

body.light-mode .dropzone-browse-btn {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
}

body.light-mode .dropzone-browse-btn:hover {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

body.light-mode .dropzone-repo-select-row {
    border-top: 1px dashed #e2e8f0 !important;
}

body.light-mode .repo-select-label {
    color: #64748b !important;
}

body.light-mode .repo-quick-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    height: 36px !important;
    min-height: 36px !important;
    line-height: 1.4 !important;
    padding: 6px 12px !important;
}

body.light-mode .ingestion-console-section {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .console-header {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .console-status {
    color: #0284c7 !important;
}

body.light-mode .ingestion-console-output {
    background: #ffffff !important;
    color: #1e293b !important;
}

/* --------------------------------------------------------------------------
   2. Engine Editor Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .editor-target-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .editor-target-label {
    color: #0284c7 !important;
}

body.light-mode .editor-target-name {
    color: #0f172a !important;
}

body.light-mode .editor-target-id {
    color: #64748b !important;
}

body.light-mode .editor-switch-group label {
    color: #475569 !important;
}

body.light-mode .editor-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .editor-section-title {
    color: #0284c7 !important;
}

body.light-mode .editor-linked-manual-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .editor-linked-label {
    color: #64748b !important;
}

body.light-mode .editor-linked-val {
    color: #0284c7 !important;
}

body.light-mode .editor-stat-pill {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .editor-stat-pill .stat-num {
    color: #0284c7 !important;
}

body.light-mode .editor-stat-pill .stat-txt {
    color: #64748b !important;
}

body.light-mode .editor-danger-zone {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}

body.light-mode .danger-title {
    color: #dc2626 !important;
}

body.light-mode .danger-desc {
    color: #991b1b !important;
}

body.light-mode .danger-checkbox-label {
    color: #991b1b !important;
}

body.light-mode .editor-baseline-notice {
    background: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
}

body.light-mode .danger-confirm-card {
    background: #fee2e2 !important;
    border: 1px solid #f87171 !important;
}

body.light-mode .danger-confirm-title {
    color: #b91c1c !important;
}

body.light-mode .danger-confirm-desc {
    color: #991b1b !important;
}

body.light-mode #delete-confirm-engine-name {
    color: #7f1d1d !important;
}

/* --------------------------------------------------------------------------
   3. Component Card View Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .component-card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .comp-card-title {
    color: #0f172a !important;
}

body.light-mode .comp-engine-platform {
    color: #64748b !important;
}

body.light-mode .comp-category-tag {
    background: rgba(2, 132, 199, 0.1) !important;
    color: #0284c7 !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .comp-status-tag {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

body.light-mode .comp-interval-tag {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}

body.light-mode .card-hazard-banner {
    background: #fffbeb !important;
    border: 1px solid #fcd34d !important;
}

body.light-mode .hazard-alert-content strong {
    color: #b45309 !important;
}

body.light-mode .hazard-alert-content p {
    color: #78350f !important;
}

body.light-mode .card-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .dossier-label {
    color: #64748b !important;
}

body.light-mode .dossier-code {
    color: #0284c7 !important;
}

body.light-mode .copy-btn {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0284c7 !important;
}

body.light-mode .copy-btn:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
}

body.light-mode .citation-text {
    color: #475569 !important;
}

body.light-mode .lineage-flow-row,
body.light-mode .cross-ref-flow-row {
    border-top: 1px solid #e2e8f0 !important;
}

body.light-mode .flow-label {
    color: #64748b !important;
}

body.light-mode .section-title {
    color: #0f172a !important;
}

body.light-mode .fastener-count-badge {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
}

body.light-mode .sequence-step-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .sequence-step-card:hover {
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
}

body.light-mode .sequence-step-card.reverse-step {
    background: #fffbeb !important;
    border-color: #fde68a !important;
}

body.light-mode .step-label {
    color: #0f172a !important;
}

body.light-mode .step-sublabel {
    color: #64748b !important;
}

body.light-mode .step-num-badge {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #7dd3fc !important;
}

body.light-mode .step-torque-primary {
    color: #059669 !important;
}

body.light-mode .step-torque-secondary {
    color: #64748b !important;
}

body.light-mode .step-socket-badge {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

body.light-mode .sequence-meta-bar {
    border-top: 1px solid #e2e8f0 !important;
}

body.light-mode .meta-label {
    color: #64748b !important;
}

body.light-mode .meta-val {
    color: #0284c7 !important;
}

body.light-mode .card-tribal-note-item {
    background: #faf5ff !important;
    border: 1px solid #e9d5ff !important;
    border-left: 3px solid #9333ea !important;
}

body.light-mode .card-note-author {
    color: #7e22ce !important;
}

body.light-mode .card-note-text {
    color: #1e293b !important;
}

body.light-mode .component-card-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-mode .card-component-dossier-btn {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0284c7 !important;
}

body.light-mode .card-component-dossier-btn:hover {
    background: #bae6fd !important;
}

body.light-mode .card-add-gotcha-btn {
    background: #f3e8ff !important;
    border: 1px solid #d8b4fe !important;
    color: #7e22ce !important;
}

body.light-mode .card-add-gotcha-btn:hover {
    background: #e9d5ff !important;
}

/* --------------------------------------------------------------------------
   4. Engine Privacy & Sharing Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .share-target-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .share-target-label {
    color: #64748b !important;
}

body.light-mode .share-target-name {
    color: #0f172a !important;
}

body.light-mode .share-target-id {
    color: #0284c7 !important;
    background: #e0f2fe !important;
}

body.light-mode .visibility-option-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .visibility-option-card:hover {
    background: #faf5ff !important;
    border-color: #c084fc !important;
}

body.light-mode .visibility-option-card.selected {
    background: #f5f3ff !important;
    border-color: #9333ea !important;
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.15) !important;
}

body.light-mode .vis-title-text {
    color: #0f172a !important;
}

body.light-mode .vis-desc {
    color: #475569 !important;
}

body.light-mode .shared-emails-panel {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .shared-emails-panel .input-field-label {
    color: #7e22ce !important;
}

body.light-mode .shared-recipient-pill {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0369a1 !important;
}

/* --------------------------------------------------------------------------
   5. Platform Comparison Studio Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .comparison-summary-box {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-left: 4px solid #f59e0b !important;
}

body.light-mode .summary-title {
    color: #b45309 !important;
}

body.light-mode .summary-deltas-list li {
    color: #451a03 !important;
}

body.light-mode .comparison-section-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .comparison-matrix-table th,
body.light-mode .comparison-fasteners-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

body.light-mode .comparison-matrix-table td,
body.light-mode .comparison-fasteners-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .spec-key-col {
    background: #f8fafc !important;
    color: #0284c7 !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-mode .engine-header-title {
    color: #0f172a !important;
}

body.light-mode .engine-header-sub {
    color: #64748b !important;
}

body.light-mode .spec-torque-val {
    color: #0f172a !important;
}

body.light-mode .spec-torque-nm {
    color: #64748b !important;
}

body.light-mode .spec-socket-pill {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-mode .load-engine-twin-btn {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0369a1 !important;
}

body.light-mode .load-engine-twin-btn:hover {
    background: #bae6fd !important;
    border-color: #0284c7 !important;
}

body.light-mode .delta-badge-hazard {
    background: #fee2e2 !important;
    border: 1px solid #f87171 !important;
    color: #b91c1c !important;
}

body.light-mode .delta-badge-diff {
    background: #fef3c7 !important;
    border: 1px solid #fbbf24 !important;
    color: #92400e !important;
}

/* --------------------------------------------------------------------------
   6. Robotics Execution Studio Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .robotics-toolbar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .robotics-contract-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

body.light-mode .robotics-contract-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .motor-sign-standard {
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
    color: #0369a1 !important;
}

body.light-mode .motor-sign-reverse {
    background: #fef3c7 !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

body.light-mode .atc-socket-badge {
    background: #f3e8ff !important;
    border: 1px solid #d8b4fe !important;
    color: #6b21a8 !important;
}

body.light-mode .status-badge-pass {
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
    color: #15803d !important;
}

body.light-mode .status-badge-fail {
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
}

body.light-mode .coordinate-pill {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   7. Technician Authentication Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .oauth-btn {
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .oauth-google-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .oauth-google-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

body.light-mode .oauth-microsoft-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .oauth-microsoft-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

body.light-mode .auth-divider .divider-line {
    background: #e2e8f0 !important;
}

body.light-mode .auth-divider .divider-text {
    color: #64748b !important;
}

body.light-mode .auth-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .auth-tab-btn {
    color: #64748b !important;
}

body.light-mode .auth-tab-btn.active {
    color: #b45309 !important;
    border-bottom-color: #b45309 !important;
}

body.light-mode .auth-offline-notice {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
}

/* --------------------------------------------------------------------------
   8. User Profile Summary Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .profile-hero-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .profile-hero-info h3 {
    color: #0f172a !important;
}

body.light-mode .profile-modal-email {
    color: #64748b !important;
}

body.light-mode .profile-detail-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .detail-label {
    color: #64748b !important;
}

body.light-mode .detail-val {
    color: #0f172a !important;
}

/* --------------------------------------------------------------------------
   9. Multi-Engine Subscription Modal in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .sub-target-engine-banner {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
}

body.light-mode .sub-engine-title {
    color: #b45309 !important;
}

body.light-mode .sub-engine-desc {
    color: #78350f !important;
}

body.light-mode .sub-plan-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .sub-plan-featured {
    background: #ffffff !important;
    border: 2px solid #0284c7 !important;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12) !important;
}

body.light-mode .sub-plan-title {
    color: #0f172a !important;
}

body.light-mode .price-num {
    color: #0f172a !important;
}

body.light-mode .sub-plan-featured .price-num {
    color: #0284c7 !important;
}

body.light-mode .price-term {
    color: #64748b !important;
}

body.light-mode .sub-plan-features li {
    color: #334155 !important;
}

body.light-mode .sub-annual-discount {
    color: #059669 !important;
}

/* --------------------------------------------------------------------------
   10. Voice Gotcha & Spec Editor Modals in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .slang-chip {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
}

body.light-mode .slang-chip:hover {
    background: #fef3c7 !important;
}

body.light-mode .direction-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .direction-card .dir-info strong {
    color: #0f172a !important;
}

body.light-mode .direction-card .dir-info span {
    color: #64748b !important;
}

body.light-mode .direction-option input[type="radio"]:checked + .direction-card {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.2) !important;
}

body.light-mode .direction-option input[type="radio"]:checked + .direction-card .dir-icon {
    color: #0284c7 !important;
}

body.light-mode .direction-option input[type="radio"]:checked + .reverse-warning-card {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.25) !important;
}

body.light-mode .direction-option input[type="radio"]:checked + .reverse-warning-card .dir-icon {
    color: #b45309 !important;
}

body.light-mode .direction-option input[type="radio"]:checked + .reverse-warning-card .dir-info strong {
    color: #b45309 !important;
}

body.light-mode .conversion-helper-text {
    color: #0284c7 !important;
}

body.light-mode .input-with-unit .unit-badge {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

/* --------------------------------------------------------------------------
   11. Voice Command Listening Overlay in Light Mode
   -------------------------------------------------------------------------- */
body.light-mode .voice-command-overlay {
    background: #ffffff !important;
    border: 1px solid #f59e0b !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15), 0 0 20px rgba(245, 158, 11, 0.2) !important;
    color: #0f172a !important;
}

body.light-mode .voice-overlay-status {
    color: #64748b !important;
}

body.light-mode .voice-overlay-transcript {
    color: #0f172a !important;
}

/* ==========================================================================
   AUTHENTICATION HUD BUTTONS & SIGN UP ENTRY POINTS
   ========================================================================== */
.hud-signup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(16, 185, 129, 0.22));
    border: 1px solid rgba(6, 182, 212, 0.6);
    color: #67e8f9;
    padding: 5px 13px;
    border-radius: 20px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.hud-signup-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.38), rgba(16, 185, 129, 0.38));
    border-color: #22d3ee;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.5), 0 0 8px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

body.light-mode .hud-signup-btn {
    background: linear-gradient(135deg, #e0f2fe, #d1fae5);
    border-color: #0284c7;
    color: #0369a1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.light-mode .hud-signup-btn:hover {
    background: linear-gradient(135deg, #bae6fd, #a7f3d0);
    border-color: #0369a1;
    color: #0c4a6e;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.drawer-user-actions-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    flex-shrink: 0;
}

.drawer-auth-signup-btn {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(16, 185, 129, 0.28));
    border: 1px solid rgba(6, 182, 212, 0.7);
    color: #67e8f9;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.drawer-auth-signup-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.45), rgba(16, 185, 129, 0.45));
    border-color: #22d3ee;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

body.light-mode .drawer-auth-signup-btn {
    background: linear-gradient(135deg, #e0f2fe, #d1fae5);
    border-color: #0284c7;
    color: #0369a1;
}

body.light-mode .drawer-auth-signup-btn:hover {
    background: linear-gradient(135deg, #bae6fd, #a7f3d0);
    border-color: #0369a1;
    color: #0c4a6e;
}

.drawer-item-signup {
    border-left: 3px solid #06b6d4 !important;
    background: rgba(6, 182, 212, 0.08) !important;
}

.drawer-item-signup:hover {
    background: rgba(6, 182, 212, 0.18) !important;
}

body.light-mode .drawer-item-signup {
    border-left: 3px solid #0284c7 !important;
    background: #f0f9ff !important;
}

body.light-mode .drawer-item-signup:hover {
    background: #e0f2fe !important;
}

.auth-switch-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    font-family: var(--font-sans, sans-serif);
}

.auth-inline-link-btn {
    background: none;
    border: none;
    color: #38bdf8;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
    font-family: inherit;
}

.auth-inline-link-btn:hover {
    color: #7dd3fc;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

body.light-mode .auth-switch-prompt {
    border-top-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

body.light-mode .auth-inline-link-btn {
    color: #0284c7;
}

body.light-mode .auth-inline-link-btn:hover {
    color: #0369a1;
}

/* Engine Platform Switch Notice Banner (Single enclosing rectangle, no background) */
.auth-engine-lock-banner {
    background: transparent !important;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    animation: fadeInLock 0.3s ease;
}

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

.auth-engine-lock-banner .current-tag {
    color: #94a3b8;
}

.auth-engine-lock-banner .tag-arrow {
    color: #38bdf8;
    font-weight: bold;
}

.auth-engine-lock-banner .target-tag {
    color: #34d399;
    font-weight: 700;
}

body.light-mode .auth-engine-lock-banner {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
}

body.light-mode .auth-engine-lock-banner .current-tag {
    color: #64748b;
}

body.light-mode .auth-engine-lock-banner .tag-arrow {
    color: #0284c7;
}

body.light-mode .auth-engine-lock-banner .target-tag {
    color: #059669;
}

body.light-mode .auth-lock-engine-tags .target-tag {
    color: #059669;
}

/* ==========================================================================
   SUPPORT, ISSUE REPORTING & DEVELOPER CONTACT STYLES
   ========================================================================== */
.hud-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.hud-support-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

body.light-mode .hud-support-btn {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

body.light-mode .hud-support-btn:hover {
    background: #fecaca;
    border-color: #ef4444;
    color: #991b1b;
}

.issue-modal-card {
    max-width: 640px;
    width: 95%;
}

.issue-header-icon {
    font-size: 24px;
}

.issue-tabs-bar {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.issue-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    transition: all 0.2s ease;
}

.issue-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.issue-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

body.light-mode .issue-tab-btn {
    color: #64748b;
}

body.light-mode .issue-tab-btn.active {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.issue-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.issue-textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}

.issue-active-engine-badge {
    padding: 8px 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--font-mono, monospace);
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-mode .issue-active-engine-badge {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.issue-telemetry-toggle-row {
    margin-top: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
}

.issue-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.issue-status-indicator {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.issue-status-indicator.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
}

.issue-status-indicator.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #f87171;
}

.developer-contact-card {
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
}

.dev-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dev-avatar {
    font-size: 32px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dev-title {
    margin: 0;
    font-size: 16px;
    color: #f8fafc;
}

.dev-role {
    font-size: 12px;
    color: #94a3b8;
}

body.light-mode .dev-title {
    color: #0f172a;
}

.dev-details-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

body.light-mode .dev-details-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dev-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.dev-detail-label {
    font-weight: 700;
    color: #64748b;
    min-width: 120px;
    font-family: var(--font-mono, monospace);
}

.dev-detail-val {
    color: #e2e8f0;
    font-family: var(--font-mono, monospace);
    flex: 1;
}

body.light-mode .dev-detail-val {
    color: #1e293b;
}

.dev-copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.dev-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dev-external-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   GLOBAL FOOTER & LEGAL / DEVELOPER API MODAL STYLES
   ========================================================================== */
.app-global-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    font-size: 11px;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    z-index: 90;
    flex-wrap: wrap;
    gap: 12px;
}

body.light-mode .app-global-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
    color: #64748b;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-copyright {
    font-weight: 600;
    color: #cbd5e1;
}

body.light-mode .footer-copyright {
    color: #334155;
}

.footer-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

body.light-mode .footer-badge {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-link-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    padding: 2px 4px;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-link-btn:hover {
    color: #38bdf8;
    text-decoration: underline;
}

body.light-mode .footer-link-btn {
    color: #475569;
}

body.light-mode .footer-link-btn:hover {
    color: #0284c7;
}

.footer-separator {
    color: #475569;
    opacity: 0.6;
}

.footer-api-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399 !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

.footer-api-badge:hover {
    background: rgba(16, 185, 129, 0.22);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

body.light-mode .footer-api-badge {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #059669 !important;
}

/* Legal & Dev API Modal Styling */
.legal-modal-card {
    max-width: 820px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.legal-modal-body {
    overflow-y: auto;
    padding: 18px 22px;
    max-height: calc(85vh - 140px);
}

.legal-tabs-bar {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    margin-bottom: 18px;
    padding-bottom: 8px;
    overflow-x: auto;
}

.legal-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.legal-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.legal-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

body.light-mode .legal-tab-btn {
    color: #64748b;
}

body.light-mode .legal-tab-btn.active {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.legal-content-pane {
    line-height: 1.6;
    font-size: 13px;
    color: #cbd5e1;
}

body.light-mode .legal-content-pane {
    color: #334155;
}

.legal-section-block {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
}

body.light-mode .legal-section-block {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.legal-warning-block {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-left: 4px solid #f59e0b !important;
}

.legal-warning-block .legal-text {
    color: #e2e8f0 !important;
}

.legal-warning-block strong {
    color: #fbbf24 !important;
}

body.light-mode .legal-warning-block {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-left: 4px solid #d97706 !important;
}

body.light-mode .legal-warning-block .legal-text {
    color: #78350f !important;
}

body.light-mode .legal-warning-block strong {
    color: #92400e !important;
}

.legal-heading {
    font-size: 14px;
    font-weight: 700;
    color: #38bdf8;
    margin: 0 0 8px 0;
    font-family: var(--font-mono, monospace);
}

body.light-mode .legal-heading {
    color: #0284c7;
}

.legal-text {
    margin: 0;
    font-size: 12.5px;
    color: #94a3b8;
}

body.light-mode .legal-text {
    color: #475569;
}

.legal-bullet-list {
    margin: 8px 0 0 18px;
    padding: 0;
    font-size: 12.5px;
    color: #94a3b8;
}

body.light-mode .legal-bullet-list {
    color: #475569;
}

.legal-bullet-list li {
    margin-bottom: 6px;
}

/* Developer API Panel Styles */
.api-overview-card {
    padding: 14px 18px;
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    margin-bottom: 18px;
}

.api-links-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.api-btn-primary {
    background: #0284c7;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-family: var(--font-mono, monospace);
    transition: background 0.2s ease;
}

.api-btn-primary:hover {
    background: #0369a1;
}

.api-endpoints-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 12px;
    font-family: var(--font-mono, monospace);
}

.api-endpoints-table th {
    text-align: left;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #94a3b8;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

body.light-mode .api-endpoints-table th {
    background: #e2e8f0;
    color: #475569;
}

.api-endpoints-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .api-endpoints-table td {
    border-bottom-color: #f1f5f9;
}

.method-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
}

.method-get {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.method-post {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.api-code-block {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    position: relative;
    font-family: var(--font-mono, monospace);
    font-size: 11.5px;
    color: #e2e8f0;
    overflow-x: auto;
}

body.light-mode .api-code-block {
    background: #1e293b;
    color: #f8fafc;
}

/* ==========================================================================
   ADMINISTRATOR ANALYTICS DASHBOARD STYLES
   ========================================================================== */
.hud-admin-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    border-radius: 6px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.3px;
}

.hud-admin-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.45));
    border-color: #f59e0b;
    color: #fef3c7;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

body.light-mode .hud-admin-btn {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #d97706;
    color: #92400e;
}

.admin-analytics-card {
    max-width: 960px;
    width: 95%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.admin-kpi-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
}

.admin-kpi-label {
    font-size: 10px;
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.admin-kpi-val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    margin: 4px 0 2px;
    line-height: 1.1;
}

.admin-kpi-hint {
    font-size: 10px;
    color: var(--text-secondary);
}

.admin-tabs-row {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.admin-tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-tab-btn:hover {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.3);
}

.admin-tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
}

.admin-view-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-table-wrapper {
    max-height: 440px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

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

.admin-table th {
    text-align: left;
    padding: 8px 12px;
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: #0b1120;
    z-index: 10;
}

.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.admin-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-subpanel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
}

.admin-subpanel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--hud-cyan);
    font-family: var(--font-mono, monospace);
    margin-bottom: 10px;
}

.admin-rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-family: var(--font-mono, monospace);
}

.admin-rank-name {
    color: #e2e8f0;
}

.admin-rank-count {
    color: #38bdf8;
    font-weight: 700;
}

.admin-badge-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9.5px;
    font-weight: 700;
}

.admin-badge-event.event-register {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.admin-badge-event.event-switch {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.admin-badge-event.event-select {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.admin-badge-event.event-default {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Light mode overrides */
body.light-mode .admin-kpi-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-mode .admin-table th {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

body.light-mode .admin-table td {
    border-color: #f1f5f9;
    color: #1e293b;
}

body.light-mode .admin-table tr:hover td {
    background: #f8fafc;
}

body.light-mode .admin-subpanel {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-mode .admin-rank-name {
    color: #1e293b;
}










