/* ============================================================================
   CONSOLE THEME — terminal-inspired admin/dev tool aesthetic
   See: console-ui-design.md

   - Near-black canvas with a four-step surface ramp
   - Single blue accent for all primary actions + focus
   - Rajdhani for UI, monospace for console surfaces
   - Status pills + dots + colored log lines
   - 14px card radii, 10px control radii, accent-halo focus ring
   ============================================================================ */

/* -----------------------------
   1. THEME TOKENS
   ----------------------------- */
body[data-theme="console-dark"] {
    /* Surfaces (bg → surface → panel → inset) */
    --bg: #0b0b0c;
    --bg-2: #111113;
    --bg-3: #060607;
    --surface: #0d0d0e;      /* main wrapper card */
    --panel: #131316;        /* secondary cards */
    --surface-2: #1b1b20;    /* button neutral bg */
    --inset: #0f0f12;        /* inputs / graph tiles */

    /* Ink */
    --text: #f2f2f4;
    --heading: #ffffff;
    --muted: #a7a7ad;
    --muted-2: #8b8b92;
    --text-invert: #0b0b0c;

    /* Borders */
    --line: #2a2a2f;
    --line-soft: #1f1f23;

    /* Action */
    --accent: #0099ff;
    --accent-2: #0088ee;
    --accent-3: #0077dd;
    --accent-glow: rgba(0, 153, 255, 0.18);
    --accent-ring: rgba(0, 153, 255, 0.35);
    --progress: #0099ff;

    /* Destructive */
    --danger: #dc2626;
    --danger-2: #b91c1c;
    --danger-muted: #7f1d1d;

    /* Semantic status (from console output) */
    --success: #9fe6b8;
    --warning: #ffd38a;
    --info:    #7dd3fc;
    --error:   #fca5a5;

    /* Shadow tokens — Console stays flat; only hover/modals get shadow */
    --card-shadow: 0 1px 0 rgba(255,255,255,0.02);
    --inset-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    --glass-border: var(--line);

    /* Selection */
    --selection-bg: rgba(0, 153, 255, 0.28);
    --focus-ring: 0 0 0 3px var(--accent-ring);
}

/* Console-Light — inverted but keeps the "tooling" feel.
   Surfaces stay subtle and low-contrast; accent stays the same. */
body[data-theme="console-light"] {
    --bg: #eeeef2;
    --bg-2: #f4f4f7;
    --bg-3: #e2e2e7;
    --surface: #ffffff;
    --panel: #ffffff;
    --surface-2: #e8e8ed;
    --inset: #f7f7fa;

    --text: #1a1a1d;
    --heading: #0b0b0c;
    --muted: #5d5d66;
    --muted-2: #7a7a82;
    --text-invert: #ffffff;

    --line: #d4d4d9;
    --line-soft: #e4e4e9;

    --accent: #0077d4;
    --accent-2: #0066bb;
    --accent-3: #0055a3;
    --accent-glow: rgba(0, 119, 212, 0.18);
    --accent-ring: rgba(0, 119, 212, 0.30);
    --progress: #0077d4;

    --danger: #dc2626;
    --danger-2: #b91c1c;
    --danger-muted: #fca5a5;

    --success: #0f7a3f;
    --warning: #b37500;
    --info:    #0369a1;
    --error:   #b91c1c;

    --card-shadow: 0 1px 0 rgba(0,0,0,0.02);
    --inset-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
    --glass-border: var(--line);

    --selection-bg: rgba(0, 119, 212, 0.22);
    --focus-ring: 0 0 0 3px var(--accent-ring);
}

/* -----------------------------
   2. BODY, TYPOGRAPHY, A11Y
   ----------------------------- */
body[data-theme^="console"] {
    font-family: 'Rajdhani', ui-sans-serif, system-ui, -apple-system, sans-serif;
    letter-spacing: 0.01em;
    background:
        linear-gradient(to bottom right, var(--bg-2), var(--bg), var(--bg-3));
    background-size: 100% 100%;
    color: var(--text);
}

body[data-theme^="console"] ::selection {
    background: var(--selection-bg);
    color: var(--heading);
}

body[data-theme^="console"] button,
body[data-theme^="console"] input,
body[data-theme^="console"] select,
body[data-theme^="console"] textarea {
    font-family: inherit;
    letter-spacing: 0.02em;
}

/* Signature focus ring — the thing that makes the whole system feel "console". */
body[data-theme^="console"] button:focus-visible,
body[data-theme^="console"] input:focus-visible,
body[data-theme^="console"] select:focus-visible,
body[data-theme^="console"] textarea:focus-visible,
body[data-theme^="console"] [role="button"]:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

body[data-theme^="console"] input::placeholder,
body[data-theme^="console"] textarea::placeholder {
    color: var(--muted-2);
    opacity: 0.9;
}

/* Monospace for anything that should read as "log output" */
body[data-theme^="console"] kbd,
body[data-theme^="console"] code,
body[data-theme^="console"] .mini-console,
body[data-theme^="console"] .project-last-updated {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0;
}

/* -----------------------------
   3. TOP APP BAR
   ----------------------------- */
body[data-theme^="console"] .top-app-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body[data-theme^="console"] .top-app-bar-title {
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--heading);
}

/* -----------------------------
   4. NAV BUTTON + DROPDOWN
   ----------------------------- */
body[data-theme^="console"] .menu-button {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
    transition: all 0.2s ease;
}

body[data-theme^="console"] .menu-button:hover {
    background: var(--panel);
    border-color: var(--accent);
    transform: none;
}

body[data-theme^="console"] .menu-button.active {
    background: var(--panel);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

body[data-theme^="console"] .menu-icon {
    color: var(--heading);
}

body[data-theme^="console"] .menu-dropdown {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 8px;
    min-width: 220px;
}

body[data-theme="console-light"] .menu-dropdown {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

body[data-theme^="console"] .menu-dropdown-item,
body[data-theme^="console"] .menu-dropdown a {
    margin: 2px 0;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}

body[data-theme^="console"] .menu-dropdown-item:hover,
body[data-theme^="console"] .menu-dropdown a:hover {
    background: var(--surface-2);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--line);
}

body[data-theme="console-light"] .menu-dropdown-item:hover,
body[data-theme="console-light"] .menu-dropdown a:hover {
    background: var(--inset);
}

body[data-theme^="console"] .menu-dropdown-item--danger {
    color: var(--error);
}

body[data-theme^="console"] .menu-dropdown-item--danger:hover {
    background: rgba(220, 38, 38, 0.10);
    color: var(--danger);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.25);
}

body[data-theme^="console"] .menu-dropdown-separator {
    background: var(--line);
    margin: 6px 4px;
}

body[data-theme^="console"] .menu-shortcuts-panel {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 4px 0;
}

body[data-theme^="console"] .shortcut-line {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: var(--muted);
}

body[data-theme^="console"] kbd {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    color: var(--text);
}

/* -----------------------------
   5. VIEW TOOLBAR CONTROLS
   ----------------------------- */
body[data-theme^="console"] .view-toolbar-search,
body[data-theme^="console"] .view-toolbar-select,
body[data-theme^="console"] .view-toolbar-button {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s ease;
}

body[data-theme^="console"] .view-toolbar-search:hover,
body[data-theme^="console"] .view-toolbar-select:hover {
    border-color: var(--muted-2);
}

body[data-theme^="console"] .view-toolbar-button {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
}

body[data-theme^="console"] .view-toolbar-button:hover {
    background: var(--panel);
    border-color: var(--accent);
    transform: none;
}

/* Select caret */
body[data-theme="console-dark"] .view-toolbar-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7a7ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body[data-theme="console-light"] .view-toolbar-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d5d66' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* -----------------------------
   6. COLOR MODE TOGGLE
   ----------------------------- */
body[data-theme^="console"] .color-mode-toggle {
    background: var(--surface-2);
    border: 1px solid var(--line);
}

body[data-theme^="console"] .color-mode-toggle:hover {
    border-color: var(--accent);
}

body[data-theme^="console"] .color-mode-toggle-thumb {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* -----------------------------
   7. CONTROL PANEL
   ----------------------------- */
body[data-theme^="console"] .control-panel-scroll-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
}

body[data-theme^="console"] .control-panel-header h2 {
    color: var(--heading);
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .collapse-button,
body[data-theme^="console"] .expand-button {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    padding: 6px;
    transition: all 0.2s ease;
}

body[data-theme^="console"] .collapse-button:hover,
body[data-theme^="console"] .expand-button:hover {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent);
}

body[data-theme^="console"] .panel-user-pill {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    color: var(--text);
    transition: all 0.2s ease;
}

body[data-theme^="console"] .panel-user-pill:hover {
    border-color: var(--accent);
    transform: none;
    box-shadow: 0 0 0 1px var(--accent);
}

body[data-theme^="console"] .panel-avatar,
body[data-theme^="console"] .account-avatar {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--accent);
    font-weight: 700;
}

body[data-theme^="console"] .panel-username {
    color: var(--text);
    font-weight: 600;
}

/* Display (mode toggle) row inside panel — flat, no background */
body[data-theme^="console"] .panel-display-row {
    background: transparent;
    border: none;
    border-radius: 0;
}

body[data-theme^="console"] .panel-display-label {
    color: var(--muted);
}

/* Save status — framed as a "status pill" */
body[data-theme^="console"] .save-status {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    box-shadow: none;
}

body[data-theme^="console"] .save-status--idle { color: var(--success); }
body[data-theme^="console"] .save-status--saving { color: var(--warning); }
body[data-theme^="console"] .save-status--error { color: var(--error); }

body[data-theme^="console"] .save-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: 1px;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* Stat cards */
body[data-theme^="console"] .stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

body[data-theme^="console"] .stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

body[data-theme^="console"] .stat-card.active {
    background: var(--panel);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow);
}

body[data-theme^="console"] .stat-card.active .stat-value,
body[data-theme^="console"] .stat-card.active .stat-label {
    color: var(--accent) !important;
}

body[data-theme^="console"] .stat-value {
    color: var(--heading);
    font-weight: 700;
}

body[data-theme^="console"] .stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Total completion */
body[data-theme^="console"] .total-completion-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}

body[data-theme^="console"] .total-completion-section h3,
body[data-theme^="console"] .side-panel-section h3 {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body[data-theme^="console"] .total-percentage {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 20px var(--accent-glow);
}

body[data-theme^="console"] .total-percentage-label {
    color: var(--muted);
}

/* Add Project button */
body[data-theme^="console"] .add-project-button {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: none;
    transition: all 0.2s ease;
}

body[data-theme^="console"] .add-project-button:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

body[data-theme^="console"] .undo-button {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: none;
}

body[data-theme^="console"] .undo-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: none;
}

/* Side panel sections — flat wrapper with just a heading label */
body[data-theme^="console"] .side-panel-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

body[data-theme^="console"] .section-count-pill {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    box-shadow: none;
}

body[data-theme^="console"] .section-action-button {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

body[data-theme^="console"] .section-action-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

body[data-theme^="console"] .side-panel-empty {
    color: var(--muted-2);
    font-size: 12px;
    text-align: center;
    padding: 16px 8px;
}

/* Mini sidebar cards */
body[data-theme^="console"] .saved-view-main,
body[data-theme^="console"] .side-project-card,
body[data-theme^="console"] .archived-project-card,
body[data-theme^="console"] .notification-card {
    background: var(--inset);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    box-shadow: none;
    transition: all 0.2s ease;
}

body[data-theme^="console"] .saved-view-main:hover,
body[data-theme^="console"] .side-project-card:hover,
body[data-theme^="console"] .archived-project-card:hover,
body[data-theme^="console"] .notification-card:hover {
    border-color: var(--accent);
    background: var(--surface-2);
}

/* -----------------------------
   8. PROJECT CARDS (viewport)
   ----------------------------- */
body[data-theme^="console"] .project-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

body[data-theme^="console"] .project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

body[data-theme^="console"] .project-title,
body[data-theme^="console"] .project-title-input {
    color: var(--heading);
    font-weight: 700;
}

body[data-theme^="console"] .project-title-input {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
}

body[data-theme^="console"] .project-stats,
body[data-theme^="console"] .project-last-updated,
body[data-theme^="console"] .card-owner-name,
body[data-theme^="console"] .progress-text {
    color: var(--muted);
    font-size: 11px;
}

body[data-theme^="console"] .project-last-updated {
    font-size: 10px;
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .progress-text-large {
    color: var(--accent);
    font-weight: 700;
}

body[data-theme^="console"] .progress-bar-container {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    overflow: hidden;
}

body[data-theme^="console"] .progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Tasks */
body[data-theme^="console"] .task-item {
    background: var(--inset);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    box-shadow: none;
}

body[data-theme^="console"] .task-item:hover {
    border-color: var(--line);
}

body[data-theme^="console"] .task-input {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
}

body[data-theme^="console"] .task-text {
    color: var(--text);
}

body[data-theme^="console"] .task-text.completed {
    color: var(--muted-2);
    text-decoration-color: var(--muted-2);
}

body[data-theme^="console"] .task-checkbox {
    background: var(--inset);
    border: 1px solid var(--line);
    box-shadow: none;
    border-radius: 6px;
}

body[data-theme^="console"] .task-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Card action buttons */
body[data-theme^="console"] .edit-button,
body[data-theme^="console"] .copy-button,
body[data-theme^="console"] .card-delete-button,
body[data-theme^="console"] .drag-handle,
body[data-theme^="console"] .task-drag-handle {
    color: var(--muted);
    transition: color 0.15s ease;
}

body[data-theme^="console"] .edit-button:hover,
body[data-theme^="console"] .copy-button:hover,
body[data-theme^="console"] .drag-handle:hover,
body[data-theme^="console"] .task-drag-handle:hover {
    color: var(--accent);
}

body[data-theme^="console"] .card-delete-button:hover {
    color: var(--danger);
}

/* -----------------------------
   9. EMPTY STATE
   ----------------------------- */
body[data-theme^="console"] .empty-state {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 60px 20px;
    text-align: center;
}

body[data-theme^="console"] .empty-state .title {
    color: var(--muted);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

body[data-theme^="console"] .empty-state .subtitle {
    color: var(--muted-2);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* -----------------------------
   10. FILTER CHIPS
   ----------------------------- */
body[data-theme^="console"] .filter-chip {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    box-shadow: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* -----------------------------
   11. MODALS + DIALOGS
   ----------------------------- */
body[data-theme^="console"] .modal-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body[data-theme="console-light"] .modal-overlay {
    background: rgba(10, 10, 20, 0.55);
}

body[data-theme^="console"] .modal-content,
body[data-theme^="console"] .account-modal-content,
body[data-theme^="console"] .ui-options-modal-content,
body[data-theme^="console"] .command-palette-content,
body[data-theme^="console"] .confirm-dialog {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body[data-theme^="console"] .modal-close {
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease;
}

body[data-theme^="console"] .modal-close:hover {
    background: var(--surface);
    color: var(--danger);
    transform: none;
}

body[data-theme^="console"] .account-modal-title {
    color: var(--heading);
    font-weight: 700;
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .account-modal-subtitle {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

body[data-theme^="console"] .account-input,
body[data-theme^="console"] .account-form-input,
body[data-theme^="console"] .modal-title-input,
body[data-theme^="console"] .notes-textarea,
body[data-theme^="console"] .project-select,
body[data-theme^="console"] .invite-email-input,
body[data-theme^="console"] .invite-role-select,
body[data-theme^="console"] .member-role-select,
body[data-theme^="console"] .paste-box {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    box-shadow: none;
}

body[data-theme^="console"] .account-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body[data-theme^="console"] .account-stat-card {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
}

body[data-theme^="console"] .account-action-btn,
body[data-theme^="console"] .modal-done-btn,
body[data-theme^="console"] .modal-add-task,
body[data-theme^="console"] .modal-add-task-top,
body[data-theme^="console"] .paste-button,
body[data-theme^="console"] .invite-submit-btn,
body[data-theme^="console"] .activate-button {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    box-shadow: none;
    transition: all 0.2s ease;
}

body[data-theme^="console"] .account-action-btn:hover,
body[data-theme^="console"] .modal-done-btn:hover,
body[data-theme^="console"] .paste-button:hover,
body[data-theme^="console"] .invite-submit-btn:hover,
body[data-theme^="console"] .activate-button:hover {
    background: var(--accent-2);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

body[data-theme^="console"] .account-action-btn--secondary {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}

body[data-theme^="console"] .account-action-btn--secondary:hover {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent);
}

body[data-theme^="console"] .modal-tab {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
}

body[data-theme^="console"] .modal-tab.active,
body[data-theme^="console"] .modal-tab[aria-selected="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

/* Confirm dialog */
body[data-theme^="console"] .confirm-dialog h3 {
    color: var(--heading);
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .confirm-dialog p {
    color: var(--muted);
}

body[data-theme^="console"] .confirm-cancel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
}

body[data-theme^="console"] .confirm-cancel:hover {
    background: var(--panel);
    border-color: var(--muted-2);
}

body[data-theme^="console"] .confirm-delete {
    background: var(--danger);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
}

body[data-theme^="console"] .confirm-delete:hover {
    background: var(--danger-2);
}

/* Theme cards */
body[data-theme^="console"] .theme-card {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: none;
    transition: all 0.2s ease;
    color: var(--text);
}

body[data-theme^="console"] .theme-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

body[data-theme^="console"] .theme-card.is-active {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow);
}

body[data-theme^="console"] .theme-card-title {
    color: var(--heading);
    font-weight: 700;
    letter-spacing: 0.02em;
}

body[data-theme^="console"] .theme-card-copy {
    color: var(--muted);
    font-size: 12px;
}

/* Command palette */
body[data-theme^="console"] .command-palette-input {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body[data-theme^="console"] .command-palette-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
}

body[data-theme^="console"] .command-palette-item:hover,
body[data-theme^="console"] .command-palette-item.is-active {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--accent);
}

/* -----------------------------
   12. AUTH OVERLAY
   ----------------------------- */
body[data-theme^="console"] .auth-overlay {
    background: linear-gradient(to bottom right, var(--bg-2), var(--bg), var(--bg-3));
}

body[data-theme^="console"] .auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body[data-theme^="console"] .auth-tab {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 10px;
}

body[data-theme^="console"] .auth-tab-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

body[data-theme^="console"] .auth-input {
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    box-shadow: none;
}

body[data-theme^="console"] .auth-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body[data-theme^="console"] .auth-submit {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
    box-shadow: none;
}

body[data-theme^="console"] .auth-submit:hover {
    background: var(--accent-2);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

body[data-theme^="console"] .auth-error {
    color: var(--danger);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

body[data-theme^="console"] .remember-me-label {
    color: var(--muted);
    font-size: 12px;
}

body[data-theme^="console"] .remember-me-checkbox {
    accent-color: var(--accent);
}

body[data-theme^="console"] .show-pw-btn {
    color: var(--muted);
    background: transparent;
    border: none;
}

body[data-theme^="console"] .show-pw-btn:hover {
    color: var(--accent);
}

/* -----------------------------
   13. SCROLLBARS
   ----------------------------- */
body[data-theme^="console"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body[data-theme^="console"] ::-webkit-scrollbar-track {
    background: transparent;
}

body[data-theme^="console"] ::-webkit-scrollbar-thumb {
    background: var(--line);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

body[data-theme^="console"] ::-webkit-scrollbar-thumb:hover {
    background: var(--muted-2);
    background-clip: padding-box;
}


/* ============================================================================
   CONSOLE THEME: SIDEBAR / TOGGLE / NOTIFICATION POLISH
   ============================================================================ */

body[data-theme^="console"] .control-panel .panel-display-row {
    padding: 8px 0 2px;
    margin-bottom: 18px;
}

body[data-theme^="console"] .control-panel .panel-header-actions > button:not(.collapse-button):not(.expand-button),
body[data-theme^="console"] .control-panel .panel-header-actions > .icon-button-small,
body[data-theme^="console"] .control-panel .icon-button-small {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
}

body[data-theme^="console"] .control-panel .panel-header-actions > button:not(.collapse-button):not(.expand-button):hover,
body[data-theme^="console"] .control-panel .panel-header-actions > .icon-button-small:hover,
body[data-theme^="console"] .control-panel .icon-button-small:hover {
    background: var(--panel);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 20px var(--accent-glow);
}

body[data-theme^="console"] .control-panel .control-panel-scroll-inner {
    min-height: 100%;
}

/* ============================================================================
   PATCH v5 — console cleanup: SF Mono, flat app bar, single select caret,
   flat role controls, and sidebar/settings polish
   ============================================================================ */

body[data-theme^="console"] {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Dank Mono', ui-monospace, monospace;
    letter-spacing: 0;
}

body[data-theme^="console"] .top-app-bar {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body[data-theme^="console"] .top-app-bar-title {
    font-family: inherit;
}

body[data-theme^="console"] .top-app-logo {
    filter: none;
}

body[data-theme^="console"] .view-toolbar-search,
body[data-theme^="console"] .view-toolbar-select,
body[data-theme^="console"] .view-toolbar-button {
    background-color: var(--inset);
    border: 1px solid var(--line);
    box-shadow: none;
}

body[data-theme="console-dark"] .view-toolbar-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 34px !important;
    background: var(--inset) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7a7ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 12px 12px !important;
}

body[data-theme="console-light"] .view-toolbar-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 34px !important;
    background: var(--inset) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d5d66' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 12px 12px !important;
}

body[data-theme^="console"] .view-toolbar-select::-ms-expand,
body[data-theme^="console"] .member-role-select::-ms-expand,
body[data-theme^="console"] .invite-role-select::-ms-expand {
    display: none;
}

body[data-theme^="console"] .control-panel-scroll-inner {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

body[data-theme^="console"] .panel-user-pill,
body[data-theme^="console"] .notifications-summary-card,
body[data-theme^="console"] .settings-panel-card,
body[data-theme^="console"] .sidebar-nav-card,
body[data-theme^="console"] .total-completion-section {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: none;
}

body[data-theme^="console"] .sidebar-nav-card.active {
    outline: none;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px var(--accent-glow);
}

body[data-theme^="console"] .sidebar-action-button,
body[data-theme^="console"] .section-action-button,
body[data-theme^="console"] .undo-button,
body[data-theme^="console"] .icon-button-small,
body[data-theme^="console"] .member-role-select,
body[data-theme^="console"] .invite-role-select,
body[data-theme^="console"] .member-role-badge,
body[data-theme^="console"] .role-badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: none !important;
    border-radius: 10px;
}

body[data-theme^="console"] .member-role-select,
body[data-theme^="console"] .invite-role-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 34px;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

body[data-theme="console-dark"] .member-role-select,
body[data-theme="console-dark"] .invite-role-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7a7ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body[data-theme="console-light"] .member-role-select,
body[data-theme="console-light"] .invite-role-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d5d66' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body[data-theme^="console"] .color-mode-toggle {
    width: 104px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: none;
}

body[data-theme^="console"] .color-mode-toggle-thumb {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

body[data-theme^="console"] .color-mode-toggle-option {
    color: var(--muted);
}

body[data-theme^="console"] .color-mode-toggle.is-dark .color-mode-toggle-option--dark,
body[data-theme^="console"] .color-mode-toggle:not(.is-dark) .color-mode-toggle-option--light {
    color: var(--text-invert);
}

body[data-theme^="console"] .save-status--saved,
body[data-theme^="console"] .save-status--idle {
    color: var(--success);
}


/* -----------------------------
   ROUND 9 CONSOLE REFINEMENTS
   ----------------------------- */
body[data-theme^="console"] .shared-badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--accent);
    box-shadow: none !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-slider {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-slider:before {
    background: var(--heading);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: none !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-switch input:checked + .toggle-slider {
    background: var(--surface-2);
    border-color: var(--accent);
    box-shadow: none !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-switch input:checked + .toggle-slider:before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none !important;
}

body[data-theme="console-dark"] .paste-box,
body[data-theme="console-dark"] .notes-textarea,
body[data-theme="console-dark"] .task-input,
body[data-theme="console-dark"] textarea {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

/* ROUND 10 — keep the console hide-completed toggle fully contained in-track */
body[data-theme^="console"] .hide-completed-toggle .toggle-switch {
    width: 58px !important;
    height: 30px !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-slider {
    border-radius: 999px !important;
    overflow: hidden !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-slider:before {
    top: 50% !important;
    bottom: auto !important;
    left: 2px !important;
    width: 24px !important;
    height: 24px !important;
    transform: translate3d(0, -50%, 0) !important;
    border-radius: 999px !important;
}

body[data-theme^="console"] .hide-completed-toggle .toggle-switch input:checked + .toggle-slider:before {
    transform: translate3d(30px, -50%, 0) !important;
}

/* Task tag controls */
body[data-theme^="console"] .task-sort-select,
body[data-theme^="console"] .task-custom-tag-input {
    background: rgba(4, 10, 18, 0.92);
    color: var(--heading);
    border: 1px solid rgba(90, 173, 255, 0.22);
    box-shadow: none;
}

body[data-theme^="console"] .task-tag-pill {
    border: 1px solid rgba(90, 173, 255, 0.22);
    box-shadow: none;
}

/* Browser-style tabs + task sorting controls */
body[data-theme^="console"] .modal-tabs,
body[data-theme^="console"] .auth-tabs,
body[data-theme^="console"] .task-category-tabs {
    --browser-tab-baseline: var(--line);
    --browser-tab-border: var(--line);
    --browser-tab-active-bg: var(--panel);
    --browser-tab-inactive-bg: var(--inset);
    --browser-tab-hover-bg: var(--surface-2);
}

body[data-theme^="console"] .modal-tab,
body[data-theme^="console"] .auth-tab,
body[data-theme^="console"] .task-category-tab-shell {
    border-radius: 10px 10px 0 0 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body[data-theme^="console"] .modal-tab.active,
body[data-theme^="console"] .modal-tab[aria-selected="true"],
body[data-theme^="console"] .auth-tab.auth-tab-active,
body[data-theme^="console"] .task-category-tab-shell.is-active {
    background: var(--panel) !important;
    border-color: var(--accent) !important;
    border-bottom-color: transparent !important;
    color: var(--accent) !important;
}

body[data-theme^="console"] .task-category-menu-popover {
    background: var(--panel);
    border: 1px solid var(--accent);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

body[data-theme^="console"] .task-sort-control {
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: var(--inset);
    box-shadow: none;
}

body[data-theme^="console"] .task-sort-select {
    background-color: var(--panel);
    color: var(--heading);
    border: 1px solid var(--line);
    box-shadow: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body[data-theme^="console"] .task-sort-select:hover,
body[data-theme^="console"] .task-sort-select:focus {
    border-color: var(--accent);
}

body[data-theme^="console"] .task-sort-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f2f2f4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}

body[data-theme="console-light"] .task-sort-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a1a1d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Round 25: keep project modal section buttons, category tab fixes, and no-card sort control. */
body[data-theme^="console"] .modal-tabs {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    border-bottom: 2px solid var(--surface) !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .modal-tab {
    position: relative !important;
    bottom: auto !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 0 -2px !important;
    padding: 12px !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--muted) !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

body[data-theme^="console"] .modal-tab:hover {
    color: var(--heading) !important;
    background: transparent !important;
}

body[data-theme^="console"] .modal-tab.active,
body[data-theme^="console"] .modal-tab[aria-selected="true"] {
    color: var(--heading) !important;
    border-bottom-color: var(--accent) !important;
    background: transparent !important;
}

body[data-theme^="console"] .modal-tab::after,
body[data-theme^="console"] .modal-tab.active::after,
body[data-theme^="console"] .modal-tab[aria-selected="true"]::after {
    display: none !important;
}

body[data-theme^="console"] .task-category-tabs {
    padding: 0 !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    flex-wrap: wrap !important;
}

body[data-theme^="console"] .task-category-tab-wrap--all {
    margin-left: 0 !important;
}

body[data-theme^="console"] .task-category-tab-shell--create {
    padding: 0 !important;
}

body[data-theme^="console"] .task-category-tab-shell--create .task-category-tab {
    width: 100% !important;
    min-width: 44px !important;
    min-height: 38px !important;
    padding: 0 16px !important;
}

body[data-theme^="console"] .task-category-tab-wrap.is-drop-target .task-category-tab-shell {
    border-color: var(--accent) !important;
    box-shadow: inset 0 2px 0 var(--accent), 0 0 0 3px rgba(90, 173, 255, 0.18) !important;
}

body[data-theme^="console"] .task-sort-control {
    margin-left: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Round 26 task modal polish + member-section console cleanup */
body[data-theme^="console"] .modal-tasks-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .task-category-tabs {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
}

body[data-theme^="console"] .task-category-tabs::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body[data-theme^="console"] .task-category-tab-shell {
    padding: 0 !important;
    cursor: pointer;
}

body[data-theme^="console"] .task-category-tab {
    align-self: stretch !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    cursor: pointer !important;
}

body[data-theme^="console"] .task-category-menu-button {
    align-self: stretch !important;
    min-width: 34px !important;
    min-height: 38px !important;
    padding: 0 12px 0 4px !important;
    cursor: pointer !important;
}

body[data-theme^="console"] .modal-task-controls-row {
    align-items: flex-start !important;
}

body[data-theme^="console"] .task-sort-control {
    align-items: flex-end !important;
    justify-content: flex-start !important;
}

body[data-theme^="console"] .member-row,
body[data-theme^="console"] .member-row--owner,
body[data-theme^="console"] .invite-form,
body[data-theme^="console"] .member-avatar,
body[data-theme^="console"] .member-role-select,
body[data-theme^="console"] .member-role-badge,
body[data-theme^="console"] .member-remove-btn {
    box-shadow: none !important;
}

body[data-theme^="console"] .member-row,
body[data-theme^="console"] .invite-form {
    background: var(--inset) !important;
    border: 1px solid var(--line) !important;
}

body[data-theme^="console"] .member-row--owner {
    background: var(--panel) !important;
}

body[data-theme^="console"] .member-avatar {
    background: var(--surface-2) !important;
    border: 1px solid var(--line) !important;
    color: var(--heading) !important;
}

/* ============================================================================
   ROUND 37 — Console-only toggle/status color fixes
   ============================================================================ */
body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    margin-left: auto !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle {
    position: relative !important;
    width: 56px !important;
    height: 28px !important;
    min-width: 56px !important;
    min-height: 28px !important;
    max-width: 56px !important;
    max-height: 28px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    border: 1px solid var(--line) !important;
    background: var(--surface-2) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: hidden !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-track {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    border-radius: inherit !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-option {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-thumb {
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: var(--accent) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 0 10px var(--accent-glow) !important;
    transform: translateX(0) !important;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s ease !important;
    z-index: 2 !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle.is-dark .color-mode-toggle-thumb {
    transform: translateX(28px) !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-icon {
    position: absolute !important;
    inset: auto !important;
    width: 12px !important;
    height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    color: currentColor !important;
    display: block !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-icon--moon {
    display: none !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle-icon--sun {
    display: block !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle.is-dark .color-mode-toggle-icon--moon {
    display: block !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .color-mode-toggle.is-dark .color-mode-toggle-icon--sun {
    display: none !important;
}

body[data-theme^="console"] .control-panel .sidebar-header-theme-toggle .sidebar-theme-toggle-label {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    text-align: center !important;
    color: var(--heading) !important;
    white-space: nowrap !important;
}

body[data-theme^="console"] .sidebar-total-completion-section .total-percentage,
body[data-theme^="console"] .sidebar-total-completion-section .sidebar-completion-stat strong {
    color: var(--accent) !important;
    text-shadow: 0 0 18px var(--accent-glow) !important;
}

body[data-theme^="console"] .save-status--saved,
body[data-theme^="console"] .save-status--idle {
    color: var(--accent) !important;
}


/* ============================================================================
   Stitch Console layout + exact orange accent
   ============================================================================ */

body[data-theme="console-dark"],
body[data-theme="console-light"] {
    --accent: #ff6b00;
    --accent-2: #e66000;
    --accent-3: #cc5600;
    --accent-glow: rgba(255, 107, 0, 0.18);
    --accent-ring: rgba(255, 107, 0, 0.38);
    --progress: #ff6b00;
    --selection-bg: rgba(255, 107, 0, 0.28);
}

body[data-theme="console-dark"] {
    --bg: #050506;
    --bg-2: #0b0b0d;
    --bg-3: #111114;
    --surface: #101014;
    --panel: #15151a;
    --surface-2: #1f1f26;
    --inset: #0b0b0e;
    --line: #2a2a32;
    --line-soft: #202027;
    --text: #f4f4f5;
    --heading: #ffffff;
    --muted: #a1a1aa;
    --muted-2: #71717a;
    --card-shadow: 0 18px 45px rgba(0,0,0,0.24);
}

body[data-theme="console-light"] {
    --bg: #f4f1ed;
    --bg-2: #fbfaf8;
    --bg-3: #ece8e0;
    --surface: #fffaf4;
    --panel: #ffffff;
    --surface-2: #f4eee6;
    --inset: #fbf6f0;
    --line: #e5d9cc;
    --line-soft: #efe5db;
    --text: #1c1917;
    --heading: #0c0a09;
    --muted: #6f6258;
    --muted-2: #8a7d72;
    --card-shadow: 0 18px 40px rgba(67, 45, 25, 0.10);
}

body[data-theme^="console"] {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', ui-monospace, monospace;
    background:
        radial-gradient(circle at top right, rgba(255,107,0,0.12), transparent 32rem),
        linear-gradient(135deg, var(--bg-2), var(--bg), var(--bg-3));
}

body[data-theme^="console"] .control-panel {
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255,107,0,0.045), transparent 14rem),
        var(--surface);
    box-shadow: 1px 0 0 rgba(255,255,255,0.02);
}

body[data-theme^="console"] .top-app-bar {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body[data-theme^="console"] .top-app-bar-title {
    color: var(--heading);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body[data-theme^="console"] .top-app-logo {
    filter: drop-shadow(0 0 18px var(--accent-glow));
}

body[data-theme^="console"] .viewport {
    background:
        radial-gradient(circle at 20% 0%, rgba(255,107,0,0.06), transparent 24rem),
        transparent;
}

body[data-theme^="console"] .panel-user-pill,
body[data-theme^="console"] .save-status,
body[data-theme^="console"] .sidebar-nav-card,
body[data-theme^="console"] .total-completion-section,
body[data-theme^="console"] .leaderboard-panel-card,
body[data-theme^="console"] .settings-panel-card,
body[data-theme^="console"] .project-card,
body[data-theme^="console"] .theme-card,
body[data-theme^="console"] .modal-content {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, white 4%), var(--panel));
    box-shadow: none;
}

body[data-theme^="console"] .panel-user-pill:hover,
body[data-theme^="console"] .sidebar-nav-card:hover,
body[data-theme^="console"] .sidebar-action-button:hover,
body[data-theme^="console"] .project-card:hover,
body[data-theme^="console"] .leaderboard-row:hover,
body[data-theme^="console"] .filter-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
    box-shadow: 0 0 0 1px rgba(255,107,0,0.08), 0 14px 36px rgba(255,107,0,0.08);
}

body[data-theme^="console"] .sidebar-section-label,
body[data-theme^="console"] .sidebar-section-toggle-label,
body[data-theme^="console"] .ui-options-section-label,
body[data-theme^="console"] .project-tag-controls-label,
body[data-theme^="console"] .sidebar-more-label {
    color: var(--muted-2);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body[data-theme^="console"] .add-project-button,
body[data-theme^="console"] .modal-done-btn,
body[data-theme^="console"] .auth-submit {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b0b0c;
    border-color: transparent;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(255,107,0,0.22);
}

body[data-theme^="console"] .add-project-button:hover,
body[data-theme^="console"] .modal-done-btn:hover,
body[data-theme^="console"] .auth-submit:hover {
    background: linear-gradient(135deg, #ff7d1f, var(--accent));
    color: #0b0b0c;
    transform: translateY(-1px);
}

body[data-theme^="console"] .sidebar-nav-card {
    min-height: 3rem;
    border-radius: 0.95rem;
}

body[data-theme^="console"] .sidebar-nav-card.active,
body[data-theme^="console"] .sidebar-nav-card.is-active {
    border-color: var(--accent);
    background:
        linear-gradient(90deg, rgba(255,107,0,0.18), rgba(255,107,0,0.04)),
        var(--panel);
}

body[data-theme^="console"] .sidebar-nav-card.active .sidebar-nav-card-label,
body[data-theme^="console"] .sidebar-nav-card.active .sidebar-nav-card-count,
body[data-theme^="console"] .sidebar-nav-card.is-active .sidebar-nav-card-label,
body[data-theme^="console"] .sidebar-nav-card.is-active .sidebar-nav-card-count,
body[data-theme^="console"] .total-percentage,
body[data-theme^="console"] .sidebar-completion-stat strong,
body[data-theme^="console"] .save-status,
body[data-theme^="console"] .project-sync-text {
    color: var(--accent);
}

body[data-theme^="console"] .view-toolbar-search,
body[data-theme^="console"] .view-toolbar-select,
body[data-theme^="console"] .project-tag-inline-input,
body[data-theme^="console"] input,
body[data-theme^="console"] select,
body[data-theme^="console"] textarea {
    background: var(--inset);
    border: 1px solid var(--line);
    color: var(--text);
}

body[data-theme^="console"] .view-toolbar-search:focus,
body[data-theme^="console"] .view-toolbar-select:focus,
body[data-theme^="console"] .project-tag-inline-input:focus,
body[data-theme^="console"] input:focus,
body[data-theme^="console"] select:focus,
body[data-theme^="console"] textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

body[data-theme^="console"] .filter-chip,
body[data-theme^="console"] .project-card-tag,
body[data-theme^="console"] .project-tag-chip,
body[data-theme^="console"] .project-card-status {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
    background: rgba(255,107,0,0.08);
    color: var(--accent);
}

body[data-theme^="console"] .filter-chip.is-active {
    background: var(--accent);
    color: #0b0b0c;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,0,0.16);
}

body[data-theme^="console"] .project-card {
    border-radius: 1.15rem;
}

body[data-theme^="console"] .project-card .progress-bar,
body[data-theme^="console"] .progress-bar {
    background: linear-gradient(90deg, var(--accent-3), var(--accent), #ff9a3d);
    box-shadow: 0 0 18px rgba(255,107,0,0.28);
}

body[data-theme^="console"] .progress-bar-container {
    background: var(--inset);
    border: 1px solid var(--line-soft);
}

body[data-theme^="console"] .project-preview-task,
body[data-theme^="console"] .project-preview-empty,
body[data-theme^="console"] .project-tag-controls,
body[data-theme^="console"] .leaderboard-row {
    background: var(--inset);
    border-color: var(--line-soft);
}

body[data-theme^="console"] .project-preview-check {
    border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
    color: var(--accent);
}

body[data-theme^="console"] .edit-button,
body[data-theme^="console"] .card-delete-button,
body[data-theme^="console"] .project-tag-add,
body[data-theme^="console"] .project-tag-remove,
body[data-theme^="console"] .panel-edge-toggle {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
}

body[data-theme^="console"] .edit-button:hover,
body[data-theme^="console"] .project-tag-add:hover,
body[data-theme^="console"] .project-tag-remove:hover,
body[data-theme^="console"] .panel-edge-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

body[data-theme^="console"] .card-delete-button:hover,
body[data-theme^="console"] .sidebar-action-button--danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

body[data-theme^="console"] .leaderboard-row-avatar {
    background: rgba(255,107,0,0.12);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    color: var(--accent);
}

body[data-theme^="console"] .leaderboard-row-score {
    color: var(--accent);
}

body[data-theme^="console"] .empty-state {
    border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--line));
    background: rgba(255,107,0,0.04);
}

body[data-theme^="console"] .empty-state .title {
    color: var(--heading);
}

body[data-theme^="console"] .empty-state .subtitle {
    color: var(--muted);
}

/* ==========================================================================
   Console-only Stitch refinements: fixed dark mode + synced indicator
   ========================================================================== */
body[data-theme^="console"] .ui-options-section--appearance,
body[data-theme^="console"] .color-mode-toggle,
body[data-theme^="console"] .sidebar-theme-toggle-label {
    display: none !important;
}

body[data-theme^="console"] .control-panel-header {
    align-items: center !important;
}

body[data-theme^="console"] .control-panel .panel-user-info {
    width: 100% !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.9rem !important;
}

body[data-theme^="console"] .save-status {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 0 0 auto !important;
    color: var(--accent) !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.12em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}

body[data-theme^="console"] .save-status--saved,
body[data-theme^="console"] .save-status--idle {
    font-size: 0 !important;
}

body[data-theme^="console"] .save-status--saved::after,
body[data-theme^="console"] .save-status--idle::after {
    content: "SYNCED";
    font-size: 0.72rem;
}

body[data-theme^="console"] .save-status::before {
    width: 0.6rem !important;
    height: 0.6rem !important;
    margin-right: 0.55rem !important;
    background: var(--accent) !important;
    border-radius: 999px !important;
    box-shadow: 0 0 12px var(--accent-glow) !important;
}

body[data-theme^="console"] .project-card {
    min-height: 27rem;
    border-radius: 1.35rem !important;
    padding: 1.55rem !important;
}

body[data-theme^="console"] .project-card-description-row {
    color: var(--muted-2);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

body[data-theme^="console"] .project-card-description-row strong {
    color: var(--accent);
    text-shadow: 0 0 14px var(--accent-glow);
}

body[data-theme^="console"] .project-preview-task,
body[data-theme^="console"] .project-preview-empty {
    border-radius: 0.8rem;
    background: var(--inset);
}

body[data-theme^="console"] .view-toolbar-category-select {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ========================================================================== 
   Console refinement pass: synced alignment, leaderboard rows, chip style
   ========================================================================== */
body[data-theme^="console"] .control-panel .panel-user-info {
    align-items: center !important;
}

body[data-theme^="console"] .panel-user-pill {
    flex: 0 1 auto !important;
    min-width: 0 !important;
}

body[data-theme^="console"] .save-status {
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;
    margin: 0 0 0 auto !important;
    white-space: nowrap !important;
    line-height: 1.1 !important;
}

body[data-theme^="console"] .save-status--saved::after,
body[data-theme^="console"] .save-status--idle::after {
    content: "SYNCED";
    font-size: 0.74rem;
    line-height: 1.1;
}

body[data-theme^="console"] .add-project-button,
body[data-theme^="console"] .add-project-button svg {
    color: #ffffff !important;
}

body[data-theme^="console"] .filter-chip {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2.5rem !important;
    padding: 0.7rem 1.2rem !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid var(--line) !important;
    color: var(--heading) !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .filter-chip:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line)) !important;
    color: var(--accent) !important;
    background: rgba(255,107,0,0.03) !important;
}

body[data-theme^="console"] .filter-chip.is-active {
    background: rgba(255,107,0,0.04) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: inset 0 0 0 1px rgba(255,107,0,0.06) !important;
}

body[data-theme^="console"] .leaderboard-panel-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body[data-theme^="console"] .leaderboard-list {
    display: grid !important;
    gap: 0.95rem !important;
}

body[data-theme^="console"] .leaderboard-row {
    display: grid !important;
    grid-template-columns: 1.65rem 1.6rem minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.85rem !important;
    min-height: 4rem !important;
    padding: 0.95rem 0.85rem !important;
    background: var(--inset) !important;
    border: 1px solid var(--line-soft) !important;
    border-radius: 0.9rem !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .leaderboard-row:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line)) !important;
}

body[data-theme^="console"] .leaderboard-rank {
    color: var(--muted) !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
}

body[data-theme^="console"] .leaderboard-rank--top {
    color: var(--accent) !important;
}

body[data-theme^="console"] .leaderboard-row-avatar {
    width: 1.6rem !important;
    height: 1.6rem !important;
    border-radius: 0.35rem !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid var(--line) !important;
    color: transparent !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .leaderboard-row-main,
body[data-theme^="console"] .leaderboard-meta {
    display: none !important;
}

body[data-theme^="console"] .leaderboard-user {
    display: block !important;
    min-width: 0 !important;
    color: var(--heading) !important;
    font-size: 0.98rem !important;
    font-weight: 700 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body[data-theme^="console"] .leaderboard-row-score {
    color: var(--heading) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
}

/* ==========================================================================
   Console Stitch polish overrides
   ========================================================================== */
body[data-theme^="console"] .filter-chip.is-active {
    background: var(--bg) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .add-project-button,
body[data-theme^="console"] .add-project-button svg {
    color: #ffffff !important;
}

/* ============================================================================
   Console flat-background and card-color chip overrides
   ============================================================================ */
body[data-theme^="console"] {
    background: var(--bg) !important;
}

body[data-theme^="console"] .bg-gradient {
    display: none !important;
    background: var(--bg) !important;
}

body[data-theme^="console"] .viewport,
body[data-theme^="console"] .top-app-bar {
    background: var(--bg) !important;
}

body[data-theme^="console"] .filter-chip,
body[data-theme^="console"] .filter-chip:hover,
body[data-theme^="console"] .filter-chip.is-active {
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, white 4%), var(--panel)) !important;
}

/* ============================================================================
   Console sidebar link and top-bar final overrides
   ============================================================================ */
body[data-theme^="console"] .top-app-logo {
    display: block !important;
}

body[data-theme^="console"] .sidebar-action-button,
body[data-theme^="console"] .sidebar-action-button--more {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body[data-theme^="console"] .sidebar-action-button--danger {
    color: var(--danger) !important;
}
