/* ============================================================
   DARK MODE OVERRIDES — navy palette
   Applied via [data-theme="dark"] on <html>
   ============================================================ */

/* --- App shell & workspace layout --- */

[data-theme="dark"] .patriot-app-shell {
    background: #0d1b2a;
    --patriot-scrollbar-track: #0f2035;
    --patriot-scrollbar-thumb: rgba(56, 188, 212, 0.22);
    --patriot-scrollbar-thumb-hover: color-mix(in srgb, #38bcd4 45%, transparent);
    --patriot-scrollbar-thumb-hover-strong: color-mix(in srgb, #38bcd4 62%, transparent);
    --patriot-scrollbar-thumb-active: #38bcd4;
    --patriot-scrollbar-border: #0f2035;
}

[data-theme="dark"] .patriot-workspace {
    background: #0f2035;
    --patriot-chat-focus-panel-bg: #0f2433;
    --patriot-chat-focus-surface: #0f2d3d;
}

/* --- Sidebar --- */

[data-theme="dark"] .patriot-sidebar {
    background: #0f2035;
    border-right-color: rgba(148, 163, 184, 0.1);
    --patriot-sidebar-panel-bg: #0f2035;
}

[data-theme="dark"] .patriot-sidebar.is-personal-workspace {
    --patriot-sidebar-accent-bg: rgba(56, 188, 212, 0.1);
    --patriot-sidebar-accent-surface: #0f2d3d;
    --patriot-sidebar-accent-border: rgba(56, 188, 212, 0.2);
    --patriot-sidebar-accent-soft: rgba(56, 188, 212, 0.18);
    --patriot-sidebar-accent-soft-mid: rgba(56, 188, 212, 0.1);
    --patriot-sidebar-accent-soft-hover: rgba(56, 188, 212, 0.09);
    --patriot-sidebar-accent-soft-subtle: rgba(56, 188, 212, 0.07);
    --patriot-sidebar-accent-soft-faint: rgba(56, 188, 212, 0.05);
    --patriot-sidebar-accent-ring: rgba(56, 188, 212, 0.28);
    --patriot-sidebar-accent-focus: rgba(56, 188, 212, 0.16);
    --patriot-sidebar-brand-bg: linear-gradient(90deg, rgba(15, 45, 61, 0.98) 0%, #0f2035 100%);
}

[data-theme="dark"] .patriot-sidebar.is-team-workspace {
    --patriot-sidebar-accent-bg: rgba(255, 125, 77, 0.1);
    --patriot-sidebar-accent-surface: #2a1a12;
    --patriot-sidebar-accent-border: rgba(255, 125, 77, 0.25);
    --patriot-sidebar-accent-soft: rgba(255, 125, 77, 0.18);
    --patriot-sidebar-accent-soft-mid: rgba(255, 125, 77, 0.1);
    --patriot-sidebar-accent-soft-hover: rgba(255, 125, 77, 0.09);
    --patriot-sidebar-accent-soft-subtle: rgba(255, 125, 77, 0.07);
    --patriot-sidebar-accent-soft-faint: rgba(255, 125, 77, 0.05);
    --patriot-sidebar-accent-ring: rgba(255, 125, 77, 0.28);
    --patriot-sidebar-accent-focus: rgba(255, 125, 77, 0.16);
    --patriot-sidebar-brand-bg: linear-gradient(90deg, rgba(42, 26, 18, 0.98) 0%, #0f2035 100%);
}

[data-theme="dark"] .patriot-chat-tab-brand-byline {
    color: #ff9a6b;
}

[data-theme="dark"] .patriot-sidebar-collapse-btn {
    background: #1e3448;
    border-color: rgba(148, 163, 184, 0.22);
    color: #94a3b8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .patriot-sidebar-collapse-btn:hover {
    background: #1a3d55;
    border-color: var(--patriot-sidebar-accent, #38bcd4);
    color: #7dd3e8;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .patriot-workspace.is-sidebar-collapsed .patriot-sidebar-collapse-btn {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .patriot-sidebar-search {
    background: #0f2035;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-sidebar-search-input {
    background: #162032;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .patriot-sidebar-search-input:focus {
    background: #1c2a3d;
}

[data-theme="dark"] .patriot-sidebar-search-clear {
    color: #64748b;
}

[data-theme="dark"] .patriot-sidebar-search-meta {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-search-hit-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-sidebar-search-hit-btn:hover {
    background: rgba(255, 125, 77, 0.08);
}

[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-selected,
[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-active {
    background: linear-gradient(90deg, rgba(255, 125, 77, 0.18) 0%, rgba(42, 26, 18, 0.95) 28%, #2a1a12 100%);
    box-shadow: inset 2px 0 0 var(--optimaly-orange);
}

[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-selected .patriot-sidebar-search-hit-title,
[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-active .patriot-sidebar-search-hit-title {
    color: #ff9a6b;
    font-weight: 600;
}

[data-theme="dark"] .patriot-sidebar-search-hit-badge {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-item-snippet {
    color: #94a3b8;
}

[data-theme="dark"] mark.patriot-search-highlight,
[data-theme="dark"] .patriot-sidebar-item-snippet mark.patriot-search-highlight,
[data-theme="dark"] .patriot-sidebar-search-hit-snippet mark.patriot-search-highlight {
    background: rgba(250, 204, 21, 0.3);
    color: inherit;
}

[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-selected .patriot-sidebar-search-hit-snippet mark.patriot-search-highlight,
[data-theme="dark"] .patriot-sidebar-search-hit-btn.is-active .patriot-sidebar-search-hit-snippet mark.patriot-search-highlight {
    background: rgba(255, 125, 77, 0.32);
}

[data-theme="dark"] .patriot-message.is-search-match-active {
    box-shadow: inset 3px 0 0 var(--optimaly-orange);
}

[data-theme="dark"] .patriot-chat-messages mark.patriot-search-highlight-chat {
    background: rgba(255, 125, 77, 0.28);
    color: inherit;
}

[data-theme="dark"] .patriot-chat-messages mark.patriot-search-highlight-current {
    background: var(--optimaly-orange);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 125, 77, 0.45);
}

[data-theme="dark"] .patriot-message-user mark.patriot-search-highlight-current {
    background: #fff;
    color: #e85a24;
}

[data-theme="dark"] .patriot-chat-search-nav {
    background: #162032;
    border-top-color: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-search-nav-btn {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-chat-search-nav-btn:hover {
    border-color: rgba(56, 188, 212, 0.35);
    color: #38bcd4;
}

[data-theme="dark"] .patriot-sidebar-section {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-sidebar-tree-section::after {
    background: linear-gradient(180deg, transparent 0%, var(--patriot-sidebar-panel-bg, #0f2035) 88%);
}

[data-theme="dark"] .patriot-sidebar-inline-edit {
    background: #1c2a3d;
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-account-name {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-account-meta {
    color: #64748b;
}

[data-theme="dark"] .patriot-workspace-context-menu {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .patriot-workspace-context-item {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-workspace-context-item span {
    color: #64748b;
}

[data-theme="dark"] .patriot-workspace-context-divider {
    background: rgba(148, 163, 184, 0.1);
}

/* --- Chat messages area --- */

[data-theme="dark"] .patriot-workspace-main {
    background: #0d1b2a;
}

[data-theme="dark"] .patriot-workspace-header {
    background: #162032;
    border-bottom-color: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-chat-messages {
    background: #0d1b2a;
}

[data-theme="dark"] .patriot-message-assistant {
    background: #162032;
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-message-user {
    background: #0e4f61;
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-msg-transparency summary {
    color: #475569;
}

[data-theme="dark"] .patriot-msg-transparency dd {
    color: #cbd5e1;
}

/* --- Compose area --- */

[data-theme="dark"] .patriot-chat-compose {
    background: #162032;
}

[data-theme="dark"] .patriot-chat-compose textarea,
[data-theme="dark"] .patriot-chat-compose input {
    background: transparent;
    color: #e2e8f0;
    border-color: transparent;
}

[data-theme="dark"] .patriot-chat-compose textarea:focus,
[data-theme="dark"] .patriot-chat-compose input:focus {
    background: transparent;
    border-color: transparent;
}

[data-theme="dark"] .patriot-chat-compose textarea::placeholder,
[data-theme="dark"] .patriot-chat-compose input::placeholder {
    color: #475569;
}

/* --- Detail panel (right column) --- */

[data-theme="dark"] .patriot-detail {
    background: #0f2035;
    border-left-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-detail-header {
    background: #162032;
    border-bottom-color: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-detail-input {
    background: #0d1b2a;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .patriot-detail-input:focus {
    background: #0d1b2a;
    border-color: rgba(56, 188, 212, 0.45);
}

[data-theme="dark"] .patriot-detail-file-row {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-detail-file-row:hover:not(.is-selected) {
    background: #1c2a3d;
}

[data-theme="dark"] .patriot-memory-item {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-memory-item:hover {
    background: #1c2a3d;
}

/* --- Modals --- */

[data-theme="dark"] .patriot-modal {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .patriot-modal-header {
    background: #162032;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-modal-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-modal-body {
    color: #cbd5e1;
}

[data-theme="dark"] .patriot-modal-footer {
    background: #162032;
    border-top-color: rgba(148, 163, 184, 0.1);
}

/* Settings modal specific */

[data-theme="dark"] .patriot-settings-nav {
    background: #0f2035;
    border-right-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-settings-nav-item {
    color: #64748b;
}

[data-theme="dark"] .patriot-settings-nav-item.is-active {
    background: rgba(56, 188, 212, 0.14);
    color: #38bcd4;
}

[data-theme="dark"] .patriot-settings-nav-item:hover:not(.is-active) {
    background: rgba(226, 232, 240, 0.06);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-settings-content {
    background: #162032;
}

[data-theme="dark"] .patriot-settings-section-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-settings-content .patriot-settings-section + .patriot-settings-section {
    border-top-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-settings-action {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-settings-action:hover {
    background: #243448;
    border-color: rgba(56, 188, 212, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .patriot-settings-action-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-settings-action-hint {
    color: #64748b;
}

[data-theme="dark"] .patriot-settings-field span {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-settings-crosslink {
    color: #475569;
}

[data-theme="dark"] .patriot-settings-inline-link {
    color: #38bcd4;
}

[data-theme="dark"] .patriot-settings-inline-link:hover {
    color: #7dd3e8;
}

/* --- Inputs (global) --- */

[data-theme="dark"] .patriot-detail-input,
[data-theme="dark"] input.patriot-detail-input,
[data-theme="dark"] textarea.patriot-detail-input {
    background: #1c2a3d;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.2);
}

/* --- Buttons --- */

[data-theme="dark"] .patriot-btn-secondary {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-btn-secondary:hover:not(:disabled) {
    background: #243448;
    border-color: rgba(56, 188, 212, 0.4);
}

[data-theme="dark"] .patriot-btn-ghost {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-btn-ghost:hover:not(:disabled) {
    background: rgba(226, 232, 240, 0.07);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-icon-btn {
    color: #64748b;
}

[data-theme="dark"] .patriot-icon-btn:hover {
    background: rgba(226, 232, 240, 0.08);
    color: #94a3b8;
}

/* --- Register / auth modals --- */

[data-theme="dark"] .patriot-auth-lead {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-register-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
}

/* --- Detail muted text --- */

[data-theme="dark"] .patriot-detail-muted {
    color: #64748b;
}

/* --- Sidebar project/chat items --- */

[data-theme="dark"] .patriot-sidebar-tree-chat-btn .patriot-sidebar-item-meta {
    color: #475569;
}

[data-theme="dark"] .patriot-sidebar-tree-archive-label {
    color: #475569;
}

/* --- Security modal card --- */

[data-theme="dark"] .patriot-security-card {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-security-row--action:hover:not(:disabled) {
    background: #243448;
}

/* --- Toasts --- */

[data-theme="dark"] .patriot-toast-item {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .patriot-toast-item.is-success {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.55) 0%, #1f2937 100%);
}

[data-theme="dark"] .patriot-toast-item.is-info {
    border-color: rgba(59, 130, 246, 0.45);
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.45) 0%, #1f2937 100%);
}

[data-theme="dark"] .patriot-toast-item.is-warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.45) 0%, #1f2937 100%);
}

[data-theme="dark"] .patriot-toast-item.is-error {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.45) 0%, #1f2937 100%);
}

[data-theme="dark"] .patriot-toast {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .patriot-toast-dismiss {
    color: #475569;
}

[data-theme="dark"] .patriot-toast-dismiss:hover {
    color: #94a3b8;
}

/* --- Workspace chat welcome screen --- */

[data-theme="dark"] .patriot-workspace-welcome {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-workspace-welcome h2 {
    color: #e2e8f0;
}

/* --- Recent chat picker --- */

[data-theme="dark"] .patriot-chat-recent-picker-label {
    color: var(--patriot-sidebar-accent-strong, #38bcd4);
}

[data-theme="dark"] .patriot-chat-recent-columns {
    border-bottom-color: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

[data-theme="dark"] .patriot-chat-recent-item {
    background: transparent;
}

[data-theme="dark"] .patriot-chat-recent-item:hover {
    background: var(--patriot-sidebar-accent-soft-hover, rgba(56, 188, 212, 0.09));
}

[data-theme="dark"] .patriot-chat-recent-item:focus-visible {
    box-shadow: 0 0 0 2px var(--patriot-sidebar-accent-focus, rgba(56, 188, 212, 0.16));
}

[data-theme="dark"] .patriot-chat-recent-title {
    color: var(--patriot-sidebar-accent-strong, #38bcd4);
}

[data-theme="dark"] .patriot-chat-recent-project {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-recent-date,
[data-theme="dark"] .patriot-chat-recent-preview {
    color: #94a3b8;
}

/* --- Sidebar account bar bottom --- */

[data-theme="dark"] .patriot-sidebar-bottom {
    border-top-color: rgba(148, 163, 184, 0.1);
    background: #0f2035;
}

/* --- Theme picker (settings modal) --- */

[data-theme="dark"] .patriot-settings-theme-option {
    border-color: rgba(148, 163, 184, 0.15);
    color: #64748b;
}

[data-theme="dark"] .patriot-settings-theme-option:hover {
    border-color: rgba(56, 188, 212, 0.4);
    background: rgba(56, 188, 212, 0.07);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-settings-theme-option.is-active {
    border-color: #38bcd4;
    background: rgba(56, 188, 212, 0.12);
    color: #e2e8f0;
}

/* Specificity fix — sidebar workspace variants in dark mode */

[data-theme="dark"] .patriot-sidebar.is-personal-workspace,
[data-theme="dark"] .patriot-sidebar.is-team-workspace {
    background: #0f2035;
    --patriot-sidebar-panel-bg: #0f2035;
}

[data-theme="dark"] .patriot-project-counts-badge {
    color: #64748b;
}

[data-theme="dark"] .patriot-project-counts-badge:hover {
    color: #38bcd4;
}

[data-theme="dark"] .patriot-project-settings-input,
[data-theme="dark"] .patriot-project-settings-file-item,
[data-theme="dark"] .patriot-project-settings-chip {
    background: #132a45;
    border-color: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-project-settings-label,
[data-theme="dark"] .patriot-project-settings-file-meta {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-project-settings-file-name {
    color: #f1f5f9;
}

[data-theme="dark"] .patriot-project-settings-chip.is-active {
    border-color: rgba(56, 188, 212, 0.55);
    background: rgba(56, 188, 212, 0.12);
    color: #7dd3e8;
}

[data-theme="dark"] .patriot-project-settings-file-item.is-failed {
    background: rgba(127, 29, 29, 0.18);
    border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .patriot-btn-danger-text {
    color: #f87171;
}

[data-theme="dark"] .patriot-btn-danger-text:hover {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.12);
}

/* --- Workspace chat layout (main white areas) --- */

[data-theme="dark"] .patriot-workspace-chat-header {
    background: #162032;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-workspace-chat-header h1 {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-workspace-project-title {
    color: #f0a070;
}

[data-theme="dark"] .patriot-chat-input {
    background: #0d1b2a;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .patriot-chat-input:focus-within {
    border-color: rgba(56, 188, 212, 0.45);
    box-shadow: 0 4px 16px rgba(56, 188, 212, 0.2), 0 0 0 3px rgba(56, 188, 212, 0.12);
}

[data-theme="dark"] .patriot-chat-input textarea {
    background: transparent;
    color: #e2e8f0;
    border: none;
}

[data-theme="dark"] .patriot-chat-input textarea:focus {
    outline: none;
}

[data-theme="dark"] .patriot-chat-input textarea::placeholder {
    color: #475569;
}

[data-theme="dark"] .patriot-chat-input-send {
    background: #38bcd4;
    color: #0d1b2a;
}

[data-theme="dark"] .patriot-chat-input-send:hover:not(:disabled) {
    background: #7dd3e8;
}

[data-theme="dark"] .patriot-chat-input-send:disabled {
    background: #334155;
    color: #64748b;
    opacity: 1;
}

[data-theme="dark"] .patriot-workspace-chat-eyebrow {
    color: #64748b;
}

[data-theme="dark"] .patriot-workspace-chat-eyebrow::after {
    color: #475569;
}

[data-theme="dark"] .patriot-workspace-archived-badge,
[data-theme="dark"] .patriot-workspace-demo-badge {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .patriot-workspace-chat-panel,
[data-theme="dark"] .patriot-chat-column,
[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column {
    background: #0d1b2a;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) {
    background: #0d1b2a;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column.is-focused::before {
    content: none;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab-bar::before {
    background: linear-gradient(180deg, rgba(9, 20, 33, 0.98) 0%, #0a1520 100%);
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab-bar {
    --patriot-chat-tab-fade-color: #0a1520;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab-bar::after {
    background: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .patriot-chat-column-splitter {
    background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column-secondary {
    border-left-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column-secondary.is-focused {
    border-left-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused {
    --patriot-chat-tab-active-bg: #0d1b2a;
    --patriot-chat-tab-active-border: var(--patriot-sidebar-accent, #38bcd4);
    background: var(--patriot-chat-focus-panel-bg, #0f2433);
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused .patriot-chat-tab-bar {
    --patriot-chat-tab-active-border: rgba(148, 163, 184, 0.22);
    --patriot-chat-tab-fade-color: #0a1f2e;
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused .patriot-chat-tab-bar::before {
    background: linear-gradient(180deg, rgba(15, 36, 51, 0.98) 0%, #0a1f2e 100%);
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused .patriot-chat-tab.is-active {
    box-sizing: border-box;
    border: 2px solid var(--patriot-sidebar-accent, #38bcd4);
    border-bottom: none;
    margin-bottom: -1px;
    box-shadow: inset 0 1px 0 0 rgba(148, 163, 184, 0.22);
    z-index: 4;
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused .patriot-chat-tab.is-active .patriot-chat-tab-chat {
    color: #7dd3e8;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab.is-active {
    box-sizing: border-box;
    border: 2px solid var(--patriot-sidebar-accent, #38bcd4);
    border-bottom: none;
    margin-bottom: -1px;
    box-shadow: inset 0 1px 0 0 rgba(148, 163, 184, 0.22);
    z-index: 4;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab.is-active .patriot-chat-tab-chat {
    color: #7dd3e8;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column:not(.is-focused) .patriot-chat-tab-bar {
    --patriot-chat-tab-active-bg: #0d1b2a;
    --patriot-chat-tab-active-border: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column > .patriot-chat-window,
[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column > .patriot-landing-demo-chat-body,
[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column > .patriot-chat-column-empty:not(:has(.patriot-welcome-stage)) {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-top: none;
    box-shadow: none;
}

[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused > .patriot-chat-window,
[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused > .patriot-landing-demo-chat-body,
[data-theme="dark"] .patriot-workspace-chat-panel .patriot-chat-column.is-focused > .patriot-chat-column-empty:not(:has(.patriot-welcome-stage)) {
    border-color: var(--patriot-sidebar-accent, #38bcd4);
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column > .patriot-chat-column-empty:has(.patriot-welcome-stage) {
    box-sizing: border-box;
    border: 2px solid transparent;
    box-shadow: none;
}

[data-theme="dark"] .patriot-workspace-chat-panel.is-split .patriot-chat-column.is-focused > .patriot-chat-column-empty:has(.patriot-welcome-stage) {
    border-color: rgba(56, 188, 212, 0.35);
}

[data-theme="dark"] .patriot-chat-column.is-focused {
    background: var(--patriot-chat-focus-panel-bg, #0f2433);
    --patriot-scrollbar-track: var(--patriot-chat-focus-panel-bg, #0f2433);
    --patriot-scrollbar-border: var(--patriot-chat-focus-panel-bg, #0f2433);
}

[data-theme="dark"] .patriot-chat-column.is-focused > .patriot-chat-window,
[data-theme="dark"] .patriot-chat-column.is-focused > .patriot-chat-column-empty {
    background: var(--patriot-chat-focus-panel-bg, #0f2433);
}

[data-theme="dark"] .patriot-chat-column.is-focused .patriot-chat-messages,
[data-theme="dark"] .patriot-chat-column.is-focused .patriot-chat-compose {
    background: var(--patriot-chat-focus-panel-bg, #0f2433);
}

[data-theme="dark"] .patriot-chat-column-empty {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-column-dismiss-btn {
    background: #132337;
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-column-dismiss-btn:hover {
    background: #1a3d55;
    border-color: var(--patriot-sidebar-accent, #38bcd4);
    color: #7dd3e8;
}

[data-theme="dark"] .patriot-chat-column-empty h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-chat-column-empty-recent:has(.patriot-welcome-stage) {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(56, 188, 212, 0.08) 0%, transparent 70%);
}

/* --- Welcome / empty state --- */

[data-theme="dark"] .patriot-welcome-stage {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .patriot-welcome-head .patriot-connect-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-connect-overlay {
    background: rgba(13, 27, 42, 0.12);
}

[data-theme="dark"] .patriot-connect-overlay-reveal {
    background: rgba(13, 27, 42, 0.12);
}

[data-theme="dark"] .patriot-connect-overlay-recovery {
    background: rgba(13, 27, 42, 0.55);
}

[data-theme="dark"] .patriot-connect-stage,
[data-theme="dark"] .patriot-connect-panel {
    background: rgba(22, 32, 50, 0.97);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .patriot-connect-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-connect-detail {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-connect-done-item {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-connect-done-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-connect-done-detail {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-connect-icon {
    background: #1c2a3d;
}

[data-theme="dark"] .patriot-connect-panel-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-connect-progress {
    background: rgba(56, 188, 212, 0.15);
}

[data-theme="dark"] .patriot-connect-trust {
    border-top-color: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-connect-done-item.is-finished .patriot-connect-done-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-welcome-composer {
    background: rgba(56, 188, 212, 0.08);
    border-color: rgba(56, 188, 212, 0.2);
}

[data-theme="dark"] .patriot-welcome-composer .patriot-chat-input {
    background: #0d1b2a;
    border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .patriot-welcome-chips .patriot-landing-chip-btn {
    background: #1c2a3d;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.15);
    box-shadow: none;
}

[data-theme="dark"] .patriot-welcome-chips .patriot-landing-chip-btn:hover {
    border-color: rgba(56, 188, 212, 0.45);
    background: #243448;
}

[data-theme="dark"] .patriot-onboarding-trust-chip {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-onboarding-trust-chip.is-highlight {
    background: rgba(56, 188, 212, 0.12);
    border-color: rgba(56, 188, 212, 0.35);
    color: #7dd3e8;
    box-shadow: none;
}

/* --- Detail panel (right column) --- */

[data-theme="dark"] .patriot-detail {
    background: #0f2035;
    border-left-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-detail-header {
    background: #162032;
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-detail .patriot-transparency {
    background: #162032;
}

[data-theme="dark"] .patriot-project-hub-header {
    background: linear-gradient(180deg, rgba(56, 188, 212, 0.08) 0%, #0d1b2a 100%);
}

[data-theme="dark"] .patriot-project-hub-chat-btn {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-project-hub-chat-btn:hover,
[data-theme="dark"] .patriot-project-hub-chat-btn.is-selected {
    background: #1c2a3d;
}

[data-theme="dark"] .patriot-project-hub-chat-meta {
    color: #64748b;
}

/* --- Settings: transparency, usage, storage --- */

[data-theme="dark"] .patriot-transparency,
[data-theme="dark"] .patriot-account-transparency,
[data-theme="dark"] .patriot-settings-transparency .patriot-transparency {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-transparency h2,
[data-theme="dark"] .patriot-settings-transparency .patriot-transparency h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-transparency dt {
    color: #38bcd4;
}

[data-theme="dark"] .patriot-transparency dd {
    color: #cbd5e1;
}

[data-theme="dark"] .patriot-settings-subsection-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-usage-tier {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-usage-meter {
    background: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .patriot-usage-meter-hint {
    color: #64748b;
}

[data-theme="dark"] .patriot-storage-locked-banner {
    background: rgba(56, 188, 212, 0.1);
    border-color: rgba(56, 188, 212, 0.25);
    color: #cbd5e1;
}

[data-theme="dark"] .patriot-storage-inventory-item {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-storage-inventory-file {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-sidebar-meter-label {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-meter-value {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-sidebar-meter-bar {
    background: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .patriot-sidebar-meter-note {
    color: #64748b;
}

[data-theme="dark"] .patriot-settings-trusted-device {
    background: #162032;
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-settings-trusted-device-label {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-settings-trusted-device-meta {
    color: #64748b;
}

[data-theme="dark"] .patriot-settings-status-badge.is-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

[data-theme="dark"] .patriot-settings-status-badge.is-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-theme="dark"] .patriot-settings-status-badge.is-neutral {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-settings-status-badge.is-active {
    background: rgba(56, 188, 212, 0.15);
    color: #7dd3e8;
}

/* --- Sidebar footer, extras, credits meter --- */

[data-theme="dark"] .patriot-sidebar-footer,
[data-theme="dark"] .patriot-detail-footer {
    background: #0f2035;
    border-top-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-sidebar-extras-resizer,
[data-theme="dark"] .patriot-panel-resizer {
    background: #0f2035;
    border-top-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-sidebar-extras-resizer::before,
[data-theme="dark"] .patriot-panel-resizer::before {
    background: #475569;
}

[data-theme="dark"] .patriot-sidebar-extras {
    background: #0f2035;
}

[data-theme="dark"] .patriot-sidebar-peek-title {
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-sidebar-peek-meta,
[data-theme="dark"] .patriot-sidebar-peek-section-hint {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-peek-section-label {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-peek-section-body,
[data-theme="dark"] .patriot-sidebar-peek-list-item,
[data-theme="dark"] .patriot-sidebar-peek-memory-text {
    color: #cbd5e1;
}

[data-theme="dark"] .patriot-sidebar-peek-section:hover {
    background: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .patriot-sidebar-peek-chip {
    background: rgba(23, 162, 184, 0.16);
    color: #67e8f9;
}

[data-theme="dark"] .patriot-sidebar-peek-footer-link {
    border-top-color: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-peek-footer-link:hover {
    color: #67e8f9;
}

[data-theme="dark"] .patriot-sidebar-meter {
    background: #0f2035;
    border-top-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .patriot-account-bar-meter-bar {
    background: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .patriot-sidebar-files-title {
    color: #64748b;
}

[data-theme="dark"] .patriot-sidebar-files-row {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-files-row:hover {
    background: rgba(56, 188, 212, 0.08);
}

/* --- Chat tab bar --- */

[data-theme="dark"] .patriot-chat-tab-bar {
    background: transparent;
    border-bottom: none;
    --patriot-chat-tab-active-bg: #0d1b2a;
    --patriot-chat-tab-active-border: rgba(56, 188, 212, 0.35);
    --patriot-chat-tab-fade-color: #0f2035;
}

[data-theme="dark"] .patriot-chat-tab-bar::before {
    background: linear-gradient(180deg, #162032 0%, #0f2035 100%);
}

[data-theme="dark"] .patriot-chat-tab-bar::after {
    background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .patriot-chat-tab-brand-name {
    color: var(--patriot-sidebar-accent-strong, #38bcd4);
}

[data-theme="dark"] .patriot-chat-tab:not(.is-active) {
    background: rgba(15, 32, 53, 0.88);
    border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .patriot-chat-tab:not(.is-active):hover {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .patriot-chat-tab.is-active {
    background: var(--patriot-chat-tab-active-bg);
    border: none;
    box-shadow: inset 0 1px 0 0 var(--patriot-chat-tab-active-border);
}

[data-theme="dark"] .patriot-chat-tab-btn {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-tab-chat {
    color: #cbd5e1;
}

[data-theme="dark"] .patriot-chat-tab-project {
    color: #64748b;
}

[data-theme="dark"] .patriot-chat-tab.is-active .patriot-chat-tab-chat {
    color: #38bcd4;
}

[data-theme="dark"] .patriot-chat-tab.is-active .patriot-chat-tab-project {
    color: #94a3b8;
}

[data-theme="dark"] .patriot-chat-tab-close {
    color: #64748b;
}

[data-theme="dark"] .patriot-chat-tab-close:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
}

/* --- Mobile tab menu & drawer --- */

[data-theme="dark"] .patriot-chat-tab-mobile-menu {
    background: rgba(28, 42, 61, 0.95);
    color: #e2e8f0;
    box-shadow: inset 0 1px 0 0 rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .patriot-chat-tab-mobile-menu:hover {
    background: #1c2a3d;
    color: #38bcd4;
}

[data-theme="dark"] .patriot-sidebar-mobile-close {
    background: #1c2a3d;
    border-color: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

[data-theme="dark"] .patriot-sidebar-mobile-close:hover {
    background: rgba(56, 188, 212, 0.1);
    color: #e2e8f0;
}

[data-theme="dark"] .patriot-mobile-backdrop {
    background: rgba(0, 0, 0, 0.55);
}

@media (max-width: 1023px) {
    [data-theme="dark"] .patriot-sidebar {
        border-right-color: rgba(148, 163, 184, 0.1);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.45);
    }
}
