:root {
            --mobile-safe-top: 0px;
            color-scheme: light dark;
            --bg: #161618;
            --bg-gradient: radial-gradient(circle at 50% 20%, #222226 0%, #171719 50%, #121214 100%);
            --card-bg: rgba(24, 24, 26, 0.94);
            --card-border: rgba(255, 255, 255, 0.08);
            --card-shadow: 0 25px 65px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.04) inset;
            --input-bg: #242428;
            --input-border: #33333a;
            --text-main: #f8fafc;
            --text-muted: #9ca3af;
            --text-label: #cbd5e1;
            --primary-red: #ef4444;
            --primary-red-hover: #dc2626;
            --primary-gradient: linear-gradient(135deg, #ef4444 0%, #dc1414 50%, #b91c1c 100%);
            --primary-glow: rgba(239, 68, 68, 0.35);
            --error-bg: rgba(239, 68, 68, 0.08);
            --error-border: rgba(239, 68, 68, 0.28);
            --error-text: #fca5a5;
            --success-bg: rgba(16, 185, 129, 0.08);
            --success-border: rgba(16, 185, 129, 0.28);
            --success-text: #6ee7b7;
            --top-bar-bg: rgba(28, 28, 33, 0.8);
            --top-bar-border: rgba(255, 255, 255, 0.1);
        }

        :root.is-apk,
        :root.is-webview,
        html.is-apk,
        html.is-webview,
        body.is-apk,
        body.is-webview {
            --mobile-safe-top: max(env(safe-area-inset-top, 0px), 24px);
        }

        .light-theme {
            color-scheme: light;
            --bg: #f8fafc;
            --bg-gradient: radial-gradient(circle at 50% 20%, #ffffff 0%, #f1f5f9 60%, #e2e8f0 100%);
            --card-bg: #ffffff;
            --card-border: #cbd5e1;
            --card-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
            --input-bg: #f8fafc;
            --input-border: #cbd5e1;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --text-label: #334155;
            --primary-red: #dc2626;
            --primary-red-hover: #b91c1c;
            --primary-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
            --primary-glow: rgba(220, 38, 38, 0.25);
            --error-bg: #fef2f2;
            --error-border: #fecaca;
            --error-text: #991b1b;
            --success-bg: #f0fdf4;
            --success-border: #bbf7d0;
            --success-text: #166534;
            --top-bar-bg: rgba(255, 255, 255, 0.85);
            --top-bar-border: #cbd5e1;
        }

        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        html, body {
            min-height: 100%;
            width: 100%;
        }

        body {
            min-height: 100vh;
            background: var(--bg-gradient);
            color: var(--text-main);
            font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            overflow-x: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.3s ease, color 0.3s ease;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* Ambient Glow */
        .ambient-glow-left {
            position: fixed;
            top: 25%;
            left: 12%;
            width: 480px;
            height: 480px;
            background: radial-gradient(circle, rgba(var(--accent-bright-rgb, 239, 68, 68), 0.07) 0%, transparent 70%);
            filter: blur(80px);
            pointer-events: none;
            z-index: 0;
        }
        .light-theme .ambient-glow-left {
            background: radial-gradient(circle, rgba(var(--accent-bright-rgb, 239, 68, 68), 0.04) 0%, transparent 70%);
        }

        /* Top Action Bar */
        .top-action-bar {
            position: fixed;
            top: calc(20px + var(--mobile-safe-top, 0px));
            right: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 30;
        }
        html.is-apk .top-action-bar,
        html.is-webview .top-action-bar,
        body.is-apk .top-action-bar,
        body.is-webview .top-action-bar {
            top: calc(20px + var(--mobile-safe-top, 24px));
        }
        .bar-btn {
            width: 38px;
            height: 38px;
            border-radius: 999px;
            border: 1px solid var(--top-bar-border);
            background: var(--top-bar-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            color: var(--text-main);
            cursor: pointer;
            display: grid;
            place-items: center;
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }
        .bar-btn:hover {
            border-color: var(--primary-red);
            color: var(--primary-red);
            transform: translateY(-1px);
        }
        .auth-lang-dropdown {
            position: relative;
            display: inline-flex;
            align-items: center;
        }
        .auth-lang-dropdown .hk-lang-trigger {
            height: 32px;
            min-height: 32px;
            max-height: 32px;
            min-width: 110px;
            padding: 0 10px 0 12px;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            border: 1px solid var(--top-bar-border);
            border-radius: 4px;
            background: var(--top-bar-bg);
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 600;
            line-height: 1;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            white-space: nowrap;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .auth-lang-dropdown .hk-lang-current-name,
        .auth-lang-dropdown .hk-lang-name {
            min-width: 0;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .auth-lang-dropdown .hk-lang-name {
            flex: 1 1 auto;
        }
        .auth-lang-dropdown .hk-lang-flag {
            width: 1.3em;
            height: 0.87em;
            flex: 0 0 1.3em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: 2px;
            box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.35);
        }
        .auth-lang-dropdown .hk-flag-svg {
            display: block;
            width: 100%;
            height: 100%;
        }
        .auth-lang-dropdown .hk-lang-trigger:hover {
            border-color: rgba(var(--accent-rgb, 239, 68, 68), 0.42);
            background: rgba(var(--accent-rgb, 239, 68, 68), 0.06);
        }
        .auth-lang-dropdown .hk-lang-trigger.is-open {
            border-color: var(--accent, var(--primary-red));
            box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent, var(--primary-red)) 22%, transparent);
        }
        .auth-lang-dropdown .hk-lang-chevron {
            flex-shrink: 0;
            color: var(--text-muted);
            font-size: 10px;
            transition: transform 0.2s ease, color 0.2s ease;
        }
        .auth-lang-dropdown .hk-lang-trigger.is-open .hk-lang-chevron {
            color: var(--accent, var(--primary-red));
            transform: rotate(180deg);
        }
        .auth-lang-dropdown .hk-lang-menu {
            position: absolute;
            top: calc(100% + 5px);
            right: 0;
            z-index: 1050;
            min-width: 145px;
            max-width: min(240px, calc(100vw - 20px));
            max-height: 320px;
            overflow-y: auto;
            padding: 5px;
            border: 1px solid var(--card-border);
            border-radius: 8px;
            background: var(--card-bg);
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.04);
            scrollbar-width: thin;
            animation: authLangDropAnim 0.15s ease-out;
        }
        .auth-lang-dropdown .hk-lang-menu[hidden] {
            display: none;
        }
        @keyframes authLangDropAnim {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .auth-lang-dropdown .hk-lang-item {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 7px 10px;
            border: 0;
            border-radius: 5px;
            background: transparent;
            color: var(--text-main);
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 500;
            line-height: 1.4;
            text-align: left;
            cursor: pointer;
            transition: background 0.12s ease, color 0.12s ease;
            user-select: none;
        }
        .auth-lang-dropdown .hk-lang-item:hover {
            background: color-mix(in oklab, var(--accent, var(--primary-red)) 14%, transparent);
        }
        .auth-lang-dropdown .hk-lang-item.is-active {
            background: color-mix(in oklab, var(--accent, var(--primary-red)) 20%, transparent);
            color: var(--accent, var(--primary-red));
            font-weight: 600;
        }
        .auth-lang-dropdown .hk-lang-check {
            flex-shrink: 0;
            color: var(--accent, var(--primary-red));
            font-size: 11px;
        }
        .light-theme .auth-lang-dropdown .hk-lang-menu {
            border-color: #e4e4e7;
            background: #fff;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
        }
        .light-theme .auth-lang-dropdown .hk-lang-item {
            color: #18181b;
        }
        .light-theme .auth-lang-dropdown .hk-lang-item:hover {
            background: color-mix(in oklab, var(--accent, var(--primary-red)) 8%, #fff);
            color: #09090b;
        }
        .light-theme .auth-lang-dropdown .hk-lang-item.is-active {
            background: color-mix(in oklab, var(--accent, var(--primary-red)) 12%, #fff);
            color: var(--accent, var(--primary-red));
        }
        .window-decor {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-left: 6px;
            opacity: 0.55;
        }
        .decor-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.25);
        }
        .light-theme .decor-dot {
            background: rgba(0, 0, 0, 0.25);
        }

        /* Main Container */
        .auth-container {
            width: min(1200px, 94vw);
            min-height: min(720px, 90vh);
            display: grid;
            grid-template-columns: 1.15fr 1fr;
            align-items: center;
            gap: 40px;
            padding: 40px 20px;
            position: relative;
            z-index: 10;
        }

        /* Left Column: Automotive ECU Telemetry HUD */
        .auth-presentation {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: relative;
            padding: 20px;
        }

        .brand-header,
        html[dir="rtl"] .brand-header,
        [dir="rtl"] .brand-header {
            margin-bottom: 18px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            direction: ltr !important;
            unicode-bidi: isolate !important;
        }
        .brand-logo,
        html[dir="rtl"] .brand-logo,
        [dir="rtl"] .brand-logo {
            display: inline-flex !important;
            flex-direction: row !important;
            direction: ltr !important;
            unicode-bidi: isolate !important;
            align-items: center;
            justify-content: center;
            gap: 2px;
            font-size: 2.4rem;
            font-weight: 900;
            letter-spacing: -0.5px;
            line-height: 1;
            color: #ffffff;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.18);
        }
        .light-theme .brand-logo,
        html[dir="rtl"].light-theme .brand-logo,
        [dir="rtl"] .light-theme .brand-logo {
            color: #0f172a;
            text-shadow: none;
        }
        .brand-hk,
        .brand-works,
        html[dir="rtl"] .brand-hk,
        html[dir="rtl"] .brand-works,
        [dir="rtl"] .brand-hk,
        [dir="rtl"] .brand-works {
            direction: ltr !important;
            unicode-bidi: isolate !important;
            display: inline-block !important;
            color: inherit;
        }
        .brand-works {
            font-weight: 900;
        }
        .brand-tagline {
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 3.5px;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-top: 4px;
        }

        /* Canvas Stage */
        .animation-stage {
            width: 100%;
            max-width: 460px;
            height: 350px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 8px 0 20px;
        }
        .animation-canvas {
            width: 100%;
            height: 100%;
            display: block;
        }

        /* Presentation Features (Calm, Minimalist & Balanced) */
        .presentation-features {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 8px;
            margin: 0 0 20px;
            max-width: 440px;
        }
        .pres-feature-pill {
            font-size: 0.74rem;
            font-weight: 600;
            padding: 5px 12px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.04);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.07);
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            letter-spacing: 0.2px;
            transition: all 0.2s ease;
        }
        .pres-feature-pill i {
            color: var(--primary-red);
            font-size: 0.76rem;
        }
        .light-theme .pres-feature-pill {
            background: rgba(0, 0, 0, 0.03);
            border-color: rgba(0, 0, 0, 0.08);
            color: #475569;
        }

        .presentation-footer {
            font-size: 0.88rem;
            font-weight: 600;
            letter-spacing: 0.4px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .presentation-footer::before,
        .presentation-footer::after {
            content: "";
            width: 28px;
            height: 1px;
            background: var(--card-border);
        }

        /* Right Column: Authentication Card - Original Compact Dimensions */
        .auth-card-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            gap: 14px;
        }
        .auth-card {
            width: 100%;
            max-width: 430px;
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--card-border);
            border-radius: 18px;
            padding: 38px 34px 28px;
            box-shadow: var(--card-shadow);
            position: relative;
            box-sizing: border-box;
            transition: all 0.25s ease;
        }

        .card-header {
            text-align: center;
            margin-bottom: 24px;
        }
        .card-title {
            font-size: 1.55rem;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 6px;
            letter-spacing: -0.3px;
        }
        .card-subtitle {
            font-size: 0.88rem;
            color: var(--text-muted);
            line-height: 1.4;
        }

        /* Form elements */
        .auth-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .input-group {
            position: relative;
            display: flex;
            align-items: center;
        }
        .input-icon {
            position: absolute;
            left: 15px;
            color: var(--text-muted);
            font-size: 0.95rem;
            pointer-events: none;
            transition: color 0.2s ease;
        }
        .input-field {
            width: 100%;
            height: 48px;
            background: var(--input-bg);
            border: 1.5px solid var(--input-border);
            border-radius: 10px;
            color: var(--text-main);
            font-size: 0.92rem;
            font-family: inherit;
            padding: 0 14px 0 44px;
            outline: none;
            transition: all 0.2s ease;
            box-sizing: border-box;
            color-scheme: dark;
        }
        .light-theme .input-field {
            color-scheme: light;
        }
        .input-field::placeholder {
            color: #64748b;
        }
        .input-field:focus {
            border-color: var(--primary-red);
            box-shadow: 0 0 0 3px var(--primary-glow);
        }
        .input-group:focus-within .input-icon {
            color: var(--primary-red);
        }

        /* Prevent browser autofill background override & enforce dark/light theme */
        .input-field:-webkit-autofill,
        .input-field:-webkit-autofill:hover, 
        .input-field:-webkit-autofill:focus,
        .input-field:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
            -webkit-text-fill-color: var(--text-main) !important;
            caret-color: var(--text-main) !important;
            color-scheme: dark !important;
            transition: background-color 5000s ease-in-out 0s;
        }
        .light-theme .input-field:-webkit-autofill,
        .light-theme .input-field:-webkit-autofill:hover, 
        .light-theme .input-field:-webkit-autofill:focus,
        .light-theme .input-field:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
            -webkit-text-fill-color: var(--text-main) !important;
            caret-color: var(--text-main) !important;
            color-scheme: light !important;
            transition: background-color 5000s ease-in-out 0s;
        }

        .input-group.has-trailing .input-field {
            padding-right: 44px;
        }
        .toggle-password-btn {
            position: absolute;
            right: 12px;
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 0.95rem;
            cursor: pointer;
            padding: 6px;
            display: grid;
            place-items: center;
            transition: color 0.2s ease;
        }
        .toggle-password-btn:hover {
            color: var(--text-main);
        }

        .form-options-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 2px;
            margin-bottom: 4px;
        }
        .custom-checkbox {
            display: inline-flex;
            align-items: center;
            gap: 9px;
            cursor: pointer;
            user-select: none;
        }
        .custom-checkbox input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }
        .checkbox-mark {
            width: 18px;
            height: 18px;
            border-radius: 5px;
            border: 1.5px solid var(--input-border);
            background: var(--input-bg);
            display: grid;
            place-items: center;
            font-size: 0.65rem;
            color: transparent;
            transition: all 0.18s ease;
        }
        .custom-checkbox input:checked + .checkbox-mark {
            background: var(--primary-red);
            border-color: var(--primary-red);
            color: var(--on-accent, #ffffff);
            box-shadow: 0 2px 8px var(--primary-glow);
        }
        .checkbox-label {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-label);
        }
        .forgot-link {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--primary-red);
            text-decoration: none;
            transition: color 0.18s ease;
        }
        .forgot-link:hover {
            text-decoration: underline;
        }

        /* Submit Button */
        .submit-btn {
            width: 100%;
            height: 48px;
            border: none;
            border-radius: 10px;
            background: var(--primary-gradient);
            color: var(--on-accent, #ffffff);
            font-size: 0.98rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 8px 24px var(--primary-glow);
            transition: all 0.22s ease;
            position: relative;
            overflow: hidden;
            margin-top: 4px;
            text-decoration: none;
        }
        .submit-btn:hover {
            filter: brightness(1.08);
            transform: translateY(-1px);
            box-shadow: 0 12px 28px rgba(var(--accent-rgb, 220, 38, 38), 0.45);
        }
        .submit-btn:active {
            transform: translateY(0);
        }
        .submit-btn i.fa-arrow-right,
        .submit-btn i.fa-paper-plane,
        .submit-btn i.fa-key {
            transition: transform 0.2s ease;
        }
        .submit-btn:hover i.fa-arrow-right {
            transform: translateX(4px);
        }

        /* Alert message - Clean and compact */
        .auth-alert {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 9px;
            font-size: 0.86rem;
            line-height: 1.4;
            margin-bottom: 16px;
            margin-top: 0;
        }
        .auth-alert.error {
            background: var(--error-bg);
            border: 1px solid var(--error-border);
            border-left: 3px solid var(--primary-red);
            color: var(--error-text);
        }
        .auth-alert.success {
            background: var(--success-bg);
            border: 1px solid var(--success-border);
            border-left: 3px solid #10b981;
            color: var(--success-text);
        }
        .alert-icon {
            font-size: 0.95rem;
            flex-shrink: 0;
            color: var(--primary-red);
        }
        .auth-alert.success .alert-icon {
            color: #10b981;
        }
        .light-theme .auth-alert.error {
            background: var(--error-bg, #fef2f2);
            border: 1px solid var(--error-border, #fecaca);
            border-left: 3px solid var(--primary-red, #dc2626);
            color: var(--error-text, #991b1b);
        }
        .light-theme .auth-alert.success {
            background: #f0fdf4;
            border: 1px solid #bbf7d0;
            border-left: 3px solid #16a34a;
            color: #166534;
        }
        .light-theme .auth-alert.error .alert-icon {
            color: var(--primary-red, #dc2626);
        }
        .light-theme .auth-alert.success .alert-icon {
            color: #16a34a;
        }

        /* Divider & Google */
        .auth-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 6px 0 0;
            color: var(--text-muted);
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        .auth-divider::before, .auth-divider::after {
            content: "";
            height: 1px;
            background: var(--card-border);
            flex: 1;
        }
        .google-login-btn {
            width: 100%;
            height: 44px;
            border: 1px solid var(--card-border);
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-main);
            font-size: 0.88rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-decoration: none;
            transition: all 0.2s ease;
        }
        .google-login-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
        }
        .google-login-btn.is-disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }
        .light-theme .google-login-btn {
            background: rgba(0, 0, 0, 0.03);
            border-color: #cbd5e1;
        }
        .light-theme .google-login-btn:hover {
            background: rgba(0, 0, 0, 0.06);
            border-color: #94a3b8;
        }
        .google-login-btn.is-disabled {
            opacity: 0.45;
            cursor: not-allowed;
            pointer-events: none;
        }
        .light-theme .google-login-btn {
            background: rgba(0, 0, 0, 0.02);
            border-color: #cbd5e1;
        }
        .light-theme .google-login-btn:hover {
            background: rgba(0, 0, 0, 0.05);
            border-color: #94a3b8;
        }

        .back-link-wrap {
            margin-top: 14px;
            text-align: center;
        }
        .back-link {
            color: var(--primary-red);
            text-decoration: none;
            font-size: 0.88rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: color 0.18s ease;
        }
        .back-link:hover {
            text-decoration: underline;
        }

        /* Card footer */
        .card-footer {
            width: 100%;
            max-width: 430px;
            margin-top: 0;
            padding: 13px 8px 0;
            border-top: 1px solid rgba(156, 163, 175, 0.2);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            box-sizing: border-box;
        }
        .legal-links {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 6px 10px;
            width: 100%;
            font-size: 0.76rem;
            color: #9ca3af;
        }
        .legal-links a {
            min-width: 0;
            min-height: 0;
            display: inline-flex;
            align-items: center;
            padding: 2px 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            color: #9ca3af;
            text-decoration: none;
            line-height: 1.4;
            white-space: nowrap;
            transition: color 0.18s ease;
        }
        .legal-links a i {
            display: none;
        }
        .legal-links a span {
            min-width: 0;
            overflow-wrap: normal;
        }
        .legal-links a:hover {
            color: #d1d5db;
            text-decoration: underline;
            text-underline-offset: 3px;
        }
        .legal-links a:focus-visible {
            outline: 2px solid #9ca3af;
            outline-offset: 2px;
        }
        .legal-sep {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #6b7280;
            opacity: 0.65;
            font-size: 0.72rem;
            line-height: 1;
            user-select: none;
            pointer-events: none;
        }

        .light-theme .legal-links {
            color: #6b7280;
        }
        .light-theme .legal-links a {
            color: #6b7280;
        }
        .light-theme .legal-links a:hover {
            color: #374151;
        }
        .light-theme .legal-sep {
            color: #9ca3af;
            opacity: 0.85;
        }
        .version-pill {
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--text-muted);
            background: rgba(125, 125, 125, 0.08);
            border: 1px solid var(--card-border);
            padding: 3px 12px;
            border-radius: 999px;
            letter-spacing: 0.5px;
        }

        @media (max-width: 992px) {
            .auth-container {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                grid-template-columns: 1fr;
                gap: 16px;
                padding: 48px 16px 24px;
                min-height: 100vh;
                width: 100%;
                max-width: 440px;
                margin: 0 auto;
            }
            .auth-presentation {
                padding: 0;
                margin-bottom: 0;
                width: 100%;
                text-align: center;
            }
            .brand-header {
                margin-bottom: 0;
                gap: 4px;
            }
            .brand-logo {
                font-size: 2.1rem;
            }
            .brand-tagline {
                font-size: 0.68rem;
                letter-spacing: 2px;
                opacity: 0.75;
            }
            .animation-stage,
            .presentation-features,
            .presentation-footer {
                display: none !important;
            }
            .auth-card-wrap {
                width: 100%;
                max-width: 440px;
            }
            .auth-card {
                padding: 26px 20px 22px;
                border-radius: 18px;
            }
            html.is-apk .top-action-bar,
            html.is-webview .top-action-bar,
            body.is-apk .top-action-bar,
            body.is-webview .top-action-bar {
                top: calc(12px + var(--mobile-safe-top, 24px));
            }
        }
        @media (max-width: 480px) {
            .auth-container {
                padding: 38px 12px 20px;
                gap: 12px;
            }
            html.is-apk .auth-container,
            html.is-webview .auth-container,
            body.is-apk .auth-container,
            body.is-webview .auth-container {
                padding-top: calc(38px + var(--mobile-safe-top, 24px)) !important;
            }
            .auth-card {
                padding: 20px 16px 18px;
                border-radius: 16px;
            }
            .legal-links {
                gap: 4px 8px;
            }
            .legal-links a {
                width: auto;
                min-height: 0;
                padding: 3px 0;
                font-size: 0.72rem;
            }
            .legal-sep {
                font-size: 0.68rem;
            }
            .brand-logo {
                font-size: 1.85rem;
            }
            .top-action-bar {
                top: calc(10px + var(--mobile-safe-top, 0px));
                right: 10px;
                gap: 6px;
            }
            html.is-apk .top-action-bar,
            html.is-webview .top-action-bar,
            body.is-apk .top-action-bar,
            body.is-webview .top-action-bar {
                top: calc(10px + var(--mobile-safe-top, 24px));
            }
            .bar-btn,
            .auth-lang-dropdown .hk-lang-trigger {
                height: 34px;
            }
            .window-decor {
                display: none;
            }
        }
        @media (max-width: 360px) {
            .legal-links {
                gap: 4px 6px;
            }
            .legal-links a {
                min-height: 0;
                padding: 3px 0;
                font-size: 0.68rem;
            }
            .legal-sep {
                font-size: 0.64rem;
            }
        }

/* ==========================================================================
   SECURITY SHIELD MODAL & ANTI-INSPECTION OVERLAY
   ========================================================================== */
.security-shield-overlay:not(.is-active) {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

.security-shield-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(5, 5, 8, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-shield-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.security-shield-card {
    position: relative;
    max-width: 440px;
    width: 100%;
    background: linear-gradient(145deg, #242022 0%, #1a1a1c 100%);
    border: 2px solid var(--primary-red, #ef4444);
    border-radius: 18px;
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 0 50px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35), 0 25px 50px rgba(0, 0, 0, 0.85);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}

.security-shield-overlay.is-active .security-shield-card {
    transform: scale(1);
}

.security-shield-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.12);
    border: 1.5px solid rgba(var(--accent-bright-rgb, 239, 68, 68), 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shieldIconPulse 2s ease-in-out infinite;
}

.security-shield-icon {
    font-size: 1.8rem;
    color: var(--primary-red, #ef4444);
    filter: drop-shadow(0 0 10px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.6));
}

@keyframes shieldIconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35); }
    50% { transform: scale(1.06); box-shadow: 0 0 20px 4px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.25); }
}

.security-shield-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.security-shield-message {
    font-size: 0.92rem;
    color: #cbd5e1;
    line-height: 1.55;
    margin: 0 0 16px 0;
}

.security-shield-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 20px;
    border-radius: 6px;
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.1);
    border: 1px solid rgba(var(--accent-bright-rgb, 239, 68, 68), 0.28);
    font-size: 0.72rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--accent-light, #fca5a5);
    letter-spacing: 0.5px;
}

.security-shield-badge i {
    font-size: 0.8rem;
    color: var(--primary-red, #ef4444);
}

.security-shield-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--primary-gradient, linear-gradient(135deg, #ef4444 0%, #dc2626 100%));
    border: none;
    color: var(--on-accent, #ffffff);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.4);
    transition: all 0.2s ease;
}

.security-shield-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 22px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.55);
    transform: translateY(-1px);
}

.light-theme .security-shield-overlay {
    background: rgba(255, 255, 255, 0.85);
}

.light-theme .security-shield-card {
    background: #ffffff;
    border-color: var(--primary-red, #dc2626);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 35px rgba(var(--accent-rgb, 220, 38, 38), 0.2);
}

.light-theme .security-shield-title {
    color: #0f172a;
}

.light-theme .security-shield-message {
    color: #475569;
}

.light-theme .security-shield-badge {
    background: var(--error-bg, #fee2e2);
    border-color: var(--error-border, #fca5a5);
    color: var(--error-text, #b91c1c);
}

/* ========================================================================
   HKWORKS LEGAL & CONTACT MODAL (INDIVIDUAL VIEW & DUAL THEME)
   ======================================================================== */
.legal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(5, 5, 8, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.legal-modal-container {
    position: relative;
    max-width: 680px;
    width: min(680px, calc(100vw - 32px));
    max-height: min(84vh, 740px);
    background: linear-gradient(160deg, #222226 0%, #18181b 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.6), 0 0 35px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}

.legal-modal-overlay.is-active .legal-modal-container {
    transform: scale(1);
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(28, 28, 34, 0.65);
}

.legal-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.legal-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.12);
    border: 1px solid rgba(var(--accent-bright-rgb, 239, 68, 68), 0.3);
    color: var(--primary-red, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.2);
    flex-shrink: 0;
}

.legal-brand-text {
    min-width: 0;
    flex: 1;
}

.legal-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legal-modal-subtitle {
    font-size: 0.76rem;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legal-modal-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.legal-modal-close-btn:hover {
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.15);
    border-color: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.4);
    color: var(--primary-red, #ef4444);
    transform: rotate(90deg);
}

.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 22px;
    max-height: calc(84vh - 135px);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35) transparent;
}

.legal-modal-body::-webkit-scrollbar {
    width: 6px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35);
    border-radius: 999px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.6);
}

.legal-modal-body::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.legal-tab-panel {
    animation: legalFadeIn 0.22s ease-out;
}

@keyframes legalFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Alert Boxes (Dark Theme Default) */
.legal-alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.legal-alert-box i {
    font-size: 1.05rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.legal-alert-box.alert-red {
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.08);
    border-left: 3.5px solid var(--primary-red, #ef4444);
    color: var(--error-text, #fca5a5);
}
.legal-alert-box.alert-red i { color: var(--primary-red, #ef4444); }
.legal-alert-box.alert-red strong { color: var(--accent-lighter, #fee2e2); }

.legal-alert-box.alert-blue {
    background: rgba(56, 189, 248, 0.08);
    border-left: 3.5px solid #38bdf8;
    color: #bae6fd;
}
.legal-alert-box.alert-blue i { color: #38bdf8; }
.legal-alert-box.alert-blue strong { color: #e0f2fe; }

.legal-alert-box.alert-green {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3.5px solid #10b981;
    color: #a7f3d0;
}
.legal-alert-box.alert-green i { color: #10b981; }
.legal-alert-box.alert-green strong { color: #d1fae5; }

/* Section Cards (Dark Theme Default) */
.legal-section-card {
    background: rgba(25, 25, 33, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}

.legal-section-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.legal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.legal-section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.legal-section-title i {
    color: var(--primary-red, #ef4444);
    font-size: 0.92rem;
}

/* Badges (Dark Theme Default) */
.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.12);
    color: var(--accent-light, #f87171);
    border: 1px solid rgba(var(--accent-bright-rgb, 239, 68, 68), 0.25);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.legal-badge.badge-blue {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.28);
}

.legal-badge.badge-green {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.28);
}

.legal-section-text {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0 0 8px 0;
}

.legal-section-text:last-child {
    margin-bottom: 0;
}

.legal-bullet-list {
    margin: 8px 0 0 16px;
    color: #cbd5e1;
    font-size: 0.83rem;
    line-height: 1.55;
}

.legal-bullet-list li {
    margin-bottom: 6px;
}

.legal-bullet-list strong {
    color: #f8fafc;
}

/* Contact Cards (Dark Theme Default) */
.legal-contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

@media (min-width: 520px) {
    .legal-contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.legal-contact-card {
    background: rgba(20, 20, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.legal-contact-card:hover {
    border-color: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.legal-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--accent-bright-rgb, 239, 68, 68), 0.1);
    border: 1px solid rgba(var(--accent-bright-rgb, 239, 68, 68), 0.25);
    color: var(--primary-red, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.legal-contact-info {
    min-width: 0;
    flex: 1;
}

.legal-contact-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
}

.legal-contact-info p {
    margin: 0 0 6px 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

.legal-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-red, #ef4444);
    text-decoration: none;
    transition: color 0.15s ease;
    word-break: break-all;
}

.legal-contact-link:hover {
    color: var(--accent-light, #f87171);
    text-decoration: underline;
}

.legal-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 12, 16, 0.75);
    gap: 12px;
}

.legal-footer-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
}

.legal-footer-info i {
    color: var(--primary-red, #ef4444);
}

.legal-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.legal-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.legal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.legal-btn-primary {
    background: var(--primary-gradient, linear-gradient(135deg, #ef4444 0%, #dc2626 100%));
    color: var(--on-accent, #ffffff);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.35);
}

.legal-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(var(--accent-bright-rgb, 239, 68, 68), 0.5);
    transform: translateY(-1px);
}

/* ========================================================================
   LIGHT THEME OVERRIDES (CRISP, HIGH-CONTRAST & EYE-FRIENDLY)
   ======================================================================== */
.light-theme .legal-modal-overlay {
    background: rgba(15, 23, 42, 0.65);
}

.light-theme .legal-modal-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 25px 65px rgba(15, 23, 42, 0.18), 0 0 1px 1px rgba(0, 0, 0, 0.04);
}

.light-theme .legal-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.light-theme .legal-brand-icon {
    background: var(--error-bg, #fee2e2);
    border-color: var(--error-border, #fca5a5);
    color: var(--primary-red, #dc2626);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb, 220, 38, 38), 0.12);
}

.light-theme .legal-modal-title {
    color: #0f172a;
    font-weight: 800;
}

.light-theme .legal-modal-subtitle {
    color: #64748b;
    font-weight: 500;
}

.light-theme .legal-modal-close-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.light-theme .legal-modal-close-btn:hover {
    background: var(--error-bg, #fee2e2);
    border-color: var(--error-border, #fca5a5);
    color: var(--primary-red, #dc2626);
}

.light-theme .legal-modal-body {
    scrollbar-color: #cbd5e1 transparent;
}

.light-theme .legal-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.light-theme .legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* High-Contrast Alert Boxes in Light Theme */
.light-theme .legal-alert-box.alert-red {
    background: var(--error-bg, #fef2f2);
    border-left: 3.5px solid var(--primary-red, #dc2626);
    color: var(--error-text, #991b1b);
}
.light-theme .legal-alert-box.alert-red i { color: var(--primary-red, #dc2626); }
.light-theme .legal-alert-box.alert-red strong { color: var(--error-text, #7f1d1d); }

.light-theme .legal-alert-box.alert-blue {
    background: #f0f9ff;
    border-left: 3.5px solid #0284c7;
    color: #075985;
}
.light-theme .legal-alert-box.alert-blue i { color: #0284c7; }
.light-theme .legal-alert-box.alert-blue strong { color: #0c4a6e; }

.light-theme .legal-alert-box.alert-green {
    background: #f0fdf4;
    border-left: 3.5px solid #16a34a;
    color: #166534;
}
.light-theme .legal-alert-box.alert-green i { color: #16a34a; }
.light-theme .legal-alert-box.alert-green strong { color: #14532d; }

/* High-Contrast Section Cards in Light Theme */
.light-theme .legal-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.light-theme .legal-section-card:hover {
    border-color: #cbd5e1;
}

.light-theme .legal-section-title {
    color: #0f172a;
}

.light-theme .legal-section-title i {
    color: var(--primary-red, #dc2626);
}

.light-theme .legal-section-text {
    color: #334155;
}

.light-theme .legal-bullet-list {
    color: #334155;
}

.light-theme .legal-bullet-list strong {
    color: #0f172a;
}

/* High-Contrast Badges in Light Theme */
.light-theme .legal-badge {
    background: var(--error-bg, #fee2e2);
    color: var(--error-text, #b91c1c);
    border-color: var(--error-border, #fca5a5);
    font-weight: 700;
}

.light-theme .legal-badge.badge-blue {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
    font-weight: 700;
}

.light-theme .legal-badge.badge-green {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
    font-weight: 700;
}

/* High-Contrast Contact Cards in Light Theme */
.light-theme .legal-contact-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.light-theme .legal-contact-card:hover {
    border-color: var(--error-border, #fca5a5);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb, 220, 38, 38), 0.08);
}

.light-theme .legal-contact-icon {
    background: var(--error-bg, #fee2e2);
    border-color: var(--error-border, #fecaca);
    color: var(--primary-red, #dc2626);
}

.light-theme .legal-contact-info h4 {
    color: #0f172a;
}

.light-theme .legal-contact-info p {
    color: #475569;
}

.light-theme .legal-contact-link {
    color: var(--primary-red, #dc2626);
    font-weight: 700;
}

.light-theme .legal-contact-link:hover {
    color: var(--error-text, #991b1b);
}

/* Footer in Light Theme */
.light-theme .legal-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.light-theme .legal-footer-info {
    color: #64748b;
    font-weight: 500;
}

.light-theme .legal-footer-info i {
    color: var(--primary-red, #dc2626);
}

.light-theme .legal-btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.light-theme .legal-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.light-theme .legal-btn-primary {
    background: var(--primary-gradient, linear-gradient(135deg, #dc2626 0%, #b91c1c 100%));
    color: var(--on-accent, #ffffff);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb, 220, 38, 38), 0.28);
}

.light-theme .legal-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb, 220, 38, 38), 0.4);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .legal-modal-container {
        max-height: 92vh;
        border-radius: 16px;
    }
    .legal-modal-header {
        padding: 14px 16px;
    }
    .legal-brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .legal-modal-title {
        font-size: 0.95rem;
    }
    .legal-modal-subtitle {
        font-size: 0.72rem;
    }
    .legal-modal-body {
        padding: 16px;
    }
    .legal-modal-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }
    .legal-footer-info {
        justify-content: center;
    }
    .legal-footer-actions {
        width: 100%;
        display: flex;
    }
    .legal-footer-actions .legal-btn {
        flex: 1;
    }
}

/* ==========================================================================
   29 EKİM CUMHURİYET BAYRAMI ÖZEL PREMİUM TEMASI & EFEKTLERİ
   "Efendiler, yarın Cumhuriyeti ilân edeceğiz!" — Gazi Mustafa Kemal Atatürk
   ========================================================================== */

/* 29 Ekim Dalgalanan Mini Bayrak */
.republic-flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    vertical-align: middle;
    cursor: pointer;
    line-height: 1;
    position: relative;
    top: -1px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
    user-select: none;
    background: transparent;
    border: none;
    padding: 0;
}

.republic-flag-badge:hover {
    transform: scale(1.18);
    filter: drop-shadow(0 0 10px rgba(227, 10, 23, 0.8));
}

.republic-waving-flag {
    width: 24px;
    height: 20px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

/* 29 Ekim Özel Üst Şerit (Tribute Ribbon) - Doğal Akış, Kompakt Boşluk */
.republic-top-ribbon {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: 0 !important;
    border-radius: 8px;
    border: 1px solid rgba(227, 10, 23, 0.35);
    background: linear-gradient(90deg, 
        rgba(10, 10, 14, 0.95) 0%, 
        rgba(227, 10, 23, 0.20) 20%, 
        rgba(15, 15, 22, 0.95) 50%, 
        rgba(227, 10, 23, 0.20) 80%, 
        rgba(10, 10, 14, 0.95) 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 12px rgba(227, 10, 23, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace > .republic-top-ribbon {
    margin: 0 0 -4px 0 !important;
}

.republic-top-ribbon.is-hidden {
    display: none !important;
}

.republic-ribbon-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.republic-ribbon-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.republic-crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e30a17;
    color: #ffffff;
    font-size: 0.68rem;
    box-shadow: 0 0 10px rgba(227, 10, 23, 0.6);
    flex-shrink: 0;
}

.republic-quote-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.republic-quote {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 0 12px rgba(227, 10, 23, 0.4);
}

.republic-author {
    color: #f87171;
    font-size: 0.74rem;
    font-weight: 500;
    opacity: 0.9;
}

.republic-ribbon-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.republic-event-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(227, 10, 23, 0.15);
    border: 1px solid rgba(227, 10, 23, 0.35);
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 600;
}

.republic-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.republic-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Ambient Glow */
.ambient-republic-glow {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 280px;
    background: radial-gradient(circle at 100% 0%, rgba(227, 10, 23, 0.12) 0%, rgba(227, 10, 23, 0.03) 45%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* 29 Ekim Özel Modal / Pop-up Dialog */
.republic-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.republic-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.republic-modal-card {
    background: linear-gradient(145deg, #13131a 0%, #0c0c10 100%);
    border: 1px solid rgba(227, 10, 23, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(227, 10, 23, 0.22);
    border-radius: 14px;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    position: relative;
    transform: scale(0.94);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.republic-modal-backdrop.is-open .republic-modal-card {
    transform: scale(1);
}

.republic-modal-header {
    background: linear-gradient(90deg, rgba(227, 10, 23, 0.28) 0%, transparent 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(227, 10, 23, 0.2);
}

.republic-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.republic-modal-body {
    padding: 24px 22px;
    text-align: center;
}

.republic-modal-quote-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid #e30a17;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 16px 0;
    text-align: left;
}

.republic-modal-quote-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(227, 10, 23, 0.35);
}

.republic-modal-author {
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 600;
}

.republic-modal-footer {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Light Tema Uyum */
.light-theme .republic-top-ribbon {
    background: linear-gradient(90deg, #f8fafc 0%, #fee2e2 50%, #f8fafc 100%) !important;
    border: 1px solid rgba(227, 10, 23, 0.3) !important;
}

.light-theme .republic-quote {
    color: #991b1b !important;
    text-shadow: none !important;
}

.light-theme .republic-author {
    color: #b91c1c !important;
}

.light-theme .republic-event-tag {
    background: #ffffff !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}

.light-theme .republic-close-btn {
    color: #64748b !important;
}

.light-theme .republic-close-btn:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

@media (max-width: 768px) {
    .republic-ribbon-content {
        padding: 5px 10px;
    }
    .republic-author,
    .republic-event-tag {
        display: none;
    }
    .republic-quote {
        font-size: 0.74rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 78vw;
    }
}
