@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #25d366;
    --primary-green-dark: #128c7e;
    --bg-black: #000000;
    --bg-dark: #0d0d0d;
    --bg-darker: #1a1a1a;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e8e;
    --border-color: #2a2a2a;
    --hover-bg: #252525;
    --tabbar-height: 30px;
    --danger: #ff4d4d;
    --danger-hover: #cc0000;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-black);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* ─── Premium Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ─── Splash / Preloader ─────────────────────────────────────────────────────── */
.splash-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: splashIn 0.5s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes splashIn {
    from {
        opacity: 0;
        transform: scale(0.88);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.splash-logo-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(37, 211, 102, 0.45));
}

/* Spinning green ring around the logo */
.splash-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: var(--primary-green);
    border-right-color: rgba(37, 211, 102, 0.3);
    animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
    to {
        transform: rotate(360deg);
    }
}

.splash-wordmark {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #fff 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Login Screen ──────────────────────────────────────────────────────────── */

.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #0a1f0f 0%, #000000 60%);
    z-index: 9999;
}

.login-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 48px 40px 36px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(37, 211, 102, 0.07);
    animation: slideUp 0.5s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    margin-bottom: 18px;
}

.login-logo img {
    height: 72px;
    filter: drop-shadow(0 0 20px rgba(37, 211, 102, 0.35));
}

.login-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
    text-align: left;
}

.login-feature {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}

.feature-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.google-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 24px;
    background: #fff;
    color: #1f1f1f;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
}

.google-signin-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.auth-error-msg {
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: #ff6b6b;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.login-terms {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.terms-link {
    color: var(--primary-green);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}




.user-dropdown-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-avatar-lg {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    word-break: break-all;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
}

/* ─── Main Container ─────────────────────────────────────────────────────────── */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ─── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-black);
    text-align: center;
    padding: 20px;
}

.empty-content {
    max-width: 400px;
    animation: fadeIn 0.4s ease-out;
}

.empty-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary-green);
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #1db954;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 11px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: #444;
}

/* ─── Profiles Container ─────────────────────────────────────────────────────── */
.profiles-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.webview-container {
    flex: 1;
    position: relative;
    background: var(--bg-black);
    height: 100%;
}

.webview-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    border: none;
}

.webview-container iframe.active {
    display: block;
}

/* ─── Tab Bar ─────────────────────────────────────────────────────────────────── */
.tab-bar {
    height: var(--tabbar-height);
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    overflow: visible;
    /* allow dropdown to overflow upward */
    padding: 0 0 0 6px;
    flex-shrink: 0;
    position: relative;
}

.tabs-wrapper {
    display: flex;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-end;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.tabs-wrapper::-webkit-scrollbar {
    height: 3px;
}

.tabs-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.tabs-container {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 100%;
}

.tab {
    min-width: 140px;
    max-width: 220px;
    height: 100%;
    background: var(--bg-dark);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px 0 16px;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    margin-right: -10px;
    transition: all var(--transition);
}

.tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary-green);
    color: #000;
    z-index: 10;
}

.tab-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-badge {
    color: #ff4444;
    font-size: 10px;
    font-weight: 700;
    display: none;
    flex-shrink: 0;
}

.tab-badge.show {
    display: inline;
}

.tab.active .tab-badge {
    color: #000;
}

.tab-settings {
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity var(--transition);
    flex-shrink: 0;
    color: inherit;
}

.tab:hover .tab-settings {
    opacity: 0.6;
}

.tab-settings:hover {
    opacity: 1 !important;
}

.close-tab {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition);
    padding: 1px;
    border-radius: 3px;
}

.tab:hover .close-tab {
    opacity: 0.6;
}

.close-tab:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.2);
}

.tab.active .close-tab:hover {
    background: rgba(0, 0, 0, 0.15);
}

.add-tab {
    min-width: 50px;
    height: 100%;
    background: var(--bg-dark);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%);
    margin-left: 2px;
    transition: all var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 1px;
}

.add-tab:hover {
    background: var(--hover-bg);
    color: var(--primary-green);
}

/* ─── Tabbar User Profile (right side of tab bar) ───────────────────────────── */
.tabbar-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px 0 10px;
    height: 100%;
    cursor: pointer;
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: background var(--transition);
    user-select: none;
}

.tabbar-user:hover {
    background: var(--hover-bg);
}

.tabbar-user .user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.tabbar-user .user-name-display {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabbar-user:hover .user-name-display {
    color: var(--text-primary);
}

.tabbar-user .chevron-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.tabbar-user:hover .chevron-icon {
    transform: rotate(180deg);
}

/* User Dropdown — opens UPWARD from the tab bar */
.user-dropdown {
    position: absolute;
    bottom: calc(var(--tabbar-height) + 6px);
    right: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 250px;
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 500;
    overflow: hidden;
    animation: dropdownUp 0.15s ease;
}

.user-dropdown.show {
    display: block;
}

@keyframes dropdownUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Dialogs ─────────────────────────────────────────────────────────────────── */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-overlay.show,
.terms-overlay[style*="flex"] {
    display: flex;
}

.dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: dialogIn 0.2s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes dialogIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.terms-dialog {
    max-width: 600px;
}

.dialog-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialog-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.dialog-content {
    padding: 22px;
}

.terms-scrollable {
    max-height: 380px;
    overflow-y: auto;
    padding: 22px;
    line-height: 1.65;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.terms-scrollable h3 {
    margin: 18px 0 8px;
    color: var(--primary-green);
    font-size: 14px;
    font-weight: 600;
}

.terms-scrollable p,
.terms-scrollable ul {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.terms-scrollable ul {
    margin-left: 18px;
}

.terms-scrollable li {
    margin-bottom: 8px;
}

.terms-scrollable strong {
    color: var(--text-primary);
}

.dialog-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus {
    border-color: var(--primary-green);
    background: rgba(37, 211, 102, 0.04);
}

.input-hint {
    font-size: 12px;
    color: #555;
    margin-top: 5px;
    display: block;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 8px;
    display: none;
    padding: 8px 12px;
    background: rgba(255, 77, 77, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.dialog-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.dialog-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* ─── Toast ────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(.16, 1, .3, 1);
    z-index: 999999;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.3);
    color: #ff6b6b;
}

/* ─── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Profile Settings Modal  (Discord-style two-column layout)
   ═══════════════════════════════════════════════════════════════════════════════ */
#profile-settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

#profile-settings-overlay.show {
    display: flex;
}

.ps-modal {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    display: flex;
    width: min(860px, 96vw);
    height: min(580px, 90vh);
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    animation: psSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes psSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Close button ─────────────────────────────────────────────────── */
.ps-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
}

.ps-close:hover {
    background: #2a2a2a;
    color: #ccc;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.ps-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #111;
    border-right: 1px solid #242424;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ps-sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid #1e1e1e;
}

.ps-user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-user-mini img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2a2a2a;
    flex-shrink: 0;
}

.ps-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-user-email {
    font-size: 11px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-nav {
    padding: 8px;
    flex: 1;
}

.ps-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    margin-bottom: 2px;
}

.ps-nav-item:hover {
    background: #1e1e1e;
    color: #ccc;
}

.ps-nav-item.active {
    background: rgba(37, 211, 102, 0.12);
    color: #25d366;
}

.ps-nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.ps-nav-item.active svg {
    opacity: 1;
}

/* ── Content panel ────────────────────────────────────────────────── */
.ps-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 28px;
}

.ps-section {
    display: none;
}

.ps-section.active {
    display: block;
    animation: fadeIn 0.18s ease;
}

.ps-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0 0 6px;
}

.ps-section-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 22px;
    line-height: 1.5;
}

/* ── Google row (profile picture + readonly info) ─────────────────── */
.ps-google-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #141414;
    border: 1px solid #242424;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
}

.ps-google-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2a2a2a;
    flex-shrink: 0;
}

.ps-google-name {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
    margin-bottom: 2px;
}

.ps-google-email {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.ps-google-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    color: #888;
    font-weight: 500;
}

/* ── Fields ───────────────────────────────────────────────────────── */
.ps-field-group {
    margin-bottom: 16px;
}

.ps-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.ps-optional {
    font-weight: 400;
    text-transform: none;
    color: #555;
    letter-spacing: 0;
}

.ps-input {
    width: 100%;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #e0e0e0;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.ps-input:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.12);
}

.ps-input::placeholder {
    color: #444;
}

/* ── Preferences card ─────────────────────────────────────────────── */
.ps-card {
    background: #141414;
    border: 1px solid #252525;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.ps-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.ps-card-label {
    font-size: 14px;
    color: #ddd;
    font-weight: 500;
    margin-bottom: 3px;
}

.ps-card-sub {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.ps-select {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    min-width: 140px;
    transition: border-color 0.15s;
}

.ps-select:focus {
    border-color: #25d366;
}

.ps-select option {
    background: #1e1e1e;
}

/* ── Error / Actions ──────────────────────────────────────────────── */
.ps-error {
    font-size: 12px;
    color: #ff6b6b;
    min-height: 18px;
    margin-bottom: 8px;
}

.ps-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.ps-btn-primary {
    background: #25d366;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.ps-btn-primary:hover {
    background: #1db954;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.ps-btn-primary:active {
    transform: scale(0.97);
}

.ps-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ps-btn-danger {
    background: transparent;
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ps-btn-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.5);
}

.ps-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Sessions list ────────────────────────────────────────────────── */
.ps-sessions-actions {
    margin-bottom: 16px;
}

.ps-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-loading {
    font-size: 13px;
    color: #555;
    padding: 12px 0;
}

.ps-session-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #141414;
    border: 1px solid #242424;
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.15s;
}

.ps-session-item.current {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.04);
}

.ps-session-icon {
    width: 32px;
    height: 32px;
    background: #1e1e1e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    flex-shrink: 0;
}

.ps-session-item.current .ps-session-icon {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.ps-session-info {
    flex: 1;
    min-width: 0;
}

.ps-session-browser {
    font-size: 13px;
    font-weight: 600;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.ps-current-badge {
    font-size: 10px;
    font-weight: 600;
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.02em;
}

.ps-session-meta {
    font-size: 11px;
    color: #555;
    margin-bottom: 2px;
}

.ps-session-time {
    font-size: 11px;
    color: #444;
}

.ps-session-revoke {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 7px;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ps-session-revoke:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.ps-session-revoke:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Current-session Sign Out button (text + icon, danger-tinted) */
.ps-session-signout-self {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.28);
    border-radius: 7px;
    color: #e06060;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ps-session-signout-self:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

.ps-session-signout-self:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Scrollbar ────────────────────────────────────────────────────── */
.ps-content::-webkit-scrollbar,
.ps-sidebar::-webkit-scrollbar {
    width: 4px;
}

.ps-content::-webkit-scrollbar-thumb,
.ps-sidebar::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

/* ─── Account Settings Sheet ─────────────────────────────────────────────────── */
.acct-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.acct-settings-overlay.show {
    opacity: 1;
}

.acct-settings-sheet {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 380px;
    max-width: calc(100vw - 32px);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.acct-settings-overlay.show .acct-settings-sheet {
    transform: translateY(0) scale(1);
}

.acct-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-color);
}

.acct-settings-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.acct-settings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    line-height: 1;
}

.acct-settings-close:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.acct-settings-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Input */
.acct-s-field-group {
    margin-bottom: 20px;
}

.acct-s-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.acct-s-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.acct-s-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

/* Section titles */
.acct-s-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

/* Toggle rows */
.acct-s-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.acct-s-toggle-row:last-of-type {
    border-bottom: none;
    margin-bottom: 6px;
}

.acct-s-toggle-info {
    flex: 1;
}

.acct-s-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.acct-s-toggle-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* iOS-style toggle switch */
.acct-s-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 12px;
}

.acct-s-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.acct-s-slider {
    position: absolute;
    inset: 0;
    background: #333;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.acct-s-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.acct-s-switch input:checked+.acct-s-slider {
    background: var(--primary-green);
}

.acct-s-switch input:checked+.acct-s-slider::before {
    transform: translateX(18px);
}

/* Error */
.acct-s-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
    margin-bottom: 4px;
}

/* Actions */
.acct-s-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.acct-s-btn-cancel {
    padding: 9px 18px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}

.acct-s-btn-cancel:hover {
    color: var(--text-primary);
    border-color: #555;
}

.acct-s-btn-save {
    padding: 9px 22px;
    background: var(--primary-green);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
}

.acct-s-btn-save:hover {
    opacity: 0.85;
}

.acct-s-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Iframe loading progress bar ────────────────────────────────────────────── */
.iframe-progress-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.iframe-progress-wrap.active {
    opacity: 1;
}

.iframe-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-green), #00e676);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.6);
}

/* ─── Refresh button in Account Settings dialog ───────────────────────────────── */
.acct-s-actions {
    display: flex;
    align-items: center;
    margin-top: 12px;
}

.acct-s-btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    flex-shrink: 0;
}

.acct-s-btn-refresh:hover {
    color: var(--text-primary);
    border-color: #555;
    background: var(--hover-bg);
}

.acct-s-btn-refresh svg {
    flex-shrink: 0;
}