/*
 * Compass graphite module theme.
 * This layer changes presentation only. Existing module layout, visibility,
 * responsive rules, data colors and interactions continue to own their rules.
 * The document scope also covers overlays mounted directly beneath body.
 */

/* Module aliases keep lazy-loaded styles on the shared semantic palette. */
html[data-compass-theme="graphite"] .ci-workbench {
  --ci-ink: var(--compass-ink);
  --ci-muted: var(--compass-muted);
  --ci-line: var(--compass-line);
  --ci-soft: var(--compass-subtle);
  --ci-accent: var(--compass-accent);
  --ci-accent-dark: var(--compass-accent-hover);
  --ci-accent-soft: var(--compass-soft);
  --ci-purple: var(--compass-accent);
  --ci-purple-dark: var(--compass-accent-hover);
  --ci-purple-soft: var(--compass-soft);
  --ci-green: var(--compass-success);
  --ci-amber: var(--compass-warning);
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .fa-workbench {
  --fa-ink: var(--compass-ink);
  --fa-muted: var(--compass-muted);
  --fa-line: var(--compass-line);
  --fa-bg: var(--compass-page);
  --fa-accent: var(--compass-accent);
  color: var(--compass-ink);
  font-size: 14px;
}

html[data-compass-theme="graphite"] .kol-dashboard {
  --kol-ink: var(--compass-ink);
  --kol-muted: var(--compass-muted);
  --kol-line: var(--compass-line);
  --kol-accent: var(--compass-accent);
  --kol-soft: var(--compass-soft);
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .kol-query-public-view {
  --green: var(--compass-accent);
  --muted: var(--compass-muted);
  --line: var(--compass-line);
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] :is(.pr-page, .pr-dialog) {
  --pr-ink: var(--compass-ink);
  --pr-muted: var(--compass-muted);
  --pr-line: var(--compass-line);
  --pr-accent: var(--compass-accent);
  --pr-soft: var(--compass-subtle);
  color: var(--compass-ink);
  font-family: inherit;
}

/* Video library: match the final workspace overrides without changing grids. */
html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-stat, .video-library-filters, .video-sample-card, .video-library-data
) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] #app-shell :is(.video-library-stat, .video-sample-card):hover {
  border-color: #bdcbed;
  background: var(--compass-surface);
}

html[data-compass-theme="graphite"] #app-shell .video-library-stat.is-active {
  background: var(--compass-soft);
  border-color: var(--compass-accent);
  box-shadow: inset 0 0 0 1px var(--compass-accent);
}

html[data-compass-theme="graphite"] #app-shell .video-library-stat.is-active::after,
html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-stat.is-active > span,
  .video-library-filter-row .text-button, .video-sample-footer .row-action
) { color: var(--compass-accent-hover); }

html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-stat > strong, .video-library-results-heading h2,
  .video-sample-content h3, .video-sample-metrics dd, .video-library-empty h3
) { color: var(--compass-ink); }

html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-intro p, .video-library-scope-note, .video-library-results-heading p,
  .video-library-data-note, .video-library-data-note summary, .video-library-sort,
  .video-library-filter-row > label, .video-library-pagination, .video-sample-description,
  .video-library-filter-label, .video-library-empty p
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] #app-shell :is(
  .video-sample-platform, .video-sample-creator, .video-sample-product,
  .video-sample-product > strong, .video-sample-metrics dt, .video-sample-id,
  .video-library-stat > small
) { color: var(--compass-muted); font-size: 12px; }

html[data-compass-theme="graphite"] #app-shell .video-sample-creator strong {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] #app-shell .video-library-view {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] #app-shell .video-library-view button {
  color: var(--compass-muted);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] #app-shell .video-library-view button[aria-pressed="true"] {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell :is(.video-sample-card-top, .video-library-table th) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-chips button, .video-sample-platform > span, .video-library-empty-icon
) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
}

html[data-compass-theme="graphite"] #app-shell .video-library-feedback:not(.is-error):not(.is-success) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell :is(
  .video-library-search-row .search-field, .video-library-filters select,
  .video-library-pagination select
) {
  color: var(--compass-ink);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] #app-shell .video-library-scope-note > span:first-child::before {
  background: var(--compass-accent);
}

html[data-compass-theme="graphite"] .video-kol-creator-link {
  color: var(--compass-accent-hover);
  text-decoration-color: #b1c0e8;
}

/* Content analysis keeps warning/success meanings and chart colors separate. */
html[data-compass-theme="graphite"] .ci-workbench :is(
  .ci-question, .ci-evidence-card, .ci-local-evidence, .ci-local-evidence-item
) {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 8px #19212e06;
}

html[data-compass-theme="graphite"] .ci-workbench .ci-question.is-selected {
  background: var(--compass-surface);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-question.is-featured {
  border-top-color: var(--compass-accent);
  box-shadow: 0 4px 18px #19212e09;
}

html[data-compass-theme="graphite"] .ci-workbench .ci-question.is-featured[data-tone="caution"] {
  border-top-color: var(--compass-warning);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-question.is-featured[data-tone="neutral"] {
  border-top-color: #8090a3;
}

html[data-compass-theme="graphite"] .ci-workbench :is(
  .ci-question > p, .ci-question.is-secondary .commerce-finding-takeaway
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .ci-workbench .ci-button {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .ci-workbench .ci-button:hover {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .ci-workbench :is(
  .ci-button.is-primary, .ci-feature-main > footer .ci-button:first-child
) {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .ci-workbench :is(
  .ci-button.is-primary, .ci-feature-main > footer .ci-button:first-child
):hover {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .ci-workbench :is(
  .ci-signal, .ci-evidence-card .ci-evidence-metric, .ci-local-script, .ci-local-profile
) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-local-video-mark {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .ci-workbench :is(.commerce-questions, .ci-goal-options) {
  background: var(--compass-subtle);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .ci-workbench :is(.commerce-questions, .ci-goal-options) button {
  color: var(--compass-muted);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .ci-workbench :is(.commerce-questions, .ci-goal-options) button:hover {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .ci-workbench :is(.commerce-questions, .ci-goal-options) button[aria-pressed="true"] {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  box-shadow: 0 1px 5px #19212e10;
}

html[data-compass-theme="graphite"] .ci-workbench :is(.ci-feature-evidence, .ci-feature-next) {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-feature-next {
  border-left-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-feature-main .commerce-finding-takeaway {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-feature-metrics > div {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .ci-workbench .ci-feature-metrics span,
html[data-compass-theme="graphite"] .ci-workbench .ci-feature-metrics small {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .ci-workbench .ci-feature-video {
  border-top-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .ci-workbench :is(.ci-table, .ci-pair-table) tbody tr:hover {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .ci-workbench :is(.ci-table, .ci-pair-table) tbody tr.is-selected {
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .ci-workbench select {
  color: var(--compass-ink);
  border-color: var(--compass-line);
  background-color: var(--compass-surface);
  border-radius: 6px;
}

/* Free analysis: controls, selected fields and layout-edit feedback only. */
html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-button, input, select, .fa-toolbar-actions > .fa-more > summary
) { border-radius: 6px; }

html[data-compass-theme="graphite"] .fa-workbench .fa-button:hover:not(:disabled) {
  color: var(--compass-ink);
  border-color: #bdcbed;
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-button.fa-primary, .fa-canvas-navigation > .fa-primary
) {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-button.fa-primary, .fa-canvas-navigation > .fa-primary
):hover:not(:disabled) {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-canvas-entry:hover, .fa-field:hover, .fa-field.is-added,
  .fa-chart-types > .fa-button:hover:not(:disabled), .fa-field-slot:hover,
  .fa-quick-fields > button:hover
) { background: var(--compass-subtle); border-color: #bdcbed; }

html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-canvas-entry.is-active, .fa-chart-directory > .fa-button[aria-current="true"],
  .fa-chart-types > .fa-button[aria-pressed="true"], .fa-field[aria-pressed="true"],
  .fa-eyebrow, .fa-scope-chips > span
) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
}

html[data-compass-theme="graphite"] .fa-workbench :is(
  .fa-selected-field, .fa-settings-guide, .fa-card-controls, .fa-field-chip,
  .fa-quick-fields > button, .fa-library-destination, .fa-data-table th
) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-card {
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px #19212e07;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-card.is-selected {
  border-color: var(--compass-accent);
  box-shadow: 0 0 0 2px #315fe81a, 0 2px 10px #19212e07;
}

html[data-compass-theme="graphite"] .fa-workbench :is(.fa-card-header, .fa-card-footer) {
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-question-options .fa-starter {
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 8px #19212e06;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-question-options .fa-starter:is(:hover, [aria-pressed="true"]) {
  background: var(--compass-soft);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-workbench :is(.fa-compare, .fa-field-slot) {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-view-switch {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-notice:not(.is-error) {
  color: var(--compass-muted);
  border-color: var(--compass-line);
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-data-table tbody tr:hover {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-layout-toggle {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-layout-toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-layout-toggle:hover:not(:disabled) {
  background: #e2eaff;
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-layout-toggle[aria-pressed="true"]:hover:not(:disabled) {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .fa-layout-guidance {
  color: var(--compass-muted);
  background: var(--compass-soft);
  border-color: #d6dff6;
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing {
  background-color: var(--compass-subtle);
  background-image: radial-gradient(#cbd4e0 .7px, transparent .7px);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-canvas.is-layout-editing > .fa-card {
  border-color: #cbd4e0;
  box-shadow: 0 3px 14px #19212e0b;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-canvas.is-layout-editing > .fa-card:is(:hover, :focus-within) {
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-workbench .fa-canvas.is-layout-editing :is(.fa-drag-handle, .fa-resize-handle) {
  color: var(--compass-accent-hover);
  border-color: #bdcbed;
  background: var(--compass-soft);
  border-radius: 6px;
  box-shadow: 0 2px 8px #19212e0b;
}

html[data-compass-theme="graphite"] .fa-workbench .fa-canvas.is-layout-editing :is(.fa-drag-handle, .fa-resize-handle):hover {
  background: #e2eaff;
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-layout-card-actions {
  background: var(--compass-subtle);
  border-bottom-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .fa-layout-card-actions :is(.fa-button, output),
html[data-compass-theme="graphite"] .fa-layout-card-position {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .fa-layout-card-actions .fa-layout-width-button[aria-pressed="true"] {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing > .fa-card.fa-is-dragging {
  border-color: var(--compass-accent) !important;
  box-shadow: inset 0 0 0 3px var(--compass-soft) !important;
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing > .fa-card.fa-is-dragging::after {
  color: var(--compass-accent-hover);
  background: #edf2ffb8;
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing > .fa-card:is(.fa-drop-before, .fa-drop-after)::before {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing > .fa-card.fa-is-resizing {
  border-color: var(--compass-accent);
  box-shadow: 0 0 0 3px #315fe81a, 0 6px 20px #19212e12;
}

html[data-compass-theme="graphite"] .fa-canvas.is-layout-editing > .fa-card.fa-is-resizing::after {
  color: #fff;
  background: var(--compass-accent);
}

html[data-compass-theme="graphite"] .fa-layout-drag-preview {
  color: var(--compass-ink);
  border-color: #bdcbed;
  background: var(--compass-surface);
  border-radius: 10px;
  box-shadow: 0 12px 34px #19212e33;
}

html[data-compass-theme="graphite"] .fa-layout-drag-preview > span {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .fa-layout-drag-preview small {
  color: var(--compass-muted);
  font-size: 12px;
}

/* KOL query workspace, table and native profile/comparison overlays. */
html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-history, .archive-person, .archive-profile, .archive-candidate-workbench,
  .archive-column-options
) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px #19212e07;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-profile {
  border-radius: 14px;
  box-shadow: 0 18px 70px #19212e2b;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-profile-backdrop {
  background: #19212e66;
}

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-conversation, .archive-interpretation, .archive-readonly,
  .archive-attribute-list > span, .archive-match-reasons li,
  .archive-works-metrics > div, .archive-table-toolbar,
  .archive-comparison-table th:first-child
) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-conversation:hover {
  background: var(--compass-soft);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-conversation.is-selected {
  background: var(--compass-soft);
  border-color: var(--compass-accent);
  box-shadow: 0 0 0 1px var(--compass-accent);
}

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-brand strong, .archive-result-heading h2, .archive-person h3,
  .archive-person-metrics dd, .archive-works-metrics dd,
  .archive-profile-section h3, .archive-field-group h3,
  .archive-column-options legend, .archive-candidate-empty strong,
  .archive-comparison-table thead strong, .archive-video summary strong,
  .archive-linkage-origin strong, .archive-channel-values b,
  .archive-identity-link, .archive-candidate-table, .archive-evidence-count
) { color: var(--compass-ink); }

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-history-heading p, .archive-eyebrow, .archive-history-hint,
  .archive-conversation-time, .archive-conversation-time b, .archive-speaker,
  .archive-response-count, .archive-name-preview, .archive-selected-label,
  .archive-history-foot, .archive-result-navigation, .archive-result-byline,
  .archive-interpretation-head p, .archive-list-heading p, .archive-field-count,
  .archive-person-top p, .archive-person-order, .archive-person-meta,
  .archive-person-metrics dt, .archive-person-bottom > span, .archive-results-foot,
  .archive-results-foot span, .archive-profile-header p, .archive-profile-header span,
  .archive-profile-intro, .archive-profile-intro span + span,
  .archive-profile-source, .archive-linkage-origin span, .archive-linkage-origin small,
  .archive-works-scope, .archive-works-note, .archive-works-formats,
  .archive-works-metrics dt, .archive-profile-section h3 span,
  .archive-field-group h3 span, .archive-attribute-list strong,
  .archive-attribute-list small, .archive-empty-evidence, .archive-video-number,
  .archive-candidate-table small, .archive-identity-link span,
  .archive-channel-values, .archive-contact-state, .archive-candidate-empty p,
  .archive-compare-bar > span, .archive-column-options p,
  .archive-column-options label, .archive-results-foot,
  .archive-comparison-table thead span, .archive-comparison-table small
) { color: var(--compass-muted); }

/* These labels carry readable data, including the confirmed contrast defects. */
html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-person-metrics dt, .archive-works-metrics dt, .archive-profile-source,
  .archive-works-scope, .archive-works-note, .archive-works-formats,
  .archive-profile-section h3 span, .archive-field-group h3 span,
  .archive-attribute-list small, .archive-empty-evidence,
  .archive-comparison-table thead span, .archive-comparison-table small,
  .archive-profile-header span
) { font-size: 12px; }

html[data-compass-theme="graphite"] .kol-query-public-view .archive-person-metrics .is-missing,
html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table .is-missing {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-filter-field input, .archive-filter-field select, .archive-column-preset select,
  .archive-filter-percent input, .archive-column-options,
  .archive-profile-close, .archive-history-close,
  .archive-linkage-origin button, .archive-linkage-actions button,
  .archive-selected-creators button, .archive-candidate-empty button,
  .archive-comparison-table thead button
) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-response-line > b, .archive-linkage-actions button,
  .archive-linkage-origin button, .archive-candidate-empty button,
  .archive-person-bottom button, .archive-detail-cell button,
  .archive-comparison-table thead button, .archive-results-foot span,
  .archive-selected-label, .archive-clear-filters, .archive-filter-toggle
) { color: var(--compass-accent-hover); }

html[data-compass-theme="graphite"] .kol-query-public-view :is(
  .archive-applied-filters > span, .archive-linkage-origin,
  .archive-answer-icon, .archive-filter-toggle b,
  .archive-list-heading h3 span, .archive-history-heading h1 span
) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table :is(th, td),
html[data-compass-theme="graphite"] .kol-query-public-view .archive-comparison-table :is(th, td) {
  border-color: var(--compass-line);
  background: var(--compass-surface);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table thead th,
html[data-compass-theme="graphite"] .kol-query-public-view .archive-comparison-table thead th {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table tbody tr:nth-child(even) > * {
  background: #fbfcfe;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table tbody tr:hover > * {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table tbody tr:has(input:checked) > * {
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table .archive-identity-cell {
  border-right-color: var(--compass-line);
  box-shadow: 3px 0 5px #19212e06;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-candidate-table thead th:is(
  [aria-sort="ascending"], [aria-sort="descending"]
) button i { color: var(--compass-accent); }

html[data-compass-theme="graphite"] .kol-query-public-view .archive-compare-bar {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  box-shadow: 0 3px 10px #19212e07;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-compare-button {
  color: #fff;
  background: var(--compass-accent);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-compare-button:hover:not(:disabled) {
  background: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .kol-query-public-view .archive-compare-button:disabled {
  color: var(--compass-muted);
  background: #e5eaf2;
}

html[data-compass-theme="graphite"] .kol-query-public-view input[type="checkbox"] {
  accent-color: var(--compass-accent);
}

/* KOL dashboard retains its charts, editable card widths and data categories. */
html[data-compass-theme="graphite"] .kol-dashboard :is(
  aside[data-kol-target], [data-kol-filters], .kol-card, [data-kol-dialog]
) {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px #19212e07;
}

html[data-compass-theme="graphite"] .kol-dashboard [data-kol-header] {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border: 1px solid var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px #19212e07;
}

html[data-compass-theme="graphite"] .kol-dashboard .kol-heading > span {
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .kol-dashboard :is(.kol-heading p, .kol-header-facts span) {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .kol-dashboard .kol-header-facts > div {
  border-left-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  input:not([type="checkbox"]), select, .kol-segments button,
  .kol-check-grid span, .kol-toolbar-actions > button,
  .kol-toolbar-actions details > summary, .kol-board-toolbar > button,
  .kol-canvas-rail > div:first-child button, .kol-versions > button,
  .kol-version-list button, .kol-editor-actions button, .kol-column-list span
) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-segments button[aria-pressed="true"], .kol-check-grid input:checked + span,
  .kol-canvas-entry.is-active
) {
  color: var(--compass-accent-hover);
  border-color: #bdcbed;
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-canvas-entry:hover, .kol-directory-entry:hover,
  .kol-toolbar-actions details > div button:hover
) { background: var(--compass-subtle); }

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-canvas-entry, .kol-directory-entry, .kol-canvas-entry small,
  .kol-directory-entry span, .kol-card-heading > span,
  .kol-chart-empty, .kol-board-empty, .kol-inspect-group article span,
  .kol-inspect-group article small, .kol-inspect-group article p,
  .kol-number-grid span, .kol-number-grid small, .kol-control-group > span,
  .kol-versions > div:first-child span, .kol-versions > div:last-child small,
  .kol-compare > p, .kol-candidate-table tbody th small,
  .kol-candidate-table tbody td:not(:first-child)
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-number-grid > div, .kol-inspect-intro, .kol-versions, .kol-compare-empty
) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-number-grid strong, .kol-inspect-intro strong, .kol-compare-empty strong,
  .kol-board-empty strong, .kol-candidate-table tbody th strong
) { color: var(--compass-ink); }

html[data-compass-theme="graphite"] .kol-dashboard :is(th, td) {
  border-bottom-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .kol-dashboard thead th {
  color: var(--compass-muted);
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .kol-dashboard tbody tr:hover {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  [data-kol-tabs] button[aria-current="page"],
  .kol-candidate-table td button, .kol-compare-head button,
  .kol-editor-block > div:first-child button, .kol-result-table tbody th button,
  .kol-result-table tbody td button
) { color: var(--compass-accent-hover); }

html[data-compass-theme="graphite"] .kol-dashboard [data-kol-tabs] button[aria-current="page"]::after {
  background: var(--compass-accent);
}

html[data-compass-theme="graphite"] .kol-dashboard input[type="checkbox"] {
  accent-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .kol-dashboard :is(.kol-primary, .kol-board-head-actions > button) {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(.kol-primary, .kol-board-head-actions > button):hover:not(:disabled) {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .kol-dashboard [data-kol-mode="edit"] .kol-board-head-actions > button {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-card-actions button, .kol-quick-filters button, [data-kol-dialog] header button
) {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-card-actions button, .kol-quick-filters button
):hover { background: var(--compass-soft); border-color: #bdcbed; }

html[data-compass-theme="graphite"] .kol-dashboard .kol-card-editor {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-target-fields > label, .kol-price label, .kol-candidate-controls label,
  .kol-editor-grid label, .kol-target-foot, .kol-table-caption,
  .kol-card-top > div:nth-child(2) > span, .kol-card-foot,
  .kol-dialog-note, .kol-filter-head small, .kol-filter-head > span,
  .kol-quick-filters label, .kol-more-filters > label, .kol-board-head-actions label,
  .kol-grouped-number > p, .kol-editor-note, .kol-grouped-number td small,
  .kol-gmv-trend-picker, .kol-trend-summary span, .kol-trend-note, .kol-trend-source
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-target-foot, .kol-table-caption, .kol-dialog-note, .kol-card-foot,
  .kol-grouped-number td small, .kol-trend-source
) { font-size: 12px; }

html[data-compass-theme="graphite"] .kol-dashboard :is(
  .kol-filter-head > div > span, .kol-board-heading > div:first-child > span,
  .kol-card-foot summary, [data-kol-dialog] header span
) { color: var(--compass-accent-hover); }

html[data-compass-theme="graphite"] .kol-dashboard .kol-grouped-number td strong {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .kol-dashboard .kol-gmv-trend-picker select {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

/* Video/KOL comparison is mounted directly on body. */
html[data-compass-theme="graphite"] .vkl-overlay {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .vkl-backdrop { background: #19212e61; }

html[data-compass-theme="graphite"] .vkl-dialog {
  background: var(--compass-page);
  border-radius: 14px;
  box-shadow: 0 18px 70px #19212e2b;
}

html[data-compass-theme="graphite"] .vkl-heading {
  background: var(--compass-surface);
  border-bottom-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .vkl-heading p {
  color: var(--compass-accent-hover);
  font-size: 12px;
}

html[data-compass-theme="graphite"] .vkl-button {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .vkl-button:hover:not(:disabled) {
  background: var(--compass-soft);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .vkl-primary {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .vkl-primary:hover:not(:disabled) {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .vkl-tabs {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] :is(
  .vkl-video, .vkl-creator, .vkl-research-grid > section, .vkl-comparison-scroll
) {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] :is(
  .vkl-note, .vkl-video-top, .vkl-video-copy, .vkl-metrics dt,
  .vkl-video footer > span, .vkl-creator header span, .vkl-match-reason,
  .vkl-compare-bar, .vkl-works-summary span, .vkl-toolbar label,
  .vkl-pagination, .vkl-empty, .vkl-note-label
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] :is(
  .vkl-note, .vkl-video-top, .vkl-metrics dt, .vkl-toolbar label,
  .vkl-match-reason, .vkl-note-label
) { font-size: 12px; }

html[data-compass-theme="graphite"] :is(
  .vkl-tags span, .vkl-condition-picker label, .vkl-reference,
  .vkl-works-summary > div
) {
  color: var(--compass-muted);
  background: var(--compass-soft);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .vkl-tags span { font-size: 12px; }

html[data-compass-theme="graphite"] :is(.vkl-select input, .vkl-condition-picker input) {
  accent-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .vkl-compare-bar {
  background: var(--compass-page);
}

html[data-compass-theme="graphite"] :is(.vkl-toolbar input, .vkl-toolbar select, .vkl-note-label textarea) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .vkl-evidence-link {
  background: var(--compass-subtle);
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .vkl-comparison :is(th, td) {
  border-bottom-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .vkl-comparison thead th {
  background: var(--compass-subtle);
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] :is(.vkl-video footer, .vkl-creator footer) {
  border-top-color: var(--compass-line);
}

/* Upload retains its allowed sources and genuine progress/status feedback. */
html[data-compass-theme="graphite"] :is(.upload-heading h1, .video-upload-drop strong) {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] :is(
  .upload-heading p, .video-upload-drop p, .video-upload-drop small,
  .video-upload-list li > span:not(:first-child), .video-upload-details summary span,
  .video-upload-details label, .video-upload-note
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] :is(.video-upload-drop small, .video-upload-note) {
  font-size: 12px;
}

html[data-compass-theme="graphite"] .video-upload-card {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
  box-shadow: 0 3px 14px #19212e08;
}

html[data-compass-theme="graphite"] .video-upload-drop {
  background: var(--compass-subtle);
  border-color: #c3cfe4;
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .video-upload-drop.is-dragging {
  background: var(--compass-soft);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] :is(.video-upload-symbol, .video-upload-file-icon) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .video-upload-list button {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .upload-access-note {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .upload-access-note a {
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .video-upload-progress progress {
  accent-color: var(--compass-accent);
}

/* Tasks: progress, complete, waiting and error keep their separate meanings. */
html[data-compass-theme="graphite"] .task-center-preview-note {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  color: var(--compass-muted);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] :is(
  .processing-toolbar, .processing-table th, .task-center .batch-monitor,
  .task-center .management-tabs, .task-center .repair-monitor-stats > div,
  .task-center .refresh-policy-card, .task-schedules-empty,
  .task-schedules-history-empty, .task-schedules-technical pre
) {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] :is(
  .processing-toolbar input, .processing-toolbar select, .processing-table-wrap,
  .processing-pagination select, .task-center .task-stats > div,
  .task-center .batch-monitor-card, .task-workspace, .task-monitor-empty,
  .task-schedules-detail
) {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] :is(
  .processing-toolbar input, .processing-toolbar select, .processing-pagination select
) { border-radius: 6px; }

html[data-compass-theme="graphite"] :is(
  .processing-section-heading h2, .processing-batch-cell strong,
  .processing-source-cell strong, .processing-batch-name-cell, .processing-count,
  .processing-duration, .processing-table-state strong, .task-center .task-stats strong,
  .task-center .batch-monitor-heading h2, .task-workspace-heading h2
) { color: var(--compass-ink); }

html[data-compass-theme="graphite"] :is(
  .processing-toolbar label > span, .processing-table td,
  .processing-batch-cell span, .processing-source-cell span,
  .processing-table-progress > b, .processing-table-state,
  .processing-table-state div p, .processing-pagination,
  .task-center .task-stats span, .task-center .task-stats small
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .processing-table td {
  border-bottom-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .processing-table tbody tr:hover td {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .processing-table-progress > span {
  background: #e5eaf2;
}

html[data-compass-theme="graphite"] .processing-table-progress:not(.is-completed) > span i {
  background: var(--compass-accent);
}

html[data-compass-theme="graphite"] .processing-spinner {
  border-color: #d6dff6;
  border-top-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .task-center .task-stats > div.is-accent {
  background: var(--compass-soft);
  border-color: #d6dff6;
}

html[data-compass-theme="graphite"] .task-center .task-stats > div.is-accent::after {
  background: var(--compass-accent);
  box-shadow: 0 0 0 5px #315fe81a;
}

html[data-compass-theme="graphite"] .task-monitor-empty > span,
html[data-compass-theme="graphite"] .task-center .management-tabs button.is-active small {
  background: var(--compass-accent);
  color: #fff;
}

html[data-compass-theme="graphite"] .task-schedules-button,
html[data-compass-theme="graphite"] .task-schedules-row-action {
  font-size: 12px !important;
}

html[data-compass-theme="graphite"] #page-processing .processing-mobile-filter-toggle {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #d6dff6;
}

html[data-compass-theme="graphite"] #page-processing .processing-table tbody tr.processing-mobile-card {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] #page-processing .processing-mobile-card td::before {
  color: var(--compass-muted);
}

/* Platform resources includes dialogs that can render outside its page. */
html[data-compass-theme="graphite"] :is(
  .pr-heading h1, .pr-section-heading h2, .pr-connection-card h3,
  .pr-shop-copy h3, .pr-creator-card h3, .pr-metric-card strong,
  .pr-table td > strong, .pr-video-cell strong, .pr-research-footer strong,
  .pr-context-card h2, .pr-context-card dd, .pr-creator-card dd, .pr-dialog h2,
  .pr-sync-context > div, .pr-sync-context dd, .pr-mapping-file strong,
  .pr-metric-heading strong, .pr-selection-line > strong
) { color: var(--compass-ink); }

html[data-compass-theme="graphite"] :is(
  .pr-heading p, .pr-section-heading p, .pr-connection-card p, .pr-shop-copy p,
  .pr-creator-card > p, .pr-card-meta, .pr-sync-context dt, .pr-sync-context small,
  .pr-mapping-file p, .pr-metric-heading span, .pr-page .pr-metric-period,
  .pr-metric-card span, .pr-metric-card small, .pr-metric-definitions,
  .pr-selection-line, .pr-table small, .pr-video-cell .pr-source-id,
  .pr-research-footer span, .pr-flow-note span, .pr-marketplace-context,
  .pr-dialog > p, .pr-dialog li, .pr-management-tools label,
  .pr-management-tools select
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .pr-button {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
  font-size: 13px;
}

html[data-compass-theme="graphite"] .pr-button:hover:not(:disabled) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
  border-color: #bdcbed;
}

html[data-compass-theme="graphite"] .pr-button.pr-button-primary {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .pr-button.pr-button-primary:hover:not(:disabled) {
  color: #fff;
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .pr-button.pr-button-text,
html[data-compass-theme="graphite"] .pr-metric-definitions summary {
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .pr-tabs button.is-active {
  color: var(--compass-accent-hover);
  border-bottom-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] :is(
  .pr-demo-strip, .pr-shop-toolbar, .pr-stepper, .pr-metric-switch,
  .pr-tag, .pr-flow-note, .pr-info-note, .pr-research-footer, .pr-management-tools
) {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] :is(.pr-tabs button > span, .pr-model, .pr-video-art) {
  color: var(--compass-accent-hover);
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] :is(
  .pr-shop-toolbar select, .pr-demo-strip select, .pr-select-label select,
  .pr-management-tools select, .pr-search
) {
  color: var(--compass-ink);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .pr-shop-toolbar label,
html[data-compass-theme="graphite"] .pr-search input {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .pr-search input::placeholder {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .pr-search:focus-within {
  border-color: var(--compass-accent);
  box-shadow: 0 0 0 3px #315fe81a;
}

html[data-compass-theme="graphite"] :is(
  .pr-workflow, .pr-metric-grid, .pr-metric-card,
  .pr-table-wrap, .pr-dialog, .pr-connection-card, .pr-shop-card,
  .pr-creator-card, .pr-sync-context, .pr-mapping-file, .pr-context-card
) {
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
}

html[data-compass-theme="graphite"] .pr-metric-card { border-radius: 0; }

html[data-compass-theme="graphite"] :is(.pr-eyebrow, .pr-step-label) {
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] :is(.pr-connection-card.is-selected, .pr-shop-card.is-selected) {
  border-color: var(--compass-accent);
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .pr-stepper .is-current button {
  color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] .pr-stepper .is-current button > span {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .pr-table th {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-bottom-color: var(--compass-line);
  font-size: 12px;
}

html[data-compass-theme="graphite"] .pr-table td {
  color: var(--compass-ink);
  border-bottom-color: var(--compass-line);
  font-size: 13px;
}

html[data-compass-theme="graphite"] .pr-table tbody tr:hover td {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] .pr-table tr.is-selected td {
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] .pr-checkbox-cell input,
html[data-compass-theme="graphite"] .pr-sync-progress progress {
  accent-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .pr-sync-progress progress::-webkit-progress-value {
  background: var(--compass-accent);
}

html[data-compass-theme="graphite"] .pr-metric-switch button {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .pr-metric-switch button[aria-pressed="true"] {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  box-shadow: 0 1px 3px #19212e10;
}

html[data-compass-theme="graphite"] .pr-dialog {
  border-radius: 14px;
  box-shadow: 0 18px 70px #19212e2b;
}

/* Generic evidence drawers, dialogs and command search also use root tokens. */
html[data-compass-theme="graphite"] .detail-drawer {
  color: var(--compass-ink);
  background: var(--compass-surface);
  box-shadow: -8px 0 28px #19212e1a;
}

html[data-compass-theme="graphite"] .detail-drawer :is(.archive-version-line, .archive-metric-grid > div) {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] .detail-drawer :is(
  .field-item dt, .archive-field-grid dt, .archive-metric-grid span,
  .archive-version-line > div > span
) { color: var(--compass-muted); }

html[data-compass-theme="graphite"] .detail-drawer .button-primary {
  color: #fff;
  background: var(--compass-accent);
  border-color: var(--compass-accent);
}

html[data-compass-theme="graphite"] .detail-drawer .button-primary:hover {
  background: var(--compass-accent-hover);
  border-color: var(--compass-accent-hover);
}

html[data-compass-theme="graphite"] :is(.fa-dialog, .workspace-command) {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 14px;
  box-shadow: 0 18px 70px #19212e2b;
}

html[data-compass-theme="graphite"] :is(
  .fa-dialog, .workspace-command, .pr-dialog,
  .kol-dashboard [data-kol-dialog]
)::backdrop { background: #19212e78; }

html[data-compass-theme="graphite"] .workspace-command input {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .workspace-command-results button:is(:hover, :focus-visible) {
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] :is(
  .workspace-command-results span, .workspace-command-hint
) { color: var(--compass-muted); }

/* Shared focus treatment; only presentation, never keyboard/event behavior. */
html[data-compass-theme="graphite"] :is(
  .ci-workbench, .fa-workbench, .kol-dashboard, .kol-query-public-view,
  .pr-page, .pr-dialog, .vkl-overlay, .upload-page, .detail-drawer,
  .workspace-command, .task-center, .task-schedules
) :is(button, input, select, textarea, summary, a, [tabindex]):focus-visible {
  outline-color: var(--compass-accent);
}

/* Source-unavailable/loading states retain their existing content and entry. */
html[data-compass-theme="graphite"] .workspace-blank-state {
  color: var(--compass-muted);
}

html[data-compass-theme="graphite"] .workspace-blank-state :is(h1, h2, strong) {
  color: var(--compass-ink);
}

html[data-compass-theme="graphite"] .workspace-status {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] .workspace-research-question {
  color: var(--compass-ink);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 10px;
}

/* Preserve existing edge-to-edge mobile profile and comparison behavior. */
@media (max-width: 720px) {
  html[data-compass-theme="graphite"] .kol-query-public-view .archive-comparison {
    border-radius: 0;
  }
  html[data-compass-theme="graphite"] .kol-query-public-view .archive-history {
    border-radius: 0 0 0 10px;
  }
}

/* The editorial video layout owns a double-ID scope in its lazy stylesheet.
 * Match that scope so later-loaded rules cannot restore the old green preview.
 */
html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-preview {
  color: var(--compass-ink);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-preview-icon {
  color: var(--compass-accent-hover);
  background: var(--compass-surface);
  border-color: var(--compass-line);
  border-radius: 6px;
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-preview-label {
  color: var(--compass-muted);
  font-size: 12px;
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-preview p {
  color: var(--compass-ink);
  font-size: 13px;
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-proof {
  background: var(--compass-surface);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-card:is(:hover, :focus-within) {
  background: var(--compass-surface);
  border-color: #bdcbed;
  box-shadow: 0 6px 18px #19212e0d;
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-library-table th {
  color: var(--compass-muted);
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-library-stat:hover {
  background: var(--compass-subtle);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-library-stat.is-active:hover {
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-library-chips button {
  color: var(--compass-accent-hover);
  border-color: #d6dff6;
  background: var(--compass-soft);
}

html[data-compass-theme="graphite"] #app-shell #page-videos .video-library-view {
  background: var(--compass-subtle);
  border-color: var(--compass-line);
}

html[data-compass-theme="graphite"] #app-shell #page-videos :is(.video-sample-metrics dt, .video-sample-id) {
  color: var(--compass-muted);
  font-size: 12px;
}

@media (max-width: 700px) {
  html[data-compass-theme="graphite"] #app-shell #page-videos .video-sample-preview p {
    font-size: 12px;
  }
}
