/*
 * Orbis authenticated visual system
 * ---------------------------------
 * This file is intentionally loaded last. It keeps every authenticated module
 * on one enterprise visual language while allowing client themes and national
 * colors to provide restrained accents.
 */

:root {
  --orbis-font: Inter, "Segoe UI", Arial, sans-serif;
  --orbis-navy-950: #06182a;
  --orbis-navy-900: #08243d;
  --orbis-navy-800: #0d3657;
  --orbis-blue-700: #0069b4;
  --orbis-blue-600: #007fc4;
  --orbis-cyan-500: #00a6c8;
  --orbis-teal-600: #087f7a;
  --orbis-green-600: #167a57;
  --orbis-amber-600: #a56a00;
  --orbis-red-600: #b54747;
  --orbis-gray-950: #10283d;
  --orbis-gray-700: #526a7c;
  --orbis-gray-500: #7d8f9d;
  --orbis-gray-300: #cbd8e1;
  --orbis-gray-200: #dce5eb;
  --orbis-gray-100: #edf3f6;
  --orbis-gray-50: #f7fafc;
  --orbis-white: #ffffff;
}

body {
  font-family: var(--orbis-font);
}

body[data-client-theme="enterprise"],
body[data-client-theme="light"] {
  --theme-primary: #0069b4;
  --theme-primary-strong: #00518c;
  --theme-accent: #00a6c8;
  --theme-tint: #e7f5f9;
  --theme-page: #eef3f6;
}

body[data-client-theme="orbis"] {
  --theme-primary: #0b527f;
  --theme-primary-strong: #073b5d;
  --theme-accent: #00a6c8;
  --theme-tint: #e4f1f6;
  --theme-page: #eaf0f4;
}

body[data-client-theme="satellite"] {
  --theme-primary: #176fb0;
  --theme-primary-strong: #0d558c;
  --theme-accent: #00a9c7;
  --theme-tint: #e6f3fa;
  --theme-page: #edf4f8;
}

body[data-client-theme="mineral"] {
  --theme-primary: #80601d;
  --theme-primary-strong: #65480d;
  --theme-accent: #c28a20;
  --theme-tint: #faf3e2;
  --theme-page: #f3f2ee;
}

body[data-client-theme="executive"] {
  --theme-primary: #3b566c;
  --theme-primary-strong: #263f53;
  --theme-accent: #6a879a;
  --theme-tint: #edf2f5;
  --theme-page: #edf1f4;
}

body[data-client-theme="emerging"] {
  --theme-primary: #08796c;
  --theme-primary-strong: #075e55;
  --theme-accent: #1b9b83;
  --theme-tint: #e7f5f1;
  --theme-page: #edf4f2;
}

/* Themes change accents, never information architecture or readability. */
.app-shell:not(.is-hidden) {
  --oe-page: var(--theme-page, #eef3f6);
  --oe-surface: var(--orbis-white);
  --oe-soft: var(--orbis-gray-50);
  --oe-tint: var(--theme-tint, #e7f5f9);
  --oe-ink: var(--orbis-gray-950);
  --oe-copy: var(--orbis-gray-700);
  --oe-line: var(--orbis-gray-200);
  --oe-line-strong: var(--orbis-gray-300);
  --oe-cyan: var(--theme-accent, #00a6c8);
  --oe-cyan-dark: var(--theme-primary, #0069b4);
  min-height: 100vh !important;
  background: var(--oe-page) !important;
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 180px),
    var(--oe-page) !important;
  color: var(--oe-ink) !important;
}

/* Primary navigation */
.app-shell:not(.is-hidden) .product-header.sidebar {
  border-bottom: 1px solid var(--oe-line) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 4px 18px rgba(8, 36, 61, 0.08) !important;
}

.app-shell:not(.is-hidden) .product-header .brand,
.app-shell:not(.is-hidden) .product-header .brand strong {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .product-header .brand span,
.app-shell:not(.is-hidden) .product-header .user-card span {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .product-header .nav-item,
.app-shell:not(.is-hidden) .product-header .nav-menu > summary {
  color: #29445a !important;
}

.app-shell:not(.is-hidden) .product-header .nav-item:is(:hover, :focus-visible, .active),
.app-shell:not(.is-hidden) .product-header .nav-menu > summary:is(:hover, :focus-visible),
.app-shell:not(.is-hidden) .product-header .nav-menu[open] > summary {
  background: var(--oe-tint) !important;
  color: var(--theme-primary-strong, #00518c) !important;
}

.app-shell:not(.is-hidden) .product-header > .nav-list > .nav-item.active::after,
.app-shell:not(.is-hidden) .product-header > .nav-list > .nav-item:hover::after,
.app-shell:not(.is-hidden) .product-header > .nav-list > .nav-menu[open] > summary::after {
  background: var(--theme-accent, #00a6c8) !important;
}

.app-shell:not(.is-hidden) .product-header .nav-menu-panel {
  border-color: var(--oe-line) !important;
  border-top-color: var(--theme-accent, #00a6c8) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
}

/* Page title and operating context */
.app-shell:not(.is-hidden) .topbar {
  border: 1px solid var(--oe-line) !important;
  border-top: 3px solid var(--theme-primary, #0069b4) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 3px 12px rgba(8, 36, 61, 0.045) !important;
}

.app-shell:not(.is-hidden) .topbar :is(h1, h2, h3, strong),
.app-shell:not(.is-hidden) .topbar-actions label {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) :is(.eyebrow, .section-kicker) {
  color: var(--theme-primary, #0069b4) !important;
}

.app-shell:not(.is-hidden) .operator-ribbon {
  gap: 12px !important;
}

.app-shell:not(.is-hidden) .operator-ribbon-card {
  border: 1px solid var(--oe-line) !important;
  border-top: 3px solid color-mix(in srgb, var(--theme-accent, #00a6c8) 68%, white) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 2px 8px rgba(8, 36, 61, 0.035) !important;
}

.app-shell:not(.is-hidden) .operator-ribbon-card :is(strong, b) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .operator-ribbon-card :is(span, small, p) {
  color: var(--oe-copy) !important;
}

/* Country identity is a compact national accent, not a page-wide color wash. */
.app-shell:not(.is-hidden) .country-context-bar,
.app-shell:not(.is-hidden) .country-module-identity {
  border: 1px solid var(--oe-line) !important;
  border-left: 4px solid var(--country-accent, var(--theme-accent, #00a6c8)) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 2px 8px rgba(8, 36, 61, 0.035) !important;
}

.app-shell:not(.is-hidden) .country-context-bar::before,
.app-shell:not(.is-hidden) .country-module-identity::before {
  display: none !important;
}

.app-shell:not(.is-hidden) .country-context-bar .country-identity-strip,
.app-shell:not(.is-hidden) .country-module-identity .country-identity-strip {
  overflow: hidden !important;
  border: 1px solid var(--oe-line) !important;
  background: var(--orbis-white) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) .country-flag-mark {
  background: var(--orbis-gray-50) !important;
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .country-color-band {
  height: 8px !important;
  background: var(--country-gradient) !important;
}

.app-shell:not(.is-hidden) .country-module-copy :is(h2, h3, h4, strong),
.app-shell:not(.is-hidden) .country-context-bar :is(h2, h3, h4, strong) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .country-module-copy :is(p, small),
.app-shell:not(.is-hidden) .country-context-bar :is(p, small) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .country-context-action {
  color: var(--theme-primary, #0069b4) !important;
}

/* Standard module surfaces */
.app-shell:not(.is-hidden) :is(
  .view-section,
  .panel,
  .detail-panel,
  .activity-panel,
  .selected-asset,
  .opportunity-finder,
  .discovery-workspace,
  .production-intelligence,
  .sovereign-production-layer,
  .pipeline-status-panel,
  .eo-pipeline-panel,
  .accuracy-proof-panel,
  .orbis-strength-panel,
  .agriculture-monitoring-panel,
  .strategy-panel,
  .commercial-viability-panel,
  .evidence-explainability,
  .country-resource-matrix,
  .country-flow-panel,
  .prospectivity-where-panel,
  .modeling-estimate-panel,
  .technical-analysis-panel,
  .drilling-intelligence-panel,
  .public-evidence-verification,
  .discovery-table-panel,
  .feedback-panel
) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 3px 12px rgba(8, 36, 61, 0.045) !important;
}

.app-shell:not(.is-hidden) :is(
  .view-section,
  .panel,
  .detail-panel,
  .activity-panel,
  .selected-asset,
  .opportunity-finder,
  .discovery-workspace,
  .production-intelligence,
  .sovereign-production-layer,
  .pipeline-status-panel,
  .eo-pipeline-panel,
  .accuracy-proof-panel,
  .orbis-strength-panel,
  .agriculture-monitoring-panel,
  .strategy-panel,
  .commercial-viability-panel,
  .evidence-explainability,
  .country-resource-matrix,
  .country-flow-panel,
  .prospectivity-where-panel,
  .modeling-estimate-panel,
  .technical-analysis-panel,
  .drilling-intelligence-panel,
  .public-evidence-verification,
  .discovery-table-panel,
  .feedback-panel
) :is(h1, h2, h3, h4, h5, h6, strong, b) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) :is(
  .view-section,
  .panel,
  .detail-panel,
  .activity-panel,
  .selected-asset,
  .opportunity-finder,
  .discovery-workspace,
  .production-intelligence,
  .sovereign-production-layer,
  .pipeline-status-panel,
  .eo-pipeline-panel,
  .accuracy-proof-panel,
  .orbis-strength-panel,
  .agriculture-monitoring-panel,
  .strategy-panel,
  .commercial-viability-panel,
  .evidence-explainability,
  .country-resource-matrix,
  .country-flow-panel,
  .prospectivity-where-panel,
  .modeling-estimate-panel,
  .technical-analysis-panel,
  .drilling-intelligence-panel,
  .public-evidence-verification,
  .discovery-table-panel,
  .feedback-panel
) :is(p, small, em, label) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .panel-header,
.app-shell:not(.is-hidden) .view-section > .panel-header:first-child,
.app-shell:not(.is-hidden) .discovery-page-header {
  min-height: auto !important;
  padding: 16px 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--oe-line) !important;
  border-radius: 0 !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) .panel-header :is(h2, h3, h4, strong),
.app-shell:not(.is-hidden) .discovery-page-header :is(h2, h3, h4, strong) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .panel-header :is(p, small),
.app-shell:not(.is-hidden) .discovery-page-header :is(p, small) {
  color: var(--oe-copy) !important;
}

/* Repeated cards */
.app-shell:not(.is-hidden) :is(
  .workflow-card,
  .metric-card,
  .assessment-card,
  .executive-kpi-card,
  .orbis-strength-card,
  .agriculture-signal-card,
  .sovereign-production-card,
  .commercial-viability-card,
  .evidence-explanation-card,
  .valuation-explanation,
  .risk-explanation,
  .esg-obligation-card,
  .deal-room-card,
  .report-card,
  .modeling-estimate-card,
  .modeling-basis-card,
  .technical-analysis-card,
  .drilling-intelligence-card,
  .prospectivity-where-card,
  .eo-product-card,
  .verification-card,
  .country-opportunity-card
) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-gray-50) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(
  .workflow-card,
  .metric-card,
  .assessment-card,
  .executive-kpi-card,
  .orbis-strength-card,
  .agriculture-signal-card,
  .sovereign-production-card,
  .commercial-viability-card,
  .evidence-explanation-card,
  .valuation-explanation,
  .risk-explanation,
  .esg-obligation-card,
  .deal-room-card,
  .report-card,
  .modeling-estimate-card,
  .modeling-basis-card,
  .technical-analysis-card,
  .drilling-intelligence-card,
  .prospectivity-where-card,
  .eo-product-card,
  .verification-card,
  .country-opportunity-card
) :is(h2, h3, h4, strong, b) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) :is(
  .workflow-card,
  .metric-card,
  .assessment-card,
  .executive-kpi-card,
  .orbis-strength-card,
  .agriculture-signal-card,
  .sovereign-production-card,
  .commercial-viability-card,
  .evidence-explanation-card,
  .valuation-explanation,
  .risk-explanation,
  .esg-obligation-card,
  .deal-room-card,
  .report-card,
  .modeling-estimate-card,
  .modeling-basis-card,
  .technical-analysis-card,
  .drilling-intelligence-card,
  .prospectivity-where-card,
  .eo-product-card,
  .verification-card,
  .country-opportunity-card
) :is(p, small, em, span) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) :is(
  .workflow-card,
  .metric-card,
  .assessment-card,
  .executive-kpi-card,
  .prospectivity-where-card,
  .modeling-estimate-card,
  .technical-analysis-card,
  .drilling-intelligence-card
):is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--theme-primary, #0069b4) 52%, var(--oe-line)) !important;
  background: var(--oe-tint) !important;
  box-shadow: 0 5px 16px rgba(8, 36, 61, 0.08) !important;
  transform: translateY(-1px);
}

/* Decision path */
.app-shell:not(.is-hidden) .user-decision-path {
  gap: 8px !important;
  padding: 10px !important;
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) .user-decision-step {
  border: 1px solid var(--oe-line) !important;
  border-radius: 4px !important;
  background: var(--orbis-gray-50) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) .user-decision-step :is(span, small) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .user-decision-step :is(strong, b) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .user-decision-step:is(:hover, :focus-visible, .active) {
  border-color: var(--theme-accent, #00a6c8) !important;
  background: var(--oe-tint) !important;
  box-shadow: inset 0 -3px 0 var(--theme-accent, #00a6c8) !important;
}

/* Resource sleeves and filters */
.app-shell:not(.is-hidden) :is(
  .filter-band,
  .resource-sleeve-panel,
  .resource-sleeve-bar,
  .country-resource-sleeves,
  .resource-focus-panel
) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(.resource-sleeve, .resource-filter-chip, .filter-chip) {
  border: 1px solid var(--oe-line-strong) !important;
  border-radius: 999px !important;
  background: var(--orbis-white) !important;
  color: #28465c !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(.resource-sleeve, .resource-filter-chip, .filter-chip):is(:hover, :focus-visible, .active, [aria-pressed="true"]) {
  border-color: var(--theme-primary, #0069b4) !important;
  background: var(--oe-tint) !important;
  color: var(--theme-primary-strong, #00518c) !important;
}

/* Inputs and actions */
.app-shell:not(.is-hidden) :is(input, select, textarea) {
  border: 1px solid var(--oe-line-strong) !important;
  border-radius: 4px !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(input, select, textarea):focus {
  border-color: var(--theme-primary, #0069b4) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #00a6c8) 18%, transparent) !important;
  outline: none !important;
}

.app-shell:not(.is-hidden) button {
  font-family: var(--orbis-font);
}

.app-shell:not(.is-hidden) :is(.primary-action, .primary-table-action, .guided-run-button, .button-primary) {
  border: 1px solid var(--theme-primary-strong, #00518c) !important;
  border-radius: 4px !important;
  background: var(--theme-primary, #0069b4) !important;
  color: var(--orbis-white) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(.primary-action, .primary-table-action, .guided-run-button, .button-primary):is(:hover, :focus-visible) {
  background: var(--theme-primary-strong, #00518c) !important;
  color: var(--orbis-white) !important;
}

.app-shell:not(.is-hidden) :is(.secondary-action, .table-action, .icon-button, .sign-out-button) {
  border: 1px solid var(--oe-line-strong) !important;
  border-radius: 4px !important;
  background: var(--orbis-white) !important;
  color: #28465c !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) :is(.secondary-action, .table-action, .icon-button, .sign-out-button):is(:hover, :focus-visible) {
  border-color: var(--theme-primary, #0069b4) !important;
  background: var(--oe-tint) !important;
  color: var(--theme-primary-strong, #00518c) !important;
}

/* Tables */
.app-shell:not(.is-hidden) :is(.data-table-wrap, .discovery-table-wrap) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
}

.app-shell:not(.is-hidden) .data-table {
  border-collapse: collapse !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .data-table th {
  border-color: var(--oe-line) !important;
  background: #eef4f7 !important;
  color: #3f5b70 !important;
}

.app-shell:not(.is-hidden) .data-table td {
  border-color: var(--oe-line) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .data-table td :is(small, em, span) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .data-table tbody tr:is(:hover, :focus-within) td {
  background: var(--oe-tint) !important;
}

/* Status language is semantic and consistent across modules. */
.app-shell:not(.is-hidden) .status-pill {
  border: 1px solid #b7d9d1 !important;
  background: #e8f6f1 !important;
  color: #126449 !important;
}

.app-shell:not(.is-hidden) :is(.status-pill.warning, .warning-pill, .status-warning) {
  border-color: #e7cf9a !important;
  background: #fff6df !important;
  color: #805400 !important;
}

.app-shell:not(.is-hidden) :is(.status-pill.error, .error-pill, .status-error, .status-blocked) {
  border-color: #e4b6b6 !important;
  background: #fceeee !important;
  color: #993c3c !important;
}

.app-shell:not(.is-hidden) :is(.status-pill.info, .info-pill, .status-info) {
  border-color: #b5d6e8 !important;
  background: #eaf5fb !important;
  color: #155e86 !important;
}

/* Maps keep cartographic contrast while controls match the application. */
.app-shell:not(.is-hidden) :is(.map-panel, .world-map-shell, .asset-map-shell) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
  box-shadow: 0 3px 12px rgba(8, 36, 61, 0.045) !important;
}

.app-shell:not(.is-hidden) :is(.map-controls, .basemap-control, .layer-control, .leaflet-control-layers) {
  border: 1px solid var(--oe-line) !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 5px 16px rgba(8, 36, 61, 0.12) !important;
}

.app-shell:not(.is-hidden) :is(.map-controls, .basemap-control, .layer-control, .leaflet-control-layers) :is(label, span, strong, button) {
  color: var(--oe-ink) !important;
}

/* Preserve cartographic labels and graphics from generic light-surface rules. */
.app-shell:not(.is-hidden) :is(.leaflet-container, .world-map, .map-canvas, .map-stage) {
  color: initial;
}

/*
 * Legacy module compatibility
 * ---------------------------
 * Orbis has several generations of module markup. These structural selectors
 * keep older and newly generated country views on the same visual contract
 * without allowing national colors or legacy dark panels to repaint the UI.
 */
.app-shell:not(.is-hidden) .workspace :is(
  .scope-entry-panel,
  .scope-landing-page,
  .command-surface,
  .metrics-grid,
  .metric,
  .main-grid,
  .gateway-country-panel,
  .country-summary-panel,
  .asset-facts,
  .orbis-engine,
  .orbis-engine-result
) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  [class$="-panel"],
  [class*="-panel "],
  [class$="-section"],
  [class*="-section "]
):not(
  .map-panel,
  .world-map-shell,
  .asset-map-shell,
  .continent-panel,
  .map-layer-control,
  .map-controls,
  .basemap-control,
  .layer-control,
  .leaflet-control-layers
) {
  border-color: var(--oe-line) !important;
  background: var(--orbis-white) !important;
  color: var(--oe-ink) !important;
  box-shadow: 0 3px 12px rgba(8, 36, 61, 0.045) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  [class$="-card"],
  [class*="-card "],
  .metric,
  .clickable-card
):not(
  .country-landing-card,
  .map-card,
  .leaflet-popup-content
) {
  border-color: var(--oe-line) !important;
  background: var(--orbis-gray-50) !important;
  color: var(--oe-ink) !important;
  box-shadow: none !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  [class$="-panel"],
  [class*="-panel "],
  [class$="-section"],
  [class*="-section "],
  [class$="-card"],
  [class*="-card "],
  .metric,
  .clickable-card
):not(
  .map-panel,
  .world-map-shell,
  .asset-map-shell,
  .continent-panel,
  .map-layer-control,
  .map-controls,
  .basemap-control,
  .layer-control,
  .leaflet-control-layers,
  .map-card,
  .leaflet-popup-content
) :is(h1, h2, h3, h4, h5, h6, strong, b, dt, dd) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  [class$="-panel"],
  [class*="-panel "],
  [class$="-section"],
  [class*="-section "],
  [class$="-card"],
  [class*="-card "],
  .metric,
  .clickable-card
):not(
  .map-panel,
  .world-map-shell,
  .asset-map-shell,
  .continent-panel,
  .map-layer-control,
  .map-controls,
  .basemap-control,
  .layer-control,
  .leaflet-control-layers,
  .map-card,
  .leaflet-popup-content
) :is(p, small, em, label, figcaption) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  .metrics-grid,
  .operator-ribbon,
  .workflow-grid,
  .executive-kpi-grid
) {
  gap: 12px !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  .metric,
  .metric-card,
  .operator-ribbon-card,
  .executive-kpi-card
) {
  min-height: 112px !important;
  padding: 16px !important;
  border: 1px solid var(--oe-line) !important;
  border-top: 3px solid var(--theme-primary, #0069b4) !important;
  border-radius: 5px !important;
  background: var(--orbis-white) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  .metric,
  .metric-card,
  .operator-ribbon-card,
  .executive-kpi-card
) :is(.value, strong, b, dd) {
  color: var(--oe-ink) !important;
}

.app-shell:not(.is-hidden) .workspace :is(
  .metric,
  .metric-card,
  .operator-ribbon-card,
  .executive-kpi-card
) :is(p, small, span, dt) {
  color: var(--oe-copy) !important;
}

.app-shell:not(.is-hidden) .workspace .clickable-card {
  cursor: pointer !important;
}

.app-shell:not(.is-hidden) .workspace .clickable-card:is(:hover, :focus-visible) {
  border-color: var(--theme-primary, #0069b4) !important;
  background: var(--oe-tint) !important;
  box-shadow: 0 5px 16px rgba(8, 36, 61, 0.08) !important;
}

.app-shell:not(.is-hidden) :focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-accent, #00a6c8) 62%, white) !important;
  outline-offset: 2px !important;
}

.app-shell:not(.is-hidden) ::selection {
  background: #ccecf5;
  color: var(--orbis-navy-950);
}

.app-shell:not(.is-hidden) {
  color-scheme: light;
  scrollbar-color: #9eb4c3 var(--orbis-gray-100);
}

.app-shell:not(.is-hidden) ::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.app-shell:not(.is-hidden) ::-webkit-scrollbar-track {
  background: var(--orbis-gray-100);
}

.app-shell:not(.is-hidden) ::-webkit-scrollbar-thumb {
  border: 3px solid var(--orbis-gray-100);
  border-radius: 999px;
  background: #9eb4c3;
}

/* Desktop density */
@media (min-width: 1200px) {
  .app-shell:not(.is-hidden) .workspace {
    padding: 20px 26px 42px !important;
  }
}

/* Tablet and mobile: same visual language, fewer columns and no clipped content. */
@media (max-width: 1050px) {
  .app-shell:not(.is-hidden) .operator-ribbon,
  .app-shell:not(.is-hidden) .workflow-grid,
  .app-shell:not(.is-hidden) .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .app-shell:not(.is-hidden) .user-decision-path {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .app-shell:not(.is-hidden) .workspace {
    padding: 12px !important;
  }

  .app-shell:not(.is-hidden) :is(
    .operator-ribbon,
    .workflow-grid,
    .metric-grid,
    .user-decision-path
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-shell:not(.is-hidden) .country-context-bar,
  .app-shell:not(.is-hidden) .country-module-identity {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .app-shell:not(.is-hidden) .country-context-action {
    display: none !important;
  }

  .app-shell:not(.is-hidden) .panel-header,
  .app-shell:not(.is-hidden) .view-section > .panel-header:first-child,
  .app-shell:not(.is-hidden) .discovery-page-header {
    padding: 14px !important;
  }
}
