/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER ACTIONS · right-hand side of #TB
   Controller: /assets/tfa/nav-actions.js   Loaded after home.css, so it layers over
   the earlier header rules without editing them.

   Visibility follows `html[data-nv-state]` (out | up | top), set from the real
   session and plan catalogue. With the attribute absent the header shows the guest
   set, so a controller failure never shows Upgrade to someone who is signed out.

   One control height (34px), one radius (pill), one type scale (12.5px / 600) for
   every action. Glows and shimmer sweeps are removed; turquoise stays the Match
   Deal Pro identity, gold stays the primary action.
   ═══════════════════════════════════════════════════════════════════════════════ */

#TB .tb-right { gap: 14px; }

/* ── Visibility ───────────────────────────────────────────────────────────────── */
html:not([data-nv-state='up']) #TB .tb-upgrade { display: none; }
html:not([data-nv-state='top']) #TB .nv-plan { display: none; }
html:not([data-nv-state='up']):not([data-nv-state='top']) #TB .nv-acct { display: none; }
/* The credit balance moves into the account menu outside the assistant view. */
html:not([data-th-view='assistant']) #TB #TB_CREDITS { display: none !important; }

/* ── Shared control metrics ───────────────────────────────────────────────────── */
#TB .tb-upgrade, #TB .tb-signin, #TB .th-getstarted, #TB .nv-plan, #TB .tb-md-wrap {
  height: 34px; border-radius: 100px; box-sizing: border-box;
  font: 600 12.5px/1 'Inter', system-ui, sans-serif; letter-spacing: 0;
  white-space: nowrap; box-shadow: none;
}
#TB .tb-upgrade::after { display: none; }

/* ── Match Deal Pro · button + caret as one turquoise component ──────────────── */
#TB .tb-md-wrap {
  display: flex; align-items: center; gap: 0; padding: 0;
  border: 1px solid rgba(20, 184, 166, .38);
  background: rgba(13, 148, 136, .10);
  transition: border-color .18s, background-color .18s;
}
#TB .tb-md-wrap:hover, #TB .tb-md-wrap:focus-within, #TB .tb-md-wrap.open {
  border-color: rgba(20, 184, 166, .62); background: rgba(13, 148, 136, .16);
}
#TB .tb-matchdeal {
  height: 100%; padding: 0 12px 0 14px; border: 0; border-radius: 100px 0 0 100px;
  background: none; box-shadow: none; transform: none;
  font: inherit; color: #5EEAD4;
}
#TB .tb-matchdeal::after { display: none; }
#TB .tb-matchdeal:hover { transform: none; box-shadow: none; color: #99F6E4; }
#TB .tb-md-caret {
  width: 30px; height: 100%; border: 0; border-radius: 0 100px 100px 0;
  border-inline-start: 1px solid rgba(20, 184, 166, .28);
  background: none; color: #5EEAD4; font-size: 10px;
}
#TB .tb-md-caret:hover { background: rgba(20, 184, 166, .12); color: #99F6E4; }
#TB .tb-md-wrap.open .tb-md-caret, #TB .tb-md-caret[aria-expanded='true'] { color: #99F6E4; }
#TB .tb-matchdeal:focus-visible, #TB .tb-md-caret:focus-visible {
  outline: 2px solid #5EEAD4; outline-offset: -2px;
}
[dir='rtl'] #TB .tb-matchdeal { border-radius: 0 100px 100px 0; }
[dir='rtl'] #TB .tb-md-caret { border-radius: 100px 0 0 100px; }

/* ── Separator ────────────────────────────────────────────────────────────────── */
#TB .nv-sep { width: 1px; height: 22px; flex-shrink: 0; background: rgba(255, 255, 255, .12); }

/* ── Guest actions ────────────────────────────────────────────────────────────── */
#TB .tb-signin {
  padding: 0 4px; border: 0; background: none; color: rgba(242, 239, 232, .78);
  transition: color .18s;
}
#TB .tb-signin:hover { background: none; color: #F2EFE8; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(240, 204, 90, .6); }

#TB .th-getstarted, #TB .tb-upgrade {
  padding: 0 18px; border: 0; color: #0A0B0F;
  background: linear-gradient(135deg, #D4A832, #F0CC5A);
  transition: filter .18s, transform .18s;
}
#TB .th-getstarted:hover, #TB .tb-upgrade:hover { transform: none; box-shadow: none; filter: brightness(1.06); }
#TB .tb-signin:focus-visible, #TB .th-getstarted:focus-visible, #TB .tb-upgrade:focus-visible {
  outline: 2px solid #F0CC5A; outline-offset: 2px;
}

/* ── Current-plan badge ───────────────────────────────────────────────────────── */
#TB .nv-plan {
  display: inline-flex; align-items: center; padding: 0 14px;
  border: 1px solid rgba(212, 168, 50, .32); background: rgba(212, 168, 50, .07);
  color: #E9C65A; font-size: 12px;
}

/* ── Avatar + account menu ────────────────────────────────────────────────────── */
#TB .nv-acct { position: relative; display: flex; }
#TB .nv-acct .tb-acct {
  width: 34px; height: 34px; padding: 0; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
}
#TB .nv-acct .tb-acct .nm { display: none; }
#TB .nv-acct .tb-acct .av { width: 28px; height: 28px; font-size: 11px; }
#TB .nv-acct .tb-acct:hover, #TB .nv-acct.open .tb-acct { border-color: rgba(240, 204, 90, .45); }
#TB .nv-acct .tb-acct:focus-visible { outline: 2px solid #F0CC5A; outline-offset: 2px; }

#TB .nv-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60;
  width: 248px; padding: 6px; box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px;
  background: rgba(11, 13, 17, .98); box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(-4px); pointer-events: none; visibility: hidden;
  transition: opacity .16s, transform .16s, visibility 0s .16s;
}
#TB .nv-acct.open .nv-menu {
  opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition: opacity .16s, transform .16s;
}
#TB .nv-head {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px;
  margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .07);
  font: 500 11.5px/1.35 'Inter', system-ui, sans-serif; color: rgba(242, 239, 232, .5);
}
#TB .nv-head b { font-size: 13px; font-weight: 600; color: #F2EFE8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#TB .nv-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#TB .nv-head-plan { color: #E9C65A; }
#TB .nv-head-plan:empty { display: none; }
#TB .nv-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: none;
  font: 500 12.5px/1 'Inter', system-ui, sans-serif; color: rgba(242, 239, 232, .85);
  text-align: start; cursor: pointer;
}
#TB .nv-item:hover, #TB .nv-item:focus-visible { background: rgba(255, 255, 255, .06); color: #F2EFE8; outline: none; }
#TB .nv-item[hidden] { display: none; }
#TB .nv-val { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #E9C65A; }
#TB .nv-line { height: 1px; margin: 4px 6px; background: rgba(255, 255, 255, .07); }
#TB .nv-out { color: rgba(242, 239, 232, .62); }

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) { #TB .tb-right { gap: 12px; } #TB .nv-plan { display: none; } }
@media (max-width: 560px) {
  #TB .tb-matchdeal { padding: 0 12px; }
  #TB .tb-upgrade { padding: 0 14px; }
}
@media (max-width: 480px) {
  #TB .tb-right { gap: 10px; }
  #TB .nv-sep { display: none; }
  /* The caret is hidden here by an existing rule; the button keeps both ends round. */
  #TB .tb-matchdeal { border-radius: 100px; padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { #TB .nv-menu { transition: none; } }
