/* =========================================
   7. PANELES SECUNDARIOS (ADMIN, MONITOR)
   ========================================= */
.admin-container { max-width: 1000px; width: 100%; margin: 40px auto; background-color: white; border-radius: var(--radius-box); padding: 40px; box-shadow: var(--shadow-soft); border: 1px solid var(--border-color); }
.admin-container h1 { margin-bottom: 20px; color: #111; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-card { background-color: white; border-radius: var(--radius-box); padding: 35px; box-shadow: var(--shadow-soft); border: 1px solid var(--border-color); margin-bottom: 25px; }
.card-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.card-header h2 { font-size: 1.3rem; color: #111; }
.pildora-fase { background-color: #e8f0fe; color: #1a73e8; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.premium-form .form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.input-group { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 0.85rem; font-weight: 600; color: #555; margin-left: 5px; }
.input-group input, .input-group select { background-color: #f9f9fa; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 15px; padding: 12px 18px; font-size: 0.95rem; color: #333; outline: none; transition: all 0.4s var(--apple-ease); }
.input-group input:focus, .input-group select:focus { border-color: #111; background-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05); }
.btn-submit { background-color: #111; color: white; border: none; padding: 14px 25px; border-radius: var(--radius-pill); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.4s var(--apple-ease); margin-top: 10px; }
.btn-submit:hover { background-color: #333; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

/* ==============================================
   8. ACORDEÓN MAESTRO DEL HISTORIAL
   ============================================== */
.master-history { background-color: transparent; border-radius: var(--radius-box); border: 1px solid transparent; margin-bottom: 15px; flex: 1; display: flex; flex-direction: column; overflow: hidden; transition: all 0.5s var(--apple-ease); }
.master-history[open] { background-color: #fdfdfd; border: 1px solid var(--border-color); box-shadow: inset 0 2px 10px rgba(0,0,0,0.01); }
.master-history-title { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; cursor: pointer; font-weight: 600; color: var(--text-main); list-style: none; user-select: none; border-radius: var(--radius-box); transition: background-color 0.3s var(--apple-ease); }
.master-history-title::-webkit-details-marker { display: none; }
.master-history-title:hover { background-color: rgba(0,0,0,0.03); }
.summary-left { display: flex; align-items: center; gap: 12px; }
.summary-left i { color: var(--text-muted); font-size: 1.1rem; }
.chevron-icon { color: var(--text-muted); font-size: 0.8rem; transition: transform 0.5s var(--apple-spring); }
.master-history[open] .chevron-icon { transform: rotate(180deg); }
.history-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8; /* Gris elegante */
    letter-spacing: 0.8px;
    text-transform: uppercase;
    user-select: none;
}
.master-history .chat-history { padding: 0 10px 10px 10px; max-height: 35vh; overflow-y: auto; }
.master-history .chat-history::-webkit-scrollbar { width: 4px; }
.master-history .chat-history::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* ==============================================
   9. TABELLA DINAMICA PREMIUM & MODAL
   ============================================== */
.dynamic-table-container { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; border: 1px solid rgba(226, 232, 240, 0.95); border-radius: 28px; margin: 16px auto 0; background: linear-gradient(180deg, #ffffff, #fbfdff); box-shadow: 0 22px 40px rgba(15,23,42,0.07); overflow: hidden; }
.table-answer-shell { width: 100%; max-width: 100%; display: flex; flex-direction: column; align-items: stretch; }
.table-answer-shell > .table-intro-copy { width: 100%; }
.table-limit-notice { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: #475569; background: #f8fafc; border-bottom: 1px solid rgba(226, 232, 240, 0.9); font-size: 0.88rem; font-weight: 700; }
.table-limit-notice i { color: #2563eb; font-size: 0.9rem; }
.ingeo-table .table-row-number-cell { width: 58px; min-width: 58px; max-width: 70px; text-align: center; color: #64748b; font-weight: 800; background: #f8fafc; }
.ingeo-table .table-row-number-header { justify-content: center; }
.ingeo-table .table-row-selector { cursor: pointer; user-select: none; }
.ingeo-table .table-row-selector:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.42); outline-offset: -3px; }
.ingeo-table tbody tr.is-row-selected td { background: #e0f2fe !important; color: #0f172a !important; box-shadow: inset 0 -1px 0 rgba(14, 165, 233, 0.18); }
.ingeo-table tbody tr.is-row-selected .table-row-number-cell { background: #0284c7 !important; color: #ffffff !important; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; background: linear-gradient(180deg, #fbfdff, #f8fafc); border-bottom: 1px solid rgba(226, 232, 240, 0.92); }
.table-search { position: relative; width: min(320px, 100%); flex: 1 1 240px; }
.table-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.table-search input { width: 100%; padding: 11px 14px 11px 36px; border: 1px solid rgba(226, 232, 240, 0.95); border-radius: 18px; font-size: 0.92rem; outline: none; transition: all 0.2s ease; background: #fff; }
.table-search input:focus { border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.55); }
.btn-expand { background: none; border: 1px solid rgba(226, 232, 240, 0.95); padding: 7px 12px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: #111; transition: all 0.2s ease; }
.btn-expand:hover { background: #111; color: #fff; }
.table-scroll { width: 100%; min-width: 0; height: 350px; max-height: 350px; overflow-y: auto; overflow-x: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.3s ease; }
.table-scroll:hover { scrollbar-color: #c1c1c1 transparent; }
.table-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.table-scroll::-webkit-scrollbar-thumb { background-color: transparent; border-radius: 10px; }
.table-scroll:hover::-webkit-scrollbar-thumb { background-color: #d1d1d1; }
.table-scroll::-webkit-scrollbar-thumb:hover { background-color: #a8a8a8; }
.ingeo-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.85rem; text-align: left; table-layout: auto; }
.ingeo-table th { background: #fff; padding: 12px 15px; font-weight: 600; color: var(--text-muted); position: sticky; top: 0; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.ingeo-table td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.table-header-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 100%; }
.table-header-title { overflow: hidden; text-overflow: ellipsis; }
.table-col-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.table-col-btn:hover,
.table-col-btn.is-active {
    transform: translateY(-1px);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 10px 16px rgba(59, 130, 246, 0.12);
}
.ingeo-table tr:hover td { background: #fdfdfd; }
.ingeo-table tbody tr.is-match td { background: #fff8dc; }
.ingeo-table tbody tr.is-dim td { color: #94a3b8; }
.ingeo-table tbody tr.is-dim:hover td { background: #f8fafc; }
.ingeo-table tbody tr.is-current-match td { background: #dbeafe; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18); }
.table-match { background: #facc15; color: #111827; border-radius: 6px; padding: 1px 4px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(161, 98, 7, 0.12); }

.column-filter-menu {
    position: absolute;
    z-index: 12000;
    width: min(320px, calc(100vw - 32px));
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.24s ease;
}

.column-filter-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.column-filter-menu-header,
.column-filter-menu-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.column-filter-menu-body {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.column-filter-menu-body input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    padding: 11px 13px;
    font-size: 0.92rem;
    outline: none;
}

.column-filter-menu-body input:focus {
    border-color: rgba(59, 130, 246, 0.32);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.column-filter-menu-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.83rem;
    line-height: 1.55;
}

.column-filter-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
}

/* MODAL FULLSCREEN */
.table-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 40px; opacity: 0; transition: opacity 0.3s ease; }
.table-modal-overlay.active { display: flex; opacity: 1; }
.table-modal-content { background: #fff; width: 100%; max-width: 1200px; height: 90vh; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; background: #f9f9fa; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 1.2rem; }
.btn-close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }
.btn-close-modal:hover { color: #111; }
.modal-body { flex: 1; overflow: auto; padding: 0; }

.sql-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.sql-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s ease;
}

body.modal-open {
    overflow: hidden;
}

.sql-modal-content {
    --dialog-origin-x: 0px;
    --dialog-origin-y: 24px;
    --dialog-origin-scale: 0.92;
    width: min(860px, 100%);
    max-height: min(78vh, 760px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 30px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    opacity: 0.72;
    transform: translateY(18px) scale(0.965);
    transform-origin: center center;
    transition:
        transform 0.34s cubic-bezier(0.2, 0.9, 0.22, 1),
        opacity 0.24s ease,
        box-shadow 0.34s ease,
        filter 0.34s ease;
    will-change: transform, opacity, filter;
}

.sql-modal-overlay.active .sql-modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.sql-modal-content.origin-preopen,
.sql-modal-overlay.closing .sql-modal-content.origin-closing {
    opacity: 0.28;
    transform:
        translate(var(--dialog-origin-x), var(--dialog-origin-y))
        scale(var(--dialog-origin-scale));
    filter: blur(1.5px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.sql-modal-overlay.closing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
}

.sql-modal-overlay.active .liquid-modal {
    animation: none;
}

.liquid-modal {
    animation: liquid-drop 0.45s var(--apple-ease);
}

.sql-modal-body {
    padding: 0;
    overflow: auto;
    max-height: calc(78vh - 72px);
}

.sql-code-block {
    margin: 0;
    padding: 22px 24px;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    color: #0f172a;
    font-size: 0.86rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}


/* Animación de entrada líquida */
@keyframes liquid-drop {
    0% { transform: scale(0.5); filter: blur(10px) contrast(20); opacity: 0; }
    60% { transform: scale(1.05); filter: blur(5px) contrast(15); }
    100% { transform: scale(1); filter: blur(0) contrast(1); opacity: 1; }
}

.dynamic-table-container {
    animation: liquid-drop 0.6s var(--apple-ease);
}

/* Estilo de botones de exportación */
.export-tools {
    display: flex;
    gap: 8px;
}

.btn-export {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.95);
    padding: 7px 11px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--apple-spring);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-export:hover {
    background: linear-gradient(180deg, #ffffff, #eef2f7);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.btn-export.excel:hover { color: #1d6f42; border-color: #1d6f42; }
.btn-export.sql:hover { color: #4338ca; border-color: #4338ca; }
.btn-export.analysis:hover { color: #0f766e; border-color: #0f766e; }

.analysis-modal-content {
    width: min(980px, 100%);
    max-height: min(84vh, 900px);
}

.analysis-modal-body {
    padding: 20px 22px 24px;
    background: linear-gradient(180deg, #fbfdff, #f8fafc);
}

.analysis-shell {
    display: grid;
    gap: 16px;
}

.analysis-loading,
.analysis-summary-card,
.analysis-meta-card,
.analysis-section {
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
}

.app-dialog-content {
    width: min(760px, 100%);
    max-height: min(88vh, 920px);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(191, 219, 254, 0.55);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.app-dialog-header {
    padding: 20px 24px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
}

.app-dialog-header-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-dialog-eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 20px 24px 18px;
    background: linear-gradient(180deg, #fbfdff, #f8fafc);
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 24px 24px;
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.85), rgba(255, 255, 255, 0.96));
}

.dialog-btn {
    min-width: 128px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dialog-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.dialog-btn.secondary {
    background: #ffffff;
    color: #475569;
}

.dialog-btn.primary {
    background: linear-gradient(145deg, #0f172a, #1e293b);
    color: #ffffff;
}

.dialog-btn.success {
    background: linear-gradient(145deg, #15803d, #16a34a);
    color: #ffffff;
}

.dialog-btn.warning {
    background: linear-gradient(145deg, #d97706, #f59e0b);
    color: #ffffff;
}

.dialog-btn.danger {
    background: linear-gradient(145deg, #b91c1c, #dc2626);
    color: #ffffff;
}

.welcome-ai-dialog {
    width: min(560px, calc(100vw - 44px));
    position: relative;
    overflow: visible;
    isolation: isolate;
    border-color: transparent;
    box-shadow: none !important;
    background: transparent !important;
}

.welcome-ai-dialog::before,
.welcome-ai-dialog::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 34px;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.welcome-ai-dialog::before {
    inset: -44px -64px;
    z-index: -2;
    padding: 18px;
    border-radius: 46% 54% 52% 48% / 48% 48% 52% 52%;
    background:
        conic-gradient(
            from 0deg,
            rgba(249, 115, 22, 0.92),
            rgba(244, 63, 94, 0.78),
            rgba(236, 72, 153, 0.72),
            rgba(96, 165, 250, 0.48),
            rgba(249, 115, 22, 0.92)
        );
    filter: blur(2px) saturate(1.28);
    opacity: 0.78;
    transform: rotate(-12deg);
    animation: welcomeOuterAurora 9s linear infinite, welcomeOuterFloat 4.2s ease-in-out infinite;
}

.welcome-ai-dialog::after {
    inset: -30px -48px;
    z-index: -1;
    padding: 10px;
    border-radius: 42% 58% 47% 53% / 55% 43% 57% 45%;
    background:
        conic-gradient(
            from 120deg,
            rgba(96, 165, 250, 0.52),
            rgba(244, 114, 182, 0.68),
            rgba(249, 115, 22, 0.74),
            rgba(96, 165, 250, 0.52)
        );
    opacity: 0.58;
    transform: rotate(18deg);
    animation: welcomeOuterAuroraReverse 11s linear infinite, welcomeOuterFloatAlt 5.2s ease-in-out infinite;
}

.welcome-ai-dialog .app-dialog-body {
    overflow: visible;
    padding: 12px 24px 10px;
    background: transparent;
}

.welcome-ai-dialog .app-dialog-actions {
    border-top: 0;
    box-shadow: none;
    background: transparent;
}

.welcome-ai-shell {
    position: relative;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 18px;
    padding: 8px 0 2px;
}

.welcome-ai-orb {
    position: relative;
    z-index: 2;
    width: 86px;
    height: 86px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 2.1rem;
    background: linear-gradient(145deg, #0f172a, #2563eb);
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.24);
}

.welcome-ai-orb::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 34px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    animation: welcomeAiHalo 2.4s ease-in-out infinite;
}

.welcome-ai-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.welcome-ai-sparkles span {
    position: absolute;
    left: 50%;
    top: 48px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(145deg, #22c55e, #60a5fa);
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.44);
    transform:
        rotate(calc(var(--spark-index) * 20deg))
        translateX(74px)
        scale(0.72);
    transform-origin: 0 0;
    animation: welcomeAiSpark 1.9s ease-in-out infinite;
    animation-delay: calc(var(--spark-index) * 0.045s);
}

.welcome-ai-copy {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 10px;
    max-width: 430px;
}

.welcome-ai-copy strong {
    color: #0f172a;
    font-size: 1.18rem;
    line-height: 1.35;
}

.welcome-ai-copy p {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.62;
}

.welcome-ai-signature {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #166534;
    background: rgba(220, 252, 231, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.18);
    font-size: 0.84rem;
    font-weight: 800;
}

@keyframes welcomeAiSpark {
    0%, 100% {
        opacity: 0.28;
        filter: blur(0.2px);
        transform:
            rotate(calc(var(--spark-index) * 20deg))
            translateX(64px)
            scale(0.58);
    }
    45% {
        opacity: 1;
        filter: blur(0);
        transform:
            rotate(calc(var(--spark-index) * 20deg))
            translateX(96px)
            scale(1);
    }
}

@keyframes welcomeAiHalo {
    0%, 100% {
        opacity: 0.42;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.06);
    }
}

.welcome-ai-dialog {
    border-color: transparent !important;
    box-shadow: none !important;
    background: transparent !important;
}

.welcome-ai-dialog .app-dialog-body {
    position: relative;
    background: transparent !important;
}

.welcome-ai-dialog .app-dialog-header {
    border-bottom-color: transparent;
    background: transparent;
    padding: 10px 24px 4px;
}

.welcome-ai-shell {
    min-height: 276px;
    padding: 18px 0 6px;
    isolation: isolate;
}

.welcome-ai-grid {
    position: absolute;
    inset: -46px -58px;
    z-index: 0;
    opacity: 0;
    background:
        linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.075) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(circle at center, black 0 40%, transparent 74%);
    animation: welcomeGridDrift 7s linear infinite;
}

.welcome-ai-border-aurora {
    display: none;
}

.welcome-ai-orbits {
    position: absolute;
    inset: -42px -58px;
    z-index: 1;
    pointer-events: none;
}

.welcome-ai-orbits span {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 44% 56% 50% 50% / 50% 44% 56% 50%;
    filter: drop-shadow(0 16px 28px rgba(15, 23, 42, 0.08));
    opacity: 0.62;
}

.welcome-ai-orbits span:nth-child(1) {
    border-color: rgba(249, 115, 22, 0.72);
    border-width: 3px;
    transform: rotate(-12deg);
    animation: welcomeOrbitA 8.8s linear infinite;
}

.welcome-ai-orbits span:nth-child(2) {
    inset: 16px 24px;
    border-color: rgba(236, 72, 153, 0.62);
    border-width: 3px;
    transform: rotate(28deg);
    animation: welcomeOrbitB 10.4s linear infinite;
}

.welcome-ai-orbits span:nth-child(3) {
    inset: 30px 42px;
    border-color: rgba(96, 165, 250, 0.48);
    border-width: 2px;
    transform: rotate(-34deg);
    animation: welcomeOrbitC 12s linear infinite;
}

.welcome-ai-orbits span:nth-child(4) {
    inset: -8px 28px;
    border-color: rgba(244, 63, 94, 0.34);
    border-width: 7px;
    filter: blur(7px);
    opacity: 0.18;
    transform: rotate(44deg);
    animation: welcomeOrbitGlow 7.6s linear infinite;
}

.welcome-ai-core-wrap {
    position: relative;
    z-index: 3;
    width: 124px;
    height: 124px;
    display: grid;
    place-items: center;
}

.welcome-ai-ring {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-left-color: rgba(249, 115, 22, 0.78);
    border-bottom-color: rgba(236, 72, 153, 0.72);
    filter: drop-shadow(0 0 16px rgba(244, 114, 182, 0.2));
}

.welcome-ai-ring.ring-one {
    animation: welcomeRingSpin 4.8s linear infinite;
}

.welcome-ai-ring.ring-two {
    inset: 22px;
    border-style: dashed;
    animation: welcomeRingSpinReverse 3.6s linear infinite;
}

.welcome-ai-ring.ring-three {
    inset: 36px;
    border-color: rgba(244, 114, 182, 0.38);
    animation: welcomeRingPulse 1.7s ease-in-out infinite;
}

.welcome-ai-orb {
    width: 76px;
    height: 76px;
    border-radius: 26px;
    background:
        linear-gradient(145deg, #020617, #1d4ed8 58%, #ec4899);
    box-shadow:
        0 24px 48px rgba(37, 99, 235, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 0 34px rgba(244, 114, 182, 0.24);
    animation: welcomeCoreBoot 1.8s cubic-bezier(0.16, 0.92, 0.2, 1) both, welcomeCoreBreathe 2.4s ease-in-out 1.8s infinite;
}

.welcome-ai-orb i {
    animation: welcomeIconSignal 1.6s ease-in-out infinite;
}

.welcome-ai-sparkles span {
    top: 74px;
    width: 6px;
    height: 6px;
    background: linear-gradient(145deg, #fb923c, #ec4899 48%, #38bdf8);
    box-shadow:
        0 0 14px rgba(244, 114, 182, 0.58),
        0 0 26px rgba(56, 189, 248, 0.38);
    animation-duration: 2.15s;
}

.welcome-ai-status {
    position: relative;
    z-index: 3;
    width: min(270px, 78%);
    height: 7px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.welcome-ai-status span {
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.7);
    overflow: hidden;
    position: relative;
}

.welcome-ai-status span::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-105%);
    border-radius: inherit;
    background: linear-gradient(90deg, #fb923c, #ec4899, #60a5fa);
    animation: welcomeStatusLoad 1.55s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    animation-delay: calc(var(--status-index, 0) * 0.12s);
}

.welcome-ai-status span:nth-child(1)::after { --status-index: 0; }
.welcome-ai-status span:nth-child(2)::after { --status-index: 1; }
.welcome-ai-status span:nth-child(3)::after { --status-index: 2; }
.welcome-ai-status span:nth-child(4)::after { --status-index: 3; }

.welcome-ai-copy strong {
    font-size: 1.06rem;
}

.welcome-ai-signature {
    color: #9f1239;
    background: rgba(255, 241, 242, 0.9);
    border-color: rgba(244, 114, 182, 0.22);
    box-shadow: 0 12px 28px rgba(244, 114, 182, 0.16);
    animation: welcomeSignaturePop 1.2s cubic-bezier(0.16, 0.92, 0.2, 1) both;
}

@keyframes welcomeGridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 38px 38px, 38px 38px; }
}

@keyframes welcomeAuroraOrbit {
    to { transform: rotate(360deg); }
}

@keyframes welcomeAuroraOrbitReverse {
    to { transform: rotate(-360deg); }
}

@keyframes welcomeAuroraBreathe {
    0%, 100% {
        opacity: 0.62;
        filter: saturate(1.05);
    }
    50% {
        opacity: 0.92;
        filter: saturate(1.28);
    }
}

@keyframes welcomeOuterAurora {
    to { transform: rotate(360deg); }
}

@keyframes welcomeOuterAuroraReverse {
    to { transform: rotate(-360deg); }
}

@keyframes welcomeOuterGlow {
    0%, 100% {
        opacity: 0.68;
        filter: blur(12px) saturate(1.18);
    }
    50% {
        opacity: 0.94;
        filter: blur(9px) saturate(1.5);
    }
}

@keyframes welcomeOuterFloat {
    0%, 100% { border-radius: 46% 54% 52% 48% / 48% 48% 52% 52%; }
    50% { border-radius: 54% 46% 47% 53% / 45% 55% 45% 55%; }
}

@keyframes welcomeOuterFloatAlt {
    0%, 100% { border-radius: 42% 58% 47% 53% / 55% 43% 57% 45%; }
    50% { border-radius: 57% 43% 55% 45% / 44% 58% 42% 56%; }
}

@keyframes welcomeOrbitA {
    to { transform: rotate(348deg); }
}

@keyframes welcomeOrbitB {
    to { transform: rotate(-332deg); }
}

@keyframes welcomeOrbitC {
    to { transform: rotate(326deg); }
}

@keyframes welcomeOrbitGlow {
    0%, 100% { opacity: 0.18; transform: rotate(44deg) scale(0.98); }
    50% { opacity: 0.3; transform: rotate(224deg) scale(1.04); }
}

@keyframes welcomeRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes welcomeRingSpinReverse {
    to { transform: rotate(-360deg); }
}

@keyframes welcomeRingPulse {
    0%, 100% { opacity: 0.42; transform: scale(0.94); }
    50% { opacity: 1; transform: scale(1.06); }
}

@keyframes welcomeCoreBoot {
    0% { opacity: 0; transform: scale(0.62) rotate(-8deg); filter: blur(4px); }
    58% { opacity: 1; transform: scale(1.08) rotate(2deg); filter: blur(0); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); }
}

@keyframes welcomeCoreBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.035); }
}

@keyframes welcomeIconSignal {
    0%, 100% { opacity: 0.86; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.11); }
}

@keyframes welcomeStatusLoad {
    0% { transform: translateX(-105%); opacity: 0.45; }
    52% { opacity: 1; }
    100% { transform: translateX(105%); opacity: 0.45; }
}

@keyframes welcomeSignaturePop {
    0% { opacity: 0; transform: translateY(8px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.app-confirm-shell {
    display: grid;
    gap: 16px;
    align-items: start;
}

.app-confirm-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}

.app-confirm-copy {
    display: grid;
    gap: 8px;
}

.app-confirm-copy strong {
    color: #0f172a;
    font-size: 1.02rem;
}

.app-confirm-shell p {
    margin: 0;
    color: #334155;
    line-height: 1.7;
    font-size: 0.96rem;
}

.app-confirm-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.app-confirm-icon.primary { background: rgba(15, 23, 42, 0.08); color: #0f172a; }
.app-confirm-icon.success { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.app-confirm-icon.warning { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.app-confirm-icon.danger { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }

.app-confirm-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.app-confirm-note small {
    color: #64748b;
    line-height: 1.6;
}

.app-confirm-note-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-info-shell {
    display: grid;
    gap: 18px;
}

.app-info-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.app-info-hero {
    display: grid;
    gap: 10px;
    padding: 22px 22px 20px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 32%),
        radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.16), transparent 28%),
        linear-gradient(145deg, #f8fbff, #eef4ff);
    border: 1px solid rgba(191, 219, 254, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.app-info-hero h3 {
    margin: 0;
    font-size: 1.45rem;
    color: #0f172a;
}

.app-info-hero p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.app-info-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
}

.app-info-orb {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a, #2563eb);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.25);
}

.app-info-wave {
    display: inline-block;
    margin-right: 8px;
}

.app-info-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.app-info-hero-tags span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(191, 219, 254, 0.8);
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
}

.app-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.app-info-card,
.app-info-section {
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.04);
}

.app-info-card {
    display: grid;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.app-info-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -30px auto;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.13), transparent 68%);
}

.app-info-card strong {
    color: #0f172a;
    font-size: 1rem;
}

.app-info-card small,
.app-info-label {
    color: #64748b;
}

.app-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-info-section h4 {
    margin: 0 0 12px;
    color: #0f172a;
}

.app-info-highlight {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
        linear-gradient(145deg, rgba(59, 130, 246, 0.05), rgba(14, 165, 233, 0.05));
}

.app-info-highlight p {
    margin: 0;
    color: #334155;
    line-height: 1.75;
}

.app-info-section ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
    color: #334155;
}

.app-info-examples {
    display: grid;
    gap: 10px;
}

.app-info-examples span {
    display: block;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
    color: #334155;
    line-height: 1.6;
    position: relative;
    padding-left: 16px;
}

.success-toast {
    position: fixed;
    right: 26px;
    bottom: 28px;
    z-index: 12000;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    min-width: min(420px, calc(100vw - 32px));
    max-width: min(460px, calc(100vw - 32px));
    padding: 16px 18px;
    border-radius: 24px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    background:
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.22), transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 244, 0.98));
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.94);
    transition: transform 0.36s var(--apple-ease), opacity 0.24s ease;
    overflow: hidden;
}

.success-toast.is-success {
    border-color: rgba(34, 197, 94, 0.2);
    background:
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.22), transparent 32%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 244, 0.98));
}

.success-toast.is-error {
    border-color: rgba(244, 63, 94, 0.22);
    background:
        radial-gradient(circle at top right, rgba(251, 113, 133, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 241, 242, 0.98));
}

.success-toast.is-info {
    border-color: rgba(59, 130, 246, 0.22);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.98));
}

.success-toast.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.success-toast-icon {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(145deg, #16a34a, #22c55e);
    box-shadow: 0 16px 26px rgba(34, 197, 94, 0.28);
    font-size: 1.15rem;
}

.success-toast.is-error .success-toast-icon {
    background: linear-gradient(145deg, #e11d48, #f43f5e);
    box-shadow: 0 16px 26px rgba(244, 63, 94, 0.28);
}

.success-toast.is-info .success-toast-icon {
    background: linear-gradient(145deg, #2563eb, #3b82f6);
    box-shadow: 0 16px 26px rgba(59, 130, 246, 0.28);
}

.success-toast-copy {
    display: grid;
    gap: 5px;
}

.success-toast-copy strong {
    color: #14532d;
    font-size: 1rem;
}

.success-toast-copy p {
    margin: 0;
    color: #166534;
    line-height: 1.55;
    font-size: 0.92rem;
}

.success-toast.is-error .success-toast-copy strong,
.success-toast.is-error .success-toast-copy p {
    color: #9f1239;
}

.success-toast.is-info .success-toast-copy strong,
.success-toast.is-info .success-toast-copy p {
    color: #1d4ed8;
}

.chat-answer-toast {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 12050;
    width: min(380px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 13px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
    color: #111111;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.985);
    transition:
        opacity 0.24s ease,
        transform 0.28s cubic-bezier(0.2, 0.86, 0.28, 1),
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    text-align: left;
}

.chat-answer-toast.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-answer-toast:hover {
    border-color: rgba(17, 24, 39, 0.22);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

.chat-answer-toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #111111;
    color: #ffffff;
    box-shadow: none;
    font-size: 1.05rem;
}

.chat-answer-toast-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.chat-answer-toast-copy strong {
    color: #111111;
    font-size: 0.92rem;
    line-height: 1.2;
}

.chat-answer-toast-copy span {
    color: #111111;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.chat-answer-toast-copy small {
    color: #525252;
    font-size: 0.78rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.success-toast-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.success-toast-burst span {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(145deg, #4ade80, #22c55e);
    opacity: 0;
}

.success-toast.is-error .success-toast-burst span {
    background: linear-gradient(145deg, #fb7185, #f43f5e);
}

.success-toast.is-info .success-toast-burst span {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
}

.success-toast.active .success-toast-burst span {
    animation: success-burst 0.9s ease forwards;
}

.success-toast-burst span:nth-child(1) { top: 18px; left: 18px; animation-delay: 0.02s; }
.success-toast-burst span:nth-child(2) { top: 18px; right: 22px; animation-delay: 0.08s; }
.success-toast-burst span:nth-child(3) { top: 50%; left: 12px; animation-delay: 0.14s; }
.success-toast-burst span:nth-child(4) { top: 52%; right: 16px; animation-delay: 0.18s; }
.success-toast-burst span:nth-child(5) { bottom: 14px; left: 58px; animation-delay: 0.24s; }
.success-toast-burst span:nth-child(6) { bottom: 12px; right: 54px; animation-delay: 0.3s; }

@keyframes success-burst {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.4);
    }
    40% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-18px) scale(0.7);
    }
}

body.dark-mode .app-dialog-content {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.93));
    border-color: rgba(96, 165, 250, 0.2);
}

body.dark-mode .app-dialog-header,
body.dark-mode .app-dialog-actions {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
}

body.dark-mode .app-dialog-body {
    background: linear-gradient(180deg, rgba(8, 17, 31, 0.94), rgba(15, 23, 42, 0.92));
}

body.dark-mode .dialog-btn.secondary {
    background: rgba(30, 41, 59, 0.9);
    color: #dbe7f3;
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .app-confirm-copy strong,
body.dark-mode .app-info-hero h3,
body.dark-mode .app-info-card strong,
body.dark-mode .app-info-section h4 {
    color: #f8fafc;
}

body.dark-mode .app-confirm-shell p,
body.dark-mode .app-confirm-note small,
body.dark-mode .app-info-hero p,
body.dark-mode .app-info-section ul,
body.dark-mode .app-info-highlight p,
body.dark-mode .app-info-examples span,
body.dark-mode .app-info-card small,
body.dark-mode .app-info-label {
    color: #cbd5e1;
}

body.dark-mode .app-confirm-note,
body.dark-mode .app-info-card,
body.dark-mode .app-info-section {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.2);
}

body.dark-mode .app-info-hero {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.24), transparent 32%),
        radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.9));
    border-color: rgba(96, 165, 250, 0.24);
}

body.dark-mode .app-info-badge,
body.dark-mode .app-info-hero-tags span {
    background: rgba(15, 23, 42, 0.72);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.18);
}

body.dark-mode .app-info-examples span {
    background: rgba(30, 41, 59, 0.76);
    border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode .chosen-container-multi .chosen-choices,
body.dark-mode .chosen-container .chosen-drop,
body.dark-mode .chosen-container .chosen-search input[type="text"] {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .chosen-container .chosen-results li {
    color: #dbe7f3 !important;
}

body.dark-mode .chosen-container .chosen-results li.highlighted {
    background: linear-gradient(145deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
}

body.dark-mode .success-toast {
    border-color: rgba(34, 197, 94, 0.18);
    background:
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.18), transparent 32%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(20, 83, 45, 0.92));
}

body.dark-mode .success-toast.is-error {
    border-color: rgba(244, 63, 94, 0.2);
    background:
        radial-gradient(circle at top right, rgba(251, 113, 133, 0.16), transparent 32%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(127, 29, 29, 0.92));
}

body.dark-mode .success-toast.is-info {
    border-color: rgba(59, 130, 246, 0.22);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 32%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.92));
}

body.dark-mode .success-toast-copy strong,
body.dark-mode .success-toast-copy p {
    color: #dcfce7;
}

body.dark-mode .chat-answer-toast {
    background: rgba(10, 10, 10, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
    color: #ffffff;
}

body.dark-mode .chat-answer-toast-icon {
    background: #ffffff;
    color: #111111;
}

body.dark-mode .chat-answer-toast-copy strong {
    color: #ffffff;
}

body.dark-mode .chat-answer-toast-copy span {
    color: #ffffff;
}

body.dark-mode .chat-answer-toast-copy small {
    color: #d4d4d4;
}

body.dark-mode .success-toast.is-error .success-toast-copy strong,
body.dark-mode .success-toast.is-error .success-toast-copy p,
body.dark-mode .success-toast.is-info .success-toast-copy strong,
body.dark-mode .success-toast.is-info .success-toast-copy p {
    color: #eff6ff;
}

@media (max-width: 768px) {
    .app-dialog-content {
        width: min(100%, 100%);
        max-height: min(92vh, 920px);
        border-radius: 24px;
    }

    .app-dialog-header,
    .app-dialog-body,
    .app-dialog-actions {
        padding-left: 18px;
        padding-right: 18px;
    }

    .app-dialog-actions {
        justify-content: stretch;
    }

    .dialog-btn {
        width: 100%;
    }

    .app-confirm-hero {
        grid-template-columns: 1fr;
    }

    .app-confirm-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-info-grid {
        grid-template-columns: 1fr;
    }

    .app-info-hero-top {
        align-items: flex-start;
    }

    .app-info-orb {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .success-toast {
        right: 12px;
        left: 12px;
        bottom: 16px;
        min-width: auto;
        max-width: none;
    }

    .chat-answer-toast {
        top: 14px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

.analysis-loading,
.analysis-summary-card,
.analysis-meta-card,
.analysis-section {
    padding: 18px 20px;
}

.analysis-summary {
    color: var(--text-main);
}

.analysis-disclaimer {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.analysis-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.analysis-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.analysis-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 600;
}

.analysis-chip.muted {
    background: #f1f5f9;
    color: #64748b;
}

.analysis-section h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #0f172a;
}

.analysis-block p:first-child,
.analysis-block pre:first-child {
    margin-top: 0;
}

.analysis-block p:last-child,
.analysis-block pre:last-child {
    margin-bottom: 0;
}

.analysis-pre-block {
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    border-radius: 18px;
    padding: 14px 16px;
    overflow: auto;
}

.analysis-pre-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #0f172a;
    font-size: 0.84rem;
    line-height: 1.6;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.analysis-muted {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.analysis-rag-list {
    display: grid;
    gap: 14px;
}

.analysis-rag-scope {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.72));
}

.analysis-rag-scope h4 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analysis-rag-hit {
    padding: 12px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.analysis-rag-hit:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.analysis-rag-hit-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
}

.analysis-rag-hit-head strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.analysis-rag-hit-head span,
.analysis-rag-hit small {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.analysis-rag-hit p {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 0.86rem;
    line-height: 1.55;
}

.feedback-monitor-list {
    display: grid;
    gap: 14px;
}

.feedback-monitor-card {
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    padding: 16px 18px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.feedback-monitor-card.positive {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.06);
}

.feedback-monitor-card.negative {
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.06);
}

.feedback-monitor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.feedback-monitor-head span {
    color: #64748b;
    font-size: 0.82rem;
}

.feedback-monitor-question {
    margin: 0 0 8px;
    font-weight: 700;
    color: #0f172a;
}

.feedback-monitor-answer {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.feedback-monitor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.feedback-monitor-btn {
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    color: #0f172a;
    border-radius: 14px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feedback-monitor-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
    border-color: rgba(148, 163, 184, 0.9);
}

/* Efecto de fijado (Pin) con animación líquida */
.active-pin {
    color: #fbbc04 !important;
    transform: rotate(-45deg);
    filter: drop-shadow(0 0 5px rgba(251, 188, 4, 0.4));
    transition: all 0.4s var(--apple-spring);
}

.chat-item {
    position: relative;
    overflow: hidden;
}

/* El efecto de gota al hacer clic en un chat del historial */
.chat-item::after {
    content: "";
    position: absolute;
    background: rgba(0, 0, 0, 0.05);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-item:active::after {
    animation: ripple-liquid 0.6s ease-out;
    left: 50%;
    top: 50%;
}

@keyframes ripple-liquid {
    from { transform: scale(0); opacity: 1; filter: blur(5px); }
    to { transform: scale(40); opacity: 0; filter: blur(20px); }
}

/* Contenedor del botón de 3 puntos */
.chat-options-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-options {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-options:hover {
    color: #111;
    background: #e9e9e9;
}

/* El menú desplegable flotante */
.chat-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

/* Clase mágica para mostrar el menú */
.chat-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f4f4f4;
}

/* Estilo rojo para el botón de eliminar */
.dropdown-item.delete-item {
    color: #d93025;
    border-top: 1px solid #f0f0f0;
}

.dropdown-item.delete-item:hover {
    background: #fce8e6;
}

/* Nuevo Menú Flotante Global (Elimina el antiguo .chat-dropdown primero) */
.ingeo-global-dropdown {
    display: none; /* Oculto por defecto */
    position: fixed; /* Posicionamiento fijo relativo a la pantalla entera (viewport) */
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10000; /* Z-index extremadamente alto para superponerse a CUALQUIER overflow */
    min-width: 160px;
    overflow: hidden;
    color: #333;
}

/* Clase mágica para mostrar el menú global */
.ingeo-global-dropdown.show {
    display: block;
}

.ingeo-global-dropdown-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    user-select: none; /* Previene selección de texto al hacer click */
}

.ingeo-global-dropdown-item:hover {
    background: #f4f4f4;
}

/* Estilo rojo para el botón de eliminar */
.ingeo-global-dropdown-item.delete-item {
    color: #d93025;
    border-top: 1px solid #f0f0f0;
}

.ingeo-global-dropdown-item.delete-item:hover {
    background: #fce8e6;
}

