/* ==========================================================================
   Top bar extras (Dec 4 2026): state chips next to the logo and the account
   menu on the right. Loaded last, after theme-light.css. Colors use the theme
   tokens, so light mode works without regenerating theme-light.css.
   ========================================================================== */

/* State chips: outline of each chosen state + its code */
.gnav-states { display: flex; align-items: center; gap: 4px; flex: none; margin-left: -8px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.st-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 9px 0 5px; border: 1px solid var(--line-2); background: transparent; color: var(--soft); font-size: .72rem; font-weight: 700; letter-spacing: .05em; line-height: 1; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.st-chip svg { width: 22px; height: 22px; flex: none; fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.1; stroke-linejoin: round; transition: fill .15s; }
.st-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); text-decoration: none; }
.st-chip:hover svg { fill: rgba(242,138,36,.35); }
.st-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.st-chip.is-active svg { fill: var(--accent); }
.st-chip.is-extra { border-style: dashed; }
.st-chip.st-add { width: 32px; padding: 0; justify-content: center; color: var(--muted); border-style: dashed; }
.st-chip.st-add svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.st-chip.st-add:hover { color: var(--accent); }
.gnav-states-m { display: none; }

/* Account menu */
.dd-acct > summary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; color: var(--text); font-size: .88rem; font-weight: 500; white-space: nowrap; cursor: pointer; list-style: none; }
.dd-acct > summary::-webkit-details-marker { display: none; }
.dd-acct > summary:hover, .dd-acct[open] > summary { background: rgba(255,255,255,.06); }
html[data-theme="light"] .dd-acct > summary:hover, html[data-theme="light"] .dd-acct[open] > summary { background: rgba(15,24,20,.05); }
.gnav .dd-acct.is-current > summary { box-shadow: none; }
.acct-av { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50% !important; background: var(--accent); color: #1a0d02; font-family: var(--display); font-weight: 700; font-size: .76rem; letter-spacing: .03em; }
.dd-acct.is-current > summary .acct-av { box-shadow: 0 0 0 2px var(--ink, #0a0f0d), 0 0 0 4px var(--accent-line); }
.acct-av.lg { width: 42px; height: 42px; font-size: .92rem; }
.gnav-right .acct-panel { left: auto; right: 0; min-width: 290px; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 2px; border-bottom: 1px solid var(--line-2); }
.acct-head > span:last-child { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.acct-head b { color: var(--text); font-size: .93rem; font-weight: 600; }
.acct-head small { color: var(--muted); font-size: .76rem; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-panel .dd-h { margin-top: 10px; }
.acct-panel a > small { flex: none; margin-left: auto; padding: 2px 6px; border: 1px solid var(--line-2); font-size: .68rem !important; font-weight: 700; letter-spacing: .04em; }
.acct-panel form { margin: 0; }
.acct-sep { height: 1px; margin: 6px 0; background: var(--line-2); }
.acct-panel .dd-btn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: #ffb35c; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="light"] .acct-panel .dd-btn svg { stroke: #ad5d00; }
.acct-theme .ic-moon { display: none; }
html[data-theme="light"] .acct-theme .ic-sun { display: none; }
html[data-theme="light"] .acct-theme .ic-moon { display: block; }

/* Make room: search box folds to its icon a little earlier now that the bar holds more */
@media (max-width: 1300px) {
  .st-chip:not(.st-add) { padding: 0 5px; }
  .st-chip b { display: none; }
}
@media (max-width: 1440px) { .gnav .top-search { display: none; } .gnav .top-search-btn { display: grid; } }
@media (max-width: 1220px) {
  .acct-nm { display: none; }
  .gnav-in { gap: 14px; }
  .gnav-states { gap: 2px; margin-left: -4px; padding-left: 10px; }
  .gnav-in > .gnav-states .st-chip:not(.st-add) { padding: 0 2px; }
  .gnav-in > .gnav-states .st-chip.st-add { width: 26px; }
}

/* Tablets and phones: the menu is a drawer, but the account menu stays a dropdown in the bar */
@media (max-width: 1020px) {
  .gnav-states { margin-left: 0; padding-left: 10px; }
  .gnav-right .acct-panel { position: absolute; top: calc(100% + 8px); right: 0; left: auto; width: min(300px, calc(100vw - 20px)); min-width: 0; padding: 8px; border: 1px solid var(--line-2); background: #0e1512; box-shadow: 0 24px 60px rgba(0,0,0,.55); grid-template-columns: 1fr; }
  html[data-theme="light"] .gnav-right .acct-panel { background: #fff; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(16,24,20,.18); }
  .acct-panel a, .acct-panel .dd-btn { min-height: 42px; }
  .dd-acct > summary .caret { display: none; }
  .dd-acct > summary { padding: 0 4px; }
}
@media (max-width: 700px) {
  .gnav-in > .gnav-states { display: none; }
  .gnav-states-m { display: block; padding: 6px 0 4px; }
  .gnav-states-m .dd-h { margin: 4px 4px 8px; }
  .gnav-states-m > div { display: flex; flex-wrap: wrap; gap: 6px; }
  .gnav-states-m .st-chip { height: 38px; padding: 0 10px 0 6px; font-size: .78rem; }
  .gnav-states-m .st-chip b { display: inline; }
  .gnav-states-m .st-chip.st-add { width: 38px; padding: 0; }
  .gnav-states-m .st-chip svg { width: 24px; height: 24px; }
}
@media print { .gnav-states, .dd-acct { display: none !important; } }

/* Account page: section links land below the sticky bar */
.page-account .content [id] { scroll-margin-top: 84px; }
@media (min-width: 1021px) and (max-width: 1120px) {
  .gnav-group > a, .gnav-group summary { padding: 0 7px; }
  .gnav-group > a.top-link .pro-tag { display: none; }
}
