/* Matrix Soft+ theme */

body[data-theme="matrix"] {
  --bg: #08120d;
  --bg-2: #07100c;
  --surface: #030805;
  --surface-strong: #020704;
  --surface-muted: #040906;
  --surface-editor: #050a08;
  --border: #22352c;
  --border-strong: rgba(132, 172, 151, 0.32);
  --text: #93d6b7;
  --text-soft: #7ea994;
  --text-faint: #688777;
  --accent: #6ab391;
  --accent-soft: rgba(106, 179, 145, 0.08);
  --success: #93d6b7;
  --warning: #c8d3b3;
  --danger: #d690aa;
  --shadow-lg: 0 0 0 1px #22352c, 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 0 0 1px #22352c, 0 8px 20px rgba(0, 0, 0, 0.5);
}

body[data-theme="matrix"] {
  background:
    radial-gradient(ellipse at top left, rgba(106, 179, 145, 0.028) 0%, transparent 46%),
    radial-gradient(ellipse at bottom right, rgba(126, 169, 148, 0.018) 0%, transparent 48%),
    #08120d;
}

body[data-theme="matrix"] .sidebar-scroll,
body[data-theme="matrix"] .account-dock,
body[data-theme="matrix"] .workspace-header,
body[data-theme="matrix"] .statement-pane,
body[data-theme="matrix"] .results-dock,
body[data-theme="matrix"] .editor-shell,
body[data-theme="matrix"] .task-item,
body[data-theme="matrix"] .result-card,
body[data-theme="matrix"] .test-card,
body[data-theme="matrix"] .account-card,
body[data-theme="matrix"] .admin-task-board,
body[data-theme="matrix"] .admin-catalog-panel,
body[data-theme="matrix"] .admin-panel,
body[data-theme="matrix"] .admin-modal-panel,
body[data-theme="matrix"] .admin-catalog-create-panel,
body[data-theme="matrix"] .dataset-top-panel,
body[data-theme="matrix"] .dataset-card,
body[data-theme="matrix"] .preview-result-card,
body[data-theme="matrix"] .checkbox-row,
body[data-theme="matrix"] .admin-task-row,
body[data-theme="matrix"] .admin-builder-card,
body[data-theme="matrix"] .profile-header {
  background: none;
  border-color: transparent;
  box-shadow: none;
}
body[data-theme="matrix"] .profile-section {
  background: none;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="matrix"] .sidebar-scroll,
body[data-theme="matrix"] .account-dock,
body[data-theme="matrix"] .workspace-header,
body[data-theme="matrix"] .statement-pane,
body[data-theme="matrix"] .results-dock,
body[data-theme="matrix"] .editor-shell {
  background: #0d1a11;
  border-color: rgba(0, 255, 65, 0.22);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

/* Restore visible borders for card/row elements in dark theme
   after the global transparent-border reset above. */
body[data-theme="matrix"] .auth-panel,
body[data-theme="matrix"] .catalog-panel,
body[data-theme="matrix"] .account-card,
body[data-theme="matrix"] .task-item,
body[data-theme="matrix"] .admin-task-row,
body[data-theme="matrix"] .admin-task-board,
body[data-theme="matrix"] .admin-catalog-panel,
body[data-theme="matrix"] .admin-panel,
body[data-theme="matrix"] .admin-builder-card {
  border-color: #22352c;
}

body[data-theme="matrix"] .admin-tabs {
  background: #050a08;
  border-color: #22352c;
  box-shadow: none;
}

body[data-theme="matrix"] .text-input,
body[data-theme="matrix"] textarea,
body[data-theme="matrix"] select,
body[data-theme="matrix"] .catalog-filter-select,
body[data-theme="matrix"] .catalog-tag-filter-toggle,
body[data-theme="matrix"] .catalog-tag-filter-menu,
body[data-theme="matrix"] .filter-icon-btn,
body[data-theme="matrix"] .admin-mini-btn,
body[data-theme="matrix"] .catalog-dd-trigger,
body[data-theme="matrix"] .catalog-dd-menu,
body[data-theme="matrix"] .catalog-dd-option,
body[data-theme="matrix"] .task-list .task-item,
body[data-theme="matrix"] pre,
body[data-theme="matrix"] .chip-btn,
body[data-theme="matrix"] .ghost-btn,
body[data-theme="matrix"] .editor-user,
body[data-theme="matrix"] .editor-status,
body[data-theme="matrix"] .meta-pill,
body[data-theme="matrix"] .task-type-pill,
body[data-theme="matrix"] .soft-pill,
body[data-theme="matrix"] #logoutBtn,
body[data-theme="matrix"] #submissionStatusBadge {
  background: #030805;
  color: #7ea994;
  border-color: #2a3f35;
}

body[data-theme="matrix"] .catalog-tag-filter-menu,
body[data-theme="matrix"] .catalog-dd-menu {
  background: #020603;
  border-color: #2a3f35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9), 0 0 0 1px #2a3f35;
}

body[data-theme="matrix"] .chip-btn.active,
body[data-theme="matrix"] .catalog-tag-filter-toggle:hover,
body[data-theme="matrix"] .catalog-dd-option:hover,
body[data-theme="matrix"] .catalog-tag-filter-option:hover,
body[data-theme="matrix"] .filter-icon-btn:hover,
body[data-theme="matrix"] .admin-mini-btn:hover,
body[data-theme="matrix"] #logoutBtn:hover,
body[data-theme="matrix"] #submissionStatusBadge:hover {
  color: #a1dcc1;
  border-color: rgba(132, 172, 151, 0.58);
  box-shadow: 0 0 8px rgba(106, 179, 145, 0.14);
}

body[data-theme="matrix"] .task-item:hover {
  background: #040b07;
  border-color: #2a3f35;
}

body[data-theme="matrix"] .task-item.active {
  background: #050d08;
  border-color: rgba(132, 172, 151, 0.42);
  box-shadow: 0 0 6px rgba(106, 179, 145, 0.1);
}

body[data-theme="matrix"] .task-progress-pill.task-progress-not_started {
  color: #9aa7b1;
  background: rgba(77, 89, 97, 0.36);
  border-color: rgba(126, 138, 148, 0.45);
}

body[data-theme="matrix"] .task-progress-pill.task-progress-started {
  color: #ffd27c;
  background: rgba(113, 68, 7, 0.5);
  border-color: rgba(186, 122, 27, 0.5);
}

body[data-theme="matrix"] .task-progress-pill.task-progress-completed {
  color: #8ff2ba;
  background: rgba(18, 78, 45, 0.55);
  border-color: rgba(73, 173, 120, 0.5);
}

body[data-theme="matrix"] .meta-pill-success {
  color: #8ff2ba;
  background: rgba(18, 78, 45, 0.45);
  border-color: rgba(73, 173, 120, 0.45);
}

body[data-theme="matrix"] #submissionStatusBadge.status-accepted {
  color: #72d49c;
  background: rgba(18, 78, 45, 0.55);
  border-color: rgba(73, 173, 120, 0.5);
}

body[data-theme="matrix"] #submissionStatusBadge.status-wrong_answer {
  color: #ff9aa9;
  background: rgba(104, 24, 40, 0.55);
  border-color: rgba(209, 84, 109, 0.54);
}

body[data-theme="matrix"] .task-item.active .task-item-title,
body[data-theme="matrix"] .editor-badge,
body[data-theme="matrix"] .statement-pane .description code {
  color: #a1dcc1;
}

body[data-theme="matrix"] .primary-btn {
  color: #93d6b7;
  background: rgba(106, 179, 145, 0.1);
  border-color: rgba(132, 172, 151, 0.45);
  box-shadow: 0 0 8px rgba(106, 179, 145, 0.12);
}

body[data-theme="matrix"] .primary-btn:hover {
  background: rgba(106, 179, 145, 0.14);
  border-color: rgba(132, 172, 151, 0.62);
  box-shadow: 0 0 10px rgba(106, 179, 145, 0.16), inset 0 0 8px rgba(106, 179, 145, 0.05);
  transform: translateY(-1px);
}

body[data-theme="matrix"] .editor-actions .ghost-btn.editor-action-btn {
  color: #93d6b7;
  background: linear-gradient(180deg, #07120d 0%, #050c09 100%);
  border-color: #2d4a3c;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

body[data-theme="matrix"] .editor-actions .ghost-btn.editor-action-btn:hover {
  color: #a9e2c8;
  border-color: rgba(132, 172, 151, 0.62);
  box-shadow: 0 0 10px rgba(106, 179, 145, 0.16), inset 0 0 8px rgba(106, 179, 145, 0.05);
}

body[data-theme="matrix"] .editor-actions .primary-btn.editor-action-btn {
  color: #b6f0d6;
  background: linear-gradient(135deg, #1b5a41 0%, #114433 100%);
  border-color: #2d7a5d;
  box-shadow: 0 14px 30px rgba(12, 56, 40, 0.45);
}

body[data-theme="matrix"] .editor-actions .primary-btn.editor-action-btn:hover {
  color: #c8f8e3;
  background: linear-gradient(135deg, #22654a 0%, #16513b 100%);
  border-color: #3a9672;
}

body[data-theme="matrix"] .theme-switch {
  border-color: #2a3f35;
  background: #030805;
}

body[data-theme="matrix"] .theme-dot {
  border-color: #2a3f35;
}

body[data-theme="matrix"] .theme-dot.active {
  border-color: rgba(106, 179, 145, 0.8);
  box-shadow: 0 0 0 3px rgba(106, 179, 145, 0.22);
}

body[data-theme="matrix"] .workspace-header {
  border-color: #22352c;
}

body[data-theme="matrix"] .editor-toolbar {
  border-bottom-color: #22352c;
}

body[data-theme="matrix"] .editor-badge {
  background: rgba(106, 179, 145, 0.08);
  border-color: rgba(132, 172, 151, 0.32);
}

body[data-theme="matrix"] .code-editor-stack,
body[data-theme="matrix"] pre {
  background: #040906;
  box-shadow: inset 0 0 0 1px rgba(132, 172, 151, 0.16);
}

body[data-theme="matrix"] #codeEditorHighlight {
  color: #93d6b7;
}

body[data-theme="matrix"] #codeEditorHighlight .tok-keyword {
  color: #a1dcc1;
}

body[data-theme="matrix"] #codeEditorHighlight .tok-string {
  color: #90c3ad;
}

body[data-theme="matrix"] #codeEditorHighlight .tok-number {
  color: #7fba9f;
}

body[data-theme="matrix"] #codeEditorHighlight .tok-comment {
  color: #688777;
}

body[data-theme="matrix"] #codeEditor::selection {
  background: rgba(132, 172, 151, 0.16);
}

body[data-theme="matrix"] .workspace-title-group h1,
body[data-theme="matrix"] .task-item-title,
body[data-theme="matrix"] .account-name,
body[data-theme="matrix"] .block-header h3 {
  color: #a1dcc1;
}

body[data-theme="matrix"] .workspace-kicker,
body[data-theme="matrix"] .section-kicker,
body[data-theme="matrix"] .account-email,
body[data-theme="matrix"] .muted,
body[data-theme="matrix"] .summary-copy,
body[data-theme="matrix"] .summary-label,
body[data-theme="matrix"] .auth-message,
body[data-theme="matrix"] .text-input::placeholder,
body[data-theme="matrix"] textarea::placeholder {
  color: #688777;
}

body[data-theme="matrix"] .text-input:focus,
body[data-theme="matrix"] textarea:focus,
body[data-theme="matrix"] select:focus,
body[data-theme="matrix"] .tag-editor:focus-within {
  border-color: rgba(132, 172, 151, 0.62);
  box-shadow: 0 0 0 3px rgba(106, 179, 145, 0.16);
}

body[data-theme="matrix"] .statement-pane .description p,
body[data-theme="matrix"] .statement-pane .description li,
body[data-theme="matrix"] .statement-pane .description code,
body[data-theme="matrix"] .statement-pane .description pre {
  font-family: "IBM Plex Mono", "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #90c3ad;
}

body[data-theme="matrix"] .statement-pane .description code {
  background: rgba(106, 179, 145, 0.05);
  border: 1px solid #2a3f35;
  color: #a1dcc1;
}

body[data-theme="matrix"] .admin-tab-btn {
  color: #7ea994;
}

body[data-theme="matrix"] .admin-tab-btn:hover {
  background: rgba(106, 179, 145, 0.07);
  color: #a1dcc1;
}

body[data-theme="matrix"] .admin-tab-btn.active {
  color: #a1dcc1;
  background: rgba(106, 179, 145, 0.12);
  border-color: rgba(132, 172, 151, 0.35);
  box-shadow: none;
}

body[data-theme="matrix"] .admin-task-row:hover {
  background: #06100b;
  border-color: rgba(132, 172, 151, 0.3);
}

body[data-theme="matrix"] .dataset-card-head {
  background: rgba(106, 179, 145, 0.05);
  border-bottom-color: #22352c;
}

body[data-theme="matrix"] .sidebar-divider {
  background: linear-gradient(90deg, transparent 0%, #22352c 20%, #2a3f35 50%, #22352c 80%, transparent 100%);
}

body[data-theme="matrix"] .admin-rich-editor,
body[data-theme="matrix"] .rt-preview {
  background: rgba(6, 16, 10, 0.9);
  border-color: #2e4b39;
  color: #8cd5aa;
}

body[data-theme="matrix"] .tag-editor,
body[data-theme="matrix"] .admin-test-card,
body[data-theme="matrix"] .dataset-varname-input,
body[data-theme="matrix"] .dataset-preview-table th,
body[data-theme="matrix"] .dataset-preview-table td {
  background: #030805;
  border-color: #2a3f35;
  color: #8cd5aa;
}

body[data-theme="matrix"] .dataset-preview-table th {
  background: rgba(106, 179, 145, 0.08);
  color: #7ea994;
}

body[data-theme="matrix"] .dataset-preview-table td {
  border-bottom-color: rgba(132, 172, 151, 0.18);
}

body[data-theme="matrix"] .admin-modal-backdrop {
  background: rgba(2, 7, 4, 0.68);
  backdrop-filter: blur(3px);
}

body[data-theme="matrix"] .admin-rich-editor .ProseMirror {
  color: #8cd5aa;
}

body[data-theme="matrix"] .rt-toolbar button {
  background: rgba(6, 16, 10, 0.86);
  border-color: #2e4b39;
  color: #8cd5aa;
}

body[data-theme="matrix"] .status-accepted { color: #93d6b7; }
body[data-theme="matrix"] .status-wrong_answer,
body[data-theme="matrix"] .status-runtime_error,
body[data-theme="matrix"] .status-syntax_error { color: #d690aa; }
body[data-theme="matrix"] .status-timeout { color: #c8d3b3; }

/* Strong admin overrides for matrix palette */
body[data-theme="matrix"] #adminDatasetsPanel .admin-task-row {
  background: #030805;
  border-color: #22352c;
}

body[data-theme="matrix"] #adminDatasetsPanel .admin-task-row:hover {
  background: #06100b;
  border-color: rgba(132, 172, 151, 0.3);
}

body[data-theme="matrix"] #adminDatasetsPanel .primary-btn,
body[data-theme="matrix"] #createAdminTaskBtn {
  color: #93d6b7;
  background: rgba(106, 179, 145, 0.11);
  border-color: rgba(132, 172, 151, 0.46);
  box-shadow: 0 0 8px rgba(106, 179, 145, 0.14);
}

body[data-theme="matrix"] #adminDatasetsPanel .primary-btn:hover,
body[data-theme="matrix"] #createAdminTaskBtn:hover {
  color: #a1dcc1;
  background: rgba(106, 179, 145, 0.16);
  border-color: rgba(132, 172, 151, 0.62);
  box-shadow: 0 0 12px rgba(106, 179, 145, 0.2);
}

body[data-theme="matrix"] .catalog-action-btn {
  background: #030805;
  border-color: #2a3f35;
  color: #7ea994;
}

body[data-theme="matrix"] .catalog-action-btn:hover:not(:disabled) {
  background: #06100b;
  border-color: rgba(132, 172, 151, 0.55);
  color: #a1dcc1;
}

body[data-theme="matrix"] .catalog-action-btn.catalog-action-delete:hover:not(:disabled) {
  background: rgba(75, 28, 34, 0.5);
  border-color: rgba(214, 144, 170, 0.45);
  color: #d690aa;
}

/* ── Admin Users ── */
body[data-theme="matrix"] .admin-user-row {
  background: rgba(0, 30, 0, 0.7);
  border-color: rgba(0, 255, 65, 0.12);
}

body[data-theme="matrix"] .admin-user-row:hover {
  background: rgba(0, 40, 0, 0.85);
  border-color: rgba(0, 255, 65, 0.28);
}

body[data-theme="matrix"] .badge-pioneer {
  background: rgba(250, 176, 5, 0.08);
  color: #d4a017;
  border-color: rgba(250, 176, 5, 0.25);
}

body[data-theme="matrix"] .badge-paid {
  background: rgba(0, 255, 65, 0.08);
  color: #00b844;
  border-color: rgba(0, 255, 65, 0.2);
}

body[data-theme="matrix"] .badge-tester {
  background: rgba(0, 200, 255, 0.08);
  color: #00c8ff;
  border-color: rgba(0, 200, 255, 0.2);
}

body[data-theme="matrix"] .badge-role {
  background: rgba(0, 255, 65, 0.1);
  color: #00c95a;
  border-color: rgba(0, 255, 65, 0.28);
}

body[data-theme="matrix"] .status-badge-active {
  background: rgba(0, 255, 65, 0.08);
  color: #00b844;
  border-color: rgba(0, 255, 65, 0.2);
}

body[data-theme="matrix"] .status-badge-inactive {
  background: rgba(255, 60, 60, 0.08);
  color: #ff5050;
  border-color: rgba(255, 60, 60, 0.2);
}

body[data-theme="matrix"] .admin-error-row {
  background: rgba(0, 18, 4, 0.85);
  border-color: rgba(0, 255, 65, 0.08);
}

body[data-theme="matrix"] .admin-error-row:hover {
  border-color: rgba(255, 60, 60, 0.3);
  background: rgba(0, 22, 5, 0.95);
}

body[data-theme="matrix"] .error-level-error {
  background: rgba(255, 60, 60, 0.08);
  color: #ff5050;
  border-color: rgba(255, 60, 60, 0.25);
}

body[data-theme="matrix"] .error-level-warning {
  background: rgba(255, 204, 0, 0.07);
  color: #ffcc00;
  border-color: rgba(255, 204, 0, 0.2);
}

body[data-theme="matrix"] .error-level-info {
  background: rgba(0, 200, 255, 0.07);
  color: #00c8ff;
  border-color: rgba(0, 200, 255, 0.18);
}

body[data-theme="matrix"] .error-traceback {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 255, 65, 0.1);
  color: #00b844;
}

body[data-theme="matrix"] .error-status-badge {
  color: #ff5050;
  background: rgba(255, 60, 60, 0.07);
}

body[data-theme="matrix"] .error-type-badge {
  color: #00c8ff;
  background: rgba(0, 200, 255, 0.07);
}

body[data-theme="matrix"] .profile-stat-card,
body[data-theme="matrix"] .profile-lang-card,
body[data-theme="matrix"] .profile-submission-row {
  background: rgba(2, 20, 6, 0.78);
  border-color: rgba(0, 255, 65, 0.2);
}

body[data-theme="matrix"] .profile-stat-card:hover {
  border-color: rgba(0, 255, 65, 0.22);
  box-shadow: 0 2px 12px rgba(0, 255, 65, 0.06);
}

body[data-theme="matrix"] .profile-submission-row:hover {
  border-color: rgba(0, 255, 65, 0.22);
  background: inherit;
}

body[data-theme="matrix"] .profile-submission-row--accepted {
  background: rgba(0, 255, 65, 0.06);
  border-color: rgba(0, 255, 65, 0.28);
}

body[data-theme="matrix"] .profile-submission-row--accepted:hover {
  background: rgba(0, 255, 65, 0.09);
  border-color: rgba(0, 255, 65, 0.4);
}

body[data-theme="matrix"] .profile-submission-row--wrong {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.28);
}

body[data-theme="matrix"] .profile-submission-row--wrong:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

body[data-theme="matrix"] .profile-submission-row--error {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.25);
}

body[data-theme="matrix"] .profile-submission-row--error:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.38);
}

body[data-theme="matrix"] .profile-stat-value { color: #00ff41; }
body[data-theme="matrix"] .profile-stat-label { color: rgba(0, 200, 80, 0.5); }

body[data-theme="matrix"] .profile-back-btn { color: rgba(0, 200, 80, 0.4); }
body[data-theme="matrix"] .profile-back-btn:hover { color: rgba(0, 200, 80, 0.8); }
body[data-theme="matrix"] .profile-email { color: rgba(0, 200, 80, 0.4); }
body[data-theme="matrix"] .profile-change-password-link { color: rgba(0, 255, 65, 0.5); }
body[data-theme="matrix"] .profile-change-password-link:hover { color: #00ff41; }

body[data-theme="matrix"] .profile-password-modal-inner {
  background: #000e02;
  border-color: rgba(0, 255, 65, 0.15);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
}

body[data-theme="matrix"] .profile-result-accepted {
  background: rgba(0, 255, 65, 0.08);
  color: #00b844;
  border-color: rgba(0, 255, 65, 0.2);
}

body[data-theme="matrix"] .profile-result-wrong {
  background: rgba(255, 204, 0, 0.07);
  color: #ffcc00;
  border-color: rgba(255, 204, 0, 0.2);
}

body[data-theme="matrix"] .profile-result-error {
  background: rgba(255, 60, 60, 0.08);
  color: #ff5050;
  border-color: rgba(255, 60, 60, 0.2);
}

body[data-theme="matrix"] .profile-result-pending {
  background: rgba(0, 255, 65, 0.04);
  color: rgba(0, 200, 80, 0.6);
  border-color: rgba(0, 255, 65, 0.12);
}

body[data-theme="matrix"] .profile-submission-date { color: rgba(0, 200, 80, 0.35); }
body[data-theme="matrix"] .profile-submission-task-link:hover { color: #00ff41; }

/* ── Empty state ── */
body[data-theme="matrix"] .empty-state {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

/* ── Profile avatar ── */
body[data-theme="matrix"] .profile-avatar {
  background: linear-gradient(135deg, #2a5e45 0%, #6ab391 100%);
}

/* ── Schema pill ── */
body[data-theme="matrix"] .schema-col-pill {
  background: rgba(3, 8, 5, 0.85);
  border-color: #22352c;
}

/* ── Catalog tabs ── */
body[data-theme="matrix"] .catalog-nav-tabs {
  background: rgba(106, 179, 145, 0.08);
}

/* ── Profile new blocks ── */
body[data-theme="matrix"] .profile-level-card {
  background: linear-gradient(135deg, rgba(0,255,65,0.06), rgba(0,200,80,0.03));
  border-color: rgba(0,255,65,0.15);
}
body[data-theme="matrix"] .profile-level-title { color: #00ff41; }
body[data-theme="matrix"] .profile-level-sub { color: rgba(0,200,80,0.5); }
body[data-theme="matrix"] .profile-level-bar-wrap { background: rgba(0,255,65,0.1); }
body[data-theme="matrix"] .profile-level-bar { background: linear-gradient(90deg, #00b844, #00ff41); }
body[data-theme="matrix"] .profile-level-bar-label { color: rgba(0,200,80,0.4); }
body[data-theme="matrix"] .profile-solved-count { color: rgba(0,200,80,0.5); }
body[data-theme="matrix"] .profile-solved-count span { color: #00ff41; }

body[data-theme="matrix"] .profile-streak-inline {
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.25);
}

body[data-theme="matrix"] .profile-difficulty-wrap {
  background: rgba(2,20,6,0.78);
  border-color: rgba(0,255,65,0.15);
}
body[data-theme="matrix"] .profile-difficulty-count { color: #00ff41; }
body[data-theme="matrix"] .profile-difficulty-label { color: rgba(0,200,80,0.45); }
body[data-theme="matrix"] .profile-difficulty-bar-track { background: rgba(0,255,65,0.08); }

body[data-theme="matrix"] .profile-progress-wrap {
  background: rgba(2,20,6,0.78);
  border-color: rgba(0,255,65,0.15);
}
body[data-theme="matrix"] .profile-progress-head { color: rgba(0,200,80,0.6); }
body[data-theme="matrix"] .profile-progress-pct { color: #00ff41; }
body[data-theme="matrix"] .profile-progress-track { background: rgba(0,255,65,0.08); }
body[data-theme="matrix"] .profile-progress-fill { background: linear-gradient(90deg, #00b844, #00ff41); }

body[data-theme="matrix"] .profile-section-mini {
  background: rgba(2,20,6,0.78);
  border-color: rgba(0,255,65,0.15);
}
body[data-theme="matrix"] .profile-section-mini-label { color: rgba(0,200,80,0.4); }
body[data-theme="matrix"] .profile-tag-chip {
  background: rgba(0,255,65,0.05);
  border-color: rgba(0,255,65,0.15);
  border-radius: 8px;
}
body[data-theme="matrix"] .profile-tag-chip:hover {
  background: rgba(0,255,65,0.09);
  border-color: rgba(0,255,65,0.3);
}
body[data-theme="matrix"] .profile-tag-chip {
  background: rgba(0,255,65,0.04);
  border-color: rgba(0,255,65,0.14);
}
body[data-theme="matrix"] .profile-tag-chip:hover {
  background: rgba(0,255,65,0.09);
  border-color: rgba(0,255,65,0.28);
}
body[data-theme="matrix"] .profile-tag-name { color: rgba(0,200,80,0.85); }
body[data-theme="matrix"] .profile-tag-count {
  background: rgba(0,255,65,0.1);
  color: #00ff41;
}
body[data-theme="matrix"] .profile-lang-card {
  background: rgba(0,255,65,0.04);
  border-color: rgba(0,255,65,0.15);
}
body[data-theme="matrix"] .profile-lang-card[data-lang="python"] {
  background: rgba(0,255,65,0.05);
  border-color: rgba(0,255,65,0.18);
}
body[data-theme="matrix"] .profile-lang-card[data-lang="sql"] {
  background: rgba(0,200,200,0.04);
  border-color: rgba(0,200,200,0.15);
}
body[data-theme="matrix"] .profile-lang-num { color: #00ff41; }
body[data-theme="matrix"] .profile-lang-card[data-lang="sql"] .profile-lang-num { color: #00cccc; }
body[data-theme="matrix"] .profile-lang-grid .task-type-pill { background: rgba(0,255,65,0.07); color: #00cc44; border-color: rgba(0,255,65,0.2); }
body[data-theme="matrix"] .profile-lang-card[data-lang="sql"] .task-type-pill { background: rgba(0,200,200,0.07); color: #00aaaa; border-color: rgba(0,200,200,0.2); }

body[data-theme="matrix"] .profile-cta {
  background: linear-gradient(135deg, rgba(0,255,65,0.05), rgba(0,200,80,0.04));
  border-color: rgba(0,255,65,0.12);
  color: rgba(0,200,80,0.6);
}

body[data-theme="matrix"] .profile-section h3 { color: rgba(0,200,80,0.7); }

body[data-theme="matrix"] .catalog-nav-tab {
  color: #7ea994;
}

body[data-theme="matrix"] .catalog-nav-tab.active {
  background: #030805;
  color: #a1dcc1;
  box-shadow: 0 0 0 1px #22352c;
}

body[data-theme="matrix"] .catalog-nav-tab:hover:not(.active) {
  color: #a1dcc1;
  background: rgba(106, 179, 145, 0.06);
}

/* ── Main catalog header ── */
body[data-theme="matrix"] .main-catalog-header {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

body[data-theme="matrix"] .main-catalog-header::before {
  background: linear-gradient(180deg, #6ab391, #4a8a6a);
}

body[data-theme="matrix"] .main-catalog-header h2 {
  color: #a1dcc1;
}

body[data-theme="matrix"] .main-catalog-count {
  background: rgba(106, 179, 145, 0.1);
  color: #7ea994;
}

body[data-theme="matrix"] .main-catalog-topbar {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

body[data-theme="matrix"] .main-catalog-topbar-tabs {
  background: rgba(106, 179, 145, 0.08);
}

/* ── Task cards ── */
body[data-theme="matrix"] .main-task-card {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

body[data-theme="matrix"] .main-task-card:hover {
  background: #040b07;
  border-color: rgba(132, 172, 151, 0.42);
  box-shadow: 0 0 12px rgba(106, 179, 145, 0.1);
}

body[data-theme="matrix"] .main-task-card-accent {
  background: linear-gradient(90deg, #6ab391, #4a8a6a);
}

body[data-theme="matrix"] .main-task-card-accent.lang-python {
  background: linear-gradient(90deg, #4a8a6a, #6ab391);
}

body[data-theme="matrix"] .main-task-card-title {
  color: #a1dcc1;
}

body[data-theme="matrix"] .main-task-card-footer {
  border-top-color: #22352c;
}

/* ── Module cards ── */
body[data-theme="matrix"] .module-card {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

body[data-theme="matrix"] .module-card:hover {
  background: #040b07;
  border-color: rgba(132, 172, 151, 0.42);
  box-shadow: 0 0 12px rgba(106, 179, 145, 0.1);
}

body[data-theme="matrix"] .module-card-header {
  background: rgba(106, 179, 145, 0.05);
  border-bottom-color: #22352c;
}

body[data-theme="matrix"] .module-card-title {
  color: #a1dcc1;
}

body[data-theme="matrix"] .module-card-footer {
  border-top-color: #22352c;
}

/* ── Select option colors ── */
body[data-theme="matrix"] .catalog-filter-select option,
body[data-theme="matrix"] select option {
  background: #030805;
  color: #93d6b7;
}

/* ── Task tag chips (blue → green) ── */
body[data-theme="matrix"] .task-tag-chip {
  background: rgba(106, 179, 145, 0.08);
  color: #7ea994;
  border-color: rgba(106, 179, 145, 0.22);
}

body[data-theme="matrix"] .task-tag-chip:hover {
  background: rgba(106, 179, 145, 0.16);
  border-color: rgba(132, 172, 151, 0.42);
}

body[data-theme="matrix"] .task-tag-chip.active {
  color: #a1dcc1;
  background: rgba(106, 179, 145, 0.22);
  border-color: rgba(132, 172, 151, 0.5);
}

/* ── Task meta type pill (indigo → green) ── */
body[data-theme="matrix"] #taskMeta .task-type-pill {
  color: #a1dcc1;
  background: rgba(106, 179, 145, 0.1);
  border-color: rgba(132, 172, 151, 0.3);
}

/* ── Content block (white → dark) ── */
body[data-theme="matrix"] .content-block {
  background: #030805;
  border-color: #22352c;
}

/* ── Editor active btn (light blue → dark green) ── */
body[data-theme="matrix"] .editor-actions .editor-action-btn.is-active {
  background: linear-gradient(180deg, rgba(106, 179, 145, 0.2) 0%, rgba(74, 138, 106, 0.18) 100%);
  border-color: rgba(106, 179, 145, 0.5);
}

body[data-theme="matrix"] .editor-actions .editor-action-btn.is-active svg {
  stroke: #a1dcc1;
}

/* ── Admin tag chip (blue → green) ── */
body[data-theme="matrix"] .tag-chip {
  background: rgba(106, 179, 145, 0.1);
  color: #7ea994;
  border-color: rgba(106, 179, 145, 0.25);
}

/* ── Admin md preview (white → dark) ── */
body[data-theme="matrix"] .admin-md-preview {
  background: rgba(3, 8, 5, 0.9);
  border-color: #22352c;
}

/* ── Catalog rename form (light blue → dark) ── */
body[data-theme="matrix"] .catalog-rename-form {
  background: rgba(3, 8, 5, 0.9);
  border-color: rgba(106, 179, 145, 0.35);
}

body[data-theme="matrix"] .catalog-rename-input {
  color: #a1dcc1;
}

/* ── Admin tasks empty placeholder (light gradient → dark) ── */
body[data-theme="matrix"] #adminTasksPanel .admin-task-list > .muted {
  border-color: rgba(106, 179, 145, 0.2);
  background: rgba(3, 8, 5, 0.8);
  color: #688777;
}

/* ── Dock status colors (dark text → bright on dark) ── */
body[data-theme="matrix"] .dock-status.status-accepted {
  color: #00c85a;
  background: rgba(0, 200, 90, 0.1);
  border-color: rgba(0, 200, 90, 0.28);
}

body[data-theme="matrix"] .dock-status.status-running,
body[data-theme="matrix"] .dock-status.status-queued {
  color: #ffc040;
  background: rgba(255, 192, 64, 0.1);
  border-color: rgba(255, 192, 64, 0.28);
}

body[data-theme="matrix"] .dock-status.status-wrong_answer,
body[data-theme="matrix"] .dock-status.status-runtime_error,
body[data-theme="matrix"] .dock-status.status-syntax_error,
body[data-theme="matrix"] .dock-status.status-failed_internal,
body[data-theme="matrix"] .dock-status.status-timeout,
body[data-theme="matrix"] .dock-status.status-memory_limit,
body[data-theme="matrix"] .dock-status.status-restricted_operation {
  color: #ff6680;
  background: rgba(255, 60, 80, 0.1);
  border-color: rgba(255, 60, 80, 0.28);
}

/* ── Preview result head (blue tint → dark green tint) ── */
body[data-theme="matrix"] .preview-result-head {
  background: rgba(106, 179, 145, 0.06);
  border-bottom-color: #22352c;
}

/* ── Preview/run buttons ── */
body[data-theme="matrix"] .preview-apply-btn {
  color: #7ea994;
  background: rgba(106, 179, 145, 0.08);
  border-color: rgba(106, 179, 145, 0.3);
}

body[data-theme="matrix"] .preview-apply-btn:hover {
  background: rgba(106, 179, 145, 0.16);
}

body[data-theme="matrix"] .run-preview-btn {
  color: #7ea994;
  background: rgba(106, 179, 145, 0.06);
  border-color: rgba(106, 179, 145, 0.25);
}

body[data-theme="matrix"] .run-preview-btn:hover {
  background: rgba(106, 179, 145, 0.14);
}

/* ── CodeMirror gutters (white → dark green) ── */
body[data-theme="matrix"] #codeEditorMount .cm-gutters {
  background: #050e09 !important;
  border-right-color: #1e3028 !important;
  color: #3d6050 !important;
}

/* ── Rich-text toolbar active btn (indigo → green) ── */
body[data-theme="matrix"] .rt-toolbar button.active {
  border-color: rgba(106, 179, 145, 0.45);
  background: rgba(106, 179, 145, 0.14);
  color: #a1dcc1;
}

/* ── Catalog action active state ── */
body[data-theme="matrix"] .catalog-action-btn--active {
  background: rgba(3, 8, 5, 0.9);
  border-color: rgba(106, 179, 145, 0.35);
  color: #7ea994;
}

/* ── Dataset browser panels (white → dark) ── */
body[data-theme="matrix"] .dataset-browser-folders,
body[data-theme="matrix"] .dataset-browser-list {
  background: #030805;
  border-color: #22352c;
}

/* ── Dataset folder active row ── */
body[data-theme="matrix"] .dataset-folder-row--active {
  background: rgba(106, 179, 145, 0.1) !important;
  border-color: rgba(106, 179, 145, 0.3);
}

/* ── Dataset group heading ── */
body[data-theme="matrix"] .dataset-group-head h4 {
  color: #a1dcc1;
}

/* ── SEO sub-tabs (same pattern as admin-tabs) ── */
body[data-theme="matrix"] .seo-sub-tabs {
  background: #050a08;
  border-color: #22352c;
  box-shadow: none;
}

/* ── Module modals ── */
body[data-theme="matrix"] .modal-backdrop {
  background: rgba(2, 8, 5, 0.72);
}

body[data-theme="matrix"] .modal-box {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.08), 0 24px 60px rgba(0, 0, 0, 0.7);
}

/* New catalog filters + compact profile (2026-05-04) */
body[data-theme="matrix"] .task-filter-trigger,
body[data-theme="matrix"] .task-random-btn,
body[data-theme="matrix"] .main-module-filters .module-picker-select {
  background: rgba(3, 8, 5, 0.9);
  border-color: #22352c;
  color: #7ea994;
}

body[data-theme="matrix"] .task-filter-trigger:hover,
body[data-theme="matrix"] .task-filter-trigger.has-active-filters,
body[data-theme="matrix"] .task-random-btn:hover,
body[data-theme="matrix"] .main-module-filters .module-picker-select:hover,
body[data-theme="matrix"] .main-module-filters .module-picker-select:focus {
  background: rgba(6, 18, 11, 0.96);
  border-color: rgba(106, 179, 145, 0.45);
  color: #a1dcc1;
}

body[data-theme="matrix"] .task-active-filter-chip {
  background: rgba(106, 179, 145, 0.12);
  border-color: rgba(106, 179, 145, 0.32);
  color: #a1dcc1;
}

body[data-theme="matrix"] .task-filters-popover {
  background: #030805;
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.08), 0 22px 54px rgba(0, 0, 0, 0.72);
}

body[data-theme="matrix"] .task-filters-popover-head strong,
body[data-theme="matrix"] .task-filter-group-title {
  color: #a1dcc1;
}

body[data-theme="matrix"] .main-task-filters .catalog-tag-filter-option {
  background: rgba(6, 18, 11, 0.78);
  border-color: transparent;
  color: #93d6b7;
}

body[data-theme="matrix"] .main-task-filters .catalog-tag-filter-option:hover {
  background: rgba(106, 179, 145, 0.12);
  border-color: transparent;
  color: #a1dcc1;
}

body[data-theme="matrix"] .main-task-filters .catalog-tag-filter-menu.task-filter-options {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme="matrix"] .task-filter-options .catalog-tag-filter-empty {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(126, 169, 148, 0.52);
}

body[data-theme="matrix"] .profile-view .profile-header,
body[data-theme="matrix"] .profile-view .profile-section,
body[data-theme="matrix"] .profile-view .profile-level-card,
body[data-theme="matrix"] .profile-view .profile-difficulty-wrap,
body[data-theme="matrix"] .profile-view .profile-progress-wrap,
body[data-theme="matrix"] .profile-view .profile-section-mini,
body[data-theme="matrix"] .profile-view .profile-cta {
  background: linear-gradient(180deg, rgba(3, 8, 5, 0.96), rgba(5, 14, 9, 0.9));
  border-color: #22352c;
  box-shadow: 0 0 0 1px rgba(132, 172, 151, 0.045);
}

body[data-theme="matrix"] .profile-view .profile-name,
body[data-theme="matrix"] .profile-view .profile-section h3 {
  color: #a1dcc1;
}

body[data-theme="matrix"] .profile-view .profile-email,
body[data-theme="matrix"] .profile-view .profile-back-btn {
  color: #7ea994;
  background: rgba(3, 8, 5, 0.92);
  border-color: rgba(106, 179, 145, 0.28);
  box-shadow: none;
}

body[data-theme="matrix"] .profile-view .profile-change-password-link {
  background: rgba(106, 179, 145, 0.1);
  border-color: rgba(106, 179, 145, 0.28);
  color: #a1dcc1;
}

body[data-theme="matrix"] .profile-view .profile-change-password-link:hover {
  background: rgba(106, 179, 145, 0.22);
  color: #d7ffe9;
}

body[data-theme="matrix"] .profile-view .profile-difficulty-cell {
  background: rgba(6, 18, 11, 0.78);
  border-color: rgba(106, 179, 145, 0.16);
}

body[data-theme="matrix"] .profile-view .profile-difficulty-count {
  color: #a1dcc1;
}

/* ── AI Interview ──────────────────────────────────────────────────────── */

body[data-theme="matrix"] .ai-interview-shell {
  background: #0d1a11;
  border-color: rgba(0, 255, 65, 0.22);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="matrix"] .ai-interview-head,
body[data-theme="matrix"] .ai-interview-compose {
  background: #0d1a11;
  border-color: rgba(132, 172, 151, 0.32);
}

body[data-theme="matrix"] .ai-interview-messages {
  background: #040906;
  border-color: rgba(132, 172, 151, 0.32);
  color: #93d6b7;
}

body[data-theme="matrix"] .ai-interview-empty {
  color: #7ea994;
}

body[data-theme="matrix"] .ai-interview-answer {
  background: #030805;
  border-color: rgba(132, 172, 151, 0.42);
  color: #93d6b7;
}

body[data-theme="matrix"] .ai-interview-answer::placeholder {
  color: rgba(126, 169, 148, 0.76);
}

body[data-theme="matrix"] .ai-interview-answer:focus {
  border-color: rgba(132, 172, 151, 0.66);
  box-shadow: 0 0 0 3px rgba(106, 179, 145, 0.14);
}

body[data-theme="matrix"] .ai-interview-filter-dropdown summary {
  background: #030805;
  color: #7ea994;
  border-color: #2a3f35;
}

body[data-theme="matrix"] .ai-interview-filter-dropdown summary:hover {
  border-color: rgba(132, 172, 151, 0.58);
  color: #a1dcc1;
}

body[data-theme="matrix"] .ai-interview-filter-menu {
  background: #020603;
  border-color: #2a3f35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9), 0 0 0 1px #2a3f35;
}

body[data-theme="matrix"] .ai-interview-filter-menu label:hover {
  background: rgba(106, 179, 145, 0.14);
}

body[data-theme="matrix"] .ai-interview-msg-student .ai-interview-msg-body {
  background: #6ab391;
  color: #020704;
}

body[data-theme="matrix"] .ai-interview-msg-interviewer .ai-interview-msg-body {
  background: #040906;
  border-color: #22352c;
  color: #93d6b7;
}

body[data-theme="matrix"] .ai-interview-messages::-webkit-scrollbar-thumb {
  background: rgba(132, 172, 151, 0.32);
}

body[data-theme="matrix"] .profile-view .profile-difficulty-label {
  color: rgba(126, 169, 148, 0.66);
}

body[data-theme="matrix"] .profile-view .profile-difficulty-bar-track {
  background: rgba(106, 179, 145, 0.1);
}

body[data-theme="matrix"] .profile-view .profile-cta-btn {
  background: rgba(106, 179, 145, 0.1);
  border-color: rgba(106, 179, 145, 0.28);
  color: #a1dcc1;
  box-shadow: none;
}

body[data-theme="matrix"] .profile-view .profile-cta-btn:hover {
  background: rgba(106, 179, 145, 0.18);
  color: #d7ffe9;
}
