/* ============================================================
 * css/components/nav.css — TinkyTown nav grouping + profile menu
 *
 * Owns:
 *   1. Visual group dividers in the top-nav segmented strip
 *      (.view-tabs > .o-nav-divider — DOM elements, not pseudos,
 *      so dynamically-injected tabs e.g. Reps don't break grouping)
 *   2. Header profile dropdown (.o-profile-menu) for the items
 *      moved out of the top-nav per platform-spec § 2 IA
 *      (Billing · Settings · Organization · API Keys · Logout)
 *
 * Spec: docs/specs/tinkytown-platform-spec.md § 2 IA
 * Load order: AFTER /css/tokens.css and /css/outreach.css.
 * P1.T3 — Nav grouping + profile dropdown (2026-05-11)
 * ============================================================ */

/* ── Visual group divider between tab clusters ──
 * 1px border + width:0 keeps the line hairline at 1x/2x DPR. */
.view-tabs .o-nav-divider {
  display: inline-block;
  align-self: stretch;
  width: 0;
  margin: 4px 6px;
  border-left: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* ── Header profile menu (fresh DOM, no existing chip to extend) ── */
.o-profile-menu { position: relative; display: inline-flex; }
.o-profile-btn {
  /* Pill shaped like .o-btn but tinted amber on hover so users
     can spot the account control without reading the label. */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font: 600 13px/1 'General Sans', system-ui, sans-serif;
  cursor: pointer;
  min-height: 44px;
}
.o-profile-btn:hover { border-color: var(--amber); color: var(--amber); }
.o-profile-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.35);
}
.o-profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--surface-deep);
  font: 700 11px/1 'General Sans', system-ui, sans-serif;
}
.o-profile-caret { font-size: 10px; opacity: 0.7; }

.o-profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  z-index: 1000;
  display: none; /* JS toggles [data-open="true"] */
}
.o-profile-menu[data-open="true"] .o-profile-dropdown { display: block; }
.o-profile-dropdown-email {
  padding: 6px 10px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
  word-break: break-all;
}
.o-profile-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  padding: 9px 10px;
  border-radius: 6px;
  font: 500 13px/1.2 'General Sans', system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
}
.o-profile-dropdown button:hover { background: rgba(232, 163, 61, 0.12); color: var(--amber); }
.o-profile-dropdown button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(232, 163, 61, 0.55);
}
.o-profile-dropdown hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 4px 0; }

/* ── Mobile: outreach.css already makes the strip scroll. Collapse
     dividers so wrapped groups don't look visually busy on phones. ── */
@media (max-width: 600px) {
  .view-tabs .o-nav-divider {
    border-left: 0;
    width: 0;
    margin: 0 2px;
  }
}
