/* ==================== CSS CUSTOM PROPERTIES ==================== */
:root {
    --primary-color: 0, 217, 255;
    --primary-hex: #00d9ff;
    --accent-color: 0, 255, 157;
    --accent-hex: #00ff9d;
}

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

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    height: 100dvh;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    color: #00d9ff;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Prevent iOS bounce/rubber-band scroll affecting fixed-position UI */
    overscroll-behavior: none;
}

/* Tech Grid Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(0, 217, 255, 0.05) 25%, rgba(0, 217, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 217, 255, 0.05) 75%, rgba(0, 217, 255, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 217, 255, 0.05) 25%, rgba(0, 217, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 217, 255, 0.05) 75%, rgba(0, 217, 255, 0.05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* Scanline Effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 217, 255, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* ==================== PARTICLE BACKGROUND ==================== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
}

/* ==================== MAIN CONTAINER ==================== */
.container {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ==================== ARC REACTOR (MOVIE STYLE) ==================== */
.arc-reactor-container {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#arcReactor {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 60px rgba(0, 217, 255, 1)) drop-shadow(0 0 100px rgba(0, 150, 255, 0.6));
}

/* Voice Button (compact, bottom-right) */
.voice-btn {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.12);
    border: 2px solid rgba(0, 217, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow:
        0 0 15px rgba(0, 217, 255, 0.3),
        inset 0 0 10px rgba(0, 217, 255, 0.1);
    z-index: 100000;
    backdrop-filter: blur(5px);
}

.voice-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 217, 255, 0.25);
    box-shadow:
        0 0 25px rgba(0, 217, 255, 0.5),
        inset 0 0 15px rgba(0, 217, 255, 0.2);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    background: rgba(0, 255, 100, 0.2);
    border-color: rgba(0, 255, 100, 0.7);
    box-shadow:
        0 0 20px rgba(0, 255, 100, 0.5),
        inset 0 0 10px rgba(0, 255, 100, 0.15);
}

.mic-icon {
    width: 22px;
    height: 22px;
    stroke: #00d9ff;
    z-index: 2;
}

.voice-btn.listening .mic-icon {
    stroke: #00ff64;
}

/* Voice Ripple Effect */
.voice-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(0, 217, 255, 0.6);
    opacity: 0;
}

.voice-btn.listening .voice-ripple {
    animation: voiceRipple 1.5s ease-out infinite;
}

.voice-btn.listening .voice-ripple:nth-child(2) {
    animation-delay: 0.3s;
}

.voice-btn.listening .voice-ripple:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes voiceRipple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

.reactor-status {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    letter-spacing: 5px;
    color: #00d9ff;
    text-shadow:
        0 0 20px rgba(0, 217, 255, 1),
        0 0 40px rgba(0, 217, 255, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
    white-space: nowrap;
    transition: all 0.4s ease;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ==================== CHAT CONTAINER ==================== */
.chat-container {
    width: 380px;
    height: 450px;
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow:
        0 0 40px rgba(0, 217, 255, 0.25),
        inset 0 0 30px rgba(0, 217, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    bottom: 200px;
    right: 40px;
    z-index: 60;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-container.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

/* Chat Header */
.chat-header {
    padding: 15px 20px;
    background: rgba(0, 217, 255, 0.08);
    border-bottom: 1px solid rgba(0, 217, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.chat-control-btn {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 6px;
    padding: 8px;
    color: #00d9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-control-btn:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
    transform: translateY(-2px);
}

.chat-control-btn:active {
    transform: translateY(0);
}

.chat-control-btn svg {
    display: block;
}

.jarvis-logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #00d9ff;
    text-shadow:
        0 0 20px rgba(0, 217, 255, 1),
        0 0 40px rgba(0, 150, 255, 0.5);
}

.header-subtitle {
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(0, 217, 255, 0.6);
    margin-top: 4px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 217, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.4);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.6);
}

/* Message Bubbles */
.message {
    display: flex;
    animation: messageSlide 0.5s ease-out;
}

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

.message.user {
    justify-content: flex-end;
}

.message.jarvis {
    justify-content: flex-start;
}

.message.system {
    justify-content: center;
}

.message-content {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(0, 150, 255, 0.15));
    border: 1px solid rgba(0, 217, 255, 0.5);
    color: #00d9ff;
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.3);
}

.message.jarvis .message-content {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 217, 255, 0.12));
    border: 1px solid rgba(0, 255, 157, 0.4);
    color: #00ff9d;
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.3);
}

.message.system .message-content {
    background: transparent;
    border: none;
    color: rgba(0, 217, 255, 0.6);
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d9ff;
    animation: thinking 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(0, 217, 255, 1);
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    30% {
        transform: scale(1.4);
        opacity: 1;
    }
}

/* ==================== KEYBOARD (HIDDEN) ==================== */
.chat-input-container {
    padding: 12px 15px;
    background: rgba(0, 217, 255, 0.08);
    border-top: 1px solid rgba(0, 217, 255, 0.3);
    display: flex;
    gap: 10px;
    position: relative;
}

.chat-input-container.hidden {
    display: none;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(0, 14, 27, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 20px;
    color: #00d9ff;
    font-size: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input::placeholder {
    color: rgba(0, 217, 255, 0.5);
    font-style: italic;
}

.chat-input:focus {
    border-color: rgba(0, 217, 255, 0.7);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.4);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.4), rgba(0, 150, 255, 0.25));
    border: 1px solid rgba(0, 217, 255, 0.6);
    border-radius: 50%;
    color: #00d9ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.6), rgba(0, 150, 255, 0.4));
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.7);
    transform: scale(1.1) rotate(45deg);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.hide-keyboard-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.5);
    border-radius: 50%;
    color: #ff6464;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hide-keyboard-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    box-shadow: 0 0 20px rgba(255, 100, 100, 0.5);
}

/* ==================== VOICE VISUALIZATION ==================== */
#voiceVisualization {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#voiceVisualization.active {
    opacity: 1;
}

/* ==================== LISTENING INDICATOR ==================== */
.listening-indicator {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(0, 255, 100, 0.15);
    border: 1px solid rgba(0, 255, 100, 0.5);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 255, 100, 0.5);
    z-index: 200;
}

.listening-indicator.hidden {
    display: none;
}

.listening-pulse {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #00ff64;
    box-shadow: 0 0 15px rgba(0, 255, 100, 1);
    animation: listeningPulse 1s ease-in-out infinite;
}

@keyframes listeningPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.listening-text {
    color: #00ff64;
    font-size: 14px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 100, 0.8);
}

/* ==================== HIDDEN UTILITY ==================== */
.hidden {
    display: none !important;
}

/* ==================== HUD OVERLAY (IRON MAN STYLE) ==================== */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-panel {
    position: absolute;
    background: linear-gradient(135deg, rgba(0, 10, 20, 0.85), rgba(0, 5, 15, 0.9));
    border: 1px solid rgba(0, 217, 255, 0.5);
    border-radius: 8px;
    padding: 20px;
    min-width: 250px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(0, 217, 255, 0.3),
        inset 0 0 30px rgba(0, 217, 255, 0.05);
    animation: panelSlideIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hud-panel.panel-dismissed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.hud-panel .panel-title {
    cursor: pointer;
}

.quick-actions-bar.panel-dismissed {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* Restore Panels Button */
.restore-panels-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.4);
    color: #00d9ff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    transform: scale(0.8);
    backdrop-filter: blur(5px);
}

.restore-panels-btn.visible {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.restore-panels-btn:hover {
    background: rgba(0, 217, 255, 0.3);
    transform: scale(1.1);
}

/* Panel Positions */
.hud-panel.top-left {
    top: 30px;
    left: 30px;
}

.hud-panel.top-right {
    top: 30px;
    right: 30px;
}

/* Panel Slide-In Animations */
.hud-panel.top-left {
    animation: slideInTopLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hud-panel.top-right {
    animation: slideInTopRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInTopLeft {
    from {
        transform: translate(-100%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes slideInTopRight {
    from {
        transform: translate(100%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* Corner Brackets (Iron Man Style) */
.panel-bracket {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    pointer-events: none;
}

.panel-bracket::before,
.panel-bracket::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 217, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

/* Top-left bracket */
.panel-bracket::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 8px;
}

/* Bottom-right bracket */
.panel-bracket::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 8px;
}

/* Panel Content */
.panel-content {
    position: relative;
    z-index: 1;
}

.panel-title {
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(0, 217, 255, 0.9);
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.8);
    border-bottom: 1px solid rgba(0, 217, 255, 0.3);
    padding-bottom: 8px;
}

/* Status Items */
.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 11px;
}

.status-item .label {
    color: rgba(0, 217, 255, 0.7);
    font-size: 10px;
    letter-spacing: 1px;
    min-width: 80px;
}

.status-item .value {
    color: #00ff9d;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.6);
    letter-spacing: 1px;
}

.status-item .value.mono {
    font-family: 'Courier New', monospace;
    color: #00d9ff;
}

/* TTS Toggle Button */
.tts-toggle-btn {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(0, 255, 157, 0.15));
    border: 1px solid rgba(0, 217, 255, 0.5);
    border-radius: 4px;
    padding: 4px 12px;
    color: #00ff9d;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

.tts-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.3), rgba(0, 255, 157, 0.3));
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
    transform: translateY(-1px);
}

.tts-toggle-btn:active {
    transform: translateY(0);
}

/* Connection Indicator */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.connection-dot.connected {
    background: #00ff9d;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.8);
    animation: connectionPulse 2s ease-in-out infinite;
}

.connection-dot.connecting {
    background: #ffa500;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.8);
    animation: connectionBlink 1s ease-in-out infinite;
}

.connection-dot.disconnected {
    background: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.connection-status {
    color: #00ff9d;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

@keyframes connectionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: linear-gradient(135deg, rgba(0, 10, 20, 0.95), rgba(0, 5, 15, 0.95));
    border: 1px solid rgba(0, 217, 255, 0.5);
    border-radius: 8px;
    padding: 15px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow:
        0 0 30px rgba(0, 217, 255, 0.3),
        inset 0 0 20px rgba(0, 217, 255, 0.05);
    pointer-events: auto;
    animation: notificationSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.error {
    border-color: rgba(255, 68, 68, 0.5);
    box-shadow:
        0 0 30px rgba(255, 68, 68, 0.3),
        inset 0 0 20px rgba(255, 68, 68, 0.05);
}

.notification.success {
    border-color: rgba(0, 255, 157, 0.5);
    box-shadow:
        0 0 30px rgba(0, 255, 157, 0.3),
        inset 0 0 20px rgba(0, 255, 157, 0.05);
}

.notification.warning {
    border-color: rgba(255, 165, 0, 0.5);
    box-shadow:
        0 0 30px rgba(255, 165, 0, 0.3),
        inset 0 0 20px rgba(255, 165, 0, 0.05);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #00d9ff;
    margin-bottom: 4px;
}

.notification.error .notification-title {
    color: #ff4444;
}

.notification.success .notification-title {
    color: #00ff9d;
}

.notification.warning .notification-title {
    color: #ffa500;
}

.notification-message {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: #00d9ff;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Gauges */
.gauge-container {
    flex: 1;
    height: 6px;
    background: rgba(0, 217, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.8), rgba(0, 255, 157, 0.8));
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.gauge-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: gaugeShine 2s linear infinite;
}

@keyframes gaugeShine {
    0% { left: -100%; }
    100% { left: 200%; }
}

.gauge-fill.processing {
    background: linear-gradient(90deg, rgba(255, 200, 80, 0.8), rgba(255, 150, 30, 0.8));
    box-shadow: 0 0 10px rgba(255, 200, 80, 0.8);
}

/* Gauge Color Variants */
.gauge-fill.cpu {
    background: linear-gradient(90deg, rgba(0, 255, 157, 0.8), rgba(0, 217, 255, 0.8));
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.6);
}

.gauge-fill.ram {
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.8), rgba(100, 200, 255, 0.8));
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

.gauge-fill.disk {
    background: linear-gradient(90deg, rgba(255, 200, 80, 0.8), rgba(255, 150, 30, 0.8));
    box-shadow: 0 0 10px rgba(255, 200, 80, 0.6);
}

.gauge-fill.high {
    background: linear-gradient(90deg, rgba(255, 100, 100, 0.8), rgba(255, 50, 50, 0.8)) !important;
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.8) !important;
}

/* Bottom Panel Positions */
.hud-panel.bottom-left {
    bottom: 30px;
    left: 30px;
    animation: slideInBottomLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hud-panel.bottom-right {
    bottom: 30px;
    right: 30px;
    animation: slideInBottomRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInBottomLeft {
    from { transform: translate(-100%, 100%); opacity: 0; }
    to { transform: translate(0, 0); opacity: 1; }
}

@keyframes slideInBottomRight {
    from { transform: translate(100%, 100%); opacity: 0; }
    to { transform: translate(0, 0); opacity: 1; }
}

/* ==================== DATE/TIME DISPLAY ==================== */
.datetime-display {
    text-align: center;
    padding: 8px 0;
}

.time-large {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #00d9ff;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
    font-family: 'Courier New', monospace;
}

.date-line {
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(0, 217, 255, 0.7);
    margin-top: 4px;
}

.day-line {
    font-size: 10px;
    letter-spacing: 3px;
    color: #00ff9d;
    text-transform: uppercase;
    margin-top: 2px;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.5);
}

/* ==================== WEATHER HUD ==================== */
.weather-hud-loading {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(0, 217, 255, 0.5);
    text-align: center;
    padding: 15px 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.weather-hud-temp {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.weather-hud-icon {
    font-size: 28px;
}

.weather-hud-degrees {
    font-size: 22px;
    font-weight: bold;
    color: #00ff9d;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.6);
    letter-spacing: 2px;
}

/* ==================== DEVICES PANEL ==================== */
.device-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
}

.device-item:hover {
    background: rgba(0, 217, 255, 0.06);
}

.device-item.device-active {
    background: rgba(0, 217, 255, 0.12);
    border-color: rgba(0, 217, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.25);
}

.device-item.device-active .device-name {
    color: #00d9ff;
    text-shadow: 0 0 4px rgba(0, 217, 255, 0.6);
}

.device-item:last-child {
    border-bottom: none;
}

.device-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.device-dot.online {
    background: #00ff9d;
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.8);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 157, 0.8); }
    50% { box-shadow: 0 0 15px rgba(0, 255, 157, 1); }
}

.device-dot.offline {
    background: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.device-info {
    flex: 1;
}

.device-name {
    font-size: 11px;
    color: #00d9ff;
    letter-spacing: 1px;
    font-weight: 600;
}

.device-caps {
    font-size: 9px;
    color: rgba(0, 217, 255, 0.4);
    letter-spacing: 1px;
    margin-top: 2px;
}

.device-empty {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(0, 217, 255, 0.3);
    text-align: center;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* ==================== MODAL SYSTEM ==================== */
/* Close All Modals button */
.close-all-modals {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 99999;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.5);
    color: #ff6666;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.close-all-modals:hover {
    background: rgba(255, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}
.close-all-modals.hidden { display: none; }

.modal-container.focused {
    border-color: rgba(0, 217, 255, 0.8);
    box-shadow: 0 0 60px rgba(0, 217, 255, 0.6), inset 0 0 35px rgba(0, 217, 255, 0.15);
}

@keyframes modalFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

.modal-container {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, rgba(0, 10, 20, 0.98), rgba(0, 5, 15, 0.98));
    border: 2px solid rgba(0, 217, 255, 0.6);
    border-radius: 12px;
    max-width: 500px;
    max-height: 80vh;
    width: 500px;
    box-shadow:
        0 0 50px rgba(0, 217, 255, 0.5),
        inset 0 0 30px rgba(0, 217, 255, 0.1);
    animation: hologramReveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    /* Hologram scan line that sweeps as modal appears */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    z-index: 10000;
    transition: box-shadow 0.3s ease;
}

.modal-container:hover {
    box-shadow:
        0 0 60px rgba(0, 217, 255, 0.6),
        inset 0 0 35px rgba(0, 217, 255, 0.15);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #00d9ff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.modal-brand {
    margin-left: auto;
    margin-right: 12px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(0, 217, 255, 0.45);
    white-space: nowrap;
}

/* JARVIS HUD content formatting */
.jv-body { font-size: 14px; line-height: 1.55; color: #cfe9f5; }
.jv-h {
    color: #00d9ff; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    font-size: 12px; margin: 16px 0 7px; padding-left: 9px; border-left: 3px solid #00d9ff;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.4);
}
.jv-body > .jv-h:first-child { margin-top: 0; }
.jv-row {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 6px 8px; border-bottom: 1px solid rgba(0, 217, 255, 0.08);
}
.jv-k { color: rgba(159, 221, 255, 0.7); }
.jv-v { color: #eaf6fb; text-align: right; font-weight: 600; }
.jv-li { position: relative; padding: 4px 8px 4px 24px; }
.jv-li::before { content: '▸'; position: absolute; left: 7px; color: #00d9ff; }
.jv-p { padding: 4px 8px; }
.jv-sp { height: 8px; }
.jv-sep { height: 1px; background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.4), transparent); margin: 12px 0; }

/* Actionable command buttons (click to run — same command also works by voice) */
.jv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rich-actions-label {
    font-size: 10px; letter-spacing: 2px; color: #7fd6ee; opacity: 0.85;
    text-transform: uppercase; margin: 14px 0 6px;
}
.jv-action {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(0, 217, 255, 0.12); border: 1px solid rgba(0, 217, 255, 0.55);
    color: #dff6fb; border-radius: 8px; padding: 8px 14px; cursor: pointer;
    font-size: 13px; font-weight: 600; letter-spacing: .3px; transition: all .15s;
}
.jv-action:hover { background: rgba(0, 217, 255, 0.25); border-color: #22d3ee; box-shadow: 0 0 14px rgba(0, 217, 255, 0.4); transform: translateY(-1px); }
.jv-action-ico { color: #22d3ee; font-size: 11px; }
.jv-action.needs-input { border-color: rgba(245, 185, 66, 0.6); }
.jv-action.needs-input:hover { border-color: #f5b942; box-shadow: 0 0 14px rgba(245, 185, 66, 0.4); }
.jv-action.needs-input .jv-action-ico { color: #f5b942; }

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    transform: rotate(90deg);
}

.modal-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 100px);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 217, 255, 0.05);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.4);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.6);
}

/* Conversation History Modal Styles */
.conversation-item {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid rgba(0, 217, 255, 0.5);
    background: rgba(0, 217, 255, 0.05);
}

.conversation-item.user {
    border-left-color: rgba(0, 217, 255, 0.8);
    background: rgba(0, 217, 255, 0.1);
}

.conversation-item.jarvis {
    border-left-color: rgba(0, 255, 157, 0.8);
    background: rgba(0, 255, 157, 0.05);
}

.conversation-label {
    font-size: 11px;
    font-weight: 600;
    color: #00d9ff;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.conversation-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* File Viewer Modal Styles */
.file-viewer {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.file-header {
    color: #00ff9d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 157, 0.3);
}

.file-content {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Security Audit Modal Styles */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.security-card {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.security-card.ok {
    border-color: rgba(0, 255, 157, 0.5);
    background: rgba(0, 255, 157, 0.05);
}

.security-card.warning {
    border-color: rgba(255, 165, 0, 0.5);
    background: rgba(255, 165, 0, 0.05);
}

.security-card.error {
    border-color: rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.05);
}

.security-label {
    font-size: 12px;
    font-weight: 600;
    color: #00d9ff;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.security-value {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.security-details {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Weather Modal Styles */
.weather-display {
    padding: 10px;
}

.weather-location {
    font-size: 24px;
    font-weight: 600;
    color: #00ff9d;
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(0, 255, 157, 0.1));
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

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

.weather-item {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.weather-item:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

.weather-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 217, 255, 0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.weather-value {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* ==================== Search Results Modal ==================== */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-card {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-left: 3px solid rgba(0, 217, 255, 0.6);
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.3s ease;
}

.search-result-card:hover {
    background: rgba(0, 217, 255, 0.1);
    border-left-color: #00d9ff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.15);
}

.search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #00d9ff;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}

a.search-result-title:hover {
    color: #00ff9d;
    text-decoration: underline;
}

.search-result-snippet {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 4px;
}

.search-result-url {
    font-size: 11px;
    color: rgba(0, 217, 255, 0.4);
    word-break: break-all;
}

/* ==================== Process Table Modal ==================== */
.process-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.process-row {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 217, 255, 0.03);
    gap: 10px;
}

.process-row:hover {
    background: rgba(0, 217, 255, 0.08);
}

.process-row.process-header {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.2);
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 217, 255, 0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.process-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-count {
    font-size: 12px;
    color: rgba(0, 217, 255, 0.6);
    text-align: center;
}

.process-mem {
    display: flex;
    align-items: center;
    gap: 8px;
}

.process-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.process-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.process-mem-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 65px;
    text-align: right;
}

/* ==================== Network Info Modal ==================== */
.network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.network-card {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 18px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.network-card:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

.network-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.network-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 217, 255, 0.7);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.network-value {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    word-break: break-all;
}

/* ==================== Disk Usage Modal ==================== */
.disk-drives {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.disk-drive-card {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.disk-drive-name {
    font-size: 14px;
    font-weight: 600;
    color: #00d9ff;
    margin-bottom: 12px;
}

.disk-usage-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.disk-usage-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
}

.disk-usage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== Port Scan / Network Recon ==================== */
.portscan-table { display: flex; flex-direction: column; gap: 2px; }
.portscan-row {
    display: grid; grid-template-columns: 80px 1fr 120px 80px;
    align-items: center; padding: 8px 12px; border-radius: 4px;
    background: rgba(0, 217, 255, 0.03); gap: 10px; font-size: 13px;
}
.portscan-row:hover { background: rgba(0, 217, 255, 0.08); }
.portscan-row.header {
    background: rgba(0, 217, 255, 0.1); border: 1px solid rgba(0, 217, 255, 0.2);
    font-size: 11px; font-weight: 600; color: rgba(0, 217, 255, 0.7);
    letter-spacing: 1px; text-transform: uppercase;
}
.port-number { color: #00d9ff; font-weight: 600; font-family: 'Courier New', monospace; }
.port-service { color: rgba(255, 255, 255, 0.9); }
.port-state { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; }
.port-state.open { background: rgba(0, 255, 157, 0.15); color: #00ff9d; border: 1px solid rgba(0, 255, 157, 0.3); }
.port-state.closed { background: rgba(255, 68, 68, 0.15); color: #ff4444; border: 1px solid rgba(255, 68, 68, 0.3); }
.port-state.filtered { background: rgba(255, 165, 0, 0.15); color: #ffaa00; border: 1px solid rgba(255, 165, 0, 0.3); }
.recon-section { margin-bottom: 20px; }
.recon-section-title {
    font-size: 12px; font-weight: 600; color: #00d9ff; letter-spacing: 2px;
    text-transform: uppercase; margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

/* ==================== PCAP Analyzer (Wireshark-style) ==================== */
.pcap-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pcap-stat { background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.2); border-radius: 6px; padding: 12px; text-align: center; }
.pcap-stat-value { font-size: 22px; font-weight: 700; color: #00d9ff; }
.pcap-stat-label { font-size: 10px; color: rgba(0, 217, 255, 0.6); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.pcap-packet-table { display: flex; flex-direction: column; gap: 1px; font-family: 'Courier New', monospace; font-size: 12px; }
.pcap-packet-row {
    display: grid; grid-template-columns: 140px 140px 80px 1fr;
    padding: 6px 10px; background: rgba(0, 10, 20, 0.4); gap: 8px; align-items: center;
}
.pcap-packet-row:nth-child(even) { background: rgba(0, 217, 255, 0.03); }
.pcap-packet-row:hover { background: rgba(0, 217, 255, 0.08); }
.pcap-packet-row.header {
    background: rgba(0, 217, 255, 0.1); border: 1px solid rgba(0, 217, 255, 0.2);
    font-weight: 600; color: rgba(0, 217, 255, 0.7); text-transform: uppercase;
    letter-spacing: 1px; font-family: inherit;
}
.pcap-proto { padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; text-align: center; }
.pcap-proto.tcp { background: rgba(0, 217, 255, 0.2); color: #00d9ff; }
.pcap-proto.udp { background: rgba(0, 255, 157, 0.2); color: #00ff9d; }
.pcap-proto.http { background: rgba(255, 165, 0, 0.2); color: #ffaa00; }
.pcap-proto.dns { background: rgba(157, 0, 255, 0.2); color: #bd7aff; }
.pcap-proto.tls { background: rgba(255, 68, 68, 0.2); color: #ff6b6b; }
.pcap-proto.arp { background: rgba(255, 255, 0, 0.15); color: #ffff66; }

/* ==================== Firewall Monitor ==================== */
.firewall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.firewall-card { background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.2); border-radius: 8px; padding: 14px; }
.firewall-card.enabled { border-color: rgba(0, 255, 157, 0.4); }
.firewall-card.disabled { border-color: rgba(255, 68, 68, 0.4); background: rgba(255, 68, 68, 0.05); }
.firewall-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.firewall-status-dot.on { background: #00ff9d; box-shadow: 0 0 6px #00ff9d; }
.firewall-status-dot.off { background: #ff4444; box-shadow: 0 0 6px #ff4444; }
.firewall-rule-row {
    display: grid; grid-template-columns: 50px 1fr 80px 80px;
    padding: 6px 10px; font-size: 12px; background: rgba(0, 10, 20, 0.3);
    border-radius: 3px; gap: 8px; align-items: center; margin-bottom: 2px;
}
.firewall-rule-row.header {
    background: rgba(0, 217, 255, 0.1); font-weight: 600;
    color: rgba(0, 217, 255, 0.7); text-transform: uppercase; letter-spacing: 1px; font-size: 11px;
}
.fw-allow { color: #00ff9d; }
.fw-block { color: #ff4444; }

/* ==================== Blue Team / Log Correlation ==================== */
.blueteam-timeline { position: relative; padding-left: 24px; }
.blueteam-timeline::before {
    content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, #00d9ff, rgba(0, 217, 255, 0.2));
}
.blueteam-event {
    position: relative; margin-bottom: 16px; padding: 12px 14px;
    background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.15); border-radius: 6px;
}
.blueteam-event::before {
    content: ''; position: absolute; left: -20px; top: 16px; width: 10px; height: 10px;
    border-radius: 50%; background: #00d9ff; box-shadow: 0 0 6px #00d9ff;
}
.blueteam-event.critical::before { background: #ff4444; box-shadow: 0 0 8px #ff4444; }
.blueteam-event.critical { border-color: rgba(255, 68, 68, 0.4); }
.blueteam-event.high::before { background: #ffaa00; box-shadow: 0 0 8px #ffaa00; }
.blueteam-event.high { border-color: rgba(255, 165, 0, 0.3); }
.blueteam-event.low::before { background: #00ff9d; box-shadow: 0 0 6px #00ff9d; }
.blueteam-event-time { font-size: 11px; color: rgba(0, 217, 255, 0.6); font-family: 'Courier New', monospace; }
.blueteam-event-title { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.95); margin: 4px 0; }
.blueteam-event-detail { font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.severity-badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.severity-badge.critical { background: rgba(255, 68, 68, 0.2); color: #ff4444; border: 1px solid rgba(255, 68, 68, 0.4); }
.severity-badge.high { background: rgba(255, 165, 0, 0.2); color: #ffaa00; border: 1px solid rgba(255, 165, 0, 0.4); }
.severity-badge.medium { background: rgba(0, 217, 255, 0.2); color: #00d9ff; border: 1px solid rgba(0, 217, 255, 0.4); }
.severity-badge.low { background: rgba(0, 255, 157, 0.2); color: #00ff9d; border: 1px solid rgba(0, 255, 157, 0.4); }
.severity-badge.info { background: rgba(157, 0, 255, 0.15); color: #bd7aff; border: 1px solid rgba(157, 0, 255, 0.3); }

/* ==================== Vulnerability Assessment ==================== */
.vuln-grid { display: flex; flex-direction: column; gap: 10px; }
.vuln-card {
    background: rgba(0, 217, 255, 0.04); border: 1px solid rgba(0, 217, 255, 0.15);
    border-left: 4px solid #00d9ff; border-radius: 6px; padding: 14px;
}
.vuln-card.critical { border-left-color: #ff4444; }
.vuln-card.high { border-left-color: #ffaa00; }
.vuln-card.medium { border-left-color: #00d9ff; }
.vuln-card.low { border-left-color: #00ff9d; }
.vuln-title { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.95); margin-bottom: 6px; }
.vuln-detail { font-size: 12px; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }
.vuln-cve { font-family: 'Courier New', monospace; color: #00d9ff; font-weight: 600; }

/* ==================== Forensics ==================== */
.forensics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.forensics-card { background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.2); border-radius: 6px; padding: 14px; }
.forensics-label {
    font-size: 11px; font-weight: 600; color: rgba(0, 217, 255, 0.7);
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px;
}
.forensics-value { font-size: 14px; color: rgba(255, 255, 255, 0.9); word-break: break-all; font-family: 'Courier New', monospace; }
.hash-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; background: rgba(0, 10, 20, 0.4); border-radius: 4px; margin-bottom: 4px;
}
.hash-type { font-size: 11px; font-weight: 700; color: #00d9ff; min-width: 60px; text-transform: uppercase; }
.hash-value { font-size: 12px; color: rgba(255, 255, 255, 0.8); font-family: 'Courier New', monospace; word-break: break-all; flex: 1; margin-left: 12px; }

/* ==================== Password Tools ==================== */
.password-meter { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.password-meter-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.password-strength-label { font-size: 18px; font-weight: 700; text-align: center; margin: 8px 0; }
.password-strength-label.weak { color: #ff4444; }
.password-strength-label.fair { color: #ffaa00; }
.password-strength-label.good { color: #00d9ff; }
.password-strength-label.strong { color: #00ff9d; }
.password-generated {
    font-family: 'Courier New', monospace; font-size: 18px; color: #00ff9d;
    text-align: center; padding: 16px; background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.3); border-radius: 8px; letter-spacing: 2px; word-break: break-all;
}

/* ==================== Thermal / System Temps ==================== */
.thermal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.thermal-card {
    background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px; padding: 16px; text-align: center;
}
.thermal-temp { font-size: 32px; font-weight: 700; margin: 8px 0; }
.thermal-temp.cool { color: #00ff9d; }
.thermal-temp.warm { color: #00d9ff; }
.thermal-temp.hot { color: #ffaa00; }
.thermal-temp.critical { color: #ff4444; text-shadow: 0 0 10px rgba(255, 68, 68, 0.5); }
.thermal-label { font-size: 12px; font-weight: 600; color: rgba(0, 217, 255, 0.7); text-transform: uppercase; letter-spacing: 1px; }
.thermal-bar { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.thermal-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ==================== CVE / Cyber Intel ==================== */
.cve-card {
    background: rgba(0, 217, 255, 0.04); border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px; padding: 16px; margin-bottom: 12px;
}
.cve-id { font-family: 'Courier New', monospace; font-size: 16px; font-weight: 700; color: #00d9ff; margin-bottom: 8px; }
.cve-score {
    display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 13px; font-weight: 700; margin-left: 10px;
}
.cve-score.critical { background: rgba(255, 68, 68, 0.2); color: #ff4444; }
.cve-score.high { background: rgba(255, 165, 0, 0.2); color: #ffaa00; }
.cve-score.medium { background: rgba(0, 217, 255, 0.2); color: #00d9ff; }
.cve-score.low { background: rgba(0, 255, 157, 0.2); color: #00ff9d; }
.cve-description { font-size: 13px; color: rgba(255, 255, 255, 0.8); line-height: 1.6; margin-top: 8px; }

/* ==================== Nmap Results ==================== */
.nmap-host {
    background: rgba(0, 217, 255, 0.05); border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.nmap-host-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}
.nmap-host-ip { font-size: 16px; font-weight: 700; color: #00d9ff; font-family: 'Courier New', monospace; }
.nmap-host-status { padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.nmap-host-status.up { background: rgba(0, 255, 157, 0.15); color: #00ff9d; }
.nmap-host-status.down { background: rgba(255, 68, 68, 0.15); color: #ff4444; }

/* ==================== YARA Scanner ==================== */
.yara-match {
    background: rgba(255, 68, 68, 0.05); border: 1px solid rgba(255, 68, 68, 0.25);
    border-left: 4px solid #ff4444; border-radius: 6px; padding: 14px; margin-bottom: 10px;
}
.yara-match.clean { background: rgba(0, 255, 157, 0.05); border-color: rgba(0, 255, 157, 0.25); border-left-color: #00ff9d; }
.yara-rule-name { font-size: 14px; font-weight: 700; color: #ff6b6b; font-family: 'Courier New', monospace; }
.yara-match.clean .yara-rule-name { color: #00ff9d; }
.yara-file-path { font-size: 12px; color: rgba(255, 255, 255, 0.6); font-family: 'Courier New', monospace; margin-top: 4px; word-break: break-all; }

/* ==================== Evidence Tracker ==================== */
.evidence-card {
    background: rgba(0, 217, 255, 0.04); border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px; padding: 16px; margin-bottom: 12px;
}
.evidence-id { font-family: 'Courier New', monospace; font-size: 13px; font-weight: 700; color: #00d9ff; margin-bottom: 6px; }
.evidence-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.evidence-tag {
    padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
    background: rgba(0, 217, 255, 0.15); color: #00d9ff; border: 1px solid rgba(0, 217, 255, 0.3);
}
.evidence-hash { font-family: 'Courier New', monospace; font-size: 11px; color: rgba(255, 255, 255, 0.5); margin-top: 6px; word-break: break-all; }

/* ==================== Generic Tool Detail Block ==================== */
.tool-detail-block {
    padding: 14px; background: rgba(0, 0, 0, 0.3); border-radius: 6px;
    color: rgba(255, 255, 255, 0.85); font-size: 13px; line-height: 1.6;
    white-space: pre-wrap; word-wrap: break-word; margin-top: 12px;
    border: 1px solid rgba(0, 217, 255, 0.1);
}
.tool-detail-rendered {
    padding: 14px; background: rgba(0, 0, 0, 0.3); border-radius: 6px;
    color: rgba(255, 255, 255, 0.85); font-size: 13px; line-height: 1.6;
    word-wrap: break-word; margin-top: 12px;
    border: 1px solid rgba(0, 217, 255, 0.1);
}
.tool-detail-rendered p { margin: 0 0 8px 0; }
.tool-detail-rendered p:last-child { margin-bottom: 0; }
.tool-detail-rendered strong { color: #00d9ff; }
.tool-detail-rendered ul, .tool-detail-rendered ol { margin: 6px 0; padding-left: 20px; }
.tool-detail-rendered li { margin: 3px 0; }
.tool-detail-rendered code { background: rgba(0, 217, 255, 0.1); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.tool-detail-rendered pre { background: rgba(0, 0, 0, 0.4); padding: 10px; border-radius: 4px; overflow-x: auto; }
.tool-detail-rendered h1, .tool-detail-rendered h2, .tool-detail-rendered h3 { color: #00d9ff; margin: 10px 0 6px 0; }
.tool-detail-rendered h1 { font-size: 16px; } .tool-detail-rendered h2 { font-size: 15px; } .tool-detail-rendered h3 { font-size: 14px; }

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Holographic modal reveal — projects in like a Stark hologram */
@keyframes hologramReveal {
    0% {
        opacity: 0;
        transform: scaleY(0.02) scaleX(0.85) translateZ(0);
        filter: brightness(2.5) blur(2px);
        clip-path: inset(50% 0 50% 0);
    }
    25% {
        opacity: 0.85;
        transform: scaleY(1) scaleX(0.92) translateZ(0);
        filter: brightness(2) blur(1px);
        clip-path: inset(0 0 0 0);
    }
    55% {
        opacity: 0.95;
        transform: scaleY(1.02) scaleX(1) translateZ(0);
        filter: brightness(1.4);
        clip-path: inset(0 0 0 0);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1) translateZ(0);
        filter: brightness(1);
        clip-path: inset(0 0 0 0);
    }
}

/* Scan line that sweeps over the modal during reveal */
.modal-container::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 48%,
        rgba(0, 217, 255, 0.6) 50%,
        transparent 52%,
        transparent 100%);
    animation: hologramScanSweep 0.6s ease-out both;
    z-index: 100;
}

@keyframes hologramScanSweep {
    0% { transform: translateY(-100%); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

@keyframes modalSlideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1400px) {
    .arc-reactor-container {
        width: 350px;
        height: 350px;
    }

    .voice-btn {
        width: 40px;
        height: 40px;
        bottom: 80px;
        right: 20px;
    }

    .mic-icon {
        width: 20px;
        height: 20px;
    }

    .chat-container {
        width: 320px;
        height: 380px;
        bottom: 180px;
        right: 30px;
    }

    .jarvis-logo {
        font-size: 18px;
        letter-spacing: 4px;
    }

    /* HUD Panels - smaller on medium screens */
    .hud-panel {
        min-width: 180px;
        padding: 12px;
        font-size: 9px;
    }

    .hud-panel.top-left {
        left: 15px;
        top: 15px;
    }

    .hud-panel.top-right {
        right: 15px;
        top: 15px;
    }

    .hud-panel.bottom-left {
        left: 15px;
        bottom: 15px;
    }

    .hud-panel.bottom-right {
        right: 15px;
        bottom: 15px;
    }

    .time-large {
        font-size: 22px;
        letter-spacing: 3px;
    }

    .weather-hud-degrees {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    /* Arc reactor sized to fit BOTH width and height of viewport, accounting
       for the bottom mobile-nav (60px) and a buffer so it doesn't touch the
       mic that pops up from the nav. */
    .arc-reactor-container {
        position: fixed !important;
        top: calc(50% - 30px - env(safe-area-inset-top, 0px) / 2 + env(safe-area-inset-bottom, 0px) / 2) !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: min(78vw, calc(100vh - 200px), 360px) !important;
        height: min(78vw, calc(100vh - 200px), 360px) !important;
        z-index: 5;
    }
    .arc-reactor-container canvas {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }

    /* Hide quick actions bar — mobile nav replaces it */
    .quick-actions-bar {
        display: none !important;
    }

    /* Hide desktop voice button — mobile nav has its own */
    .voice-btn {
        display: none !important;
    }

    /* Hide wake word indicator on mobile */
    #wake-word-indicator {
        display: none !important;
    }

    /* Hide the reactor status text */
    .reactor-status {
        display: none !important;
    }

    /* Full-screen chat on mobile (when visible).
       Anchor top + bottom for reliable layout under iOS address bar resize. */
    .chat-container {
        position: fixed !important;
        top: env(safe-area-inset-top, 0px) !important;
        bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        border-radius: 0 !important;
        border: none !important;
        transform: none !important;
        z-index: 50;
    }
    /* On mobile, .hidden must actually remove the chat from view —
       opacity:0 alone isn't enough because the chat still blocks taps. */
    .chat-container.hidden {
        display: none !important;
    }

    .chat-header {
        padding: 10px 15px;
        min-height: 44px;
    }

    .jarvis-logo {
        font-size: 16px;
        letter-spacing: 3px;
    }

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

    .chat-messages {
        padding: 12px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .message-content {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 12px;
        max-width: 90%;
    }

    .message-content pre {
        max-width: calc(100vw - 60px);
        font-size: 12px;
    }

    .message-content code {
        font-size: 12px;
    }

    /* Chat input — bigger touch targets */
    .chat-input-container {
        padding: 8px 12px;
        gap: 8px;
    }

    .chat-input {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 10px 14px;
        min-height: 44px;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    /* Always show input on mobile when chat is open */
    .chat-container:not(.hidden) .chat-input-container {
        display: flex !important;
    }

    /* Hide all HUD panels on mobile by default */
    .hud-panel {
        display: none;
    }

    /* Show HUD panels only when HUD tab is active.
       Stack them vertically in a scrollable column so they never overlap
       each other or the mobile nav (with its protruding mic). */
    .hud-panel.mobile-show {
        display: block !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin-bottom: 10px !important;
        max-height: none !important;
    }
    /* Container that holds the visible panels, scrolls inside */
    .hud-overlay.mobile-hud-active {
        position: fixed !important;
        top: env(safe-area-inset-top, 0px) !important;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 0 !important;
        z-index: 200;
    }

    .hud-panel.top-left.mobile-show {
        top: 10px;
    }

    .hud-panel.top-right.mobile-show {
        top: 10px;
        left: auto;
        right: 10px;
        max-width: 50%;
    }

    .hud-panel.bottom-left.mobile-show,
    .hud-panel.bottom-right.mobile-show {
        bottom: 70px;
    }

    .panel-title {
        font-size: 10px;
        letter-spacing: 2px;
        margin-bottom: 8px;
        padding-bottom: 5px;
    }

    .status-item {
        font-size: 10px;
        gap: 6px;
        margin-bottom: 8px;
    }

    .status-item .label {
        font-size: 9px;
        min-width: 55px;
    }

    .status-item .value {
        font-size: 10px;
    }

    .time-large {
        font-size: 20px;
        letter-spacing: 2px;
    }

    /* Hide CPU/RAM/DISK/UPTIME on mobile to save space */
    #cpuRow, #ramRow, #diskRow, #uptimeRow {
        display: none;
    }

    .listening-indicator {
        bottom: 75px;
        padding: 10px 20px;
    }

    .listening-text {
        font-size: 12px;
    }

    /* Settings panel full width */
    .settings-panel {
        width: 100% !important;
        right: -100% !important;
    }

    .settings-panel.open {
        right: 0 !important;
    }

    .settings-toggle-btn {
        display: none;
    }

    /* Floating, draggable window on mobile (not full-screen) so it can be
       moved around. Grab the title bar to slide it. */
    .modal-container {
        position: fixed !important;
        top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        left: 3vw !important;
        right: auto !important;
        bottom: auto !important;
        width: 94vw !important;
        max-width: 94vw !important;
        height: auto !important;
        max-height: 72vh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .modal-header { cursor: move; touch-action: none; }

    .modal-container .modal-content {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;
    }

    /* Stop modals from getting offset right when stacked on mobile */
    .modal-container.focused {
        z-index: 10001;
    }

    /* Notifications: stack at top of screen, fit within viewport.
       Override base styles that center via translateX(-50%) and use min-width:300px. */
    #notificationContainer,
    .notification-container {
        position: fixed !important;
        top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        max-width: none !important;
        width: auto !important;
        z-index: 9999;
    }

    .notification {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 6px !important;
        box-sizing: border-box !important;
        padding: 12px 14px !important;
    }

    /* Camera alerts smaller on mobile */
    #cameraAlertContainer {
        width: calc(100vw - 20px);
        right: 10px;
        top: 10px;
    }

    .camera-alert-thumbnail {
        max-height: 120px;
    }

    /* Monitor widget above mobile nav */
    #cameraMonitorWidget {
        bottom: 70px;
    }

    /* Quick actions above mobile nav */
    .quick-actions-bar {
        bottom: 75px;
    }

    /* Macro panel */
    .macro-panel {
        width: calc(100vw - 20px);
        max-width: none;
        bottom: 70px;
    }

    /* Wake word indicator above mobile nav */
    #wake-word-indicator > div {
        bottom: 75px !important;
    }

    /* HUD panels in mobile-show mode must not overlap the bottom nav */
    .hud-panel.mobile-show {
        max-height: calc(100vh - 80px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .hud-panel.bottom-left.mobile-show,
    .hud-panel.bottom-right.mobile-show {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* === Small phones (iPhone SE, older Android) === */
@media (max-width: 380px) {
    .arc-reactor-container {
        width: min(72vw, calc(100vh - 180px), 280px) !important;
        height: min(72vw, calc(100vh - 180px), 280px) !important;
    }
    .mobile-nav-btn {
        font-size: 8px !important;
        min-width: 44px !important;
        padding: 6px 4px !important;
    }
    .mobile-nav-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
    .mobile-nav-btn.voice-nav-btn {
        width: 50px !important;
        height: 50px !important;
        transform: translateX(-50%) translateY(-18px) !important;
    }
    .jarvis-logo {
        font-size: 14px !important;
        letter-spacing: 2px !important;
    }
}

/* === Landscape phone — short height, wide screen === */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    /* Reactor must shrink to fit the short height */
    .arc-reactor-container {
        width: min(60vh, 35vw, 220px) !important;
        height: min(60vh, 35vw, 220px) !important;
        top: calc(50% - 25px) !important;
    }
    /* Shorter nav so it doesn't dominate the screen */
    .mobile-nav {
        height: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .mobile-nav-btn.voice-nav-btn {
        width: 48px !important;
        height: 48px !important;
        transform: translateX(-50%) translateY(-16px) !important;
    }
    /* Chat container respects shorter nav */
    .chat-container {
        bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
    }
    /* Hide reactor status text — no room */
    .reactor-status {
        font-size: 10px !important;
    }
}

/* === Tablet portrait (iPad, larger Android tablets) === */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    /* Bigger reactor to fill the larger screen */
    .arc-reactor-container {
        width: min(60vw, 70vh, 480px) !important;
        height: min(60vw, 70vh, 480px) !important;
    }
    /* Show mobile nav on tablets too — better one-handed UX */
    .mobile-nav {
        display: flex !important;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .arc-reactor-container.tablet-fix {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    /* Apply the same chat full-screen behavior as phones */
    .chat-container {
        position: fixed !important;
        top: env(safe-area-inset-top, 0px) !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        border-radius: 0 !important;
        z-index: 50;
    }
    .chat-container.hidden {
        display: none !important;
    }
}

/* === Tablet landscape (iPad in landscape, ~1024-1366) === */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
    .arc-reactor-container {
        width: min(50vh, 500px) !important;
        height: min(50vh, 500px) !important;
    }
}

/* Continuous Conversation Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Ready indicator styling */
.ready-indicator {
    transition: all 0.3s ease;
}

.ready-indicator:hover {
    background: rgba(0, 217, 255, 0.2) !important;
    transform: translateX(5px);
}

/* ==================== SETTINGS PANEL ==================== */
.settings-toggle-btn {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(0, 10, 20, 0.8);
    border: 1px solid rgba(var(--primary-color), 0.4);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    color: var(--primary-hex);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-toggle-btn:hover {
    border-color: var(--primary-hex);
    box-shadow: 0 0 15px rgba(var(--primary-color), 0.4);
    transform: translateX(-50%) rotate(45deg);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 10, 20, 0.97), rgba(0, 5, 15, 0.98));
    border-left: 1px solid rgba(var(--primary-color), 0.4);
    z-index: 500;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header-title {
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--primary-hex);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(var(--primary-color), 0.5);
}

.settings-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close-btn:hover {
    color: #ff4444;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

.settings-body::-webkit-scrollbar {
    width: 5px;
}

.settings-body::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color), 0.3);
    border-radius: 3px;
}

.settings-group {
    margin-bottom: 22px;
}

.settings-group-title {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(var(--primary-color), 0.7);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.15);
    font-weight: 600;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
}

.settings-label {
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

.settings-select {
    background: rgba(0, 10, 20, 0.8);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 4px;
    color: var(--primary-hex);
    font-size: 10px;
    padding: 5px 8px;
    max-width: 160px;
    outline: none;
    cursor: pointer;
}

.settings-select:focus {
    border-color: var(--primary-hex);
}

.settings-range {
    -webkit-appearance: none;
    width: 120px;
    height: 4px;
    background: rgba(var(--primary-color), 0.2);
    border-radius: 2px;
    outline: none;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-hex);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(var(--primary-color), 0.6);
}

.settings-toggle {
    position: relative;
    width: 40px;
    height: 20px;
    background: rgba(var(--primary-color), 0.15);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(var(--primary-color), 0.3);
    transition: all 0.3s;
}

.settings-toggle.active {
    background: rgba(var(--primary-color), 0.3);
    border-color: var(--primary-hex);
}

.settings-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(var(--primary-color), 0.5);
    transition: all 0.3s;
}

.settings-toggle.active::after {
    left: 22px;
    background: var(--primary-hex);
    box-shadow: 0 0 8px rgba(var(--primary-color), 0.6);
}

/* Color picker */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.color-option.active {
    border-color: #fff;
    box-shadow: 0 0 12px currentColor;
}

.color-option.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.settings-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    font-size: 10px;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.settings-btn:hover {
    border-color: var(--primary-hex);
    background: rgba(var(--primary-color), 0.1);
}

.settings-btn.danger {
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff6666;
}

.settings-btn.danger:hover {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.settings-input {
    background: rgba(0, 10, 20, 0.6);
    border: 1px solid rgba(var(--primary-color), 0.2);
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 4px;
    width: 160px;
    transition: border-color 0.3s;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-hex);
    box-shadow: 0 0 8px rgba(var(--primary-color), 0.2);
}

.settings-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-size: 10px;
}

.settings-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 1px;
}

/* ==================== SESSION BROWSER ==================== */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-item {
    padding: 12px 15px;
    background: rgba(var(--primary-color), 0.05);
    border: 1px solid rgba(var(--primary-color), 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.session-item:hover {
    background: rgba(var(--primary-color), 0.1);
    border-color: rgba(var(--primary-color), 0.5);
    transform: translateX(3px);
}

.session-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.1);
    color: rgba(255, 59, 48, 0.6);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.session-item:hover .session-delete-btn {
    opacity: 1;
}

.session-delete-btn:hover {
    background: rgba(255, 59, 48, 0.3);
    border-color: #ff3b30;
    color: #ff6b6b;
}

.session-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.session-item-date {
    font-size: 11px;
    color: var(--primary-hex);
    letter-spacing: 1px;
    font-weight: 600;
}

.session-item-count {
    font-size: 9px;
    color: rgba(var(--primary-color), 0.5);
    letter-spacing: 1px;
}

.session-item-preview {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-back-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    font-size: 10px;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    margin-bottom: 15px;
}

.session-back-btn:hover {
    border-color: var(--primary-hex);
    background: rgba(var(--primary-color), 0.1);
}

/* ==================== MOBILE BOTTOM NAV ==================== */
.mobile-nav {
    display: none;
    /* `position: fixed` creates a containing block, so absolute children
       (the mic) position relative to the nav, not the viewport */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(0, 10, 20, 0.95), rgba(0, 5, 15, 0.98));
    border-top: 1px solid rgba(var(--primary-color), 0.3);
    z-index: 300;
    backdrop-filter: blur(15px);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: center;
    justify-content: space-between;
}

/* Outer side buttons share the bar; mic floats over the center */
.mobile-nav > .mobile-nav-btn:not(.voice-nav-btn) {
    flex: 1 1 0;
    min-width: 0;
}

/* Center the mic horizontally inside the nav, sticking up slightly.
   Anchored to the nav's BOTTOM so safe-area insets don't push it off. */
.mobile-nav-btn.voice-nav-btn {
    position: absolute !important;
    left: 50% !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    z-index: 2;
}

.mobile-nav-btn {
    background: none;
    border: none;
    color: rgba(var(--primary-color), 0.5);
    font-size: 9px;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    min-width: 54px;
    transition: all 0.3s;
}

.mobile-nav-btn.active {
    color: var(--primary-hex);
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-btn.voice-nav-btn {
    background: rgba(var(--primary-color), 0.15);
    border: 2px solid rgba(var(--primary-color), 0.5);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    margin-top: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-btn.voice-nav-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-btn.voice-nav-btn.active {
    border-color: #00ff64;
    color: #00ff64;
    background: rgba(0, 255, 100, 0.15);
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex !important;
    }
}

/* ==================== MARKDOWN RENDERING ==================== */
.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: #fff;
    font-weight: 600;
}

.message-content em {
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

/* Inline code */
.message-content code {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.2);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-hex);
}

/* Code blocks */
.message-content pre {
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(var(--primary-color), 0.25);
    border-left: 3px solid rgba(var(--primary-color), 0.6);
    border-radius: 6px;
    padding: 12px 15px;
    margin: 10px 0;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.message-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85em;
    line-height: 1.5;
}

.message-content pre::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

.message-content pre::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color), 0.3);
    border-radius: 3px;
}

.message-content pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

/* Links */
.message-content a {
    color: var(--primary-hex);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--primary-color), 0.3);
    transition: all 0.2s;
}

.message-content a:hover {
    border-bottom-color: var(--primary-hex);
    text-shadow: 0 0 8px rgba(var(--primary-color), 0.4);
}

.modal-content a {
    color: var(--primary-hex);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--primary-color), 0.3);
    transition: all 0.2s;
    cursor: pointer;
}

.modal-content a:hover {
    border-bottom-color: var(--primary-hex);
    text-shadow: 0 0 8px rgba(var(--primary-color), 0.4);
}

/* Lists */
.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 22px;
}

.message-content li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.message-content ul li::marker {
    color: rgba(var(--primary-color), 0.6);
}

.message-content ol li::marker {
    color: var(--primary-hex);
}

/* Blockquotes */
.message-content blockquote {
    border-left: 3px solid rgba(var(--primary-color), 0.5);
    margin: 10px 0;
    padding: 8px 15px;
    background: rgba(var(--primary-color), 0.05);
    border-radius: 0 6px 6px 0;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

.message-content blockquote p {
    margin: 0;
}

/* Headings (scaled down for chat context) */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    color: var(--primary-hex);
    margin: 12px 0 6px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.message-content h1 { font-size: 1.2em; }
.message-content h2 { font-size: 1.1em; }
.message-content h3 { font-size: 1.05em; }
.message-content h4,
.message-content h5,
.message-content h6 { font-size: 1em; }

/* Tables */
.message-content table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    font-size: 0.9em;
}

.message-content th,
.message-content td {
    border: 1px solid rgba(var(--primary-color), 0.2);
    padding: 6px 10px;
    text-align: left;
}

.message-content th {
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-hex);
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.message-content td {
    color: rgba(255, 255, 255, 0.8);
}

.message-content tr:hover td {
    background: rgba(var(--primary-color), 0.05);
}

/* Horizontal rule */
.message-content hr {
    border: none;
    border-top: 1px solid rgba(var(--primary-color), 0.2);
    margin: 12px 0;
}

/* Images (if any) */
.message-content img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(var(--primary-color), 0.2);
    margin: 8px 0;
}

/* Conversation text in modals should also support markdown */
.conversation-text pre {
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(var(--primary-color), 0.25);
    border-left: 3px solid rgba(var(--primary-color), 0.6);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.conversation-text code {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.2);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-hex);
}

.conversation-text pre code {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
}

/* ==================== QUICK ACTIONS BAR ==================== */

.quick-actions-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(0, 217, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    min-width: 56px;
}

.quick-action-btn:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.4);
    color: #00d9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.15);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn svg {
    opacity: 0.8;
}

.quick-action-btn:hover svg {
    opacity: 1;
}

/* ==================== MACRO PANEL ==================== */

.macro-panel {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    max-height: 350px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    z-index: 150;
    overflow: hidden;
}

.macro-panel.hidden {
    display: none;
}

.macro-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.macro-panel-header .panel-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: rgba(0, 217, 255, 0.6);
}

.macro-panel-content {
    padding: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.macro-card {
    background: rgba(0, 217, 255, 0.04);
    border: 1px solid rgba(0, 217, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.macro-card:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
}

.macro-card-name {
    color: #00d9ff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
}

.macro-card-desc {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
}

.macro-card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 9px;
    color: rgba(0, 255, 157, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.macro-empty {
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.5;
}

/* ==================== REMINDER PANEL ==================== */
.reminder-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 90vw;
    max-height: 70vh;
    background: rgba(5, 10, 20, 0.95);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    z-index: 500;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.1);
}

.reminder-panel.hidden {
    display: none;
}

.reminder-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

.reminder-panel-content {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    max-height: 50vh;
}

.reminder-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 217, 255, 0.04);
    border: 1px solid rgba(0, 217, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.reminder-card:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
}

.reminder-card-body {
    flex: 1;
    min-width: 0;
}

.reminder-card-msg {
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-card-time {
    color: rgba(0, 255, 157, 0.7);
    font-size: 10px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reminder-recurring {
    background: rgba(0, 217, 255, 0.15);
    color: #00d9ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    margin-left: 6px;
}

.reminder-delete-btn {
    background: none;
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff3b30;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.reminder-delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
}

/* Priority styles */
.reminder-urgent { border-color: rgba(255, 59, 48, 0.5); background: rgba(255, 59, 48, 0.08); }
.reminder-high { border-color: rgba(255, 165, 0, 0.4); background: rgba(255, 165, 0, 0.06); }
.reminder-low { opacity: 0.7; }

.reminder-priority {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 6px;
    letter-spacing: 0.5px;
}
.reminder-priority-urgent { background: rgba(255, 59, 48, 0.3); color: #ff3b30; }
.reminder-priority-high { background: rgba(255, 165, 0, 0.3); color: #ffa500; }
.reminder-priority-low { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }

/* ==================== COMMAND PALETTE ==================== */
.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    animation: fadeIn 0.15s ease-out;
}

.command-palette-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.command-palette-dialog {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    max-width: 90vw;
    background: rgba(5, 15, 25, 0.98);
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 14px;
    box-shadow: 0 0 60px rgba(0, 217, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

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

.command-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
    color: rgba(0, 217, 255, 0.5);
}

.command-palette-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.command-palette-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.command-palette-input-wrap kbd {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.35);
    font-family: inherit;
    letter-spacing: 0.5px;
}

.command-palette-results {
    max-height: 350px;
    overflow-y: auto;
    padding: 6px;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.command-palette-item.active,
.command-palette-item:hover {
    background: rgba(0, 217, 255, 0.1);
}

.command-palette-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.command-palette-label {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
}

.command-palette-item kbd {
    font-size: 9px;
    padding: 2px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.3);
    font-family: inherit;
}

.command-palette-empty {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    line-height: 1.6;
}

.command-palette-empty span {
    font-size: 11px;
    opacity: 0.6;
}

/* ==================== CODE BLOCK COPY BUTTONS ==================== */
.code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 10px;
    font-size: 10px;
    font-family: inherit;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(0, 217, 255, 0.6);
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    z-index: 5;
}

pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.4);
    color: #00d9ff;
}

.code-copy-btn.copied {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
}

/* ==================== SCROLL TO BOTTOM ==================== */
.scroll-bottom-btn {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid rgba(0, 217, 255, 0.4);
    color: #00d9ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.scroll-bottom-btn:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: #00d9ff;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.scroll-bottom-btn.hidden {
    display: none;
}

.unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.unread-badge.hidden {
    display: none;
}

/* ==================== BUTTON RIPPLE EFFECT ==================== */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==================== TOOL EXECUTING BADGE ==================== */
.tool-executing-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 4px 10px;
    background: rgba(0, 217, 255, 0.06);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px;
    font-size: 11px;
    color: rgba(0, 217, 255, 0.7);
    letter-spacing: 0.5px;
    animation: fadeIn 0.2s ease-out;
}

.tool-executing-badge.hidden {
    display: none;
}

.tool-badge-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.tool-executing-badge strong {
    color: #00d9ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== CAMERA FEED MODAL ==================== */

.camera-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 8px 0;
}

.camera-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--primary-color), 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.camera-card-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(var(--primary-color), 0.1);
}

.camera-name {
    color: var(--primary-hex);
    font-size: 13px;
    font-weight: 600;
}

.camera-location {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.camera-embed {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.5);
}

.camera-embed iframe {
    display: block;
}

.camera-preview-placeholder {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(var(--primary-color), 0.2);
    min-height: 120px;
}

.camera-card-footer {
    padding: 6px 12px;
    border-top: 1px solid rgba(var(--primary-color), 0.1);
    text-align: right;
}

.camera-link-btn {
    color: var(--primary-hex) !important;
    font-size: 12px;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.camera-link-btn:hover {
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(var(--primary-color), 0.5) !important;
}

/* ==================== CAMERA ALERTS ==================== */

#cameraAlertContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 340px;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.camera-alert {
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    pointer-events: all;
    animation: cameraAlertSlideIn 0.3s ease-out;
    border-left: 3px solid #64ffda;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, opacity 0.2s;
}

.camera-alert:hover {
    transform: translateX(-5px);
    border-left-width: 5px;
}

.camera-alert-motion {
    border-left-color: #ff6b35;
}

.camera-alert-face {
    border-left-color: #ff4757;
}

.camera-alert-object {
    border-left-color: #3742fa;
}

.camera-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.camera-alert-icon {
    font-size: 16px;
}

.camera-alert-camera {
    font-weight: 600;
    color: #ccd6f6;
    font-size: 13px;
    flex: 1;
}

.camera-alert-time {
    color: #8892b0;
    font-size: 11px;
}

.camera-alert-close {
    background: none;
    border: none;
    color: #8892b0;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.camera-alert-close:hover {
    color: #ff4757;
}

.camera-alert-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.camera-alert-details {
    color: #a8b2d1;
    font-size: 12px;
}

.camera-alert-thumbnail {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    max-height: 180px;
    object-fit: cover;
}

.camera-alert-thumbnail:hover {
    opacity: 0.8;
}

@keyframes cameraAlertSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes cameraAlertSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Camera Monitor Widget */
#cameraMonitorWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 15, 30, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 25px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9000;
    font-size: 12px;
    color: #ccd6f6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.monitor-widget-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: monitorPulse 2s ease-in-out infinite;
}

.monitor-widget-text {
    color: #64ffda;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.monitor-widget-count {
    color: #8892b0;
    font-size: 11px;
}

.monitor-widget-stop {
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.4);
    color: #ff4757;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.monitor-widget-stop:hover {
    background: rgba(255, 71, 87, 0.4);
}

@keyframes monitorPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #00ff88; }
    50% { opacity: 0.5; box-shadow: 0 0 8px #00ff88; }
}

/* ==================== BLINK DASHBOARD ==================== */
#blinkDashboard {
    color: var(--primary-hex);
    width: 90vw;
    max-width: 1100px;
    max-height: calc(85vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Make the modal that wraps the dashboard wider */
.modal-container:has(#blinkDashboard) {
    width: 90vw !important;
    max-width: 1100px !important;
    max-height: 85vh !important;
}

.modal-container:has(#blinkDashboard) .modal-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.blink-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px 0;
    border-bottom: 1px solid rgba(var(--primary-color), 0.2);
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.blink-header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.blink-interval-select {
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 5px 8px;
    font-size: 10px;
    letter-spacing: 1px;
    border-radius: 4px;
    font-family: inherit;
    cursor: pointer;
}

.blink-manage-btn {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 5px 12px;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
}

.blink-manage-btn:hover {
    background: rgba(var(--primary-color), 0.25);
}

.blink-refresh-btn {
    background: rgba(var(--primary-color), 0.15);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 6px 14px;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    transition: all 0.2s;
}

.blink-refresh-btn:hover {
    background: rgba(var(--primary-color), 0.3);
    box-shadow: 0 0 8px rgba(var(--primary-color), 0.5);
}

.blink-refresh-status {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 1px;
}

.blink-networks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.blink-network {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(var(--primary-color), 0.3);
    background: rgba(0, 10, 20, 0.5);
    font-size: 11px;
}

.blink-network.armed {
    border-color: rgba(0, 255, 100, 0.5);
    background: rgba(0, 80, 30, 0.2);
}

.blink-network.disarmed {
    border-color: rgba(255, 100, 100, 0.4);
    background: rgba(80, 30, 30, 0.2);
}

.blink-network-name {
    font-weight: 600;
    letter-spacing: 1px;
}

.blink-network-status {
    font-size: 9px;
    letter-spacing: 1.5px;
    opacity: 0.85;
}

.blink-network.armed .blink-network-status { color: #00ff64; }
.blink-network.disarmed .blink-network-status { color: #ff6464; }

.blink-network-count {
    font-size: 10px;
    opacity: 0.7;
}

.blink-arm-btn {
    background: rgba(var(--primary-color), 0.15);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
    margin-left: auto;
}

.blink-arm-btn:hover {
    background: rgba(var(--primary-color), 0.3);
}

.blink-camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.blink-camera-card {
    background: rgba(0, 10, 20, 0.6);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.blink-camera-card:hover {
    border-color: rgba(var(--primary-color), 0.6);
    box-shadow: 0 0 10px rgba(var(--primary-color), 0.3);
}

.blink-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    cursor: zoom-in;
}

.blink-thumb-wrapper:hover .blink-thumb {
    transform: scale(1.03);
}

.blink-live-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 50, 50, 0.95);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(255, 50, 50, 0.6);
    animation: liveBadgePulse 1.5s ease-in-out infinite;
}

@keyframes liveBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.blink-cam-buttons {
    display: flex;
    gap: 6px;
}

.blink-cam-buttons button {
    flex: 1;
}

.blink-live-btn {
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid rgba(255, 50, 50, 0.4);
    color: #ff6464;
    padding: 5px 10px;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
    transition: all 0.2s;
}

.blink-live-btn:hover:not(:disabled) {
    background: rgba(255, 50, 50, 0.3);
}

.blink-live-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blink-live-btn.active {
    background: rgba(255, 50, 50, 0.5);
    color: #fff;
    animation: liveBadgePulse 1.5s ease-in-out infinite;
}

/* Camera hidden state */
.blink-camera-card.hidden-camera {
    display: none;
}

/* Lightbox */
.blink-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
}

.blink-lightbox img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border: 1px solid rgba(var(--primary-color), 0.5);
    box-shadow: 0 0 30px rgba(var(--primary-color), 0.3);
    cursor: default;
}

.blink-lightbox-info {
    position: absolute;
    top: 20px;
    left: 30px;
    color: var(--primary-hex);
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.blink-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--primary-hex);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

/* Manage cameras panel */
.blink-manage-panel {
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.blink-manage-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.blink-manage-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(var(--primary-color), 0.1);
    font-size: 11px;
}

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

.blink-manage-row label {
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blink-manage-row input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary-hex);
}

.blink-manage-network {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.blink-manage-add-note {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--primary-color), 0.15);
    line-height: 1.5;
}

.blink-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.blink-thumb-error {
    opacity: 0.3;
}

.blink-motion-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 71, 87, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.6);
}

.blink-cam-info {
    padding: 10px 12px;
}

.blink-cam-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.blink-cam-meta {
    display: flex;
    gap: 10px;
    font-size: 10px;
    opacity: 0.75;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.blink-snap-btn {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    padding: 5px 10px;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
    width: 100%;
    transition: all 0.2s;
}

.blink-snap-btn:hover:not(:disabled) {
    background: rgba(var(--primary-color), 0.25);
}

.blink-snap-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blink-loading,
.blink-empty,
.blink-error {
    padding: 40px 20px;
    text-align: center;
    opacity: 0.7;
    font-size: 12px;
    letter-spacing: 1px;
}

.blink-error {
    color: #ff6464;
    opacity: 0.9;
}

@media (max-width: 768px) {
    #blinkDashboard {
        min-width: auto;
    }
    .blink-camera-grid {
        grid-template-columns: 1fr;
    }
    .blink-network {
        font-size: 10px;
    }
}

/* ==================== LIVE CAMERAS PANEL ==================== */
#liveCamerasDashboard {
    color: var(--primary-hex);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
}

.livecam-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.2);
}

.livecam-search,
.livecam-category {
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px;
    font-family: inherit;
}
.livecam-search {
    flex: 1;
    min-width: 160px;
}
.livecam-search::placeholder {
    color: rgba(var(--primary-color), 0.4);
}
.livecam-btn {
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 8px 12px; font-size: 13px; border-radius: 4px; cursor: pointer;
    font-family: inherit; white-space: nowrap; transition: all .15s;
}
.livecam-btn:hover { border-color: rgba(var(--primary-color), 0.9); background: rgba(var(--primary-color), 0.12); }
.livecam-btn.on { background: rgba(var(--primary-color), 0.25); border-color: rgba(var(--primary-color), 1); color: #fff; }
/* favorite star + distance on cards */
.livecam-fav {
    position: absolute; top: 6px; right: 6px; z-index: 3;
    background: rgba(0, 10, 20, 0.65); border: none; color: #ffd85f;
    font-size: 18px; line-height: 1; width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; opacity: 0.85;
}
.livecam-fav:hover, .livecam-fav.on { opacity: 1; background: rgba(0, 10, 20, 0.85); }
.livecam-dist {
    position: absolute; bottom: 6px; right: 6px; z-index: 2;
    background: rgba(0, 10, 20, 0.8); color: #7fd6ee; font-size: 11px;
    padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(var(--primary-color), 0.3);
}
/* multi-view wall */
.livecam-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; grid-column: 1 / -1; }
.livecam-wall-cell { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid rgba(var(--primary-color), 0.4); border-radius: 6px; overflow: hidden; }
.livecam-wall-cell iframe, .livecam-wall-cell img { width: 100%; height: 100%; border: 0; object-fit: cover; }
.livecam-wall-label { position: absolute; top: 0; left: 0; z-index: 2; background: rgba(0, 10, 20, 0.75); color: var(--primary-hex); font-size: 11px; padding: 3px 8px; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.livecam-fullscreen { position: absolute; top: 10px; right: 52px; z-index: 5; background: rgba(0,10,20,0.8); border: 1px solid rgba(var(--primary-color),0.4); color: var(--primary-hex); width: 34px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.livecam-fullscreen:hover { border-color: rgba(var(--primary-color), 1); }

.livecam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.livecam-card {
    background: rgba(0, 10, 20, 0.6);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.livecam-card:hover {
    border-color: rgba(var(--primary-color), 0.7);
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.4);
    transform: translateY(-2px);
}

.livecam-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0a1419, #1a3a4a);
    overflow: hidden;
}
.livecam-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.livecam-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: var(--primary-hex);
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
}
.livecam-card:hover .livecam-play-overlay {
    opacity: 1;
    background: rgba(0, 217, 255, 0.2);
}
.livecam-category-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary-hex);
    padding: 2px 8px;
    font-size: 9px;
    letter-spacing: 1px;
    border-radius: 3px;
    text-transform: uppercase;
}

.livecam-info {
    padding: 10px 12px;
}
.livecam-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    color: #fff;
}
.livecam-location {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.livecam-loading,
.livecam-empty,
.livecam-error {
    padding: 50px 20px;
    text-align: center;
    opacity: 0.7;
    font-size: 13px;
    grid-column: 1 / -1;
}
.livecam-error {
    color: #ff6464;
    opacity: 0.9;
}

/* The video player overlay (shown when a camera is clicked) */
.livecam-player {
    position: fixed;
    inset: 20px;
    background: rgba(0, 0, 0, 0.96);
    border: 1px solid rgba(var(--primary-color), 0.5);
    border-radius: 10px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
}
.livecam-player.hidden {
    display: none !important;
}
.livecam-player-title {
    padding: 14px 20px;
    color: var(--primary-hex);
    font-size: 14px;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.3);
    padding-right: 60px;
}
.livecam-close-player {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--primary-hex);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 12px;
    z-index: 1;
}
.livecam-player-frame {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}
.livecam-player-frame iframe,
.livecam-player-frame video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Responsive layouts */
@media (max-width: 768px) {
    .livecam-header {
        flex-direction: column;
        gap: 6px;
    }
    .livecam-search,
    .livecam-category {
        width: 100%;
        font-size: 16px; /* prevent iOS zoom */
    }
    .livecam-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .livecam-name {
        font-size: 11px;
    }
    .livecam-location {
        font-size: 9px;
    }
    .livecam-info {
        padding: 6px 8px;
    }
    .livecam-player {
        inset: 0;
        border-radius: 0;
        border: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-top: env(safe-area-inset-top, 0px);
    }
    .livecam-player-title {
        font-size: 11px;
        padding: 10px 14px;
        padding-right: 50px;
    }
}

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

@media (min-width: 769px) and (max-width: 1024px) {
    .livecam-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* ==================== WEATHER FORECAST PANEL ==================== */
#weatherForecastDash {
    color: var(--primary-hex);
    min-width: 320px;
}
.forecast-location {
    font-size: 11px;
    letter-spacing: 2px;
    opacity: 0.6;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 14px;
}
.forecast-current {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.2);
}
.forecast-current-temp {
    font-size: 56px;
    font-weight: 200;
    color: var(--primary-hex);
    text-shadow: 0 0 18px rgba(var(--primary-color), 0.5);
    line-height: 1;
}
.forecast-current-condition {
    font-size: 14px;
    margin: 8px 0 6px;
    color: rgba(255, 255, 255, 0.85);
}
.forecast-current-meta {
    font-size: 10px;
    opacity: 0.5;
    letter-spacing: 0.5px;
}

.forecast-days-title {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 10px;
}
.forecast-days {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.forecast-day {
    flex: 1 0 64px;
    min-width: 64px;
    background: rgba(0, 10, 20, 0.5);
    border: 1px solid rgba(var(--primary-color), 0.2);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}
.forecast-day-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-hex);
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}
.forecast-day-condition {
    font-size: 9px;
    opacity: 0.6;
    height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    line-height: 1.2;
}
.forecast-day-temps {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.forecast-high { color: #ff7755; font-weight: 600; }
.forecast-low { color: rgba(0, 217, 255, 0.7); }

.forecast-loading, .forecast-error {
    padding: 30px;
    text-align: center;
    opacity: 0.7;
}
.forecast-error { color: #ff6b7a; }

/* ==================== STARK NOTIFICATION BANNER ==================== */
.stark-banner {
    --stark-banner-color: var(--primary-hex);
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 70px);
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    width: 90vw;
    max-width: 600px;
    background: rgba(0, 8, 14, 0.96);
    border: 1px solid var(--stark-banner-color);
    border-radius: 8px;
    padding: 14px 18px 10px;
    z-index: 9999;
    backdrop-filter: blur(14px);
    box-shadow:
        0 0 32px var(--stark-banner-color),
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 0 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: auto;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stark-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.stark-banner.dismissing {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* Corner brackets — Stark UI signature */
.stark-banner-bracket {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--stark-banner-color);
    border-style: solid;
    pointer-events: none;
}
.stark-banner-bracket.left {
    top: 4px;
    left: 4px;
    border-width: 2px 0 0 2px;
}
.stark-banner-bracket.right {
    bottom: 4px;
    right: 4px;
    border-width: 0 2px 2px 0;
}

.stark-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0;
}
.stark-banner-icon {
    font-size: 30px;
    flex-shrink: 0;
    text-shadow: 0 0 12px var(--stark-banner-color);
    animation: starkBannerIcon 1.4s ease-in-out infinite;
}
@keyframes starkBannerIcon {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}
.stark-banner-text {
    flex: 1;
    min-width: 0;
}
.stark-banner-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--stark-banner-color);
    text-shadow: 0 0 8px var(--stark-banner-color);
    margin-bottom: 4px;
    text-transform: uppercase;
}
.stark-banner-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.stark-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.stark-banner-action {
    background: transparent;
    color: var(--stark-banner-color);
    border: 1px solid var(--stark-banner-color);
    padding: 6px 12px;
    font-size: 10px;
    letter-spacing: 1.5px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.stark-banner-action:hover {
    background: var(--stark-banner-color);
    color: #001018;
}
.stark-banner-close {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    border-radius: 50%;
    line-height: 1;
}

/* Sweeping progress bar at the bottom — looks like a scan */
.stark-banner-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg,
        transparent,
        var(--stark-banner-color),
        transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: starkBannerProgress 1.6s linear infinite;
    box-shadow: 0 0 8px var(--stark-banner-color);
}
@keyframes starkBannerProgress {
    0% { background-position: -50% 0; }
    100% { background-position: 150% 0; }
}

@media (max-width: 768px) {
    .stark-banner {
        top: calc(env(safe-area-inset-top, 0px) + 56px);
        max-width: calc(100vw - 16px);
        padding: 10px 14px 8px;
    }
    .stark-banner-icon { font-size: 24px; }
    .stark-banner-title { font-size: 10px; }
    .stark-banner-message { font-size: 12px; }
    .stark-banner-action { font-size: 9px; padding: 4px 8px; }
}

/* ==================== MINI-MONTH CALENDAR ==================== */
.mini-month {
    color: var(--primary-hex);
    min-width: 320px;
}
.mm-nav {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 14px;
}
.mm-nav button {
    flex: 1;
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    padding: 6px 8px;
    font-size: 11px;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.mm-nav button:hover {
    background: rgba(var(--primary-color), 0.25);
    border-color: var(--primary-hex);
}

.mm-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}
.mm-day-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    opacity: 0.5;
    text-align: center;
    padding: 4px 0;
}
.mm-day {
    position: relative;
    aspect-ratio: 1;
    background: rgba(0, 10, 20, 0.3);
    border: 1px solid rgba(var(--primary-color), 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    transition: all 0.15s;
}
.mm-day.mm-empty {
    background: transparent;
    border: none;
}
.mm-day.mm-today {
    background: var(--primary-hex);
    color: #001018;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.6);
}
.mm-day.mm-has-events {
    cursor: pointer;
    border-color: rgba(var(--primary-color), 0.4);
}
.mm-day.mm-has-events:hover {
    background: rgba(var(--primary-color), 0.2);
    border-color: var(--primary-hex);
}
.mm-event-dot {
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-hex);
    box-shadow: 0 0 6px var(--primary-hex);
}
.mm-day.mm-today .mm-event-dot {
    background: #001018;
    box-shadow: none;
}

.mm-events-today {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--primary-color), 0.2);
}
.mm-events-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 8px;
}
.mm-event-item {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.1);
}
.mm-event-item:last-child { border-bottom: none; }
.mm-event-time {
    color: var(--primary-hex);
    font-variant-numeric: tabular-nums;
    min-width: 70px;
    font-size: 11px;
}
.mm-event-title { flex: 1; }

/* ==================== CPU SPARKLINE IN AOS STRIP ==================== */
.aos-cpu {
    display: flex;
    align-items: center;
    gap: 4px;
}
.aos-cpu-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    opacity: 0.65;
}
.aos-cpu canvas {
    margin: 0 2px;
}
.aos-cpu #aosCpuValue {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 28px;
}
@media (max-width: 768px) {
    .aos-cpu canvas { width: 30px !important; }
    .aos-cpu-label { display: none; }
}
@media (max-width: 380px) {
    .aos-cpu { display: none; }
    .always-on-strip .aos-divider:nth-of-type(4) { display: none; }
}

/* ==================== DROP-ZONE OVERLAY ==================== */
.drop-zone-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 8, 14, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.drop-zone-overlay.hidden { display: none; }

.drop-zone-card {
    background: rgba(0, 14, 24, 0.95);
    border: 2px dashed var(--primary-hex);
    border-radius: 16px;
    padding: 50px 70px;
    text-align: center;
    box-shadow: 0 0 50px rgba(var(--primary-color), 0.5);
    animation: dropZonePulse 1.4s ease-in-out infinite;
}
.drop-zone-icon {
    font-size: 80px;
    text-shadow: 0 0 24px rgba(var(--primary-color), 0.6);
    margin-bottom: 14px;
}
.drop-zone-title {
    font-size: 22px;
    letter-spacing: 4px;
    color: var(--primary-hex);
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(var(--primary-color), 0.6);
    margin-bottom: 8px;
}
.drop-zone-hint {
    font-size: 11px;
    letter-spacing: 2px;
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.7);
}
@keyframes dropZonePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(var(--primary-color), 0.5); }
    50%      { transform: scale(1.03); box-shadow: 0 0 70px rgba(var(--primary-color), 0.7); }
}

/* ==================== VOICE MEMO RECORDER OVERLAY ==================== */
.voice-memo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.voice-memo-overlay.hidden { display: none; }

.voice-memo-card {
    background: rgba(0, 10, 20, 0.95);
    border: 1px solid rgba(var(--primary-color), 0.5);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 40px rgba(var(--primary-color), 0.3);
    min-width: 280px;
}
.voice-memo-pulse {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-memo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 71, 87, 0.6);
    animation: voiceMemoRing 1.4s ease-out infinite;
}
.voice-memo-ring::before, .voice-memo-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 71, 87, 0.5);
    animation: voiceMemoRing 1.4s ease-out infinite;
}
.voice-memo-ring::before { animation-delay: 0.4s; }
.voice-memo-ring::after { animation-delay: 0.8s; }
@keyframes voiceMemoRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
.voice-memo-mic {
    font-size: 38px;
    z-index: 2;
    text-shadow: 0 0 12px rgba(255, 71, 87, 0.6);
}
.voice-memo-status {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--primary-hex);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.voice-memo-time {
    font-size: 38px;
    font-variant-numeric: tabular-nums;
    color: var(--primary-hex);
    text-shadow: 0 0 12px rgba(var(--primary-color), 0.5);
    margin-bottom: 24px;
    font-weight: 200;
}
.voice-memo-controls {
    display: flex;
    gap: 10px;
}
.vm-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 11px;
    letter-spacing: 1.5px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid;
    background: transparent;
    transition: all 0.15s;
}
.vm-cancel {
    border-color: rgba(120, 120, 120, 0.4);
    color: rgba(255, 255, 255, 0.6);
}
.vm-cancel:hover {
    border-color: #ff6b7a;
    color: #ff6b7a;
}
.vm-save {
    border-color: rgba(0, 255, 100, 0.4);
    color: #00ff88;
}
.vm-save:hover {
    background: rgba(0, 255, 100, 0.15);
    border-color: #00ff88;
}

/* ==================== MINI MEDIA PLAYER ==================== */
.mini-media-player {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: rgba(0, 10, 20, 0.92);
    border: 1px solid rgba(var(--primary-color), 0.4);
    border-radius: 12px;
    padding: 8px 14px;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4),
                0 0 16px rgba(var(--primary-color), 0.25);
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 360px;
}
.mini-media-player.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
.mmp-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mmp-icon {
    font-size: 24px;
    flex-shrink: 0;
    animation: mmpPulse 2s ease-in-out infinite;
}
@keyframes mmpPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; transform: scale(1.05); }
}
.mmp-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.mmp-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-hex);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.mmp-artist {
    font-size: 10px;
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mmp-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.mmp-controls button {
    background: transparent;
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.mmp-controls button:hover {
    background: rgba(var(--primary-color), 0.2);
    border-color: var(--primary-hex);
}
.mmp-close {
    border-color: rgba(255, 71, 87, 0.3) !important;
    color: #ff6b7a !important;
}
@media (max-width: 768px) {
    .mini-media-player {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        right: 8px;
        max-width: none;
    }
}

/* ==================== QUICK-ACTION FAB + RADIAL MENU ==================== */
.quick-action-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-hex);
    color: #001018;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(var(--primary-color), 0.6),
                0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 99;
}
.quick-action-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(var(--primary-color), 0.9),
                0 6px 20px rgba(0, 0, 0, 0.5);
}
.quick-action-fab.open {
    transform: rotate(45deg);
}
.quick-action-fab.open svg {
    color: #001018;
}

.quick-action-menu {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 98;
    pointer-events: none;
}
.quick-action-menu.hidden { display: none; }

.qa-item {
    --qa-i: 0;
    --qa-total: 8;
    /* Each button slides up from 0 with stagger */
    position: absolute;
    bottom: calc(var(--qa-i) * 56px);
    right: 0;
    width: 200px;
    height: 48px;
    background: rgba(0, 10, 20, 0.92);
    border: 1px solid rgba(var(--primary-color), 0.35);
    color: var(--primary-hex);
    border-radius: 24px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    animation: qaItemIn 0.25s ease-out forwards;
    animation-delay: calc(var(--qa-i) * 35ms);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: left;
}
.qa-item:hover {
    background: rgba(var(--primary-color), 0.15);
    border-color: var(--primary-hex);
    transform: translateY(0) translateX(-4px) !important;
}
@keyframes qaItemIn {
    to { opacity: 1; transform: translateY(0); }
}
.qa-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.qa-label {
    font-weight: 500;
}

@media (max-width: 768px) {
    .quick-action-fab {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 50px;
        height: 50px;
    }
    .quick-action-menu {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
        right: 16px;
    }
    .qa-item {
        width: 170px;
        font-size: 12px;
        height: 44px;
        bottom: calc(var(--qa-i) * 50px);
    }
}

/* ==================== ACTIVITY TIMELINE ==================== */
#activityTimelineDash {
    color: var(--primary-hex);
    min-width: 320px;
}
.activity-summary {
    font-size: 11px;
    letter-spacing: 1.5px;
    opacity: 0.6;
    text-align: center;
    padding: 4px 0 14px;
    text-transform: uppercase;
}
.activity-section-title {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--primary-hex);
    padding: 14px 0 10px;
    border-top: 1px solid rgba(var(--primary-color), 0.15);
    margin-top: 8px;
}
.activity-section-title:first-child {
    border-top: none;
    margin-top: 0;
}

/* Bar chart */
.activity-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100px;
    padding: 4px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.15);
}
.activity-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 18px;
}
.activity-bar {
    width: 100%;
    background: linear-gradient(180deg,
        var(--primary-hex),
        rgba(var(--primary-color), 0.4));
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 8px rgba(var(--primary-color), 0.4);
    transition: height 0.4s ease;
    min-height: 2px;
}
.activity-bar-hour {
    background: linear-gradient(180deg,
        rgb(var(--accent-color, 255, 165, 0)),
        rgba(var(--accent-color, 255, 165, 0), 0.3));
    box-shadow: 0 0 8px rgba(var(--accent-color, 255, 165, 0), 0.4);
}
.activity-bar-label {
    font-size: 8px;
    opacity: 0.55;
    padding-top: 4px;
    letter-spacing: 0.5px;
}

/* Top commands rows */
.activity-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}
.activity-row {
    display: grid;
    grid-template-columns: 1fr 100px 30px;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    padding: 4px 0;
}
.activity-row-label {
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-row-bar {
    background: rgba(var(--primary-color), 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.activity-row-bar > div {
    height: 100%;
    background: var(--primary-hex);
    box-shadow: 0 0 6px rgba(var(--primary-color), 0.4);
    transition: width 0.4s ease;
}
.activity-row-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--primary-hex);
    font-weight: 600;
}

.activity-loading, .activity-error {
    padding: 30px 10px;
    text-align: center;
    opacity: 0.7;
}
.activity-error { color: #ff6b7a; }

/* ==================== POMODORO / FOCUS TIMER ==================== */
.pomo-card {
    text-align: center;
    padding: 16px 8px;
    color: var(--primary-hex);
}
.pomo-phase {
    font-size: 11px;
    letter-spacing: 4px;
    opacity: 0.75;
    margin-bottom: 6px;
}
.pomo-time {
    font-size: 56px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    color: var(--primary-hex);
    text-shadow: 0 0 20px rgba(var(--primary-color), 0.5);
    line-height: 1;
    margin-bottom: 18px;
}
.pomo-progress {
    background: rgba(var(--primary-color), 0.1);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 6px 14px;
}
.pomo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(var(--primary-color), 0.4),
        var(--primary-hex));
    transition: width 1s linear;
    box-shadow: 0 0 8px var(--primary-hex);
}
.pomo-cycle {
    font-size: 10px;
    opacity: 0.5;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
}
.pomo-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.pomo-controls button {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    padding: 10px 6px;
    font-size: 10px;
    letter-spacing: 1px;
    border-radius: 4px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.pomo-controls button:hover {
    background: rgba(var(--primary-color), 0.25);
    border-color: var(--primary-hex);
}
.pomo-controls .pomo-pause {
    background: rgba(255, 170, 0, 0.12);
    border-color: rgba(255, 170, 0, 0.4);
    color: #ffaa00;
    grid-column: span 1;
}
.pomo-controls .pomo-stop {
    background: rgba(255, 71, 87, 0.12);
    border-color: rgba(255, 71, 87, 0.4);
    color: #ff6b7a;
    grid-column: span 2;
}

/* ==================== THEME PRESETS PICKER ==================== */
.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 8px 0;
}
.theme-preset-card {
    --card-primary: #00d9ff;
    --card-accent: #ffaa00;
    background: rgba(0, 10, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-preset-card:hover {
    border-color: var(--card-primary);
    box-shadow: 0 0 16px var(--card-primary);
    transform: translateY(-2px);
}
.theme-preset-card.active {
    border-color: var(--card-primary);
    box-shadow: 0 0 24px var(--card-primary), inset 0 0 16px rgba(255, 255, 255, 0.05);
}
.theme-preset-swatch {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
}
.theme-preset-orb {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--card-primary) 50%, transparent 100%);
    box-shadow: 0 0 16px var(--card-primary);
    animation: themeOrbPulse 2s ease-in-out infinite;
}
.theme-preset-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--card-primary);
    opacity: 0.6;
}
.theme-preset-ring::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1px solid var(--card-accent);
    opacity: 0.6;
}
@keyframes themeOrbPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}
.theme-preset-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--card-primary);
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--card-primary);
}

/* ==================== ALWAYS-ON TOP STATUS STRIP ==================== */
.always-on-strip {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 14px;
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.25);
    border-radius: 18px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--primary-hex);
    backdrop-filter: blur(10px);
    z-index: 50;
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.15);
    transition: opacity 0.3s ease;
    user-select: none;
}
.aos-clock {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 6px rgba(var(--primary-color), 0.4);
}
.aos-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}
.aos-stat span {
    font-weight: 600;
    color: var(--primary-hex);
}
.aos-divider {
    width: 1px;
    height: 14px;
    background: rgba(var(--primary-color), 0.25);
}
.aos-battery .aos-battery-icon {
    font-size: 13px;
    line-height: 1;
}
.aos-battery.battery-low #aosBatteryValue,
.aos-battery.battery-low .aos-battery-icon {
    color: #ff6b7a;
    text-shadow: 0 0 6px rgba(255, 71, 87, 0.5);
    animation: battery-low-pulse 1.6s ease-in-out infinite;
}
.aos-battery.battery-charging #aosBatteryValue {
    color: #00ff9d;
}
@keyframes battery-low-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@media (max-width: 768px) {
    .always-on-strip {
        font-size: 10px;
        padding: 4px 10px;
        gap: 8px;
        right: 8px;
    }
    .aos-stat {
        font-size: 10px;
    }
    /* Hide weather on tiny screens to keep strip narrow */
}
@media (max-width: 380px) {
    .always-on-strip #aosWeather { display: none; }
    .always-on-strip .aos-divider:last-of-type { display: none; }
}

/* ==================== STOP TASK BUTTON ==================== */
.stop-task-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 71, 87, 0.95);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: stopBtnPulse 1.6s ease-in-out infinite;
}
.stop-task-btn:hover {
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.8),
                0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%) scale(1.05);
}
.stop-task-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}
@keyframes stopBtnPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 71, 87, 0.5), 0 4px 12px rgba(0,0,0,0.3); }
    50%      { box-shadow: 0 0 30px rgba(255, 71, 87, 0.8), 0 4px 12px rgba(0,0,0,0.3); }
}
@media (max-width: 768px) {
    .stop-task-btn {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        font-size: 11px;
        padding: 8px 16px;
    }
}

/* ==================== LIVE TRANSCRIPTION HUD ==================== */
.live-transcript-hud {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(0, 217, 255, 0.4);
    backdrop-filter: blur(10px);
    padding: 8px 14px 8px 38px;
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    letter-spacing: 0.5px;
    max-width: min(720px, calc(100vw - 24px));
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.25);
    z-index: 9998;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    line-height: 1.4;
}
.live-transcript-hud.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
}
.live-transcript-hud.final {
    color: var(--primary-hex);
    border-color: rgba(0, 217, 255, 0.7);
    box-shadow: 0 0 24px rgba(0, 217, 255, 0.5);
}
.live-transcript-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-hex);
    animation: live-transcript-pulse 1.4s ease-in-out infinite;
}
.live-transcript-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes live-transcript-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@media (max-width: 768px) {
    .live-transcript-hud {
        font-size: 12px;
        padding: 6px 12px 6px 32px;
        max-width: calc(100vw - 16px);
    }
}

/* ==================== RICH DATA CARDS ==================== */
.rich-data-card {
    color: var(--primary-hex);
}

.rich-data-header {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 6px 0 12px 0;
    border-bottom: 1px solid rgba(var(--primary-color), 0.2);
    margin-bottom: 14px;
}

.rich-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.data-tile {
    background: rgba(0, 10, 20, 0.55);
    border: 1px solid rgba(var(--primary-color), 0.25);
    border-left: 3px solid rgba(var(--primary-color), 0.8);
    border-radius: 6px;
    padding: 10px 12px;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.data-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--primary-color), 0.6);
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.3);
}

.data-tile-key {
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #7fd6ee;
    opacity: 0.9;
    margin-bottom: 5px;
}

.data-tile-val {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Severity coloring */
.data-tile.tile-ok {
    border-left-color: #00ff88;
}
.data-tile.tile-ok .data-tile-val {
    color: #00ff88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.data-tile.tile-warning {
    border-left-color: #ffaa00;
}
.data-tile.tile-warning .data-tile-val {
    color: #ffaa00;
    text-shadow: 0 0 6px rgba(255, 170, 0, 0.4);
}

.data-tile.tile-critical {
    border-left-color: #ff4757;
    background: rgba(60, 10, 15, 0.6);
}
.data-tile.tile-critical .data-tile-val {
    color: #ff6b7a;
    text-shadow: 0 0 6px rgba(255, 71, 87, 0.5);
}

/* Raw output toggle below the tiles */
.rich-data-raw {
    margin-top: 16px;
    border-top: 1px solid rgba(var(--primary-color), 0.15);
    padding-top: 10px;
    font-size: 11px;
}
.rich-data-raw summary {
    cursor: pointer;
    opacity: 0.5;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 0;
}
.rich-data-raw summary:hover {
    opacity: 0.9;
}
.rich-data-raw pre {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--primary-color), 0.15);
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .rich-data-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .data-tile {
        padding: 8px 10px;
    }
    .data-tile-val {
        font-size: 14px;
    }
}

/* ==================== PROTOCOL ACTIVATION OVERLAY ==================== */
/* Full-screen sweep + flash effect when a Stark protocol activates */
.protocol-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.protocol-overlay.gone {
    display: none;
}

/* Top-to-bottom horizontal scan line */
.protocol-overlay .protocol-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--scan-color, #00d9ff) 50%,
        transparent 100%);
    box-shadow: 0 0 30px var(--scan-color, #00d9ff),
                0 0 60px var(--scan-color, #00d9ff);
    animation: protocolScanV 1s ease-out forwards;
}

/* Side-to-side vertical scan line */
.protocol-overlay .protocol-scan-h {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--scan-color, #00d9ff) 50%,
        transparent 100%);
    box-shadow: 0 0 30px var(--scan-color, #00d9ff);
    animation: protocolScanH 0.9s ease-out 0.1s forwards;
}

/* Edge glow when triggered */
.protocol-overlay .protocol-flash {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 100px var(--scan-color, #00d9ff),
                inset 0 0 200px var(--scan-color, #00d9ff);
    opacity: 0;
    animation: protocolFlash 0.5s ease-out forwards;
}

/* Center label that announces the protocol */
.protocol-overlay .protocol-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--scan-color, #00d9ff);
    font-size: clamp(20px, 4vw, 36px);
    font-weight: 700;
    letter-spacing: 8px;
    text-shadow: 0 0 20px var(--scan-color, #00d9ff),
                 0 0 40px var(--scan-color, #00d9ff);
    text-transform: uppercase;
    opacity: 0;
    animation: protocolLabel 1.4s ease-out forwards;
    text-align: center;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes protocolScanV {
    0% { top: -10px; opacity: 0; }
    20% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
@keyframes protocolScanH {
    0% { left: -10px; opacity: 0; }
    20% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}
@keyframes protocolFlash {
    0% { opacity: 0; }
    30% { opacity: 0.8; }
    100% { opacity: 0; }
}
@keyframes protocolLabel {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ==================== STARK INTRO SEQUENCE ==================== */
.stark-intro {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.6s ease;
}
.stark-intro.fade-out {
    opacity: 0;
}
.stark-intro.gone {
    display: none;
}

.stark-intro-rings {
    position: relative;
    width: 240px;
    height: 240px;
    margin-bottom: 48px;
}
.stark-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(0, 217, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.4);
    animation: stark-ring-expand 1.6s ease-out forwards;
    opacity: 0;
}
.stark-ring-1 { animation-delay: 0s; }
.stark-ring-2 { animation-delay: 0.2s; border-color: rgba(0, 217, 255, 0.8); }
.stark-ring-3 { animation-delay: 0.4s; border-color: #fff; }

.stark-core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #00d9ff 40%, #0080a0 100%);
    box-shadow:
        0 0 60px rgba(0, 217, 255, 1),
        0 0 120px rgba(0, 217, 255, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    animation: stark-core-pulse 1.4s ease-in-out infinite;
}

@keyframes stark-ring-expand {
    0%   { transform: scale(0); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
@keyframes stark-core-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.15); }
}

.stark-intro-text {
    text-align: center;
    color: var(--primary-hex);
    font-family: 'Segoe UI', Tahoma, sans-serif;
}
.stark-intro-line {
    font-size: 13px;
    letter-spacing: 6px;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(8px);
    animation: stark-line-in 0.5s ease-out forwards;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}
.stark-intro-line[data-line="1"] { animation-delay: 0.6s; }
.stark-intro-line[data-line="2"] { animation-delay: 1.0s; }
.stark-intro-line[data-line="3"] { animation-delay: 1.4s; font-size: 11px; opacity: 0.7; }

.stark-intro-version {
    font-size: 9px;
    letter-spacing: 3px;
    margin-top: 24px;
    opacity: 0;
    color: rgba(0, 217, 255, 0.5);
    animation: stark-line-in 0.5s ease-out forwards;
    animation-delay: 1.8s;
}

@keyframes stark-line-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== STEALTH MODE STYLING ==================== */
body.stealth-active {
    /* Dim everything */
    filter: brightness(0.45) saturate(0.6);
    transition: filter 0.4s ease;
}
.stealth-indicator {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(120, 30, 200, 0.6);
    color: #c08aff;
    padding: 4px 12px;
    font-size: 10px;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 99999;
    backdrop-filter: blur(8px);
}
.stealth-indicator:hover {
    background: rgba(60, 0, 100, 0.85);
}

/* ==================== MESSAGE REACTIONS ==================== */
.message-reactions {
    display: flex;
    gap: 4px;
    padding: 4px 0 0;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.message:hover .message-reactions,
.message.message-reacting .message-reactions {
    opacity: 1;
}
.msg-react {
    background: transparent;
    border: 1px solid rgba(var(--primary-color), 0.2);
    color: rgba(255, 255, 255, 0.6);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: all 0.15s;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.msg-react:hover {
    background: rgba(var(--primary-color), 0.15);
    color: var(--primary-hex);
    border-color: rgba(var(--primary-color), 0.5);
    transform: scale(1.1);
}
.msg-react.msg-react-active {
    background: rgba(var(--primary-color), 0.3);
    color: var(--primary-hex);
    border-color: var(--primary-hex);
}
@media (max-width: 768px) {
    /* On mobile, always show reactions since hover doesn't work */
    .message-reactions {
        opacity: 0.7;
    }
    .msg-react {
        width: 28px;
        height: 28px;
    }
}

/* ==================== TOGGLE SWITCH (used in theme schedule modal) ==================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(80, 90, 110, 0.5);
    border-radius: 20px;
    transition: 0.3s;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: rgba(220, 220, 230, 0.95);
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: rgba(var(--primary-color), 0.6);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background: var(--primary-hex);
    box-shadow: 0 0 6px var(--primary-hex);
}

.modal-btn {
    background: rgba(var(--primary-color), 0.15);
    border: 1px solid rgba(var(--primary-color), 0.4);
    color: var(--primary-hex);
    padding: 6px 18px;
    font-size: 11px;
    letter-spacing: 1.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.modal-btn:hover {
    background: rgba(var(--primary-color), 0.3);
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.3);
}

/* ==================== NEW MESSAGE PILL ==================== */
.new-message-pill {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 217, 255, 0.9);
    color: #001020;
    border: none;
    border-radius: 14px;
    padding: 5px 14px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 600;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 2px 12px rgba(var(--primary-color), 0.5);
    animation: pill-appear 0.3s ease-out;
    text-transform: uppercase;
}
.new-message-pill:hover {
    background: var(--primary-hex);
    transform: translateX(-50%) scale(1.05);
}
@keyframes pill-appear {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==================== SLASH COMMAND PALETTE ==================== */
.slash-palette {
    position: fixed;
    background: rgba(0, 10, 20, 0.95);
    border: 1px solid rgba(var(--primary-color), 0.4);
    border-radius: 8px;
    padding: 4px;
    backdrop-filter: blur(12px);
    z-index: 9999;
    box-shadow: 0 0 20px rgba(var(--primary-color), 0.25);
    max-height: 320px;
    overflow-y: auto;
    user-select: none;
}
.slash-palette.hidden {
    display: none;
}
.slash-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}
.slash-item:hover,
.slash-item.slash-active {
    background: rgba(var(--primary-color), 0.18);
}
.slash-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: var(--primary-hex);
}
.slash-cmd {
    font-family: var(--mono-font, 'Consolas', monospace);
    font-size: 12px;
    color: var(--primary-hex);
}
.slash-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== REMINDERS MODAL ==================== */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}
.reminder-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 217, 255, 0.06);
    border: 1px solid rgba(var(--primary-color), 0.18);
    border-radius: 6px;
    transition: background 0.15s;
}
.reminder-row:hover {
    background: rgba(0, 217, 255, 0.1);
}
.reminder-row.reminder-overdue {
    border-color: rgba(255, 71, 87, 0.4);
    background: rgba(255, 71, 87, 0.08);
}
.reminder-content {
    flex: 1;
    min-width: 0;
}
.reminder-msg {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3px;
    word-wrap: break-word;
}
.reminder-time {
    font-size: 10px;
    color: var(--primary-hex);
    opacity: 0.7;
    letter-spacing: 0.5px;
}
.reminder-overdue .reminder-time {
    color: #ff6b7a;
}
.reminder-delete {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid rgba(255, 71, 87, 0.4);
    color: #ff6b7a;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
}
.reminder-delete:hover {
    background: rgba(255, 71, 87, 0.2);
    transform: scale(1.05);
}

/* ==================== CHEAT SHEET MODAL ==================== */
.cheat-sheet {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 4px;
}
.cheat-hint {
    font-size: 11px;
    opacity: 0.6;
    margin-bottom: 14px;
    text-align: center;
}
.cheat-section {
    margin-bottom: 18px;
}
.cheat-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--primary-hex);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(var(--primary-color), 0.2);
}
.cheat-table {
    width: 100%;
    border-collapse: collapse;
}
.cheat-table tr {
    cursor: pointer;
    transition: background 0.15s;
}
.cheat-table tr:hover {
    background: rgba(var(--primary-color), 0.08);
}
.cheat-cmd {
    font-family: var(--mono-font, 'Consolas', monospace);
    font-size: 12px;
    color: var(--primary-hex);
    padding: 5px 8px;
    width: 45%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cheat-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    padding: 5px 8px;
}
.cheat-footer {
    font-size: 10px;
    opacity: 0.5;
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--primary-color), 0.15);
    line-height: 1.6;
}

/* ==================== WORLD CLOCK MODAL ==================== */
.world-clock {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}
.wc-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    padding: 8px 12px;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(var(--primary-color), 0.15);
    border-radius: 6px;
    align-items: center;
}
.wc-city {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
}
.wc-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-hex);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 6px rgba(var(--primary-color), 0.4);
}
.wc-day {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==================== WAKE-WORD READY PILL ==================== */
.wake-pill {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 10, 20, 0.7);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 14px;
    padding: 5px 12px 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    z-index: 48;
    user-select: none;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.wake-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-hex);
    box-shadow: 0 0 6px var(--primary-hex);
    animation: wake-pill-pulse 2s ease-in-out infinite;
}
@keyframes wake-pill-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50%      { opacity: 1; transform: scale(1.15); }
}
.wake-pill-text {
    font-weight: 500;
    text-transform: uppercase;
}
@media (max-width: 768px) {
    .wake-pill { bottom: 96px; font-size: 9px; padding: 4px 10px 4px 6px; }
}

/* ==================== NEWS TICKER ==================== */
.news-ticker {
    position: fixed;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    height: 30px;
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(var(--primary-color), 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 0;
    backdrop-filter: blur(10px);
    z-index: 45;
    box-shadow: 0 0 12px rgba(var(--primary-color), 0.18);
    overflow: hidden;
    user-select: none;
}
.news-ticker-label {
    flex: 0 0 auto;
    background: linear-gradient(90deg, rgba(var(--primary-color), 0.4), rgba(var(--primary-color), 0.15));
    color: var(--primary-hex);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(var(--primary-color), 0.3);
}
.news-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.news-ticker-content {
    display: inline-block;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.3px;
    padding-left: 100%;
    animation: news-ticker-scroll 90s linear infinite;
    will-change: transform;
}
.news-ticker-content:hover {
    animation-play-state: paused;
}
.news-ticker-content .nt-item {
    display: inline-block;
    padding: 0 32px;
    cursor: pointer;
    transition: color 0.2s;
}
.news-ticker-content .nt-item:hover {
    color: var(--primary-hex);
}
.news-ticker-content .nt-sep {
    color: var(--primary-hex);
    opacity: 0.5;
    margin: 0 4px;
}
.news-ticker-close {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}
.news-ticker-close:hover {
    color: var(--primary-hex);
}
@keyframes news-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
@media (max-width: 768px) {
    .news-ticker { height: 26px; left: 8px; right: 8px; }
    .news-ticker-label { font-size: 10px; padding: 0 10px; }
    .news-ticker-content { font-size: 11px; animation-duration: 70s; }
}

/* ==================================================================
   CLEAN REACTOR HOME  (phone · tablet · desktop)
   Home is the arc reactor, alone. Every other surface — system HUD,
   chat, vision, cameras, weather, settings — stays hidden until the
   user summons it (by voice, or the ⨁ launcher), then layers over the
   reactor and closes back to this clean state. One consistent model on
   every device; each summoned surface is itself responsive.
   ================================================================== */

/* 1. Hide the always-on chrome so only the reactor shows on load. */
.always-on-strip { display: none !important; }
.quick-actions-bar { display: none !important; }
.news-ticker { display: none !important; }
.settings-toggle-btn { display: none !important; }  /* Settings lives in the launcher now */
.mobile-nav { display: none !important; }           /* launcher replaces the tab bar on every device */

/* 2. Desktop cockpit HUD (the 4 corner panels): hidden by default,
      revealed only when summoned via body.hud-cockpit. On phones the HUD
      is instead a summoned card-stack (mobile-hud-active, set inline by JS),
      so this opacity default never fights the mobile path. */
.hud-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
body.hud-cockpit .hud-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* 3. The launcher is the single control on every device. Keep it clear of
      the reactor and, on phones (nav now hidden), drop it to the corner. */
.quick-action-fab { z-index: 120; }
@media (max-width: 768px) {
    .quick-action-fab {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 18px;
    }
    .quick-action-menu {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        right: 18px;
    }
}

/* 4. A gentle breathing glow makes the launcher discoverable on the
      otherwise-empty home screen. Stops while open or hovered. */
.quick-action-fab { animation: fabBreathe 3.6s ease-in-out infinite; }
.quick-action-fab.open,
.quick-action-fab:hover { animation: none; }
@keyframes fabBreathe {
    0%, 100% { box-shadow: 0 0 14px rgba(var(--primary-color), 0.5), 0 4px 16px rgba(0,0,0,0.4); }
    50%      { box-shadow: 0 0 28px rgba(var(--primary-color), 0.95), 0 4px 20px rgba(0,0,0,0.55); }
}

/* 5. Tablet: give the reactor room to breathe, launcher a touch bigger. */
@media (min-width: 769px) and (max-width: 1024px) {
    .quick-action-fab { width: 60px; height: 60px; bottom: 28px; right: 28px; }
}

/* 6. Phone polish for the few bespoke overlays the audit flagged: the voice-
   memo recorder (stack its buttons, full-width targets) and the drag-drop
   card (smaller so it never overflows a narrow screen). */
@media (max-width: 600px) {
    .drop-zone-card { padding: 32px 26px; }
    .drop-zone-icon { font-size: 60px; }
    .drop-zone-title { font-size: 18px; letter-spacing: 2px; }
    .voice-memo-card { min-width: 0; width: 100%; max-width: 340px; padding: 26px 22px; }
    .voice-memo-controls { flex-direction: column; gap: 10px; }
    .voice-memo-controls .vm-btn { width: 100%; min-height: 46px; }
}

/* ==================== WEB ARTICLE CARDS (rich web content) ==================== */
.jv-arts { display: grid; gap: 12px; padding: 4px 2px; }
.jv-art {
    display: flex; gap: 12px; text-decoration: none; color: inherit;
    background: rgba(0, 20, 35, 0.55); border: 1px solid rgba(var(--primary-color), 0.18);
    border-radius: 12px; overflow: hidden;
    transition: border-color .2s ease, transform .12s ease, background .2s ease;
}
.jv-art:hover {
    border-color: rgba(var(--primary-color), 0.55);
    background: rgba(0, 28, 48, 0.7); transform: translateY(-1px);
}
.jv-art-img {
    flex: 0 0 108px; width: 108px; min-height: 92px;
    background-size: cover; background-position: center;
    background-color: rgba(var(--primary-color), 0.08);
}
.jv-art-noimg { display: flex; align-items: center; justify-content: center; font-size: 30px; opacity: .5; }
.jv-art-body { flex: 1; min-width: 0; padding: 10px 12px 10px 0; display: flex; flex-direction: column; gap: 5px; }
.jv-art-title { font-size: 14px; font-weight: 600; color: #eaf6ff; line-height: 1.3; }
.jv-art-snip {
    font-size: 12px; color: rgba(220, 240, 255, 0.65); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jv-art-meta { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: rgba(var(--primary-color), 0.75); margin-top: auto; }
.jv-loading { text-align: center; padding: 40px 20px; color: rgba(var(--primary-color), 0.9); letter-spacing: 2px; font-size: 14px; }
.jv-dots { animation: jvDots 1.2s steps(4, end) infinite; }
@keyframes jvDots { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (max-width: 600px) {
    .jv-art-img { flex-basis: 84px; width: 84px; min-height: 80px; }
    .jv-art-title { font-size: 13px; }
}

/* Image grid + map embed for the proactive contextual display */
.jv-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 4px 2px; }
.jv-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid rgba(var(--primary-color), 0.18); aspect-ratio: 1 / 1; background: #08131f; }
.jv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jv-map { width: 100%; height: min(60vh, 460px); border: 0; border-radius: 10px; display: block; }

/* Summary / definition card */
.jv-summary { padding: 6px 2px; }
.jv-sum-img { width: 100%; height: 160px; background-size: cover; background-position: center; border-radius: 10px; margin-bottom: 12px; }
.jv-sum-title { font-size: 17px; font-weight: 700; color: #eaf6ff; margin-bottom: 8px; }
.jv-sum-text { font-size: 14px; line-height: 1.6; color: rgba(230, 245, 255, 0.85); }
.jv-sum-link { display: inline-block; margin-top: 12px; color: var(--primary-hex); text-decoration: none; font-size: 13px; }
.jv-sum-link:hover { text-decoration: underline; }

/* Crypto price card */
.jv-price { text-align: center; padding: 20px 10px; }
.jv-price-icon { width: 56px; height: 56px; margin-bottom: 10px; }
.jv-price-name { font-size: 16px; color: #eaf6ff; }
.jv-price-sym { opacity: 0.6; font-size: 13px; }
.jv-price-val { font-size: 34px; font-weight: 700; color: #fff; margin: 8px 0; }
.jv-price-chg { font-size: 15px; font-weight: 600; }
.jv-price-chg.up { color: #2ec77a; }
.jv-price-chg.down { color: #ff5c6c; }
.jv-price-cap { font-size: 12px; opacity: 0.6; margin-top: 8px; letter-spacing: 1px; }

/* Video grid + inline YouTube player */
.jv-vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 4px 2px; }
.jv-vid { display: block; text-decoration: none; color: inherit; }
.jv-vid-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: #08131f; border-radius: 10px; border: 1px solid rgba(var(--primary-color), 0.18); overflow: hidden; }
.jv-vid-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: rgba(255, 255, 255, 0.9); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.jv-vid-dur { position: absolute; bottom: 6px; right: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 4px; }
.jv-vid-title { font-size: 13px; color: #eaf6ff; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jv-vid-pub { font-size: 11px; color: rgba(var(--primary-color), 0.7); margin-top: 2px; }
.jv-ytplayer { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; display: block; }
.jv-vid-back { margin-top: 10px; background: rgba(var(--primary-color), 0.12); border: 1px solid rgba(var(--primary-color), 0.35); color: var(--primary-hex); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }

/* In-app viewer (open links inside JARVIS, not a new browser tab) */
.jv-art, .jv-img, .jv-vid { cursor: pointer; }
.jv-webview { width: 100%; height: min(70vh, 560px); border: 0; border-radius: 10px; background: #0a1520; display: block; }
.jv-webtoolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.jv-web-open { color: var(--primary-hex); text-decoration: none; font-size: 13px; border: 1px solid rgba(var(--primary-color), 0.4); padding: 5px 12px; border-radius: 6px; }
.jv-web-open:hover { background: rgba(var(--primary-color), 0.12); }
.jv-web-note { font-size: 11px; opacity: 0.55; }
.jv-lightbox-wrap { display: flex; align-items: center; justify-content: center; }
.jv-lightbox { max-width: 100%; max-height: 72vh; border-radius: 10px; display: block; }

/* Forensic triage report (evidence upload) */
.jv-forensic { white-space: pre-wrap; word-break: break-word; font-family: 'Courier New', ui-monospace, monospace; font-size: 12px; line-height: 1.55; color: #cfe8ff; padding: 6px 4px; margin: 0; max-height: 62vh; overflow: auto; background: rgba(4, 12, 20, 0.5); border: 1px solid rgba(var(--primary-color), 0.18); border-radius: 8px; }

/* Document Q&A */
.jv-docqa-name { font-size: 15px; color: #eaf6ff; font-weight: 600; }
.jv-docqa-meta { font-size: 12px; color: rgba(var(--primary-color), 0.75); margin: 4px 0 10px; }
.jv-doc-chip { position: fixed; bottom: 18px; left: 18px; z-index: 4000; background: rgba(4, 12, 20, 0.82); border: 1px solid rgba(var(--primary-color), 0.4); color: var(--primary-hex); font-size: 12px; padding: 7px 12px; border-radius: 18px; cursor: pointer; backdrop-filter: blur(6px); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
.jv-doc-chip:hover { background: rgba(var(--primary-color), 0.16); }
