@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/**
 * WellsTrack mobile app — Corporate Slate theme
 * Inspired by premium SaaS & Fintech: crisp, professional, high-legibility.
 * Dark mode = html.dark (opt-in via Profile toggle)
 */

/* ─── Design Tokens ─── */
:root {
    /* Corporate Light Mode - Clean Slate/White */
    --wt-bg-page:       #F8FAFC;
    --wt-bg-elevated:   #FFFFFF;
    --wt-bg-surface:    #F1F5F9;
    --wt-bg-hover:      #E2E8F0;

    /* Corporate Typography */
    --wt-text-primary:  #0F172A;
    --wt-text-secondary:#475569;
    --wt-text-muted:    #94A3B8;

    /* Subtle borders & shadows */
    --wt-border:        rgba(15, 23, 42, 0.08);
    --wt-border-card:   rgba(15, 23, 42, 0.05);
    --wt-shadow-card:   0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --wt-shadow-nav:    0 -1px 0 rgba(0,0,0,0.06);
    --wt-shadow-hover:  0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);

    /* Gradients & Brand */
    --wt-brand-gradient: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
    --wt-brand-gradient-hover: linear-gradient(135deg, #1D4ED8 0%, #4338CA 100%);

    /* Brand Accent (SaaS Blue) */
    --wt-brand-50:  #EFF6FF;
    --wt-brand-100: #DBEAFE;
    --wt-brand-200: #BFDBFE;
    --wt-brand-500: #3B82F6;
    --wt-brand-600: #2563EB;
    --wt-brand-700: #1D4ED8;
    --wt-brand-800: #1E40AF;
    --wt-brand-900: #1E3A8A;

    /* Functional */
    --wt-green: #10B981;
    --wt-green-bg: rgba(16, 185, 129, 0.08);
    --wt-red: #EF4444;
    --wt-red-bg: rgba(239, 68, 68, 0.08);
    --wt-amber: #F59E0B;
    --wt-amber-bg: rgba(245, 158, 11, 0.08);

    /* Layout */
    --wt-nav-bar-h: 3.5rem;
    --wt-gesture-extra: 0.5rem;
    --wt-safe-top: env(safe-area-inset-top, 0px);
    --wt-safe-bottom: env(safe-area-inset-bottom, 0px);
    --wt-top-inset: max(0.75rem, var(--wt-safe-top));
    --wt-bottom-inset: calc(var(--wt-nav-bar-h) + var(--wt-gesture-extra) + var(--wt-safe-bottom));
    --wt-radius: 1rem;
    --wt-radius-sm: 0.75rem;
    --wt-radius-xs: 0.5rem;

    /* Motion */
    --wt-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --wt-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --wt-duration: 0.35s;
    --wt-duration-fast: 0.2s;
}

/* ─── Dark Mode (opt-in only) ─── */
html.dark {
    --wt-bg-page:       #020617;
    --wt-bg-elevated:   #0F172A;
    --wt-bg-surface:    #1E293B;
    --wt-bg-hover:      #334155;

    --wt-text-primary:  #F8FAFC;
    --wt-text-secondary:#94A3B8;
    --wt-text-muted:    #64748B;

    --wt-border:        rgba(255, 255, 255, 0.08);
    --wt-border-card:   rgba(255, 255, 255, 0.06);
    --wt-shadow-card:   0 2px 8px rgba(0,0,0,0.3);
    --wt-shadow-nav:    0 -1px 0 rgba(255,255,255,0.06);
    --wt-shadow-hover:  0 4px 16px rgba(0,0,0,0.4);

    --wt-brand-gradient: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
    --wt-brand-gradient-hover: linear-gradient(135deg, #60A5FA 0%, #818CF8 100%);

    --wt-brand-50:  rgba(37, 99, 235, 0.1);
    --wt-brand-100: rgba(37, 99, 235, 0.18);
    --wt-brand-200: rgba(37, 99, 235, 0.25);
    --wt-brand-500: #60A5FA;
    --wt-brand-600: #3B82F6;
    --wt-brand-700: #2563EB;
    --wt-brand-800: #1D4ED8;
    --wt-brand-900: #1E40AF;

    --wt-green-bg: rgba(16, 185, 129, 0.12);
    --wt-red-bg: rgba(239, 68, 68, 0.12);
    --wt-amber-bg: rgba(245, 158, 11, 0.12);
}

/* ─── Global Animations ─── */
@keyframes wtFadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes wtScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes wtSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes wtShimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

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

.wt-animate-in {
    animation: wtFadeSlideUp var(--wt-duration) var(--wt-ease) both;
}

.wt-animate-in-1 { animation-delay: 0.05s; }
.wt-animate-in-2 { animation-delay: 0.1s; }
.wt-animate-in-3 { animation-delay: 0.15s; }
.wt-animate-in-4 { animation-delay: 0.2s; }
.wt-animate-in-5 { animation-delay: 0.25s; }

.wt-fade-in {
    animation: wtFadeIn 0.4s ease both;
}

/* Theme transition class (added during toggle for smooth switch) */
.wt-theme-transitioning,
.wt-theme-transitioning *,
.wt-theme-transitioning *::before,
.wt-theme-transitioning *::after {
    transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ─── App Shell ─── */
.wt-app-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior-y: none;
    background: var(--wt-bg-page);
    color: var(--wt-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide scrollbars globally to mimic native views */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent; /* make scrollbar invisible */
}
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Allow text selection where appropriate */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: auto;
    user-select: auto;
}

.selectable-text {
    -webkit-user-select: text;
    user-select: text;
}

a, button, [role="button"], input, select, textarea, .wt-bottom-nav__item, .wt-post-card, .wt-bento-tile {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Page enter animation */
.wt-app-body > .wt-mobile-shell {
    animation: wtFadeSlideUp 0.5s var(--wt-ease) both;
}

body.wt-has-bottom-nav {
    padding-top: var(--wt-top-inset);
    padding-bottom: var(--wt-bottom-inset);
}

.wt-mobile-shell {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    min-height: calc(100dvh - var(--wt-top-inset) - var(--wt-bottom-inset));
    position: relative;
}

/* ─── Page Header ─── */
.wt-page-header {
    padding: 0.75rem 1rem 0.875rem;
    background: var(--wt-bg-elevated);
    border-bottom: 1px solid var(--wt-border);
}

.wt-page-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--wt-text-primary);
    letter-spacing: -0.02em;
}

.wt-page-header .wt-page-sub {
    font-size: 0.6875rem;
    color: var(--wt-text-muted);
    margin-top: 0.125rem;
}

.wt-brand-accent {
    color: var(--wt-brand-600);
}

/* ─── Bottom Navigation (Myntra-clean) ─── */
.wt-bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    z-index: 90;
    width: 100%;
    max-width: 28rem;
    background: var(--wt-bg-elevated);
    border-top: 1px solid var(--wt-border);
    box-shadow: var(--wt-shadow-nav);
}

.wt-bottom-nav__bar {
    display: flex;
    align-items: stretch;
    height: var(--wt-nav-bar-h);
    padding: 0 0.25rem;
}

.wt-bottom-nav__system-pad {
    height: calc(var(--wt-gesture-extra) + var(--wt-safe-bottom));
    min-height: var(--wt-gesture-extra);
    background: inherit;
}

.wt-bottom-nav__item {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    text-decoration: none;
    color: var(--wt-text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.375rem 0.25rem 0.25rem;
    border-radius: 1rem;
    transition: color var(--wt-duration-fast) ease;
}

.wt-bottom-nav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    font-size: 1.35rem;
    line-height: 1;
    z-index: 1;
}

.wt-bottom-nav__label {
    z-index: 1;
    line-height: 1.1;
}

.wt-bottom-nav__indicator {
    position: absolute;
    top: 0.25rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 3.5rem;
    height: 2rem;
    border-radius: 1rem;
    background: var(--wt-brand-gradient);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}

.wt-bottom-nav__item--active {
    color: var(--wt-brand-700);
}

.wt-bottom-nav__item--active .wt-bottom-nav__icon {
    color: #FFFFFF;
}

.wt-bottom-nav__item--active .wt-bottom-nav__indicator {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
}

html.dark .wt-bottom-nav__item--active .wt-bottom-nav__icon {
    color: #FFFFFF;
}

html.dark .wt-bottom-nav__item--active {
    color: var(--wt-brand-500);
}

.wt-bottom-nav__item:active {
    opacity: 0.85;
}

.wt-bottom-nav--hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Legacy top nav — hidden */
.wt-top-nav {
    display: none !important;
}

/* ─── Card System (Clean Myntra-style) ─── */
.wt-card-glow {
    border-radius: var(--wt-radius);
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border-card);
    box-shadow: var(--wt-shadow-card);
    transition: box-shadow var(--wt-duration) ease, transform var(--wt-duration-fast) ease;
}

.wt-card-glow:active {
    transform: scale(0.985);
}

.wt-glass-card {
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border-card);
    box-shadow: var(--wt-shadow-card);
    border-radius: var(--wt-radius);
}

/* ─── Surfaces ─── */
.wt-app-header {
    background-color: var(--wt-bg-elevated);
    border-bottom: 1px solid var(--wt-border);
    color: var(--wt-text-primary);
}

.wt-app-surface,
.wt-menu-card {
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border-card);
    color: var(--wt-text-primary);
    border-radius: var(--wt-radius);
    box-shadow: var(--wt-shadow-card);
}

.wt-menu-item {
    color: var(--wt-text-primary);
}

.wt-muted {
    color: var(--wt-text-muted);
}

/* ─── Profile Hero (logo-matching blue gradient) ─── */
.wt-profile-hero {
    background: var(--wt-brand-gradient);
    color: #ffffff;
    border-bottom: none;
}

html.dark .wt-profile-hero {
    background: var(--wt-brand-gradient);
}

.wt-profile-hero h1,
.wt-profile-hero h2,
.wt-profile-hero p,
.wt-profile-hero .text-slate-900,
.wt-profile-hero .text-gray-700 {
    color: #ffffff !important;
}

.wt-profile-hero .dark\:text-white,
.wt-profile-hero .dark\:text-gray-300 {
    color: #ffffff !important;
}

/* ─── Research Hero ─── */
.wt-research-hero {
    background: linear-gradient(165deg, #10b981 0%, #059669 30%, #047857 70%, #064e3b 100%);
    color: #ffffff;
    border-bottom: none;
}

html.dark .wt-research-hero {
    background: linear-gradient(165deg, #059669 0%, #047857 40%, #064e3b 100%);
}

.wt-research-hero h1,
.wt-research-hero h2,
.wt-research-hero p {
    color: #ffffff !important;
}

/* ─── Bento Grid ─── */
.wt-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.wt-bento-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 1.25rem;
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 110px;
}

.wt-bento-tile:active {
    transform: scale(0.96);
}

.wt-bento-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
}

.wt-bento-label {
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.2;
    z-index: 1;
}

/* Bento Tile Colors */
.wt-bento--blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.wt-bento--blue .wt-bento-icon { background: #3b82f6; color: #fff; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }

.wt-bento--green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #14532d;
}
.wt-bento--green .wt-bento-icon { background: #22c55e; color: #fff; box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3); }

.wt-bento--orange {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #7c2d12;
}
.wt-bento--orange .wt-bento-icon { background: #f97316; color: #fff; box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3); }

.wt-bento--red {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #7f1d1d;
}
.wt-bento--red .wt-bento-icon { background: #ef4444; color: #fff; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); }

/* Dark mode bento */
html.dark .wt-bento--blue { background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.2) 100%); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
html.dark .wt-bento--green { background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 83, 45, 0.2) 100%); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
html.dark .wt-bento--orange { background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(124, 45, 18, 0.2) 100%); border-color: rgba(249, 115, 22, 0.3); color: #fdba74; }
html.dark .wt-bento--red { background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(127, 29, 29, 0.2) 100%); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* ─── Alerts ─── */
.wt-alerts-shell {
    background: var(--wt-bg-page);
    color: var(--wt-text-primary);
}

.wt-alerts-list-header {
    background: var(--wt-bg-elevated);
    border-bottom: 1px solid var(--wt-border);
}

.wt-alerts-list-header h1 {
    color: var(--wt-text-primary);
}

.wt-chat-item:hover,
.wt-chat-item:active {
    background: var(--wt-bg-hover);
}

/* ─── Shimmer ─── */
.wt-shimmer {
    background: var(--wt-bg-surface);
    background-image: linear-gradient(
        to right,
        var(--wt-bg-surface) 0%,
        var(--wt-bg-elevated) 20%,
        var(--wt-bg-surface) 40%,
        var(--wt-bg-surface) 100%
    );
    background-repeat: no-repeat;
    background-size: 600px 100%;
    animation: wtShimmer 1.8s infinite linear forwards;
    border-radius: var(--wt-radius-sm);
}

/* ─── Tabs & Pills ─── */
.wt-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: var(--wt-radius-sm);
    background: var(--wt-bg-surface);
    border: 1px solid var(--wt-border);
}

.wt-mode-btn {
    border: none;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--wt-text-muted);
    background: transparent;
    cursor: pointer;
    transition: all var(--wt-duration-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wt-mode-btn--active {
    background: var(--wt-bg-elevated);
    color: var(--wt-brand-600);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wt-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--wt-border);
    background: var(--wt-bg-elevated);
    color: var(--wt-text-muted);
    transition: all var(--wt-duration-fast) ease;
}

.wt-cat-pill--active {
    background: linear-gradient(135deg, var(--wt-brand-500), var(--wt-brand-600));
    border-color: var(--wt-brand-600);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 63, 138, 0.3);
}

/* ─── News Cards ─── */
.wt-news-card {
    border-bottom: 1px solid var(--wt-border);
    padding-bottom: 1.25rem;
    margin-bottom: 0.5rem;
}

.wt-feed-card {
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border-card);
    border-radius: var(--wt-radius);
    color: var(--wt-text-primary);
    box-shadow: var(--wt-shadow-card);
    transition: box-shadow var(--wt-duration) ease, transform var(--wt-duration-fast) ease;
}

.wt-feed-card:active {
    transform: scale(0.985);
}

.wt-feed-card h3 {
    color: var(--wt-text-primary);
}

/* ─── Empty State ─── */
.wt-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--wt-text-muted);
}

/* ─── Theme Toggle Switch ─── */
.wt-theme-switch {
    background-color: var(--wt-bg-surface);
    border: 1px solid var(--wt-border);
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 9999px;
}

html.dark .wt-theme-switch {
    background-color: var(--wt-brand-600);
    border-color: var(--wt-brand-500);
}

.wt-toggle input:checked + .wt-toggle-slider {
    background: linear-gradient(135deg, #1E3F8A 0%, #FAF8F5 100%);
    border-color: #1E3F8A;
}

html.dark .wt-toggle input:checked + .wt-toggle-slider {
    background: linear-gradient(135deg, #3A5FA0 0%, #252525 100%);
    border-color: #3A5FA0;
}

.wt-toggle input:checked + .wt-toggle-slider:before {
    transform: translateX(20px);
}

.wt-theme-switch::after {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ─── Buttons ─── */
.wt-btn-primary {
    background: linear-gradient(135deg, #3466B5, #1E3F8A);
    color: #fff;
    font-weight: 700;
    border-radius: var(--wt-radius-sm);
    box-shadow: 0 2px 8px rgba(30, 63, 138, 0.25);
    transition: all var(--wt-duration-fast) ease;
    border: none;
}

.wt-btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(30, 63, 138, 0.2);
}

/* ─── WhatsApp chat (alerts detail) ─── */
.wt-wa-chat { background-color: #0b141a; }
.wt-wa-chat-header { background-color: #1f2c34; }
.wt-wa-chat-input { background-color: #1f2c34; }

#chat-view.wt-chat-closed {
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
}

#chat-view.wt-chat-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    z-index: 110;
}

#chat-history.wt-wa-chat {
    background-color: #0b141a;
}

/* ─── Skeleton ─── */
.wt-skeleton-inline {
    background-color: var(--wt-bg-surface);
    border-radius: var(--wt-radius-xs);
}

/* ─── Glass utility ─── */
.glass {
    background: var(--wt-bg-elevated);
    border: 1px solid var(--wt-border-card);
    box-shadow: var(--wt-shadow-card);
    border-radius: var(--wt-radius);
}

/* ─── Dashboard profile hero text overrides ─── */
.wt-profile-hero .text-gray-500,
.wt-profile-hero .text-gray-600,
.wt-profile-hero #subExpiry,
.wt-profile-hero #planStart {
    color: rgba(248, 246, 243, 0.75) !important;
}

.wt-profile-hero #subStatus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
}

/* ─── Scrollbar utilities ─── */
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ─── Focus & Accessibility ─── */
:focus-visible {
    outline: 2px solid var(--wt-brand-500);
    outline-offset: 2px;
}

/* ─── Selection ─── */
::selection {
    background: var(--wt-brand-100);
    color: var(--wt-brand-900);
}

html.dark ::selection {
    background: var(--wt-brand-600);
    color: #fff;
}

/* SPA View Sandboxing (Scroll Memory) */
/* Only the OUTER shell root gets the fixed viewport treatment */
#wt-shell-root.wt-mobile-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* When bottom nav is present, shrink shell to leave room for the nav */
.wt-has-bottom-nav #wt-shell-root.wt-mobile-shell {
    height: calc(100vh - var(--wt-bottom-inset));
    height: calc(100dvh - var(--wt-bottom-inset));
}

/* Inner .wt-mobile-shell inside views must NOT inherit the SPA lock */
.wt-view .wt-mobile-shell {
    display: block;
    height: auto;
    overflow: visible;
    min-height: 0;
}

.wt-view {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    width: 100%;
    will-change: opacity, transform;
    /* Keep scroll state inside this container */
}

.wt-view.wt-view--active {
    animation: wtTabInNative 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes wtTabInNative {
    0% { opacity: 0; transform: scale(0.985) translateY(6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Ensure body doesn't scroll in SPA mode */
.wt-app-body.wt-has-bottom-nav {
    overflow: hidden;
}

/* ─── Global API Loader ─── */
.wt-global-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

html.dark .wt-global-loader {
    background: rgba(15, 23, 42, 0.5);
}

.wt-global-loader.wt-global-loader--active {
    opacity: 1;
    pointer-events: auto;
}

.wt-global-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--wt-brand-600);
    border-right-color: var(--wt-brand-500);
    animation: wtGlobalSpin 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

html.dark .wt-global-spinner {
    border-top-color: var(--wt-brand-500);
    border-right-color: var(--wt-brand-400);
}

@keyframes wtGlobalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
