
/* ── User settings & admin panel ── */
.settings-group {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.settings-group-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.settings-row:last-child { border-bottom: none; }

.settings-select,
.settings-input {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    min-width: 140px;
}

.settings-input { flex: 1; min-width: 0; width: 100%; }

.settings-key-row {
    flex-direction: column;
    align-items: stretch;
}

.settings-key-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.settings-key-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}

.settings-toggle input[type="checkbox"] {
    width: 44px;
    height: 26px;
    accent-color: var(--accent);
    cursor: pointer;
}

.settings-save-note {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.btn-settings-link {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: center;
}

.btn-settings-link:hover { color: var(--text-primary); border-color: var(--border-light); }

/* Admin floating panel */
.admin-fab {
    position: fixed;
    bottom: calc(var(--tabbar-h) + 12px);
    right: 16px;
    z-index: 200;
    background: linear-gradient(180deg, #f0f0f0, #c8c8c8);
    color: #111;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

@media (min-width: 769px) {
    .admin-fab { bottom: 24px; }
}

.admin-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

.admin-panel-overlay.open { display: flex; }

.admin-panel-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 92dvh;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px 20px 0 0;
    padding: 20px 18px 28px;
    animation: sheetUp 0.28s ease;
}

@media (min-width: 769px) {
    .admin-panel-overlay { align-items: center; padding: 24px; }
    .admin-panel-sheet { border-radius: 16px; max-height: 85vh; }
}

@keyframes sheetUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-panel-head h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 2px;
    margin: 0;
}

.admin-panel-badge {
    display: inline-block;
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.12);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.admin-panel-intro {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.admin-demo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-demo-clear {
    color: #e57373;
}

.sidebar-suggest-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-suggest-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-suggest-text {
    min-width: 0;
}

.sidebar-suggest-text strong,
.sidebar-suggest-text span {
    display: block;
}

.mobile-header-btn.settings-btn {
    font-size: 1.1rem;
}

.maintenance-banner {
    background: #3a2a00;
    border-bottom: 1px solid rgba(255,200,80,0.25);
    color: #ffd080;
    padding: 10px 16px;
    font-size: 0.78rem;
    text-align: center;
    flex-shrink: 0;
}

/* Theme: light mode */
html[data-theme="light"] {
    --bg-deep: #f4f4f4;
    --bg-surface: #ffffff;
    --bg-elevated: #fafafa;
    --bg-hover: #eeeeee;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.14);
    --text-primary: #111111;
    --text-secondary: #444444;
    --text-muted: #777777;
    --accent: #222222;
    --link-color: #0a66c2;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --app-bg: #ffffff;
    --shell-bg: #ffffff;
    --chrome-bg: rgba(255, 255, 255, 0.92);
    --sticky-head-bg: rgba(255, 255, 255, 0.92);
    --post-bg: #ffffff;
    --post-bg-mobile: #ffffff;
    --hover-surface: rgba(0, 0, 0, 0.05);
    --hover-surface-strong: rgba(0, 0, 0, 0.08);
    --input-bg: rgba(0, 0, 0, 0.04);
    --overlay-scrim: rgba(0, 0, 0, 0.45);
    --toast-bg: rgba(255, 255, 255, 0.98);
    --search-panel-bg: #ffffff;
    --search-btn-bg: #111111;
    --search-btn-text: #ffffff;
    --badge-fill: #111111;
    --badge-ink: #ffffff;
    --badge-glow: rgba(0, 0, 0, 0.2);
    --notif-active-color: #111111;
    --btn-primary-bg: linear-gradient(180deg, #222222, #111111);
    --btn-primary-text: #ffffff;
    --btn-accent: #0a66c2;
    --btn-accent-text: #ffffff;
    --nav-active-bg: linear-gradient(180deg, #222222, #111111);
    --nav-active-text: #ffffff;
    --section-divider: #e8e8e8;
    --skeleton-a: #e8e8e8;
    --skeleton-b: #f4f4f4;
    --avatar-ph-bg: linear-gradient(135deg, #dddddd, #bbbbbb);
    --avatar-ph-text: #111111;
    --dropdown-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --editor-stage-bg: #ececec;
    --editor-viewport-bg: #f5f5f5;
    --editor-border: rgba(0, 0, 0, 0.12);
    --unread-pill-bg: #0a66c2;
    --unread-pill-text: #ffffff;
}

html[data-theme="light"] body {
    background: #f0f0f0;
    background-image: none;
    color: var(--text-primary);
}

html[data-theme="light"] .hub-topbar,
html[data-theme="light"] .mobile-app-header,
html[data-theme="light"] .hub-tabbar,
html[data-theme="light"] .app-shell,
html[data-theme="light"] #auth-boot {
    background: var(--shell-bg);
}

html[data-theme="light"] .socials-post,
html[data-theme="light"] .socials-composer,
html[data-theme="light"] .feed-scope-tabs,
html[data-theme="light"] .notif-panel {
    background: var(--post-bg);
}

html[data-theme="light"] .login-card,
html[data-theme="light"] .hub-modal,
html[data-theme="light"] .settings-group,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .membership-plan,
html[data-theme="light"] .admin-panel-sheet,
html[data-theme="light"] .sidebar-widget,
html[data-theme="light"] .tag-post-chip,
html[data-theme="light"] .chat-new-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .feed-card,
html[data-theme="light"] .app-tile,
html[data-theme="light"] .membership-active-banner {
    background: #fafafa;
}

html[data-theme="light"] .login-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.98));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .login-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

html[data-theme="light"] .btn-oauth {
    background: var(--input-bg);
    border-color: var(--border-light);
    color: var(--text-primary);
}

html[data-theme="light"] .btn-oauth:hover {
    background: var(--hover-surface);
}

html[data-theme="light"] .upload-dropzone {
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .upload-dropzone.dragover {
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .apps-mode-note,
html[data-theme="light"] .membership-status.pitch {
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .plan-perks li {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .hub-toast-error {
    color: #b91c1c;
}

html[data-theme="light"] .socials-post-menu-item:hover,
html[data-theme="light"] .tag-post-result:hover,
html[data-theme="light"] .notif-item:hover,
html[data-theme="light"] .notif-item-row:hover .notif-item {
    background: var(--hover-surface);
}

html[data-theme="light"] .notif-item-row.unread {
    background: rgba(10, 102, 194, 0.1);
    border-left-color: #0a66c2;
}

html[data-theme="light"] .socials-composer-tool:hover:not(.is-disabled) {
    background: var(--hover-surface);
}

html[data-theme="light"] .socials-tab.active,
html[data-theme="light"] .feed-scope-tab.active {
    color: var(--text-primary);
}

html[data-theme="light"] .socials-post-avatar-placeholder,
html[data-theme="light"] .socials-composer-avatar-placeholder,
html[data-theme="light"] .socials-profile-avatar-placeholder,
html[data-theme="light"] .reels-author-avatar-ph {
    background: var(--avatar-ph-bg);
    color: var(--avatar-ph-text);
}

html[data-theme="light"] .socials-post-text-only {
    background: var(--post-bg);
    color: var(--text-primary);
}

html[data-theme="light"] .x-profile-avatar,
html[data-theme="light"] .x-profile-avatar-placeholder,
html[data-theme="light"] .x-profile-avatar-cam {
    border-color: var(--shell-bg);
}

html[data-theme="light"] .sidebar-post-btn {
    background: var(--text-primary);
    color: var(--app-bg);
}

html[data-theme="light"] .profile-skeleton-avatar {
    border-color: var(--shell-bg);
}

html[data-theme="light"] .comment-reply-bar {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-primary);
}

html[data-theme="light"] .hub-modal-overlay,
html[data-theme="light"] .admin-panel-overlay,
html[data-theme="light"] .chat-new-overlay,
html[data-theme="light"] .username-setup-overlay {
    background: var(--overlay-scrim);
}

html[data-theme="light"] .progress-track {
    background: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .progress-fill {
    background: linear-gradient(90deg, #888888, #333333);
}

html[data-theme="light"] .admin-panel-badge {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

html[data-theme="light"] .profile-meta.premium {
    color: var(--text-secondary);
}

html[data-theme="light"] .socials-hashtag-preview .socials-hashtag {
    background: rgba(10, 102, 194, 0.1);
}

/* Reels keep white overlay text on video — intentional */
html[data-theme="light"] .reels-viewer {
    background: #000000;
}

html[data-theme="light"] .reels-slide {
    background: #000000;
}

html[data-theme="light"] .socials-post-media,
html[data-theme="light"] .feed-media {
    background: #0a0a0a;
}

html[data-theme="light"] .socials-grid-cell {
    background: #eeeeee;
}

/* Font sizes */
html[data-font="small"] { font-size: 14px; }
html[data-font="medium"] { font-size: 16px; }
html[data-font="large"] { font-size: 18px; }

/* Compact feed */
html[data-compact="true"] .socials-post-media { aspect-ratio: 4/5; max-height: 55vh; }
html[data-compact="true"] .socials-post-head,
html[data-compact="true"] .socials-post-actions { padding-top: 6px; padding-bottom: 6px; }

/* Reduce motion */
html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Hide like counts */
html[data-show-likes="false"] .socials-action .action-count,
html[data-show-likes="false"] .reels-action-count { display: none; }

.comment-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 16px 0;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
