/* ==========================================================================
   AQRI'M VISION DETECT & TRANSLATE - Modern, Clean & High Precision UI
   ========================================================================== */

:root {
    --detect-primary: #6366f1;
    --detect-primary-hover: #4f46e5;
    --detect-secondary: #ec4899;
    --detect-accent: #8b5cf6;
    --detect-cyan: #06b6d4;
    --detect-bg: #000000;
    --detect-bg-card: rgba(9, 5, 12, 0.85);
    --detect-border: rgba(99, 102, 241, 0.2);
    --detect-text: #f8fafc;
    --detect-text-muted: #94a3b8;
    --detect-radius: 18px;
    --detect-font: 'Inter', system-ui, -apple-system, sans-serif;
    --detect-title-font: 'Outfit', var(--detect-font);
}

body.detect-body {
    background: radial-gradient(circle at 50% 0%, #000000 0%, #030103 75%);
    color: var(--detect-text);
    font-family: var(--detect-font);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.detect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(25, 11, 24, 0.7);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--detect-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.detect-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.detect-brand img {
    height: 36px;
    width: auto;
}

.header-lang-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

.lang-select-header {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.lang-select-header option {
    background: #0f172a;
    color: #fff;
}

.detect-node-badge {
    background: rgba(195, 6, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.node-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #06b6d4;
    box-shadow: 0 0 8px #06b6d4;
    animation: nodePulse 2s infinite;
}

@keyframes nodePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

/* Workspace & Live Section */
.detect-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 14px 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detect-live-section {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.detect-live-section .detect-canvas-wrapper {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-radius: var(--detect-radius);
    overflow: hidden;
    background: #000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    position: relative;
    margin: 0 auto;
}

.detect-live-section video {
    width: 100%;
    height: auto;
    max-height: 72vh;
    display: block;
    object-fit: contain;
}

#detectOverlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.detect-upload-zone {
    border: 2px dashed rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.03);
    border-radius: 14px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.detect-upload-zone:hover {
    border-color: var(--detect-accent);
    background: rgba(99, 102, 241, 0.08);
}

.detect-upload-icon {
    font-size: 3rem;
    color: var(--detect-primary);
}

.detect-upload-text {
    font-size: 0.95rem;
    color: #cbd5e1;
}

.detect-upload-text strong {
    color: #fff;
}

.detect-action-btns-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
}

.detect-btn {
    background: var(--detect-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex: 1;
}

.detect-btn:hover {
    background: var(--detect-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.detect-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

.detect-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Interactive Image Canvas */
.detect-canvas-wrapper {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    user-select: none;
}

.detect-canvas-wrapper img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
    cursor: crosshair;
}

.detect-canvas-tip {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 11, 24, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #c4b5fd;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Click Pin Pointer */
.detect-pin {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ec4899;
    box-shadow: 0 0 12px #ec4899;
    animation: pinPing 1.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pin-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

@keyframes pinPing {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }

    80%,
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Results Panel */
.detect-results-card {
    background: var(--detect-bg-card);
    border: 1px solid var(--detect-border);
    border-radius: var(--detect-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    position: relative;
    min-height: 380px;
}

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

.results-title {
    font-family: var(--detect-title-font);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.lang-selector-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

/* States */
.detect-state-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
    color: var(--detect-text-muted);
    gap: 10px;
}

.detect-state-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
    gap: 14px;
}

.detect-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--detect-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Structured Result Cards */
.detected-objects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.detect-tag {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c4b5fd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detect-tag:hover {
    background: var(--detect-primary);
    color: #fff;
    transform: translateY(-1px);
}

/* Translation Card Hero */
.translation-hero-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.translation-main-word {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.translation-target-title {
    font-family: var(--detect-title-font);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.btn-speak-audio {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f472b6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.btn-speak-audio:hover {
    background: #ec4899;
    color: #fff;
    transform: scale(1.1);
}

.translation-phonetic {
    font-size: 0.85rem;
    color: #a78bfa;
    font-family: monospace;
}

.multilang-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.multilang-item {
    background: rgba(0, 0, 0, 0.35);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.multilang-item span {
    display: block;
    font-size: 0.7rem;
    color: var(--detect-text-muted);
    text-transform: uppercase;
}

.multilang-item strong {
    font-size: 0.85rem;
    color: #e2e8f0;
}

/* ==========================================================================
   VIDEO HUD, FULLSCREEN & REALTIME TOUCH FOCUS
   ========================================================================== */
.detect-canvas-wrapper {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    user-select: none;
    touch-action: manipulation;
}

/* Modo Pantalla Completa */
.detect-canvas-wrapper.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.detect-canvas-wrapper.is-fullscreen video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    object-fit: contain !important;
    border-radius: 0 !important;
}

.detect-canvas-wrapper.is-fullscreen #detectOverlayCanvas {
    width: 100% !important;
    height: 100% !important;
}

/* HUD Contenedor */
.video-hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    pointer-events: none;
    z-index: 20;
    box-sizing: border-box;
}

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

.hud-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.hud-device-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.hud-device-select:focus,
.hud-device-select:hover {
    border-color: #ec4899;
    background: rgba(255, 255, 255, 0.12);
}

.hud-device-select option {
    background: #0f172a;
    color: #fff;
}

/* Barra de Zoom Flotante Lateral Derecha (Colapsable) */
.hud-zoom-bar {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 25;
}

/* Botón disparador único de zoom cuando está colapsado */
.zoom-trigger-btn {
    background: rgba(15, 23, 42, 0.82);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #f8fafc;
    font-family: var(--detect-font);
    font-size: 0.8rem;
    font-weight: 800;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoom-trigger-btn:hover,
.hud-zoom-bar.is-expanded .zoom-trigger-btn {
    background: var(--detect-primary);
    border-color: #fff;
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 0 14px var(--detect-primary);
}

/* Panel expandible que contiene los botones rápidos 3x, 2x, 1x y el slider */
.zoom-expanded-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px);
    padding: 10px 6px;
    border-radius: 28px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) translateY(10px);
    transform-origin: bottom center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
}

.hud-zoom-bar.is-expanded .zoom-expanded-panel {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    max-height: 320px;
    overflow: visible;
    margin-bottom: 2px;
}

.zoom-pill-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-pill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.zoom-pill-btn.active {
    background: var(--detect-primary);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px var(--detect-primary);
}

.zoom-slider-vertical {
    -webkit-appearance: slider-vertical;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 85px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    margin: 4px 0;
}

.zoom-slider-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ec4899;
    box-shadow: 0 0 8px #ec4899;
    cursor: pointer;
}

.hud-circle-btn {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.hud-circle-btn:hover,
.hud-circle-btn:active {
    background: var(--detect-primary);
    transform: scale(1.08);
    border-color: #fff;
}

.hud-circle-btn.active {
    background: var(--detect-primary);
    border-color: rgba(236, 72, 153, 0.8);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

/* ---- Panel de Configuración de IA ---- */
.hud-ai-settings-panel {
    position: absolute;
    top: 58px;
    right: 10px;
    background: rgba(10, 14, 30, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 230px;
    z-index: 120;
    pointer-events: auto;
    touch-action: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
    animation: settingsPanelIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes settingsPanelIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.ai-settings-row {
    margin-bottom: 14px;
}

.ai-settings-row:last-child {
    margin-bottom: 0;
}

.ai-settings-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.ai-settings-label i {
    color: #ec4899;
    margin-right: 5px;
}

.ai-settings-val {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
    border-radius: 6px;
    padding: 2px 7px;
    min-width: 42px;
    text-align: center;
}

.ai-settings-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
    transition: transform 0.15s ease;
}

.ai-settings-slider::-webkit-slider-thumb:active {
    transform: scale(1.25);
}

.ai-settings-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: 2px solid rgba(255,255,255,0.8);
    cursor: pointer;
}

.ai-settings-hints {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
}

.hud-live-tag {
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}

.live-blip {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: livePulse 1s infinite alternate;
}

@keyframes livePulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.4);
        opacity: 1;
    }
}

.hud-fps-tag {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 8px;
}

/* ==========================================================================
   TIRA ERGONÓMICA DE INFORMACIÓN (DEBAJO DEL VISOR)
   ========================================================================== */
.detect-info-strip {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 15;
}

/* Card Inferior de Objeto Detectado */
.hud-bottom-card {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.92);
    border: 1.5px solid rgba(6, 182, 212, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(6, 182, 212, 0.15);
    animation: hudSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Cuando estamos en pantalla completa, la info strip flota elegantemente sobre el video */
.detect-canvas-wrapper.is-fullscreen ~ .detect-info-strip,
body.has-fullscreen-video .detect-info-strip {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    left: 14px;
    right: 14px;
    max-width: 600px;
    margin: 0 auto;
    z-index: 100000;
    pointer-events: none;
}

.detect-canvas-wrapper.is-fullscreen ~ .detect-info-strip > *,
body.has-fullscreen-video .detect-info-strip > * {
    pointer-events: auto;
}

@keyframes hudSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.hud-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hud-card-info {
    flex: 1;
    overflow: hidden;
}

.hud-tag-class {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #f472b6;
    text-transform: uppercase;
}

.hud-tag-name {
    font-family: var(--detect-title-font);
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-tag-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Badges de reconocimiento visual de precisión */
.hud-tag-name {
    transition: opacity 0.4s ease;
}

.hud-llava-badge,
.hud-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-radius: 8px;
    padding: 3px 9px;
}

.hud-llava-badge.verifying,
.hud-ai-badge.verifying {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
    border: 1px solid rgba(251, 191, 36, 0.5);
    animation: aiVerifyPulse 1.2s ease-in-out infinite alternate;
}

.hud-llava-badge.confirmed,
.hud-ai-badge.confirmed {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.55);
}

@keyframes aiVerifyPulse {
    from { opacity: 0.6; transform: scale(0.98); }
    to   { opacity: 1.0; transform: scale(1.02); }
}

/* Botón de Frenar Cuadro / Freeze Frame */
.hud-freeze-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-freeze-btn.frozen {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    border-color: #fcd34d !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.7) !important;
    animation: freezeBtnGlow 1.8s ease-in-out infinite alternate;
}

@keyframes freezeBtnGlow {
    from { box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
    to   { box-shadow: 0 0 20px rgba(239, 68, 68, 0.85); }
}

.hud-btn-voice {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4);
    transition: transform 0.2s ease;
}

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

/* Touch Focus Bracket Ring (Animación al Tocar la Pantalla) */
.touch-focus-ring {
    position: absolute;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 25;
    animation: touchPing 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes touchPing {
    0% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
}

.focus-bracket {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2.5px solid #06b6d4;
}

.focus-bracket.top-left {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.focus-bracket.top-right {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.focus-bracket.bottom-left {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.focus-bracket.bottom-right {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.focus-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ec4899;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #ec4899;
}

/* Ajustes Mobile First */
@media (max-width: 640px) {
    .detect-header {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .detect-brand img {
        height: 28px;
    }

    .detect-mode-bar {
        order: 2;
        margin: 0;
    }

    .mode-bar-summary-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
        gap: 6px;
    }

    .mode-summary-prefix {
        display: none;
    }

    .detect-node-badge {
        display: none;
    }

    .detect-container {
        padding: 8px 8px 40px;
        gap: 12px;
    }

    .detect-live-section video {
        max-height: 58vh;
        border-radius: 12px;
    }

    .video-hud-overlay {
        padding: 10px 10px;
    }

    .hud-circle-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .hud-controls-right {
        gap: 6px;
    }

    .hud-live-tag {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .hud-fps-tag {
        font-size: 0.68rem;
        padding: 3px 6px;
    }

    .detect-info-strip {
        gap: 8px;
        margin-top: 8px;
    }

    .hud-bottom-card {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .hud-tag-name {
        font-size: 1.15rem;
    }

    .hud-tag-sub {
        font-size: 0.78rem;
    }

    .scene-caption-card {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .scene-caption-target {
        font-size: 0.88rem;
    }

    .scene-caption-source {
        font-size: 0.76rem;
    }
}

/* ==========================================================================
   SELECTOR DE MODOS COLAPSABLE CYBERPUNK GLASS (detect-mode-bar)
   ========================================================================== */
.detect-mode-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 120;
}

/* Botón de Resumen / Trigger */
.mode-bar-summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 28px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f8fafc;
    cursor: pointer;
    font-family: var(--detect-font);
    font-size: 0.83rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    outline: none;
    user-select: none;
}

.mode-bar-summary-btn:hover {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.mode-summary-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
    animation: pulseSummaryDot 2s infinite ease-in-out;
}

@keyframes pulseSummaryDot {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px #10b981; }
    50% { opacity: 0.5; transform: scale(0.8); box-shadow: 0 0 3px #10b981; }
}

.mode-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #a5b4fc;
    flex-shrink: 0;
}

.mode-summary-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.mode-summary-prefix {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.mode-summary-label {
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.mode-summary-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.mode-summary-chevron {
    font-size: 0.72rem;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.detect-mode-bar.expanded .mode-summary-chevron {
    transform: rotate(180deg);
}

.detect-mode-bar.expanded .mode-bar-summary-btn {
    border-color: #6366f1;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
}

/* ==========================================================================
   DROPDOWN / DRAWER PANEL
   ========================================================================== */
.mode-bar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.96);
    width: 390px;
    max-width: calc(100vw - 20px);
    background: rgba(10, 14, 26, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
    z-index: 200;
}

.detect-mode-bar.expanded .mode-bar-dropdown {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

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

.mode-dropdown-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #c7d2fe;
}

.mode-dropdown-title i {
    color: #818cf8;
}

.mode-dropdown-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.mode-dropdown-close-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: scale(1.05);
}

.mode-group {
    margin-bottom: 12px;
}

.mode-group:last-child {
    margin-bottom: 0;
}

.mode-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-left: 4px;
}

.mode-group-label.ai-accent {
    color: #ec4899;
}

.mode-group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Mode pill inside dropdown */
.mode-pill-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 9px 12px;
    color: #cbd5e1;
    font-family: var(--detect-font);
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}

.mode-pill-btn i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.22s;
    color: #94a3b8;
}

.mode-pill-btn .pill-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mode-pill-btn .pill-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}

.mode-pill-btn .pill-sub {
    font-size: 0.67rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-pill-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.mode-pill-btn:hover i {
    transform: scale(1.18);
    color: #ffffff;
}

/* Estados activos y colores por modo */
.mode-pill-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(236, 72, 153, 0.25) 100%);
    border-color: #6366f1;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.mode-pill-btn.active i {
    color: #a5b4fc;
}
.mode-pill-btn.active .pill-name {
    color: #ffffff;
}
.mode-pill-btn.active .pill-sub {
    color: #cbd5e1;
}

.mode-pill-btn[data-mode="ocr_plate"]:hover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.12);
}
.mode-pill-btn.active[data-mode="ocr_plate"] {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
    border-color: #06b6d4;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}
.mode-pill-btn.active[data-mode="ocr_plate"] i {
    color: #38bdf8;
}

.mode-pill-btn[data-mode="chef"]:hover {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}
.mode-pill-btn.active[data-mode="chef"] {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.3) 0%, rgba(245, 158, 11, 0.3) 100%);
    border-color: #f97316;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
.mode-pill-btn.active[data-mode="chef"] i {
    color: #fb923c;
}

.mode-pill-btn[data-mode="inspector"]:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}
.mode-pill-btn.active[data-mode="inspector"] {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.3) 0%, rgba(239, 68, 68, 0.3) 100%);
    border-color: #ef4444;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.mode-pill-btn.active[data-mode="inspector"] i {
    color: #f87171;
}

.mode-pill-btn[data-mode="stock"]:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}
.mode-pill-btn.active[data-mode="stock"] {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.mode-pill-btn.active[data-mode="stock"] i {
    color: #60a5fa;
}

.mode-pill-btn[data-mode="mirror"]:hover {
    border-color: #d946ef;
    background: rgba(217, 70, 239, 0.12);
}
.mode-pill-btn.active[data-mode="mirror"] {
    background: linear-gradient(135deg, rgba(192, 38, 211, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: #d946ef;
    box-shadow: 0 4px 14px rgba(217, 70, 239, 0.35);
}
.mode-pill-btn.active[data-mode="mirror"] i {
    color: #e879f9;
}

/* Glow del Summary chip según el modo activo */
.mode-bar-summary-btn[data-mode="ocr_plate"] .mode-summary-live-dot { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.mode-bar-summary-btn[data-mode="ocr_plate"] .mode-summary-icon { color: #38bdf8; }

.mode-bar-summary-btn[data-mode="chef"] .mode-summary-live-dot { background: #f97316; box-shadow: 0 0 8px #f97316; }
.mode-bar-summary-btn[data-mode="chef"] .mode-summary-icon { color: #fb923c; }

.mode-bar-summary-btn[data-mode="inspector"] .mode-summary-live-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.mode-bar-summary-btn[data-mode="inspector"] .mode-summary-icon { color: #f87171; }

.mode-bar-summary-btn[data-mode="stock"] .mode-summary-live-dot { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.mode-bar-summary-btn[data-mode="stock"] .mode-summary-icon { color: #60a5fa; }

.mode-bar-summary-btn[data-mode="mirror"] .mode-summary-live-dot { background: #d946ef; box-shadow: 0 0 8px #d946ef; }
.mode-bar-summary-btn[data-mode="mirror"] .mode-summary-icon { color: #e879f9; }

/* Responsive adjustments para pantallas chicas */
@media (max-width: 640px) {
    .mode-bar-dropdown {
        position: fixed;
        top: 66px;
        left: 10px;
        right: 10px;
        width: auto;
        transform: translateY(-8px) scale(0.97);
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        padding: 12px;
    }
    .detect-mode-bar.expanded .mode-bar-dropdown {
        transform: translateY(0) scale(1);
    }
    .mode-group-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .mode-pill-btn {
        padding: 9px 12px;
    }
}

/* ==========================================================================
   DISEÑO DE CHAPA PATENTE VEHICULAR (MERCOSUR & ESTÁNDAR)
   ========================================================================== */
.plate-hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 14px;
    background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--detect-radius);
    position: relative;
    overflow: hidden;
}

.plate-hero-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #06b6d4, #38bdf8, transparent);
}

.license-plate-card {
    width: 280px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 0 2px #1e293b, inset 0 0 3px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: platePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes platePop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.plate-header-mercosur {
    background: #003399;
    color: #ffffff;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.plate-country-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}

.plate-body {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.plate-code {
    font-family: 'Outfit', 'Inter', monospace;
    font-size: 2.1rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 4px;
    line-height: 1.1;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.15);
    user-select: all;
}

.plate-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-plate-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    padding: 8px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-plate-action:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #38bdf8;
    transform: translateY(-1px);
}

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

.plate-meta-info {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   LOG DE TRÁNSITO VEHICULAR (REGISTRO EN VIVO)
   ========================================================================== */
.transit-log-card {
    width: 100%;
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--detect-radius);
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.transit-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.transit-log-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #38bdf8;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transit-counter-badge {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.transit-log-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-transit-tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 5px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-transit-tool:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.25);
}

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

.transit-table-wrapper {
    max-height: 280px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.transit-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.transit-log-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    padding: 8px 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.transit-log-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #f8fafc;
}

.transit-log-table tr:hover td {
    background: rgba(6, 182, 212, 0.08);
}

.transit-plate-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transit-plate-badge {
    background: #003399;
    color: #ffffff;
    font-family: 'Outfit', monospace;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.transit-plate-badge:hover {
    transform: scale(1.05);
}

.transit-type-tag {
    font-size: 0.72rem;
    color: #94a3b8;
}

.transit-time-cell {
    font-family: monospace;
    color: #38bdf8;
    font-size: 0.78rem;
    white-space: nowrap;
}

.transit-action-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-transit-icon {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.btn-transit-icon:hover {
    color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
}

.transit-empty-row {
    text-align: center;
    color: #64748b;
    padding: 24px 10px !important;
    font-style: italic;
}

/* ==========================================================================
   DISEÑO DE TEXTO OCR Y TRADUCCIÓN
   ========================================================================== */
.ocr-hero-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.15) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--detect-radius);
    position: relative;
}

.ocr-source-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    color: #f8fafc;
    line-height: 1.4;
    word-break: break-word;
}

.ocr-translation-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
}

.ocr-translated-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f472b6;
    line-height: 1.35;
    margin: 0;
}

/* ==========================================================================
   MODO PREGUNTAR (ASK OBJECT SHEET & INSPECTOR)
   ========================================================================== */
.ask-object-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80%;
    background: rgba(10, 15, 30, 0.95);
    border-top: 1.5px solid rgba(236, 72, 153, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    padding: 16px 20px 20px;
    z-index: 100;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(236, 72, 153, 0.15);
    display: flex;
    flex-direction: column;
    animation: askSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

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

.ask-sheet-drag-bar {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 auto 12px;
}

.ask-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ask-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ask-sheet-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.ask-sheet-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ask-sheet-body {
    flex: 1;
    overflow-y: auto;
    max-height: 55vh;
    padding-right: 4px;
}

.ask-sheet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    text-align: center;
    color: #cbd5e1;
}

.ask-loading-orb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    animation: askOrbPulse 1.2s ease-in-out infinite alternate;
    margin-bottom: 14px;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}

@keyframes askOrbPulse {
    from { transform: scale(0.85); opacity: 0.7; }
    to { transform: scale(1.15); opacity: 1; }
}

.ask-sheet-content {
    font-size: 0.95rem;
    color: #f1f5f9;
    line-height: 1.55;
}

.ask-sheet-content .ask-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.ask-sheet-content .ask-section strong {
    color: #ec4899;
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.ask-sheet-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ask-voice-btn {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
    transition: transform 0.2s ease;
}

.ask-voice-btn:hover {
    transform: scale(1.04);
}

.ask-web-search-btn {
    background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35) !important;
}

.hud-card-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hud-btn-web-search {
    background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4) !important;
}

.hud-btn-web-search:hover {
    transform: scale(1.08);
}

/* Modal / Card de Resultados SearXNG en Visión */
.vision-web-results-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: webCardIn 0.25s ease-out;
}

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

.vision-web-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vision-web-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.vision-web-item:last-child {
    margin-bottom: 0;
}

.vision-web-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
    line-height: 1.3;
}

.vision-web-link:hover {
    text-decoration: underline;
    color: #7dd3fc;
}

.vision-web-snippet {
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.4;
}

/* ==========================================================================
   AQRI'M VISION DETECT PLUS — Estilos del Panel Diff, Auto y Escena
   ========================================================================== */

/* Header: Selector Dual de Idiomas */
.header-langs-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-arrow-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.lang-pill-prefix {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding-right: 2px;
}

.lang-pill-prefix.target {
    color: #ec4899;
}

.header-lang-pill.target-pill {
    border-color: rgba(236, 72, 153, 0.4);
    background: rgba(236, 72, 153, 0.08);
}

/* Botón Auto-Play en HUD */
.hud-auto-btn {
    position: relative;
}

.hud-auto-btn.active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
    color: #ffffff !important;
    border-color: rgba(236, 72, 153, 0.8) !important;
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.55);
}

.auto-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: #06b6d4;
    color: #041017;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 6px;
    line-height: 1;
    letter-spacing: 0.04em;
    border: 1px solid rgba(0, 0, 0, 0.4);
}

/* Tarjeta de Escena (En Tira de Información o Overlay Fullscreen) */
.scene-caption-card {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 10, 28, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 16px rgba(139, 92, 246, 0.15);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scene-caption-card.loading {
    border-color: rgba(236, 72, 153, 0.6);
    animation: scenePulse 1.4s ease-in-out infinite;
}

@keyframes scenePulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 12px rgba(236, 72, 153, 0.2); }
    50% { box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 24px rgba(236, 72, 153, 0.55); }
}

.scene-caption-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.scene-caption-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scene-view-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.scene-view-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.scene-view-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

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

.scene-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.scene-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.06);
}

.scene-action-btn.close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.scene-caption-target {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.42;
    color: #f8fafc;
    font-weight: 600;
}

.scene-caption-source {
    margin: 4px 0 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #cbd5e1;
    font-style: italic;
    opacity: 0.88;
    cursor: pointer;
    display: inline-block;
}

.scene-caption-source:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Panel de Resultados con Actualización por Diferencias (Diff) */
.vp-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vp-hero {
    background: radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.12) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(15, 10, 24, 0.6) 100%);
    border: 1px solid rgba(236, 72, 153, 0.25);
    border-radius: 16px;
    padding: 16px 18px;
    position: relative;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.vp-hero.vp-dim {
    opacity: 0.45;
}

.vp-hero-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.vp-hero-tag {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f472b6;
}

.vp-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vp-hero-words {
    flex: 1;
    min-width: 0;
}

.vp-hero-target {
    margin: 0;
    font-family: var(--detect-title-font);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
    word-break: break-word;
}

.vp-hero-phon {
    font-size: 0.84rem;
    color: #a5b4fc;
    font-family: 'JetBrains Mono', monospace, sans-serif;
    margin-top: 3px;
    opacity: 0.85;
}

.vp-hero-source {
    margin-top: 6px;
}

.vp-src {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.84rem;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.vp-src:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.vp-src-lang {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.vp-say-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.vp-say-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.6);
}

.vp-say-btn.sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.vp-say-btn.sm:hover {
    background: rgba(236, 72, 153, 0.3);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.6);
}

.vp-conf {
    font-family: monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    font-weight: 700;
}

.vp-more {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vp-more summary {
    font-size: 0.78rem;
    color: #94a3b8;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    outline: none;
}

.vp-more summary:hover {
    color: #e2e8f0;
}

.vp-list-head {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

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

.vp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vp-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(3px);
}

.vp-item.vp-hl {
    border-color: #ec4899;
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.45);
    background: rgba(236, 72, 153, 0.12);
}

.vp-item.vp-stale {
    opacity: 0.55;
}

.vp-item.vp-enter {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
}

.vp-item.vp-leave {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
}

.vp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.vp-item-words {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vp-item-words strong {
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 700;
}

.vp-llm {
    color: #ec4899;
    font-size: 0.75rem;
}

.vp-pop {
    animation: vpPop 0.22s ease-out;
}

@keyframes vpPop {
    0% { transform: scale(0.97); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}