/* Xmark - Dashboard Styles */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #222222;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-blue: #f5f5f5;
    --accent-blue-hover: #ffffff;
    --accent-pink: #f91880;
    --accent-green: #00ba7c;
    --accent-orange: #ff7a00;
    --accent-purple: #7856ff;
    --surface-active: rgba(255, 255, 255, 0.1);
    --surface-active-strong: rgba(255, 255, 255, 0.16);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --focus-ring: rgba(255, 255, 255, 0.14);
    --cta-bg: #f5f5f5;
    --cta-bg-strong: #ffffff;
    --cta-text: #111111;
    --shadow-tint: rgba(255, 255, 255, 0.2);
    --border-color: #27272a;
    --border-hover: #3f3f46;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

body.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --bg-hover: #ececec;
    --text-primary: #111827;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    --accent-blue: #111827;
    --accent-blue-hover: #000000;
    --surface-active: rgba(17, 24, 39, 0.1);
    --surface-active-strong: rgba(17, 24, 39, 0.16);
    --surface-soft: rgba(17, 24, 39, 0.05);
    --focus-ring: rgba(17, 24, 39, 0.16);
    --cta-bg: #111827;
    --cta-bg-strong: #000000;
    --cta-text: #ffffff;
    --shadow-tint: rgba(17, 24, 39, 0.3);
    --border-color: #e4e4e7;
    --border-hover: #d4d4d8;
    --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.08);
    --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.12);
    --shadow-lg: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent-blue);
}

/* User Profile */
.user-profile {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.user-logged-in {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

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

.user-handle {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title span {
    flex: 1;
}

.folder-refresh-btn,
.folder-add-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-refresh-btn:hover,
.folder-add-btn:hover {
    color: var(--accent-blue);
    background: var(--bg-hover);
}

.folder-refresh-btn.syncing svg {
    animation: spin 1s linear infinite;
}

.xmark-sync-btn {
    transition: transform 0.2s ease;
}

.xmark-sync-btn:hover {
    transform: scale(1.02);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--surface-active);
    color: var(--accent-blue);
}

.nav-badge {
    margin-left: auto;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.nav-item.active .nav-badge {
    background: var(--surface-active-strong);
    color: var(--accent-blue);
}

.folders-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 300px;
    overflow-y: auto;
}

.sync-status-card {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
}

.sync-status-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sync-status-meta {
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 2px;
}

.sync-status-sub {
    color: var(--text-muted);
}

.content-schedule-status-card.tone-success {
    border-left-color: #22c55e;
}

.content-schedule-status-card.tone-warn {
    border-left-color: #f59e0b;
}

.content-schedule-status-card.tone-danger {
    border-left-color: #ef4444;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.folder-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.folder-item.active {
    background: var(--surface-active);
    color: var(--accent-blue);
}

.folder-collapse-trigger {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.folder-collapse-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
}

.folder-item.ai-recommendations-folder {
    color: #a78bfa;
}

.folder-item.ai-recommendations-folder.active {
    background: rgba(139, 92, 246, 0.14);
    color: #c4b5fd;
}

.folder-entry.ai-recommendations-subentry {
    margin-left: 10px;
}

.folder-item.ai-recommendations-subfolder {
    color: var(--text-secondary);
    padding-left: 18px;
}

.folder-item.ai-recommendations-subfolder .folder-name {
    font-size: 13px;
}

.folder-entry {
    position: relative;
}

.folder-drag {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.5;
    cursor: grab;
}

.folder-icon {
    flex-shrink: 0;
    color: inherit;
}

.folder-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.folder-count {
    color: var(--text-muted);
    font-size: 13px;
    min-width: 30px;
    text-align: right;
}

.folder-share-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.18;
    transition: var(--transition);
}

.folder-item:hover .folder-share-trigger,
.folder-item.active .folder-share-trigger,
.folder-share-trigger.has-share,
.folder-share-trigger.active {
    opacity: 1;
}

.folder-share-trigger.has-share {
    color: var(--accent-green);
}

.folder-share-trigger:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.folder-share-trigger.active {
    background: var(--surface-active);
    border-color: var(--border-hover);
    color: var(--accent-blue);
}

.folder-share-inline-wrap {
    margin: 4px 0 10px 34px;
}

.add-folder-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.add-folder-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: var(--surface-soft);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.sync-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--cta-bg) 0%, var(--cta-bg-strong) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--cta-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sync-btn:hover {
    background: linear-gradient(135deg, var(--cta-bg-strong) 0%, var(--cta-bg-strong) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-tint);
}

.sync-btn.syncing svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    min-height: var(--topbar-height);
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-nav-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.top-nav-tabs::-webkit-scrollbar {
    display: none;
}

.search-container {
    flex: 0 1 360px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-container svg {
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.dashboard-language-picker {
    min-width: 118px;
}

.language-picker {
    display: inline-flex;
    align-items: center;
}

.language-select {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.top-bar-actions .search-container {
    flex: 0 1 340px;
}

.top-module-tab {
    min-width: 140px;
    justify-content: space-between;
    border-radius: 12px;
    font-size: 16px;
    padding: 10px 14px;
}

.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
    overflow-x: auto;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.view-label {
    font-size: 12px;
    font-weight: 600;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-hover);
    color: var(--accent-blue);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 10px;
    position: relative;
    overflow: visible;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tool-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

#theme-toggle-btn {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

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

.content-title {
    font-size: 24px;
    font-weight: 700;
}

.content-stats {
    color: var(--text-muted);
    font-size: 14px;
}

.folder-share-panel {
    margin-top: 0;
    padding: 12px;
    background: rgba(0, 186, 124, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.folder-share-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.folder-share-eyebrow {
    color: var(--accent-green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.folder-share-title {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
}

.folder-share-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.folder-share-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.folder-share-description,
.folder-share-meta {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.folder-share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.folder-share-input {
    flex: 1;
    min-width: 160px;
    padding: 9px 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
}

.share-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.share-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.share-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.share-primary-btn {
    background: var(--cta-bg);
    border-color: var(--cta-bg);
    color: var(--cta-text);
}

.share-primary-btn:hover {
    background: var(--cta-bg-strong);
    border-color: var(--cta-bg-strong);
}

.share-danger-btn {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.share-danger-btn:hover {
    background: #991b1b;
    border-color: #991b1b;
}

.content-toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-container.locked-surface,
.content-toolbar.locked-surface,
.active-filters-bar.locked-surface {
    filter: blur(1px) saturate(0.75);
    opacity: 0.72;
    pointer-events: none;
    user-select: none;
}

.active-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.active-filters-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    max-width: 260px;
}

.filter-tag-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-tag-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.filter-tag-remove:hover {
    color: var(--text-primary);
}

.filter-clear-mini {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.filter-clear-mini:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.toolbar-actions .action-btn {
    position: relative;
    overflow: hidden;
    width: auto;
    min-width: 36px;
    padding: 0 10px;
    max-width: 40px;
    justify-content: flex-start;
    gap: 6px;
    transition: max-width 0.18s ease, padding 0.18s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
    flex: 0 0 auto;
}

.toolbar-actions .action-btn:hover,
.toolbar-actions .action-btn:focus-visible {
    max-width: 240px;
    padding: 0 12px;
}

.toolbar-actions .action-btn > svg {
    flex: 0 0 auto;
    display: block;
}

.toolbar-actions .tool-text {
    display: inline-block;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transform: translateX(-4px);
    transition: max-width 0.18s ease, margin-left 0.18s ease, opacity 0.14s ease, transform 0.18s ease;
}

.toolbar-actions .action-btn:hover .tool-text,
.toolbar-actions .action-btn:focus-visible .tool-text {
    max-width: 176px;
    margin-left: 8px;
    opacity: 1;
    transform: translateX(0);
}

.toolbar-actions .toolbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.sort-menu-wrap {
    position: relative;
}

.sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 80;
}

#date-format-menu {
    min-width: 190px;
}

.sort-option,
.date-format-option {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.sort-option:hover,
.date-format-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sort-option.active,
.date-format-option.active {
    background: var(--surface-active);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.module-switcher {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px;
    margin-bottom: 16px;
}

.module-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.module-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.module-tab.active {
    background: var(--surface-active);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.module-badge {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 1px 8px;
    min-width: 24px;
    text-align: center;
    font-size: 12px;
}

.module-tab.active .module-badge {
    background: var(--surface-active-strong);
    color: var(--accent-blue);
}

.nav-badge.locked-badge,
.module-badge.locked-badge {
    min-width: 42px;
    background: rgba(255, 122, 0, 0.16);
    color: var(--accent-orange);
}

.nav-badge.upgrade-badge,
.module-badge.upgrade-badge {
    min-width: 38px;
    background: rgba(29, 155, 240, 0.16);
    color: var(--accent-blue);
}

.nav-item.locked-feature,
.module-tab.locked-feature {
    border-color: rgba(255, 122, 0, 0.22);
}

.nav-item.upgrade-feature,
.module-tab.upgrade-feature {
    border-color: rgba(29, 155, 240, 0.22);
}

.section-readiness {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.section-readiness.locked {
    border-left-color: var(--accent-orange);
}

.section-readiness.upgrade {
    border-left-color: var(--accent-blue);
}

.section-readiness-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.section-readiness-badge.soon {
    background: rgba(255, 122, 0, 0.14);
    color: var(--accent-orange);
}

.section-readiness-badge.upgrade {
    background: rgba(29, 155, 240, 0.14);
    color: var(--accent-blue);
}

.section-readiness-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.section-readiness-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ai-author-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(120, 86, 255, 0.14), rgba(0, 186, 124, 0.08));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.ai-author-panel-copy {
    flex: 1;
    min-width: 0;
}

.ai-author-panel-badge {
    display: inline-flex;
    margin-bottom: 10px;
    background: rgba(0, 186, 124, 0.14);
    color: var(--accent-green);
}

.ai-author-panel-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

.ai-author-panel-actions {
    width: min(100%, 520px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.ai-author-summary-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ai-author-summary-card {
    min-width: 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.ai-author-summary-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.ai-author-summary-card strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
}

.ai-author-refresh-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}

.ai-author-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: var(--transition);
}

.ai-author-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.ai-author-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ai-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    font-weight: 700;
}

.ai-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-author-title-block {
    min-width: 0;
    flex: 1;
}

.ai-author-title-block h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-author-title-block span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13px;
}

.ai-author-state {
    flex-shrink: 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(0, 186, 124, 0.12);
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 700;
}

.ai-author-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ai-author-metrics div {
    min-width: 0;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.ai-author-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-author-folder-list,
.ai-author-policy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-author-folder-chip {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
}

.ai-author-policy,
.ai-author-samples {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.sync-main-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--cta-bg) 0%, var(--cta-bg-strong) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--cta-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--shadow-tint);
}

.sync-main-btn:hover {
    background: linear-gradient(135deg, var(--cta-bg-strong) 0%, var(--cta-bg-strong) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--shadow-tint);
}

.sync-main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sync-main-btn.syncing svg {
    animation: spin 1s linear infinite;
}

/* Filter Panel */
.filter-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.36);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    z-index: 901;
}

.filter-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(460px, 100vw);
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    overflow: hidden;
    z-index: 902;
    display: flex;
    flex-direction: column;
    transform: translateX(102%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.filter-panel.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.filter-panel-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.filter-panel-close {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.filter-panel-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-blue);
    color: var(--cta-text);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.filter-options {
    padding: 14px;
    background: var(--bg-secondary);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.filter-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-row-span-2 {
    grid-column: 1 / -1;
}

.filter-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    min-height: 38px;
    padding: 0 12px;
}

.filter-multi-input {
    min-height: 88px;
    max-height: 132px;
    padding: 8px;
}

.filter-multi-input option {
    padding: 6px 8px;
}

.filter-hint {
    color: var(--text-muted);
    font-size: 11px;
}

.filter-folder-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    padding: 12px;
}

.filter-folder-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.filter-folder-summary-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.filter-folder-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.filter-folder-clear {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-folder-clear:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.filter-folder-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.filter-folder-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-folder-option:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.filter-folder-option.is-checked {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.12);
}

.filter-folder-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    flex-shrink: 0;
}

.filter-folder-option-body {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.filter-folder-option-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-folder-option-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.filter-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-quick-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    font-size: 13px;
    cursor: pointer;
}

.filter-quick-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.filter-toggle-row input {
    width: 16px;
    height: 16px;
}

.filter-footer-actions {
    display: flex;
    gap: 8px;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group:last-of-type {
    margin-bottom: 8px;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 6px 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--cta-text);
}

.filter-clear {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-clear:hover {
    background: var(--bg-hover);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

/* Tweets Container */
.tweets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.tweets-container.empty,
.tweets-container.empty.waterfall-view,
.tweets-container.empty.gallery-view,
.tweets-container.empty.list-view,
.tweets-container.empty.table-view,
.tweets-container.empty.insights-view {
    display: block;
    min-height: min(60vh, 720px);
    column-width: auto;
    column-count: auto;
    column-gap: 0;
}

.tweets-container.empty .empty-state,
.tweets-container.empty .empty-state-shell {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.tweets-container.waterfall-view {
    display: block;
}

.waterfall-columns {
    display: grid;
    gap: 16px;
    align-items: start;
}

.waterfall-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tweets-container.waterfall-view .tweet-card {
    margin: 0;
}

.tweets-container.waterfall-view .tweet-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
}

.tweets-container.waterfall-view .pagination {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.tweets-container.table-view,
.tweets-container.insights-view {
    display: block;
}

.tweets-container.gallery-view {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.tweets-container.gallery-view .tweet-card {
    display: none;
}

.table-view-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.tweet-table {
    width: 100%;
    border-collapse: collapse;
}

.tweet-table th,
.tweet-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    vertical-align: top;
}

.tweet-table th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
}

.tweet-table tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.tweet-table tbody tr:hover {
    background: var(--bg-hover);
}

.tweet-table tbody tr.selected {
    background: rgba(59, 130, 246, 0.12);
}

.tweet-table tbody tr.selected:hover {
    background: rgba(59, 130, 246, 0.18);
}

.tweet-table tbody tr.selected td {
    box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.12);
}

.table-select,
.table-select-all {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.table-user-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-user-name {
    color: var(--text-primary);
    font-weight: 600;
}

.table-user-handle,
.table-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.table-folder-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
}

.table-post-cell {
    max-width: 540px;
    color: var(--text-primary);
}

.table-media-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.local-media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.local-media-preview.compact {
    min-height: 44px;
    font-size: 10px;
}

.dashboard-video-poster {
    position: relative;
    width: 100%;
    height: 100%;
}

.dashboard-video-poster-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #f5f5f5;
    font-size: 13px;
    font-weight: 700;
}

.table-media-thumb.local-media-preview {
    min-height: 64px;
    object-fit: initial;
}

.gallery-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.gallery-media {
    aspect-ratio: 1 / 1;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.gallery-media img,
.gallery-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-media-placeholder.local-media-preview {
    height: 100%;
    min-height: 180px;
}

.gallery-media-mosaic {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    height: 100%;
}

.gallery-media-mosaic.gallery-media-mosaic-3 .gallery-media-mosaic-tile:first-child {
    grid-column: 1 / -1;
}

.gallery-media-mosaic-tile {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-media-mosaic-tile img,
.gallery-media-mosaic-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-media-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.7);
    color: #f5f5f5;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
    padding: 4px 6px;
}

.gallery-media-order {
    position: absolute;
    top: 8px;
    left: 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(0, 0, 0, 0.64);
    color: #f5f5f5;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    padding: 5px 8px;
}

.gallery-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
}

.gallery-meta {
    padding: 10px;
}

.gallery-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.gallery-card-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gallery-card-author strong {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
}

.gallery-card-author span,
.gallery-card-date {
    color: var(--text-secondary);
    font-size: 12px;
}

.gallery-card-date {
    white-space: nowrap;
}

.gallery-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.35;
}

.insights-view-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.insight-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    padding: 18px;
}

.insight-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.insight-label {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.insight-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    padding: 16px;
}

.insight-section h3 {
    font-size: 20px;
    margin: 0;
}

.insight-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.insight-section-sub {
    color: var(--text-muted);
    font-size: 12px;
}

.insight-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.insight-user-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    text-align: left;
    cursor: pointer;
}

.insight-user-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.insight-user-card.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue) inset;
}

.insight-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.insight-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.insight-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2f3136;
    color: #f4f4f5;
    font-weight: 700;
    font-size: 13px;
}

.insight-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.insight-user-handle {
    color: var(--text-muted);
    font-size: 12px;
}

.insight-user-count {
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
}

.insight-user-filter-icon {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.insight-rank {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 24px;
}

.tweets-container.list-view {
    grid-template-columns: 1fr;
}

/* Tweet Card */
.tweet-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.tweet-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.tweet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tweet-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.tweet-author {
    flex: 1;
}

.tweet-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.tweet-username {
    font-size: 13px;
    color: var(--text-muted);
}

.tweet-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.tweet-media {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-tertiary);
}

.tweet-media img,
.tweet-media video {
    width: 100%;
    display: block;
}

.tweet-media-main {
    width: 100%;
}

.tweet-media-placeholder.local-media-preview {
    min-height: 180px;
}

.tweet-media-strip {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
}

.tweet-media-thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    cursor: pointer;
}

.tweet-media-thumb.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue) inset;
}

.tweet-media-thumb img,
.tweet-media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tweet-media-thumb-placeholder.local-media-preview {
    min-height: 46px;
    height: 46px;
}

.tweet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.tweet-metrics {
    display: flex;
    gap: 16px;
}

.tweet-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.tweet-date {
    font-size: 12px;
    color: var(--text-muted);
}

.table-row-focus {
    background: rgba(59, 130, 246, 0.12) !important;
}

.preview-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    z-index: 905;
}

.preview-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.preview-drawer {
    position: fixed;
    top: 0;
    right: -620px;
    width: min(620px, 100vw);
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 906;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
    box-shadow: var(--shadow-lg);
}

.preview-drawer.active {
    right: 0;
}

.preview-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.preview-drawer-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.preview-drawer-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.preview-drawer-content {
    overflow-y: auto;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.preview-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.preview-author-name {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.preview-author-handle {
    color: var(--text-muted);
    font-size: 14px;
}

.preview-time {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: stretch;
}

.preview-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.preview-btn:hover {
    background: var(--bg-hover);
}

.preview-btn.primary {
    border-color: rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(37, 99, 235, 0.28) 100%);
    color: #dbeafe;
}

.preview-btn.primary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0.38) 100%);
}

.preview-actions .preview-btn.primary {
    flex: 0 0 auto;
}

.preview-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.preview-content-status {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.48);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-content-status.tone-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.preview-content-status.tone-warn {
    border-color: rgba(245, 158, 11, 0.35);
}

.preview-content-status.tone-danger {
    border-color: rgba(239, 68, 68, 0.35);
}

.preview-content-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-content-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.preview-content-status-badge.tone-info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.preview-content-status-badge.tone-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.preview-content-status-badge.tone-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.preview-content-status-badge.tone-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.preview-content-status-link {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.preview-content-status-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.preview-content-status-detail {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.preview-text-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    padding: 14px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.preview-media-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    overflow: hidden;
}

.preview-media-main {
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-media-main img,
.preview-media-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-media-main.is-image {
    aspect-ratio: auto;
    min-height: 0;
}

.preview-media-main.is-image img {
    height: auto;
    max-height: none;
    object-fit: contain;
}

.preview-media-placeholder.local-media-preview {
    min-height: 260px;
}

.preview-media-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
}

.preview-media-nav {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.preview-media-nav:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.preview-media-counter {
    color: var(--text-muted);
    font-size: 12px;
}

.preview-media-strip {
    padding: 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
}

.preview-thumb {
    width: 74px;
    height: 58px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex: 0 0 auto;
    cursor: pointer;
    background: #111;
}

.preview-thumb.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue) inset;
}

.preview-thumb img,
.preview-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

.media-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: #f5f5f5;
    cursor: pointer;
    z-index: 2;
}

.media-lightbox-toolbar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.media-lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: #f5f5f5;
    border-radius: 10px;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    line-height: 1;
    font-size: 20px;
    cursor: pointer;
}

.media-lightbox-btn:hover,
.media-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

.media-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: #f5f5f5;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.media-lightbox-nav.prev {
    left: 14px;
}

.media-lightbox-nav.next {
    right: 14px;
}

.media-lightbox-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 70px 138px;
    overflow: hidden;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
}

.media-lightbox-placeholder.local-media-preview {
    width: min(92vw, 900px);
    min-height: min(56vh, 520px);
}

.media-lightbox-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px 14px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.65) 25%, rgba(0, 0, 0, 0.85) 100%);
}

.media-lightbox-counter {
    color: #c7c7cc;
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
}

.media-lightbox-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.media-lightbox-thumb {
    width: 80px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    cursor: pointer;
    flex: 0 0 auto;
    opacity: 0.75;
}

.media-lightbox-thumb.active {
    opacity: 1;
    border-color: #fff;
}

.media-lightbox-thumb img,
.media-lightbox-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(360px, 56vh, 680px);
    margin: 0 auto;
    padding: 56px 24px;
    text-align: center;
    overflow: hidden;
}

.empty-preview {
    position: absolute;
    inset: 24px;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.empty-preview-card {
    min-height: 220px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(29, 155, 240, 0.18), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    transform: rotate(-5deg);
    filter: blur(0.6px);
    opacity: 0.9;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.empty-preview-card.alt {
    transform: translateY(26px) rotate(3deg);
}

.empty-preview-card.short {
    min-height: 180px;
    transform: translateY(-10px) rotate(-2deg);
}

.empty-preview-card span {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.empty-preview-card span:first-child {
    width: 48%;
}

.empty-preview-card span:nth-child(2) {
    width: 86%;
}

.empty-preview-card span:nth-child(3) {
    width: 64%;
}

.empty-state-shell {
    width: min(100%, 560px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.empty-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.empty-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.empty-chip.soon {
    background: rgba(255, 122, 0, 0.16);
    color: var(--accent-orange);
}

.empty-chip.upgrade {
    background: rgba(29, 155, 240, 0.16);
    color: var(--accent-blue);
}

.empty-chip.progress {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.empty-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.empty-icon {
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-icon-target,
.empty-sync-trail {
    display: none;
}

.empty-state.syncing .empty-icon {
    color: var(--accent-pink);
    opacity: 0.95;
}

.empty-state.syncing .empty-icon svg {
    transform-origin: center;
    animation: bookmarkFloat 2.3s ease-in-out infinite;
}

.empty-state.syncing .empty-action {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.28);
    animation: syncPulse 1.6s ease-in-out infinite;
}

.empty-state.folder-syncing .empty-scene {
    gap: 16px;
}

.empty-state.folder-syncing .empty-icon-source {
    color: var(--cta-bg);
    opacity: 1;
}

.empty-state.folder-syncing .empty-icon-source svg {
    animation: bookmarkDeliver 2.1s ease-in-out infinite;
}

.empty-state.folder-syncing .empty-icon-target {
    display: flex;
    color: var(--accent-green);
    opacity: 0.92;
    animation: folderReceive 2.1s ease-in-out infinite;
}

.empty-state.folder-syncing .empty-sync-trail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state.folder-syncing .empty-sync-trail span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    animation: syncTrail 1.2s ease-in-out infinite;
}

.empty-state.folder-syncing .empty-sync-trail span:nth-child(2) {
    animation-delay: 0.15s;
}

.empty-state.folder-syncing .empty-sync-trail span:nth-child(3) {
    animation-delay: 0.3s;
}

.empty-state.locked .empty-preview {
    display: grid;
    opacity: 1;
}

.empty-state.locked .empty-state-shell {
    position: relative;
    z-index: 1;
    padding: 30px 28px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 12, 16, 0.68);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.empty-state.locked .empty-icon {
    color: rgba(255, 255, 255, 0.78);
    opacity: 0.88;
}

.empty-state.locked .empty-action {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.empty-state.locked .empty-action:hover {
    background: rgba(255, 255, 255, 0.12);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
    margin: 0;
    max-width: 360px;
}

.empty-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--cta-bg);
    color: var(--cta-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.empty-action:hover {
    background: var(--cta-bg-strong);
    transform: translateY(-1px);
}

@keyframes bookmarkFloat {
    0%,
    100% {
        transform: translateY(0) rotate(-6deg);
    }

    50% {
        transform: translateY(-10px) rotate(4deg);
    }
}

@keyframes bookmarkDeliver {
    0%,
    100% {
        transform: translateX(-2px) translateY(0) rotate(-6deg);
    }

    35% {
        transform: translateX(6px) translateY(-3px) rotate(-2deg);
    }

    70% {
        transform: translateX(12px) translateY(2px) rotate(4deg);
    }
}

@keyframes folderReceive {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.88;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes syncTrail {
    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.82);
    }

    50% {
        opacity: 1;
        transform: scale(1.16);
    }
}

@keyframes syncPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.18);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(236, 72, 153, 0);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Export Modal */
.export-modal {
    max-width: 680px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.export-modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: calc(100vh - 168px);
    overflow-y: auto;
}

.export-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.export-mode-tab {
    min-height: 44px;
    border: none;
    border-radius: calc(var(--radius-md) - 4px);
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.export-mode-tab:hover {
    color: var(--text-primary);
}

.export-mode-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.export-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-section[hidden] {
    display: none;
}

.export-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.export-section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-section-header p,
.export-section-note {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.export-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.export-choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 112px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.export-choice-card:hover {
    background: var(--bg-hover);
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.export-choice-card.active {
    border-color: var(--accent-blue);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04)), var(--bg-tertiary);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22);
    color: var(--text-primary);
}

.export-choice-card.disabled,
.export-choice-card:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.export-choice-card.disabled:hover,
.export-choice-card:disabled:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.export-choice-title {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

.export-choice-description {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.export-name-group {
    margin-bottom: 0;
}

.export-summary-card {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: var(--radius-md);
}

.export-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-summary-meta {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

.export-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.export-start-btn svg {
    flex: none;
}

.export-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .export-choice-grid {
        grid-template-columns: 1fr;
    }

    .export-section-header {
        flex-direction: column;
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.color-picker {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary);
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--cta-bg) 0%, var(--cta-bg-strong) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--cta-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--cta-bg-strong) 0%, var(--cta-bg-strong) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-tint);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Sync Drawer */
.sync-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.sync-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sync-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sync-drawer > * {
    flex-shrink: 0;
}

.sync-drawer.active {
    right: 0;
}

.sync-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.sync-drawer-header h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    flex: 1;
    padding-right: 12px;
}

.sync-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.sync-drawer-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sync-drawer-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 32px;
}

.sync-counter-container {
    text-align: center;
    padding: 32px 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.sync-counter {
    font-size: 72px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -2px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.sync-counter.updating {
    transform: scale(1.05);
    color: var(--accent-blue);
}

.sync-counter-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-last-time {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sync-account-card {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.sync-account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sync-account-header > div:first-child {
    min-width: 0;
}

.sync-account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 112px;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 112px;
}

.sync-account-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sync-account-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sync-account-meta {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sync-account-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sync-account-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.sync-account-badge.info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.sync-account-badge.ok {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.sync-account-badge.warn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.sync-account-refresh-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 8px 12px;
    max-width: 100%;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    cursor: pointer;
    transition: var(--transition);
}

.sync-account-refresh-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.sync-account-refresh-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
}

.beta-readiness-card {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background:
        radial-gradient(circle at top left, rgba(29, 155, 240, 0.12), transparent 38%),
        var(--bg-tertiary);
}

.beta-readiness-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.beta-readiness-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.beta-readiness-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.beta-readiness-score {
    min-width: 52px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.beta-readiness-meta {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

.beta-readiness-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.beta-readiness-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.beta-readiness-btn {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.beta-readiness-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1678c2 100%);
    color: #fff;
    border: none;
}

.beta-readiness-btn.secondary {
    background: transparent;
    color: var(--text-primary);
}

.beta-readiness-btn.secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.beta-readiness-note {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

.release-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 8, 15, 0.76);
    backdrop-filter: blur(8px);
}

.release-gate-overlay.active {
    display: flex;
}

.release-gate-panel {
    width: min(560px, 100%);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(18, 26, 43, 0.98), rgba(11, 16, 29, 0.98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.release-gate-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.release-gate-title {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 1.05;
    color: var(--text-primary);
}

.release-gate-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.release-gate-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.release-gate-btn {
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.release-gate-btn.primary {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
}

.release-gate-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.sync-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.sidebar-auto-countdown {
    --auto-sync-angle: 0deg;
    margin-top: 10px;
    width: 100%;
    min-height: 58px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    background: transparent;
}

.sidebar-auto-countdown-ring {
    position: relative;
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: conic-gradient(from -90deg, #22c55e 0deg var(--auto-sync-angle), rgba(255, 255, 255, 0.13) var(--auto-sync-angle) 360deg);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), 0 0 18px rgba(34, 197, 94, 0.22);
    transition: background 180ms linear, box-shadow 180ms ease;
}

.sidebar-auto-countdown-ring::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bg-secondary);
}

.sidebar-auto-countdown-label {
    display: block;
    max-width: 180px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    white-space: normal;
}

.sidebar-auto-countdown.warn {
    background: transparent;
}

.sidebar-auto-countdown.warn .sidebar-auto-countdown-ring {
    background: conic-gradient(from -90deg, #f59e0b 0deg var(--auto-sync-angle), rgba(255, 255, 255, 0.13) var(--auto-sync-angle) 360deg);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 0 18px rgba(245, 158, 11, 0.2);
}

.sidebar-auto-countdown.error {
    background: transparent;
}

.sidebar-auto-countdown.error .sidebar-auto-countdown-ring {
    background: conic-gradient(from -90deg, #ef4444 0deg var(--auto-sync-angle), rgba(255, 255, 255, 0.13) var(--auto-sync-angle) 360deg);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25), 0 0 18px rgba(239, 68, 68, 0.2);
}

.sync-auto-countdown {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.sync-auto-countdown-label {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sync-auto-countdown-time {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.sync-auto-countdown-meta {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.sync-auto-countdown.warn {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.sync-auto-countdown.error {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
}

.sync-primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--cta-bg) 0%, var(--cta-bg-strong) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--cta-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--shadow-tint);
}

.sync-primary-btn:hover {
    background: linear-gradient(135deg, var(--cta-bg-strong) 0%, var(--cta-bg-strong) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--shadow-tint);
}

.sync-primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sync-primary-btn.syncing svg {
    animation: spin 1s linear infinite;
}

.sync-full-resync-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.sync-full-resync-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: var(--surface-soft);
}

.sync-full-resync-btn svg {
    opacity: 0.7;
}


.sync-secondary-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.sync-secondary-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.sync-progress {
    margin-bottom: 24px;
}

.sync-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sync-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.sync-progress-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.content-queue-card {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content-queue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.content-queue-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.content-queue-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #60a5fa;
    margin-bottom: 4px;
}

.content-queue-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.content-queue-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.content-queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content-queue-empty {
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.content-queue-item {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.content-queue-item.tone-success {
    border-color: rgba(34, 197, 94, 0.24);
}

.content-queue-item.tone-warn {
    border-color: rgba(245, 158, 11, 0.28);
}

.content-queue-item.tone-danger {
    border-color: rgba(239, 68, 68, 0.28);
}

.content-queue-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.content-queue-item-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.content-queue-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.content-queue-badge.tone-info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.content-queue-badge.tone-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.content-queue-badge.tone-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.content-queue-badge.tone-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.content-queue-item-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.content-queue-item-detail {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.content-queue-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.content-queue-item-action {
    border: none;
    background: transparent;
    padding: 0;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.content-queue-item-action:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.content-queue-item-link {
    align-self: flex-start;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.content-queue-item-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.sync-debug-section {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.sync-debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sync-debug-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sync-debug-actions {
    display: flex;
    gap: 6px;
}

.sync-debug-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

.sync-debug-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.sync-debug-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sync-debug-btn:disabled:hover {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.sync-debug-stage {
    font-size: 11px;
    color: #22c55e;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.sync-debug-log {
    max-height: 160px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #aab4c2;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: #0a0f18;
}

.sync-debug-line {
    margin-bottom: 6px;
    word-break: break-word;
}

.sync-debug-line:last-child {
    margin-bottom: 0;
}

.sync-debug-time {
    color: #7f8ea3;
    margin-right: 6px;
}

.sync-debug-level-error {
    color: #ef4444;
}

.sync-debug-level-warn {
    color: #f59e0b;
}

.sync-debug-level-success {
    color: #22c55e;
}

.sync-debug-empty {
    color: #6b7280;
    text-align: center;
    padding: 6px 0;
}

.sync-folders-section {
    margin-top: 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    scroll-margin-top: 24px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.sync-folders-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.sync-folders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sync-folder-item-main {
    min-width: 0;
    flex: 1;
}

.sync-folder-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sync-folder-item-name {
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-folder-item-meta {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.sync-folder-item-count {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 12px;
    flex-shrink: 0;
}

.sync-folder-item-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.sync-folder-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.sync-folder-item.done .sync-folder-item-icon {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.14);
}

.sync-folder-item.done .sync-folder-badge {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.14);
}

.sync-folder-item.stale .sync-folder-item-icon {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.sync-folder-item.stale .sync-folder-badge {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.sync-folder-item.idle .sync-folder-item-icon {
    color: #71717a;
    background: rgba(113, 113, 122, 0.18);
}

.sync-folder-item.idle .sync-folder-badge {
    color: #71717a;
    background: rgba(113, 113, 122, 0.18);
}

.sync-folder-item.syncing .sync-folder-item-icon,
.sync-folder-item.syncing .sync-folder-badge {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.14);
}

.sync-folder-item.syncing {
    animation: folderItemBreathe 1.7s ease-in-out infinite;
}

.sync-folder-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.sync-checklist-card,
.sync-folder-prompt {
    margin-top: 18px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sync-checklist-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.sync-checklist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
}

.sync-checklist-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.sync-checklist-item.done .sync-checklist-icon {
    background: rgba(34, 197, 94, 0.14);
    color: #22c55e;
}

.sync-checklist-item.pending .sync-checklist-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.sync-checklist-item.info .sync-checklist-icon {
    background: rgba(113, 113, 122, 0.18);
    color: var(--text-muted);
}

.sync-checklist-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sync-checklist-label {
    font-weight: 600;
}

.sync-checklist-meta {
    color: var(--text-muted);
    font-size: 12px;
}

.sync-folder-prompt {
    border-left: 3px solid #f59e0b;
}

.sync-folder-prompt.ready {
    border-left-color: #22c55e;
}

.sync-folder-prompt-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.sync-folder-prompt-copy {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.sync-folder-prompt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-folder-prompt-btn {
    border: none;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sync-folder-prompt-btn.primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.sync-folder-prompt-btn.secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sync-folders-section.focused {
    animation: syncSectionPulse 1.4s ease;
}

.sync-folders-section.syncing {
    animation: folderSectionBreathe 1.9s ease-in-out infinite;
}

@keyframes syncSectionPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.28);
        border-radius: 12px;
    }
    100% {
        box-shadow: 0 0 0 16px rgba(34, 197, 94, 0);
        border-radius: 12px;
    }
}

@keyframes folderSectionBreathe {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.1);
        transform: translateY(0);
    }

    50% {
        box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.24), 0 10px 24px rgba(34, 197, 94, 0.08);
        transform: translateY(-2px);
    }
}

@keyframes folderItemBreathe {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-1px);
    }
}

.search-input:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

@media (orientation: portrait), (max-width: 860px) {
    .desktop-original-only {
        display: none !important;
    }
}

@media (min-width: 861px) and (orientation: landscape), (min-width: 1180px) {
    .desktop-current-only {
        display: none !important;
    }

    .top-nav-tabs {
        flex: 0 1 auto;
        overflow-x: visible;
        scrollbar-width: auto;
    }

    .top-nav-tabs::-webkit-scrollbar {
        display: initial;
    }

    .top-bar-actions {
        flex-shrink: 1;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 230px;
    }

    .content-area {
        padding: 18px;
    }

    .module-tab {
        font-size: 12px;
        padding: 7px 10px;
    }

    .top-module-tab {
        min-width: 112px;
        font-size: 14px;
    }

    .insight-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insight-user-grid {
        grid-template-columns: 1fr;
    }

    .preview-drawer {
        width: min(520px, 100vw);
    }
}

@media (max-width: 560px) {
    .preview-actions .preview-btn.primary {
        flex: 1 0 100%;
    }
}

@media (max-width: 860px) {
    body {
        overflow: auto;
    }

    .app {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        max-height: 260px;
    }

    .top-bar {
        height: auto;
        padding: 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-nav-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .top-bar-actions {
        width: 100%;
        margin-left: 0;
    }

    .search-container {
        flex: 1;
        max-width: none;
    }

    .content-toolbar {
        flex-wrap: wrap;
    }

    .toolbar-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .folder-share-link-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-author-panel {
        flex-direction: column;
    }

    .ai-author-panel-actions {
        width: 100%;
        align-items: stretch;
    }

    .ai-author-summary-grid,
    .ai-author-metrics {
        grid-template-columns: 1fr;
    }

    .folder-share-inline-wrap {
        margin-left: 12px;
    }

    .folder-share-input {
        min-width: 0;
        width: 100%;
    }

    .action-btn {
        flex: 0 0 auto;
    }

    .filter-top-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        width: min(100vw, 420px);
    }

    .filter-folder-checklist {
        grid-template-columns: 1fr;
    }

    .preview-drawer {
        width: 100vw;
    }

    .preview-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .preview-actions {
        width: 100%;
    }

    .preview-btn {
        flex: 1;
        text-align: center;
    }

    .media-lightbox-stage {
        padding: 72px 16px 140px;
    }

    .media-lightbox-toolbar {
        left: 12px;
        right: 12px;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tweet-table th:nth-child(4),
    .tweet-table td:nth-child(4),
    .tweet-table th:nth-child(6),
    .tweet-table td:nth-child(6) {
        display: none;
    }

    .tweets-container.waterfall-view {
        display: block;
    }

    .waterfall-columns,
    .waterfall-column {
        gap: 12px;
    }

    .tweets-container.waterfall-view .tweet-card {
        margin-bottom: 0;
    }

    .insight-cards {
        grid-template-columns: 1fr;
    }

    .insight-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .sync-drawer {
        width: min(420px, 100vw);
    }
}
