/* Modals: NFC, QR Code & App Update */
        /* NFC Modal / Overlay */
        .nfc-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: -260px;
            background: rgba(8, 7, 6, 0.82);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 24px 284px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translate3d(0, var(--kb-shift, 0px), 0);
            transition: opacity 0.19s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.19s, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        body.is-native-app .nfc-overlay,
        body.is-native-app .qr-overlay,
        body.is-native-app .update-overlay,
        body.is-native-app .pwd-overlay,
        body.is-native-app .perm-lock-overlay {
            background: rgba(8, 7, 6, 0.85);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }
        .nfc-overlay.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .nfc-modal {
            width: 100%;
            max-width: 340px;
            min-height: 336px;
            background: rgba(28, 25, 23, 0.98);
            border: 1px solid rgba(139, 92, 246, 0.4);
            border-radius: 28px;
            padding: 24px 22px 22px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(124, 58, 237, 0.2);
            opacity: 0;
            transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.19s ease, border-color 0.28s ease, box-shadow 0.28s ease;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            contain: layout style;
            display: grid;
            grid-template-columns: 100%;
            align-items: center;
            position: relative;
            box-sizing: border-box;
            overflow: hidden;
        }
        .nfc-overlay.active .nfc-modal {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
        }
        /* Internal sub-views for seamless in-place view morphing without overlay blinking */
        .nfc-view {
            grid-area: 1 / 1;
            width: 100%;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translate3d(0, 10px, 0) scale3d(0.96, 0.96, 1);
            transition: opacity 0.20s cubic-bezier(0.22, 1, 0.36, 1),
                        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                        visibility 0s linear 0.24s;
            will-change: transform, opacity;
            box-sizing: border-box;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
        .nfc-view.active {
            opacity: 1;
            visibility: inherit;
            pointer-events: none;
            transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1) 0.02s,
                        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1) 0.02s,
                        visibility 0s linear 0s;
            z-index: 2;
        }
        .nfc-overlay.active .nfc-view.active {
            pointer-events: auto;
        }
        .nfc-view:not(.active),
        .nfc-view:not(.active) * {
            pointer-events: none !important;
        }
        .nfc-overlay:not(.active),
        .nfc-overlay:not(.active) *,
        .qr-overlay:not(.active),
        .qr-overlay:not(.active) *,
        .update-overlay:not(.active),
        .update-overlay:not(.active) *,
        .pwd-overlay:not(.active),
        .pwd-overlay:not(.active) *,
        .perm-lock-overlay:not(.active),
        .perm-lock-overlay:not(.active) * {
            pointer-events: none !important;
        }
        .nfc-view.view-exit {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translate3d(0, -10px, 0) scale3d(0.96, 0.96, 1);
            transition: opacity 0.17s cubic-bezier(0.4, 0, 0.2, 1),
                        transform 0.21s cubic-bezier(0.4, 0, 0.2, 1),
                        visibility 0s linear 0.21s;
            z-index: 1;
        }
        .nfc-wave-container {
            position: relative;
            width: 84px;
            height: 84px;
            margin: 0 auto 22px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .nfc-wave-ring {
            position: absolute;
            inset: -8px;
            border-radius: 50%;
            border: 2px solid rgba(139, 92, 246, 0.5);
            animation: nfcPulse 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
            transform: translateZ(0);
            transition: opacity 0.24s ease, border-color 0.24s ease;
        }
        .nfc-overlay:not(.active) .nfc-wave-ring {
            animation-play-state: paused;
        }
        .nfc-wave-ring:nth-child(2) {
            animation-delay: 0.6s;
        }
        @keyframes nfcPulse {
            0% { transform: scale3d(0.72, 0.72, 1); opacity: 0.88; }
            100% { transform: scale3d(1.58, 1.58, 1); opacity: 0; }
        }
        .nfc-icon-circle {
            position: relative;
            z-index: 2;
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: var(--primary-gradient);
            border: 2px solid transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
            outline: none;
            -webkit-tap-highlight-color: transparent;
        }
        .nfc-icon-circle svg {
            width: 36px;
            height: 36px;
            fill: #ffffff;
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), fill 0.24s ease, opacity 0.24s ease;
        }
        .nfc-modal.success,
        .nfc-modal.perm-lock-thump {
            animation: modalHapticThump 0.42s cubic-bezier(0.22, 1, 0.36, 1);
        }
        @keyframes modalHapticThump {
            0% { transform: scale3d(1, 1, 1); }
            30% { transform: scale3d(1.03, 1.03, 1) translate3d(0, -2px, 0); }
            60% { transform: scale3d(0.99, 0.99, 1) translate3d(0, 1px, 0); }
            100% { transform: scale3d(1, 1, 1); }
        }
        .nfc-modal.success .nfc-wave-ring {
            opacity: 0;
            animation-play-state: paused;
        }
        .nfc-modal.perm-lock-standby {
            border-color: rgba(16, 185, 129, 0.4);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 32px rgba(16, 185, 129, 0.16);
        }
        .nfc-modal.perm-lock-standby .nfc-wave-container {
            cursor: pointer;
        }
        .nfc-modal.perm-lock-standby .nfc-wave-ring {
            opacity: 0;
            animation-play-state: paused;
        }
        .nfc-modal.perm-lock-standby .nfc-icon-circle {
            background: rgba(34, 30, 28, 0.96) !important;
            border: 2px dashed rgba(168, 162, 158, 0.42);
            box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.35) !important;
            transform: scale3d(0.95, 0.95, 1);
            cursor: pointer;
        }
        .nfc-modal.perm-lock-standby .nfc-icon-circle svg {
            fill: #a8a29e;
            opacity: 0.48;
            transform: scale3d(0.92, 0.92, 1);
        }
        .nfc-modal.perm-lock-standby .nfc-wave-container:active .nfc-icon-circle {
            transform: scale3d(0.88, 0.88, 1);
            border-color: rgba(245, 39, 125, 0.65);
        }
        .nfc-modal.success .nfc-icon-circle {
            animation: iconCheckPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transform: scale(1.08);
        }
        @keyframes iconCheckPopIn {
            0% { transform: scale(0.5) rotate(-20deg); opacity: 0; }
            65% { transform: scale(1.22) rotate(4deg); opacity: 1; }
            100% { transform: scale(1.08) rotate(0deg); opacity: 1; }
        }
        .nfc-modal.success .nfc-icon-circle svg {
            animation: checkmarkScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @keyframes checkmarkScaleIn {
            0% { transform: scale(0.4); opacity: 0; }
            70% { transform: scale(1.15); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }

        /* ── Per-Theme Success Checkmark & Aura Styling ── */

        /* 1. Review Link Write (Purple Theme) */
        .nfc-modal.theme-link.success,
        .nfc-modal.success:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) {
            border-color: rgba(124, 58, 237, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(124, 58, 237, 0.25);
        }
        .nfc-modal.theme-link.success .nfc-icon-circle,
        .nfc-modal.success:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) .nfc-icon-circle {
            background: var(--primary-gradient);
            box-shadow: 0 10px 30px rgba(124, 58, 237, 0.65), 0 0 25px rgba(124, 58, 237, 0.45);
        }
        .nfc-modal.theme-link.success .nfc-icon-circle svg,
        .nfc-modal.success:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) .nfc-icon-circle svg {
            fill: #ffffff;
        }
        .nfc-modal.theme-link .nfc-counter-badge,
        .nfc-modal.success:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) .nfc-counter-badge {
            background: rgba(124, 58, 237, 0.15);
            border-color: rgba(124, 58, 237, 0.4);
            color: #c4b5fd;
        }
        .nfc-modal.theme-link .nfc-counter-dot,
        .nfc-modal.success:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) .nfc-counter-dot {
            background: #a78bfa;
            box-shadow: 0 0 8px rgba(167, 139, 250, 0.85);
        }

        /* 2. Password Lock & Permanent Lock (Pink Theme) */
        .nfc-modal.theme-lock.success {
            border-color: rgba(245, 39, 125, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 39, 125, 0.25);
        }
        .nfc-modal.theme-lock.success .nfc-icon-circle {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 10px 30px rgba(245, 39, 125, 0.6), 0 0 25px rgba(245, 39, 125, 0.4);
        }
        .nfc-modal.theme-lock.success .nfc-icon-circle svg {
            fill: #ffffff;
        }
        .nfc-modal.theme-lock .nfc-counter-badge {
            background: rgba(245, 39, 125, 0.15);
            border-color: rgba(245, 39, 125, 0.4);
            color: #fda4af;
        }
        .nfc-modal.theme-lock .nfc-counter-dot {
            background: #f43f5e;
            box-shadow: 0 0 8px rgba(244, 63, 94, 0.85);
        }

        /* 3. Password Unlock (Emerald Green Theme) */
        .nfc-modal.theme-unlock.success {
            border-color: rgba(16, 185, 129, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.25);
        }
        .nfc-modal.theme-unlock.success .nfc-icon-circle {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6), 0 0 25px rgba(16, 185, 129, 0.35);
        }
        .nfc-modal.theme-unlock.success .nfc-icon-circle svg {
            fill: #ffffff;
        }
        .nfc-modal.theme-unlock .nfc-counter-badge {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.35);
            color: #34d399;
        }
        .nfc-modal.theme-unlock .nfc-counter-dot {
            background: #10b981;
            box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
        }

        /* 4. Wi-Fi Card Write (Amber / Yellow Theme) */
        .nfc-modal.theme-wifi.success {
            border-color: rgba(245, 158, 11, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.25);
        }
        .nfc-modal.theme-wifi.success .nfc-icon-circle {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            box-shadow: 0 10px 30px rgba(245, 158, 11, 0.65), 0 0 25px rgba(245, 158, 11, 0.4);
        }
        .nfc-modal.theme-wifi.success .nfc-icon-circle svg {
            fill: #ffffff;
        }
        .nfc-modal.theme-wifi .nfc-counter-badge {
            background: rgba(245, 158, 11, 0.15);
            border-color: rgba(245, 158, 11, 0.4);
            color: #fbbf24;
        }
        .nfc-modal.theme-wifi .nfc-counter-dot {
            background: #f59e0b;
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.85);
        }

        /* Error state animation inside NFC modal */
        .nfc-modal.error {
            animation: modalErrorShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
            border-color: rgba(245, 39, 125, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 39, 125, 0.25);
        }
        @keyframes modalErrorShake {
            0%, 100% { transform: scale(1) translateX(0); }
            20%, 60% { transform: scale(1.02) translateX(-6px); }
            40%, 80% { transform: scale(0.99) translateX(6px); }
        }
        .nfc-modal.error .nfc-wave-ring {
            opacity: 0;
            animation-play-state: paused;
        }
        .nfc-modal.error .nfc-icon-circle {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 10px 30px rgba(245, 39, 125, 0.55), 0 0 25px rgba(245, 39, 125, 0.35);
            animation: iconErrorPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            transform: scale(1.08);
        }
        @keyframes iconErrorPopIn {
            0% { transform: scale(0.5) rotate(20deg); opacity: 0; }
            65% { transform: scale(1.22) rotate(-4deg); opacity: 1; }
            100% { transform: scale(1.08) rotate(0deg); opacity: 1; }
        }
        .nfc-modal.error .nfc-icon-circle svg {
            animation: checkmarkScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nfc-modal.morph-to-ready .nfc-icon-circle {
            animation: iconCheckMorphExit 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        @keyframes iconCheckMorphExit {
            0% { transform: scale(1.08); opacity: 1; }
            50% { transform: scale(0.85); opacity: 0.6; }
            100% { transform: scale(1); opacity: 1; }
        }

        /* Smooth Morph Transition from Read to Wi-Fi */
        .nfc-modal.morph-to-wifi {
            animation: modalHapticThump 0.45s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .nfc-modal.morph-to-wifi .nfc-icon-circle {
            animation: iconWifiMorphIn 0.48s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .nfc-modal.morph-to-wifi .nfc-icon-circle svg {
            animation: iconWifiSvgPop 0.42s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nfc-modal.morph-to-wifi .nfc-title {
            animation: modalTextMorphIn 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nfc-modal.morph-to-wifi .nfc-desc {
            animation: modalTextMorphIn 0.44s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nfc-modal.morph-to-wifi .nfc-wave-ring {
            animation: modalWaveBurst 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes iconWifiMorphIn {
            0% { transform: scale(0.65) rotate(-14deg); opacity: 0.3; }
            60% { transform: scale(1.16) rotate(3deg); opacity: 1; }
            100% { transform: scale(1) rotate(0deg); opacity: 1; }
        }
        @keyframes iconWifiSvgPop {
            0% { transform: scale(0.35); opacity: 0; }
            70% { transform: scale(1.18); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }
        @keyframes modalTextMorphIn {
            0% { opacity: 0; transform: translateY(8px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes modalWaveBurst {
            0% { transform: scale3d(0.8, 0.8, 1); opacity: 0.9; }
            100% { transform: scale3d(1.4, 1.4, 1); opacity: 0; }
        }
        .nfc-counter-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.35);
            color: #34d399;
            padding: 4px 12px;
            border-radius: 50px;
            font-size: 12px;
            font-weight: 700;
            margin-bottom: 12px;
        }
        .nfc-counter-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #10b981;
            box-shadow: 0 0 8px #10b981;
        }
        .nfc-title {
            font-size: 18px;
            font-weight: 800;
            color: #ffffff;
            margin-bottom: 8px;
        }
        .nfc-desc {
            font-size: 13px;
            color: var(--text-sub);
            line-height: 1.5;
            margin-bottom: 24px;
        }
        .nfc-actions-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
        }
        .btn-nfc-retry {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex: 1;
            height: 44px;
            background: var(--primary-gradient);
            border: none;
            border-radius: var(--radius-btn);
            color: #ffffff;
            font-size: 13px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
        }
        .btn-nfc-retry svg {
            width: 17px;
            height: 17px;
            fill: #ffffff;
        }
        .btn-nfc-retry:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
        }
        .btn-nfc-next {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            flex: 1.35;
            height: 44px;
            border: none;
            border-radius: var(--radius-btn);
            color: #ffffff;
            font-size: 12.5px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            white-space: nowrap;
            padding: 0 10px;
        }
        .btn-nfc-next.theme-lock {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 4px 15px rgba(245, 39, 125, 0.45);
        }
        .btn-nfc-next.theme-lock:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(245, 39, 125, 0.6);
        }
        .btn-nfc-next.theme-unlock {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45);
        }
        .btn-nfc-next.theme-unlock:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
        }
        .btn-nfc-next.theme-wifi {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45);
            color: #0c0a09;
            font-weight: 800;
        }
        .btn-nfc-next.theme-wifi:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
        }
        .btn-nfc-next.theme-wifi svg {
            fill: #0c0a09;
        }
        .btn-nfc-next.theme-link,
        .btn-nfc-next:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) {
            background: var(--primary-gradient);
            box-shadow: 0 4px 15px rgba(124, 58, 237, 0.45);
            color: #ffffff;
            font-weight: 800;
        }
        .btn-nfc-next.theme-link:hover,
        .btn-nfc-next:not(.theme-lock):not(.theme-unlock):not(.theme-wifi):hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
        }
        .btn-nfc-next.theme-link svg,
        .btn-nfc-next:not(.theme-lock):not(.theme-unlock):not(.theme-wifi) svg {
            fill: #ffffff;
        }
        .btn-nfc-next:active {
            transform: scale(0.98);
        }
        .btn-nfc-next svg {
            width: 16px;
            height: 16px;
            fill: #ffffff;
            flex-shrink: 0;
        }

        .nfc-modal.has-next-btn.success .btn-nfc-cancel {
            background: rgba(255, 255, 255, 0.08) !important;
            border-color: rgba(255, 255, 255, 0.18) !important;
            color: var(--text-sub) !important;
            box-shadow: none !important;
            flex: 0.85;
        }
        .nfc-modal.has-next-btn.success .btn-nfc-cancel:hover,
        .nfc-modal.has-next-btn.success .btn-nfc-cancel:active {
            background: rgba(255, 255, 255, 0.15) !important;
            color: #ffffff !important;
            border-color: rgba(255, 255, 255, 0.3) !important;
            transform: translateY(-1px);
        }
        .btn-nfc-wifi-qr {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 6px;
            flex: 1.15;
            height: 44px;
            background: rgba(245, 158, 11, 0.14);
            border: 1px solid rgba(245, 158, 11, 0.45);
            border-radius: var(--radius-btn);
            color: #fbbf24;
            font-family: inherit;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
            white-space: nowrap;
            padding: 0 10px;
            transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease;
        }
        .btn-nfc-wifi-qr:active {
            transform: scale(0.97);
            background: rgba(245, 158, 11, 0.25);
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
        }
        .btn-nfc-wifi-qr svg {
            width: 17px;
            height: 17px;
            fill: #fbbf24;
            flex-shrink: 0;
        }
        .btn-nfc-cancel {
            flex: 1;
            width: 100%;
            height: 44px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border);
            border-radius: var(--radius-btn);
            color: var(--text-sub);
            font-family: inherit;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        }
        .btn-nfc-cancel:active {
            background: rgba(255, 255, 255, 0.16);
            transform: scale3d(0.97, 0.97, 1);
        }
        .nfc-back-icon {
            display: none;
            width: 16px;
            height: 16px;
            fill: currentColor;
            flex-shrink: 0;
        }
        .btn-nfc-cancel.is-back-btn {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.26);
            color: #fafaf9;
        }
        .btn-nfc-cancel.is-back-btn .nfc-back-icon {
            display: block;
        }
        [dir="rtl"] .btn-nfc-cancel.is-back-btn .nfc-back-icon,
        html[lang="ar"] .btn-nfc-cancel.is-back-btn .nfc-back-icon {
            transform: scaleX(-1);
        }
        .nfc-modal.perm-lock-standby .btn-nfc-cancel {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border-color: rgba(16, 185, 129, 0.5);
            color: #ffffff;
            box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
        }
        .nfc-modal.perm-lock-standby .btn-nfc-cancel:active {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            transform: scale3d(0.97, 0.97, 1);
        }
        .nfc-modal.success:not(.has-next-btn) .btn-nfc-cancel {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border-color: rgba(16, 185, 129, 0.5);
            color: #ffffff;
            box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
        }
        .nfc-modal.theme-lock.success:not(.has-next-btn) .btn-nfc-cancel {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            border-color: rgba(245, 39, 125, 0.5);
            color: #ffffff;
            box-shadow: 0 4px 18px rgba(245, 39, 125, 0.4);
        }
        .nfc-modal.theme-wifi.success:not(.has-next-btn) .btn-nfc-cancel {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border-color: rgba(245, 158, 11, 0.5);
            color: #0c0a09;
            box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
        }
        .nfc-modal.theme-link.success:not(.has-next-btn) .btn-nfc-cancel {
            background: var(--primary-gradient);
            border-color: rgba(124, 58, 237, 0.5);
            color: #ffffff;
            box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
        }
        .nfc-modal.success:not(.has-next-btn) .btn-nfc-cancel:hover,
        .nfc-modal.success:not(.has-next-btn) .btn-nfc-cancel:active {
            filter: brightness(0.92);
            transform: scale(0.98);
        }

        /* Dynamic Theming for NFC Waiting Modal */
        .nfc-modal.theme-lock {
            border-color: rgba(245, 39, 125, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 39, 125, 0.25);
        }
        .nfc-modal.theme-lock .nfc-wave-ring {
            border-color: rgba(245, 39, 125, 0.55);
        }
        .nfc-modal.theme-lock .nfc-icon-circle {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 10px 30px rgba(245, 39, 125, 0.55), 0 0 25px rgba(245, 39, 125, 0.35);
        }
        .nfc-modal.theme-lock .btn-nfc-cancel:hover,
        .nfc-modal.theme-lock .btn-nfc-cancel:active {
            border-color: rgba(245, 39, 125, 0.45);
            color: #ffffff;
        }

        .nfc-modal.theme-unlock {
            border-color: rgba(16, 185, 129, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.25);
        }
        .nfc-modal.theme-unlock .nfc-wave-ring {
            border-color: rgba(16, 185, 129, 0.55);
        }
        .nfc-modal.theme-unlock .nfc-icon-circle {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 10px 30px rgba(16, 185, 129, 0.55), 0 0 25px rgba(16, 185, 129, 0.35);
        }
        .nfc-modal.theme-unlock .btn-nfc-cancel:hover,
        .nfc-modal.theme-unlock .btn-nfc-cancel:active {
            border-color: rgba(16, 185, 129, 0.45);
            color: #ffffff;
        }

        .nfc-modal.theme-wifi {
            border-color: rgba(245, 158, 11, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.25);
        }
        .nfc-modal.theme-wifi .nfc-wave-ring {
            border-color: rgba(245, 158, 11, 0.55);
        }
        .nfc-modal.theme-wifi .nfc-icon-circle {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            box-shadow: 0 10px 30px rgba(245, 158, 11, 0.65), 0 0 25px rgba(245, 158, 11, 0.4);
            border-color: transparent;
        }
        .nfc-modal.theme-wifi .nfc-icon-circle svg {
            fill: #ffffff;
        }
        .nfc-modal.theme-wifi .btn-nfc-cancel:hover,
        .nfc-modal.theme-wifi .btn-nfc-cancel:active {
            border-color: rgba(245, 158, 11, 0.45);
            color: #ffffff;
        }

        /* Error state retry button matching pink theme */
        .nfc-modal.error .btn-nfc-retry {
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 4px 15px rgba(245, 39, 125, 0.4);
        }
        .nfc-modal.error .btn-nfc-retry:hover {
            box-shadow: 0 6px 20px rgba(245, 39, 125, 0.55);
        }


        /* QR Code Modal / Overlay */
        .qr-overlay {
            position: fixed;
            inset: 0;
            background: rgba(8, 7, 6, 0.8);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 1100;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
            transition: opacity 0.19s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.19s;
        }
        .qr-overlay.active {
            opacity: 1;
            pointer-events: auto;
            visibility: visible;
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
        }
        .qr-modal {
            width: 100%;
            max-width: 320px;
            background: rgba(28, 25, 23, 0.98);
            border: 1px solid rgba(139, 92, 246, 0.4);
            border-radius: 28px;
            padding: 28px 24px 24px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(124, 58, 237, 0.2);
            transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
            opacity: 0;
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.19s ease;
        }
        .qr-overlay.active .qr-modal {
            transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
            opacity: 1;
        }
        .qr-modal.theme-wifi {
            border-color: rgba(245, 158, 11, 0.5);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.25);
        }
        .qr-modal.theme-wifi .btn-qr-download {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
            color: #0c0a09;
            font-weight: 800;
        }
        .qr-modal.theme-wifi .btn-qr-download svg {
            fill: #0c0a09;
        }
        .qr-modal.theme-wifi .btn-qr-download:active {
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
        }
        .qr-title {
            font-size: 18px;
            font-weight: 800;
            color: #ffffff;
            margin-bottom: 6px;
        }
        .qr-desc {
            font-size: 12px;
            color: var(--text-sub);
            margin-bottom: 20px;
        }
        .qr-box-wrapper {
            background: #ffffff;
            padding: 16px;
            border-radius: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
        }
        .qr-box-wrapper canvas,
        .qr-box-wrapper img {
            display: block;
            border-radius: 8px;
        }
        .qr-actions-row {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .btn-qr-download {
            width: 100%;
            height: 48px;
            background: var(--primary-gradient);
            border: none;
            border-radius: var(--radius-btn);
            color: #ffffff;
            font-family: inherit;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
            transition: transform 0.15s, box-shadow 0.2s;
        }
        .btn-qr-download:active {
            transform: scale(0.97);
        }
        .btn-qr-download svg {
            width: 18px;
            height: 18px;
            fill: #ffffff;
        }
        .btn-qr-close {
            width: 100%;
            height: 42px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border);
            border-radius: var(--radius-btn);
            color: var(--text-sub);
            font-family: inherit;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
        }
        .btn-qr-close:active {
            background: rgba(255, 255, 255, 0.15);
        }


        /* App Update Modal Dialog */
        .update-overlay {
            position: fixed;
            inset: 0;
            background: rgba(8, 7, 6, 0.84);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 1050;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
            transition: opacity 0.19s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.19s;
        }
        .update-overlay.active {
            opacity: 1;
            pointer-events: auto;
            visibility: visible;
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
        }
        .update-modal {
            width: 100%;
            max-width: 400px;
            background: rgba(24, 21, 19, 0.98);
            border: 1px solid rgba(139, 92, 246, 0.45);
            border-radius: 24px;
            padding: 22px 20px 20px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(124, 58, 237, 0.22);
            transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
            opacity: 0;
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.19s ease;
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .update-overlay.active .update-modal {
            transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
            opacity: 1;
        }
        .update-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .update-header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .update-icon-circle {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            background: rgba(139, 92, 246, 0.15);
            border: 1px solid rgba(139, 92, 246, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: #a78bfa;
        }
        .update-icon-circle svg {
            width: 22px;
            height: 22px;
            fill: currentColor;
        }
        .update-header-info {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        .update-badge {
            display: inline-block;
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #38bdf8;
        }
        .update-title {
            font-size: 17px;
            font-weight: 800;
            color: #ffffff;
            margin: 0;
        }
        .btn-update-close {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 26px;
            line-height: 1;
            cursor: pointer;
            padding: 2px 6px;
            transition: color 0.2s;
        }
        .btn-update-close:hover {
            color: #ffffff;
        }

        /* Version comparison chips */
        .update-version-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 12px;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid var(--border);
            border-radius: 14px;
        }
        .version-chip {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        .version-chip-label {
            font-size: 10.5px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        .version-chip-val {
            font-family: monospace;
            font-size: 14px;
            font-weight: 800;
        }
        .version-chip.current .version-chip-val {
            color: #a8a29e;
        }
        .version-chip.latest .version-chip-val {
            color: #4ade80;
        }
        .version-arrow {
            color: var(--primary);
            font-size: 16px;
            font-weight: bold;
        }
        [dir="rtl"] .version-arrow {
            transform: scaleX(-1);
        }

        .update-meta-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 11.5px;
            color: var(--text-muted);
        }
        .update-meta-divider {
            color: var(--border);
        }

        /* Changelog Card - Hidden for clean, compact modal */
        .update-changelog-card {
            display: none !important;
            background: rgba(14, 12, 11, 0.8);
            border: 1px solid var(--border);
            border-radius: 14px;
            padding: 14px;
            max-height: 180px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .update-changelog-card::-webkit-scrollbar {
            width: 5px;
        }
        .update-changelog-card::-webkit-scrollbar-thumb {
            background: rgba(139, 92, 246, 0.4);
            border-radius: 3px;
        }
        .update-changelog-header {
            font-size: 12px;
            font-weight: 700;
            color: #c4b5fd;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            padding-bottom: 6px;
        }
        .update-changelog-body {
            font-size: 12px;
            line-height: 1.6;
            color: var(--text-sub);
        }
        .update-changelog-body ul {
            margin: 0;
            padding-left: 18px;
            padding-right: 0;
        }
        [dir="rtl"] .update-changelog-body ul {
            padding-left: 0;
            padding-right: 18px;
        }
        .update-changelog-body li {
            margin-bottom: 4px;
        }

        /* Update Action Buttons */
        .update-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 4px;
        }
        .btn-update-now {
            width: 100%;
            height: 48px;
            background: var(--primary-gradient);
            border: none;
            border-radius: 14px;
            color: #ffffff;
            font-family: inherit;
            font-size: 13.5px;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-decoration: none;
        }
        .btn-update-now:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
        }
        .btn-update-now:active {
            transform: scale(0.98);
        }
        .btn-update-now svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }
        .update-sub-actions {
            display: flex;
            gap: 10px;
        }
        .btn-update-github {
            flex: 1;
            height: 40px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            border-radius: 12px;
            color: var(--text-sub);
            font-family: inherit;
            font-size: 12px;
            font-weight: 700;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .btn-update-github:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }
        .btn-update-github svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
        }
        .btn-update-later {
            flex: 1;
            height: 40px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 12px;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-update-later:hover {
            background: rgba(255, 255, 255, 0.04);
            color: #ffffff;
        }

        /* Password & Security Modal */
        .pwd-overlay,
        .perm-lock-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: -260px;
            background: rgba(8, 7, 6, 0.82);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 24px 284px;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translate3d(0, var(--kb-shift, 0px), 0);
            transition: opacity 0.19s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.19s, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            overscroll-behavior: contain;
        }
        .pwd-overlay.active,
        .perm-lock-overlay.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
        }

        /* Seamless Zero-Gap Modal-to-Modal Handoff States */
        .nfc-overlay.handoff-enter,
        .pwd-overlay.handoff-enter,
        .perm-lock-overlay.handoff-enter {
            opacity: 1 !important;
            visibility: visible !important;
            transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
        }
        .nfc-overlay.handoff-exit,
        .pwd-overlay.handoff-exit,
        .perm-lock-overlay.handoff-exit {
            opacity: 1 !important;
            visibility: visible !important;
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            pointer-events: none !important;
            transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
        }
        .modal-no-inner-transition,
        .modal-no-inner-transition * {
            transition: none !important;
        }

        .pwd-modal {
            width: 100%;
            max-width: 340px;
            background: rgba(28, 25, 23, 0.98);
            border: 1px solid rgba(245, 39, 125, 0.4);
            border-radius: 28px;
            padding: 22px 20px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 39, 125, 0.22);
            opacity: 0;
            transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), 
                        opacity 0.19s ease, 
                        border-color 0.28s ease, 
                        box-shadow 0.28s ease;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            contain: layout style;
        }
        .perm-lock-modal {
            width: 100%;
            max-width: 340px;
            background: rgba(28, 25, 23, 0.98);
            border: 1px solid rgba(245, 39, 125, 0.45);
            border-radius: 28px;
            padding: 26px 22px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 39, 125, 0.25);
            opacity: 0;
            transform: translate3d(0, 14px, 0) scale3d(0.92, 0.92, 1);
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), 
                        opacity 0.19s ease, 
                        border-color 0.28s ease, 
                        box-shadow 0.28s ease;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            contain: layout style;
        }
        .pwd-overlay.active .pwd-modal,
        .perm-lock-overlay.active .perm-lock-modal {
            opacity: 1;
            transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
        }

        /* Modal Transform Origin */
        .pwd-modal,
        .perm-lock-modal,
        .nfc-modal,
        .qr-modal,
        .update-modal {
            transform-origin: center center;
        }

        .pwd-modal.unlock-mode {
            border-color: rgba(16, 185, 129, 0.45);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 185, 129, 0.22);
        }

        .pwd-tabs {
            position: relative;
            display: flex;
            background: rgba(18, 16, 15, 0.95);
            border: 1px solid var(--border);
            border-radius: 50px;
            padding: 4px;
            margin-bottom: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }
        .pwd-tab-slider {
            position: absolute;
            top: 4px;
            bottom: 4px;
            left: 0;
            border-radius: 50px;
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 4px 14px rgba(245, 39, 125, 0.45);
            transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), 
                        width 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                        background 0.28s ease,
                        box-shadow 0.28s ease;
            z-index: 1;
            pointer-events: none;
            will-change: transform, width;
            transform: translate3d(0, 0, 0);
        }
        .pwd-tab-slider.unlock-mode {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
        }

        .pwd-tab {
            position: relative;
            z-index: 2;
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 7px 12px;
            border-radius: 50px;
            background: transparent !important;
            border: none;
            color: var(--text-sub);
            font-family: inherit;
            font-size: 12.5px;
            font-weight: 700;
            cursor: pointer;
            transition: color 0.24s cubic-bezier(0.16, 1, 0.3, 1);
            user-select: none;
            white-space: nowrap;
        }
        .pwd-tab:hover {
            color: #ffffff;
        }
        .pwd-tab.active {
            color: #ffffff;
            background: transparent !important;
            box-shadow: none !important;
        }

        .pwd-icon-circle-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 2px auto 10px;
        }
        .pwd-icon-circle {
            position: relative;
            width: 62px;
            height: 62px;
            border-radius: 50%;
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 24px rgba(245, 39, 125, 0.45);
            transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            transform: translate3d(0, 0, 0);
            will-change: transform, box-shadow;
        }
        .pwd-icon-circle.unlock-mode {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55), 0 0 20px rgba(16, 185, 129, 0.3);
            transform: scale(1.05) translate3d(0, 0, 0);
        }
        .pwd-svg-icon {
            position: absolute;
            width: 32px;
            height: 32px;
            fill: #ffffff;
            transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                        opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform, opacity;
        }
        .pwd-icon-circle:not(.unlock-mode) .icon-lock {
            opacity: 1;
            transform: scale(1) rotate(0deg);
        }
        .pwd-icon-circle:not(.unlock-mode) .icon-unlock {
            opacity: 0;
            transform: scale(0.6) rotate(-35deg);
            pointer-events: none;
        }
        .pwd-icon-circle.unlock-mode .icon-lock {
            opacity: 0;
            transform: scale(0.6) rotate(35deg);
            pointer-events: none;
        }
        .pwd-icon-circle.unlock-mode .icon-unlock {
            opacity: 1;
            transform: scale(1) rotate(0deg);
        }

        /* Continuous Sliding Title */
        .pwd-title-wrapper {
            position: relative;
            height: 26px;
            margin-bottom: 2px;
            overflow: hidden;
        }
        .pwd-mode-title {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 800;
            color: #ffffff;
            margin: 0;
            transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), 
                        opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform, opacity;
        }
        .pwd-modal:not(.unlock-mode) .mode-lock-title,
        .nfc-modal:not(.unlock-mode) .mode-lock-title {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        .pwd-modal:not(.unlock-mode) .mode-unlock-title,
        .nfc-modal:not(.unlock-mode) .mode-unlock-title {
            opacity: 0;
            transform: translate3d(0, 14px, 0);
            pointer-events: none;
        }
        .pwd-modal.unlock-mode .mode-lock-title,
        .nfc-modal.unlock-mode .mode-lock-title {
            opacity: 0;
            transform: translate3d(0, -14px, 0);
            pointer-events: none;
        }
        .pwd-modal.unlock-mode .mode-unlock-title,
        .nfc-modal.unlock-mode .mode-unlock-title {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

        /* Continuous Sliding Description */
        .pwd-desc-wrapper {
            position: relative;
            min-height: 34px;
            margin-bottom: 10px;
            padding: 0 4px;
        }
        .pwd-mode-desc {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11.5px;
            line-height: 1.4;
            color: var(--text-sub);
            text-align: center;
            margin: 0;
            transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), 
                        opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform, opacity;
        }
        .pwd-modal:not(.unlock-mode) .mode-lock-desc,
        .nfc-modal:not(.unlock-mode) .mode-lock-desc {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        .pwd-modal:not(.unlock-mode) .mode-unlock-desc,
        .nfc-modal:not(.unlock-mode) .mode-unlock-desc {
            opacity: 0;
            transform: translate3d(0, 10px, 0);
            pointer-events: none;
        }
        .pwd-modal.unlock-mode .mode-lock-desc,
        .nfc-modal.unlock-mode .mode-lock-desc {
            opacity: 0;
            transform: translate3d(0, -10px, 0);
            pointer-events: none;
        }
        .pwd-modal.unlock-mode .mode-unlock-desc,
        .nfc-modal.unlock-mode .mode-unlock-desc {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

        .pwd-input-group {
            display: flex;
            align-items: center;
            background: rgba(18, 16, 15, 0.95);
            border: 1.5px solid var(--border);
            border-radius: 16px;
            padding: 4px 12px;
            margin: 10px 0 8px 0;
            gap: 10px;
            transition: border-color 0.25s ease, box-shadow 0.25s ease;
        }
        .pwd-input-group:focus-within {
            border-color: #F5277D;
            box-shadow: 0 0 0 3px rgba(245, 39, 125, 0.25);
        }
        .pwd-modal.unlock-mode .pwd-input-group:focus-within,
        .nfc-modal.unlock-mode .pwd-input-group:focus-within {
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
        }
        .pwd-input-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .pwd-input-icon svg {
            width: 18px;
            height: 18px;
            fill: #F5277D;
            transition: fill 0.25s ease;
        }
        .pwd-modal.unlock-mode .pwd-input-icon svg,
        .nfc-modal.unlock-mode .pwd-input-icon svg {
            fill: #10b981;
        }
        .pwd-text-input {
            flex: 1;
            height: 42px;
            background: transparent;
            border: none;
            outline: none;
            color: #ffffff;
            font-size: 15px;
            font-weight: 600;
            font-family: inherit;
            min-width: 0;
            text-align: start;
        }
        /* Theme-aware Text Selection Highlight for Lock & Unlock Modals */
        .unlock-mode .pwd-text-input::selection,
        .nfc-modal.unlock-mode input::selection,
        .nfc-modal.theme-unlock input::selection,
        .pwd-modal.unlock-mode input::selection,
        .unlock-mode ::selection {
            background-color: #ffffff !important;
            color: #10b981 !important;
            text-shadow: none !important;
        }
        .unlock-mode .pwd-text-input::-moz-selection,
        .nfc-modal.unlock-mode input::-moz-selection,
        .nfc-modal.theme-unlock input::-moz-selection,
        .pwd-modal.unlock-mode input::-moz-selection,
        .unlock-mode ::-moz-selection {
            background-color: #ffffff !important;
            color: #10b981 !important;
            text-shadow: none !important;
        }
        .nfc-modal:not(.unlock-mode) .pwd-text-input::selection,
        .nfc-modal.theme-lock input::selection,
        .pwd-modal:not(.unlock-mode) input::selection,
        .nfc-modal:not(.unlock-mode) ::selection {
            background-color: #ffffff !important;
            color: #F5277D !important;
            text-shadow: none !important;
        }
        .nfc-modal:not(.unlock-mode) .pwd-text-input::-moz-selection,
        .nfc-modal.theme-lock input::-moz-selection,
        .pwd-modal:not(.unlock-mode) input::-moz-selection,
        .nfc-modal:not(.unlock-mode) ::-moz-selection {
            background-color: #ffffff !important;
            color: #F5277D !important;
            text-shadow: none !important;
        }
        .pwd-text-input::placeholder {
            color: #78716c;
            font-size: 13px;
            font-weight: 500;
        }
        .btn-pwd-eye {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--text-sub);
            transition: color 0.2s ease, transform 0.15s ease;
            flex-shrink: 0;
        }
        .btn-pwd-eye:hover {
            color: #ffffff;
            transform: scale(1.08);
        }
        .btn-pwd-eye svg {
            width: 19px;
            height: 19px;
            fill: currentColor;
        }

        .btn-pwd-info {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--text-sub);
            transition: color 0.2s ease, transform 0.15s ease;
            flex-shrink: 0;
        }
        .btn-pwd-info:hover,
        .btn-pwd-info:active {
            color: #F5277D;
            transform: scale(1.12);
        }
        .pwd-modal.unlock-mode .btn-pwd-info:hover,
        .pwd-modal.unlock-mode .btn-pwd-info:active,
        .nfc-modal.unlock-mode .btn-pwd-info:hover,
        .nfc-modal.unlock-mode .btn-pwd-info:active {
            color: #10b981;
        }
        .btn-pwd-info svg {
            width: 19px;
            height: 19px;
            fill: currentColor;
        }

        .pwd-hint {
            display: none;
        }

        .pwd-actions,
        .perm-lock-actions {
            display: flex;
            gap: 8px;
            margin-top: 14px;
        }
        .btn-pwd-submit {
            position: relative;
            flex: 1;
            height: 42px;
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 4px 15px rgba(245, 39, 125, 0.4);
            border: none;
            border-radius: 12px;
            color: #ffffff;
            font-size: 12.5px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            overflow: hidden;
            transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                        transform 0.15s ease;
        }
        .btn-pwd-submit.unlock-mode {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
            box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
        }
        .btn-pwd-submit:active {
            transform: scale(0.98);
        }
        .pwd-btn-label {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), 
                        opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
            will-change: transform, opacity;
            padding: 0 8px;
            white-space: nowrap;
        }
        .btn-pwd-submit:not(.unlock-mode) .mode-lock-btn-label {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
        .btn-pwd-submit:not(.unlock-mode) .mode-unlock-btn-label {
            opacity: 0;
            transform: translate3d(0, 12px, 0);
            pointer-events: none;
        }
        .btn-pwd-submit.unlock-mode .mode-lock-btn-label {
            opacity: 0;
            transform: translate3d(0, -12px, 0);
            pointer-events: none;
        }
        .btn-pwd-submit.unlock-mode .mode-unlock-btn-label {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }

        .btn-perm-lock-confirm {
            flex: 1;
            height: 42px;
            background: linear-gradient(135deg, #F5277D 0%, #D81B60 100%);
            box-shadow: 0 4px 14px rgba(245, 39, 125, 0.4);
            border: none;
            border-radius: 12px;
            color: #ffffff;
            font-size: 12.5px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: opacity 0.2s ease, transform 0.15s ease;
        }
        .btn-perm-lock-confirm:active {
            transform: scale(0.98);
        }
        .btn-pwd-cancel,
        .btn-perm-lock-cancel {
            height: 42px;
            padding: 0 16px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border);
            border-radius: 12px;
            color: var(--text-sub);
            font-size: 12px;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .btn-pwd-cancel:hover,
        .btn-perm-lock-cancel:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.12);
        }
        .perm-lock-icon {
            width: 48px;
            height: 48px;
            margin: 0 auto 12px;
            border-radius: 50%;
            background: rgba(245, 39, 125, 0.15);
            border: 1px solid rgba(245, 39, 125, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .perm-lock-icon svg {
            width: 24px;
            height: 24px;
            fill: #F5277D;
        }

        /* == Distinctive Amber / Yellow Wi-Fi Theme == */
        .nfc-modal.theme-wifi {
            overflow: visible;
            contain: none;
        }
        .nfc-modal:has(#nfcWifiView.active) {
            overflow: visible;
            contain: none;
        }
        #nfcWifiView.active {
            overflow: visible;
        }
        .nfc-modal.theme-wifi input::selection,
        #nfcWifiView input::selection {
            background-color: #f59e0b;
            color: #0c0a09;
        }

        /* Wi-Fi Setup Wizard Modal Styles */
        .wifi-icon-circle-wrapper {
            display: flex;
            justify-content: center;
            margin-bottom: 10px;
        }
        .wifi-icon-circle {
            width: 54px;
            height: 54px;
            border-radius: 50%;
            background: rgba(245, 158, 11, 0.12);
            border: 1px solid rgba(245, 158, 11, 0.38);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 24px rgba(245, 158, 11, 0.18);
            transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
        }
        .wifi-icon-circle svg {
            width: 26px;
            height: 26px;
            fill: #fbbf24;
        }
        .wifi-steps-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-bottom: 12px;
        }
        .wifi-step-item {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: rgba(41, 37, 36, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-muted);
            font-size: 10.5px;
            font-weight: 700;
            transition: all 0.24s ease;
        }
        .wifi-step-item.active {
            background: #f59e0b;
            border-color: #fbbf24;
            color: #0c0a09;
            box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
            transform: scale(1.08);
        }
        .wifi-step-item.completed {
            background: rgba(245, 158, 11, 0.25);
            border-color: rgba(245, 158, 11, 0.55);
            color: #fbbf24;
        }
        .wifi-step-line {
            width: 20px;
            height: 2px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
            transition: background 0.24s ease;
        }
        .wifi-step-line.active {
            background: rgba(245, 158, 11, 0.65);
        }
        .wifi-title {
            font-size: 17px;
            font-weight: 700;
            color: #ffffff;
            margin-bottom: 4px;
            line-height: 1.3;
        }
        .wifi-desc {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 14px;
            line-height: 1.4;
            min-height: 32px;
        }
        .wifi-steps-container {
            position: relative;
            width: 100%;
            min-height: 56px;
            margin-bottom: 14px;
            display: grid;
            grid-template-columns: 100%;
            align-items: center;
        }
        .wifi-step-pane {
            grid-column: 1 / 2;
            grid-row: 1 / 2;
            width: 100%;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                        visibility 0s linear 0.25s;
            will-change: transform, opacity;
            box-sizing: border-box;
        }
        .wifi-step-pane.pane-prev {
            transform: translate3d(-24px, 0, 0);
        }
        .wifi-step-pane.pane-next {
            transform: translate3d(24px, 0, 0);
        }
        html[lang="ar"] .wifi-step-pane.pane-prev,
        [dir="rtl"] .wifi-step-pane.pane-prev {
            transform: translate3d(24px, 0, 0);
        }
        html[lang="ar"] .wifi-step-pane.pane-next,
        [dir="rtl"] .wifi-step-pane.pane-next {
            transform: translate3d(-24px, 0, 0);
        }
        .wifi-step-pane.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translate3d(0, 0, 0) !important;
            transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
                        visibility 0s linear 0s;
        }
        @keyframes stepTextFadeIn {
            0% { opacity: 0; transform: translate3d(0, -6px, 0); }
            100% { opacity: 1; transform: translate3d(0, 0, 0); }
        }
        .step-title-animate,
        .step-desc-animate {
            animation: stepTextFadeIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }
        .wifi-input-group {
            display: flex;
            align-items: center;
            background: rgba(18, 16, 15, 0.95);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-input);
            padding: 0 12px;
            height: 52px;
            box-sizing: border-box;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        .wifi-input-group:focus-within {
            border-color: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
        }
        .wifi-input-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            margin-right: 10px;
            flex-shrink: 0;
        }
        html[lang="ar"] .wifi-input-icon {
            margin-right: 0;
            margin-left: 10px;
        }
        .wifi-input-icon svg {
            width: 18px;
            height: 18px;
            fill: #f59e0b;
        }
        .wifi-text-input {
            flex: 1;
            min-width: 0;
            height: 100%;
            background: transparent;
            border: none;
            outline: none;
            color: #ffffff;
            font-family: inherit;
            font-size: 13.5px;
            font-weight: 600;
        }
        .wifi-text-input::placeholder {
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 500;
            opacity: 0.85;
        }
        .btn-wifi-clear,
        .btn-wifi-eye {
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 6px;
            border-radius: 8px;
            transition: color 0.2s ease, background 0.2s ease;
            flex-shrink: 0;
        }
        .btn-wifi-clear:hover,
        .btn-wifi-eye:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.08);
        }
        .btn-wifi-clear svg,
        .btn-wifi-eye svg {
            width: 17px;
            height: 17px;
            fill: currentColor;
        }

        /* Wi-Fi Security Dropdown (Places Autocomplete Style) */
        .wifi-dropdown-wrapper {
            position: relative;
            width: 100%;
            z-index: 50;
        }
        .wifi-select-trigger {
            width: 100%;
            height: 52px;
            background: rgba(18, 16, 15, 0.95);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-input);
            padding: 0 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            box-sizing: border-box;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            text-align: left;
        }
        html[lang="ar"] .wifi-select-trigger {
            text-align: right;
        }
        .wifi-dropdown-wrapper.open .wifi-select-trigger,
        .wifi-select-trigger:focus {
            border-color: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
            outline: none;
        }
        .wifi-select-val {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }
        .wifi-select-icon {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: rgba(245, 158, 11, 0.14);
            border: 1px solid rgba(245, 158, 11, 0.28);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .wifi-select-icon svg {
            width: 15px;
            height: 15px;
            fill: #fbbf24;
        }
        .wifi-select-texts {
            display: flex;
            flex-direction: column;
            min-width: 0;
            gap: 1px;
        }
        .wifi-select-main {
            font-size: 13px;
            font-weight: 700;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .wifi-select-sub {
            font-size: 10.5px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .wifi-dropdown-arrow {
            width: 18px;
            height: 18px;
            fill: var(--text-muted);
            flex-shrink: 0;
            transition: transform 0.22s ease, fill 0.2s ease;
        }
        .wifi-dropdown-wrapper.open .wifi-dropdown-arrow {
            transform: rotate(180deg);
            fill: #fbbf24;
        }
        .wifi-dropdown-menu {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            z-index: 99999;
            background: #181412;
            border: 1px solid rgba(245, 158, 11, 0.38);
            border-radius: var(--radius-btn);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.2);
            display: none;
            flex-direction: column;
            overflow: hidden;
            transform-origin: top center;
        }
        .wifi-dropdown-wrapper.open .wifi-dropdown-menu {
            display: flex;
            animation: dropdownExpandAnim 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }
        .wifi-dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 9.5px 12px;
            cursor: pointer;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            transition: background 0.15s ease;
            text-align: left;
        }
        html[lang="ar"] .wifi-dropdown-item {
            text-align: right;
        }
        .wifi-dropdown-item:last-of-type {
            border-bottom: none;
        }
        .wifi-dropdown-item:hover,
        .wifi-dropdown-item.selected {
            background: rgba(245, 158, 11, 0.16);
        }
        .wifi-dropdown-icon {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: rgba(245, 158, 11, 0.14);
            border: 1px solid rgba(245, 158, 11, 0.28);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .wifi-dropdown-icon svg {
            width: 15px;
            height: 15px;
            fill: #fbbf24;
        }
        .wifi-dropdown-text {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .wifi-dropdown-main {
            font-size: 13px;
            font-weight: 700;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .wifi-dropdown-sub {
            font-size: 11px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .wifi-check-icon {
            width: 18px;
            height: 18px;
            fill: #fbbf24;
            opacity: 0;
            transform: scale(0.8);
            transition: opacity 0.18s ease, transform 0.18s ease;
            flex-shrink: 0;
        }
        .wifi-dropdown-item.selected .wifi-check-icon {
            opacity: 1;
            transform: scale(1);
        }

        /* Wi-Fi Wizard Action Buttons */
        .wifi-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
            margin-top: 4px;
        }
        .wifi-actions-primary-row {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
        }
        .wifi-actions-primary-row .btn-wifi-next {
            flex: 1.35;
            min-width: 0;
        }
        .btn-wifi-qr {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 6px;
            height: 46px;
            flex: 1;
            min-width: 0;
            padding: 0 12px;
            background: rgba(245, 158, 11, 0.12);
            border: 1px solid rgba(245, 158, 11, 0.42);
            border-radius: var(--radius-btn);
            color: #fbbf24;
            font-family: inherit;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
            white-space: nowrap;
            transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
        }
        .btn-wifi-qr:active {
            transform: scale(0.97);
            background: rgba(245, 158, 11, 0.22);
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
        }
        .btn-wifi-qr svg {
            width: 17px;
            height: 17px;
            fill: #fbbf24;
            flex-shrink: 0;
        }
        .btn-wifi-next {
            width: 100%;
            height: 46px;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border: 1px solid rgba(251, 191, 36, 0.4);
            border-radius: var(--radius-btn);
            color: #0c0a09;
            font-family: inherit;
            font-size: 14px;
            font-weight: 800;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
            transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, opacity 0.2s ease;
        }
        .btn-wifi-next:active {
            transform: scale(0.97);
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
        }
        .wifi-next-arrow {
            width: 18px;
            height: 18px;
            fill: #0c0a09;
            transition: transform 0.18s ease;
        }
        html[lang="ar"] .wifi-next-arrow {
            transform: rotate(180deg);
        }
        .btn-wifi-back {
            width: 100%;
            height: 38px;
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-btn);
            color: var(--text-muted);
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
        }
        .btn-wifi-back:hover,
        .btn-wifi-back:active {
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.04);
        }

        /* ========================================================
           Link Type Segmented Selector (Above NFC Button)
           ======================================================== */
        .link-type-selector-wrapper {
            display: flex;
            flex-direction: column;
            gap: 7px;
            width: 100%;
            margin-bottom: 12px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.025);
            border: 1px solid rgba(139, 92, 246, 0.22);
            border-radius: 18px;
            transition: border-color 0.22s ease, background 0.22s ease;
        }
        .link-type-selector-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            padding: 0 4px;
        }
        .link-type-segmented {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            background: rgba(14, 12, 18, 0.65);
            padding: 4px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
        .btn-link-type {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-height: 40px;
            padding: 6px 10px;
            border-radius: 10px;
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-sub);
            font-family: inherit;
            font-size: 11.5px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
            -webkit-tap-highlight-color: transparent;
            text-align: center;
            user-select: none;
        }
        .btn-link-type svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
            flex-shrink: 0;
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .btn-link-type:active {
            transform: scale(0.96);
        }
        .btn-link-type.active[data-type="review"] {
            background: linear-gradient(135deg, rgba(124, 58, 237, 0.28) 0%, rgba(139, 92, 246, 0.38) 100%);
            border-color: rgba(139, 92, 246, 0.6);
            color: #ffffff;
            box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
        }
        .btn-link-type.active[data-type="review"] svg {
            fill: #fbbf24;
            transform: scale(1.15);
        }
        .btn-link-type.active[data-type="location"] {
            background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(56, 189, 248, 0.35) 100%);
            border-color: rgba(56, 189, 248, 0.6);
            color: #ffffff;
            box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
        }
        .btn-link-type.active[data-type="location"] svg {
            fill: #38bdf8;
            transform: scale(1.15);
        }

        /* Top Bar Help / Guide Button */
        .btn-help-guide {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: rgba(28, 25, 23, 0.9);
            border: 1px solid var(--border);
            border-radius: 50%;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
            -webkit-tap-highlight-color: transparent;
            user-select: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
            flex-shrink: 0;
        }
        .btn-help-guide svg {
            width: 16px;
            height: 16px;
            fill: currentColor;
            transition: transform 0.2s ease;
        }
        .btn-help-guide:hover {
            color: #c4b5fd;
            border-color: rgba(139, 92, 246, 0.45);
            background: rgba(139, 92, 246, 0.12);
            transform: translateY(-1px);
        }
        .btn-help-guide:active {
            transform: scale3d(0.92, 0.92, 1);
        }

        /* Top Bar Flex Alignment */
        .top-bar-right {
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
