/* NASA visual theme for the existing Bridge RNA workspace.
   Source: HDS Core 0.10.0 tokens; NASA/Glenn rendered type and surfaces.
   Sizes and spacing retain the original research-workspace geometry.
   Brand, interaction, and scientific colors have separate roles. */
:root {
  --bg-canvas: var(--hds-color-carbon-05);
  --bg-panel: var(--hds-color-spacesuit-white);
  --bg-panel-raised: var(--hds-color-carbon-05);
  --bg-sidebar: var(--hds-color-spacesuit-white);
  --bg-inset: var(--hds-color-carbon-05);
  --plot-bg: #0e1d34; /* Validated map surface; scientific palette unchanged. */
  --border-subtle: var(--hds-color-carbon-10);
  --border-strong: var(--hds-color-carbon-30);
  --border: 1px solid var(--hds-color-carbon-20);
  --text-primary: var(--hds-color-carbon-90);
  --text-secondary: var(--hds-color-carbon-60);
  --text-muted: var(--hds-color-carbon-60);
  --accent: var(--hds-color-nasa-blue);
  --accent-text: var(--hds-color-nasa-blue-shade);
  --accent-hover: var(--hds-color-nasa-blue-shade);
  --accent-dim: var(--hds-color-carbon-30);
  --accent-soft: #f0f0f0;
  /* Interface roles: choice is charcoal, focus and links are blue, CTA is red.
     These compact control treatments are Bridge RNA adaptations of HDS. */
  --control-ink: var(--hds-color-carbon-90);
  --control-border: #858589;
  --control-hover: var(--hds-color-carbon-90);
  --control-fill: var(--hds-color-spacesuit-white);
  --control-hover-fill: var(--hds-color-carbon-05);
  --control-selected-fill: var(--hds-color-carbon-10);
  --focus-ring: var(--hds-color-nasa-blue-shade);
  --link-color: var(--hds-color-nasa-blue-shade);
  --link-hover: var(--hds-color-carbon-90);
  --plot-ui-bg: var(--hds-color-carbon-90);
  --plot-ui-inset: var(--hds-color-carbon-80);
  --plot-ui-border: var(--hds-color-carbon-50);
  --plot-ui-text: var(--hds-color-spacesuit-white);
  --plot-ui-muted: var(--hds-color-carbon-20);
  --control-height: 34px;
  --control-font-size: 12px;
  --control-weight: 600;
  --interaction-duration: 120ms;
  --data-hit: #2b7fff;
  /* Requested network-role adaptation; Map/cohort categorical hues stay separate. */
  --network-query: var(--action-primary);
  --network-sample: var(--hds-color-nasa-blue-shade);
  --network-study: var(--hds-color-carbon-60);
  --network-edge: var(--control-border);
  --network-emphasis: var(--hds-color-carbon-90);
  --accent-teal: #0bab9f;
  --accent-teal-soft: #e2f6f3;
  --accent-warm: #d9791b;
  --accent-warm-soft: #fdf0e2;
  /* HDS/USWDS accessible filled red: 4.6:1 with white at this text size. */
  --action-primary: #d83933;
  --action-primary-hover: var(--hds-color-nasa-red-shade);
  --action-primary-active: #8b0a03;
  --action-disabled-bg: var(--hds-color-carbon-10);
  --action-disabled-text: var(--hds-color-carbon-60);
  --header-bg: var(--hds-color-carbon-black);
  --header-fg: var(--hds-color-spacesuit-white);
  --header-fg-muted: var(--hds-color-carbon-20);
  --header-line: var(--hds-color-carbon-70);
  --status-good: #157a41;
  --status-good-soft: #edf7f0;
  --status-error: var(--hds-color-nasa-red-shade);
  --status-error-soft: #fff1f0;
  --status-warn: #8a600f;
  --status-warn-soft: #fdf6e3;
  --status-info-soft: var(--hds-color-carbon-05);
  --font-heading: var(--hds-font-family-heading);
  --font-sans: var(--hds-font-family-body);
  --font-mono: var(--hds-font-family-code);
  --text-xl: 20px;
  --text-lg: 18px;
  --text-base: 14px;
  --text-sm: 12px;
  --radius-sm: var(--hds-border-radius-control);
  --radius-md: var(--hds-border-radius);
  --radius-lg: var(--hds-border-radius);
  --radius: var(--hds-border-radius);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 20px;
  --space-5: 32px;
  --shadow-card: none;
  --shadow-raised: 0 4px 12px rgba(0,0,0,.12);
  --shadow: none;
}

/* Dash uses its strong interaction token for text, fills and selection.
   Keep it neutral; keyboard focus and real links have independent roles. */
:root {
  --Dash-Fill-Interactive-Strong: var(--control-ink);
  --Dash-Fill-Interactive-Weak: var(--control-selected-fill);
  --Dash-Fill-Inverse-Strong: var(--bg-panel);
  --Dash-Fill-Primary-Hover: rgba(0, 0, 0, 0.04);
  --Dash-Fill-Primary-Active: rgba(0, 0, 0, 0.08);
  --Dash-Fill-Disabled: var(--bg-panel-raised);
  --Dash-Stroke-Strong: var(--control-border);
  --Dash-Stroke-Weak: var(--border-subtle);
  --Dash-Text-Primary: var(--text-primary);
  --Dash-Text-Strong: var(--text-primary);
  --Dash-Text-Weak: var(--text-secondary);
  --Dash-Text-Disabled: var(--text-muted);
}

/* --- Global reset -------------------------------------------------------- */
/* Both views used to ship their own copy of this. The map's `height: 100%` is
   load-bearing rather than stylistic: its plot fills the viewport through an
   unbroken chain of percentage heights, and the chain starts here. */

* { box-sizing: border-box; }

/* A label that exists for assistive technology and not for the eye. Used where
   a control's visible name cannot be attached to it: Dash renders its search
   and filter inputs bare, so the alternative is a placeholder - which is not a
   name, and vanishes the moment anything is typed into it. Clipped rather than
   `display: none`, which would take it out of the accessibility tree too. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Plotly draws its modebar buttons at 24x22, two pixels under the floor WCAG
   2.2 SC 2.5.8 puts on a pointer target. Both views carry a modebar, so the
   correction is here rather than twice. */
.modebar-btn { min-height: 24px; }

.js-plotly-plot .plotly .modebar {
  left: 10px !important;
  right: auto !important;
  top: 4rem !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Heading hierarchy follows NASA; compact sizes remain the application's. */
h1, h2, h3, .app-nav, .btn-primary, .btn-secondary, .btn-ghost {
  font-family: var(--font-heading);
}
::selection { background: #cde2ff; color: #17171b; }
button, input, select, textarea { font-family: inherit; }
:where(button, input, select, textarea, a, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.dash-dropdown-trigger, .dash-dropdown-content, .dash-input-element {
  border-radius: var(--radius-sm);
}
