@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&display=swap");

:root {
    --bg-gradient: linear-gradient(135deg, #0b1120 0%, #151c2e 50%, #1a1b35 100%);
    --surface-color: #1e293b;
    --surface-hover: #1e293b;
    --surface-card: #141c2e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-color: #e5a93c;
    --primary-hover: #d49627;
    --primary-glow: rgba(229, 169, 60, 0.35);
    --primary-light: #f3c46e;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --sidebar-width: 270px;
    --bottom-nav-height: 64px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body, button, input, select, textarea {
    font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-primary);
    background-color: #0b1120;
    font-size: 11pt;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Hardware-accelerated fixed background canvas (avoids costly body background repainting on scroll) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gradient);
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-hover);
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: #0f172a !important;
    font-weight: 600;
}

/* Fingerprint Icon for Font Awesome 4 (WebAuthn / Passkey) */
.fa.fa-fingerprint,
.fa-fingerprint {
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
    vertical-align: -0.15em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8.06 6.5a.5.5 0 0 1 .5.5v.776a11.5 11.5 0 0 1-.552 3.519l-1.331 4.14a.5.5 0 0 1-.952-.305l1.33-4.141a10.5 10.5 0 0 0 .504-3.213V7a.5.5 0 0 1 .5-.5Z'/%3E%3Cpath fill='%23000' d='M6.06 7a2 2 0 1 1 4 0 .5.5 0 1 1-1 0 1 1 0 1 0-2 0v.332q0 .613-.066 1.221A.5.5 0 0 1 6 8.447q.06-.555.06-1.115zm3.509 1a.5.5 0 0 1 .487.513 11.5 11.5 0 0 1-.587 3.339l-1.266 3.8a.5.5 0 0 1-.949-.317l1.267-3.8a10.5 10.5 0 0 0 .535-3.048A.5.5 0 0 1 9.569 8m-3.356 2.115a.5.5 0 0 1 .33.626L5.24 14.939a.5.5 0 1 1-.955-.296l1.303-4.199a.5.5 0 0 1 .625-.329'/%3E%3Cpath fill='%23000' d='M4.759 5.833A3.501 3.501 0 0 1 11.559 7a.5.5 0 0 1-1 0 2.5 2.5 0 0 0-4.857-.833.5.5 0 1 1-.943-.334m.3 1.67a.5.5 0 0 1 .449.546 10.7 10.7 0 0 1-.4 2.031l-1.222 4.072a.5.5 0 1 1-.958-.287L4.15 9.793a9.7 9.7 0 0 0 .363-1.842.5.5 0 0 1 .546-.449Zm6 .647a.5.5 0 0 1 .5.5c0 1.28-.213 2.552-.632 3.762l-1.09 3.145a.5.5 0 0 1-.944-.327l1.089-3.145c.382-1.105.578-2.266.578-3.435a.5.5 0 0 1 .5-.5Z'/%3E%3Cpath fill='%23000' d='M3.902 4.222a5 5 0 0 1 5.202-2.113.5.5 0 0 1-.208.979 4 4 0 0 0-4.163 1.69.5.5 0 0 1-.831-.556m6.72-.955a.5.5 0 0 1 .705-.052A4.99 4.99 0 0 1 13.059 7v1.5a.5.5 0 1 1-1 0V7a3.99 3.99 0 0 0-1.386-3.028.5.5 0 0 1-.051-.705M3.68 5.842a.5.5 0 0 1 .422.568c-.044.289-.044.59 0 .71-.1 1.417-.298 2.1l-1.14 3.923a.5.5 0 1 1-.96-.279L2.8 8.82A11 11 0 0 0 3.1 6.6c0-.44.062-.876.518-.418Z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8.06 6.5a.5.5 0 0 1 .5.5v.776a11.5 11.5 0 0 1-.552 3.519l-1.331 4.14a.5.5 0 0 1-.952-.305l1.33-4.141a10.5 10.5 0 0 0 .504-3.213V7a.5.5 0 0 1 .5-.5Z'/%3E%3Cpath fill='%23000' d='M6.06 7a2 2 0 1 1 4 0 .5.5 0 1 1-1 0 1 1 0 1 0-2 0v.332q0 .613-.066 1.221A.5.5 0 0 1 6 8.447q.06-.555.06-1.115zm3.509 1a.5.5 0 0 1 .487.513 11.5 11.5 0 0 1-.587 3.339l-1.266 3.8a.5.5 0 0 1-.949-.317l1.267-3.8a10.5 10.5 0 0 0 .535-3.048A.5.5 0 0 1 9.569 8m-3.356 2.115a.5.5 0 0 1 .33.626L5.24 14.939a.5.5 0 1 1-.955-.296l1.303-4.199a.5.5 0 0 1 .625-.329'/%3E%3Cpath fill='%23000' d='M4.759 5.833A3.501 3.501 0 0 1 11.559 7a.5.5 0 0 1-1 0 2.5 2.5 0 0 0-4.857-.833.5.5 0 1 1-.943-.334m.3 1.67a.5.5 0 0 1 .449.546 10.7 10.7 0 0 1-.4 2.031l-1.222 4.072a.5.5 0 1 1-.958-.287L4.15 9.793a9.7 9.7 0 0 0 .363-1.842.5.5 0 0 1 .546-.449Zm6 .647a.5.5 0 0 1 .5.5c0 1.28-.213 2.552-.632 3.762l-1.09 3.145a.5.5 0 0 1-.944-.327l1.089-3.145c.382-1.105.578-2.266.578-3.435a.5.5 0 0 1 .5-.5Z'/%3E%3Cpath fill='%23000' d='M3.902 4.222a5 5 0 0 1 5.202-2.113.5.5 0 0 1-.208.979 4 4 0 0 0-4.163 1.69.5.5 0 0 1-.831-.556m6.72-.955a.5.5 0 0 1 .705-.052A4.99 4.99 0 0 1 13.059 7v1.5a.5.5 0 1 1-1 0V7a3.99 3.99 0 0 0-1.386-3.028.5.5 0 0 1-.051-.705M3.68 5.842a.5.5 0 0 1 .422.568c-.044.289-.044.59 0 .71-.1 1.417-.298 2.1l-1.14 3.923a.5.5 0 1 1-.96-.279L2.8 8.82A11 11 0 0 0 3.1 6.6c0-.44.062-.876.518-.418Z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.fa.fa-fingerprint::before,
.fa-fingerprint::before {
    content: "" !important;
    display: none !important;
}

/* ==========================================================================
   App Shell Layout (Desktop Split & Mobile Responsive)
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Desktop Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 18px;
    background: #0d1527;
    border-right: 1px solid var(--border-color);
    z-index: 1020;
    transform: translateZ(0);
    contain: layout style paint;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-header {
    padding: 10px 8px 18px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}
.brand-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.brand-logo {
    height: 48px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(229, 169, 60, 0.35));
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-name {
    font-size: 16pt;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
    text-align: center;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar-nav-item .nav-icon {
    font-size: 18px;
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.sidebar-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}
.sidebar-nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.sidebar-nav-item.active {
    background: rgba(229, 169, 60, 0.15);
    color: #f3c46e;
    font-weight: 600;
    border: 1px solid rgba(229, 169, 60, 0.3);
}

.active-indicator {
    position: absolute;
    right: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e5a93c;
    box-shadow: 0 0 10px #e5a93c;
}

/* Sidebar Add Button */
.sidebar-btn-add {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e5a93c 0%, #c8871b 100%);
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
    border: none;
    box-shadow: 0 4px 16px var(--primary-glow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.sidebar-btn-add:hover {
    background: linear-gradient(135deg, #f0b54c 0%, #d49627 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
    color: #0f172a;
}
.sidebar-btn-add:active {
    transform: translateY(0);
}

/* Sidebar Bottom & User Card */
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.2s;
}
.sidebar-user-card:hover {
    border-color: var(--border-hover);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(229, 169, 60, 0.18);
    color: #f3c46e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.sidebar-logout-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* App Main Content Area */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 32px 36px 70px;
    width: 100%;
}

.profile-content {
    width: 100%;
}

/* Hide Mobile Elements on Desktop by Default */
.mobile-top-header,
.mobile-bottom-nav {
    display: none;
}

/* ==========================================================================
   Mobile Responsive Layout (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .app-sidebar {
        display: none !important;
    }

    .app-layout {
        flex-direction: column;
    }

    .app-main {
        padding: 18px 16px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px) + 24px);
    }

    /* Mobile Top Header */
    .mobile-top-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 58px;
        padding: 0 16px;
        background: rgba(14, 22, 38, 0.96);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 1030;
        transform: translateZ(0);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--text-primary);
        font-weight: 700;
        font-size: 17px;
    }
    .mobile-brand .brand-logo {
        height: 28px;
        max-width: 120px;
        width: auto;
        object-fit: contain;
    }

    .mobile-user-link {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--text-secondary);
        font-size: 13px;
        text-decoration: none;
    }
    .mobile-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(229, 169, 60, 0.18);
        color: #f3c46e;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
    }
    .mobile-user-name {
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile iOS-Style Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(14, 22, 38, 0.96);
        border-top: 1px solid var(--border-color);
        z-index: 1040;
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.35);
        transform: translateZ(0);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        transition: all 0.2s;
    }
    .bottom-nav-item .bottom-icon {
        font-size: 19px;
        margin-bottom: 2px;
        transition: transform 0.2s;
    }
    .bottom-nav-item:hover, .bottom-nav-item:active {
        color: var(--text-primary);
    }
    .bottom-nav-item.active {
        color: #f3c46e;
        font-weight: 600;
    }
    .bottom-nav-item.active .bottom-icon {
        transform: scale(1.1);
    }

    /* Floating Center Add Button */
    .bottom-nav-add-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        position: relative;
    }
    .bottom-nav-add-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #e5a93c 0%, #c8871b 100%);
        color: #0f172a;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        border: 3px solid #0f172a;
        box-shadow: 0 4px 18px var(--primary-glow);
        margin-top: -24px;
        transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        cursor: pointer;
    }
    .bottom-nav-add-btn:active {
        transform: scale(0.92);
    }
    .dropdown-menu-center {
        left: 50% !important;
        transform: translateX(-50%) !important;
        min-width: 200px;
    }
}

/* ==========================================================================
   Design System Components (Cards, Buttons, Modals, Inputs, Alerts)
   ========================================================================== */

/* Cards & Containers */
.card, .modal-content {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: border-color 0.2s;
    contain: style;
}
.card:hover {
    border-color: var(--border-hover) !important;
}

.card-header {
    background: rgba(0, 0, 0, 0.22) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 16px 22px;
    font-weight: 600;
    font-size: 16px;
    border-radius: 16px 16px 0 0 !important;
}
.card-body {
    padding: 22px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 22px;
}
.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 14px 22px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #e5a93c 0%, #c8871b 100%);
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(229, 169, 60, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #f0b54c 0%, #d49627 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(229, 169, 60, 0.45);
    color: #0f172a;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(16, 185, 129, 0.45);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(239, 68, 68, 0.45);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #111827;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    color: #111827;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* Form Controls */
.form-control, .form-select {
    background-color: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(229, 169, 60, 0.25) !important;
}

/* Dropdown Menus */
.dropdown-menu {
    background: var(--surface-hover) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    padding: 6px;
}
.dropdown-item {
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Alerts */
.alert {
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 16px 20px;
}
.alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.25);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.25);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
}
.alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.25);
}

/* Auth Containers (Login, Register, Forgot Password) */
.auth-container {
    max-width: 440px;
    margin: 50px auto;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 34px 30px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Authenticator Code Item (Card Layout & View Modes)
   ========================================================================== */

.code-list {
    margin-top: 20px;
    width: 100%;
}

/* List View (1 Column) */
.code-list.view-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.code-list.view-list .code-container {
    width: 100%;
}

/* Grid View (Responsive: 1 col on mobile, 2 cols on medium/laptop, 3 cols on large screens) */
.code-list.view-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 769px) {
    .code-list.view-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1360px) {
    .code-list.view-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.code-container {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 22px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
    min-width: 0;
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 0 95px;
    transform: translateZ(0);
}
.code-container:hover, .code-container:focus-within {
    transform: translateY(-2px) translateZ(0);
    background: var(--surface-hover);
    border-color: rgba(229, 169, 60, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 10;
}

.code-container-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.code-container-left h2 {
    font-size: clamp(20pt, 2.2vw, 28pt);
    font-weight: 800;
    margin: 0;
    letter-spacing: 4px;
    color: #f3c46e;
    text-shadow: 0 0 8px rgba(229, 169, 60, 0.25);
    cursor: pointer;
    transition: color 0.2s;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.code-container-left h2:hover {
    color: var(--text-primary);
}

.code-container-left p {
    margin: 6px 0 0 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-container-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Newly added card highlight animation */
@keyframes codeAddedPulse {
    0% {
        box-shadow: 0 0 0 4px rgba(229, 169, 60, 0.8), 0 10px 30px rgba(0, 0, 0, 0.4);
        border-color: #e5a93c;
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.6), 0 10px 30px rgba(0, 0, 0, 0.4);
        border-color: #10b981;
    }
    100% {
        box-shadow: none;
        border-color: var(--border-color);
        transform: scale(1);
    }
}
.card-just-added {
    animation: codeAddedPulse 2.2s ease-out;
}

/* View Mode Buttons */
.view-toggle-btn {
    padding: 6px 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}
.view-toggle-btn.active {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #0f172a !important;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* Privacy Mode (Blur & Mask sensitive info for screenshots) */
body.privacy-mode .code-container-left h2 {
    filter: blur(10px);
    user-select: none;
    opacity: 0.45;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

body.privacy-mode .code-container-left p {
    filter: blur(7px);
    user-select: none;
    opacity: 0.45;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

body.privacy-mode .user-name,
body.privacy-mode .mobile-user-name {
    filter: blur(6px);
    user-select: none;
    opacity: 0.45;
}

#btnTogglePrivacy.active {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: #f59e0b !important;
    color: #fde68a !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

#privacyBanner {
    display: none !important;
}

body.privacy-mode #privacyBanner {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.code-menu-button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}
.code-menu-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.circle-progress-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    margin-top: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: radial-gradient(closest-side, #151c2e 65%, transparent 80% 100%), conic-gradient(var(--primary-color) 0%, #334155 0);
    box-shadow: 0 0 10px rgba(0,0,0,0.5) inset;
    color: #fcd34d;
}

/* Spinner */
.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}
.lds-ellipsis div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) { left: 8px; animation: lds-ellipsis1 0.6s infinite; }
.lds-ellipsis div:nth-child(2) { left: 8px; animation: lds-ellipsis2 0.6s infinite; }
.lds-ellipsis div:nth-child(3) { left: 32px; animation: lds-ellipsis2 0.6s infinite; }
.lds-ellipsis div:nth-child(4) { left: 56px; animation: lds-ellipsis3 0.6s infinite; }
@keyframes lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes lds-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } }