/* ============================================================
   HALVEX WEBSITE — app-layer overrides.
   Website-owned styles that evolve the vendored design-system
   components from the outside, without touching the frozen
   _ds_bundle.js (ADR 0003, ADR 0007). Linked after the design
   system's styles.css so these rules win the cascade.
   ============================================================ */

/* Command-line focus treatment — "v3-flat" (PRD: command-line focus hotkey).
   The CommandBar's inline focus styles swap the border to brand AND paint a 2px
   outward glow ring, which makes the bar appear to grow and bleed into the nav
   row beneath it. The bar's <form> carries a `data-cmdbar` marker (passed from
   TopBar via the component's `...rest` spread), giving a stable selector. On
   focus we keep the exact footprint: brand border, NO outward glow, and the
   input background lifted one step (surface-inset -> surface-2) so it still
   reads unmistakably as active. The inline styles must be beaten, so each
   declaration is `!important`. The focused border is neutral (border-strong),
   not brand — orange is reserved for the caret, logo, and centrality pips. */
form[data-cmdbar]:focus-within {
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
  background: var(--surface-2) !important;
}

/* Suppress the *inner* focus ring. The global `:focus-visible` rule in
   tokens/base.css paints `--ring-focus` (a 2px canvas + 3px orange ring) on any
   keyboard-/programmatically-focused element — and the CommandBar's <input> is
   exactly that whenever the bar is reached via the Cmd/Ctrl+K hotkey. That ring
   draws a second, tighter box *inside* the form border (a dark inset rectangle
   with an orange outline around just the input), so the focused bar reads as a
   weird nested "box-in-a-box". The form-level treatment above is the single
   focus indicator we want, so the input's own ring is removed. Selector
   specificity already beats the bare `:focus-visible`, so no `!important`. */
form[data-cmdbar] input:focus-visible {
  outline: none;
  box-shadow: none;
}

/* The focus-hotkey hint — a small kbd badge advertising the Cmd/Ctrl+K
   shortcut, styled to match the CommandBar's own `MSTR EQ DES ↵` hint. It sits
   just right of the bar and hides while the bar is focused (the `~` sibling
   combinator keys off the form's :focus-within), so it cues the shortcut at
   rest without cluttering the bar mid-type. */
.cmdbar-keyhint {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1.3;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  user-select: none;
}
form[data-cmdbar]:focus-within ~ .cmdbar-keyhint { display: none; }

/* Global function-code nav (FunctionCode) — de-branded. The frozen component
   (ADR 0007, untouched) paints its active chip with a solid brand-orange fill
   and its hover state with a brand tint; the design direction reserves orange
   for only the logo, the command caret, and the centrality pips. TopBar tags
   each chip `.fc-nav` (and the active one `data-active`) via the component's
   `...rest` spread, giving a stable hook to override the inline styles from the
   outside. The resting (inactive) chip is already neutral, so only the active
   and hover states need beating — hence `!important`. Active sits after hover
   so an active+hovered chip reads as the active (selected) treatment. */
.fc-nav:hover {
  color: var(--text-primary) !important;
  background: var(--surface-3) !important;
  border-color: var(--border-strong) !important;
}
.fc-nav[data-active] {
  color: var(--text-primary) !important;
  background: var(--surface-3) !important;
  border-color: var(--border-strong) !important;
}
