/* Linked knowledge palette and typography, selectable across Mission Control. */
html.theme-knowledge {
  color-scheme: light;
  --font-family-ui: Inter, 'Segoe UI', Arial, sans-serif;
  --font-weight-page-title: 400;
  --font-weight-title: 400;
  --app-bg: #f7f8f4;
  --app-text: #26392e;
  --text-color: #26392e;
  --app-text-muted: #5d7059;
  --text-muted: #5d7059;
  --text-secondary: #496343;
  --heading-color: #234c39;
  --surface-card: #fcfdf9;
  --surface-muted: #edf0e9;
  --app-surface: #fcfdf9;
  --app-surface-soft: #edf0e9;
  --app-surface-muted: #edf0e9;
  --app-surface-elevated: #f5f7f0;
  --card-bg: #fcfdf9;
  --surface: #fcfdf9;
  --surface-subtle: #edf0e9;
  --surface-hover: #e6eee0;
  --app-input-bg: #fcfdf9;
  --app-border: #d8e0d2;
  --app-border-color: #d8e0d2;
  --border-color: #d8e0d2;
  --border-light: #d8e0d2;
  --app-accent: #234c39;
  --primary-color: #234c39;
  --link-color: #28583a;
  --accent-tint: #e6eee0;
  --accent-border: #93ae80;
  --btn-primary-bg: #234c39;
  --btn-primary-bg-hover: #173c2b;
  --btn-primary-border: #234c39;
  --btn-primary-text: #fff;
  --btn-secondary-bg: #f5f7f0;
  --btn-secondary-bg-hover: #e1e9da;
  --btn-secondary-text: #34543d;
  --btn-secondary-border: #bbcbb1;
  --btn-border: #bbcbb1;
  --btn-icon-bg: #edf2e7;
  --btn-icon-bg-hover: #dbe5d4;
  --btn-icon-text: #36533d;
  --btn-outline-bg: #fcfdf9;
  --btn-outline-bg-hover: #e6eee0;
  --btn-outline-text: #234c39;
  --btn-active-bg: #234c39;
  --btn-active-text: #fff;
  --btn-active-bg-subtle: #dbe5d5;
  --control-ring: inset 0 0 0 1px #ffffff80;
  --mui-bg-default: #f7f8f4;
  --mui-bg-paper: #fcfdf9;
  --mui-border: #d8e0d2;
  --app-chrome-bg: #f7f8f4;
  --app-chrome-shadow: 0 1px 0 #d8e0d2;
  --app-chrome-text: #26392e;
  --app-chrome-muted: #5d7059;
  --app-chrome-logo: #234c39;
  --app-chrome-logo-shadow: transparent;
  --app-chrome-control-bg: #fcfdf9;
  --app-chrome-control-border: #d8e0d2;
  --app-chrome-control-ring: #d8e0d2;
  --app-chrome-control-hover-bg: #e6eee0;
  --app-chrome-control-hover-border: #93ae80;
  --app-left-nav-bg: #edf0e9;
  --app-left-nav-border: #d8e0d2;
  --app-left-nav-shadow: none;
  --app-left-nav-group-text: #5d7059;
  --app-left-nav-link-text: #34543d;
  --app-left-nav-link-hover-bg: #e1e9da;
  --app-left-nav-link-hover-border: #bbcbb1;
  --app-left-nav-hover-text: #234c39;
  --app-left-nav-link-active-bg: #dbe5d5;
  --app-left-nav-link-active-border: #829d71;
  --app-left-nav-link-active-shadow: none;
  --app-left-nav-link-active-text: #234c39;
  --app-workspace-canvas-base: #f7f8f4;
  --app-workspace-grid-line: transparent;
  --app-workspace-surface-bg: linear-gradient(#f7f8f4, #f7f8f4);
  --login-bg-1: #f7f8f4;
  --login-bg-2: #edf0e9;
  --login-bg-3: #fcfdf9;
  --login-surface: #fcfdf9;
  --login-border: #d8e0d2;
  --login-shadow: 0 12px 32px #26392e12;
  --login-text: #26392e;
  --login-text-muted: #5d7059;
  --login-input-bg: #fcfdf9;
  --login-input-border: #d8e0d2;
  --login-input-focus: #829d71;
  --login-btn-bg: #234c39;
  --login-btn-bg-hover: #173c2b;
  --login-btn-text: #fff;
  --login-theme-surface: #edf0e9;
  --login-theme-border: #d8e0d2;
}

html.theme-knowledge body.app-left-nav {
  --app-nav-scrollbar-thumb-start: #a8be99;
  --app-nav-scrollbar-thumb: #6f8965;
  --app-nav-scrollbar-thumb-hover: #496343;
  --app-nav-scrollbar-thumb-shadow: 0 4px 12px #234c3920;
  --app-nav-scrollbar-track: #d8e0d280;
  --app-nav-scrollbar-track-hover: #bbcbb180;
  --workspace-frame-border: #d8e0d2;
  --workspace-frame-bg: #f7f8f4;
  --workspace-frame-muted-bg: #edf0e9;
  --workspace-frame-panel-bg: #fcfdf9;
  --workspace-frame-shadow: 0 6px 20px #26392e0a;
}

html.theme-knowledge body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-family-ui);
  line-height: 1.55;
}

html.theme-knowledge :is(button, input, select, textarea) {
  font-family: var(--font-family-ui);
}

/* Heading treatment belongs to interface chrome, not user-authored rich text. */
html.theme-knowledge :is(h1, h2, h3, h4, h5):not([contenteditable] *):not(.global-wysiwyg-input *):not(.wysiwyg-content *):not(.note-content *) {
  font-family: Georgia, 'Times New Roman', serif !important;
  font-weight: 400 !important;
  color: var(--heading-color);
  letter-spacing: normal;
}

html.theme-knowledge :is(.modal-content, .login-container, .login-card, .notes-preview-pane, .dashboard-card) {
  background: var(--surface-card);
  color: var(--app-text);
  border-color: var(--app-border);
}

html.theme-knowledge :is(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select, textarea) {
  background-color: var(--app-input-bg);
  color: var(--app-text);
  border-color: var(--app-border);
}

html.theme-knowledge :is(input, select, textarea, button, a):focus-visible {
  outline: 2px solid #829d71;
  outline-offset: 2px;
}

html.theme-knowledge :is(input[type=checkbox], input[type=radio]) { accent-color: #234c39; }
html.theme-knowledge ::selection { background: #dbe5d5; color: #234c39; }
html.theme-knowledge.app-booting,
html.theme-knowledge.app-booting body { background: #f7f8f4; color: #26392e; }

/* Every admin destination and its embedded CRM frame use the Knowledge palette. */
html.theme-knowledge body.admin-workspace-active,
html.theme-knowledge body.crm-admin-plane {
  --ap-navy: #edf0e9;
  --ap-navy-2: #edf0e9;
  --ap-blue: #234c39;
  --ap-bg: #f7f8f4;
  --ap-card: #fcfdf9;
  --ap-border: #d8e0d2;
  --ap-text: #26392e;
  --ap-muted: #5d7059;
  --ap-rail-text: #34543d;
  --ap-rail-dim: #5d7059;
  --ap-shadow: 0 4px 14px #234c3910;
  --app-workspace-canvas-base: #f7f8f4;
  --app-workspace-grid-line: transparent;
  --app-workspace-surface-bg: linear-gradient(#f7f8f4, #f7f8f4);
  --workspace-frame-bg: #f7f8f4;
  --workspace-frame-panel-bg: #fcfdf9;
  --workspace-frame-muted-bg: #edf0e9;
  background: var(--app-bg);
  color: var(--app-text);
}
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-header, .admin-content, .admin-container) { background: var(--app-bg); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-tool-section, .admin-tool-subsection, .admin-integration-form, .admin-results-section-wrap, .admin-table-wrap) { border-color: var(--app-border); }
html.theme-knowledge body.admin-workspace-active #adminTab .admin-tool-section { background: var(--surface-card); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav, .admin-page-nav-group, .admin-theme-tabs) { background: var(--surface-muted); border-color: var(--app-border); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav-item, .admin-page-nav-group-title, .admin-page-nav-eyebrow, .admin-page-nav-toggle, .admin-theme-tab) { color: var(--app-left-nav-link-text); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav-item, .admin-theme-tab):hover { background: var(--app-left-nav-link-hover-bg); color: var(--app-accent); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav-item, .admin-theme-tab).active { background: var(--app-left-nav-link-active-bg); border-color: var(--app-left-nav-link-active-border); color: var(--app-accent); box-shadow: none; }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav-toggle, .admin-tool-section .btn-secondary):hover { background: var(--btn-secondary-bg-hover); color: var(--btn-secondary-text); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-page-nav-item, .admin-theme-tab):focus-visible { outline-color: #829d71; }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.tbl-wrap th, .admin-table-wrap th) { background: var(--surface-muted); color: var(--app-text-muted); border-color: var(--app-border); }
html.theme-knowledge body.admin-workspace-active #adminTab :is(.admin-theme-search-input, .admin-theme-search-clear) { background: var(--app-input-bg) !important; color: var(--app-text) !important; border-color: var(--app-border) !important; }
/* Personal CapEx / OpEx spreadsheet follows the Knowledge palette. */
html.theme-knowledge .apex-entry-sheet-table { color: #26392e; background: #fcfdf9; border-color: #d8e0d2; }
html.theme-knowledge .apex-entry-sheet-table :is(th, td) { border-color: #d8e0d2; }
html.theme-knowledge .apex-entry-sheet-table :is(thead th, tfoot th, tfoot td),
html.theme-knowledge .apex-entry-sheet-table .apex-entry-sheet-project,
html.theme-knowledge .apex-entry-sheet-timeoff-cell { background: #edf1e9; }
html.theme-knowledge .apex-entry-sheet-project { box-shadow: 1px 0 0 #d8e0d2; }
html.theme-knowledge :is(.apex-entry-sheet-day-name, .apex-entry-sheet-project-name, .apex-entry-sheet-row-total strong, .apex-entry-sheet-day-total) { color: #34543d; }
html.theme-knowledge :is(.apex-entry-sheet-day-date, .apex-entry-sheet-project-meta, .apex-entry-sheet-row-total, .apex-entry-sheet-field span, .apex-entry-sheet-cell-total) { color: #5d7059; }
html.theme-knowledge .apex-entry-sheet-day-today { background: #e6eee0 !important; color: #234c39; box-shadow: inset 0 3px 0 #28583a; }
html.theme-knowledge .apex-entry-sheet-day-today :is(.apex-entry-sheet-day-name, .apex-entry-sheet-day-date) { color: #234c39; }
html.theme-knowledge .apex-entry-sheet-day-today-badge { background: #dbe5d5; color: #234c39; }
html.theme-knowledge .apex-entry-sheet-table :is(.apex-entry-sheet-cell-today, .apex-entry-sheet-footer-today) { background: #f0f5eb; box-shadow: inset 3px 0 0 #93ae80; }
html.theme-knowledge .apex-entry-sheet-project-row:hover :is(.apex-entry-sheet-cell, .apex-entry-sheet-project) { background: #eef3e8; }
html.theme-knowledge .apex-entry-sheet-cell { background: #fcfdf9; }
html.theme-knowledge .apex-entry-sheet-input { width: 100%; max-width: 72px; color: #26392e; background: #fcfdf9; border-color: #c5d3be; font-variant-numeric: tabular-nums; }
html.theme-knowledge .apex-entry-sheet-input:focus { outline-color: #b5cba5; border-color: #28583a; }
html.theme-knowledge .apex-entry-sheet-input:disabled { background: #edf1e9; color: #73816c; }
html.theme-knowledge .apex-entry-sheet-timeoff-toggle input { accent-color: #28583a; }
html.theme-knowledge .apex-entry-sheet-empty-row td { color: #5d7059; background: #fcfdf9; }

html.theme-knowledge .apex-entry-sheet-cell-total { border-color: #d8e0d2; }
html.theme-knowledge .apex-entry-sheet-cell-total strong { color: #34543d; }
html.theme-knowledge .apex-entry-sheet-timeoff-toggle { color: #5d7059; }
