/* ==========================================================================
   Teska Pay v5 — Compact Executive Fintech Design System (Light Default + Dark)
   Crisp Persian Typography | 3D Icons | Flagship Entrance & Micro-Effects
   100% Scroll-Safe for Android WebView & Mobile Browsers
   ========================================================================== */

@font-face {
    font-family: 'VazirmatnFD';
    src: url('../fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'VazirmatnFD';
    src: url('../fonts/Vazirmatn-FD-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'VazirmatnFD';
    src: url('../fonts/Vazirmatn-FD-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'VazirmatnFD';
    src: url('../fonts/Vazirmatn-FD-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'VazirmatnFD';
    src: url('../fonts/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'VazirmatnLatin';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ==================== LIGHT THEME (DEFAULT — CRISP ALABASTER + ROYAL GOLD) ==================== */
:root,
[data-theme="light"] {
    color-scheme: light;
    --bg-stage: #DCE2EE;
    --bg-stage-glow: radial-gradient(ellipse at 50% -10%, rgba(245, 184, 28, 0.14) 0%, #EAEEF6 42%, #D8DFEC 85%);
    --bg-app: #F3F5FA;
    --bg-app-glow: radial-gradient(circle at 50% -8%, rgba(245, 184, 28, 0.14) 0%, transparent 42%);
    --bg-topbar: rgba(255, 255, 255, 0.94);
    --bg-card: #FFFFFF;
    --bg-card-grad: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
    --bg-card-active: linear-gradient(160deg, #FFFFFF 0%, #FFFDF4 100%);
    --bg-card-updating: linear-gradient(180deg, #FAFBFD 0%, #F1F4F9 100%);
    --bg-surface-soft: #EEF2F8;
    --bg-surface-deep: #F1F4FA;
    --bg-input: #F8FAFD;
    --bg-seg: #E7ECF5;
    --bg-sheet: #FFFFFF;
    --bg-toast: #0B1222;
    --select-opt-bg: #FFFFFF;
    --select-opt-ink: #090F1E;

    --border: rgba(9, 15, 30, 0.11);
    --border-strong: rgba(9, 15, 30, 0.21);
    --border-updating: rgba(9, 15, 30, 0.085);

    --accent: #F0B000;
    --accent-bright: #FFCC29;
    --accent-deep: #C48A00;
    --accent-text: #946500;
    --accent-soft: rgba(245, 184, 28, 0.15);
    --accent-border: rgba(224, 158, 0, 0.52);
    --spotlight-rgb: 240, 176, 0;

    --btn-primary-bg: linear-gradient(135deg, #FFDC52 0%, #F5B81C 52%, #DC9C00 100%);
    --btn-primary-ink: #090F1E;
    --btn-primary-shadow: 0 7px 18px rgba(224, 158, 0, 0.28), 0 2px 4px rgba(9, 15, 30, 0.07);

    --ink: #090F1E;
    --ink-2: #334155;
    --ink-muted: #5A687E;
    --ink-updating: #273449;
    --placeholder: #8695AB;

    --icon-stage-bg: radial-gradient(circle at 50% 60%, rgba(245, 184, 28, 0.22) 0%, rgba(245, 184, 28, 0.05) 58%, transparent 78%);
    --icon-stage-muted: radial-gradient(circle at 50% 60%, rgba(15, 23, 42, 0.065) 0%, transparent 72%);

    --live: #16A34A;
    --live-ink: #146C34;
    --live-soft: rgba(22, 163, 74, 0.12);
    --live-border: rgba(22, 163, 74, 0.32);
    --updating-pill-bg: rgba(15, 23, 42, 0.065);
    --updating-pill-ink: #475569;

    --danger: #DC2626;
    --danger-ink: #B91C1C;
    --danger-soft: rgba(220, 38, 38, 0.09);

    --slider-track: rgba(9, 15, 30, 0.15);
    --slider-thumb-ring: #FFFFFF;
    --wizard-bar-bg: rgba(9, 15, 30, 0.12);

    --shadow-shell: 0 24px 64px rgba(9, 15, 30, 0.15), 0 0 0 1px rgba(9, 15, 30, 0.08);
    --shadow-card: 0 4px 14px rgba(9, 15, 30, 0.055);
    --shadow-service: 0 3px 12px rgba(9, 15, 30, 0.055);

    --radius-xl: 15px;
    --radius-lg: 13px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --spring: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==================== DARK THEME (DEEP OBSIDIAN + ROYAL GOLD) ==================== */
[data-theme="dark"] {
    color-scheme: dark;
    --bg-stage: #03050A;
    --bg-stage-glow: radial-gradient(ellipse at 50% -10%, rgba(245, 184, 28, 0.11) 0%, #090E1A 38%, #03050A 75%);
    --bg-app: #060911;
    --bg-app-glow: radial-gradient(circle at 50% -8%, rgba(245, 184, 28, 0.12) 0%, transparent 44%);
    --bg-topbar: rgba(6, 9, 17, 0.9);
    --bg-card: #0F1524;
    --bg-card-grad: linear-gradient(165deg, #131B2E 0%, #0C1220 100%);
    --bg-card-active: linear-gradient(155deg, #18223A 0%, #0E1526 100%);
    --bg-card-updating: linear-gradient(165deg, #101625 0%, #0B101C 100%);
    --bg-surface-soft: rgba(255, 255, 255, 0.06);
    --bg-surface-deep: #090E1A;
    --bg-input: #0A0F1D;
    --bg-seg: #0A0F1D;
    --bg-sheet: #0F1626;
    --bg-toast: #182236;
    --select-opt-bg: #0F1524;
    --select-opt-ink: #FFFFFF;

    --border: rgba(226, 232, 240, 0.11);
    --border-strong: rgba(226, 232, 240, 0.21);
    --border-updating: rgba(226, 232, 240, 0.085);

    --accent: #F5B81C;
    --accent-bright: #FFD44D;
    --accent-deep: #D49600;
    --accent-text: #FFD44D;
    --accent-soft: rgba(245, 184, 28, 0.14);
    --accent-border: rgba(245, 184, 28, 0.44);
    --spotlight-rgb: 245, 184, 28;

    --btn-primary-bg: linear-gradient(135deg, #FFE066 0%, #F5B81C 52%, #D99B00 100%);
    --btn-primary-ink: #070A12;
    --btn-primary-shadow: 0 7px 20px rgba(245, 184, 28, 0.26), 0 2px 5px rgba(0, 0, 0, 0.38);

    --ink: #FFFFFF;
    --ink-2: #C8D3E4;
    --ink-muted: #8B9BB2;
    --ink-updating: #D3DCEB;
    --placeholder: #62728A;

    --icon-stage-bg: radial-gradient(circle at 50% 60%, rgba(245, 184, 28, 0.22) 0%, rgba(245, 184, 28, 0.04) 58%, transparent 78%);
    --icon-stage-muted: radial-gradient(circle at 50% 60%, rgba(148, 163, 184, 0.13) 0%, transparent 72%);

    --live: #22C55E;
    --live-ink: #4ADE80;
    --live-soft: rgba(34, 197, 94, 0.15);
    --live-border: rgba(74, 222, 128, 0.34);
    --updating-pill-bg: rgba(148, 163, 184, 0.12);
    --updating-pill-ink: #B7C4D8;

    --danger: #F87171;
    --danger-ink: #FCA5A5;
    --danger-soft: rgba(239, 68, 68, 0.14);

    --slider-track: rgba(255, 255, 255, 0.15);
    --slider-thumb-ring: #060911;
    --wizard-bar-bg: rgba(255, 255, 255, 0.12);

    --shadow-shell: 0 28px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(245, 184, 28, 0.12);
    --shadow-card: 0 7px 22px rgba(0, 0, 0, 0.34);
    --shadow-service: 0 5px 16px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* CRITICAL FOR ANDROID WEBVIEW SCROLLING:
   Never set overflow-x: hidden on BOTH html & body (creates nested scroll trap in Chromium).
   Keep a single unambiguous vertical document scroll container! */
html {
    margin: 0;
    padding: 0;
    height: auto;
    overflow-x: clip;
    overflow-y: auto;
    background: var(--bg-app);
}

body {
    margin: 0;
    padding: 0;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    background: var(--bg-app);
    color: var(--ink);
    font-family: 'VazirmatnFD', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    font-size: 12.8px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    transition: background-color 220ms ease, color 220ms ease;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.ltr { direction: ltr; unicode-bidi: isolate; }
.ltr-code {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: 'VazirmatnLatin', monospace;
    letter-spacing: 0.04em;
}

.ic { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 26px; height: 26px; }

/* Theme Toggle Icons */
.theme-toggle-btn .ic-sun,
.theme-toggle-btn .ic-moon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 300ms var(--spring);
}
.theme-toggle-btn:active .ic-sun,
.theme-toggle-btn:active .ic-moon {
    transform: rotate(35deg) scale(0.86);
}
[data-theme="dark"] .theme-toggle-btn .ic-moon { display: none; }
[data-theme="light"] .theme-toggle-btn .ic-sun { display: none; }

/* ==========================================================================
   Keyframes — Flagship Smooth GPU Animations (Zero Scroll Interference)
   ========================================================================== */

@keyframes cardReveal {
    0%   { opacity: 0; transform: translateY(14px) scale(0.95); }
    100% { opacity: 1; transform: none; }
}

@keyframes float3D {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-4px); }
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.72); }
    70%  { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes shimmerSweep {
    0%   { transform: translateX(130%) skewX(-24deg); }
    100% { transform: translateX(-230%) skewX(-24deg); }
}

@keyframes cardSheen {
    0%, 82% { transform: translateX(145%) skewX(-22deg); opacity: 0; }
    88%     { opacity: 0.7; }
    100%    { transform: translateX(-220%) skewX(-22deg); opacity: 0; }
}

@keyframes rippleExpand {
    from { transform: scale(0); opacity: 0.4; }
    to   { transform: scale(2.6); opacity: 0; }
}

@keyframes fadeSlide {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: none; }
}

@keyframes sheetUp {
    0%   { opacity: 0; transform: translateY(28px) scale(0.98); }
    100% { opacity: 1; transform: none; }
}

@keyframes splashEmblemIn {
    0%   { opacity: 0; transform: scale(0.62) rotate(-8deg); }
    65%  { opacity: 1; transform: scale(1.06) rotate(1.5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes splashRingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes splashGlowPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50%      { opacity: 1; transform: scale(1.08); }
}

@keyframes splashBarFill {
    0%   { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

@keyframes confettiPop {
    0%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4) rotate(var(--rot)); }
}

/* ==========================================================================
   Flagship Entrance Splash Overlay (Fast 1.05s, Pure GPU)
   ========================================================================== */

.teska-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    overflow: hidden;
    transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1), transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.teska-splash.is-leaving {
    opacity: 0;
    transform: scale(1.045);
    pointer-events: none;
}

.teska-splash-aurora {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 184, 28, 0.28) 0%, rgba(245, 184, 28, 0.07) 48%, transparent 72%);
    animation: splashGlowPulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

.teska-splash-emblem-wrap {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teska-splash-ring {
    position: absolute;
    inset: -7px;
    border-radius: 26px;
    padding: 2px;
    background: conic-gradient(from 0deg, transparent 0deg, var(--accent-bright) 90deg, var(--accent) 160deg, transparent 240deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: splashRingSpin 1.4s linear infinite;
}

.teska-splash-logo {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(240, 176, 0, 0.34), 0 4px 12px rgba(9, 15, 30, 0.16);
    animation: splashEmblemIn 560ms var(--spring) both;
}

.teska-splash-title {
    margin: 16px 0 2px;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.01em;
    animation: fadeSlide 420ms var(--spring) 180ms backwards;
}

.teska-splash-sub {
    font-family: 'VazirmatnLatin', sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: var(--accent-text);
    animation: fadeSlide 420ms var(--spring) 260ms backwards;
}

.teska-splash-bar {
    width: 112px;
    height: 3px;
    border-radius: 99px;
    background: var(--wizard-bar-bg);
    margin-top: 18px;
    overflow: hidden;
}

.teska-splash-bar-fill {
    width: 100%;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
    transform-origin: right center;
    animation: splashBarFill 860ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ==========================================================================
   Mobile-First App Shell (Scroll-Safe!)
   ========================================================================== */

.app-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-app);
    background-image: var(--bg-app-glow);
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    transition: background-color 220ms ease;
}

@media (min-width: 540px) {
    html, body {
        background: var(--bg-stage);
    }
    body {
        background-image: var(--bg-stage-glow);
        padding: 14px 10px;
    }
    .app-shell {
        max-width: 430px;
        min-height: calc(100vh - 28px);
        border-radius: 26px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-shell);
        overflow-x: clip;
        overflow-y: visible;
    }
}

/* ==========================================================================
   Compact Top App Bar
   ========================================================================== */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(9px + env(safe-area-inset-top)) 12px 9px;
    background: var(--bg-topbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-emblem {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: block;
    box-shadow: 0 3px 12px rgba(245, 184, 28, 0.24);
    transition: transform 240ms var(--spring);
}
.brand-lockup:active .brand-emblem {
    transform: scale(0.92);
}

.brand-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.brand-en {
    font-family: 'VazirmatnLatin', sans-serif;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent-text);
    margin-top: 1px;
}

.topbar-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.topbar-action:hover, .topbar-action:active {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-text);
}

.back-btn, .icon-ghost-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    color: var(--ink);
    transition: var(--transition);
    cursor: pointer;
}
.back-btn:hover, .icon-ghost-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-text);
}
.back-btn:active, .icon-ghost-btn:active {
    transform: scale(0.9);
}

.sub-header-center {
    text-align: center;
    flex: 1;
    padding: 0 6px;
    min-width: 0;
}

.sub-header-title {
    margin: 0;
    font-size: 13.8px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-header-badge {
    display: inline-block;
    font-size: 10.2px;
    color: var(--accent-text);
    font-weight: 700;
}

/* ==========================================================================
   Compact Crisp 3D Icons & Stage
   ========================================================================== */

.svc-3d-pic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.svc-3d-img {
    width: 33px;
    height: 33px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.28));
    transition: transform 280ms var(--spring), filter 280ms var(--spring);
}

[data-theme="light"] .svc-3d-img {
    filter: drop-shadow(0 4px 7px rgba(9, 15, 30, 0.16));
}

.svc-3d-img--sm {
    width: 34px;
    height: 34px;
}

.svc-3d-img--xl {
    width: 60px;
    height: 60px;
    animation: float3D 3.6s ease-in-out infinite;
}

.service-icon-stage {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--icon-stage-bg);
    flex-shrink: 0;
}

.service-card--active .svc-3d-img {
    animation: float3D 4.4s ease-in-out infinite;
    animation-delay: calc(var(--stagger, 0) * 350ms);
}

.service-card--updating .service-icon-stage {
    background: var(--icon-stage-muted);
}

.service-card--updating .svc-3d-img {
    opacity: 0.85;
    filter: saturate(0.8) drop-shadow(0 4px 7px rgba(0, 0, 0, 0.2));
}

/* ==========================================================================
   Home Screen — Centered Single-Viewport 2x4 Bento Cluster (Zero Footer)
   ========================================================================== */

.home-main {
    flex: 1 1 auto;
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-bento-wrap {
    width: 100%;
    max-width: 374px;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.home-credit-pill {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--accent-border);
    box-shadow: 0 2px 10px rgba(240, 176, 0, 0.08);
    font-size: 10.3px;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: -0.01em;
    animation: fadeSlide 380ms var(--spring) backwards;
}

.home-credit-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    flex-shrink: 0;
}

.services-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7.5px;
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: clamp(82px, 13.6dvh, 98px);
    min-height: 80px;
    padding: 8px 9.5px 7.5px;
    border-radius: 15px;
    background: var(--bg-card-grad);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-service);
    transition: transform 220ms var(--spring), border-color 180ms ease, box-shadow 220ms ease;
    overflow: hidden;
    animation: cardReveal 420ms var(--spring) backwards;
    animation-delay: calc(var(--stagger, 0) * 32ms);
}

/* Interactive Golden Spotlight Layer */
.js-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        140px circle at var(--mx, 50%) var(--my, 50%),
        rgba(var(--spotlight-rgb), 0.16) 0%,
        transparent 68%
    );
    opacity: 0;
    transition: opacity 200ms ease;
}
.js-spotlight:hover::after { opacity: 1; }

.service-card--active {
    border-color: var(--accent-border);
    background: var(--bg-card-active);
}

.service-card--active .card-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
    z-index: 1;
}

.service-card--active .card-sheen::before {
    content: '';
    position: absolute;
    top: -10%;
    bottom: -10%;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 224, 102, 0.22), transparent);
    animation: cardSheen 5.5s ease-in-out infinite;
    animation-delay: calc(var(--stagger, 0) * 650ms);
}

/* Top Royal Gold Accent Hairline + Subtle Periodic Sheen */
.service-card--active::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-bright), var(--accent), transparent);
    opacity: 0.92;
}

.service-card--active:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 22px rgba(240, 176, 0, 0.15), 0 0 0 1px var(--accent-border);
}

.service-card--active:hover .svc-3d-img {
    transform: translateY(-2px) scale(1.08);
    filter: drop-shadow(0 8px 13px rgba(245, 184, 28, 0.32));
}

.service-card--updating {
    background: var(--bg-card-updating);
    border-color: var(--border-updating);
}

.service-card--updating:hover {
    transform: translateY(-1.5px);
    border-color: var(--border-strong);
}

.service-card:active {
    transform: scale(0.96);
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    position: relative;
    z-index: 2;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 8.8px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill--live {
    background: var(--live-soft);
    color: var(--live-ink);
    border: 1px solid var(--live-border);
}

.status-pill--live::before {
    content: '';
    width: 4.5px;
    height: 4.5px;
    border-radius: 50%;
    background: var(--live);
    animation: livePulse 2.1s infinite;
}

.status-pill--updating {
    background: var(--updating-pill-bg);
    color: var(--updating-pill-ink);
    border: 1px solid var(--border);
}

.service-card-body {
    margin-top: 4px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    position: relative;
    z-index: 2;
}

.service-text-col {
    min-width: 0;
    flex: 1;
}

.service-title {
    margin: 0;
    font-size: 10.8px;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.015em;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-card--updating .service-title {
    color: var(--ink-updating);
}

.service-sub {
    margin: 1.5px 0 0;
    font-size: 9.6px;
    color: var(--ink-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-card--active .service-sub {
    color: var(--ink-2);
}

.service-arrow {
    color: var(--accent-text);
    transition: transform 200ms var(--spring);
    flex-shrink: 0;
}
.service-card--active:hover .service-arrow {
    transform: translateX(-3px);
}

@media (max-height: 630px) {
    .home-main { padding: 5px 12px 8px; }
    .home-bento-wrap { gap: 6px; }
    .home-credit-pill { padding: 3px 10px; font-size: 9.8px; }
    .services-grid { gap: 6px; }
    .service-card { height: 76px; min-height: 74px; padding: 6.5px 8.5px; border-radius: 13px; }
    .service-icon-stage { width: 33px; height: 33px; border-radius: 9px; }
    .svc-3d-img { width: 29px; height: 29px; }
    .service-title { font-size: 10.5px; }
    .service-sub { font-size: 9.1px; }
}

/* ==========================================================================
   Subpage Container & Compact Cards
   ========================================================================== */

.page-body {
    flex: 1;
    padding: 10px 11px 28px;
    display: flex;
    flex-direction: column;
    gap: 9.5px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.card-accent {
    background: var(--bg-card-active);
    border-color: var(--accent-border);
}

.section-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-text);
    margin: 0 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-label small {
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 10.4px;
}

/* ==========================================================================
   Vehicle & Applicant Type Selector Cards
   ========================================================================== */

.vehicle-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.vehicle-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 10px 10px 9px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    cursor: pointer;
    text-align: right;
    transition: transform 200ms var(--spring), border-color 180ms ease, box-shadow 200ms ease;
    box-shadow: var(--shadow-service);
    overflow: hidden;
}

.vehicle-option:active { transform: scale(0.965); }

.vehicle-option .vo-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.vehicle-option .vo-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-soft);
    color: var(--ink-2);
    transition: var(--transition);
}

.vehicle-option .vo-icon--3d {
    width: 42px;
    height: 40px;
    background: var(--icon-stage-muted);
    border-radius: 11px;
}

.vehicle-option.is-active .vo-icon--3d {
    background: var(--icon-stage-bg);
}

.vehicle-option.is-active .vo-icon--3d .svc-3d-img {
    transform: scale(1.06);
    filter: drop-shadow(0 6px 10px rgba(245, 184, 28, 0.3));
}

.vehicle-option .vo-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    position: relative;
    transition: var(--transition);
}

.vehicle-option .vo-title {
    font-size: 12.6px;
    font-weight: 800;
    color: var(--ink);
    position: relative;
    z-index: 2;
}

.vehicle-option .vo-range {
    font-size: 10.4px;
    color: var(--ink-muted);
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.vehicle-option.is-active {
    background: var(--bg-card-active);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-border), 0 6px 18px rgba(245, 184, 28, 0.13);
}

.vehicle-option.is-active .vo-icon:not(.vo-icon--3d) {
    background: var(--accent);
    color: #070A12;
}

.vehicle-option.is-active .vo-radio {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-card);
}

.vehicle-option.is-active .vo-range {
    color: var(--accent-text);
    font-weight: 700;
}

/* Segmented Tabs (Agencies) */
.seg-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
    background: var(--bg-seg);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.seg-tab {
    height: 35px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.seg-tab.is-active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-ink);
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(245, 184, 28, 0.24);
}

/* ==========================================================================
   Compact Amount Slider, Quick Presets & Live Loan Calculator
   ========================================================================== */

.amount-display-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 2px 0 10px;
}

.amount-step-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border-strong);
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.amount-step-btn:active { transform: scale(0.88); }

.amount-readout {
    text-align: center;
    flex: 1;
}

.amount-main {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.28;
    letter-spacing: -0.01em;
    transition: transform 150ms var(--spring);
}

.amount-main.is-bump {
    transform: scale(1.06);
}

.amount-exact {
    font-size: 11px;
    color: var(--accent-text);
    font-weight: 700;
    margin-top: 2px;
}

.slider-wrap { padding: 2px 0; }

.teska-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6.5px;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(
        to left,
        var(--accent-bright) 0%,
        var(--accent) var(--pct, 10%),
        var(--slider-track) var(--pct, 10%),
        var(--slider-track) 100%
    );
}

.teska-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFF099 0%, #F5B81C 58%, #C48600 100%);
    border: 2.5px solid var(--slider-thumb-ring);
    box-shadow: 0 0 0 2px rgba(245, 184, 28, 0.6), 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 140ms var(--spring);
}

.teska-range::-webkit-slider-thumb:active {
    transform: scale(1.16);
    cursor: grabbing;
}

.teska-range::-moz-range-thumb {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFF099 0%, #F5B81C 58%, #C48600 100%);
    border: 2.5px solid var(--slider-thumb-ring);
    box-shadow: 0 0 0 2px rgba(245, 184, 28, 0.6), 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

.slider-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10.4px;
    color: var(--ink-muted);
    font-weight: 700;
}

.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.preset-chip {
    flex: 1;
    min-width: 58px;
    height: 29px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    color: var(--ink-2);
    font-size: 10.6px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.preset-chip.is-active {
    background: var(--btn-primary-bg);
    border-color: var(--accent);
    color: var(--btn-primary-ink);
    font-weight: 800;
    box-shadow: 0 3px 9px rgba(245, 184, 28, 0.24);
}

/* Pill Selectors */
.pill-row { display: flex; flex-wrap: wrap; gap: 5px; }
.pill-row--equal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    gap: 5px;
}

.pill-btn {
    height: 33px;
    padding: 0 8px;
    border-radius: 8.5px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--ink-2);
    font-size: 11.4px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.pill-btn.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
    font-weight: 800;
}

/* Summary KPI Strip */
.calc-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.calc-stat {
    background: var(--bg-surface-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
}

.calc-stat-label {
    font-size: 10.3px;
    color: var(--ink-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.calc-stat-val {
    font-size: 12.6px;
    font-weight: 800;
    color: var(--ink);
}

.calc-stat-val.gold { color: var(--accent-text); }

/* ==========================================================================
   Step Wizard Bar
   ========================================================================== */

.wizard-steps {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 1px;
}

.wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.wizard-bar {
    width: 100%;
    height: 3.5px;
    border-radius: 999px;
    background: var(--wizard-bar-bg);
    transition: background-color 240ms ease, box-shadow 240ms ease;
}

.wizard-step.is-active .wizard-bar,
.wizard-step.is-done .wizard-bar {
    background: linear-gradient(90deg, var(--accent-bright), var(--accent));
    box-shadow: 0 0 8px rgba(245, 184, 28, 0.35);
}

.wizard-step-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-muted);
    white-space: nowrap;
}

.wizard-step.is-active .wizard-step-label {
    color: var(--accent-text);
    font-weight: 800;
}

.wizard-step.is-done .wizard-step-label {
    color: var(--ink-2);
}

.step-panel {
    display: none;
    flex-direction: column;
    gap: 9.5px;
}

.step-panel.is-active {
    display: flex;
    animation: fadeSlide 240ms var(--spring);
}

/* ==========================================================================
   Compact Form Controls
   ========================================================================== */

.field-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.field { display: flex; flex-direction: column; gap: 4px; }

.field label {
    font-size: 11.4px;
    font-weight: 700;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field label .req { color: var(--accent-text); margin-right: 2px; }
.field label .opt { color: var(--ink-muted); font-size: 10.2px; font-weight: 500; }

.input, .select, .textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    color: var(--ink);
    font-size: 12.4px;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.input::placeholder, .textarea::placeholder { color: var(--placeholder); font-size: 11.6px; }

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 28px;
}

.select option { background: var(--select-opt-bg); color: var(--select-opt-ink); }
.textarea { min-height: 66px; resize: vertical; }

.field-error-msg {
    font-size: 10.4px;
    color: var(--danger);
    display: none;
    font-weight: 700;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .upload-tile { border-color: var(--danger); }
.field.has-error .field-error-msg { display: block; }

.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }

.check-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 9px;
    border-radius: 9px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: 11.2px;
    font-weight: 700;
    color: var(--ink-2);
    transition: var(--transition);
}

.check-chip input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.check-chip:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
}

/* ==========================================================================
   Compact Document Upload Tiles
   ========================================================================== */

.upload-list { display: flex; flex-direction: column; gap: 7.5px; }

.upload-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 11px;
    background: var(--bg-input);
    border: 1.5px dashed var(--border-strong);
    cursor: pointer;
    transition: var(--transition);
}

.upload-tile:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-tile.is-filled {
    border-style: solid;
    border-color: var(--live-border);
    background: var(--live-soft);
}

.upload-tile input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-text);
    flex-shrink: 0;
}

.upload-tile.is-filled .upload-icon {
    background: var(--live-soft);
    border-color: var(--live-border);
    color: var(--live-ink);
}

.upload-meta { flex: 1; min-width: 0; }

.upload-title {
    font-size: 11.8px;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-req-tag {
    font-size: 9.5px;
    padding: 1.5px 6px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 800;
}

.upload-opt-tag {
    font-size: 9.5px;
    padding: 1.5px 6px;
    border-radius: 5px;
    background: var(--bg-surface-soft);
    color: var(--ink-muted);
    font-weight: 600;
}

.upload-sub {
    font-size: 10.4px;
    color: var(--ink-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-tile.is-filled .upload-sub { color: var(--live-ink); font-weight: 700; }

.consent-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
}

.consent-box input {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ==========================================================================
   Buttons (Compact Executive + Metallic Shimmer + Touch Ripple)
   ========================================================================== */

.btn-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.btn {
    position: relative;
    overflow: hidden;
    height: 42px;
    padding: 0 15px;
    border-radius: 11px;
    border: none;
    font-size: 12.6px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 180ms var(--spring), filter 180ms ease, box-shadow 200ms ease;
    width: 100%;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-ink);
    box-shadow: var(--btn-primary-shadow);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.44), transparent);
    pointer-events: none;
    animation: shimmerSweep 3.4s ease-in-out infinite;
}

.btn-secondary {
    background: var(--bg-surface-soft);
    border: 1.5px solid var(--border-strong);
    color: var(--ink);
    width: auto;
    min-width: 82px;
    flex-shrink: 0;
}

.btn-sm { height: 33px; font-size: 11.2px; border-radius: 9px; padding: 0 11px; }

.ripple-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
    pointer-events: none;
    animation: rippleExpand 460ms ease-out forwards;
}

/* ==========================================================================
   Compact Agencies Directory
   ========================================================================== */

.search-bar { position: relative; }
.search-bar .input { padding-right: 34px; }
.search-bar .search-ic {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-muted);
    pointer-events: none;
}

.chip-scroll {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
    flex-shrink: 0;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--ink-2);
    font-size: 10.8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip.is-active {
    background: var(--btn-primary-bg);
    border-color: var(--accent);
    color: var(--btn-primary-ink);
    font-weight: 800;
}

.agency-list { display: flex; flex-direction: column; gap: 8.5px; }

.agency-card {
    background: var(--bg-card-grad);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: var(--shadow-service);
    transition: transform 200ms var(--spring), border-color 180ms ease;
}

.agency-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }

.agency-name {
    margin: 0;
    font-size: 12.8px;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified-ic { color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

.agency-code-tag {
    font-family: 'VazirmatnLatin', monospace;
    font-size: 10.4px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 6px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-text);
    flex-shrink: 0;
}

.agency-meta-row { display: flex; flex-wrap: wrap; gap: 5px 11px; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.agency-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.agency-scopes { display: flex; flex-wrap: wrap; gap: 5px; }

.scope-tag {
    font-size: 10.2px;
    font-weight: 700;
    padding: 2px 7.5px;
    border-radius: 6px;
    background: var(--bg-surface-soft);
    border: 1px solid var(--border);
    color: var(--ink-2);
}

.agency-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--border);
}

.agency-btn {
    height: 33px;
    border-radius: 8.5px;
    font-size: 11.4px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-surface-soft);
    color: var(--ink);
    transition: var(--transition);
}

.agency-btn--gold {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-text);
}

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

/* ==========================================================================
   Bottom Sheet Modal & Digital Receipt
   ========================================================================== */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.72);
    backdrop-filter: blur(6px);
    z-index: 90;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
}

.sheet-backdrop.is-open { display: flex; }

.sheet-panel {
    width: 100%;
    max-width: 420px;
    max-height: 84vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-sheet);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 14px 14px 18px;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.46);
    animation: sheetUp 240ms var(--spring);
}

.sheet-handle {
    width: 34px;
    height: 3.5px;
    border-radius: 99px;
    background: var(--border-strong);
    margin: 0 auto 11px;
}

.receipt-card { text-align: center; padding: 18px 14px; position: relative; overflow: hidden; }

.receipt-check {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--live-soft);
    border: 1px solid var(--live-border);
    color: var(--live-ink);
    position: relative;
}

.confetti-bit {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiPop 950ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.receipt-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 800; }
.receipt-sub { margin: 0 0 13px; font-size: 11.4px; color: var(--ink-2); }

.tracking-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 11px;
    background: var(--bg-surface-deep);
    border: 1.5px solid var(--accent-border);
    margin-bottom: 12px;
}

.tracking-code-val {
    font-family: 'VazirmatnLatin', monospace;
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-text);
    letter-spacing: 0.06em;
}

.copy-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--btn-primary-bg);
    border: none;
    color: var(--btn-primary-ink);
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.kv-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: right;
    padding: 11px;
    border-radius: 11px;
    background: var(--bg-surface-deep);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.6px; }
.kv-row span:first-child { color: var(--ink-muted); font-weight: 600; }
.kv-row span:last-child { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   Compact Updating Page & Tracking Timeline
   ========================================================================== */

.updating-hero { text-align: center; padding: 20px 14px 16px; }

.updating-icon-ring {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--icon-stage-bg);
    border: 1px solid var(--accent-border);
}

.updating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3.5px 11px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 8px;
}

.updating-title { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; }
.updating-desc { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.7; }

.timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tl-item { display: flex; align-items: center; gap: 9px; }

.tl-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.2px;
    font-weight: 800;
    color: var(--ink-muted);
    flex-shrink: 0;
}

.tl-item.is-done .tl-dot {
    background: var(--accent);
    border-color: var(--accent);
    color: #070A12;
}

.tl-item.is-current .tl-dot {
    border-color: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl-text { font-size: 11.6px; font-weight: 600; color: var(--ink-muted); }
.tl-item.is-done .tl-text,
.tl-item.is-current .tl-text { color: var(--ink); font-weight: 700; }

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8.5px;
    border-radius: 999px;
    font-size: 10.4px;
    font-weight: 800;
}

.st-pending { background: var(--accent-soft); color: var(--accent-text); }
.st-review  { background: rgba(59, 130, 246, 0.14); color: #2563EB; }
.st-credit  { background: rgba(147, 51, 234, 0.14); color: #7C3AED; }
.st-warn    { background: rgba(217, 119, 6, 0.15); color: #B45309; }
.st-ok      { background: var(--live-soft); color: var(--live-ink); }
.st-reject  { background: var(--danger-soft); color: var(--danger-ink); }

[data-theme="dark"] .st-review { color: #93C5FD; }
[data-theme="dark"] .st-credit { color: #D8B4FE; }
[data-theme="dark"] .st-warn   { color: #FDE047; }

.alert { padding: 9px 11px; border-radius: 10px; font-size: 11.4px; font-weight: 600; line-height: 1.6; }
.alert-error { background: var(--danger-soft); border: 1px solid rgba(239, 68, 68, 0.36); color: var(--danger-ink); }
.alert-info { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--ink); }
.alert-success { background: var(--live-soft); border: 1px solid var(--live-border); color: var(--live-ink); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 14px);
    background: var(--bg-toast);
    border: 1.5px solid var(--accent-border);
    color: #FFFFFF;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms var(--spring);
    z-index: 120;
    max-width: calc(100% - 28px);
    text-align: center;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.empty-state { text-align: center; padding: 22px 12px; color: var(--ink-muted); font-size: 11.6px; font-weight: 600; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
