/* Modern Tech-Forward Design System v2 (Phase 7 Refinement) */
:root {
    /* Color Palette - Light (Slate-based & Vibrant Indigo) */
    --bg-color: #F8FAFC;
    /* Slate-50 */
    --surface-color: #FFFFFF;
    --text-primary: #0F172A;
    /* Slate-900 */
    --text-secondary: #64748B;
    /* Slate-500 */
    --border-color: #E2E8F0;
    /* Slate-200 */
    --accent-color: #6366F1;
    /* Indigo-500 */
    --accent-hover: #4F46E5;
    /* Indigo-600 */
    --metric-bg: #F1F5F9;
    /* Slate-100 */

    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Spacing & Layout */
    --sidebar-width: 300px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Color Palette - Dark (Deep Slate) */
    --bg-color: #0F172A;
    /* Slate-900 */
    --surface-color: #1E293B;
    /* Slate-800 */
    --text-primary: #F8FAFC;
    /* Slate-50 */
    --text-secondary: #94A3B8;
    /* Slate-400 */
    --border-color: #334155;
    /* Slate-700 */
    --accent-color: #818CF8;
    /* Indigo-400 */
    --accent-hover: #A5B4FC;
    /* Indigo-300 */
    --metric-bg: #1E293B;
    /* Same as surface for blending or slightly lighter */
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Base size up from 14/default */
}

/* Typography Utilities */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
}

/* Layout */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    /* Increased padding */
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    /* More breathing room */
}

.logo {
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.04em;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.privacy-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    /* Emerald-600 for better contrast on light */
    letter-spacing: 0.02em;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.privacy-icon {
    display: none;
    font-size: 1.2rem;
}

.privacy-popup {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    width: 250px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    white-space: normal;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.5;
}

.privacy-popup strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #059669;
}

.privacy-popup p {
    margin: 0;
    color: var(--text-secondary);
}

.privacy-popup.show {
    display: block;
}

[data-theme="dark"] .privacy-indicator {
    color: #34D399;
    /* Emerald-400 for dark mode */
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.2);
}

.countdown-timer {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-variant-numeric: tabular-nums;
}

.countdown-timer.active {
    display: flex;
}

.countdown-timer.warning {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.privacy-indicator:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    /* Emerald-500 */
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
    /* Mobile first */
}

/* Sidebar / Dashboard */
.dashboard {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Component: Metric Card */
.metric-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background-color: var(--bg-color);
    /* Subtle contrast */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    transition: var(--transition);
}

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

.metric-value {
    font-family: var(--font-sans);
    /* Use sans for cleaner modern look, or mono if preferred */
    font-weight: 700;
    font-size: 1.85rem;
    /* Large and readable */
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.limit-exceeded {
    color: var(--danger-color) !important;
}

/* Component: Select */
.platform-select {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.7rem auto;
    transition: var(--transition);
}

.platform-select:hover,
.platform-select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Component: Buttons */
.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.action-btn {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--accent-color);
    color: #FFFFFF;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.action-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background-color: #30D158;
    color: #000000;
    border: none;
}

.action-btn.secondary:hover {
    background-color: #28B84C;
    box-shadow: 0 4px 12px rgba(48, 209, 88, 0.4);
    transform: translateY(-1px);
}

.action-btn.danger {
    background-color: var(--danger-color);
    color: #FFFFFF;
}

.action-btn.danger:hover {
    background-color: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Filter Search */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filter-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.filter-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.filter-results {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-results.active {
    display: flex;
}

.filter-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.filter-stat-label {
    color: var(--text-secondary);
}

.filter-stat-value {
    font-weight: 700;
    color: var(--accent-color);
    font-variant-numeric: tabular-nums;
}

/* Highlight Container */
.text-container {
    position: relative;
    flex: 1;
    display: flex;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.highlight-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 2rem 2rem 2rem;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    line-height: 1.7;
    color: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    pointer-events: none;
}

.highlight-backdrop mark {
    background-color: rgba(99, 102, 241, 0.3);
    color: transparent;
    border-radius: 2px;
}

[data-theme="dark"] .highlight-backdrop mark {
    background-color: rgba(129, 140, 248, 0.35);
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    background-color: var(--bg-color);
    /* Seamless with editor */
    border-bottom: 1px solid transparent;
    /* Cleaner Look */
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 2px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.tool-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    /* Small inner radius */
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

/* Textarea */
#text-input {
    position: relative;
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-sans);
    font-size: 1.25rem;
    /* Larger, readable text (20px) */
    line-height: 1.7;
    background-color: transparent;
    color: var(--text-primary);
    padding: 0 2rem 2rem 2rem;
    z-index: 1;
}

#text-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.4;
}

/* Panels (Analysis / History) */
.analysis-panel,
.history-panel {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 0;
    border-top: 1px solid var(--border-color);
}

/* Panel Header (for History panel) */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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


.analysis-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

[data-theme="light"] .analysis-header {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.analysis-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.badge {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    width: fit-content;
    white-space: nowrap;
}

.analysis-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.analysis-stat.divider {
    width: 1px;
    height: 40px;
    background-color: var(--border-color);
    margin: 0 1rem;
}

.analysis-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.analysis-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.analysis-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    padding: 0.35rem 0.875rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
}

.badge.easy {
    background-color: var(--success-color);
}

.badge.moderate {
    background-color: var(--warning-color);
}

.badge.difficult {
    background-color: var(--danger-color);
}

.keyword-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    /* Pill shape */
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* PII Scanner Styles */
.metric-card.pii-card {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
    color: #D97706;
    /* Amber-600 */
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.metric-card.pii-card:hover {
    transform: translateY(-2px);
    background-color: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .metric-card.pii-card {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #FBBF24;
    /* Amber-400 */
}

.metric-card.pii-card .metric-label {
    color: currentColor;
    font-weight: 600;
}

.warning-text {
    color: #DC2626;
    /* Red-600 */
    font-weight: 700;
}

[data-theme="dark"] .warning-text {
    color: #F87171;
    /* Red-400 */
}

.pii-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: rgba(220, 38, 38, 0.1);
    /* Red background */
    color: #DC2626;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .pii-item {
    color: #F87171;
    background-color: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.3);
}

.pii-type {
    font-weight: 700;
    margin-right: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Modals */
.modal {
    background-color: rgba(15, 23, 42, 0.6);
    /* Slate tint */
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    max-width: 650px;
    width: 90%;
}

.modal-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.thread-container {
    padding: 2rem;
    background-color: var(--bg-color);
}

.tweet-box {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Desktop Responsiveness */
@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
    }

    .dashboard {
        width: var(--sidebar-width);
        border-bottom: none;
        border-right: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem;
    }

    .analysis-panel {
        padding: 1.5rem 2rem;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        gap: 3rem;
    }

    .action-btn {
        margin-top: auto;
    }
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .main-container {
        flex-direction: column;
        overflow: visible;
    }

    /* Text area comes first on mobile */
    .editor-area {
        order: -1;
        min-height: 40vh;
        flex-shrink: 0;
    }

    .dashboard {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    /* Compact metric cards in a horizontal row */
    .metrics-row {
        display: flex;
        gap: 0.5rem;
        order: -1;
    }

    .metric-card {
        flex: 1;
        padding: 0.5rem;
        text-align: center;
        min-width: 0;
    }

    .metric-value {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }

    .metric-label {
        font-size: 0.6rem;
        letter-spacing: 0.02em;
    }

    /* Scroll hint */
    .scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem;
        font-size: 0.8rem;
        color: var(--text-secondary);
        background: linear-gradient(to bottom, transparent, var(--surface-color));
        border-bottom: 1px solid var(--border-color);
    }

    .scroll-hint-arrow {
        animation: bounce 1.5s infinite;
    }

    @keyframes bounce {

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

        50% {
            transform: translateY(3px);
        }
    }

    /* Full-width tool cards */
    .filter-section {
        width: 100%;
    }

    /* Hide PII card initially on mobile for less clutter */
    .pii-card {
        display: none;
    }

    .pii-card:not(.hidden) {
        display: flex;
    }

    /* Button group */
    .button-group {
        flex-direction: row;
        gap: 0.5rem;
    }

    .button-group .action-btn {
        flex: 1;
        padding: 0.75rem;
    }

    /* Header adjustments */
    .header-right {
        gap: 0.75rem;
        align-items: center;
    }

    /* Privacy indicator: show shield, hide text on mobile */
    .privacy-indicator .status-dot,
    .privacy-indicator .privacy-text {
        display: none;
    }

    .privacy-indicator .privacy-icon {
        display: block;
    }

    .privacy-indicator {
        padding: 0;
        background: transparent;
        border: none;
    }

    /* Countdown timer: show only the time on mobile */
    .countdown-timer.active {
        display: flex;
        padding: 0.25rem 0.5rem;
        background-color: rgba(245, 158, 11, 0.1);
        border: 1px solid rgba(245, 158, 11, 0.2);
        border-radius: 999px;
        min-width: auto;
        margin-left: 0.75rem;
        /* Spacing from dropdown - matches header-right gap */
    }

    .countdown-timer span:not(#countdown-display) {
        display: none;
    }

    #countdown-display {
        display: inline;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--warning-color);
    }

    /* Ensure theme toggle is visible and clickable */
    .theme-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        font-size: 1.1rem;
    }

    /* History panel mobile improvements */
    .history-panel .panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
    }

    .history-panel .panel-header h3 {
        margin: 0;
        font-size: 1rem;
    }

    .history-panel .panel-header .close-btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        line-height: 1;
    }

    .history-panel .history-item {
        font-size: 0.75rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .history-panel .history-item .history-meta {
        font-size: 0.7rem;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }

    .history-panel .history-item .history-preview {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Hide scroll hint on desktop */
.scroll-hint {
    display: none;
}

/* Glassmorphism & Admin Module Styles */

.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

[data-theme='dark'] .glass-panel {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Feedback Widget - Final Force Fix */
.feedback-widget {
    margin-top: 0;
    /* Removed extra spacing */
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem !important;
    /* Brought closer together */
    padding: 1rem 0;
}

.feedback-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;

    /* Light Mode Default */
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #6366F1 !important;
    /* Indigo-500 Blue */

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.feedback-btn svg {
    width: 24px;
    height: 24px;
    stroke: #6366F1 !important;
    /* Force Stroke Color */
    stroke-width: 2;
    pointer-events: none;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3) !important;
    border-color: #6366F1 !important;
    background-color: #F8FAFC !important;
}

.feedback-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-color);
    color: var(--text-primary);
}

.feedback-submit {
    width: 100%;
    padding: 0.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Dark Mode Overrides */
[data-theme='dark'] .feedback-btn {
    background-color: #1E293B !important;
    /* Slate-800 */
    border-color: #334155 !important;
    color: #818CF8 !important;
    /* Indigo-400 */
}

[data-theme='dark'] .feedback-btn svg {
    stroke: #818CF8 !important;
}

[data-theme='dark'] .feedback-btn:hover {
    background-color: #0F172A !important;
    border-color: #818CF8 !important;
}

/* Admin Dashboard */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.admin-modal-overlay.hidden {
    display: none;
}

.admin-login {
    padding: 2rem;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-dashboard {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    padding: 2rem;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Logs */
.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.log-comment {
    flex: 1;
    margin-left: 1rem;
    color: var(--text-primary);
}

/* Changelog */
.changelog-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.changelog-item {
    margin-bottom: 1rem;
}

.changelog-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.changelog-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.changelog-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.text-btn.subtle {
    color: var(--text-secondary);
    opacity: 0.3;
    font-size: 0.8rem;
    padding: 0.2rem;
    border: none;
    background: none;
    cursor: pointer;
}

.text-btn.subtle:hover {
    opacity: 1;
    color: var(--accent-color);
}

.admin-link-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}
/* Updates Link */
.updates-trigger {
    display: block;
    margin-top: 1rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
}

.updates-trigger:hover {
    text-decoration: underline;
}

/* New Updates Modal Overlay (Full Screen Dark style) */
.updates-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0F172A; /* Slate-900 (Dark default) */
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.updates-modal-overlay.hidden {
    display: none;
}

.updates-card {
    background: #1E293B; /* Slate-800 */
    width: 100%;
    max-width: 800px;
    height: 90vh;
    border-radius: var(--radius-lg);
    border: 1px solid #334155; /* Slate-700 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #F8FAFC; /* Slate-50 */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.updates-header {
    padding: 2rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.updates-title h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.updates-subtitle {
    color: #94A3B8; /* Slate-400 */
    font-size: 1rem;
}

.updates-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #475569; /* Slate-600 */
    color: #F8FAFC;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.updates-back-btn:hover {
    background: #334155;
    border-color: #94A3B8;
}

.updates-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Timeline specific styles */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid #334155; /* Vertical line */
    margin-left: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2.05rem; /* Center on line */
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: #0F172A;
    border: 2px solid #06B6D4; /* Cyan-500 */
    border-radius: 50%;
    box-shadow: 0 0 0 4px #1E293B; /* Mask line */
}

.timeline-version-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-version {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F8FAFC;
}

.timeline-date {
    background: #334155;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #94A3B8;
    font-family: var(--font-mono);
}

.timeline-list {
    list-style: none;
    padding: 0;
}

.timeline-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
    color: #CBD5E1; /* Slate-300 */
    font-size: 1rem;
    line-height: 1.6;
}

.timeline-list li::before {
    content: '•';
    color: #818CF8; /* Indigo-400 */
    font-weight: bold;
    position: absolute;
    left: -0.5rem;
}

/* Light Mode Overrides for Modal if needed - user implies Dark screenshot but typically we mirror theme */
/* HOWEVER, the screenshot was explicitly dark. I will keep it dark by default as 'Dark Mode' UI often implies standalone.
   If needed, I can add [data-theme='light'] overrides later, but for now matching the 'look' means Dark. */


/* Responsive Overrides for Updates Modal */
.updates-modal-overlay {
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.updates-card {
    height: 90vh;
    animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
    .updates-modal-overlay {
        padding: 1rem;
    }
    .updates-card {
        height: 95vh;
        border-radius: var(--radius-md);
    }
    .updates-header, .updates-content {
        padding: 1rem;
    }
    .updates-title h2 {
        font-size: 1.5rem;
    }
}


/* Light Mode Styles for Updates Modal */
[data-theme='light'] .updates-modal-overlay,
:root:not([data-theme='dark']) .updates-modal-overlay {
    background: rgba(248, 250, 252, 0.95); /* Slate-50 with opacity */
}

[data-theme='light'] .updates-card,
:root:not([data-theme='dark']) .updates-card {
    background: #FFFFFF;
    border-color: #E2E8F0; /* Slate-200 */
    color: #1E293B; /* Slate-800 */
}

[data-theme='light'] .updates-header,
:root:not([data-theme='dark']) .updates-header {
    border-bottom-color: #E2E8F0;
}

[data-theme='light'] .updates-subtitle,
:root:not([data-theme='dark']) .updates-subtitle {
    color: #64748B; /* Slate-500 */
}

[data-theme='light'] .updates-back-btn,
:root:not([data-theme='dark']) .updates-back-btn {
    background: transparent;
    border-color: #CBD5E1; /* Slate-300 */
    color: #1E293B;
}

[data-theme='light'] .updates-back-btn:hover,
:root:not([data-theme='dark']) .updates-back-btn:hover {
    background: #F1F5F9; /* Slate-100 */
    border-color: #94A3B8;
}

[data-theme='light'] .timeline,
:root:not([data-theme='dark']) .timeline {
    border-left-color: #E2E8F0;
}

[data-theme='light'] .timeline-dot,
:root:not([data-theme='dark']) .timeline-dot {
    background: #FFFFFF;
    box-shadow: 0 0 0 4px #FFFFFF;
}

[data-theme='light'] .timeline-version,
:root:not([data-theme='dark']) .timeline-version {
    color: #1E293B;
}

[data-theme='light'] .timeline-date,
:root:not([data-theme='dark']) .timeline-date {
    background: #F1F5F9;
    color: #64748B;
}

[data-theme='light'] .timeline-list li,
:root:not([data-theme='dark']) .timeline-list li {
    color: #475569; /* Slate-600 */
}

[data-theme='light'] .updates-footer,
:root:not([data-theme='dark']) .updates-footer {
    border-top-color: #E2E8F0 !important;
}


/* Admin Dashboard Enhanced Sections */
.admin-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.text-info {
    color: #0EA5E9;
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.admin-logs-container {
    margin-top: 1.5rem;
}

.admin-logs-container h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.admin-logs {
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.no-logs {
    padding: 1rem;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive: allow 2 or 4 columns for stats */
@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin Dashboard Compact Mode */
.admin-dashboard {
    padding: 1.25rem !important;
    max-height: 80vh;
}

.admin-header {
    margin-bottom: 1rem !important;
}

.admin-header h3 {
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
}

.admin-section {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.section-title {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
}

.admin-stats {
    gap: 0.5rem !important;
    margin-bottom: 0 !important;
}

.stat-box {
    padding: 0.5rem 0.75rem !important;
}

.stat-val {
    font-size: 1.25rem !important;
}

.stat-lbl {
    font-size: 0.65rem !important;
}

.admin-logs-container {
    margin-top: 0.75rem !important;
}

.admin-logs-container h4 {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
}

.admin-logs {
    max-height: 150px !important;
}

.log-entry {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.8rem !important;
}

/* Admin Dashboard Compact Rows Layout */
.admin-stats-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.row-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 85px;
    flex-shrink: 0;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.5rem;
    min-width: 50px;
}

.stat-mini .stat-val {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-mini .stat-lbl {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Copy Button Styling */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem !important;
}

.copy-btn svg {
    display: block;
}

.copy-btn.copied {
    background: var(--success-color) !important;
    color: white !important;
}

.copy-btn:hover {
    background: var(--accent-color);
    color: white;
}

/* Ensure toolbar spacing works on mobile */
@media (max-width: 600px) {
    .toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .toolbar-group {
        flex-shrink: 0;
    }
    
    .copy-btn {
        padding: 0.4rem 0.6rem !important;
    }
}

/* Mobile Toolbar Compact Layout */
@media (max-width: 600px) {
    .toolbar {
        gap: 0.25rem !important;
        padding: 0.5rem !important;
    }
    
    .toolbar-group {
        gap: 0.15rem !important;
    }
    
    .tool-btn {
        padding: 0.35rem 0.4rem !important;
        font-size: 0.7rem !important;
        min-width: unset !important;
    }
    
    .copy-btn {
        padding: 0.35rem 0.4rem !important;
    }
    
    .copy-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Thread button shorter text on mobile */
    #btn-thread {
        font-size: 0.65rem !important;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .toolbar {
        gap: 0.15rem !important;
    }
    
    .tool-btn {
        padding: 0.3rem 0.35rem !important;
        font-size: 0.65rem !important;
    }
    
    .copy-btn {
        padding: 0.3rem 0.35rem !important;
    }
    
    .copy-btn svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Force toolbar to stay on one line on mobile */
@media (max-width: 600px) {
    .toolbar {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Toolbar - Full Width Even Spacing */
@media (max-width: 600px) {
    .toolbar {
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        padding: 0.75rem 1rem !important;
        gap: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .toolbar-group {
        flex: 0 0 auto;
        gap: 2px !important;
    }
    
    .tool-btn {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.8rem !important;
        min-width: unset !important;
    }
    
    .copy-btn {
        padding: 0.5rem 0.6rem !important;
    }
    
    .copy-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Shorten Thread text on mobile */
    #btn-thread {
        font-size: 0.75rem !important;
    }
}

/* Extra small - still evenly spaced but slightly smaller */
@media (max-width: 400px) {
    .toolbar {
        padding: 0.5rem 0.5rem !important;
    }
    
    .tool-btn {
        padding: 0.4rem 0.45rem !important;
        font-size: 0.75rem !important;
    }
    
    .copy-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Utility Icons Row */
.utility-icons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.utility-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.utility-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.utility-btn svg {
    display: block;
}

/* Help Modal Content */
.help-content {
    padding: 0 1.5rem 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.help-section {
    margin-bottom: 1.25rem;
}

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

.help-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    padding-left: 1rem;
    position: relative;
}

.help-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.help-list strong {
    color: var(--text-primary);
}

.help-footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Unified Icon Row */
.icon-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.icon-btn {
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: #60a5fa;
}

.icon-btn svg {
    display: block;
}

/* Blue icons (Updates, Help) */
.icon-btn:hover {
    color: #3b82f6;
    transform: scale(1.15);
}

/* Feedback Comment Row */
.feedback-comment-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.feedback-comment-row.hidden {
    display: none;
}

.feedback-comment-row .feedback-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.feedback-comment-row .feedback-submit {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.feedback-comment-row .feedback-submit:hover {
    opacity: 0.9;
}

/* Help Section Heading with SVG */
.help-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-heading svg {
    flex-shrink: 0;
    color: var(--accent-color);
}

/* Centered footer text */
.help-footer-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Help Modal Compact Footer */
.help-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--surface-color);
}

.help-tagline {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Help Modal Ultra Compact Footer - Override */
.help-footer {
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
}

.help-tagline {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* Mobile Modal Header Fixes */
@media (max-width: 480px) {
    .updates-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
    }
    
    .updates-title h2 {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .updates-title h2 svg {
        width: 24px;
        height: 24px;
    }
    
    .updates-subtitle {
        font-size: 0.8rem;
    }
    
    .updates-back-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
        white-space: nowrap;
    }
    
    .updates-back-btn span {
        display: none;
    }
    
    .updates-content {
        padding: 1rem 1.25rem;
    }
    
    .updates-footer {
        padding: 0.5rem 1rem !important;
    }
    
    .updates-footer div {
        font-size: 0.8rem !important;
    }
    
    .help-section h3 {
        font-size: 0.95rem;
    }
    
    .help-section li {
        font-size: 0.85rem;
    }
}
  
/* Sidebar Footer Ecosystem Tagline */  
.sidebar-footer {  
    margin-top: 1.5rem;  
    padding-top: 1rem;  
    border-top: 1px solid var(--border-color);  
    text-align: center;  
    font-size: 0.75rem;  
    color: var(--text-secondary);  
    line-height: 1.4;  
}  
  
.sidebar-footer a {  
    color: var(--accent-color);  
    text-decoration: none;  
    font-weight: 600;  
    transition: opacity 0.2s ease;  
}  
  
.sidebar-footer a:hover {  
    opacity: 0.8;  
    text-decoration: underline;  
} 
  
/* Compact Icon Row and Footer Spacing */  
.icon-row {  
    margin-top: 0.75rem;  
    padding-top: 0.75rem;  
}  
  
.sidebar-footer {  
    margin-top: 0.75rem;  
    padding-top: 0.5rem;  
    padding-bottom: 0.25rem;  
    font-size: 0.65rem;  
} 
  
/* Further Compact Spacing Fix */  
.button-group {  
    margin-bottom: 0 !important;  
}  
  
.icon-row {  
    margin-top: 0.5rem !important;  
    padding-top: 0.5rem !important;  
    margin-bottom: 0 !important;  
}  
  
.sidebar-footer {  
    margin-top: 0.5rem !important;  
    padding-top: 0.5rem !important;  
    padding-bottom: 0.5rem !important;  
} 
  
/* Option A: Remove separator borders for clean flow */  
.icon-row {  
    border-top: none !important;  
}  
  
.sidebar-footer {  
    border-top: none !important;  
} 

/* ============================================
   Toast Notifications (for Copy/Export feedback)
   ============================================ */
.admin-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.admin-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.admin-toast.hidden { display: none; }
.admin-toast.error { background: linear-gradient(135deg, #EF4444, #DC2626); }

/* Tool buttons with icon + text */
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #60A5FA;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tool-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.tool-btn:active { transform: translateY(0); }
.tool-btn svg { flex-shrink: 0; }

 
/* Logo Text Formatting (2suite.io Standard) */ 
.logo-2 { 
    color: #3B82F6; 
    font-weight: 800; 
} 
 
.logo-name { 
    color: var(--text-primary); 
    font-weight: 700; 
} 
 
.logo-ext { 
    color: #3B82F6; 
    font-weight: 600; 
    font-size: 0.85em; 
}
 
/* Stacked Logo Layout (2suite.io Standard - No Shield Variant) */ 
.logo.logo-stacked { 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 0; 
    line-height: 1; 
} 
 
.logo-line1 { 
    display: flex; 
    align-items: baseline; 
} 
 
.logo-line2 { 
    color: #3B82F6; 
    font-size: 0.6em; 
    font-weight: 600; 
    text-align: right; 
    margin-top: -2px; 
}
 
/* Tighter vertical spacing for logo lines */ 
.logo-line2 { 
    margin-top: -4px !important; 
    line-height: 0.9; 
}
 
/* Logo size increase - 15%% larger */ 
.logo.logo-stacked { 
    font-size: 2rem !important; 
}
 
/* Mobile: Match privacy shield height to theme toggle */ 
@media (max-width: 767px) { 
    .privacy-indicator { 
        width: 40px; 
        height: 40px; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        background: rgba(34, 197, 94, 0.1); 
        border-radius: 8px; 
        border: 1px solid rgba(34, 197, 94, 0.2); 
    } 
    .privacy-indicator .privacy-icon { 
        width: 24px; 
        height: 24px; 
    } 
}
 
/* Mobile header-right alignment */ 
@media (max-width: 767px) { 
    .header-right { 
        gap: 0.5rem; 
    } 
    .theme-btn { 
        width: 40px; 
        height: 40px; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        border-radius: 8px; 
    } 
}
 
/* Mobile: Force aligned cards with consistent spacing */ 
@media (max-width: 767px) { 
    .header-right { 
        gap: 0.5rem !important; 
        align-items: center !important; 
    } 
    .privacy-indicator, 
    .theme-btn { 
        width: 40px !important; 
        height: 40px !important; 
        min-width: 40px !important; 
        min-height: 40px !important; 
        padding: 0 !important; 
        border-radius: 8px !important; 
        display: flex !important; 
        align-items: center !important; 
        justify-content: center !important; 
    } 
}
 
/* Mobile: Reorder header-right elements and hide countdown */ 
@media (max-width: 767px) { 
    .countdown-timer { 
        display: none !important; 
    } 
    .header-right { 
        display: flex !important; 
        flex-direction: row !important; 
        gap: 0.5rem !important; 
    } 
}
 
/* Mobile: Make theme toggle match privacy indicator card exactly */ 
@media (max-width: 767px) { 
    .theme-btn { 
        background: rgba(251, 191, 36, 0.1) !important; 
        border: 1px solid rgba(251, 191, 36, 0.2) !important; 
        border-radius: 12px !important; 
        width: 44px !important; 
        height: 44px !important; 
    } 
    .privacy-indicator { 
        width: 44px !important; 
        height: 44px !important; 
        border-radius: 12px !important; 
    } 
}
 
/* FINAL Mobile Header Fix - Consolidated */ 
@media (max-width: 767px) { 
    .privacy-indicator { 
        width: 36px !important; 
        height: 36px !important; 
        min-width: 36px !important; 
        padding: 6px !important; 
        border-radius: 10px !important; 
        background: rgba(34, 197, 94, 0.1) !important; 
        border: 1px solid rgba(34, 197, 94, 0.2) !important; 
        display: flex !important; 
        align-items: center !important; 
        justify-content: center !important; 
    } 
    .theme-btn { 
        width: 36px !important; 
        height: 36px !important; 
        min-width: 36px !important; 
        padding: 6px !important; 
        border-radius: 10px !important; 
        display: flex !important; 
        align-items: center !important; 
        justify-content: center !important; 
    } 
    .header-right { 
        gap: 8px !important; 
        align-items: center !important; 
    } 
}
 
/* Tighter gap between header cards */ 
@media (max-width: 767px) { 
    .header-right { 
        gap: 4px !important; 
    } 
}
 
/* Header-left controls: dropdown and countdown stacked */ 
.header-left-controls { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    gap: 4px; 
} 
 
@media (max-width: 767px) { 
    .header-left-controls { 
        gap: 6px; 
    } 
    .countdown-timer { 
        display: flex !important; 
        font-size: 0.75rem; 
    } 
    .countdown-timer:not(.active) { 
        opacity: 0.5; 
    } 
}
 
/* Mobile header: 3-section layout with everything inline */ 
.header-center { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
} 
 
@media (max-width: 767px) { 
    .app-header { 
        padding: 0.5rem 0.75rem !important; 
    } 
    .header-left { 
        gap: 0 !important; 
    } 
    .header-center { 
        flex: 1; 
        justify-content: center; 
        gap: 6px; 
    } 
    .platform-select { 
        padding: 0.35rem 0.5rem !important; 
        font-size: 0.7rem !important; 
        min-width: auto !important; 
    } 
    .countdown-timer { 
        display: flex !important; 
        font-size: 0.7rem !important; 
        padding: 0.25rem 0.4rem !important; 
    } 
    .countdown-timer:not(.active) { 
        opacity: 0.4; 
    } 
}
 
/* Countdown timer as red card in header-right */ 
@media (max-width: 767px) { 
    .countdown-timer { 
        display: flex !important; 
        width: 36px !important; 
        height: 36px !important; 
        min-width: 36px !important; 
        padding: 0 !important; 
        border-radius: 10px !important; 
        background: rgba(239, 68, 68, 0.1) !important; 
        border: 1px solid rgba(239, 68, 68, 0.2) !important; 
        color: #EF4444 !important; 
        align-items: center !important; 
        justify-content: center !important; 
        font-size: 0.65rem !important; 
        gap: 2px !important; 
    } 
    .countdown-timer span:first-child { 
        display: none !important; 
    } 
    .countdown-timer:not(.active) { 
        opacity: 0.4; 
    } 
}
 
/* Ensure countdown timer matches shield height */ 
@media (max-width: 767px) { 
    .countdown-timer { 
        height: 36px !important; 
        min-height: 36px !important; 
        box-sizing: border-box !important; 
    } 
}
 
/* Countdown timer 10%% taller */ 
@media (max-width: 767px) { 
    .countdown-timer { 
        height: 40px !important; 
        min-height: 40px !important; 
    } 
}
 
/* Platform dropdown 40px height to match */ 
@media (max-width: 767px) { 
    .platform-select { 
        height: 40px !important; 
        min-height: 40px !important; 
    } 
}
 
/* Larger font and wider dropdown on mobile */ 
@media (max-width: 767px) { 
    .platform-select { 
        font-size: 0.85rem !important; 
        padding: 0.5rem 0.75rem !important; 
        min-width: 140px !important; 
    } 
}
 
/* Dropdown 15%% wider */ 
@media (max-width: 767px) { 
    .platform-select { 
        min-width: 160px !important; 
    } 
}
 
/* Dropdown another 15%% wider */ 
@media (max-width: 767px) { 
    .platform-select { 
        min-width: 185px !important; 
    } 
}
 
/* Override accent color to match logo blue */ 
:root { 
    --accent-color: #3B82F6 !important; 
    --accent-hover: #2563EB !important; 
} 
[data-theme=\" "dark\] { 
    --accent-color: #3B82F6 !important; 
    --accent-hover: #60A5FA !important; 
}
 
/* Time Machine button: match success green with white text */ 
#history-btn { 
    background: #10B981 !important; 
    color: white !important; 
    border-color: #10B981 !important; 
} 
#history-btn:hover { 
    background: #059669 !important; 
    border-color: #059669 !important; 
}
 
/* Fix: Time Machine button override */ 
button#history-btn.action-btn { 
    background-color: #10B981 !important; 
    color: #FFFFFF !important; 
    border-color: #10B981 !important; 
} 
button#history-btn.action-btn:hover { 
    background-color: #059669 !important; 
    border-color: #059669 !important; 
}
 
/* Override secondary button for Time Machine */ 
.action-btn.secondary#history-btn { 
    background-color: #10B981 !important; 
    color: #FFFFFF !important; 
    border-color: #10B981 !important; 
} 
.action-btn.secondary#history-btn:hover { 
    background-color: #059669 !important; 
    border-color: #059669 !important; 
}
 
/* Force white text on Time Machine button */ 
#history-btn, 
.button-group #history-btn, 
.action-btn#history-btn { 
    color: #FFFFFF !important; 
}

/* ===== ADMIN LOGIN - CENTERED DESIGN ===== */
.admin-login-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.lock-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.lock-icon {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.4);
}

.admin-access-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.admin-login-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-pass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.admin-pass-input:focus {
    outline: none;
    border-color: #60a5fa;
}

.admin-pass-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.admin-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #f87171;
    font-size: 0.875rem;
}

.admin-error.hidden {
    display: none;
}

.admin-signin-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #60a5fa;
    color: #000000;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.admin-signin-btn:hover {
    background: #3b82f6;
}

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

.admin-return-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.admin-return-btn:hover {
    color: #ffffff;
}
