/* analysis-nav.css — item 1.32, HALF TWO (nav + overview).
 * Lane cc-132-nav-b, 2026-09-17. Authority RB_WORD.md:859-863, :944, :957-961.
 *
 * css/styles.css is FROZEN (Critical Rule 2, the Frozen Four), so this is a
 * separate sheet and MUST load after it. Every value is a design token from
 * css/styles.css — no literal colours, so the light/dark swap is inherited
 * rather than re-implemented. (The theme is a CLASS, `:root.light`, never a
 * `data-theme` attribute — CLAUDE.md Rule 4's 2026-08-02 correction. Nothing
 * here keys on either, precisely so it cannot get that wrong.)
 */

/* ── THE SHELL ─────────────────────────────────────────────────────────────── */
#anav-shell {
  display: block;
  margin-top: 12px;
}

/* The overview is PINNED: it stays on screen while the pane scrolls, so a PM
   never loses the total and the confidence while reading a section. */
#anav-overview {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
}

#anav-body {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* ── LEFT NAV ──────────────────────────────────────────────────────────────── */
#anav-nav {
  position: sticky;
  top: 132px;
  flex: 0 0 232px;
  max-width: 232px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px;
}

.anav-navlist { list-style: none; margin: 0; padding: 0; }

.anav-navbtn {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 9px;
  cursor: pointer;
}
.anav-navbtn:hover { background: var(--sidebar-hover); }
.anav-navbtn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--primary);
}
.anav-navbtn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.anav-label { flex: 1 1 auto; }

/* A count is a MEASUREMENT, so it is rendered as one: monospace, and never
   fabricated. Three distinct states, and they must not look alike. */
.anav-n {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.anav-n-report { font-style: italic; }            /* report-derived, not a table */
.anav-n-none   { color: var(--gray-500); }        /* measured zero */
.anav-n-unread { color: var(--yellow); }          /* COULD NOT BE READ — not zero */

/* ── CONTENT PANE ──────────────────────────────────────────────────────────── */
#anav-pane {
  flex: 1 1 auto;
  min-width: 0;
}
.anav-group { display: none; }
.anav-group.anav-on { display: block; }

.anav-pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.anav-pane-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.anav-pane-src {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── EMPTY: SAY WHAT, AND SAY WHY (RB_WORD:860) ────────────────────────────── */
.anav-empty {
  margin: 10px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.anav-empty strong { color: var(--text); }
.anav-empty code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

/* ── THE PINNED OVERVIEW ───────────────────────────────────────────────────── */
.anav-ov-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.anav-ov-item { display: flex; flex-direction: column; gap: 2px; }
.anav-ov-k {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.anav-ov-v { font-size: 17px; font-weight: 700; color: var(--text); }
.anav-ov-v.anav-ov-sm { font-size: 13px; font-weight: 600; }
.anav-ov-v.anav-ov-absent {
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-secondary);
}

.anav-ov-conf-yellow { color: var(--yellow); }
.anav-ov-conf-red    { color: var(--red); }
.anav-ov-conf-green  { color: var(--green); }

.anav-ov-incomplete {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--yellow);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
}
.anav-ov-incomplete .anav-ov-inc-k { color: var(--text-secondary); }
.anav-ov-complete {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.anav-ov-counts {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.anav-ov-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  cursor: pointer;
}
.anav-ov-chip:hover { border-color: var(--primary); color: var(--text); }
.anav-ov-chip b { color: var(--text); font-weight: 700; }

/* ── NARROW: the nav becomes a horizontal strip rather than vanishing ───────── */
@media (max-width: 900px) {
  #anav-body { display: block; }
  #anav-nav {
    position: static;
    flex: none;
    max-width: none;
    max-height: none;
    margin-bottom: 12px;
  }
  .anav-navlist { display: flex; flex-wrap: wrap; gap: 4px; }
  .anav-navbtn { width: auto; }
  .anav-navbtn.active { box-shadow: inset 0 -2px 0 var(--primary); }
  #anav-overview { position: static; }
}

/* ───────────────────────────────────────────────────────────────────────────
   ONE NAVIGATION ELEMENT — lane cc-132-polish, 2026-09-18, item 1.32,
   authority RB_WORD.md:1050 ("the Sections button still renders alongside the
   left nav, so two navigation elements exist where the ruling required one
   absorbed or kept").

   The left nav supersedes the floating Sections button. It is hidden here
   rather than removed in JS because js/ui-polish-tier-1.js:1024 rebuilds it on
   every render, so a removed node comes straight back.

   `body.anav-on` is set by js/analysis-nav.js only while the nav is actually
   installed, and removed when localStorage['analysis-nav-off']='1' — so the
   kill switch restores the Sections button with no redeploy.

   ⚠ THIS ALSO CLOSES THE OPEN QUESTION RB ASKED. The three-entry Sections menu
   with dead jumps was this button, not a failing shell: its own present() test
   (ui-polish-tier-1.js:1065) drops any node whose offsetParent is null, and
   under the nav every pane except the active one is display:none. With Overview
   active, the only survivors of its 16 anchors are `top`, `confidence-dashboard`
   and `bid-summary` — which is exactly the three entries RB saw, in exactly that
   order. The jumps did nothing because the other anchors point into hidden
   panes. That is a property of this button under the nav, not of any bid.
   ─────────────────────────────────────────────────────────────────────────── */

body.anav-on #uipt-b4-jump-btn,
body.anav-on #uipt-b4-jump-menu {
  display: none !important;
}
