/* Operational Clarity: tachograph and AI insight pages, desktop only. */
@media (min-width: 901px) {
  body.fh-console-nav.fh-clarity #tachographsPage,
  body.fh-console-nav.fh-clarity #aiAnalysisPage {
    --insight-surface: #fff;
    --insight-canvas: #f5f8fa;
    --insight-inset: #f7f9fb;
    --insight-ink: #17212f;
    --insight-muted: #536572;
    --insight-line: #d8e2e9;
    --insight-primary: #087f9c;
    box-sizing: border-box;
    min-height: 100%;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    color: var(--insight-ink) !important;
    background: var(--insight-canvas) !important;
    font-size: 13px;
  }

  body.fh-console-nav.fh-clarity #tachographsPage *,
  body.fh-console-nav.fh-clarity #aiAnalysisPage * { box-sizing: border-box; }

  body.fh-console-nav.fh-clarity #tachographsPage :is(.tachographs-console-head,.tachographs-refresh-area),
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-control-strip,.ai-upper-grid,.ai-lower-grid) {
    min-width: 0;
  }

  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-console-head {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--insight-line);
    border-radius: 8px; background: var(--insight-surface);
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-console-head h1,
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-copy h1 { margin: 0; color: var(--insight-ink); font-size: 21px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-console-head p,
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-copy > p { margin: 5px 0 0; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-refresh-area { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 5px; border: 1px solid var(--insight-line); border-radius: 7px; background: var(--insight-surface); }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tabs button { min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: 5px; color: var(--insight-muted); background: transparent; }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tabs button.active { border-color: #b9dce4; color: #075f78; background: #edf7f9; }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tab-stage,
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tab-panel,
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tab-panel.active { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-tab-panel:not(.active) { display: none !important; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-card,.tacho-data-panel,.tacho-metric-card) { min-width: 0; border: 1px solid var(--insight-line) !important; border-radius: 8px !important; color: var(--insight-ink); background: var(--insight-surface) !important; box-shadow: 0 1px 2px #17212f0a !important; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-overview-top,.tacho-overview-bottom) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-overview-top { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-card,.tacho-data-panel) { padding: 16px; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-card h2,.tacho-data-panel h2) { color: var(--insight-ink) !important; font-size: 15px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-card-content { color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-card-action { min-height: 34px; margin-top: 12px; padding: 7px 10px; border: 1px solid var(--insight-line); border-radius: 5px; color: #075f78; background: #fff; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-metric-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-data-panel > header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-data-panel header p,
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-launcher p { color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-launcher { margin: 12px 0; padding: 14px !important; border: 1px solid var(--insight-line); border-radius: 7px; background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-launcher h3 { margin: 0 0 6px; color: var(--insight-ink); font-size: 14px; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-table-wrap,.tacho-table-wrap table) { width: 100%; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--insight-line); border-radius: 6px; background: #fff; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-table-wrap :is(th,td) { padding: 10px 12px; border-bottom: 1px solid var(--insight-line); color: var(--insight-ink); text-align: left; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-table-wrap th { color: var(--insight-muted); background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #tachographsPage .tachographs-console-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--insight-muted); }

  /* Legacy tachograph controls and chart labels use explicit dark-theme colors. */
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tachographs-refresh-area button,.tacho-data-panel header button,.tacho-table-wrap button,.tacho-archive-controls button,.tacho-card-action) {
    min-height: 36px !important;
    height: auto !important;
    padding: 8px 12px !important;
    border: 1px solid #aebfc9 !important;
    border-radius: 5px !important;
    color: #075f78;
    background: var(--insight-surface) !important;
    box-shadow: none !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    white-space: normal;
  }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tachographs-refresh-area button,.tacho-data-panel header button,.tacho-table-wrap button,.tacho-archive-controls button,.tacho-card-action):hover:not(:disabled) {
    border-color: var(--insight-primary) !important;
    color: #075f78;
    background: #edf7f9 !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-controls label {
    color: var(--insight-muted);
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-archive-controls select {
    border: 1px solid #b9c7d2 !important;
    border-radius: 5px !important;
    color: var(--insight-ink);
    background: var(--insight-surface) !important;
    font-size: 13px !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tachographs-refresh-area > span,.tacho-card h2 span,.tacho-metric-card > div > span,.tacho-metric-card small,.tacho-donut-center,.tacho-gauge-label,.tacho-legend-row em,.tacho-readout-meta,.tacho-company-card small,.tacho-list-row > div > span,.tacho-missing) {
    color: var(--insight-muted);
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tachographs-refresh-area b,.tacho-metric-card b,.tacho-donut-center b,.tacho-gauge-label b,.tacho-legend-row strong,.tacho-readout-meta b,.tacho-company-card b,.tacho-list-row b) {
    color: var(--insight-ink);
  }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-metric-card > div > span,.tacho-metric-card small,.tacho-list-row > div,.tacho-legend-row strong,.tacho-readout-meta b) {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-metric-card.is-unknown b,
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-metric-card b.is-missing {
    color: var(--insight-muted);
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-metric-card.is-unknown .tacho-metric-icon {
    color: var(--insight-muted);
    background: #edf1f4;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-donut {
    background: conic-gradient(
      #627ce0 0 calc(var(--tacho-primary) * 1%),
      #b9123f calc(var(--tacho-primary) * 1%) calc((var(--tacho-primary) + var(--tacho-secondary)) * 1%),
      var(--insight-line) calc((var(--tacho-primary) + var(--tacho-secondary)) * 1%) 100%
    );
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-donut::after,
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-gauge::after {
    background: var(--insight-surface);
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-gauge::before {
    background: conic-gradient(from 270deg, #287546 0 calc(var(--tacho-compliance, 0) * 0.5%), var(--insight-line) 0 50%, transparent 50% 100%);
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-gauge-missing::before {
    background: conic-gradient(from 270deg, var(--insight-line) 0 50%, transparent 50% 100%) !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-gauge-missing .tacho-gauge-label b {
    color: var(--insight-muted);
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-legend-row {
    color: var(--insight-ink);
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-legend-row .marker.green { background: #287546; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-readout-meta,.tacho-list-row) { border-color: var(--insight-line); }
  body.fh-console-nav.fh-clarity #tachographsPage :is(.tacho-company-card b,.tacho-list-row b) { font-size: 13px !important; line-height: 1.5 !important; }
  /* Company-card status is unclassified source text, so a record alone is not green. */
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-company-card > div > span { color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-company-card-icon { color: var(--insight-muted); border-color: var(--insight-line); background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-status-tag:not(.issue):not(.good) { color: var(--insight-muted); background: #edf1f4; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-status-tag.issue { color: #a32432; background: #fff0f1; }
  body.fh-console-nav.fh-clarity #tachographsPage .tacho-status-tag.good { color: #287546; background: #edf7ef; }
  body.fh-console-nav.fh-clarity #tachographsPage #tachographStatus { color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #tachographsPage #tachographSourceStatus {
    color: var(--insight-ink);
    background: var(--insight-surface);
    border-color: var(--insight-line);
  }
  body.fh-console-nav.fh-clarity #tachographsPage #tachographSourceStatus[data-state="partial"] { border-left-color: #8a5200; }
  body.fh-console-nav.fh-clarity #tachographsPage #tachographSourceStatus[data-state="error"],
  body.fh-console-nav.fh-clarity #tachographsPage #tachographSourceStatus[data-state="forbidden"] { color: #a32432; border-left-color: #a32432; }

  body.fh-console-nav.fh-clarity #aiAnalysisPage.active { display: flex; flex-direction: column; gap: 14px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-select-shell { border: 1px solid #b9c7d2 !important; background: #fff !important; color: #536572 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-select-shell select { border: 0 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(button,select,input) { font-size: 13px !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-run-button { color: #fff !important; background: #087f9c !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-status :is(b,.fh-icon) { color: #344653 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="ready"] #aiTelemetryStatus { color: #087f9c !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="warning"] #aiTelemetryStatus { color: #8a5200 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="error"] #aiTelemetryStatus { color: #a32432 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-map-toggles { background: #f7f9fb !important; border-color: #d8e2e9 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-map-toggles label { color: #344653 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage input[type="checkbox"] { accent-color: #087f9c; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-console-surface,.ai-upper-grid,.ai-lower-grid) { height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-console-surface,.ai-control-status) { border: 1px solid var(--insight-line) !important; border-radius: 8px !important; color: var(--insight-ink) !important; background: var(--insight-surface) !important; box-shadow: 0 1px 2px #17212f0a !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-strip { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(290px,1fr); gap: 18px; padding: 18px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-field { min-width: 150px; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-select-shell select,
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-events-tools select,.ai-layer-shell select) { min-height: 38px; border: 1px solid #b9c7d2; border-radius: 5px; color: var(--insight-ink); background: #fff; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-run-button,.ai-section-head button,.ai-map-toolbar button,.ai-events-tools button,.ai-llm-head-actions-v160 button) { min-height: 34px; border: 1px solid #aebfc9; border-radius: 5px; color: #075f78; background: #fff; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-run-button { min-height: 38px; padding: 0 14px; border-color: #066a82; color: #fff; background: var(--insight-primary); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-foundation-actions-v149 { display: flex; flex-wrap: wrap; gap: 6px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-foundation-actions-v149 button { min-height: 32px; padding: 6px 9px; border: 1px solid var(--insight-line); border-radius: 5px; color: #075f78; background: #fff; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiStatus { flex-basis: 100%; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-statuses { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; align-content: start; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-status { min-width: 0; padding: 12px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-status :is(small,.ai-telemetry-detail) { display: block; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-control-status b { display: block; margin-top: 5px; color: var(--insight-ink); overflow-wrap: anywhere; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="ready"] #aiTelemetryStatus { color: #087f9c; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="warning"] #aiTelemetryStatus,
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiTelemetryIndicator[data-state="error"] #aiTelemetryStatus { color: #8a5200; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-upper-grid,.ai-lower-grid) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 14px; align-items: start; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-lower-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-section-head,
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-map-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--insight-line); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-section-head h2,
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-map-toolbar h2 { margin: 0; color: var(--insight-ink); font-size: 15px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-section-head p,.ai-map-toolbar p) { margin: 4px 0 0; color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiAnalysisResult,
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiLlmResultV160,
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiEventsTable,
  body.fh-console-nav.fh-clarity #aiAnalysisPage #aiRecommendationsPanel { min-width: 0; padding: 15px 16px; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-result-body,.ai-score-zone,.ai-finding-grid,.ai-llm-columns-v160,.ai-recommendation-layout) { height: auto !important; min-height: 0 !important; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-summary-card,.ai-finding-card,.ai-llm-item-v160,.ai-llm-action-v160,.ai-llm-loading-v160,.ai-llm-error-v160,.ai-score-card) { border: 1px solid var(--insight-line); border-radius: 6px; color: var(--insight-ink); background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-summary-card p,.ai-finding-card span,.ai-llm-item-v160 p,.ai-llm-action-v160 p,.ai-llm-loading-v160 span,.ai-llm-error-v160 span,.ai-llm-unknowns-v160 span) { color: var(--insight-muted); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(.ai-llm-evidence-v160 button,.ai-pagination button) { min-height: 30px; border: 1px solid var(--insight-line); border-radius: 4px; color: #075f78; background: #fff; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-events-table-wrap { overflow: auto; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-events-table { width: 100%; min-width: 600px; border-collapse: collapse; color: var(--insight-ink); background: #fff; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-events-table :is(th,td) { padding: 9px 10px; border-bottom: 1px solid var(--insight-line); text-align: left; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-events-table th { color: var(--insight-muted); background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-severity-tag.critical { color: #a32432; background: #fff0f1; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .ai-severity-tag.warning { color: #795000; background: #fff8e7; }
  body.fh-console-nav.fh-clarity #aiAnalysisPage .empty-state { min-height: 100px; padding: 22px; color: var(--insight-muted); background: var(--insight-inset); }
  body.fh-console-nav.fh-clarity #aiAnalysisPage [hidden] { display: none !important; }
  body.fh-console-nav.fh-clarity #aiLayerMenuV164 { background: #fff !important; border-color: #d8e2e9 !important; color: #17212f !important; }
  body.fh-console-nav.fh-clarity #aiLayerMenuV164 button { color: #17212f !important; background: #fff !important; font-size: 13px !important; }
  body.fh-console-nav.fh-clarity #aiLayerMenuV164 :is(small,span) { color: #536572; }
  body.fh-console-nav.fh-clarity #aiLayerMenuV164 button.active { background: #edf7f9 !important; }
  body.fh-console-nav.fh-clarity:has(#aiAnalysisPage.active) #floatingModalOverlay { align-items: center !important; padding: 24px !important; }
  body.fh-console-nav.fh-clarity:has(#aiAnalysisPage.active) #floatingModalPanel :is(.comm-empty,p,label,td,th,button,input,select) { font-size: 13px !important; line-height: 1.5; }
  body.fh-console-nav.fh-clarity:has(#aiAnalysisPage.active) #floatingModalPanel :is(.ai-evidence-policy-v149,.ai-evidence-selected-finding-v149) { background: #f7f9fb; border-color: #d8e2e9; color: #17212f; }
  body.fh-console-nav.fh-clarity:has(#aiAnalysisPage.active) #floatingModalPanel :is(.ai-evidence-policy-v149,.ai-evidence-selected-finding-v149) :is(b,span,small) { color: #344653; font-size: 12px; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(button,input,select,summary):focus-visible,
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(button,input,select,summary):focus-visible { outline: 2px solid var(--insight-primary) !important; outline-offset: 2px; }
  body.fh-console-nav.fh-clarity #tachographsPage :is(button,input,select):disabled,
  body.fh-console-nav.fh-clarity #aiAnalysisPage :is(button,input,select):disabled { cursor: not-allowed; opacity: .62; }
}
