/* Shared suite menu (templates/_suite_nav.html). One look on every page.
   Brand colours come only from theme.css: green = --hw-accent (Business /
   only), yellow = --hw-legacy (Legacy only). Suite Home, Account, Logout and
   the logged-out items stay neutral. Text and surfaces use the neutral
   --hw-* tokens so both themes stay readable; no other accent hues here. */
.hn-root, .hn-list, .hn-foot, .hn-tree-label { --hn-green: var(--hw-accent); --hn-yellow: var(--hw-legacy); }

.hn-burger {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1;
  background: var(--hw-surface); color: var(--hw-text);
  border: 1px solid var(--hw-border); border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: border-color .15s, color .15s, opacity .2s, visibility .2s;
}
.hn-burger-fixed { position: fixed; top: 12px; right: 12px; z-index: 250; }
.hn-burger-inline { position: relative; }
.hn-burger:hover, .hn-burger:focus-visible { border-color: var(--hw-muted); outline: none; }
.hn-burger[data-nav-tone="business"]:hover,
.hn-burger[data-nav-tone="business"]:focus-visible { border-color: var(--hn-green); }
.hn-burger[data-nav-tone="legacy"]:hover,
.hn-burger[data-nav-tone="legacy"]:focus-visible { border-color: var(--hn-yellow); color: var(--hw-text); }
body.hallie-nav-open .hn-burger { opacity: 0; visibility: hidden; pointer-events: none; }

.hn-backdrop {
  display: none; position: fixed; inset: 0; z-index: 255;
  background: rgba(0, 0, 0, 0.45); border: 0; padding: 0; cursor: pointer;
}
body.hallie-nav-open .hn-backdrop { display: block; }

.hn-drawer {
  position: fixed; top: 0; right: 0; height: 100%; z-index: 260;
  width: 280px; max-width: 86vw; box-sizing: border-box;
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--hw-surface); color: var(--hw-text);
  border-left: 1px solid var(--hw-border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--hw-font-body);
}
.hn-drawer.open { transform: translateX(0); }
.hn-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 4px; }
.hn-greet-row {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; min-width: 0;
}
.hn-greet-row:has(+ .hn-credits:not([hidden])) { margin-bottom: 6px; }
.hn-greeting {
  margin: 0; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--hw-font-body); font-size: .92rem; color: var(--hw-muted);
}
.hn-credit-label {
  flex: 0 0 auto; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--hw-font-body); font-size: .92rem; line-height: 1.25;
  color: var(--hw-muted); font-variant-numeric: tabular-nums;
}
.hn-credit-label[hidden] { display: none !important; }
.hn-brand { color: var(--hw-text); font-family: var(--hw-font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.hn-close {
  appearance: none; background: transparent; border: 0; color: inherit; cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: 6px 10px; border-radius: 10px;
}
.hn-close:hover { background: var(--hw-surface-2); }

/* list (also dropped into the tree's own drawer) */
.hn-list { display: flex; flex-direction: column; gap: 8px; font-family: var(--hw-font-body); }
.hn-drawer > .hn-list { flex: 1; }  /* pushes Logout to the bottom; the tree drawer keeps its tools right under the menu */
.hn-list .hn-item,
.hn-foot .hn-item,
.hn-list .hn-sub a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 11px 14px;
  font: inherit; font-size: .95rem; font-weight: 500; line-height: 1.25; text-align: left;
  color: var(--hw-text); background: transparent; text-decoration: none; cursor: pointer;
  border: 1px solid var(--hw-border); border-radius: 12px;
  transition: border-color .15s, background-color .15s;
}
.hn-list .hn-sub { display: none; flex-direction: column; gap: 6px; padding: 2px 0 4px 12px; margin-left: 6px; border-left: 2px solid var(--hw-border); }
.hn-list .hn-sub.open { display: flex; }
.hn-list .hn-sub a { min-height: 42px; padding: 9px 12px; font-size: .9rem; }
.hn-list .hn-label { display: inline-flex; align-items: center; gap: 10px; }
.hn-list .hn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hw-muted); flex: none; }
.hn-list .hn-chev { transition: transform .2s; color: var(--hw-muted); }
.hn-list .hn-toggle[aria-expanded="true"] .hn-chev { transform: rotate(180deg); }

/* Business = green, Legacy = yellow; kept apart with their own rail + dot */
.hn-list .hn-business .hn-dot { background: var(--hn-green); }
.hn-list .hn-legacy .hn-dot { background: var(--hn-yellow); }
.hn-list .hn-business .hn-sub { border-left-color: var(--hn-green); }
.hn-list .hn-legacy .hn-sub { border-left-color: var(--hn-yellow); }
.hn-list .hn-legacy { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--hw-border); }
.hn-list .hn-section[data-nav-section="account"] { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--hw-border); }

/* hover + current: neutral outline + fill by default (Suite Home, Account,
   Logout, logged-out items); green only inside Business, yellow only inside
   Legacy. Text stays neutral for contrast. */
.hn-list .hn-item:hover, .hn-list .hn-sub a:hover, .hn-list .hn-packs-toggle:hover, .hn-foot .hn-item:hover,
.hn-list .hn-item:focus-visible, .hn-list .hn-sub a:focus-visible, .hn-list .hn-packs-toggle:focus-visible, .hn-foot .hn-item:focus-visible { border-color: var(--hw-muted); outline: none; }
.hn-list .hn-item.is-current, .hn-list .hn-sub a.is-current { border-color: var(--hw-text); background: var(--hw-surface-2); font-weight: 600; }
.hn-list .hn-business .hn-sub a:hover, .hn-list .hn-business .hn-sub a:focus-visible { border-color: var(--hn-green); }
.hn-list .hn-business .hn-sub a.is-current { border-color: var(--hn-green); background: color-mix(in srgb, var(--hn-green) 16%, transparent); }
.hn-list .hn-legacy .hn-sub a:hover, .hn-list .hn-legacy .hn-sub a:focus-visible { border-color: var(--hn-yellow); }
.hn-list .hn-legacy .hn-sub a.is-current { border-color: var(--hn-yellow); background: color-mix(in srgb, var(--hn-yellow) 18%, transparent); }

.hn-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hw-border); font-family: var(--hw-font-body); }
.hn-foot .hn-logout { color: var(--hw-muted); }

/* The tree's drawer: its own tools sit under the site menu, after this label */
.hn-tree-label {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 10px;
  font: 600 .72rem/1 var(--hw-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--hw-muted);
}
.hn-tree-label::before, .hn-tree-label::after { content: ""; flex: 1; height: 1px; background: var(--hw-border); }
.hn-tree-label::before { flex: 0 0 12px; }

@media (max-width: 480px) {
  .hn-burger-fixed { top: 10px; right: 10px; }
  .hn-drawer { width: 86vw; }
}
@media (prefers-reduced-motion: reduce) {
  .hn-drawer, .hn-list .hn-chev { transition: none; }
}

/* Host pages with blanket button rules (the tree's `.controls button:hover`
   paints black/white !important) must not repaint the menu. */
.hn-list .hn-toggle:hover,
.hn-list .hn-toggle:focus-visible,
.hn-list .hn-packs-toggle:hover,
.hn-list .hn-packs-toggle:focus-visible { background: transparent !important; color: var(--hw-text) !important; transform: none !important; }

/* Full-width usage bar under the greeting. The "74 of 120" / Unlimited
   label sits on the greeting line (right-anchored). Pack Buy lives in Account. */
.hn-credits { margin: 0 0 14px; }
.hn-credit-meter {
  width: 100%; box-sizing: border-box; padding: 6px 0;
  cursor: default; outline: none;
}
.hn-credit-meter:focus-visible { border-radius: 10px; box-shadow: 0 0 0 2px var(--hw-muted); }
.hn-credit-track {
  display: block; height: 8px; border-radius: 999px;
  background: var(--hw-surface-2); border: 1px solid var(--hw-border);
  overflow: hidden;
}
.hn-credit-fill {
  display: block; height: 100%; width: 0;
  background: var(--hw-accent); border-radius: inherit;
}
.hn-buy-packs { display: flex; flex-direction: column; gap: 6px; }
.hn-buy-packs[hidden] { display: none !important; }
.hn-packs-toggle {
  appearance: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; box-sizing: border-box; min-height: 42px; padding: 9px 12px;
  font: inherit; font-size: .9rem; font-weight: 500; line-height: 1.25; text-align: left;
  color: var(--hw-text); background: transparent; cursor: pointer;
  border: 1px solid var(--hw-border); border-radius: 12px;
  transition: border-color .15s, background-color .15s;
}
.hn-packs-toggle[aria-expanded="true"] .hn-chev { transform: rotate(180deg); }
.hn-credit-packs { display: flex; flex-wrap: wrap; gap: 6px; }
.hn-credits[hidden], .hn-credit-meter[hidden],
.hn-credit-packs[hidden] { display: none !important; }
.hn-pack-btn {
  appearance: none; cursor: pointer;
  padding: 8px 12px; min-height: 36px;
  font: inherit; font-size: .85rem; font-weight: 500;
  color: var(--hw-text); background: transparent;
  border: 1px solid var(--hw-border); border-radius: 12px;
}
.hn-pack-btn:hover, .hn-pack-btn:focus-visible {
  border-color: var(--hw-muted); outline: none;
}
.hn-pack-btn:disabled { opacity: .6; cursor: wait; }
#hnCreditTip {
  position: fixed; z-index: 300;
  max-width: min(260px, calc(100vw - 16px));
  padding: 8px 10px; border-radius: 10px;
  background: var(--hw-surface); color: var(--hw-text);
  border: 1px solid var(--hw-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  font-family: var(--hw-font-body); font-size: .8rem; line-height: 1.35;
  pointer-events: none;
}
#hnCreditTip[hidden] { display: none !important; }
