/*
 * CX Insights Active Palette visual priority layer.
 * Scope: static workspace-surface presentation only.
 * This file adds domain-aware visual hierarchy, stronger functional color,
 * chart contrast, and surface depth without adding runtime workflow behavior.
 */

:root {
  --cx-primary: #0a1b2f;
  --cx-primary-hover: #12365c;
  --cx-primary-contrast: #f8fbff;
  --cx-accent: #007c89;
  --cx-accent-hover: #006673;
  --cx-accent-soft: #c9f2f2;
  --cx-background: #eef3f7;
  --cx-surface-subtle: #f7fafc;
  --cx-surface-muted: #e7eef5;
  --cx-border: #cbd8e5;
  --cx-border-strong: #92a8bc;
  --cx-text-primary: #102033;
  --cx-text-muted: #53657a;
  --cx-success: #127246;
  --cx-success-soft: #d7f5e5;
  --cx-warning: #b86b00;
  --cx-warning-soft: #fff0ca;
  --cx-danger: #c5221f;
  --cx-danger-soft: #ffe0dc;
  --cx-critical-fill: #b91c1c;
  --cx-critical-contrast: #fff7f5;
  --cx-critical-amber: #d97706;
  --cx-chart-primary: #0b3b67;
  --cx-chart-accent: #007c89;
  --cx-chart-comparison: #5b4bb7;
  --cx-chart-warning: #c26d00;
  --cx-chart-danger: #c5221f;
  --cx-chart-success: #127246;
  --cx-shadow-panel: 0 20px 42px rgba(10, 27, 47, 0.13);
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 124, 137, 0.16), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(197, 34, 31, 0.12), transparent 30rem),
    linear-gradient(180deg, #f4f8fb 0%, var(--cx-background) 42%, #e8eef5 100%);
}

.sidebar {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(180deg, #07182c 0%, var(--cx-primary) 46%, #081523 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12), 18px 0 44px rgba(10, 27, 47, 0.16);
}

.sidebar::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cx-critical-amber), var(--cx-danger), var(--cx-accent));
  content: "";
}

.mark {
  background: linear-gradient(135deg, var(--cx-accent) 0%, #0ea5a5 48%, #f59e0b 100%);
  box-shadow: 0 12px 28px rgba(0, 124, 137, 0.28);
}

.module-tab[aria-current="page"] {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(0, 124, 137, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.module-tab[aria-current="page"]::before {
  background: linear-gradient(180deg, #ffb547, #ff6b4a, #14b8a6);
}

.workspace {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 18rem);
}

.topbar {
  border-bottom: 1px solid rgba(146, 168, 188, 0.7);
  background:
    linear-gradient(90deg, rgba(10, 27, 47, 0.04), rgba(0, 124, 137, 0.07)),
    rgba(247, 250, 252, 0.95);
  box-shadow: 0 12px 28px rgba(10, 27, 47, 0.08);
}

.guardrail,
.scope-guardrail {
  border-color: rgba(0, 124, 137, 0.36);
  background: linear-gradient(180deg, #ffffff 0%, #e9fbf9 100%);
  box-shadow: 0 8px 18px rgba(0, 124, 137, 0.08);
}

.command-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(10, 27, 47, 0.18);
  background:
    linear-gradient(135deg, rgba(10, 27, 47, 0.94), rgba(11, 59, 103, 0.88) 46%, rgba(0, 124, 137, 0.82)),
    radial-gradient(circle at 84% 20%, rgba(255, 181, 71, 0.42), transparent 20rem);
  color: var(--cx-primary-contrast);
  box-shadow: 0 26px 56px rgba(10, 27, 47, 0.22);
}

.command-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%) 0 0 / 26px 26px,
    linear-gradient(225deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0 / 26px 26px;
  opacity: 0.52;
  content: "";
}

.command-hero > * {
  position: relative;
  z-index: 1;
}

.command-hero .eyebrow,
.command-hero p,
.command-hero small,
.command-hero .top-issue-context p,
.command-hero .top-issue-context span,
.command-hero .evidence-gate span,
.command-hero .evidence-gate small {
  color: rgba(248, 251, 255, 0.82);
}

.command-hero h3,
.command-hero strong,
.command-hero .top-issue-context strong,
.command-hero .evidence-gate strong {
  color: #ffffff;
}

.command-hero .status-badge.urgent,
.status-badge.urgent,
.issue-card:has(.status-badge.urgent) .status-badge,
.metric-card-alert .metric-gauge {
  border-color: rgba(197, 34, 31, 0.24);
  background: #fff2ef;
  color: #9f1d1b;
  box-shadow: none;
}

.top-issue-context > div,
.evidence-gate {
  border-color: rgba(255, 255, 255, 0.22);
  border-left-color: #ffb547;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.top-issue-actions .primary,
.queue-actions .primary,
.replacement-evaluation-cta {
  background: linear-gradient(135deg, #ff7a45 0%, var(--cx-critical-amber) 48%, #b45309 100%);
  border-color: #a94d05;
  box-shadow: 0 14px 28px rgba(217, 119, 6, 0.24);
}

.command-metric-clusters,
.cockpit-grid,
.decision-path,
.queue-buckets,
.trend-chart-grid {
  gap: 16px;
}

.metric-cluster,
.panel,
.surface-brief,
.queue-bucket,
.saved-view-summary,
.evidence-workspace,
.ranking-trace-panel {
  border-color: rgba(146, 168, 188, 0.58);
  box-shadow: 0 14px 32px rgba(10, 27, 47, 0.08);
}

.metric-cluster-priority,
.command-metrics .metric-card-alert,
.issue-card:has(.status-badge.urgent),
.queue-item.urgent,
.queue-item-investigation-match,
.heatmap-selection-summary {
  border-color: rgba(146, 168, 188, 0.58);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
  box-shadow: 0 14px 30px rgba(10, 27, 47, 0.07);
}

.metric-cluster-priority {
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%),
    radial-gradient(circle at 96% 16%, rgba(0, 124, 137, 0.12), transparent 14rem);
  box-shadow: inset 4px 0 0 rgba(197, 34, 31, 0.36), 0 14px 30px rgba(10, 27, 47, 0.07);
}

.metric-cluster-priority .metric-cluster-head,
.issue-card:has(.status-badge.urgent) > div:first-child {
  margin: -10px -10px 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, rgba(0, 124, 137, 0.1), rgba(10, 27, 47, 0.04));
  color: var(--cx-text-primary);
  padding: 10px;
}

.queue-item.urgent .queue-item-title-row,
.queue-item-investigation-match .queue-item-title-row {
  margin: 0;
  border-left: 4px solid rgba(197, 34, 31, 0.48);
  border-radius: 0;
  background: transparent;
  color: var(--cx-text-primary);
  padding: 0 0 0 12px;
}

.metric-cluster-priority .metric-cluster-head {
  align-items: center;
  min-height: 58px;
  background: linear-gradient(90deg, rgba(0, 124, 137, 0.12), rgba(10, 27, 47, 0.04));
  padding: 14px 16px;
  box-shadow: inset 0 -1px 0 rgba(146, 168, 188, 0.34);
}

.metric-cluster-priority .metric-cluster-head .ui-chip-rank {
  border-color: rgba(197, 34, 31, 0.22);
  background: #ffffff;
  color: #9f1d1b;
  box-shadow: none;
}

.metric-cluster-priority .metric-cluster-head p {
  max-width: 260px;
  font-size: 0.78rem;
  line-height: 1.45;
  text-wrap: balance;
}

.metric-cluster-priority .metric-cluster-head p,
.metric-cluster-priority .metric-cluster-head span,
.issue-card:has(.status-badge.urgent) > div:first-child * {
  color: var(--cx-text-primary);
}

.metric-cluster-priority .metric-cluster-head .ui-chip-rank {
  color: #9f1d1b;
}

.metric-cluster-priority .command-metrics {
  gap: 12px;
  padding-top: 2px;
}

.metric-cluster-priority .command-metrics .metric-card-alert {
  border-color: rgba(146, 168, 188, 0.58);
  background: #ffffff;
  box-shadow: inset 3px 0 0 rgba(197, 34, 31, 0.34), 0 10px 20px rgba(10, 27, 47, 0.05);
}

.metric-cluster-priority .command-metrics .metric-card-alert p {
  color: var(--cx-text-primary);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.metric-cluster-priority .command-metrics .metric-card-alert small {
  color: var(--cx-text-muted);
  line-height: 1.35;
}

.metric-cluster-priority .command-metrics .metric-card-empty {
  border-color: rgba(146, 168, 188, 0.7);
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: inset 0 4px 0 var(--cx-border-strong), 0 10px 20px rgba(10, 27, 47, 0.07);
}

.metric-cluster-priority .command-metrics .metric-card-empty > span:not(.metric-gauge),
.metric-cluster-priority .command-metrics .metric-card-empty .metric-gauge {
  border-color: rgba(146, 168, 188, 0.58);
  background: #ffffff;
  color: #334155;
  box-shadow: inset 0 0 0 6px #eef3f7;
}

.metric-cluster-priority .command-metrics .metric-card-empty p {
  color: #4a5568;
}

.metric-cluster-priority .command-metrics .metric-card-empty small::before {
  color: #64748b;
  content: "No current urgent records · ";
}

.metric-cluster-priority .command-metrics .metric-kind-risk .metric-card-main {
  grid-template-columns: 76px minmax(0, 1fr);
}

.metric-cluster-priority .command-metrics .metric-kind-risk .metric-gauge {
  display: inline-grid;
  place-content: center;
  place-items: center;
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  height: 68px;
  box-sizing: border-box;
  overflow: visible;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.hotspot-panel {
  border-color: rgba(0, 124, 137, 0.48);
  background:
    linear-gradient(180deg, #ffffff 0%, #e8fbfb 100%),
    radial-gradient(circle at 100% 0%, rgba(0, 124, 137, 0.16), transparent 18rem);
  box-shadow: 0 22px 48px rgba(0, 124, 137, 0.18);
}

.heatmap .cell[aria-pressed="true"],
.heatmap .selected-cell {
  background: linear-gradient(180deg, var(--cx-critical-fill), #d9482f);
  color: #fff7f5;
  box-shadow: 0 0 0 4px rgba(197, 34, 31, 0.2), 0 18px 36px rgba(197, 34, 31, 0.22);
}

.heatmap .selected-cell span,
.heatmap .selected-cell small,
.heatmap .cell[aria-pressed="true"] span,
.heatmap .cell[aria-pressed="true"] small {
  color: #fff7f5;
}

.metric-sparkline,
.trend-chart,
.trend-card,
.weekly-counts div {
  background:
    linear-gradient(180deg, #ffffff 0%, #f0f6fb 100%);
  border-color: rgba(146, 168, 188, 0.64);
}

.metric-sparkline i:nth-child(1),
.metric-sparkline i:nth-child(2) {
  background: var(--cx-chart-comparison);
}

.metric-sparkline i:nth-child(3),
.metric-sparkline i:nth-child(4) {
  background: var(--cx-chart-warning);
}

.metric-sparkline i:nth-child(n + 5) {
  background: var(--cx-chart-danger);
}

.trend-bar-negative,
.trend-bar-danger,
.bar-danger,
[data-trend="negative"] {
  background: var(--cx-chart-danger) !important;
}

.trend-bar-positive,
.trend-bar-success,
.bar-success,
[data-trend="positive"] {
  background: var(--cx-chart-success) !important;
}

.trend-bar-warning,
.bar-warning,
[data-trend="warning"] {
  background: var(--cx-chart-warning) !important;
}

.action-state-callback,
.action-state-manager-review,
.action-state-process-issue,
.action-state-emerging-hotspot,
.investigation-match-label {
  border-color: transparent;
  color: #fff7f5;
  box-shadow: 0 8px 18px rgba(10, 27, 47, 0.14);
}

.action-state-callback,
.action-state-manager-review,
.investigation-match-label {
  background: var(--cx-critical-fill);
}

.action-state-process-issue,
.action-state-emerging-hotspot {
  background: var(--cx-critical-amber);
}

.action-state-coaching,
.action-state-resolved,
.action-state-dismissed {
  border-color: transparent;
  background: var(--cx-accent);
  color: #f8fbff;
}

.command-center .queue-snapshot-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fff8f5 100%),
    radial-gradient(circle at 98% 10%, rgba(197, 34, 31, 0.12), transparent 13rem);
}

.command-center .queue-snapshot-panel .panel-head {
  align-items: center;
  gap: 14px;
  margin: -16px -16px 14px;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #8f1616 0%, var(--cx-critical-fill) 54%, #d9482f 100%);
  color: #fff7f5;
  padding: 14px 16px;
}

.command-center .queue-snapshot-panel .panel-head .eyebrow,
.command-center .queue-snapshot-panel .panel-head h3 {
  color: #fff7f5;
}

.command-center .queue-snapshot-panel .panel-head h3 {
  margin-top: 4px;
  line-height: 1.22;
}

.command-center .queue-snapshot-panel .panel-head .compact-action {
  border-color: rgba(255, 255, 255, 0.72);
  background: #ffffff;
  color: #8f1616;
  box-shadow: 0 10px 20px rgba(80, 8, 8, 0.2);
}

.command-center .queue-snapshot-panel .compact-queue {
  display: grid;
  gap: 14px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.command-center .queue-snapshot-panel .queue-item-compact {
  gap: 12px;
  overflow: visible;
  border-color: rgba(185, 28, 28, 0.34);
  background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
  padding: 14px;
  box-shadow: inset 0 4px 0 var(--cx-critical-fill), 0 12px 24px rgba(185, 28, 28, 0.1);
}

.command-center .queue-snapshot-panel .queue-item-title-row {
  align-items: flex-start;
  gap: 10px;
}

.command-center .queue-snapshot-panel .queue-title-stack {
  gap: 7px;
}

.command-center .queue-snapshot-panel .queue-title-stack strong {
  color: var(--cx-primary);
  font-size: 0.98rem;
  line-height: 1.28;
}

.command-center .queue-snapshot-panel .queue-state-badges {
  gap: 7px;
  justify-content: flex-start;
  max-width: 100%;
}

.command-center .queue-snapshot-panel .ui-chip-rank,
.command-center .queue-snapshot-panel .queue-state-badges .ui-chip,
.command-center .queue-snapshot-panel .action-state-badge,
.command-center .queue-snapshot-panel .investigation-match-label {
  min-height: 28px;
  border-color: rgba(10, 27, 47, 0.14);
  font-size: 0.68rem;
  line-height: 1.15;
  padding: 7px 9px;
  white-space: normal;
}

.command-center .queue-snapshot-panel .queue-state-badges .ui-chip-evidence {
  background: #e9fbf9;
  color: #164b45;
}

.command-center .queue-snapshot-panel .queue-problem,
.command-center .queue-snapshot-panel .why-action {
  color: var(--cx-text-primary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.command-center .queue-snapshot-panel .queue-problem {
  border-top-color: rgba(185, 28, 28, 0.18);
}

.command-center .queue-snapshot-panel .queue-recommendation-block {
  border-color: rgba(185, 28, 28, 0.22);
  background: #fff8f5;
}

.command-center .queue-snapshot-panel .why-action {
  border-left-color: var(--cx-critical-fill);
  background: #ffffff;
  border-radius: 0 6px 6px 0;
  padding: 8px 10px 8px 12px;
}

.command-center .queue-snapshot-panel .queue-investigation-chain {
  display: grid;
  gap: 6px;
  border-color: rgba(0, 124, 137, 0.28);
  border-left: 4px solid var(--cx-accent);
  background: #f7fcfc;
  color: var(--cx-text-primary);
  padding: 10px 12px;
}

.command-center .queue-snapshot-panel .queue-investigation-chain strong,
.command-center .queue-snapshot-panel .queue-investigation-chain span {
  flex-basis: auto;
  color: var(--cx-text-primary);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.command-center .queue-snapshot-panel .queue-actions {
  padding-top: 2px;
}

.command-center .queue-snapshot-panel .queue-actions .row-action {
  width: 100%;
  justify-content: center;
  border-color: rgba(0, 124, 137, 0.38);
  background: #e9fbf9;
  color: #164b45;
  font-weight: 900;
}

.runner-up-strip,
.ranking-evidence-metrics span,
.workspace-audit-strip strong,
.export-state-strip span {
  border-color: rgba(0, 124, 137, 0.24);
  background: #e9fbf9;
  color: #164b45;
}

.evidence-tabs button[aria-selected="true"] {
  background: linear-gradient(135deg, var(--cx-accent), #0ea5a5);
  color: #f8fbff;
  box-shadow: 0 10px 20px rgba(0, 124, 137, 0.18);
}

.panel,
.chart-panel,
.evidence-panel,
.saved-view-panel,
.report-workspace-panel,
.admin-import-panel,
.replacement-evaluation-panel {
  border-color: rgba(146, 168, 188, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(0, 124, 137, 0.08), transparent 18rem);
  box-shadow: var(--cx-shadow-panel);
}

.panel-head,
.evidence-panel-head,
.replacement-evaluation-panel summary,
.report-context {
  border-bottom-color: rgba(146, 168, 188, 0.5);
}

.panel-head h3,
.evidence-panel-head h3,
.report-card h4,
.recommendation h4,
.analyst-review-card h4,
.workspace-grid h4 {
  color: var(--cx-primary);
}

.panel-head > span,
.report-context,
.operation-note,
.helper-text,
.narrative-guardrail-note,
.evidence-context-note {
  color: var(--cx-text-muted);
}

.narrative-grid,
.taxonomy-list,
.taxonomy-buyer-frame,
.taxonomy-buyer-answers,
.taxonomy-example-grid,
.taxonomy-surface-links,
.governed-topic-movement-grid,
.movement-meaning-grid,
.trend-workflow-grid,
.trend-chart-grid,
.role-mode-grid,
.saved-view-grid,
.story-grid,
.report-grid,
.workspace-grid,
.trust-grid,
.ops-grid,
.decision-grid,
.source-record-grid,
.import-scope-grid,
.validation-grid,
.import-status-strip {
  gap: 16px;
}

.narrative-card,
.surface-brief-cards span,
.p0-narrative-scan,
.functional-evidence-grid > div,
.taxonomy-buyer-frame > div,
.taxonomy-buyer-answers article,
.taxonomy-example-card,
.taxonomy-surface-links article,
.taxonomy-governance-strip,
.taxonomy-row,
.trend-takeaway,
.governed-topic-movement-card,
.movement-meaning-grid article,
.trend-workflow-grid article,
.trend-chart-grid article,
.trend-day,
.role-card,
.story-card,
.report-card,
.recommendation,
.analyst-review-card,
.saved-view-card,
.segment-card,
.segment-safety-strip > div,
.export-evidence-card,
.export-lockout-strip > div,
.phase-evidence-card,
.artifact-row,
.source-health-row,
.admin-section-row,
.import-scope-grid div,
.validation-grid div,
.import-status-strip div,
.import-success,
.source-record-grid > div,
.evidence-summary-strip > div,
.trust-handoff-strip > div,
.action-trace-grid > div,
.investigation-chain-panel > div,
.evidence-chain-callout,
.gate-list span,
.matrix div {
  border-color: rgba(146, 168, 188, 0.54);
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f9fb 100%);
  box-shadow: 0 10px 24px rgba(10, 27, 47, 0.07);
}

.narrative-card,
.surface-brief,
.story-card,
.report-card,
.role-card,
.analyst-review-card,
.taxonomy-example-card,
.governed-topic-movement-card,
.trend-chart-grid article,
.artifact-row,
.source-health-row,
.admin-section-row {
  position: relative;
  overflow: hidden;
}

.narrative-card::before,
.surface-brief::before,
.story-card::before,
.report-card::before,
.role-card::before,
.analyst-review-card::before,
.taxonomy-example-card::before,
.governed-topic-movement-card::before,
.trend-chart-grid article::before,
.artifact-row::before,
.source-health-row::before,
.admin-section-row::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--cx-accent), var(--cx-chart-comparison));
  content: "";
}

.narrative-grid .narrative-card:first-child::before,
.surface-brief::before,
.trend-chart-grid article:first-child::before,
.report-card:first-child::before,
.source-health-row:first-child::before,
.admin-section-row:first-child::before {
  background: linear-gradient(180deg, var(--cx-critical-fill), var(--cx-critical-amber));
}

.narrative-card strong,
.surface-brief strong,
.p0-narrative-scan strong,
.taxonomy-buyer-frame strong,
.taxonomy-buyer-answers strong,
.taxonomy-example-card strong,
.taxonomy-surface-links strong,
.governed-topic-movement-card strong,
.movement-meaning-grid strong,
.trend-workflow-grid strong,
.role-card strong,
.story-card p,
.report-card p,
.recommendation p,
.analyst-review-card p,
.artifact-row p,
.source-health-row p,
.admin-section-row p {
  color: var(--cx-text-primary);
}

.narrative-card small,
.surface-brief p,
.p0-narrative-scan span,
.functional-evidence-grid span,
.taxonomy-buyer-frame span,
.taxonomy-example-card small,
.governed-topic-movement-card span,
.movement-meaning-grid span,
.trend-workflow-grid span,
.role-card span,
.story-card span,
.report-card > div > span,
.artifact-row span,
.source-health-row span,
.admin-section-row span,
.import-scope-grid span,
.validation-grid span,
.import-status-strip span,
.source-record-grid span,
.source-record-grid small,
.evidence-summary-strip span,
.action-trace-grid span,
.matrix strong {
  color: var(--cx-text-muted);
}

.narrative-guardrail-note,
.scope-confirmation,
.taxonomy-governance-strip,
.trend-controls,
.taxonomy-form,
.export-controls,
.import-form,
.layout-edit-affordance,
.global-focus-indicator,
.action-queue-scope-disclosure {
  border-color: rgba(0, 124, 137, 0.34);
  background: linear-gradient(180deg, #ffffff 0%, #e9fbf9 100%);
  box-shadow: 0 12px 28px rgba(0, 124, 137, 0.08);
}

.trend-controls select,
.taxonomy-form input,
.import-form select,
.import-form input,
.import-form textarea,
.export-controls select,
.saved-view-controls input,
.saved-view-controls button,
.scope-row strong,
.scope-row select {
  border-color: rgba(146, 168, 188, 0.72);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.trend-controls select:focus-visible,
.taxonomy-form input:focus-visible,
.import-form select:focus-visible,
.import-form input:focus-visible,
.import-form textarea:focus-visible,
.export-controls select:focus-visible,
.saved-view-controls input:focus-visible,
.saved-view-controls button:focus-visible,
.scope-row select:focus-visible {
  border-color: var(--cx-accent);
  outline: 3px solid rgba(0, 124, 137, 0.22);
  outline-offset: 2px;
}

.taxonomy-row,
.comment,
.evidence-record,
.source-record-grid > div,
.summary-evidence-list .evidence-record {
  border-left-color: var(--cx-accent);
  border-left-width: 4px;
}

.evidence-record,
.source-record-grid > div,
.summary-evidence-list .evidence-record {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  box-shadow: 0 10px 24px rgba(10, 27, 47, 0.06);
}

.evidence-hierarchy {
  border-color: rgba(146, 168, 188, 0.58);
  background:
    linear-gradient(90deg, rgba(0, 124, 137, 0.06), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f3f8fb 100%);
  box-shadow: inset 4px 0 0 rgba(0, 124, 137, 0.18);
}

.evidence-primary-match-row {
  border-bottom: 1px solid rgba(146, 168, 188, 0.42);
  padding-bottom: 8px;
}

.evidence-secondary-context-row,
.evidence-action-linkage-row {
  padding-top: 2px;
}

.evidence-hierarchy-label,
.empty-chip-note,
.suggested-action-note,
.quote-relevance {
  color: var(--cx-text-muted);
}

.quote-relevance {
  border-left: 1px solid rgba(146, 168, 188, 0.48);
  padding-left: 8px;
}

.evidence-quote {
  color: var(--cx-text-primary);
}

.topic-tags .primary-match,
.ui-chip-topic,
.ui-chip-evidence,
.ui-chip-source,
.schema-columns code,
.topic-tags button,
.gate-list span,
.export-state-strip span,
.workspace-audit-strip strong,
.ranking-evidence-metrics span,
.segment-metrics span {
  border-color: rgba(0, 124, 137, 0.28);
  background: #e9fbf9;
  color: #164b45;
}

.ui-chip-risk,
.topic-tags .secondary-match,
.status-badge.watch,
.status-badge.planned {
  border-color: rgba(217, 119, 6, 0.3);
  background: var(--cx-warning-soft);
  color: #7a4300;
}

.status-badge.available,
.status-badge.seed,
.status-badge.applied,
.status-badge.resolved,
.import-success {
  border-color: rgba(18, 114, 70, 0.28);
  background: var(--cx-success-soft);
  color: var(--cx-success);
}

.trend-grid,
.executive-trend-grid,
.weekly-counts,
.compact-trend,
.movement-sparkline {
  border-color: rgba(146, 168, 188, 0.58);
}

.trend-day,
.weekly-counts div,
.executive-trend-day {
  background: linear-gradient(180deg, #ffffff 0%, #f0f6fb 100%);
}

.trend-bar.theme,
.movement-sparkline i {
  background: var(--cx-chart-primary);
}

.trend-bar.sentiment,
.trend-bar.action,
.trend-chart-grid .bar i,
.executive-mix-row i {
  background: var(--cx-chart-accent);
}

.trend-bar.problem,
.trend-chart-grid .bar i.problem,
.trend-chart-grid .problem,
.executive-mix-row i.problem {
  background: var(--cx-chart-danger);
}

.trend-bar.praise,
.trend-chart-grid .bar i.praise,
.executive-mix-row i.praise {
  background: var(--cx-chart-success);
}

.trend-bar.suggestion,
.trend-chart-grid .bar i.suggestion,
.executive-mix-row i.suggestion {
  background: var(--cx-chart-warning);
}

.trend-semantic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
}

.trend-legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(146, 168, 188, 0.58);
  border-radius: 999px;
  background: #ffffff;
  color: var(--cx-text-primary);
  font-size: 0.76rem;
  font-weight: 800;
}

.trend-legend-item::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.trend-semantic-rising {
  border-color: rgba(194, 109, 0, 0.42);
  color: #7a4300;
}

.trend-semantic-falling {
  border-color: rgba(18, 114, 70, 0.38);
  color: var(--cx-success);
}

.trend-semantic-stable {
  border-color: rgba(0, 124, 137, 0.34);
  color: var(--cx-accent);
}

.trend-semantic-urgency {
  border-color: rgba(197, 34, 31, 0.45);
  color: var(--cx-danger);
}

.trend-sentiment-positive {
  border-color: rgba(18, 114, 70, 0.38);
  color: var(--cx-success);
}

.trend-sentiment-negative {
  border-color: rgba(197, 34, 31, 0.45);
  color: var(--cx-danger);
}

.trend-sentiment-neutral {
  border-color: rgba(91, 75, 183, 0.34);
  color: var(--cx-chart-comparison);
}

.trend-day.trend-semantic-rising,
.governed-topic-movement-card.trend-semantic-rising {
  background: linear-gradient(180deg, #fff8e4 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-chart-warning), 0 12px 24px rgba(194, 109, 0, 0.08);
}

.trend-day.trend-semantic-falling,
.governed-topic-movement-card.trend-semantic-falling {
  background: linear-gradient(180deg, #e9f8ef 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-chart-success), 0 12px 24px rgba(18, 114, 70, 0.08);
}

.trend-day.trend-semantic-stable,
.governed-topic-movement-card.trend-semantic-stable {
  background: linear-gradient(180deg, #e9fbf9 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-accent), 0 12px 24px rgba(0, 124, 137, 0.08);
}

.trend-day.trend-sentiment-positive {
  background: linear-gradient(180deg, #e9f8ef 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-chart-success), 0 12px 24px rgba(18, 114, 70, 0.08);
}

.trend-day.trend-sentiment-negative {
  background: linear-gradient(180deg, #fff0ed 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-chart-danger), 0 12px 24px rgba(197, 34, 31, 0.08);
}

.trend-day.trend-sentiment-neutral {
  background: linear-gradient(180deg, #f1efff 0%, #ffffff 82%);
  box-shadow: inset 0 4px 0 var(--cx-chart-comparison), 0 12px 24px rgba(91, 75, 183, 0.08);
}

.trend-day.trend-semantic-urgency,
.governed-topic-movement-card.trend-semantic-urgency {
  border-color: rgba(197, 34, 31, 0.5);
}

.trend-bar.trend-semantic-rising,
.governed-topic-movement-card.trend-semantic-rising .movement-sparkline i {
  background: var(--cx-chart-warning);
}

.trend-bar.trend-semantic-falling,
.governed-topic-movement-card.trend-semantic-falling .movement-sparkline i {
  background: var(--cx-chart-success);
}

.trend-bar.trend-semantic-stable,
.governed-topic-movement-card.trend-semantic-stable .movement-sparkline i {
  background: var(--cx-accent);
}

.trend-bar.trend-semantic-urgency,
.governed-topic-movement-card.trend-semantic-urgency .movement-sparkline i:last-child {
  background: var(--cx-chart-danger);
}

.trend-bar.trend-sentiment-positive {
  background: var(--cx-chart-success);
}

.trend-bar.trend-sentiment-negative {
  background: var(--cx-chart-danger);
}

.trend-bar.trend-sentiment-neutral {
  background: var(--cx-chart-comparison);
}

.trend-drilldown:not(:disabled):hover,
.trend-drilldown:not(:disabled):focus-visible,
.saved-view-card:hover,
.saved-view-inline:hover,
.row-action:hover,
.row-action:focus-visible,
.taxonomy-row button:hover,
.taxonomy-row button:focus-visible {
  border-color: var(--cx-accent);
  background: #e9fbf9;
  box-shadow: 0 10px 22px rgba(0, 124, 137, 0.12);
}

.trust-grid .matrix div,
.ops-grid .matrix div,
.decision-grid .matrix div,
.tenant-admin .matrix div,
.admin-guardrail-strip div {
  background:
    linear-gradient(90deg, rgba(0, 124, 137, 0.08), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
}

.report-workspace-panel,
.admin-import-panel,
.evidence-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%),
    radial-gradient(circle at 92% 12%, rgba(197, 34, 31, 0.08), transparent 18rem);
}

.report-workspace-panel .panel-head,
.admin-import-panel .panel-head,
.evidence-panel-head {
  border-bottom: 1px solid rgba(146, 168, 188, 0.48);
  padding-bottom: 10px;
}

.import-status-strip div:first-child,
.validation-grid div:first-child,
.source-health-row:first-child,
.artifact-row:first-child {
  border-color: rgba(197, 34, 31, 0.4);
  background: linear-gradient(180deg, #fff8f5 0%, #ffe8e2 100%);
}

.import-status-strip div:first-child strong,
.validation-grid div:first-child strong,
.source-health-row:first-child strong,
.artifact-row:first-child strong {
  color: var(--cx-critical-fill);
}

@media (max-width: 920px) {
  .command-hero {
    grid-template-columns: 1fr;
  }

  .metric-cluster-priority .metric-cluster-head,
  .issue-card:has(.status-badge.urgent) > div:first-child,
  .queue-item.urgent .queue-item-title-row,
  .queue-item-investigation-match .queue-item-title-row {
    margin-right: -8px;
    margin-left: -8px;
  }
}
