:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --btn-num-bg: #f9fafb;
    --btn-num-active: #e5e7eb;
    --btn-op-bg: #f3e8ff;
    --btn-op-text: #7e22ce;
    --btn-plus-bg: #dbeafe;
    --btn-plus-text: #1d4ed8;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --sponsor-bg: #fff7ed;
    --sponsor-text: #c2410c;
    --sponsor-border: #ffedd5;

    --highlight-bg: #dbeafe;
    --highlight-border: #93c5fd;
    --highlight-text: #1d4ed8;
    --clear-bg: #fee2e2;
    --clear-active: #fecaca;
}

:root.dark {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-main: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #333333;
    --btn-num-bg: #1a1a1a;
    --btn-num-active: #333333;
    --btn-op-bg: #2e1065;
    --btn-op-text: #d8b4fe;
    --btn-plus-bg: #1e3a8a;
    --btn-plus-text: #bfdbfe;
    --sponsor-bg: #431407;
    --sponsor-text: #fdba74;
    --sponsor-border: #7c2d12;

    --highlight-bg: #1e3a8a;
    --highlight-border: #2563eb;
    --highlight-text: #bfdbfe;
    --clear-bg: #450a0a;
    --clear-active: #7f1d1d;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
}

.container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 30px rgba(0,0,0,0.05);
    position: relative;
}

@media (min-width: 450px) {
    body { padding: 20px; }
    .container { border-radius: 24px; max-height: 850px; height: 95vh; }
}

/* Snap Scroll wrapper para las dos calculadoras */
.calc-carousel-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.calc-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.calc-page {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    gap: 8px;
}

/* Botón / Banner de notificaciones entre el menú y las tasas */
.notif-banner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-num-bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: transform 0.12s ease, border-color 0.2s ease, background-color 0.2s ease;
    font-family: var(--font-family);
    cursor: pointer;
    outline: none;
    position: relative;
    flex-shrink: 0;
}

.notif-banner-btn.has-unread {
    border-color: rgba(239, 68, 68, 0.45);
    background-color: var(--sponsor-bg);
}

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

.notif-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.notif-logo-wrap img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background-color: var(--accent-red);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 999px;
    border: 1.5px solid var(--card-bg);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    pointer-events: none;
    animation: badge-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================================
   Estilos de Autenticación Supabase y Cuenta (Deep Dark & Animado)
   ========================================================== */
@keyframes auth-backdrop-fade-in {
    from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}

@keyframes auth-backdrop-fade-out {
    from { opacity: 1; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
    to { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
}

@keyframes auth-card-scale-in {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes auth-card-scale-out {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.97) translateY(6px);
    }
}

#auth-modal.active,
#user-profile-modal.active {
    display: flex !important;
    animation: auth-backdrop-fade-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#auth-modal.is-closing,
#user-profile-modal.is-closing {
    animation: auth-backdrop-fade-out 0.18s cubic-bezier(0.4, 0, 1, 1) forwards !important;
    pointer-events: none;
}

#auth-modal.active .auth-card,
#user-profile-modal.active .auth-card {
    animation: auth-card-scale-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

#auth-modal.is-closing .auth-card,
#user-profile-modal.is-closing .auth-card {
    animation: auth-card-scale-out 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.auth-card {
    background: var(--card-bg);
    color: var(--text-main);
    width: 100%;
    max-width: 410px;
    border-radius: 24px;
    padding: 24px 22px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.18);
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Modo oscuro profundo (Deep Dark puro, sin tonalidad azul) */
:root.dark .auth-card {
    background: #0f0f10;
    border-color: #27272a;
    color: #f9fafb;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.auth-tabs {
    display: flex;
    background: var(--btn-num-bg);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    gap: 4px;
}

:root.dark .auth-tabs {
    background: #18181b;
    border-color: #27272a;
}

.auth-tab {
    flex: 1;
    padding: 9px 10px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    font-family: inherit;
}

.auth-tab.is-active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

:root.dark .auth-tab.is-active {
    background: #27272a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
    text-align: left;
}

.auth-field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--text-secondary);
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    background: var(--btn-num-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 42px 11px 38px;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

:root.dark .auth-input-wrap input {
    background: #18181b;
    border-color: #27272a;
    color: #f9fafb;
}

.auth-input-wrap input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

:root.dark .auth-input-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.auth-eye-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-eye-btn:hover {
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.05);
}

:root.dark .auth-eye-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.auth-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 14px;
    line-height: 1.35;
    text-align: left;
}

.auth-msg.is-error {
    background-color: var(--clear-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-msg.is-success {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

:root.dark .auth-msg.is-success {
    background-color: #052e16;
    color: #86efac;
    border-color: #166534;
}

.auth-submit-btn {
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s, transform 0.12s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    font-family: inherit;
}

:root.dark .auth-submit-btn {
    background-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0 12px;
    color: var(--text-secondary);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

:root.dark .auth-divider::before,
:root.dark .auth-divider::after {
    border-color: #27272a;
}

.auth-divider span {
    padding: 0 10px;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.auth-guest-btn {
    width: 100%;
    background: var(--btn-num-bg);
    color: var(--text-main);
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    padding: 11px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s, transform 0.12s, border-color 0.2s;
    font-family: inherit;
}

:root.dark .auth-guest-btn {
    background: #18181b;
    border-color: #3f3f46;
    color: #f4f4f5;
}

.auth-guest-btn:active {
    transform: scale(0.98);
    background: var(--btn-num-active);
}

.auth-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Tarjeta de estado de sesión iniciada (Colores sólidos y limpios) */
.user-status-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    text-align: left;
    transition: background-color 0.2s, border-color 0.2s;
}

:root.dark .user-status-card {
    background-color: #18181b;
    border-color: #27272a;
}

.user-check-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #16a34a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

:root.dark .user-check-icon-wrap {
    background-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.45);
}

.user-status-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-status-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

:root.dark .user-status-title {
    color: #f4f4f5;
}

.auth-logout-btn {
    width: 100%;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    font-family: inherit;
}

:root.dark .auth-logout-btn {
    background-color: #18181b;
    color: #f87171;
    border-color: #3f3f46;
}

.auth-logout-btn:active {
    background-color: #fee2e2;
}

:root.dark .auth-logout-btn:active {
    background-color: #27272a;
}

.menu-btn-auth {
    font-weight: 600;
    color: var(--text-main);
}

.menu-btn-auth.is-authenticated {
    color: #2563eb;
}

:root.dark .menu-btn-auth.is-authenticated {
    color: #60a5fa;
}

/* Botón Hazte Premium (Compacto y Responsivo) */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3.5px;
    background-color: #f59e0b;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: -0.15px;
    padding: 4px 8px;
    border-radius: 999px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    max-height: 26px;
    -webkit-tap-highlight-color: transparent;
}

.btn-premium:active {
    transform: scale(0.95);
    opacity: 0.88;
}

.btn-premium svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    fill: #ffffff;
}

.menu-btn-premium {
    color: #d97706 !important;
    font-weight: 600;
}

:root.dark .btn-premium {
    background-color: #d97706;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

:root.dark .menu-btn-premium {
    color: #fbbf24 !important;
}

/* Candaditos y Bloqueo de Beneficios Premium */
.premium-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: #d97706;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 6px;
    padding: 2px 5px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

:root.dark .premium-lock-badge {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
}

.premium-lock-badge svg {
    width: 13px;
    height: 13px;
    display: block;
}

/* Bloqueo Segunda Calculadora Auxiliar */
.calc-page[data-calc-id="2"] {
    position: relative;
}

.calc2-premium-lock {
    position: absolute;
    inset: 0;
    z-index: 70;
    background: rgba(243, 244, 246, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInLock 0.2s ease;
}

:root.dark .calc2-premium-lock {
    background: rgba(0, 0, 0, 0.94);
}

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

.calc2-lock-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.calc2-lock-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
}

.calc2-lock-icon {
    width: 28px;
    height: 28px;
}

.calc2-lock-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.calc2-lock-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.calc2-lock-btn {
    width: 100%;
    margin-top: 6px;
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28);
    transition: transform 0.15s ease;
}

.calc2-lock-btn:active {
    transform: scale(0.97);
}

.calc2-lock-btn svg {
    color: #fef08a;
}

/* Cuando el usuario ES Premium, ocultar candaditos y bloqueo */
html.user-is-premium .premium-lock-badge,
:root.user-is-premium .premium-lock-badge {
    display: none !important;
}

html.user-is-premium #calc2-lock-overlay,
:root.user-is-premium #calc2-lock-overlay {
    display: none !important;
}

/* Ajustes responsivos para pantallas estrechas / dispositivos móviles */
@media (max-width: 390px) {
    .header {
        gap: 5px;
    }
    .header > div:first-child {
        gap: 5px !important;
    }
    .btn-premium {
        padding: 3.5px 6.5px;
        font-size: 0.65rem;
        gap: 3px;
    }
    .btn-premium .btn-premium-prefix {
        display: none;
    }
}

@media (max-width: 330px) {
    .header {
        gap: 3px;
    }
    .header > div:first-child {
        gap: 3px !important;
    }
    .btn-premium {
        padding: 3px 5px;
        font-size: 0.62rem;
        gap: 2px;
    }
    .btn-premium svg {
        width: 10px;
        height: 10px;
    }
}

/* =====================================================
   Premium Drawer (iframe panel deslizante fluido)
   ===================================================== */
#premium-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.28s;
}

#premium-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
}

#premium-drawer-panel {
    width: 100%;
    max-width: 440px;
    height: 95dvh;
    background: var(--card-bg, #ffffff);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    position: relative;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border);
    touch-action: pan-y;
}

:root.dark #premium-drawer-panel {
    background: #0d0f12;
    border-top-color: #2e3238;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.7);
}

#premium-drawer-overlay.is-open #premium-drawer-panel {
    transform: translateY(0);
}

#premium-drawer-overlay.is-closing #premium-drawer-panel {
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1);
}

/* Barra de arrastre superior para deslizar con el dedo en móvil */
.drawer-drag-zone {
    width: 100%;
    padding: 10px 0 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    background: var(--card-bg, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    transition: background-color 0.2s;
}

:root.dark .drawer-drag-zone {
    background: #0d0f12;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.drawer-drag-zone:active {
    cursor: grabbing;
}

.drawer-drag-handle {
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background-color: var(--text-secondary);
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.2s;
}

.drawer-drag-zone:hover .drawer-drag-handle,
.drawer-drag-zone:active .drawer-drag-handle {
    opacity: 0.7;
    transform: scaleX(1.1);
}

/* Próximo pago Premium (modal de cuenta y panel premium) */
.user-premium-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 16px;
    padding: 12px 16px;
    margin: -6px 0 18px;
    text-align: left;
    transition: background-color 0.2s, border-color 0.2s;
}

:root.dark .user-premium-row {
    background-color: #18181b;
    border-color: #27272a;
}

.user-premium-row[hidden],
.premium-next-payment[hidden] {
    display: none;
}

.user-premium-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f59e0b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.user-premium-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.user-premium-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

:root.dark .user-premium-title {
    color: #f4f4f5;
}

.user-premium-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

.premium-next-payment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--card-bg, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    text-align: center;
}

:root.dark .premium-next-payment {
    background: #0d0f12;
    color: #f4f4f5;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.premium-next-payment svg {
    flex-shrink: 0;
    color: #f59e0b;
}

#premium-drawer-iframe {
    width: 100%;
    flex: 1 1 auto;
    border: none;
    display: block;
    background: transparent;
}

@media (min-width: 480px) {
    #premium-drawer-panel {
        border-radius: 24px 24px 0 0;
        height: 92dvh;
        max-width: 430px;
    }
}


/* Estilos de la ventana flotante de novedades y bandeja con scroll */
.announcement-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

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

.announcement-list::-webkit-scrollbar-track {
    background: transparent;
}

.announcement-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

.announcement-card {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    flex-shrink: 0;
}

.announcement-card.is-new-card {
    border-color: var(--highlight-border);
}

.announcement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

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

.announcement-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
    border: 1px solid var(--highlight-border);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.announcement-new-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-green);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.announcement-body-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-main);
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
}

.announcement-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--highlight-text);
    background: var(--highlight-bg);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    margin: 2px 0;
    transition: opacity 0.15s;
}

.announcement-inline-link:active {
    opacity: 0.75;
}

.announcement-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    background-color: var(--text-main);
    color: var(--card-bg);
    border: 1px solid var(--border);
    transition: transform 0.12s, opacity 0.15s;
    margin-top: 4px;
}

.announcement-cta-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.announcement-cta-btn.btn-wa {
    background-color: #25D366;
    color: #ffffff;
    border-color: #25D366;
}

.announcement-cta-btn.btn-tiktok {
    background-color: #111827;
    color: #ffffff;
    border-color: #374151;
}

:root.dark .announcement-cta-btn.btn-tiktok {
    background-color: #1f2937;
    color: #ffffff;
    border-color: #4b5563;
}

.announcement-cta-btn.btn-ig {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    border: none;
}

.announcement-cta-btn.btn-yt {
    background-color: #FF0000;
    color: #ffffff;
    border-color: #FF0000;
}

.announcement-cta-btn.btn-fb {
    background-color: #1877F2;
    color: #ffffff;
    border-color: #1877F2;
}

.announcement-cta-btn.btn-tg {
    background-color: #26A5E4;
    color: #ffffff;
    border-color: #26A5E4;
}

.bcv-container { position: relative; flex-shrink: 0; }

.bcv-badge {
    font-size: 0.95rem;
    background-color: var(--btn-num-bg);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.3px;
}

.bcv-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

.bcv-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 12px;
    z-index: 100;
    width: 255px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.bcv-dropdown.active { display: flex; }

.rate-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rate-opt-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rate-opt-btn:active, .rate-opt-btn.active {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
    color: var(--highlight-text);
}

.opt-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rate-opt-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.rate-opt-btn.active .rate-opt-val {
    color: var(--highlight-text);
}

.rate-cam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
    cursor: pointer;
}

.rate-cam-btn:hover, .rate-cam-btn:active {
    background-color: var(--border);
    color: var(--text-main);
    transform: scale(1.1);
}

.custom-rate-box {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-rate-box input {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}

.custom-rate-box button {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--text-main);
    color: var(--bg-color);
    font-size: 0.85rem;
}

.display-area {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    margin-bottom: 1rem;
    flex-shrink: 0;
    padding: 0.5rem;
    min-height: 160px;
    position: relative;
}

.tooltip-bubble {
    position: absolute;
    background: #111827;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 90;
    cursor: pointer;
    max-width: 250px;
    border: 1px solid rgba(255,255,255,0.15);
    animation: bounce-float 2.5s infinite ease-in-out;
    user-select: none;
    -webkit-user-select: none;
    display: none;
    transition: opacity 0.2s ease;
}

:root.dark .tooltip-bubble {
    background: #1f2937;
    color: #f3f4f6;
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.tooltip-bubble .tooltip-close {
    float: right;
    margin-left: 8px;
    margin-top: -2px;
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: bold;
}

.tooltip-bubble.arrow-down::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #111827;
}
:root.dark .tooltip-bubble.arrow-down::after {
    border-top-color: #1f2937;
}

.tooltip-bubble.arrow-up::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #111827;
}
:root.dark .tooltip-bubble.arrow-up::after {
    border-bottom-color: #1f2937;
}

@keyframes bounce-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.expr-tape-container {
    width: 100%;
    max-height: 92px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-bottom: 0.35rem;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.expr-tape-container::-webkit-scrollbar { display: none; }

.tape-past-list {
    width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.tape-past-item {
    color: var(--text-secondary);
    opacity: 0.68;
    font-size: 1.02rem;
    font-weight: 500;
    text-align: right;
    line-height: 1.3;
    word-break: break-word;
    animation: tape-rise 0.2s ease-out;
}

@keyframes tape-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 0.68;
        transform: translateY(0);
    }
}

.history-expr {
    color: var(--text-secondary);
    font-size: 1.35rem;
    min-height: 1.9rem;
    font-weight: 500;
    width: 100%;
    text-align: right;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.history-expr .op {
    display: inline-block;
    white-space: pre;
}

.clickable-num {
    cursor: pointer;
    border-radius: 6px;
    padding: 0 4px;
    margin: 0 -2px;
    display: inline-block;
    transition: background-color 0.15s, color 0.15s;
}

.clickable-num:active { background-color: var(--border); }

.clickable-num.editing {
    background-color: var(--highlight-bg);
    color: var(--highlight-text);
    box-shadow: 0 0 0 2px var(--highlight-border);
}

.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--accent-green);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

.cursor-blink.usd-mode { background-color: var(--accent-green); }
.cursor-blink.ves-mode { background-color: var(--btn-plus-text); }

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

@keyframes spin {
    100% { transform: rotate(360deg); }
}
.spin-anim {
    animation: spin 1s linear infinite;
}

.total-main {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.08;
    padding-top: 2px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    flex-shrink: 0;
    gap: 6px;
    letter-spacing: -1px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.2s ease;
}

.currency-symbol {
    font-size: 2.2rem;
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 500;
}

.ves-badge {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background-color: var(--accent-green);
    padding: 8px 12px 8px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.ves-badge:active { transform: scale(0.95); }

.copy-amount-btn {
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.copy-ves-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.copy-ves-btn:active {
    transform: scale(0.9);
    background-color: rgba(255, 255, 255, 0.36);
}

.copy-ves-btn svg {
    width: 14px;
    height: 14px;
}

.toast {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--text-main);
    color: var(--card-bg); 
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
    flex-grow: 1;
    min-height: 0;
}

.btn {
    border: none;
    background-color: var(--btn-num-bg);
    border-radius: 16px;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.1s, transform 0.1s;
}

.btn:active {
    background-color: var(--btn-num-active);
    transform: scale(0.95);
}

.btn-op {
    background-color: var(--btn-op-bg);
    color: var(--btn-op-text);
    font-size: 2.2rem;
    font-weight: 500;
}
.btn-op:active { background-color: #e9d5ff; }

.btn-switch svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.btn-plus {
    background-color: var(--btn-plus-bg);
    color: var(--btn-plus-text);
    font-size: 2.2rem;
}
.btn-plus:active { background-color: #bfdbfe; }

.btn-equals {
    background-color: var(--accent-green);
    color: #ffffff;
    font-size: 2.3rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-equals:active {
    background-color: #059669;
    transform: scale(0.95);
}

.btn-clear {
    background-color: var(--clear-bg, #fee2e2);
    color: var(--accent-red);
    font-weight: 600;
}
.btn-clear:active { background-color: var(--clear-active, #fecaca); }

.btn-del {
    color: var(--accent-red);
    font-size: 1.6rem;
}

.btn-zero { grid-column: span 2; }

.install-fab {
    position: fixed;
    bottom: 30px;
    right: 20px;
    background-color: var(--text-main);
    color: var(--card-bg);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 9999;
    transform: translateY(150px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s, background-color 0.2s;
    border: 2px solid rgba(255,255,255,0.1);
}

.install-fab.visible {
    transform: translateY(0);
    opacity: 1;
}

.install-fab:active {
    transform: scale(0.95);
    background-color: #1f2937;
}

.install-fab svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 450px) {
    .install-fab {
        right: auto;
        left: 50%;
        margin-left: 90px;
    }
}

.history-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.history-btn:active {
    background: var(--border);
}
.history-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.history-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.history-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.history-modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px;
    height: 75vh;
    max-height: 600px;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1), opacity 0.3s ease;
}
.history-modal-overlay.active .history-modal {
    transform: scale(1);
    opacity: 1;
}

.share-modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px;
    height: auto;
    max-height: 90vh;
    border-radius: 24px;
    padding: 20px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1), opacity 0.3s ease;
}
.history-modal-overlay.active .share-modal {
    transform: scale(1);
    opacity: 1;
}

@media (min-width: 450px) {
    .history-modal { height: 600px; }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.history-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.privacy-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.2s;
    font-weight: 500;
}
.privacy-link:active, .privacy-link:hover {
    text-decoration-color: var(--text-secondary);
    opacity: 0.7;
}

.close-history {
    background: var(--bg-color);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    font-weight: bold;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
    font-family: var(--font-family);
}
.share-btn:active {
    background: var(--btn-num-active);
}

.history-totals {
    background-color: var(--btn-num-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.15s ease;
}
.history-totals:active {
    background-color: var(--border);
}

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

.totals-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.totals-currencies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.total-currency-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1.2;
}

.totals-ves-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.totals-ves-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.total-val-ves {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--accent-green);
    text-align: right;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.history-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-list::-webkit-scrollbar { display: none; }

.history-item {
    background: var(--bg-color);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.history-item-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.history-expr-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-all;
}
.history-result {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-green);
    text-align: right;
    margin-top: 4px;
}
.history-result.usd-result {
    color: var(--text-main);
}

.delete-item-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.delete-item-btn:hover, .delete-item-btn:active {
    color: var(--accent-red);
    background: var(--clear-bg, #fee2e2);
}
.history-empty {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 40px;
    font-size: 0.9rem;
}

.clear-history-btn {
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--clear-bg, #fee2e2);
    color: var(--accent-red);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.clear-history-btn:active { opacity: 0.7; }

.history-footer-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-shrink: 0;
}

.history-footer-actions .clear-history-btn {
    margin-top: 0;
    flex: 1;
    font-size: 0.9rem;
}

.export-history-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--accent-green);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: opacity 0.2s, transform 0.12s;
}

.export-history-btn:active {
    opacity: 0.85;
    transform: scale(0.97);
}

@media print {
    body { background: white !important; color: black !important; padding: 0 !important; }
    .container > *:not(#history-modal) { display: none !important; }
    #history-modal, #history-modal * { visibility: visible; }
    #history-modal { 
        position: absolute; left: 0; top: 0; width: 100%; height: auto !important; max-height: none !important;
        background: white !important; box-shadow: none !important; transform: none !important; border-radius: 0 !important;
        padding: 10px !important;
    }
    .history-modal-overlay { background: transparent !important; position: static !important; }
    .close-history, .clear-history-btn, .export-history-btn, .history-footer-actions, .privacy-link { display: none !important; }
    .history-item { border: 1px solid #e5e7eb; margin-bottom: 8px; break-inside: avoid; background: #f9fafb !important; }
    .history-totals { border: 1px solid #d1d5db; background: #f3f4f6 !important; }
    .history-list { overflow: visible !important; max-height: none !important; }
    * { color: black !important; }
    .history-result { color: #059669 !important; }
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: .3s;
    border-radius: 20px;
}
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider {
    background-color: var(--accent-green);
}
.toggle-switch input:checked + .slider:before {
    transform: translateX(16px);
}
