/* ============================================================
   Dark + soft (balanced) themes â€” html[data-theme] set inline + theme-toggle.js
   Load after global.css, notepad.css, budget.css
============================================================ */

html[data-theme="dark"]{
  color-scheme: dark;
  --border: #3d4450;
  --accent: #8ab4f8;
  --bg: #12141a;
  --text: #e8eaed;
  --surface: #1c1f28;
  --surface-muted: #252830;
  --text-muted: #9aa3b2;
  --dialog-border: rgba(255, 255, 255, 0.12);
  --dialog-surface: linear-gradient(
    180deg,
    rgba(30, 33, 42, 0.98) 0%,
    rgba(24, 27, 35, 0.98) 100%
  );
  --dialog-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 10px 26px rgba(0, 0, 0, 0.4);
  --dialog-header-bg: linear-gradient(
    180deg,
    rgba(138, 180, 248, 0.12) 0%,
    rgba(30, 33, 42, 0.98) 100%
  );
  --bb-card-border: color-mix(in srgb, var(--border) 55%, var(--accent) 45%);
  --bb-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 10px 26px rgba(0, 0, 0, 0.28);
  --bb-card-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.34),
    0 16px 36px rgba(0, 0, 0, 0.42);
  --bb-owner-action-danger: #f87171;
}

/* Balanced / hybrid: lighter surfaces than dark, still easy on the eyes (not paper-white). */
html[data-theme="soft"]{
  color-scheme: dark;
  --border: #4a5568;
  --accent: #7b9fd4;
  --bg: #2a2f3a;
  --text: #eceff4;
  --surface: #323846;
  --surface-muted: #3d4454;
  --text-muted: #a0a8b8;
  --dialog-border: rgba(255, 255, 255, 0.14);
  --dialog-surface: linear-gradient(
    180deg,
    rgba(42, 46, 56, 0.98) 0%,
    rgba(36, 40, 50, 0.98) 100%
  );
  --dialog-shadow:
    0 28px 80px rgba(0, 0, 0, 0.45),
    0 10px 26px rgba(0, 0, 0, 0.32);
  --bb-card-border: color-mix(in srgb, var(--border) 55%, var(--accent) 45%);
  --bb-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.28),
    0 10px 26px rgba(0, 0, 0, 0.26);
  --bb-card-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.32),
    0 16px 36px rgba(0, 0, 0, 0.4);
  --bb-owner-action-danger: #f87171;
  --dialog-header-bg: linear-gradient(
    180deg,
    rgba(123, 159, 212, 0.14) 0%,
    rgba(42, 46, 56, 0.98) 100%
  );
}

/* Light (standard display) â€” same token pattern as dark / soft */
html[data-theme="light"] {
  color-scheme: light;
  --border: #d2d2d2;
  --accent: #2a4d8f;
  --bg: #ffffff;
  --text: #1f2937;
  --surface: #ffffff;
  --surface-muted: #f4f6f9;
  --text-muted: #64748b;
  --dialog-border: rgba(0, 0, 0, 0.12);
  --dialog-surface:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.96) 55%, rgba(255, 255, 255, 1) 100%);
  --dialog-shadow:
    0 28px 80px rgba(0, 0, 0, 0.22),
    0 10px 26px rgba(0, 0, 0, 0.14);
  --dialog-header-bg: linear-gradient(180deg, rgba(42, 77, 143, 0.1), rgba(42, 77, 143, 0.03));
}

html[data-theme="light"] body {
  background: var(--bg) !important;
  color: var(--text);
}

html[data-theme="light"] .header,
html[data-theme="light"] .footer {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="light"] .mode-bar {
  background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="light"] .mode-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .mode-btn:hover:not(.active) {
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--accent) 6%);
}

html[data-theme="light"] .mode-btn.active {
  background: color-mix(in srgb, var(--accent) 88%, #1e3a5f);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  color: #fff;
}

html[data-theme="light"] .sticky-icon-btn,
html[data-theme="light"] .icon-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .sticky-icon-btn:hover,
html[data-theme="light"] .icon-btn:hover {
  background: color-mix(in srgb, var(--surface-muted) 80%, var(--accent) 8%);
}

html[data-theme="light"] .pill-btn {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .pill-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface-muted) 75%, var(--accent) 10%);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

html[data-theme="light"] .pill-btn.primary {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 80%, var(--border));
  color: #fff;
}

html[data-theme="light"] .pill-btn.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, #0f172a);
}

html[data-theme="light"] .modal-content h2,
html[data-theme="light"] .dialog-header-main h2 {
  color: var(--text);
}

html[data-theme="light"] .dialog-header {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] body,
html[data-theme="soft"] body {
background: var(--bg) !important;
  color: var(--text);
}

html[data-theme="dark"] .header,
html[data-theme="soft"] .header {
background-color: var(--surface);
  border-bottom-color: var(--border);
  color: var(--text);
}

/* Top nav links: use readable text, not bright accent blue */
html[data-theme="dark"] .index-header__nav-link,
html[data-theme="soft"] .index-header__nav-link,
html[data-theme="dark"] .index-header__nav-link--btn,
html[data-theme="soft"] .index-header__nav-link--btn,
html[data-theme="dark"] .public-forums-nav-link,
html[data-theme="soft"] .public-forums-nav-link,
html[data-theme="dark"] .public-forums-nav-link--btn,
html[data-theme="soft"] .public-forums-nav-link--btn {
  color: var(--text);
}

html[data-theme="dark"] .index-header__nav-link:hover,
html[data-theme="soft"] .index-header__nav-link:hover,
html[data-theme="dark"] .public-forums-nav-link:hover,
html[data-theme="soft"] .public-forums-nav-link:hover,
html[data-theme="dark"] .public-forums-nav-link--btn:hover,
html[data-theme="soft"] .public-forums-nav-link--btn:hover {
  color: var(--text);
  opacity: 0.88;
}

html[data-theme="dark"] .index-header__nav-link[aria-current="page"],
html[data-theme="soft"] .index-header__nav-link[aria-current="page"],
html[data-theme="dark"] .public-forums-nav-link[aria-current="page"],
html[data-theme="soft"] .public-forums-nav-link[aria-current="page"] {
  color: var(--accent);
  opacity: 1;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 0 var(--accent);
}

html[data-theme="dark"] .index-header__nav-sep,
html[data-theme="soft"] .index-header__nav-sep {
  color: var(--text-muted);
}

html[data-theme="dark"] .footer,
html[data-theme="soft"] .footer {
background-color: var(--surface);
  border-top-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="dark"] .mode-bar,
html[data-theme="soft"] .mode-bar {
background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .mode-btn,
html[data-theme="soft"] .mode-btn {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .mode-btn:hover:not(.active),
html[data-theme="soft"] .mode-btn:hover:not(.active) {
background: #2a2f3a;
}

html[data-theme="dark"] .mode-btn.active,
html[data-theme="soft"] .mode-btn.active {
background: #1a5a8a;
  border-color: #3d8bc4;
  color: #f0f9ff;
}

html[data-theme="dark"] .sticky-icon-btn,
html[data-theme="dark"] .icon-btn,
html[data-theme="soft"] .sticky-icon-btn ,
html[data-theme="soft"] .icon-btn {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .sticky-icon-btn:hover,
html[data-theme="soft"] .sticky-icon-btn:hover {
background: #2a2f3a;
}

html[data-theme="dark"] .icon-btn:hover,
html[data-theme="soft"] .icon-btn:hover {
background: #2a2f3a;
}

html[data-theme="dark"] .sidebar-create-btn,
html[data-theme="soft"] .sidebar-create-btn {
  background: color-mix(in srgb, var(--accent, #8ab4f8) 16%, var(--surface, #252830));
  border-color: color-mix(in srgb, var(--accent, #8ab4f8) 42%, var(--border));
  color: var(--accent, #8ab4f8);
}

html[data-theme="dark"] .sidebar-create-btn:hover:not(:disabled),
html[data-theme="soft"] .sidebar-create-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent, #8ab4f8) 28%, var(--surface, #252830));
  border-color: color-mix(in srgb, var(--accent, #8ab4f8) 62%, var(--border));
}

html[data-theme="dark"] .sticky-badge,
html[data-theme="soft"] .sticky-badge {
background: #c2410c;
  color: #fff;
}

html[data-theme="dark"] .pill-btn,
html[data-theme="soft"] .pill-btn {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .pill-btn:hover:not(:disabled),
html[data-theme="soft"] .pill-btn:hover:not(:disabled) {
background: #2a2f3a;
}

html[data-theme="dark"] .pill-btn.primary,
html[data-theme="soft"] .pill-btn.primary {
background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

/* Unclassed buttons in toolbars (e.g. Manage Personas) */
html[data-theme="dark"] .main-actions > button:not(.pill-btn),
html[data-theme="dark"] .archive-main-header button:not(.pill-btn):not(.fmt-btn),
html[data-theme="soft"] .main-actions > button:not(.pill-btn) ,
html[data-theme="soft"] .archive-main-header button:not(.pill-btn):not(.fmt-btn)  {
background: #252830;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 6px 12px;
  cursor: pointer;
}

html[data-theme="dark"] .main-actions > button:not(.pill-btn):hover,
html[data-theme="dark"] .archive-main-header button:not(.pill-btn):not(.fmt-btn):hover,
html[data-theme="soft"] .main-actions > button:not(.pill-btn):hover ,
html[data-theme="soft"] .archive-main-header button:not(.pill-btn):not(.fmt-btn):hover  {
background: #2a2f3a;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="soft"] input ,
html[data-theme="soft"] textarea ,
html[data-theme="soft"] select {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

/* #personaFilter in notepad.css uses light-only colors; needs ID-level override */
html[data-theme="dark"] #personaFilter,
html[data-theme="soft"] #personaFilter {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #personaFilter:hover,
html[data-theme="soft"] #personaFilter:hover {
border-color: var(--border);
  background: #2a2f3a;
}

html[data-theme="dark"] #personaFilter:focus,
html[data-theme="soft"] #personaFilter:focus {
outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}

html[data-theme="dark"] .archive-sidebar,
html[data-theme="dark"] #researchRoot .archive-sidebar,
html[data-theme="dark"] #groupRoot .archive-sidebar,
html[data-theme="dark"] #photoAlbumRoot .archive-sidebar,
html[data-theme="dark"] #chatRoot .archive-sidebar,
html[data-theme="soft"] .archive-sidebar ,
html[data-theme="soft"] #researchRoot .archive-sidebar ,
html[data-theme="soft"] #groupRoot .archive-sidebar ,
html[data-theme="soft"] #photoAlbumRoot .archive-sidebar ,
html[data-theme="soft"] #chatRoot .archive-sidebar  {
background: var(--surface-muted) !important;
  border-right-color: var(--border) !important;
}

html[data-theme="dark"] .detail-panel,
html[data-theme="soft"] .detail-panel {
background: var(--surface-muted);
  border-left-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .detail-panel .detail-label,
html[data-theme="dark"] .breadcrumb,
html[data-theme="soft"] .detail-panel .detail-label ,
html[data-theme="soft"] .breadcrumb  {
color: var(--text-muted);
}

html[data-theme="dark"] .breadcrumb__current,
html[data-theme="soft"] .breadcrumb__current {
  color: var(--text);
}

html[data-theme="dark"] .breadcrumb__crumb,
html[data-theme="soft"] .breadcrumb__crumb {
  color: var(--accent);
}

html[data-theme="dark"] .breadcrumb__crumb:hover,
html[data-theme="dark"] .breadcrumb__crumb:focus-visible,
html[data-theme="soft"] .breadcrumb__crumb:hover,
html[data-theme="soft"] .breadcrumb__crumb:focus-visible {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

html[data-theme="dark"] .detail-panel .detail-sharing-title,
html[data-theme="soft"] .detail-panel .detail-sharing-title  {
color: var(--accent);
}

html[data-theme="dark"] .detail-panel .detail-sharing-via,
html[data-theme="soft"] .detail-panel .detail-sharing-via  {
color: var(--text-muted);
}

html[data-theme="dark"] .archive-narrative,
html[data-theme="soft"] .archive-narrative {
color: var(--text-muted);
}

html[data-theme="dark"] .sidebar-title,
html[data-theme="soft"] .sidebar-title {
color: var(--accent);
}

html[data-theme="dark"]:not([data-a11y-view="contrast"]):not([data-a11y-view="comfort"]),
html[data-theme="soft"]:not([data-a11y-view="contrast"]):not([data-a11y-view="comfort"]) {
  --bb-sidebar-resize-line: color-mix(in srgb, var(--accent, #8ab4f8) 14%, transparent);
  --bb-sidebar-resize-line-active: color-mix(in srgb, var(--accent, #8ab4f8) 38%, transparent);
  --bb-sidebar-resize-grip: color-mix(in srgb, var(--accent, #8ab4f8) 34%, transparent);
  --bb-sidebar-resize-grip-active: color-mix(in srgb, var(--accent, #8ab4f8) 62%, transparent);
  --bb-sidebar-resize-grip-opacity: 0.52;
}

html[data-theme="dark"] .sidebar-search input,
html[data-theme="soft"] .sidebar-search input {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .sidebar-tree-toolbar,
html[data-theme="soft"] .sidebar-tree-toolbar {
border-top-color: var(--border);
}

html[data-theme="dark"] .archive-app,
html[data-theme="dark"] #groupRoot,
html[data-theme="dark"] #researchRoot,
html[data-theme="dark"] #photoAlbumRoot,
html[data-theme="soft"] .archive-app,
html[data-theme="soft"] #groupRoot,
html[data-theme="soft"] #researchRoot,
html[data-theme="soft"] #photoAlbumRoot {
  --bb-tree-hover-bg: rgba(138, 180, 248, 0.16);
  --bb-tree-hover-edge: inset 0 0 0 1px rgba(138, 180, 248, 0.3);
  --bb-tree-active-bg: rgba(59, 130, 246, 0.18);
  --bb-tree-active-hover-bg: rgba(59, 130, 246, 0.28);
  --bb-tree-active-hover-edge: inset 0 0 0 1px rgba(138, 180, 248, 0.38);
  --bb-tree-focus-ring: 0 0 0 2px rgba(138, 180, 248, 0.45);
}

html[data-theme="dark"] .archive-node:hover,
html[data-theme="dark"] .research-node:hover,
html[data-theme="dark"] #photoAlbumRoot .photo-album-node:hover,
html[data-theme="dark"] #photoAlbumRoot .photo-album-tree-photo-btn:hover,
html[data-theme="dark"] .tasks-node:hover,
html[data-theme="soft"] .archive-node:hover ,
html[data-theme="soft"] .research-node:hover ,
html[data-theme="soft"] #photoAlbumRoot .photo-album-node:hover ,
html[data-theme="soft"] #photoAlbumRoot .photo-album-tree-photo-btn:hover ,
html[data-theme="soft"] .tasks-node:hover  {
background: var(--bb-tree-hover-bg, rgba(138, 180, 248, 0.16));
}

html[data-theme="dark"] .archive-node.active,
html[data-theme="dark"] .research-node.active,
html[data-theme="dark"] #photoAlbumRoot .photo-album-node.active,
html[data-theme="dark"] #photoAlbumRoot .photo-album-tree-photo-btn.active,
html[data-theme="dark"] .tasks-node.active,
html[data-theme="soft"] .archive-node.active ,
html[data-theme="soft"] .research-node.active ,
html[data-theme="soft"] #photoAlbumRoot .photo-album-node.active ,
html[data-theme="soft"] #photoAlbumRoot .photo-album-tree-photo-btn.active ,
html[data-theme="soft"] .tasks-node.active  {
background: rgba(59, 130, 246, 0.18);
  color: var(--text);
}

/* Archive: book lens (book / chapter / page cards in sidebar) */
html[data-theme="dark"] .book-section,
html[data-theme="soft"] .book-section {
color: var(--text-muted);
}

html[data-theme="dark"] .book-archive-card,
html[data-theme="dark"] .book-chapter-card,
html[data-theme="soft"] .book-archive-card,
html[data-theme="soft"] .book-chapter-card {
  border-color: var(--border);
  border-left-color: color-mix(in srgb, var(--cab-parent) 80%, #8ab4f8);
  background: var(--surface);
  box-shadow: none;
}

html[data-theme="dark"] .book-chapter-card,
html[data-theme="soft"] .book-chapter-card {
  border-left-color: color-mix(in srgb, var(--cab-mid) 80%, #c4b5fd);
  background: color-mix(in srgb, var(--cab-mid) 10%, var(--surface));
}

html[data-theme="dark"] .book-archive-card:hover,
html[data-theme="dark"] .book-chapter-card:hover,
html[data-theme="soft"] .book-archive-card:hover,
html[data-theme="soft"] .book-chapter-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border-color: color-mix(in srgb, var(--cab-parent) 40%, rgba(138, 180, 248, 0.35));
  border-left-color: var(--cab-parent);
  background: var(--surface-muted);
}

html[data-theme="dark"] .book-archive-card.active,
html[data-theme="dark"] .book-chapter-card.active,
html[data-theme="soft"] .book-archive-card.active,
html[data-theme="soft"] .book-chapter-card.active {
  border-color: color-mix(in srgb, var(--cab-parent) 45%, rgba(138, 180, 248, 0.5));
  border-left-color: var(--cab-parent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cab-parent) 22%, transparent);
}

html[data-theme="dark"] .book-archive-card.active:hover,
html[data-theme="dark"] .book-chapter-card.active:hover,
html[data-theme="soft"] .book-archive-card.active:hover ,
html[data-theme="soft"] .book-chapter-card.active:hover  {
box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(59, 130, 246, 0.28);
}

html[data-theme="dark"] .book-caret-btn,
html[data-theme="soft"] .book-caret-btn {
color: var(--text-muted);
}

html[data-theme="dark"] .book-caret-btn:hover,
html[data-theme="soft"] .book-caret-btn:hover {
background: rgba(138, 180, 248, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .book-title-btn,
html[data-theme="soft"] .book-title-btn {
color: var(--text);
}

html[data-theme="dark"] .book-title-btn:hover,
html[data-theme="soft"] .book-title-btn:hover {
background: rgba(138, 180, 248, 0.12);
  color: var(--accent);
  box-shadow: 0 1px 0 rgba(138, 180, 248, 0.2);
}

html[data-theme="dark"] .book-meta,
html[data-theme="soft"] .book-meta {
color: var(--text-muted);
}

html[data-theme="dark"] .book-page-btn,
html[data-theme="soft"] .book-page-btn {
  border-color: color-mix(in srgb, var(--cab-child) 30%, var(--border));
  border-left-color: color-mix(in srgb, var(--cab-parent) 70%, var(--cab-child));
  background: color-mix(in srgb, var(--cab-child) 12%, var(--surface-muted));
  color: var(--text);
}

html[data-theme="dark"] .book-page-btn:hover,
html[data-theme="soft"] .book-page-btn:hover {
  background: color-mix(in srgb, var(--cab-child) 16%, rgba(138, 180, 248, 0.1));
  border-color: color-mix(in srgb, var(--cab-parent) 40%, rgba(138, 180, 248, 0.35));
  border-left-color: var(--cab-parent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .book-page-btn.active,
html[data-theme="soft"] .book-page-btn.active {
  border-color: color-mix(in srgb, var(--cab-parent) 45%, rgba(138, 180, 248, 0.45));
  border-left-color: var(--cab-parent);
  background: color-mix(in srgb, var(--cab-parent) 16%, rgba(59, 130, 246, 0.18));
  color: var(--text);
}
html[data-theme="dark"] .book-page-btn.active:hover,
html[data-theme="soft"] .book-page-btn.active:hover {
background: rgba(59, 130, 246, 0.24);
}

html[data-theme="dark"] .book-archive-card.active .book-title-btn,
html[data-theme="dark"] .book-chapter-card.active .book-title-btn,
html[data-theme="soft"] .book-archive-card.active .book-title-btn,
html[data-theme="soft"] .book-chapter-card.active .book-title-btn {
  color: #dbeafe;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.28) 0%, rgba(59, 130, 246, 0.08) 100%);
  box-shadow: inset 3px 0 0 var(--accent, #8ab4f8);
}

html[data-theme="dark"] .book-archive-card.lens-path .book-title-btn,
html[data-theme="dark"] .book-chapter-card.lens-path .book-title-btn,
html[data-theme="soft"] .book-archive-card.lens-path .book-title-btn,
html[data-theme="soft"] .book-chapter-card.lens-path .book-title-btn {
  color: var(--accent, #8ab4f8);
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 2px 0 0 rgba(138, 180, 248, 0.75);
}

html[data-theme="dark"] #archiveTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="dark"] #archiveTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="dark"] #groupTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="dark"] #groupTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="dark"] #researchTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="dark"] #researchTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #archiveTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #archiveTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #groupTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #groupTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #researchTree:has(.book-page-btn.active) .book-archive-card:not(.active):not(.lens-path) .book-title-btn,
html[data-theme="soft"] #researchTree:has(.book-page-btn.active) .book-chapter-card:not(.active):not(.lens-path) .book-title-btn {
  color: var(--text-muted);
  font-weight: 500;
}

/* Archive: drawer / workshop lens */
html[data-theme="dark"] .drawer-lens-section,
html[data-theme="soft"] .drawer-lens-section {
color: var(--text-muted);
}

html[data-theme="dark"] .drawer-cabinet,
html[data-theme="soft"] .drawer-cabinet {
  border-color: var(--border);
  border-left-color: color-mix(in srgb, var(--cab-parent) 80%, #8ab4f8);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-muted) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .drawer-cabinet:hover,
html[data-theme="soft"] .drawer-cabinet:hover {
  border-color: color-mix(in srgb, var(--cab-parent) 35%, rgba(138, 180, 248, 0.25));
  border-left-color: var(--cab-parent);
}

html[data-theme="dark"] .drawer-cabinet.active,
html[data-theme="soft"] .drawer-cabinet.active {
  border-color: color-mix(in srgb, var(--cab-parent) 45%, rgba(138, 180, 248, 0.45));
  border-left-color: var(--cab-parent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 2px color-mix(in srgb, var(--cab-parent) 20%, transparent);
}

html[data-theme="dark"] .drawer-cabinet-caret,
html[data-theme="dark"] .drawer-caret-btn,
html[data-theme="soft"] .drawer-cabinet-caret ,
html[data-theme="soft"] .drawer-caret-btn  {
color: var(--text-muted);
}

html[data-theme="dark"] .drawer-cabinet-caret:hover,
html[data-theme="dark"] .drawer-caret-btn:hover,
html[data-theme="soft"] .drawer-cabinet-caret:hover ,
html[data-theme="soft"] .drawer-caret-btn:hover  {
background: rgba(138, 180, 248, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .drawer-cabinet-title,
html[data-theme="dark"] .drawer-label-btn,
html[data-theme="soft"] .drawer-cabinet-title ,
html[data-theme="soft"] .drawer-label-btn  {
color: var(--text);
}

html[data-theme="dark"] .drawer-cabinet-title:hover,
html[data-theme="dark"] .drawer-label-btn:hover,
html[data-theme="soft"] .drawer-cabinet-title:hover ,
html[data-theme="soft"] .drawer-label-btn:hover  {
background: rgba(138, 180, 248, 0.1);
  color: var(--accent);
}

html[data-theme="dark"] .drawer-cabinet.active .drawer-cabinet-title,
html[data-theme="soft"] .drawer-cabinet.active .drawer-cabinet-title {
  color: #dbeafe;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.26) 0%, rgba(59, 130, 246, 0.06) 100%);
  box-shadow: inset 3px 0 0 var(--accent, #8ab4f8);
}

html[data-theme="dark"] .drawer-cabinet.lens-path .drawer-cabinet-title,
html[data-theme="soft"] .drawer-cabinet.lens-path .drawer-cabinet-title {
  color: var(--accent, #8ab4f8);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: inset 2px 0 0 rgba(138, 180, 248, 0.7);
}

html[data-theme="dark"] .drawer-row.active .drawer-label-btn,
html[data-theme="soft"] .drawer-row.active .drawer-label-btn {
  color: #dbeafe;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.24) 0%, rgba(59, 130, 246, 0.05) 100%);
  box-shadow: inset 3px 0 0 var(--accent, #8ab4f8);
}

html[data-theme="dark"] .drawer-row.lens-path .drawer-label-btn,
html[data-theme="soft"] .drawer-row.lens-path .drawer-label-btn {
  color: var(--accent, #8ab4f8);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 2px 0 0 rgba(138, 180, 248, 0.65);
}

html[data-theme="dark"] #archiveTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="dark"] #archiveTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn,
html[data-theme="dark"] #groupTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="dark"] #groupTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn,
html[data-theme="dark"] #researchTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="dark"] #researchTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn,
html[data-theme="soft"] #archiveTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="soft"] #archiveTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn,
html[data-theme="soft"] #groupTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="soft"] #groupTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn,
html[data-theme="soft"] #researchTree:has(.drawer-note-card.active) .drawer-cabinet:not(.active):not(.lens-path) .drawer-cabinet-title,
html[data-theme="soft"] #researchTree:has(.drawer-note-card.active) .drawer-row:not(.active):not(.lens-path) .drawer-label-btn {
  color: var(--text-muted);
  font-weight: 600;
}

html[data-theme="dark"] .drawer-cabinet-meta,
html[data-theme="dark"] .drawer-row-meta,
html[data-theme="soft"] .drawer-cabinet-meta ,
html[data-theme="soft"] .drawer-row-meta  {
color: var(--text-muted);
}

html[data-theme="dark"] .drawer-row,
html[data-theme="soft"] .drawer-row {
  border-color: var(--border);
  border-left-color: color-mix(in srgb, var(--cab-mid) 80%, #c4b5fd);
  background: color-mix(in srgb, var(--cab-mid) 10%, rgba(0, 0, 0, 0.15));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .drawer-row:hover,
html[data-theme="soft"] .drawer-row:hover {
  border-color: color-mix(in srgb, var(--cab-mid) 35%, rgba(138, 180, 248, 0.2));
  border-left-color: var(--cab-mid);
}

html[data-theme="dark"] .drawer-row.active,
html[data-theme="soft"] .drawer-row.active {
  border-color: color-mix(in srgb, var(--cab-mid) 45%, rgba(138, 180, 248, 0.4));
  border-left-color: var(--cab-mid);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 0 0 1px color-mix(in srgb, var(--cab-mid) 20%, transparent);
}

html[data-theme="dark"] .drawer-handle,
html[data-theme="soft"] .drawer-handle {
  background: repeating-linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.5) 0px,
    rgba(148, 163, 184, 0.5) 2px,
    transparent 2px,
    transparent 5px
  );
  opacity: 0.7;
}

html[data-theme="dark"] .drawer-note-card,
html[data-theme="soft"] .drawer-note-card {
  border-color: color-mix(in srgb, var(--cab-child) 28%, var(--border));
  border-left-color: color-mix(in srgb, var(--cab-parent) 70%, var(--cab-child));
  background: color-mix(in srgb, var(--cab-child) 12%, var(--surface-muted));
  color: var(--text);
}

html[data-theme="dark"] .drawer-note-card:hover,
html[data-theme="soft"] .drawer-note-card:hover {
  background: color-mix(in srgb, var(--cab-child) 14%, rgba(138, 180, 248, 0.1));
  border-color: color-mix(in srgb, var(--cab-parent) 40%, rgba(138, 180, 248, 0.35));
  border-left-color: var(--cab-parent);
}

html[data-theme="dark"] .drawer-note-card.active,
html[data-theme="soft"] .drawer-note-card.active {
  border-color: color-mix(in srgb, var(--cab-parent) 45%, rgba(138, 180, 248, 0.45));
  border-left-color: var(--cab-parent);
  background: color-mix(in srgb, var(--cab-parent) 14%, rgba(59, 130, 246, 0.18));
}

html[data-theme="dark"] .archive-app--cabinet .archive-cabinet-shell,
html[data-theme="soft"] .archive-app--cabinet .archive-cabinet-shell {
border-right-color: var(--border);
  background: linear-gradient(165deg, #1a1f2a 0%, #141820 45%, #0f1218 100%);
}

html[data-theme="dark"] .archive-cabinet-toolbar,
html[data-theme="soft"] .archive-cabinet-toolbar {
background: rgba(0, 0, 0, 0.25);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .archive-cabinet-badge,
html[data-theme="soft"] .archive-cabinet-badge {
color: var(--text-muted);
}

html[data-theme="dark"] .archive-cabinet-context,
html[data-theme="soft"] .archive-cabinet-context {
color: var(--text-muted);
}

html[data-theme="dark"] .archive-cabinet-archive-select,
html[data-theme="soft"] .archive-cabinet-archive-select {
background: rgba(30, 36, 48, 0.95);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .archive-cabinet-hint,
html[data-theme="soft"] .archive-cabinet-hint {
color: rgba(200, 210, 230, 0.65);
  background: rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .archive-cabinet-empty,
html[data-theme="soft"] .archive-cabinet-empty {
color: var(--text-muted);
}

html[data-theme="dark"] .cabinet-block,
html[data-theme="soft"] .cabinet-block {
  background: linear-gradient(180deg, #1e2430 0%, #181d28 100%);
  border-color: var(--border);
  border-left-color: color-mix(in srgb, var(--cab-parent) 85%, #8ab4f8);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .cabinet-face-name,
html[data-theme="soft"] .cabinet-face-name {
  color: var(--text);
  border-bottom-color: color-mix(in srgb, var(--cab-parent) 80%, transparent);
}

html[data-theme="dark"] .cabinet-face-meta,
html[data-theme="dark"] .cabinet-peek,
html[data-theme="soft"] .cabinet-face-meta,
html[data-theme="soft"] .cabinet-peek {
  color: var(--text-muted);
}

html[data-theme="dark"] .cabinet-interior,
html[data-theme="soft"] .cabinet-interior {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--cab-parent) 12%, rgba(0, 0, 0, 0.28)) 0%,
    rgba(0, 0, 0, 0.22) 100%
  );
  border-top-color: color-mix(in srgb, var(--cab-parent) 28%, var(--border));
}

html[data-theme="dark"] .cabinet-shelf-head,
html[data-theme="soft"] .cabinet-shelf-head {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--cab-mid) 22%, rgba(255, 255, 255, 0.06)) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border-color: color-mix(in srgb, var(--cab-mid) 35%, var(--border));
  border-left-color: color-mix(in srgb, var(--cab-mid) 88%, #c4b5fd);
  color: color-mix(in srgb, var(--cab-mid) 35%, var(--text));
}

html[data-theme="dark"] .cabinet-shelf-head:hover,
html[data-theme="soft"] .cabinet-shelf-head:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--cab-mid) 28%, rgba(255, 255, 255, 0.08)) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
}

html[data-theme="dark"] .cabinet-shelf-count,
html[data-theme="soft"] .cabinet-shelf-count {
  color: color-mix(in srgb, var(--cab-mid) 40%, var(--text-muted));
  background: color-mix(in srgb, var(--cab-mid) 16%, rgba(255, 255, 255, 0.06));
}

html[data-theme="dark"] .cabinet-shelf-rack,
html[data-theme="soft"] .cabinet-shelf-rack {
  border-left-color: color-mix(in srgb, var(--cab-child) 45%, transparent);
}

html[data-theme="dark"] .cabinet-note-card,
html[data-theme="soft"] .cabinet-note-card {
  background: color-mix(in srgb, var(--cab-child) 14%, rgba(22, 30, 48, 0.92));
  border-color: color-mix(in srgb, var(--cab-child) 35%, rgba(100, 140, 200, 0.22));
  border-left-color: color-mix(in srgb, var(--cab-parent) 75%, var(--cab-child));
  color: var(--text);
}

html[data-theme="dark"] .cabinet-note-card:hover,
html[data-theme="soft"] .cabinet-note-card:hover {
  border-color: color-mix(in srgb, var(--cab-parent) 50%, rgba(170, 205, 255, 0.65));
  border-left-color: var(--cab-parent);
  background: color-mix(in srgb, var(--cab-child) 18%, rgba(32, 42, 64, 0.95));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cab-parent) 28%, transparent),
    0 3px 14px rgba(20, 40, 80, 0.35);
}

html[data-theme="dark"] .cabinet-note-card--active,
html[data-theme="soft"] .cabinet-note-card--active {
  background: color-mix(in srgb, var(--cab-parent) 18%, rgba(36, 48, 72, 0.95));
  border-color: color-mix(in srgb, var(--cab-parent) 45%, rgba(138, 180, 248, 0.4));
  border-left-color: var(--cab-parent);
}

html[data-theme="dark"] .cabinet-note-card--active:hover,
html[data-theme="soft"] .cabinet-note-card--active:hover {
  border-color: color-mix(in srgb, var(--cab-parent) 55%, rgba(170, 205, 255, 0.7));
  background: color-mix(in srgb, var(--cab-parent) 20%, rgba(40, 52, 78, 0.98));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cab-parent) 32%, transparent),
    0 3px 14px rgba(20, 40, 80, 0.35);
}

html[data-theme="dark"] .group-mode-hint,
html[data-theme="soft"] .group-mode-hint {
color: var(--text-muted);
}

/* Group mode: tree labels (notepad.css uses light-theme blues) */
html[data-theme="dark"] #groupRoot .group-level-space,
html[data-theme="soft"] #groupRoot .group-level-space  {
color: var(--accent);
}

html[data-theme="dark"] #groupRoot .tree-level-shared-root,
html[data-theme="soft"] #groupRoot .tree-level-shared-root  {
color: #5eead4;
}

html[data-theme="dark"] #groupRoot .tree-shared-subtitle,
html[data-theme="soft"] #groupRoot .tree-shared-subtitle  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupRoot .tree-level-shared-ref,
html[data-theme="soft"] #groupRoot .tree-level-shared-ref  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupRoot .cabinet-note-card-title,
html[data-theme="soft"] #groupRoot .cabinet-note-card-title  {
color: var(--text);
}

html[data-theme="dark"] #groupRoot .cabinet-shelf-count,
html[data-theme="soft"] #groupRoot .cabinet-shelf-count ,
html[data-theme="dark"] #groupRoot .cabinet-face-meta,
html[data-theme="soft"] #groupRoot .cabinet-face-meta  {
color: var(--text-muted);
}

/* ========== Rich text: container + editor (all modes) ========== */
html[data-theme="dark"] .note-editor-container,
html[data-theme="soft"] .note-editor-container {
background: #1a1d24;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] body.bb-note-pane-maximized .note-editor-container--maximized,
html[data-theme="soft"] body.bb-note-pane-maximized .note-editor-container--maximized {
  background: #1a1d24;
  border-color: var(--border);
}

html[data-theme="dark"] .note-editor,
html[data-theme="soft"] .note-editor {
background: #14171f;
  color: var(--text);
  border-color: var(--border);
  caret-color: var(--text);
}

html[data-theme="dark"] .note-editor *,
html[data-theme="soft"] .note-editor * {
color: inherit;
}

/* Hyperlinks in notes (mailto, http, etc.) â€” not .note-link spans; strip pasted white boxes */
html[data-theme="dark"] .note-editor a[href],
html[data-theme="soft"] .note-editor a[href] {
background-color: transparent !important;
  background-image: none !important;
  color: #8ab4f8;
  text-decoration: underline;
}

html[data-theme="dark"] .note-editor a[href]:hover,
html[data-theme="soft"] .note-editor a[href]:hover {
color: #dbeafe;
}

/* [[Wiki]] pills: beat inline paste backgrounds */
html[data-theme="dark"] .note-editor .note-link,
html[data-theme="soft"] .note-editor .note-link {
background: rgba(138, 180, 248, 0.15) !important;
  background-color: rgba(138, 180, 248, 0.15) !important;
  color: var(--accent);
}

html[data-theme="dark"] .note-editor .note-link:hover,
html[data-theme="soft"] .note-editor .note-link:hover {
background: rgba(138, 180, 248, 0.28) !important;
  background-color: rgba(138, 180, 248, 0.28) !important;
  color: #dbeafe;
}

/* Outlook/Word paste: white fill behind text or blocks */
html[data-theme="dark"] .note-editor [style*="background-color: rgb(255"],
html[data-theme="dark"] .note-editor [style*="background-color:rgb(255"],
html[data-theme="dark"] .note-editor [style*="background-color: #fff"],
html[data-theme="dark"] .note-editor [style*="background-color:#fff"],
html[data-theme="dark"] .note-editor [style*="background-color: #ffffff"],
html[data-theme="dark"] .note-editor [style*="background-color:#ffffff"],
html[data-theme="dark"] .note-editor [style*="background-color: white"],
html[data-theme="dark"] .note-editor [style*="background-color:white"],
html[data-theme="dark"] .note-editor [style*="background: #fff"],
html[data-theme="dark"] .note-editor [style*="background:#fff"],
html[data-theme="dark"] .note-editor [style*="background: rgb(255"],
html[data-theme="dark"] .note-editor [style*="background:rgb(255"],
html[data-theme="soft"] .note-editor [style*="background-color: rgb(255"] ,
html[data-theme="soft"] .note-editor [style*="background-color:rgb(255"] ,
html[data-theme="soft"] .note-editor [style*="background-color: #fff"] ,
html[data-theme="soft"] .note-editor [style*="background-color:#fff"] ,
html[data-theme="soft"] .note-editor [style*="background-color: #ffffff"] ,
html[data-theme="soft"] .note-editor [style*="background-color:#ffffff"] ,
html[data-theme="soft"] .note-editor [style*="background-color: white"] ,
html[data-theme="soft"] .note-editor [style*="background-color:white"] ,
html[data-theme="soft"] .note-editor [style*="background: #fff"] ,
html[data-theme="soft"] .note-editor [style*="background:#fff"] ,
html[data-theme="soft"] .note-editor [style*="background: rgb(255"] ,
html[data-theme="soft"] .note-editor [style*="background:rgb(255"]  {
background-color: transparent !important;
  background: transparent !important;
  color: inherit !important;
}

html[data-theme="dark"] .note-editor:empty:before,
html[data-theme="soft"] .note-editor:empty:before {
color: var(--text-muted);
}

html[data-theme="dark"] .note-toolbar,
html[data-theme="dark"] .journal-note-toolbar,
html[data-theme="soft"] .note-toolbar ,
html[data-theme="soft"] .journal-note-toolbar  {
border-color: var(--border);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 6px;
  color: var(--text);
}

html[data-theme="dark"] .format-toolbar,
html[data-theme="dark"] .journal-format-toolbar,
html[data-theme="dark"] .research-format-toolbar,
html[data-theme="dark"] .tasks-format-toolbar,
html[data-theme="soft"] .format-toolbar ,
html[data-theme="soft"] .journal-format-toolbar ,
html[data-theme="soft"] .research-format-toolbar ,
html[data-theme="soft"] .tasks-format-toolbar  {
border-color: var(--border);
  background: transparent;
  color: var(--text);
}

/* Formatting toolbar â€” fixes white buttons / invisible B I U in dark mode */
html[data-theme="dark"] .fmt-btn,
html[data-theme="soft"] .fmt-btn {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .fmt-btn:hover:not(:disabled),
html[data-theme="soft"] .fmt-btn:hover:not(:disabled) {
background: #2a2f3a;
}

html[data-theme="dark"] .fmt-btn:disabled,
html[data-theme="soft"] .fmt-btn:disabled {
opacity: 0.45;
}

html[data-theme="dark"] .fmt-btn b,
html[data-theme="dark"] .fmt-btn i,
html[data-theme="dark"] .fmt-btn u,
html[data-theme="soft"] .fmt-btn b ,
html[data-theme="soft"] .fmt-btn i ,
html[data-theme="soft"] .fmt-btn u  {
color: inherit;
}

html[data-theme="dark"] .fmt-sep,
html[data-theme="soft"] .fmt-sep {
background: var(--border);
}

html[data-theme="dark"] .fmt-select,
html[data-theme="dark"] .fmt-color,
html[data-theme="soft"] .fmt-select ,
html[data-theme="soft"] .fmt-color  {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .fmt-select option,
html[data-theme="soft"] .fmt-select option {
background: #252830;
  color: var(--text);
}

html[data-theme="dark"] .note-search-highlight,
html[data-theme="soft"] .note-search-highlight {
background: rgba(234, 179, 8, 0.45);
  color: var(--text);
}

html[data-theme="dark"] .note-editor blockquote,
html[data-theme="soft"] .note-editor blockquote {
border-left-color: var(--accent);
  color: var(--text-muted);
}

html[data-theme="dark"] .note-editor pre,
html[data-theme="dark"] .note-editor code,
html[data-theme="soft"] .note-editor pre ,
html[data-theme="soft"] .note-editor code  {
background: rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
}

html[data-theme="dark"] #archiveRoot .archive-main,
html[data-theme="dark"] #researchRoot .archive-main,
html[data-theme="dark"] #groupRoot .archive-main,
html[data-theme="dark"] #chatRoot .archive-main,
html[data-theme="soft"] #archiveRoot .archive-main ,
html[data-theme="soft"] #researchRoot .archive-main ,
html[data-theme="soft"] #groupRoot .archive-main ,
html[data-theme="soft"] #chatRoot .archive-main  {
background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] .search-results,
html[data-theme="soft"] .search-results {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--text);
}

html[data-theme="dark"] .search-results__head,
html[data-theme="soft"] .search-results__head {
  background: var(--surface-muted);
  border-bottom-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .search-results h4,
html[data-theme="soft"] .search-results h4 {
  color: var(--text);
}

html[data-theme="dark"] .search-results__query,
html[data-theme="dark"] .search-results__empty,
html[data-theme="soft"] .search-results__query,
html[data-theme="soft"] .search-results__empty {
  color: var(--text-muted);
}

html[data-theme="dark"] .search-results__close,
html[data-theme="soft"] .search-results__close {
  color: var(--text-muted);
}

html[data-theme="dark"] .search-results__close:hover,
html[data-theme="soft"] .search-results__close:hover {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted));
  color: var(--text);
}

html[data-theme="dark"] .search-results a,
html[data-theme="soft"] .search-results a {
  color: var(--text);
}

html[data-theme="dark"] .search-results a:hover,
html[data-theme="soft"] .search-results a:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

html[data-theme="dark"] .note-comment,
html[data-theme="soft"] .note-comment {
background: #1e222b;
  border-color: var(--border);
}

html[data-theme="dark"] .note-comment-meta,
html[data-theme="soft"] .note-comment-meta {
color: var(--text-muted);
}

html[data-theme="dark"] .note-comment-body,
html[data-theme="soft"] .note-comment-body {
color: #cbd5e1;
}

html[data-theme="dark"] .thread-comment-row,
html[data-theme="soft"] .thread-comment-row {
background: #1e222b;
  border-color: var(--border);
}

html[data-theme="dark"] .thread-comment-body,
html[data-theme="soft"] .thread-comment-body {
color: #cbd5e1;
}

/* ========== Floating: calendar + journal ========== */
html[data-theme="dark"] .floating-window,
html[data-theme="soft"] .floating-window {
border-color: var(--border);
  background: var(--dialog-surface);
}

html[data-theme="dark"] .floating-window-header,
html[data-theme="soft"] .floating-window-header {
border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .floating-window-title,
html[data-theme="soft"] .floating-window-title {
color: var(--text);
}

html[data-theme="dark"] .budget-detached-window .floating-window-title,
html[data-theme="soft"] .budget-detached-window .floating-window-title {
color: #0f172a;
}

html[data-theme="dark"] .budget-detached-window .floating-window-header .pill-btn,
html[data-theme="soft"] .budget-detached-window .floating-window-header .pill-btn {
color: #0f172a;
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .calendar-window .calendar-grid,
html[data-theme="soft"] .calendar-window .calendar-grid {
background: var(--surface);
}

html[data-theme="dark"] .calendar-window .calendar-cell.calendar-day,
html[data-theme="soft"] .calendar-window .calendar-cell.calendar-day {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

/* Today â€” subtle border ring (base .calendar-day rules above would hide it without this) */
html[data-theme="dark"] .calendar-window .calendar-day.is-today,
html[data-theme="soft"] .calendar-window .calendar-day.is-today {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(138, 180, 248, 0.22),
    0 0 0 2px rgba(138, 180, 248, 0.18);
}

html[data-theme="dark"] .calendar-window .calendar-day.is-today.is-selected,
html[data-theme="soft"] .calendar-window .calendar-day.is-today.is-selected {
background: rgba(59, 130, 246, 0.22);
  border-color: rgba(138, 180, 248, 0.65);
  box-shadow:
    inset 0 0 0 1px rgba(138, 180, 248, 0.28),
    0 0 0 2px rgba(138, 180, 248, 0.28);
}

html[data-theme="dark"] .calendar-window .calendar-day.is-selected,
html[data-theme="soft"] .calendar-window .calendar-day.is-selected {
background: rgba(59, 130, 246, 0.22);
  border-color: rgba(138, 180, 248, 0.45);
}

html[data-theme="dark"] .calendar-window .calendar-day.is-today:hover,
html[data-theme="soft"] .calendar-window .calendar-day.is-today:hover {
border-color: rgba(138, 180, 248, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(138, 180, 248, 0.28),
    0 0 0 2px rgba(138, 180, 248, 0.22),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .calendar-window .calendar-controls,
html[data-theme="dark"] .calendar-window .calendar-selectors select,
html[data-theme="soft"] .calendar-window .calendar-controls ,
html[data-theme="soft"] .calendar-window .calendar-selectors select  {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .calendar-selectors select option,
html[data-theme="soft"] .calendar-selectors select option {
background: #252830;
  color: var(--text);
}

/* Team channel — dashboard + calendar (native dropdown list) */
html[data-theme="dark"] .team-channel-select,
html[data-theme="soft"] .team-channel-select {
  background: #252830;
  border-color: var(--border);
  color: var(--text);
  color-scheme: dark;
}

html[data-theme="dark"] .team-channel-select option,
html[data-theme="soft"] .team-channel-select option {
  background: #252830;
  color: var(--text);
}

html[data-theme="dark"] .calendar-dow-label,
html[data-theme="soft"] .calendar-dow-label {
color: var(--text-muted);
}

html[data-theme="dark"] .floating-window-body .calendar-day-view,
html[data-theme="soft"] .floating-window-body .calendar-day-view {
color: var(--text);
}

html[data-theme="dark"] .calendar-window .calendar-day-toc,
html[data-theme="soft"] .calendar-window .calendar-day-toc {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .calendar-day-toc-link,
html[data-theme="soft"] .calendar-day-toc-link {
color: var(--accent);
}

html[data-theme="dark"] .calendar-window .calendar-day-card,
html[data-theme="soft"] .calendar-window .calendar-day-card {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .calendar-window .calendar-day-card--planned,
html[data-theme="soft"] .calendar-window .calendar-day-card--planned {
background: rgba(37, 99, 235, 0.22);
  border-color: rgba(138, 180, 248, 0.38);
}

html[data-theme="dark"] .calendar-window .calendar-day-card--task,
html[data-theme="soft"] .calendar-window .calendar-day-card--task {
background: rgba(124, 58, 237, 0.25);
  border-color: rgba(196, 181, 253, 0.42);
}

html[data-theme="dark"] .calendar-day-card-title,
html[data-theme="soft"] .calendar-day-card-title {
color: var(--text);
}

html[data-theme="dark"] .calendar-day-card-body,
html[data-theme="soft"] .calendar-day-card-body {
color: #cbd5e1;
}

/* Calendar modal — dark & soft: recessed grid + raised day tiles + day detail (3D) */
html[data-theme="dark"] .calendar-window.floating-window,
html[data-theme="soft"] .calendar-window.floating-window {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 52px rgba(0, 0, 0, 0.42),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .calendar-window .floating-window-header,
html[data-theme="soft"] .calendar-window .floating-window-header {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .calendar-window .calendar-grid-inner,
html[data-theme="soft"] .calendar-window .calendar-grid-inner {
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(165deg, #14171e 0%, #1a1e28 52%, #12151c 100%);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  gap: 7px;
}

html[data-theme="dark"] .calendar-window .calendar-dow-label,
html[data-theme="soft"] .calendar-window .calendar-dow-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  padding-bottom: 2px;
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell {
  background: linear-gradient(168deg, #343a48 0%, #252830 46%, #1c2029 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 3px 8px rgba(0, 0, 0, 0.38),
    0 1px 3px rgba(0, 0, 0, 0.28);
}

html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell {
  background: linear-gradient(168deg, #454d5e 0%, #3d4454 46%, #323846 100%);
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell.is-outside,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell.is-outside {
  background: linear-gradient(168deg, #2a2f3a 0%, #22262f 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 4px rgba(0, 0, 0, 0.22);
  opacity: 0.68;
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell:hover,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 180, 248, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.42),
    0 2px 6px rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell.is-today,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell.is-today {
  background: linear-gradient(168deg, #2a3f5c 0%, #243550 48%, #1e2d45 100%);
  border-color: rgba(138, 180, 248, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(138, 180, 248, 0.2),
    0 0 0 2px rgba(138, 180, 248, 0.18),
    0 4px 12px rgba(59, 130, 246, 0.22);
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell.is-selected,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell.is-selected {
  background: linear-gradient(168deg, #2d4268 0%, #253a5c 52%, #1f3250 100%);
  border-color: rgba(138, 180, 248, 0.5);
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(138, 180, 248, 0.22),
    0 0 0 2px rgba(138, 180, 248, 0.2);
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell.is-today.is-selected,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell.is-today.is-selected {
  background: linear-gradient(168deg, #33527e 0%, #2a4570 55%, #243c62 100%);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(138, 180, 248, 0.28),
    0 0 0 2px rgba(138, 180, 248, 0.26),
    0 0 0 4px rgba(59, 130, 246, 0.1);
}

html[data-theme="dark"] .calendar-window button.calendar-day.calendar-cell:active,
html[data-theme="soft"] .calendar-window button.calendar-day.calendar-cell:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .calendar-window .calendar-controls .cal-step-btn,
html[data-theme="dark"] .calendar-window .calendar-selectors select,
html[data-theme="soft"] .calendar-window .calendar-controls .cal-step-btn,
html[data-theme="soft"] .calendar-window .calendar-selectors select {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.28);
}

/* Dark & soft — day detail */
html[data-theme="dark"] .calendar-window .calendar-day-toolbar .cal-step-btn,
html[data-theme="dark"] .calendar-window .calendar-day-toolbar .pill-btn,
html[data-theme="soft"] .calendar-window .calendar-day-toolbar .cal-step-btn,
html[data-theme="soft"] .calendar-window .calendar-day-toolbar .pill-btn,
html[data-theme="dark"] .calendar-window .calendar-window-nav-btn,
html[data-theme="soft"] .calendar-window .calendar-window-nav-btn,
html[data-theme="dark"] .bb-window-nav-btn,
html[data-theme="soft"] .bb-window-nav-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .calendar-window .calendar-window-nav-btn,
html[data-theme="soft"] .calendar-window .calendar-window-nav-btn,
html[data-theme="dark"] .bb-window-nav-btn,
html[data-theme="soft"] .bb-window-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e8edf7;
}

html[data-theme="dark"] .calendar-window .calendar-window-nav-btn:hover,
html[data-theme="soft"] .calendar-window .calendar-window-nav-btn:hover,
html[data-theme="dark"] .bb-window-nav-btn:hover,
html[data-theme="soft"] .bb-window-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

html[data-theme="dark"] .calendar-window .calendar-day-canvas,
html[data-theme="soft"] .calendar-window .calendar-day-canvas {
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(165deg, #14171e 0%, #1a1e28 52%, #12151c 100%);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.42),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="soft"] .calendar-window .calendar-day-canvas {
  background: linear-gradient(165deg, #2a303c 0%, #323846 52%, #2a303c 100%);
}

html[data-theme="dark"] .calendar-window .calendar-day-toc,
html[data-theme="soft"] .calendar-window .calendar-day-toc {
  background: linear-gradient(168deg, #343a48 0%, #252830 50%, #1e222c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.32),
    0 1px 3px rgba(0, 0, 0, 0.22);
}

html[data-theme="soft"] .calendar-window .calendar-day-toc {
  background: linear-gradient(168deg, #454d5e 0%, #3d4454 50%, #323846 100%);
}

html[data-theme="dark"] .calendar-window .calendar-day-card,
html[data-theme="soft"] .calendar-window .calendar-day-card {
  background: linear-gradient(168deg, #343a48 0%, #252830 48%, #1e222c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 3px 10px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

html[data-theme="soft"] .calendar-window .calendar-day-card {
  background: linear-gradient(168deg, #454d5e 0%, #3d4454 48%, #323846 100%);
}

html[data-theme="dark"] .calendar-window .calendar-day-card:hover,
html[data-theme="soft"] .calendar-window .calendar-day-card:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 6px 14px rgba(0, 0, 0, 0.38),
    0 2px 5px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .calendar-window .calendar-day-card--planned,
html[data-theme="soft"] .calendar-window .calendar-day-card--planned {
  background: linear-gradient(168deg, #2a3d5c 0%, #243550 55%, #1e2d45 100%);
  border-color: rgba(138, 180, 248, 0.38);
}

html[data-theme="dark"] .calendar-window .calendar-day-card--task,
html[data-theme="soft"] .calendar-window .calendar-day-card--task {
  background: linear-gradient(168deg, #3d3258 0%, #342a4c 55%, #2b2340 100%);
  border-color: rgba(196, 181, 253, 0.42);
}

html[data-theme="dark"] .calendar-window .calendar-day-comment,
html[data-theme="soft"] .calendar-window .calendar-day-comment {
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a2f3a 0%, #22262f 100%);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.32);
  list-style: none;
  margin-left: 0;
}

html[data-theme="dark"] #journalWindow.journal-window,
html[data-theme="soft"] #journalWindow.journal-window {
  border-color: rgba(138, 180, 248, 0.22);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 14px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

html[data-theme="dark"] #journalWindow .floating-window-header,
html[data-theme="soft"] #journalWindow .floating-window-header {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] #journalWindow .journal-window-body,
html[data-theme="soft"] #journalWindow .journal-window-body {
  background: linear-gradient(180deg, #1a1d24 0%, #151820 55%, #12151c 100%);
  color: var(--text);
}

html[data-theme="dark"] .journal-date-bar,
html[data-theme="soft"] .journal-date-bar {
  background: var(--surface-muted);
  border-color: var(--border);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .journal-date-label,
html[data-theme="soft"] .journal-date-label {
color: var(--text);
}

html[data-theme="dark"] .journal-sidebar-title,
html[data-theme="soft"] .journal-sidebar-title {
color: var(--text-muted);
}

html[data-theme="dark"] .journal-sidebar,
html[data-theme="soft"] .journal-sidebar {
  background: linear-gradient(180deg, #1e222b 0%, #181c24 100%);
  border-color: var(--border);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .journal-sidebar .sidebar-tree-toolbar,
html[data-theme="soft"] .journal-sidebar .sidebar-tree-toolbar {
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .journal-entry-item:hover,
html[data-theme="soft"] .journal-entry-item:hover {
  background: rgba(138, 180, 248, 0.1);
  border-color: rgba(138, 180, 248, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .journal-entry-item.active,
html[data-theme="soft"] .journal-entry-item.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.28) 0%, rgba(59, 130, 246, 0.18) 100%);
  border-color: rgba(138, 180, 248, 0.35);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .journal-editor-pane.note-editor-container,
html[data-theme="soft"] .journal-editor-pane.note-editor-container {
  background: #1a1d24;
  border-color: var(--border);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .journal-note-toolbar,
html[data-theme="soft"] .journal-note-toolbar {
  background: linear-gradient(180deg, #22262f 0%, #1a1d24 100%);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] #journalWindow #journalNoteTitle,
html[data-theme="soft"] #journalWindow #journalNoteTitle {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #journalWindow #journalNoteTitle::placeholder,
html[data-theme="soft"] #journalWindow #journalNoteTitle::placeholder {
color: var(--text-muted);
  opacity: 1;
}

html[data-theme="dark"] #journalWindow #journalNoteTitle:disabled,
html[data-theme="soft"] #journalWindow #journalNoteTitle:disabled {
color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  opacity: 1;
}

html[data-theme="dark"] #groupRoot .note-editor-title,
html[data-theme="soft"] #groupRoot .note-editor-title,
html[data-theme="dark"] #archiveRoot .note-editor-title,
html[data-theme="soft"] #archiveRoot .note-editor-title,
html[data-theme="dark"] #researchRoot .note-editor-title,
html[data-theme="soft"] #researchRoot .note-editor-title,
html[data-theme="dark"] #photoAlbumRoot .note-editor-title,
html[data-theme="soft"] #photoAlbumRoot .note-editor-title {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  color: var(--text);
}

html[data-theme="dark"] #groupRoot .note-editor-title::placeholder,
html[data-theme="soft"] #groupRoot .note-editor-title::placeholder,
html[data-theme="dark"] #archiveRoot .note-editor-title::placeholder,
html[data-theme="soft"] #archiveRoot .note-editor-title::placeholder,
html[data-theme="dark"] #researchRoot .note-editor-title::placeholder,
html[data-theme="soft"] #researchRoot .note-editor-title::placeholder,
html[data-theme="dark"] #photoAlbumRoot .note-editor-title::placeholder,
html[data-theme="soft"] #photoAlbumRoot .note-editor-title::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

html[data-theme="dark"] #groupRoot .note-editor-title:disabled,
html[data-theme="soft"] #groupRoot .note-editor-title:disabled,
html[data-theme="dark"] #archiveRoot .note-editor-title:disabled,
html[data-theme="soft"] #archiveRoot .note-editor-title:disabled,
html[data-theme="dark"] #researchRoot .note-editor-title:disabled,
html[data-theme="soft"] #researchRoot .note-editor-title:disabled,
html[data-theme="dark"] #photoAlbumRoot .note-editor-title:disabled,
html[data-theme="soft"] #photoAlbumRoot .note-editor-title:disabled {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  opacity: 1;
}

html[data-theme="dark"] #groupRoot .note-editor-title:not(:disabled):focus,
html[data-theme="soft"] #groupRoot .note-editor-title:not(:disabled):focus,
html[data-theme="dark"] #archiveRoot .note-editor-title:not(:disabled):focus,
html[data-theme="soft"] #archiveRoot .note-editor-title:not(:disabled):focus,
html[data-theme="dark"] #researchRoot .note-editor-title:not(:disabled):focus,
html[data-theme="soft"] #researchRoot .note-editor-title:not(:disabled):focus,
html[data-theme="dark"] #photoAlbumRoot .note-editor-title:not(:disabled):focus,
html[data-theme="soft"] #photoAlbumRoot .note-editor-title:not(:disabled):focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: color-mix(in srgb, var(--accent, #8ab4f8) 55%, transparent);
}

html[data-theme="dark"] #journalWindow #journalNoteBodyWrapper,
html[data-theme="soft"] #journalWindow #journalNoteBodyWrapper {
background: transparent;
}

html[data-theme="dark"] .journal-window-subtitle,
html[data-theme="soft"] .journal-window-subtitle {
color: var(--text-muted);
}

html[data-theme="dark"] #journalWindow .journal-window-head-text .floating-window-title,
html[data-theme="soft"] #journalWindow .journal-window-head-text .floating-window-title {
color: #e2e8f0;
}

/* ========== Budget ========== */
html[data-theme="dark"] .budget-app,
html[data-theme="soft"] .budget-app {
background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] .budget-topbar,
html[data-theme="soft"] .budget-topbar {
background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-period,
html[data-theme="dark"] .budget-period-label,
html[data-theme="soft"] .budget-period ,
html[data-theme="soft"] .budget-period-label  {
color: var(--text);
}

html[data-theme="dark"] .budget-workbook-title,
html[data-theme="soft"] .budget-workbook-title {
color: var(--text);
}

html[data-theme="dark"] .budget-workbook-title--editable:hover,
html[data-theme="soft"] .budget-workbook-title--editable:hover {
background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .budget-workbook-title--editable:focus-visible,
html[data-theme="soft"] .budget-workbook-title--editable:focus-visible {
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .budget-kpi span,
html[data-theme="soft"] .budget-kpi span {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-kpi strong,
html[data-theme="soft"] .budget-kpi strong {
color: var(--text);
}

html[data-theme="dark"] .budget-kpi--net.positive strong,
html[data-theme="soft"] .budget-kpi--net.positive strong {
color: #86efac;
}

html[data-theme="dark"] .budget-kpi--net.negative strong,
html[data-theme="soft"] .budget-kpi--net.negative strong {
color: #fca5a5;
}

html[data-theme="dark"] .budget-kpi,
html[data-theme="soft"] .budget-kpi {
background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-coa,
html[data-theme="soft"] .budget-coa {
background: var(--surface-muted);
}

html[data-theme="dark"] .budget-coa-group + .budget-coa-group,
html[data-theme="soft"] .budget-coa-group + .budget-coa-group {
border-top-color: var(--border);
}

html[data-theme="dark"] .budget-workbook-row,
html[data-theme="soft"] .budget-workbook-row {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-workbook-row label,
html[data-theme="soft"] .budget-workbook-row label {
  color: var(--text-muted);
}

html[data-theme="dark"] .bb-budget-body select,
html[data-theme="soft"] .bb-budget-body select {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .bb-budget-body select option,
html[data-theme="soft"] .bb-budget-body select option {
  background: var(--surface-muted, #323846);
  color: var(--text);
}

html[data-theme="dark"] .budget-account-modal-heading,
html[data-theme="soft"] .budget-account-modal-heading {
color: var(--text);
}

/* Budget â€” PDF report timeframe modal */
html[data-theme="dark"] #budgetPdfRangeModal .modal-content.dialog-card,
html[data-theme="soft"] #budgetPdfRangeModal .modal-content.dialog-card  {
background: var(--dialog-surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #budgetPdfRangeModal .budget-modal-fields label,
html[data-theme="soft"] #budgetPdfRangeModal .budget-modal-fields label  {
color: var(--text-muted);
}

html[data-theme="dark"] #budgetPdfRangeModal .budget-modal-fields input[type="date"],
html[data-theme="soft"] #budgetPdfRangeModal .budget-modal-fields input[type="date"]  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
  color-scheme: dark;
}

html[data-theme="dark"] #budgetPdfRangeModal .budget-modal-fields input[type="date"]:focus,
html[data-theme="soft"] #budgetPdfRangeModal .budget-modal-fields input[type="date"]:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] .budget-pdf-range-presets,
html[data-theme="soft"] .budget-pdf-range-presets  {
border-color: var(--border);
  background: var(--surface-muted);
}

html[data-theme="dark"] .budget-pdf-range-presets label,
html[data-theme="soft"] .budget-pdf-range-presets label  {
color: var(--text);
}

html[data-theme="dark"] .budget-pdf-range-presets input[type="radio"],
html[data-theme="soft"] .budget-pdf-range-presets input[type="radio"]  {
accent-color: #93c5fd;
}

html[data-theme="dark"] .budget-pdf-range-error,
html[data-theme="soft"] .budget-pdf-range-error  {
border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

html[data-theme="dark"] .budget-inspector,
html[data-theme="soft"] .budget-inspector {
background: var(--surface-muted);
}

html[data-theme="dark"] .budget-inspector-toolbar,
html[data-theme="soft"] .budget-inspector-toolbar {
border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-inspector-toolbar-lbl,
html[data-theme="soft"] .budget-inspector-toolbar-lbl {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-inspector-range-btn.active,
html[data-theme="dark"] .budget-inspector-sort-btn.active,
html[data-theme="soft"] .budget-inspector-range-btn.active ,
html[data-theme="soft"] .budget-inspector-sort-btn.active  {
background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .budget-inspector .budget-inspector-range .pill-btn.budget-inspector-range-btn.active:hover:not(:disabled),
html[data-theme="dark"] .budget-inspector .budget-inspector-sort-btn.active:hover:not(:disabled),
html[data-theme="soft"] .budget-inspector .budget-inspector-range .pill-btn.budget-inspector-range-btn.active:hover:not(:disabled) ,
html[data-theme="soft"] .budget-inspector .budget-inspector-sort-btn.active:hover:not(:disabled)  {
background: rgba(255, 255, 255, 0.22);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .budget-inspector .budget-inspector-range .pill-btn:hover:not(:disabled):not(.active),
html[data-theme="dark"] .budget-inspector .budget-inspector-sort-btn:hover:not(:disabled):not(.active),
html[data-theme="soft"] .budget-inspector .budget-inspector-range .pill-btn:hover:not(:disabled):not(.active) ,
html[data-theme="soft"] .budget-inspector .budget-inspector-sort-btn:hover:not(:disabled):not(.active)  {
background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-workbench,
html[data-theme="soft"] .budget-workbench {
background: var(--surface);
  border-right-color: var(--border);
}

html[data-theme="dark"] .budget-workbench-tabs,
html[data-theme="soft"] .budget-workbench-tabs {
background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-panel-body,
html[data-theme="soft"] .budget-panel-body {
background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .budget-journal-mode-bar,
html[data-theme="soft"] .budget-journal-mode-bar {
border-bottom-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-journal-mode-bar .pill-btn.active,
html[data-theme="soft"] .budget-journal-mode-bar .pill-btn.active {
border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .budget-quick-card,
html[data-theme="soft"] .budget-quick-card {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-quick-card-title,
html[data-theme="soft"] .budget-quick-card-title {
color: var(--text);
}

html[data-theme="dark"] .budget-quick-fields label,
html[data-theme="dark"] .budget-form-row label,
html[data-theme="dark"] .budget-timeline-toolbar label,
html[data-theme="soft"] .budget-quick-fields label ,
html[data-theme="soft"] .budget-form-row label ,
html[data-theme="soft"] .budget-timeline-toolbar label  {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-hint,
html[data-theme="dark"] .budget-post-hint,
html[data-theme="soft"] .budget-hint ,
html[data-theme="soft"] .budget-post-hint  {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-balance-bar,
html[data-theme="soft"] .budget-balance-bar {
background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-balance-bar.unbalanced,
html[data-theme="soft"] .budget-balance-bar.unbalanced {
background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

html[data-theme="dark"] .budget-balance-bar.balanced,
html[data-theme="soft"] .budget-balance-bar.balanced {
background: rgba(20, 83, 45, 0.28);
  border-color: rgba(74, 222, 128, 0.35);
  color: #bbf7d0;
}

html[data-theme="dark"] .budget-lines-table th,
html[data-theme="dark"] .budget-data-table th,
html[data-theme="soft"] .budget-lines-table th ,
html[data-theme="soft"] .budget-data-table th  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="dark"] .budget-lines-table td,
html[data-theme="dark"] .budget-data-table td,
html[data-theme="soft"] .budget-lines-table td ,
html[data-theme="soft"] .budget-data-table td  {
border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-register-line-detail,
html[data-theme="soft"] .budget-register-line-detail {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-register-amt,
html[data-theme="soft"] .budget-register-amt {
color: var(--text);
}

html[data-theme="dark"] .budget-register-dr,
html[data-theme="dark"] .budget-register-cr,
html[data-theme="soft"] .budget-register-dr ,
html[data-theme="soft"] .budget-register-cr  {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-memo-report-panel,
html[data-theme="soft"] .budget-memo-report-panel {
z-index: 2;
  background: var(--surface-muted);
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .budget-memo-report-panel::before,
html[data-theme="soft"] .budget-memo-report-panel::before {
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

html[data-theme="dark"] .budget-memo-report-title,
html[data-theme="soft"] .budget-memo-report-title {
color: var(--text);
}

html[data-theme="dark"] .budget-memo-time-label,
html[data-theme="dark"] .budget-memo-month-wrap,
html[data-theme="soft"] .budget-memo-time-label ,
html[data-theme="soft"] .budget-memo-month-wrap  {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-memo-time-label select,
html[data-theme="dark"] .budget-memo-month-wrap input[type="month"],
html[data-theme="soft"] .budget-memo-time-label select ,
html[data-theme="soft"] .budget-memo-month-wrap input[type="month"]  {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-memo-report-total,
html[data-theme="soft"] .budget-memo-report-total {
background: var(--surface);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .budget-memo-report-total-label,
html[data-theme="soft"] .budget-memo-report-total-label {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-memo-report-total-amt,
html[data-theme="soft"] .budget-memo-report-total-amt {
color: var(--text);
}

html[data-theme="dark"] .budget-memo-search-label,
html[data-theme="soft"] .budget-memo-search-label {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-memo-search-label input[type="search"],
html[data-theme="soft"] .budget-memo-search-label input[type="search"] {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-trial-total,
html[data-theme="soft"] .budget-trial-total {
background: var(--surface-muted);
}

html[data-theme="dark"] .budget-trial-total td,
html[data-theme="soft"] .budget-trial-total td {
border-top-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-trial-foot,
html[data-theme="soft"] .budget-trial-foot {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-register-table,
html[data-theme="dark"] .budget-trial-table,
html[data-theme="soft"] .budget-register-table ,
html[data-theme="soft"] .budget-trial-table  {
color: var(--text);
}

html[data-theme="dark"] .budget-api-banner,
html[data-theme="soft"] .budget-api-banner {
background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

html[data-theme="dark"] .budget-panel-title,
html[data-theme="soft"] .budget-panel-title {
color: var(--text-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-inspector-column-head,
html[data-theme="soft"] .budget-inspector-column-head {
background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-inspector-kicker,
html[data-theme="soft"] .budget-inspector-kicker {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-inspector-selected-title,
html[data-theme="soft"] .budget-inspector-selected-title {
color: var(--text);
}

html[data-theme="dark"] .budget-inspector-selected-title--placeholder,
html[data-theme="soft"] .budget-inspector-selected-title--placeholder {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-coa-row,
html[data-theme="soft"] .budget-coa-row {
color: var(--text);
}

html[data-theme="dark"] .budget-coa-row:hover,
html[data-theme="soft"] .budget-coa-row:hover {
background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .budget-coa-row.active,
html[data-theme="soft"] .budget-coa-row.active {
border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .budget-coa-code,
html[data-theme="soft"] .budget-coa-code {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-coa-group-title,
html[data-theme="soft"] .budget-coa-group-title {
color: var(--text);
  border-left-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

html[data-theme="dark"] .budget-liability-payoff,
html[data-theme="soft"] .budget-liability-payoff {
border-top-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .budget-liability-payoff-title,
html[data-theme="soft"] .budget-liability-payoff-title {
color: var(--text);
}

html[data-theme="dark"] .budget-quick-defaults,
html[data-theme="soft"] .budget-quick-defaults {
color: var(--text);
}

html[data-theme="dark"] .budget-workbench-tabs button,
html[data-theme="soft"] .budget-workbench-tabs button {
border-color: var(--border);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: none;
}

html[data-theme="dark"] .budget-workbench-tabs button:hover,
html[data-theme="soft"] .budget-workbench-tabs button:hover {
border-color: rgba(255, 255, 255, 0.35);
  background: var(--surface-muted);
  color: var(--text);
}

html[data-theme="dark"] .budget-workbench-tabs button.active,
html[data-theme="soft"] .budget-workbench-tabs button.active {
border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .budget-workbench-tab-pdf,
html[data-theme="soft"] .budget-workbench-tab-pdf {
color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.45) !important;
}

html[data-theme="dark"] .budget-workbench-tab-pdf:hover,
html[data-theme="soft"] .budget-workbench-tab-pdf:hover {
background: rgba(45, 212, 191, 0.12) !important;
  color: #ccfbf1 !important;
}

html[data-theme="dark"] .budget-timeline-kpi,
html[data-theme="soft"] .budget-timeline-kpi {
background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-timeline-side-card,
html[data-theme="soft"] .budget-timeline-side-card {
background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-timeline-kpi-title,
html[data-theme="soft"] .budget-timeline-kpi-title {
color: var(--text);
}

html[data-theme="dark"] .budget-timeline-kpi-row,
html[data-theme="dark"] .budget-schedule-day-list,
html[data-theme="soft"] .budget-timeline-kpi-row ,
html[data-theme="soft"] .budget-schedule-day-list  {
color: #cbd5e1;
}

html[data-theme="dark"] .budget-timeline-kpi-row-total,
html[data-theme="soft"] .budget-timeline-kpi-row-total {
border-top-color: var(--border);
}

html[data-theme="dark"] .budget-lines-table th,
html[data-theme="dark"] .budget-lines-table td,
html[data-theme="soft"] .budget-lines-table th ,
html[data-theme="soft"] .budget-lines-table td  {
border-color: var(--border);
  color: var(--text);
}

/* Cash flow report */
html[data-theme="dark"] .budget-panel-cashflow,
html[data-theme="soft"] .budget-panel-cashflow {
color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-toolbar,
html[data-theme="soft"] .budget-cashflow-toolbar {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-cashflow-field-label,
html[data-theme="soft"] .budget-cashflow-field-label {
color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-field-label select,
html[data-theme="soft"] .budget-cashflow-field-label select {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-group-toggle,
html[data-theme="soft"] .budget-cashflow-group-toggle {
color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-range-hint,
html[data-theme="soft"] .budget-cashflow-range-hint {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-cashflow-summary,
html[data-theme="soft"] .budget-cashflow-summary {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-sum-item strong,
html[data-theme="soft"] .budget-cashflow-sum-item strong {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-cashflow-sum-net,
html[data-theme="soft"] .budget-cashflow-sum-net {
color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-table.budget-data-table tbody td,
html[data-theme="soft"] .budget-cashflow-table.budget-data-table tbody td {
border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-cashflow-table thead th,
html[data-theme="soft"] .budget-cashflow-table thead th {
background: linear-gradient(180deg, #2f3644 0%, #1e222b 100%);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .budget-cashflow-sort-btn:hover,
html[data-theme="soft"] .budget-cashflow-sort-btn:hover {
background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .budget-cashflow-pos,
html[data-theme="soft"] .budget-cashflow-pos {
color: #86efac;
}

html[data-theme="dark"] .budget-cashflow-neg,
html[data-theme="soft"] .budget-cashflow-neg {
color: #fca5a5;
}

html[data-theme="dark"] .budget-cashflow-net-zero,
html[data-theme="soft"] .budget-cashflow-net-zero {
color: var(--text-muted);
}

html[data-theme="dark"] tr.budget-cashflow-row-transfer td,
html[data-theme="soft"] tr.budget-cashflow-row-transfer td {
color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .budget-cashflow-group-head td,
html[data-theme="soft"] .budget-cashflow-group-head td {
color: var(--text);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border-top-color: var(--border);
}

html[data-theme="dark"] .budget-cashflow-group-total td,
html[data-theme="soft"] .budget-cashflow-group-total td {
background: rgba(255, 255, 255, 0.06);
  border-bottom-color: var(--border);
  color: var(--text);
}

/* Expense report */
html[data-theme="dark"] .budget-panel-expense-report,
html[data-theme="soft"] .budget-panel-expense-report {
color: var(--text);
}

html[data-theme="dark"] .budget-expense-report-toolbar,
html[data-theme="soft"] .budget-expense-report-toolbar {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-expense-report-field-label,
html[data-theme="soft"] .budget-expense-report-field-label {
color: var(--text);
}

html[data-theme="dark"] .budget-expense-report-field-label select,
html[data-theme="dark"] .budget-expense-report-field-label input[type='date'],
html[data-theme="soft"] .budget-expense-report-field-label select ,
html[data-theme="soft"] .budget-expense-report-field-label input[type='date']  {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-expense-report-range-hint,
html[data-theme="soft"] .budget-expense-report-range-hint {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-expense-report-legend,
html[data-theme="soft"] .budget-expense-report-legend {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-expense-report-legend-total,
html[data-theme="soft"] .budget-expense-report-legend-total {
border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-expense-report-legend-item,
html[data-theme="soft"] .budget-expense-report-legend-item {
border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .budget-expense-report-legend-pct,
html[data-theme="soft"] .budget-expense-report-legend-pct {
color: var(--text-muted);
}

html[data-theme="dark"] button.budget-expense-report-legend-item--row:hover,
html[data-theme="soft"] button.budget-expense-report-legend-item--row:hover {
background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .budget-expense-report-detail-body .budget-data-table,
html[data-theme="soft"] .budget-expense-report-detail-body .budget-data-table {
color: var(--text);
}

html[data-theme="dark"] .budget-expense-report-chart-tooltip,
html[data-theme="soft"] .budget-expense-report-chart-tooltip {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .budget-panel-reconcile,
html[data-theme="soft"] .budget-panel-reconcile {
color: var(--text);
}

html[data-theme="dark"] .budget-reconcile-toolbar,
html[data-theme="soft"] .budget-reconcile-toolbar {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-reconcile-field,
html[data-theme="soft"] .budget-reconcile-field {
color: var(--text);
}

html[data-theme="dark"] .budget-reconcile-field select,
html[data-theme="dark"] .budget-reconcile-field input[type='date'],
html[data-theme="dark"] .budget-reconcile-field input[type='text'],
html[data-theme="soft"] .budget-reconcile-field select ,
html[data-theme="soft"] .budget-reconcile-field input[type='date'] ,
html[data-theme="soft"] .budget-reconcile-field input[type='text']  {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-reconcile-summary,
html[data-theme="soft"] .budget-reconcile-summary {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-reconcile-summary-item span,
html[data-theme="soft"] .budget-reconcile-summary-item span {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-reconcile-summary-item strong,
html[data-theme="soft"] .budget-reconcile-summary-item strong {
color: var(--text);
}

/* Budget view lenses */
html[data-theme="dark"] .budget-lens-bar,
html[data-theme="soft"] .budget-lens-bar {
background: var(--surface-muted);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .budget-lens-btn,
html[data-theme="soft"] .budget-lens-btn {
background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="dark"] .budget-lens-btn:hover,
html[data-theme="soft"] .budget-lens-btn:hover {
background: var(--surface-muted);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
}

html[data-theme="dark"] .budget-lens-btn.active,
html[data-theme="soft"] .budget-lens-btn.active {
border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .budget-lens-hero,
html[data-theme="soft"] .budget-lens-hero {
color: var(--text);
}

html[data-theme="dark"] .budget-lens-section-title,
html[data-theme="soft"] .budget-lens-section-title {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-lens-kpi-card,
html[data-theme="soft"] .budget-lens-kpi-card {
background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .budget-lens-kpi-card span,
html[data-theme="soft"] .budget-lens-kpi-card span {
color: var(--text-muted);
}

html[data-theme="dark"] .budget-lens-kpi-card strong,
html[data-theme="soft"] .budget-lens-kpi-card strong {
color: var(--text);
}

html[data-theme="dark"] .budget-lens-placeholder,
html[data-theme="soft"] .budget-lens-placeholder {
background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-lens-total-row td,
html[data-theme="soft"] .budget-lens-total-row td {
background: rgba(255, 255, 255, 0.06);
  border-top-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .budget-lens-table.budget-data-table th,
html[data-theme="dark"] .budget-lens-table.budget-data-table td,
html[data-theme="soft"] .budget-lens-table.budget-data-table th ,
html[data-theme="soft"] .budget-lens-table.budget-data-table td  {
border-color: var(--border);
  color: var(--text);
}

/* Budget — Simple lens */
html[data-theme="dark"] .budget-lens-shell--simple,
html[data-theme="soft"] .budget-lens-shell--simple {
  --budget-simple-in: #86efac;
  --budget-simple-out: #fca5a5;
}

html[data-theme="dark"] .budget-simple-nav-btn.active,
html[data-theme="soft"] .budget-simple-nav-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

html[data-theme="dark"] .budget-simple-cta--primary,
html[data-theme="soft"] .budget-simple-cta--primary {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .budget-simple-cta--primary:hover,
html[data-theme="soft"] .budget-simple-cta--primary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .budget-simple-step-num,
html[data-theme="soft"] .budget-simple-step-num {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

html[data-theme="dark"] .budget-simple-kpi--hero,
html[data-theme="soft"] .budget-simple-kpi--hero {
  background: color-mix(in srgb, var(--budget-simple-in) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--budget-simple-in) 28%, var(--border));
}

/* ========== Modals (persona, share, sticky) ========== */
html[data-theme="dark"] .modal-content,
html[data-theme="soft"] .modal-content {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .admin-flagged-item,
html[data-theme="soft"] .admin-flagged-item  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .admin-flagged-item__title,
html[data-theme="soft"] .admin-flagged-item__title  {
color: var(--text);
}

html[data-theme="dark"] .modal-content h2,
html[data-theme="soft"] .modal-content h2 {
color: var(--text);
}

html[data-theme="dark"] .dialog-header,
html[data-theme="soft"] .dialog-header {
border-bottom-color: var(--border);
}

html[data-theme="dark"] #stickyModal .modal-content,
html[data-theme="soft"] #stickyModal .modal-content {
background: var(--dialog-surface);
  color: var(--text);
}

html[data-theme="dark"] #stickyModal .dialog-section,
html[data-theme="soft"] #stickyModal .dialog-section {
border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #stickyModal .dialog-section-title,
html[data-theme="soft"] #stickyModal .dialog-section-title {
color: var(--accent);
}

html[data-theme="dark"] .persona-picker,
html[data-theme="soft"] .persona-picker {
  color: var(--text);
}

html[data-theme="dark"] .persona-picker .dialog-section,
html[data-theme="soft"] .persona-picker .dialog-section {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .persona-picker__subtitle,
html[data-theme="soft"] .persona-picker__subtitle,
html[data-theme="dark"] .persona-picker .share-scope-hint,
html[data-theme="soft"] .persona-picker .share-scope-hint {
  color: var(--text-muted);
}

html[data-theme="dark"] .persona-picker__row:hover,
html[data-theme="soft"] .persona-picker__row:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

html[data-theme="dark"] #personaManager .dialog-section,
html[data-theme="soft"] #personaManager .dialog-section {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #dashWallpaperModal .modal-content,
html[data-theme="soft"] #dashWallpaperModal .modal-content {
  background: var(--dialog-surface);
  color: var(--text);
}

html[data-theme="dark"] #dashWallpaperModal .dialog-section,
html[data-theme="soft"] #dashWallpaperModal .dialog-section {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text);
}

html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-choice-btn,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-choice-btn,
html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-album-sidebar,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-album-sidebar,
html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-album-search__input,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-album-search__input,
html[data-theme="dark"] #dashWallpaperModal .photo-album-story-picker__thumb,
html[data-theme="soft"] #dashWallpaperModal .photo-album-story-picker__thumb {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-lead,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-lead,
html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-choice-btn__hint,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-choice-btn__hint,
html[data-theme="dark"] #dashWallpaperModal .photo-album-story-picker__thumb-label,
html[data-theme="soft"] #dashWallpaperModal .photo-album-story-picker__thumb-label,
html[data-theme="dark"] #dashWallpaperModal .photo-album-story-picker__empty,
html[data-theme="soft"] #dashWallpaperModal .photo-album-story-picker__empty,
html[data-theme="dark"] #dashWallpaperModal .dash-wallpaper-album-nav--sub,
html[data-theme="soft"] #dashWallpaperModal .dash-wallpaper-album-nav--sub {
  color: var(--text-muted);
}

html[data-theme="dark"] #personaManager .dialog-section-title,
html[data-theme="soft"] #personaManager .dialog-section-title {
  color: var(--accent);
}

html[data-theme="dark"] #personaList .persona-row,
html[data-theme="soft"] #personaList .persona-row {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #personaList .persona-row input[type="text"],
html[data-theme="soft"] #personaList .persona-row input[type="text"] {
  background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #personaList .persona-row input[type="color"],
html[data-theme="soft"] #personaList .persona-row input[type="color"] {
  border-color: var(--border);
  background: #252830;
}

html[data-theme="dark"] #stickyTitle,
html[data-theme="dark"] #stickyBody,
html[data-theme="soft"] #stickyTitle ,
html[data-theme="soft"] #stickyBody  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #stickyTitle::placeholder,
html[data-theme="dark"] #stickyBody::placeholder,
html[data-theme="soft"] #stickyTitle::placeholder ,
html[data-theme="soft"] #stickyBody::placeholder  {
color: var(--text-muted);
}

html[data-theme="dark"] #stickyTitle:focus,
html[data-theme="dark"] #stickyBody:focus,
html[data-theme="soft"] #stickyTitle:focus ,
html[data-theme="soft"] #stickyBody:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
}

html[data-theme="dark"] .sticky-empty,
html[data-theme="soft"] .sticky-empty {
color: var(--text-muted);
}

html[data-theme="dark"] .sticky-item,
html[data-theme="soft"] .sticky-item {
border-color: var(--border);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .sticky-item.is-completed,
html[data-theme="soft"] .sticky-item.is-completed {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .sticky-item.is-selected,
html[data-theme="soft"] .sticky-item.is-selected {
  border-color: color-mix(in srgb, var(--accent, #8ab4f8) 75%, #fbbf24);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent, #8ab4f8) 90%, #fbbf24) 0 4px, transparent 4px),
    linear-gradient(180deg, rgba(251, 191, 36, 0.28) 0%, rgba(212, 175, 55, 0.18) 100%);
  outline: 2px solid color-mix(in srgb, var(--accent, #8ab4f8) 70%, #fbbf24);
  outline-offset: 0;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent, #8ab4f8) 28%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sticky-item.is-selected .sticky-item-title,
html[data-theme="soft"] .sticky-item.is-selected .sticky-item-title {
  color: #fde68a;
}

html[data-theme="dark"] .pf-list-card.pf-list-card--selected,
html[data-theme="soft"] .pf-list-card.pf-list-card--selected,
html[data-theme="dark"] .pf-max-card.pf-max-card--selected,
html[data-theme="soft"] .pf-max-card.pf-max-card--selected,
html[data-theme="dark"] tr.pf-list-table__row.pf-list-table__row--selected,
html[data-theme="soft"] tr.pf-list-table__row.pf-list-table__row--selected,
html[data-theme="dark"] #sharedRoot .pf-list-card.pf-list-card--selected,
html[data-theme="soft"] #sharedRoot .pf-list-card.pf-list-card--selected,
html[data-theme="dark"] #privateForumsChrome .pf-list-card.pf-list-card--selected,
html[data-theme="soft"] #privateForumsChrome .pf-list-card.pf-list-card--selected {
  --pf-sel-accent: var(--accent, #8ab4f8);
  border-color: color-mix(in srgb, var(--pf-sel-accent) 82%, var(--border));
  background:
    linear-gradient(90deg, var(--pf-sel-accent) 0 4px, transparent 4px),
    color-mix(in srgb, var(--surface, var(--bg)) 78%, var(--pf-sel-accent) 22%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--pf-sel-accent) 52%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .pf-list-card--selected .pf-list-card__title,
html[data-theme="soft"] .pf-list-card--selected .pf-list-card__title,
html[data-theme="dark"] .pf-max-card--selected .pf-max-card__title,
html[data-theme="soft"] .pf-max-card--selected .pf-max-card__title,
html[data-theme="dark"] tr.pf-list-table__row--selected .pf-list-table__title,
html[data-theme="soft"] tr.pf-list-table__row--selected .pf-list-table__title {
  color: color-mix(in srgb, var(--accent, #8ab4f8) 88%, #ffffff);
}

html[data-theme="dark"] .sticky-item-title,
html[data-theme="soft"] .sticky-item-title {
color: var(--text);
}

html[data-theme="dark"] .sticky-item-body,
html[data-theme="soft"] .sticky-item-body {
color: var(--text);
}

html[data-theme="dark"] .sticky-item-meta,
html[data-theme="soft"] .sticky-item-meta {
color: var(--text-muted);
}

html[data-theme="dark"] .sticky-small-btn,
html[data-theme="soft"] .sticky-small-btn {
border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .sticky-small-btn:hover,
html[data-theme="soft"] .sticky-small-btn:hover {
background: var(--surface-muted);
}

html[data-theme="dark"] .sticky-small-btn.danger,
html[data-theme="soft"] .sticky-small-btn.danger {
border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

html[data-theme="dark"] .sticky-small-btn.danger:hover,
html[data-theme="soft"] .sticky-small-btn.danger:hover {
background: rgba(248, 113, 113, 0.12);
}

/* Tasks modal (same dialog system as sticky inbox) */
html[data-theme="dark"] #tasksModal .modal-content,
html[data-theme="soft"] #tasksModal .modal-content {
background: var(--dialog-surface);
  color: var(--text);
}

html[data-theme="dark"] #tasksModal .dialog-section,
html[data-theme="soft"] #tasksModal .dialog-section {
border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #tasksModal .dialog-section-title,
html[data-theme="soft"] #tasksModal .dialog-section-title {
color: var(--accent);
}

html[data-theme="dark"] #tasksModal #taskTitleInput,
html[data-theme="dark"] #tasksModal #taskBodyInput,
html[data-theme="dark"] #tasksModal #tasksModalDate,
html[data-theme="dark"] #tasksModal #taskRecurrenceInput,
html[data-theme="dark"] #tasksModal #taskStartDateInput,
html[data-theme="dark"] #tasksModal #taskEndDateInput,
html[data-theme="soft"] #tasksModal #taskTitleInput ,
html[data-theme="soft"] #tasksModal #taskBodyInput ,
html[data-theme="soft"] #tasksModal #tasksModalDate ,
html[data-theme="soft"] #tasksModal #taskRecurrenceInput ,
html[data-theme="soft"] #tasksModal #taskStartDateInput ,
html[data-theme="soft"] #tasksModal #taskEndDateInput  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #tasksModal #taskTitleInput::placeholder,
html[data-theme="dark"] #tasksModal #taskBodyInput::placeholder,
html[data-theme="soft"] #tasksModal #taskTitleInput::placeholder ,
html[data-theme="soft"] #tasksModal #taskBodyInput::placeholder  {
color: var(--text-muted);
}

html[data-theme="dark"] #tasksModal #taskTitleInput:focus,
html[data-theme="dark"] #tasksModal #taskBodyInput:focus,
html[data-theme="dark"] #tasksModal #tasksModalDate:focus,
html[data-theme="dark"] #tasksModal #taskRecurrenceInput:focus,
html[data-theme="dark"] #tasksModal #taskStartDateInput:focus,
html[data-theme="dark"] #tasksModal #taskEndDateInput:focus,
html[data-theme="soft"] #tasksModal #taskTitleInput:focus ,
html[data-theme="soft"] #tasksModal #taskBodyInput:focus ,
html[data-theme="soft"] #tasksModal #tasksModalDate:focus ,
html[data-theme="soft"] #tasksModal #taskRecurrenceInput:focus ,
html[data-theme="soft"] #tasksModal #taskStartDateInput:focus ,
html[data-theme="soft"] #tasksModal #taskEndDateInput:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] #tasksModal #taskRecurrenceInput option,
html[data-theme="soft"] #tasksModal #taskRecurrenceInput option {
background: var(--surface-muted);
  color: var(--text);
}

html[data-theme="dark"] #tasksModal .share-check,
html[data-theme="soft"] #tasksModal .share-check {
color: var(--text-muted);
}

html[data-theme="dark"] #tasksModal .tasks-modal-row-flash,
html[data-theme="dark"] #stickyModal .sticky-modal-row-flash,
html[data-theme="dark"] #stickyModal .sticky-modal-row-flash,
html[data-theme="soft"] #tasksModal .tasks-modal-row-flash ,
html[data-theme="soft"] #stickyModal .sticky-modal-row-flash ,
html[data-theme="soft"] #stickyModal .sticky-modal-row-flash {
outline: 2px solid rgba(138, 180, 248, 0.65);
  outline-offset: 2px;
}

/* Share manager modal (Cockpit + archive share dialog) */
html[data-theme="dark"] #shareManagerModal .modal-content,
html[data-theme="soft"] #shareManagerModal .modal-content  {
background: var(--dialog-surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] #shareManagerModal .dialog-section,
html[data-theme="soft"] #shareManagerModal .dialog-section  {
border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #shareManagerModal .dialog-section-title,
html[data-theme="soft"] #shareManagerModal .dialog-section-title  {
color: var(--accent);
}

html[data-theme="dark"] #shareManagerModal .share-forum-nested-title,
html[data-theme="soft"] #shareManagerModal .share-forum-nested-title  {
color: var(--text);
}

html[data-theme="dark"] #shareManagerModal .share-forum-nested,
html[data-theme="soft"] #shareManagerModal .share-forum-nested  {
border-top-color: var(--border);
}

html[data-theme="dark"] #shareManagerModal #shareTargetLogin,
html[data-theme="soft"] #shareManagerModal #shareTargetLogin ,
html[data-theme="dark"] #shareManagerModal .share-add-row select,
html[data-theme="soft"] #shareManagerModal .share-add-row select ,
html[data-theme="dark"] #shareManagerModal .share-forum-field select,
html[data-theme="soft"] #shareManagerModal .share-forum-field select  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #shareManagerModal #shareTargetLogin::placeholder,
html[data-theme="soft"] #shareManagerModal #shareTargetLogin::placeholder  {
color: var(--text-muted);
}

html[data-theme="dark"] #shareManagerModal #shareTargetLogin:focus,
html[data-theme="soft"] #shareManagerModal #shareTargetLogin:focus ,
html[data-theme="dark"] #shareManagerModal .share-add-row select:focus,
html[data-theme="soft"] #shareManagerModal .share-add-row select:focus ,
html[data-theme="dark"] #shareManagerModal .share-forum-field select:focus,
html[data-theme="soft"] #shareManagerModal .share-forum-field select:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] #shareManagerModal .share-check,
html[data-theme="soft"] #shareManagerModal .share-check  {
color: var(--text-muted);
}

html[data-theme="dark"] #shareManagerModal .share-scope-hint,
html[data-theme="soft"] #shareManagerModal .share-scope-hint  {
color: var(--text-muted);
}

html[data-theme="dark"] #shareManagerModal .share-scope-hint a,
html[data-theme="soft"] #shareManagerModal .share-scope-hint a  {
color: #93c5fd;
}

html[data-theme="dark"] #shareManagerModal .share-message,
html[data-theme="soft"] #shareManagerModal .share-message ,
html[data-theme="dark"] #shareManagerModal #sharePublicMessage,
html[data-theme="soft"] #shareManagerModal #sharePublicMessage  {
color: var(--text-muted);
}

html[data-theme="dark"] #shareManagerModal .share-list,
html[data-theme="soft"] #shareManagerModal .share-list  {
border-color: var(--border);
}

html[data-theme="dark"] #shareManagerModal .share-row,
html[data-theme="soft"] #shareManagerModal .share-row  {
border-color: var(--border);
  background: rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] #shareManagerModal .share-row-name,
html[data-theme="soft"] #shareManagerModal .share-row-name  {
color: var(--text);
}

html[data-theme="dark"] #shareManagerModal .share-row-email,
html[data-theme="soft"] #shareManagerModal .share-row-email  {
color: var(--text-muted);
}

html[data-theme="dark"] .share-public-badge,
html[data-theme="soft"] .share-public-badge {
  color: var(--accent);
}

html[data-theme="dark"] .cockpit-welcome-public-line,
html[data-theme="soft"] .cockpit-welcome-public-line {
  background: rgba(0, 120, 212, 0.12);
  border-left-color: var(--accent);
}

html[data-theme="dark"] #shareManagerModal .share-forum-label,
html[data-theme="soft"] #shareManagerModal .share-forum-label  {
color: var(--text-muted);
}

html[data-theme="dark"] #shareManagerModal #shareGroupMultiSelect,
html[data-theme="soft"] #shareManagerModal #shareGroupMultiSelect  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #shareManagerModal #shareGroupMultiSelect option,
html[data-theme="soft"] #shareManagerModal #shareGroupMultiSelect option  {
background: var(--surface-muted);
  color: var(--text);
}

html[data-theme="dark"] #shareManagerModal #shareGroupMultiSelect:focus,
html[data-theme="soft"] #shareManagerModal #shareGroupMultiSelect:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] #shareManagerModal .share-group-select-label,
html[data-theme="soft"] #shareManagerModal .share-group-select-label  {
color: var(--text);
}

html[data-theme="dark"] #shareManagerModal .share-scope-hint--tight kbd,
html[data-theme="soft"] #shareManagerModal .share-scope-hint--tight kbd  {
border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Dialog header mark (all modals) â€” slightly brighter on dark headers */
html[data-theme="dark"] .dialog-header-icon,
html[data-theme="soft"] .dialog-header-icon  {
filter: brightness(1.12) contrast(1.05);
  opacity: 0.95;
}

/* Teams / Group Manager — dark / soft */
html[data-theme="dark"] #groupManagerRoot,
html[data-theme="soft"] #groupManagerRoot {
  color: var(--text);
  background: var(--bg, var(--surface));
}

html[data-theme="dark"] #groupManagerRoot .share-groups-modal-card,
html[data-theme="soft"] #groupManagerRoot .share-groups-modal-card {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] #groupManagerRoot .group-manager-title,
html[data-theme="soft"] #groupManagerRoot .group-manager-title {
  color: var(--accent);
}

html[data-theme="dark"] #groupManagerRoot .group-manager-header.dialog-header,
html[data-theme="soft"] #groupManagerRoot .group-manager-header.dialog-header {
  background: var(--dialog-header-bg, transparent);
  border-bottom-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-scope-hint,
html[data-theme="soft"] #groupManagerRoot .share-scope-hint  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-sidebar-title,
html[data-theme="soft"] #groupManagerRoot .share-groups-sidebar-title  {
color: var(--accent);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-list-panel,
html[data-theme="soft"] #groupManagerRoot .share-groups-list-panel {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-list-empty,
html[data-theme="soft"] #groupManagerRoot .share-groups-list-empty,
html[data-theme="dark"] #groupManagerRoot .share-groups-detail-empty,
html[data-theme="soft"] #groupManagerRoot .share-groups-detail-empty,
html[data-theme="dark"] #groupManagerRoot .share-group-members-empty,
html[data-theme="soft"] #groupManagerRoot .share-group-members-empty {
  color: var(--text-muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] #groupManagerRoot .share-group-meta,
html[data-theme="soft"] #groupManagerRoot .share-group-meta {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-group-meta__item strong,
html[data-theme="soft"] #groupManagerRoot .share-group-meta__item strong,
html[data-theme="dark"] #groupManagerRoot .share-group-member-primary,
html[data-theme="soft"] #groupManagerRoot .share-group-member-primary {
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-member-secondary,
html[data-theme="soft"] #groupManagerRoot .share-group-member-secondary,
html[data-theme="dark"] #groupManagerRoot .share-group-member-added,
html[data-theme="soft"] #groupManagerRoot .share-group-member-added {
  color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-list-item,
html[data-theme="soft"] #groupManagerRoot .share-groups-list-item  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-list-item:hover,
html[data-theme="soft"] #groupManagerRoot .share-groups-list-item:hover  {
border-color: rgba(138, 180, 248, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-list-item.is-active,
html[data-theme="soft"] #groupManagerRoot .share-groups-list-item.is-active  {
border-color: rgba(138, 180, 248, 0.55);
  background: rgba(138, 180, 248, 0.14);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-name-label,
html[data-theme="soft"] #groupManagerRoot .share-group-name-label  {
color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-name-controls input[type="text"],
html[data-theme="soft"] #groupManagerRoot .share-group-name-controls input[type="text"] ,
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="email"],
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="email"],
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="text"],
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="text"],
html[data-theme="dark"] #groupManagerRoot #shareGroupEmailInput,
html[data-theme="soft"] #groupManagerRoot #shareGroupEmailInput {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-name-controls input[type="text"]::placeholder,
html[data-theme="soft"] #groupManagerRoot .share-group-name-controls input[type="text"]::placeholder ,
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="email"]::placeholder,
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="email"]::placeholder,
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="text"]::placeholder,
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="text"]::placeholder,
html[data-theme="dark"] #groupManagerRoot #shareGroupEmailInput::placeholder,
html[data-theme="soft"] #groupManagerRoot #shareGroupEmailInput::placeholder {
color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-group-name-controls input[type="text"]:focus,
html[data-theme="soft"] #groupManagerRoot .share-group-name-controls input[type="text"]:focus ,
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="email"]:focus,
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="email"]:focus,
html[data-theme="dark"] #groupManagerRoot .share-group-member-form-row input[type="text"]:focus,
html[data-theme="soft"] #groupManagerRoot .share-group-member-form-row input[type="text"]:focus,
html[data-theme="dark"] #groupManagerRoot #shareGroupEmailInput:focus,
html[data-theme="soft"] #groupManagerRoot #shareGroupEmailInput:focus {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] #groupManagerRoot .share-groups-members-frame,
html[data-theme="soft"] #groupManagerRoot .share-groups-members-frame  {
background: rgba(0, 0, 0, 0.2);
  border-color: var(--border);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-members-heading,
html[data-theme="soft"] #groupManagerRoot .share-groups-members-heading  {
color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-public-hint,
html[data-theme="soft"] #groupManagerRoot .share-groups-public-hint  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-groups-public-hint strong,
html[data-theme="soft"] #groupManagerRoot .share-groups-public-hint strong  {
color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-allow-comment-label,
html[data-theme="soft"] #groupManagerRoot .share-group-allow-comment-label ,
html[data-theme="dark"] #groupManagerRoot .share-check,
html[data-theme="soft"] #groupManagerRoot .share-check  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-group-member-row,
html[data-theme="soft"] #groupManagerRoot .share-group-member-row  {
background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #groupManagerRoot .share-group-member-row:hover,
html[data-theme="soft"] #groupManagerRoot .share-group-member-row:hover  {
border-color: rgba(138, 180, 248, 0.35);
}

html[data-theme="dark"] #groupManagerRoot .share-group-member-row.is-selected,
html[data-theme="soft"] #groupManagerRoot .share-group-member-row.is-selected  {
border-color: rgba(138, 180, 248, 0.55);
  background: rgba(138, 180, 248, 0.12);
  box-shadow: 0 0 0 1px rgba(138, 180, 248, 0.2);
}

html[data-theme="dark"] #groupManagerRoot .share-group-member-badge,
html[data-theme="soft"] #groupManagerRoot .share-group-member-badge  {
color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .share-group-add-another-link,
html[data-theme="soft"] #groupManagerRoot .share-group-add-another-link  {
color: #93c5fd;
}

html[data-theme="dark"] #groupManagerRoot .share-group-add-another-link:hover,
html[data-theme="soft"] #groupManagerRoot .share-group-add-another-link:hover  {
color: #bfdbfe;
}

html[data-theme="dark"] #groupManagerRoot .pill-btn--muted,
html[data-theme="soft"] #groupManagerRoot .pill-btn--muted  {
border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

html[data-theme="dark"] #groupManagerRoot .pill-btn--danger,
html[data-theme="soft"] #groupManagerRoot .pill-btn--danger  {
border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
  background: rgba(127, 29, 29, 0.25);
}

html[data-theme="dark"] #groupManagerRoot .pill-btn--danger:hover:not(:disabled),
html[data-theme="soft"] #groupManagerRoot .pill-btn--danger:hover:not(:disabled)  {
background: rgba(127, 29, 29, 0.4);
}

html[data-theme="dark"] #groupManagerRoot #groupManagerRootMessage,
html[data-theme="soft"] #groupManagerRoot #groupManagerRootMessage,
html[data-theme="dark"] #groupManagerRoot #shareGroupsModalMessage,
html[data-theme="soft"] #groupManagerRoot #shareGroupsModalMessage {
color: var(--text-muted);
}

/* Admin overlay (Cockpit owner tools) */
html[data-theme="dark"] #adminOverlayModal .modal-content,
html[data-theme="soft"] #adminOverlayModal .modal-content  {
background: var(--dialog-surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] #adminOverlayModal .dialog-section,
html[data-theme="soft"] #adminOverlayModal .dialog-section  {
border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #adminOverlayModal .dialog-section-title,
html[data-theme="soft"] #adminOverlayModal .dialog-section-title  {
color: var(--accent);
}

html[data-theme="dark"] #adminOverlayModal .share-scope-hint,
html[data-theme="soft"] #adminOverlayModal .share-scope-hint ,
html[data-theme="dark"] #adminOverlayModal #adminOverlayStatus,
html[data-theme="soft"] #adminOverlayModal #adminOverlayStatus  {
color: var(--text-muted);
}

html[data-theme="dark"] #adminOverlayModal input,
html[data-theme="dark"] #adminOverlayModal select,
html[data-theme="dark"] #adminOverlayModal textarea,
html[data-theme="soft"] #adminOverlayModal input ,
html[data-theme="soft"] #adminOverlayModal select ,
html[data-theme="soft"] #adminOverlayModal textarea  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #adminOverlayModal input::placeholder,
html[data-theme="soft"] #adminOverlayModal input::placeholder  {
color: var(--text-muted);
}

html[data-theme="dark"] #adminOverlayModal input:focus,
html[data-theme="dark"] #adminOverlayModal select:focus,
html[data-theme="dark"] #adminOverlayModal textarea:focus,
html[data-theme="soft"] #adminOverlayModal input:focus ,
html[data-theme="soft"] #adminOverlayModal select:focus ,
html[data-theme="soft"] #adminOverlayModal textarea:focus  {
border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  outline: none;
}

html[data-theme="dark"] #adminOverlayModal .account-overlay-tab,
html[data-theme="soft"] #adminOverlayModal .account-overlay-tab  {
background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #adminOverlayModal .account-overlay-tab.active,
html[data-theme="soft"] #adminOverlayModal .account-overlay-tab.active  {
background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Help modals — inspect wikis, Cockpit welcome, mode onboarding */
html[data-theme="dark"] #bbInspectHelpModal .modal-content,
html[data-theme="soft"] #bbInspectHelpModal .modal-content,
html[data-theme="dark"] #cockpitWelcomeModal .modal-content,
html[data-theme="soft"] #cockpitWelcomeModal .modal-content,
html[data-theme="dark"] #cockpitModeOnboardModal .modal-content,
html[data-theme="soft"] #cockpitModeOnboardModal .modal-content {
  background: var(--dialog-surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] #bbInspectHelpModal .dialog-section,
html[data-theme="soft"] #bbInspectHelpModal .dialog-section {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #bbInspectHelpModal .bb-inspect-help-id,
html[data-theme="soft"] #bbInspectHelpModal .bb-inspect-help-id,
html[data-theme="dark"] #bbInspectHelpModal .bb-inspect-help-block h3,
html[data-theme="soft"] #bbInspectHelpModal .bb-inspect-help-block h3,
html[data-theme="dark"] #bbInspectHelpModal .bb-inspect-help-interim-note,
html[data-theme="soft"] #bbInspectHelpModal .bb-inspect-help-interim-note {
  color: var(--text-muted);
}

html[data-theme="dark"] #bbInspectHelpModal .bb-inspect-id-code,
html[data-theme="soft"] #bbInspectHelpModal .bb-inspect-id-code {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #bbInspectHelpModal .bb-inspect-wiki-link--live,
html[data-theme="soft"] #bbInspectHelpModal .bb-inspect-wiki-link--live {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--accent);
}

html[data-theme="dark"] #cockpitWelcomeModal .cockpit-welcome-graphic,
html[data-theme="soft"] #cockpitWelcomeModal .cockpit-welcome-graphic,
html[data-theme="dark"] #cockpitModeOnboardModal .cockpit-welcome-graphic,
html[data-theme="soft"] #cockpitModeOnboardModal .cockpit-welcome-graphic {
  background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] #cockpitWelcomeModal .cockpit-welcome-body p,
html[data-theme="soft"] #cockpitWelcomeModal .cockpit-welcome-body p,
html[data-theme="dark"] #cockpitModeOnboardModal .cockpit-welcome-body p,
html[data-theme="soft"] #cockpitModeOnboardModal .cockpit-welcome-body p,
html[data-theme="dark"] #cockpitWelcomeModal .cockpit-welcome-opt-out,
html[data-theme="soft"] #cockpitWelcomeModal .cockpit-welcome-opt-out,
html[data-theme="dark"] #cockpitModeOnboardModal .cockpit-welcome-opt-out,
html[data-theme="soft"] #cockpitModeOnboardModal .cockpit-welcome-opt-out {
  color: var(--text-muted);
}

html[data-theme="dark"] #cockpitWelcomeModal .cockpit-mode-onboard-label,
html[data-theme="soft"] #cockpitWelcomeModal .cockpit-mode-onboard-label,
html[data-theme="dark"] #cockpitModeOnboardModal .cockpit-mode-onboard-label,
html[data-theme="soft"] #cockpitModeOnboardModal .cockpit-mode-onboard-label {
  color: var(--text-muted);
}

/* Stash chooser + viewer — notepad.css option cards use light #fff / #fffbeb */
html[data-theme="dark"] #stashChooserModal .modal-content,
html[data-theme="soft"] #stashChooserModal .modal-content,
html[data-theme="dark"] #stashBoxModal .modal-content,
html[data-theme="soft"] #stashBoxModal .modal-content {
  background: var(--dialog-surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] #stashChooserModal .dialog-section,
html[data-theme="soft"] #stashChooserModal .dialog-section,
html[data-theme="dark"] #stashChooserModal .stash-chooser-section,
html[data-theme="soft"] #stashChooserModal .stash-chooser-section {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #stashChooserModal .share-scope-hint,
html[data-theme="soft"] #stashChooserModal .share-scope-hint {
  color: var(--text-muted);
}

html[data-theme="dark"] #stashChooserModal .share-scope-hint strong,
html[data-theme="soft"] #stashChooserModal .share-scope-hint strong {
  color: var(--text);
}

html[data-theme="dark"] .stash-chooser-option,
html[data-theme="soft"] .stash-chooser-option {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .stash-chooser-option--browse,
html[data-theme="soft"] .stash-chooser-option--browse {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-muted));
}

html[data-theme="dark"] .stash-chooser-option--browse:hover:not(:disabled),
html[data-theme="soft"] .stash-chooser-option--browse:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-muted));
}

html[data-theme="dark"] .stash-chooser-option--stash,
html[data-theme="soft"] .stash-chooser-option--stash {
  border-color: color-mix(in srgb, #f59e0b 55%, var(--border));
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-muted));
}

html[data-theme="dark"] .stash-chooser-option--stash:hover:not(:disabled),
html[data-theme="soft"] .stash-chooser-option--stash:hover:not(:disabled) {
  border-color: #d97706;
  background: color-mix(in srgb, #f59e0b 22%, var(--surface-muted));
}

html[data-theme="dark"] .stash-chooser-option__title,
html[data-theme="soft"] .stash-chooser-option__title {
  color: var(--text);
}

html[data-theme="dark"] .stash-chooser-option__desc,
html[data-theme="soft"] .stash-chooser-option__desc {
  color: var(--text-muted);
}

html[data-theme="dark"] .stash-chooser-option__hint,
html[data-theme="soft"] .stash-chooser-option__hint {
  color: var(--accent);
}

html[data-theme="dark"] .stash-chooser-option__hint--warn,
html[data-theme="soft"] .stash-chooser-option__hint--warn {
  color: #fbbf24;
}

html[data-theme="dark"] .stash-chooser-alert,
html[data-theme="soft"] .stash-chooser-alert {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

html[data-theme="dark"] .stash-chooser-alert strong,
html[data-theme="soft"] .stash-chooser-alert strong {
  color: #fee2e2;
}

html[data-theme="dark"] .stash-chooser-alert p,
html[data-theme="soft"] .stash-chooser-alert p {
  color: #fecaca;
}

html[data-theme="dark"] .stash-chooser-confirm-target,
html[data-theme="soft"] .stash-chooser-confirm-target {
  color: var(--text);
}

html[data-theme="dark"] #stashChooserModal .share-message,
html[data-theme="soft"] #stashChooserModal .share-message {
  color: var(--text-muted);
}

html[data-theme="dark"] #stashBoxModal .stash-box-shell,
html[data-theme="soft"] #stashBoxModal .stash-box-shell {
  background: var(--surface-muted);
  color: var(--text);
}

html[data-theme="dark"] #stashBoxModal .stash-box-toolbar,
html[data-theme="dark"] #stashBoxModal .stash-box-sidebar,
html[data-theme="dark"] #stashBoxModal .stash-box-editor-wrap,
html[data-theme="dark"] #stashBoxModal .stash-box-detail,
html[data-theme="soft"] #stashBoxModal .stash-box-toolbar,
html[data-theme="soft"] #stashBoxModal .stash-box-sidebar,
html[data-theme="soft"] #stashBoxModal .stash-box-editor-wrap,
html[data-theme="soft"] #stashBoxModal .stash-box-detail {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .stash-box-tab,
html[data-theme="soft"] .stash-box-tab {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .stash-box-tab:hover,
html[data-theme="soft"] .stash-box-tab:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

html[data-theme="dark"] .stash-box-tab.active,
html[data-theme="soft"] .stash-box-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .stash-box-loading,
html[data-theme="dark"] .stash-box-empty-hint,
html[data-theme="dark"] .stash-box-collection-hint,
html[data-theme="dark"] .stash-box-count,
html[data-theme="dark"] .stash-tree-empty,
html[data-theme="soft"] .stash-box-loading,
html[data-theme="soft"] .stash-box-empty-hint,
html[data-theme="soft"] .stash-box-collection-hint,
html[data-theme="soft"] .stash-box-count,
html[data-theme="soft"] .stash-tree-empty {
  color: var(--text-muted);
}

html[data-theme="dark"] .stash-box-sidebar .archive-tree .tree-node,
html[data-theme="soft"] .stash-box-sidebar .archive-tree .tree-node {
  color: var(--text);
}

html[data-theme="dark"] .stash-box-sidebar .archive-tree .tree-node:hover,
html[data-theme="soft"] .stash-box-sidebar .archive-tree .tree-node:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-muted));
}

html[data-theme="dark"] .stash-box-sidebar .archive-tree .tree-node.active,
html[data-theme="soft"] .stash-box-sidebar .archive-tree .tree-node.active {
  background: color-mix(in srgb, var(--accent) 35%, var(--surface-muted));
  color: var(--text);
}

html[data-theme="dark"] .stash-box-error,
html[data-theme="soft"] .stash-box-error {
  color: #fca5a5;
}

/* ========== Dashboard ========== */
html[data-theme="dark"] .dashboard-root,
html[data-theme="soft"] .dashboard-root {
background: linear-gradient(180deg, #12141a 0%, #1a1d26 100%);
}

html[data-theme="dark"] .dashboard-top,
html[data-theme="soft"] .dashboard-top {
border-bottom-color: var(--border);
  background: rgba(28, 31, 40, 0.92);
}

html[data-theme="dark"] .dashboard-heading,
html[data-theme="soft"] .dashboard-heading {
color: #f1f5f9;
}

html[data-theme="dark"] .dashboard-tagline,
html[data-theme="dark"] .dashboard-date-long,
html[data-theme="dark"] .dashboard-date-long,
html[data-theme="soft"] .dashboard-tagline ,
html[data-theme="soft"] .dashboard-date-long ,
html[data-theme="soft"] .dashboard-date-long {
color: var(--text-muted);
}

html[data-theme="dark"] .dashboard-date-input,
html[data-theme="soft"] .dashboard-date-input {
background: #252830;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .dashboard-error,
html[data-theme="soft"] .dashboard-error {
background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

html[data-theme="dark"] .dashboard-section,
html[data-theme="soft"] .dashboard-section {
background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .dashboard-section-title,
html[data-theme="soft"] .dashboard-section-title {
color: var(--text-muted);
}

html[data-theme="dark"] .dashboard-summary-chip,
html[data-theme="soft"] .dashboard-summary-chip {
background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .dashboard-jump a,
html[data-theme="soft"] .dashboard-jump a {
color: var(--accent);
}

html[data-theme="dark"] .dashboard-jump a:hover,
html[data-theme="soft"] .dashboard-jump a:hover {
color: #a8c7fa;
}

html[data-theme="dark"] .dashboard-card,
html[data-theme="soft"] .dashboard-card {
background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .dashboard-card-title,
html[data-theme="soft"] .dashboard-card-title {
color: var(--text);
}

html[data-theme="dark"] .dashboard-card-meta,
html[data-theme="dark"] .dashboard-card-body,
html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .dashboard-card-body,
html[data-theme="dark"] .dashboard-empty,
html[data-theme="soft"] .dashboard-card-meta ,
html[data-theme="soft"] .dashboard-card-body ,
html[data-theme="soft"] .dashboard-empty ,
html[data-theme="soft"] .dashboard-card-body ,
html[data-theme="soft"] .dashboard-empty {
color: var(--text-muted);
}

html[data-theme="dark"] .dashboard-micro a,
html[data-theme="soft"] .dashboard-micro a {
color: var(--accent);
}

html[data-theme="dark"] ::selection,
html[data-theme="soft"] ::selection {
background: rgba(138, 180, 248, 0.35);
  color: var(--text);
}
