/* Hero Vired Reporting Portal — v2 shell
   Sidebar (≥1024px) / top bar + drawer (<1024px), ⌘K palette, freshness pill,
   banner, toasts, coach marks and the shared v2 primitives (buttons, pills,
   cards).  Values come from tokens.css; see .claude/design_v2/README.md.
   Loaded after Bootstrap and before the legacy page CSS.  */

/* ── Base ─────────────────────────────────────────────────────────────── */
html { background: var(--hv-bg-page); }
body.hv-body {
  margin: 0;
  min-height: 100vh;
  background: var(--hv-bg-page);
  color: var(--hv-text);
  font-family: var(--hv-font-sans);
  -webkit-font-smoothing: antialiased;
  /* The shell handles notch safe areas itself (top bar, drawer); the body never pads. */
  padding: 0 !important;
  --bs-body-font-family: var(--hv-font-sans);
  --bs-body-bg: var(--hv-bg-page);
  --bs-body-color: var(--hv-text);
}
.hv-body :focus-visible { outline: none; box-shadow: var(--hv-focus); }
/* Text on an accent fill: accents are dark in light mode, light in dark mode. */
:root { --hv-on-accent: #FFFFFF; }
[data-theme="dark"] { --hv-on-accent: #0F1017; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] { --hv-on-accent: #0F1017; } }
/* Components set display:flex/grid; the hidden attribute must still win. */
.hv-body [hidden] { display: none !important; }
.hv-num, .hv-body .tabular { font-variant-numeric: tabular-nums; }
.hv-sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hv-body ::-webkit-scrollbar { height: 8px; width: 8px; }
.hv-body ::-webkit-scrollbar-thumb { background: rgba(120,125,150,.35); border-radius: 4px; }

/* ── App grid ─────────────────────────────────────────────────────────── */
.hv-app { display: flex; min-height: 100vh; }
.hv-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.hv-side {
  width: var(--hv-sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; background: var(--hv-bg-surface); border-right: 1px solid var(--hv-border);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; z-index: 20;
}
.hv-brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px;
  color: inherit; text-decoration: none !important;
}
/* Hero Vired logo — the same logo-440.png, cropped to its artwork.
   The PNG is 440×247 with the artwork at x 81–359, y 54–193 (plus a few px of
   breathing room: 77–363 × 50–197).  For a visible height H the image is drawn
   at 1.6803·H tall and shifted up/left so only that box shows (width 1.9456·H).
   The white plate keeps the black wordmark legible on dark surfaces. */
.hv-logo {
  --logo-h: 30px;
  display: inline-block; flex: none; box-sizing: content-box; overflow: hidden;
  width: calc(var(--logo-h) * 1.9456); height: var(--logo-h);
  padding: 4px 6px; border-radius: 8px; background: #fff;
}
.hv-logo img {
  display: block; max-width: none; width: auto; height: calc(var(--logo-h) * 1.6803);
  margin: calc(var(--logo-h) * -0.3401) 0 0 calc(var(--logo-h) * -0.5238);
}
.hv-logo--sm { --logo-h: 24px; padding: 3px 5px; border-radius: 7px; }
.hv-logo--md { --logo-h: 34px; }
.hv-logo--lg { --logo-h: 64px; padding: 18px 24px; border-radius: 18px; }
[data-theme="dark"] .hv-logo { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .hv-logo { box-shadow: 0 0 0 1px rgba(255,255,255,.08); } }
.hv-brand .hv-logo { margin-left: -6px; }
.hv-brand__text { display: flex; flex-direction: column; padding-left: 10px; border-left: 1px solid var(--hv-border); }
.hv-brand__name { font: 700 14px/1.1 var(--hv-font-sans); color: var(--hv-text); }
.hv-brand__sub { font: 400 11px/1.2 var(--hv-font-sans); color: var(--hv-text-muted); }

.hv-dept { position: relative; margin: 0 2px 10px; }
.hv-dept__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--hv-border); border-radius: 8px;
  background: var(--hv-bg-page); cursor: pointer; color: var(--hv-text); min-height: 40px;
  font: 600 13px var(--hv-font-sans);
}
.hv-dept__btn:hover { border-color: var(--hv-border-strong); }
.hv-dept__label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hv-dept__label i { color: var(--hv-accent); font-size: 12px; width: 14px; text-align: center; }
.hv-dept__label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-dept__chev { font-size: 10px; color: var(--hv-text-muted); transition: transform var(--hv-dur) var(--hv-ease); }
.hv-dept[data-open="true"] .hv-dept__chev { transform: rotate(180deg); }
.hv-dept__menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--hv-bg-surface); border: 1px solid var(--hv-border); border-radius: 10px;
  box-shadow: var(--hv-shadow-lg); padding: 6px; display: none; flex-direction: column; gap: 2px;
  transform-origin: top;
}
.hv-dept[data-open="true"] .hv-dept__menu { display: flex; animation: hv-scale-in .18s var(--hv-ease) both; }
.hv-dept__opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px;
  color: var(--hv-text) !important; text-decoration: none !important; min-height: 40px;
  font: 500 13px var(--hv-font-sans); background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.hv-dept__opt:hover { background: var(--hv-bg-surface-2); }
.hv-dept__opt[aria-current="true"] { background: var(--hv-accent-soft); }
.hv-dept__opt.is-locked { color: var(--hv-text-muted) !important; }
.hv-chip-icon {
  width: 24px; height: 24px; border-radius: 6px; background: var(--hv-accent-soft); color: var(--hv-accent-text);
  display: grid; place-items: center; flex: none; font-size: 11px;
}
.hv-dept__opt .hv-dept__name { flex: 1; }
.hv-dept__opt .fa-lock { font-size: 10px; color: var(--hv-text-faint); }

.hv-jump {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; padding: 8px 12px;
  border: 1px dashed var(--hv-border-strong); border-radius: 8px; background: none;
  color: var(--hv-text-muted); font: 400 12px var(--hv-font-sans); cursor: pointer; min-height: 38px;
}
.hv-jump:hover { border-color: var(--hv-accent); color: var(--hv-accent-text); }
.hv-jump i { font-size: 11px; }
.hv-jump > span:not(.hv-kbd) { flex: 1; text-align: left; white-space: nowrap; }
.hv-kbd {
  font: 500 10px var(--hv-font-sans); border: 1px solid var(--hv-border-strong);
  border-radius: 4px; padding: 1px 5px; color: var(--hv-text-faint);
}

.hv-group__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 6px; border: 0; background: none; cursor: pointer; color: var(--hv-text-faint);
  font: 600 10px/1 var(--hv-font-sans); letter-spacing: .1em; text-transform: uppercase;
}
.hv-group__btn:hover { color: var(--hv-accent-text); }
.hv-group__btn i { font-size: 9px; transition: transform var(--hv-dur) var(--hv-ease); }
.hv-group[data-open="false"] .hv-group__btn i { transform: rotate(-90deg); }
.hv-group[data-open="false"] .hv-group__items { display: none; }
.hv-group__items { display: flex; flex-direction: column; gap: 2px; }

.hv-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; color: var(--hv-text-2) !important; text-decoration: none !important;
  font: 400 13px var(--hv-font-sans); min-height: 38px; transition: background .15s var(--hv-ease);
}
.hv-item:hover { background: var(--hv-bg-surface-2); }
.hv-item i { width: 14px; font-size: 12px; color: var(--hv-text-faint); text-align: center; }
.hv-item span { flex: 1; }
.hv-item.is-locked { color: var(--hv-text-faint) !important; }
.hv-item.is-locked .fa-lock { width: auto; font-size: 10px; }
.hv-item[data-dept] > i:first-child { color: var(--hv-accent); }
.hv-item[aria-current="page"] { background: var(--hv-accent-soft); color: var(--hv-accent-text) !important; font-weight: 600; }
.hv-item[aria-current="page"] i { color: var(--hv-accent); }
.hv-item[aria-current="page"]::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--hv-gradient-active); transform-origin: center; animation: hv-grow-y .25s var(--hv-ease) both;
}
/* Desktop sidebar: one indicator that slides from the last page's row to this one
   (shell.js initNavBar).  Until it is placed, the row's own bar shows. */
.hv-side__nav { position: relative; }
.hv-navbar {
  position: absolute; left: 0; top: 0; width: 3px; height: 22px; border-radius: 3px; z-index: 1;
  background: var(--hv-gradient-active); opacity: 0; pointer-events: none;
  transition: transform .28s var(--hv-ease), opacity .2s var(--hv-ease);
}
.hv-side__nav.has-navbar .hv-navbar { opacity: 1; }
.hv-side__nav.has-navbar .hv-item[aria-current="page"]::before { display: none; }
.hv-side__spacer { flex: 1; }

.hv-userrow {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px;
  border-top: 1px solid var(--hv-border); margin-top: 8px;
}
.hv-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--hv-accent-soft); flex: none;
  display: grid; place-items: center; font: 600 11px var(--hv-font-sans); color: var(--hv-accent-text);
  overflow: hidden;
}
.hv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hv-userrow__who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hv-userrow__name { font: 600 12px/1.2 var(--hv-font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--hv-text); }
.hv-userrow__role { font: 400 11px/1.2 var(--hv-font-sans); color: var(--hv-text-muted); }
.hv-iconbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--hv-border);
  background: var(--hv-bg-page); color: var(--hv-text-2); cursor: pointer; display: grid; place-items: center;
  text-decoration: none !important; flex: none;
}
.hv-iconbtn:hover { border-color: var(--hv-accent); color: var(--hv-accent-text); }
.hv-iconbtn i { font-size: 12px; }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.hv-top {
  position: sticky; top: 0; z-index: 30; height: var(--hv-topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--hv-bg-surface);
  background: color-mix(in srgb, var(--hv-bg-surface) 85%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hv-border);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hv-top { background: var(--hv-bg-surface); }
}
.hv-crumbs {
  display: flex; align-items: center; gap: 8px; font: 400 12px var(--hv-font-sans);
  color: var(--hv-text-muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden;
}
.hv-crumbs a { color: inherit !important; text-decoration: none !important; }
.hv-crumbs a:hover { color: var(--hv-accent-text) !important; }
.hv-crumbs__current { color: var(--hv-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.hv-top__burger, .hv-top__search {
  width: 44px; height: 44px; border: 0; background: none; color: var(--hv-text); cursor: pointer;
  display: none; place-items: center; border-radius: 8px; flex: none;
}
.hv-top__burger { margin-left: -10px; }
.hv-top__burger i { font-size: 16px; }
.hv-top__search i { font-size: 14px; }
.hv-top__mark { display: none; flex: none; line-height: 0; text-decoration: none !important; border-radius: 7px; }
.hv-top__title {
  display: none; font: 600 14px var(--hv-font-sans); flex: 1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--hv-text);
}
.hv-top__actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* Freshness pill */
.hv-fresh {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: var(--hv-radius-pill);
  font: 500 12px var(--hv-font-sans); white-space: nowrap;
  background: var(--hv-ok-bg); color: var(--hv-ok);
}
.hv-fresh[hidden] { display: none; }
.hv-fresh__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
/* A new snapshot: one ring out of the dot. */
.hv-fresh[data-state="fresh"] .hv-fresh__dot.is-pulsing { animation: hv-ring .9s var(--hv-ease) 1; }
.hv-fresh__long, .hv-fresh__short { display: inline-flex; align-items: center; gap: 7px; }
.hv-fresh__sep { width: 1px; height: 12px; background: currentColor; opacity: .35; }
.hv-fresh__next { font-weight: 400; opacity: .85; }
.hv-fresh__sep:empty + .hv-fresh__next:empty, .hv-fresh.is-nonext .hv-fresh__sep { display: none; }
.hv-fresh__short { display: none; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; font-size: 11px; }
.hv-fresh__next--short { font-weight: 400; opacity: .85; }
.hv-fresh__next--short:empty { display: none; }
/* Stale: a light sweeps across the label while the refresh runs. */
.hv-fresh[data-state="stale"] .hv-fresh__label--long, .hv-fresh[data-state="stale"] .hv-fresh__label--short {
  background: linear-gradient(90deg, currentColor 0%, currentColor 40%, transparent 50%, currentColor 60%, currentColor 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hv-sweep 1.6s linear infinite;
}
.hv-fresh[data-state="stale"] { background: var(--hv-warn-bg); color: var(--hv-warn); }
.hv-fresh[data-state="building"] { background: var(--hv-info-bg); color: var(--hv-info); }
.hv-fresh[data-state="building"] .hv-fresh__dot { animation: hv-pulse 1.6s var(--hv-ease) infinite; }
.hv-fresh[data-state="failed"] { background: var(--hv-bad-bg); color: var(--hv-bad); }
.hv-fresh[data-state="offline"] { background: var(--hv-bg-surface-2); color: var(--hv-text-muted); }

/* Build progress + banner */
.hv-progress {
  height: 2px; background: linear-gradient(90deg, transparent 0%, var(--hv-accent) 40%, var(--hv-orange-400) 60%, transparent 100%);
  background-size: 400px 100%; animation: hv-shimmer 1.4s linear infinite;
}
.hv-progress[hidden], .hv-banner[hidden] { display: none; }
.hv-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 28px; font: 500 12px var(--hv-font-sans);
  border-bottom: 1px solid var(--hv-border); animation: hv-fade .3s var(--hv-ease) both;
  background: var(--hv-warn-bg); color: var(--hv-warn);
}
.hv-banner[data-state="building"] { background: var(--hv-info-bg); color: var(--hv-info); }
.hv-banner[data-state="failed"] { background: var(--hv-bad-bg); color: var(--hv-bad); }
.hv-banner[data-state="offline"] { background: var(--hv-bg-surface-2); color: var(--hv-text-muted); }
.hv-banner__text { flex: 1; }
.hv-banner__btn {
  border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px;
  padding: 5px 10px; font: 600 12px var(--hv-font-sans); cursor: pointer;
}

/* Offline (PWA, shell.js): live dots stop, online-only controls (exports) dim.
   Clicks on them are blocked in shell.js, so keyboard users get the same. */
.hv-offline .hv-livedot, .hv-offline .hv-live__dot { animation: none; color: var(--hv-text-faint); }
.hv-offline [data-hv-online-only] { opacity: .5; }
.hv-offline [data-hv-online-only] button, .hv-offline button[data-hv-online-only] { cursor: not-allowed; }

/* Skip link: first Tab stop on every shell page; visible only when focused */
.hv-skip {
  position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; border-radius: 8px;
  background: var(--hv-accent); color: var(--hv-on-accent) !important; font: 600 13px var(--hv-font-sans);
  text-decoration: none !important; transform: translateY(-150%); transition: transform .15s var(--hv-ease);
}
.hv-skip:focus { transform: none; outline: 2px solid var(--hv-text); outline-offset: 2px; }
.hv-main:focus { outline: none; }

/* ── Main ─────────────────────────────────────────────────────────────── */
/* 1200px content (design v1.5); table-heavy pages keep 1440px (core/nav.WIDE_ENDPOINTS).
   Each page fades in (320 ms); `both` ends on transform:none, so fixed/sticky children
   behave normally once it has played. */
.hv-main {
  padding: 24px 28px 96px; display: flex; flex-direction: column; gap: 20px;
  max-width: 1200px; width: 100%; box-sizing: border-box; margin: 0 auto; flex: 1;
  animation: hv-page-in .32s var(--hv-ease) both;
}
.hv-main--wide { max-width: 1440px; }
/* Legacy page wrappers carried their own gutters for the old full-width layout. */
.hv-main > .container-fluid, .hv-main > .container { padding-left: 0 !important; padding-right: 0 !important; padding-top: 0 !important; max-width: none; }
.hv-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 28px 24px;
  font: 400 11px var(--hv-font-sans); color: var(--hv-text-faint); flex-wrap: wrap;
  max-width: 1200px; width: 100%; box-sizing: border-box; margin: 0 auto;
}
.hv-main--wide ~ .hv-foot { max-width: 1440px; }
.hv-foot a { color: var(--hv-text-muted) !important; }
.hv-foot__pulse { display: inline-flex; align-items: center; gap: 6px; }
.hv-foot__pulse .hv-livedot { width: 5px; height: 5px; animation: none; color: var(--hv-text-faint); }
.hv-foot__pulse[data-state="ok"] .hv-livedot { color: var(--hv-ok); }
.hv-foot__pulse[data-state="warn"] .hv-livedot { color: var(--hv-warn); }
.hv-foot__pulse[data-state="bad"] .hv-livedot { color: var(--hv-bad); }

/* ── Page header (v2) ─────────────────────────────────────────────────── */
.hv-page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  animation: hv-rise .4s var(--hv-ease) both;
}
.hv-page-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hv-h1 {
  color: var(--hv-text); font: 700 clamp(24px, 3vw, 28px)/1.1 var(--hv-font-display);
  letter-spacing: -.02em; margin: 0;
}
.hv-sub { font: 400 13px/1.5 var(--hv-font-sans); color: var(--hv-text-muted); margin: 0; }
/* margin-left:auto keeps the actions on the right when they wrap under the title,
   so a right-anchored menu (Export) never opens off-screen on a phone. */
.hv-page-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── Primitives ───────────────────────────────────────────────────────── */
.hv-card {
  background: var(--hv-bg-surface); border: 1px solid var(--hv-border); border-radius: var(--hv-radius-lg);
  box-shadow: var(--hv-shadow-sm);
}
.hv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: var(--hv-radius-md); border: 1px solid var(--hv-border); background: var(--hv-bg-surface);
  color: var(--hv-text) !important; font: 600 13px var(--hv-font-sans); cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: filter var(--hv-dur-fast) var(--hv-ease), transform var(--hv-dur-fast) var(--hv-ease);
}
.hv-btn:hover { filter: brightness(.96); border-color: var(--hv-border-strong); }
.hv-btn:active { transform: scale(.98); }
.hv-btn--primary { background: var(--hv-accent); border-color: var(--hv-accent); color: var(--hv-on-accent) !important; }
.hv-btn--primary:hover { filter: brightness(.92); border-color: var(--hv-accent); }
.hv-btn--sm { height: 34px; padding: 0 12px; font-size: 12px; }
@media (pointer: coarse), (max-width: 767.98px) { .hv-btn--sm { height: 40px; } }   /* touch target */
.hv-btn[disabled] { opacity: .5; cursor: not-allowed; }
.hv-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--hv-radius-pill);
  font: 600 10px var(--hv-font-sans); letter-spacing: .02em; white-space: nowrap;
  background: var(--hv-bg-surface-2); color: var(--hv-text-muted);
}
.hv-pill--ok { background: var(--hv-ok-bg); color: var(--hv-ok); }
.hv-pill--warn { background: var(--hv-warn-bg); color: var(--hv-warn); }
.hv-pill--bad { background: var(--hv-bad-bg); color: var(--hv-bad); }
.hv-pill--info { background: var(--hv-info-bg); color: var(--hv-info); }
.hv-pill--accent { background: var(--hv-accent-soft); color: var(--hv-accent-text); }
.hv-eyebrow { font: 600 11px var(--hv-font-sans); letter-spacing: .08em; color: var(--hv-text-faint); text-transform: uppercase; }
.hv-rise { animation: hv-rise .4s var(--hv-ease) both; }

/* ── Full-page state card (error, no access) ──────────────────────────── */
.hv-bare-main { display: block; min-height: 100vh; }
/* Signed-out state pages (error) centre themselves; the login page fills the screen. */
.hv-bare-center { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 20px; padding: 24px 16px; box-sizing: border-box; }
.hv-bare-center .hv-state { margin: 0 auto; }
.hv-state__brand { line-height: 0; }
.hv-state {
  width: min(100%, 520px); margin: 8vh auto; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 32px 28px; text-align: center; background: var(--hv-bg-surface); border: 1px solid var(--hv-border);
  border-radius: var(--hv-radius-xl); box-shadow: var(--hv-shadow-sm); animation: hv-scale-in .25s var(--hv-ease) both;
}
.hv-state__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; margin-bottom: 4px; }
.hv-state__icon--lock { background: var(--hv-bg-sunken); color: var(--hv-text-muted); }
.hv-state__icon--bad { background: var(--hv-bad-bg); color: var(--hv-bad); }
.hv-state__title { font: 700 20px/1.25 var(--hv-font-display); letter-spacing: -.01em; color: var(--hv-text); margin: 0; }
.hv-state__body { font: 400 13px/1.6 var(--hv-font-sans); color: var(--hv-text-2); margin: 0; }
.hv-state__meta { font: 400 12px/1.5 var(--hv-font-sans); color: var(--hv-text-muted); margin: 0; }
.hv-state__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ── Drawer (mobile) ──────────────────────────────────────────────────── */
.hv-overlay {
  position: fixed; inset: 0; z-index: 60; background: var(--hv-bg-overlay);
  animation: hv-fade .2s var(--hv-ease) both;
}
.hv-overlay[hidden], .hv-drawer[hidden], .hv-palette[hidden], .hv-coach[hidden] { display: none !important; }
.hv-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 61; width: min(86vw, 320px);
  background: var(--hv-bg-surface); box-shadow: var(--hv-shadow-lg); display: flex; flex-direction: column;
  padding: 14px 12px; gap: 2px; overflow-y: auto; animation: hv-slide-right .28s var(--hv-ease) both;
}
/* Both are scrolling flex columns: children keep their height instead of squashing. */
.hv-drawer > *, .hv-side > * { flex-shrink: 0; }
.hv-deptchips { scrollbar-width: none; }
.hv-deptchips::-webkit-scrollbar { display: none; }
.hv-drawer__head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.hv-drawer__head .hv-brand { padding: 0; flex: 1; }
.hv-drawer__close {
  width: 44px; height: 44px; border: 0; background: none; color: var(--hv-text); cursor: pointer; border-radius: 8px;
}
.hv-drawer__close i { font-size: 16px; }
.hv-drawer__label { font: 600 10px/1 var(--hv-font-sans); letter-spacing: .1em; color: var(--hv-text-faint); padding: 8px 12px 6px; }
.hv-deptchips { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 10px; }
.hv-deptchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: var(--hv-radius-pill); border: 1px solid var(--hv-border); background: var(--hv-bg-surface);
  color: var(--hv-text-2) !important; font: 600 12px var(--hv-font-sans); white-space: nowrap; text-decoration: none !important;
}
.hv-deptchip i { font-size: 10px; color: var(--hv-accent); }
.hv-deptchip[aria-current="true"] { background: var(--hv-accent-soft); border-color: var(--hv-accent); color: var(--hv-accent-text) !important; }
.hv-deptchip.is-locked { opacity: .6; }
.hv-drawer .hv-group__btn { min-height: 36px; }
.hv-drawer .hv-item { gap: 12px; padding: 11px 12px; min-height: 44px; }
.hv-drawer .hv-item i { width: 16px; font-size: 13px; }
.hv-drawer .hv-item[aria-current="page"]::before { top: 10px; bottom: 10px; }
.hv-drawer .hv-iconbtn { width: 44px; height: 44px; }

/* ── ⌘K palette ───────────────────────────────────────────────────────── */
.hv-palette__overlay {
  position: fixed; inset: 0; z-index: 70; background: var(--hv-bg-overlay);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: hv-fade .18s var(--hv-ease) both;
}
.hv-palette__box {
  position: fixed; z-index: 71; left: 0; right: 0; margin: 0 auto; top: 18vh; width: min(92vw, 620px);
  background: var(--hv-bg-surface); border: 1px solid var(--hv-border); border-radius: 14px;
  box-shadow: var(--hv-shadow-lg); overflow: hidden; animation: hv-scale-in .2s var(--hv-ease) both; transform-origin: top;
}
.hv-palette__input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--hv-border); }
.hv-palette__input-row i { color: var(--hv-text-muted); }
.hv-palette__input {
  flex: 1; border: 0; outline: 0; background: none; color: var(--hv-text); font: 400 15px var(--hv-font-sans); min-width: 0;
}
.hv-palette__input:focus-visible { box-shadow: none; }
.hv-palette__list { max-height: min(60vh, 420px); overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; margin: 0; list-style: none; }
.hv-palette__opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--hv-text);
  cursor: pointer; min-height: 44px;
}
.hv-palette__opt[aria-selected="true"] { background: var(--hv-accent-soft); }
.hv-palette__icon {
  width: 28px; height: 28px; border-radius: 7px; background: var(--hv-accent-soft); color: var(--hv-accent-text);
  display: grid; place-items: center; flex: none; font-size: 11px;
}
.hv-palette__opt[aria-selected="true"] .hv-palette__icon { background: var(--hv-bg-surface); }
.hv-palette__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hv-palette__label { font: 500 13px var(--hv-font-sans); }
.hv-palette__crumb { font: 400 11px var(--hv-font-sans); color: var(--hv-text-muted); }
.hv-palette__enter { display: none; }
.hv-palette__opt[aria-selected="true"] .hv-palette__enter { display: inline-block; }
.hv-palette__empty { padding: 24px; text-align: center; font: 400 13px var(--hv-font-sans); color: var(--hv-text-muted); }
.hv-palette__foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--hv-border); font: 400 11px var(--hv-font-sans); color: var(--hv-text-faint); }

/* ── Coach marks ──────────────────────────────────────────────────────── */
.hv-coach__overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15,16,23,.55); animation: hv-fade .25s var(--hv-ease) both; }
.hv-coach__card {
  position: fixed; z-index: 91; width: min(92vw, 340px); background: var(--hv-bg-surface); color: var(--hv-text);
  border: 1px solid var(--hv-border); border-radius: 14px; box-shadow: var(--hv-shadow-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 10px; animation: hv-scale-in .25s var(--hv-ease) both;
}
.hv-coach__card[data-step="1"] { top: 52px; left: calc(var(--hv-sidebar-w) + 12px); }
.hv-coach__card[data-step="2"] { top: 30vh; left: 0; right: 0; margin: 0 auto; }
.hv-coach__card[data-step="3"] { top: 64px; right: 24px; }
.hv-coach__head { display: flex; align-items: center; gap: 8px; }
.hv-coach__icon { width: 28px; height: 28px; border-radius: 8px; background: var(--hv-gradient-brand); color: #fff; display: grid; place-items: center; font-size: 12px; }
.hv-coach__step { font: 600 11px var(--hv-font-sans); letter-spacing: .08em; color: var(--hv-text-faint); }
.hv-coach__skip { margin-left: auto; border: 0; background: none; color: var(--hv-text-muted); font: 500 12px var(--hv-font-sans); cursor: pointer; }
.hv-coach__title { font: 700 16px/1.2 var(--hv-font-display); letter-spacing: -.01em; }
.hv-coach__body { font: 400 13px/1.5 var(--hv-font-sans); color: var(--hv-text-2); margin: 0; }
.hv-coach__foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.hv-coach__dot { width: 6px; height: 6px; border-radius: 3px; background: var(--hv-border-strong); transition: all .2s var(--hv-ease); }
.hv-coach__dot.is-on { width: 18px; background: var(--hv-accent); }
.hv-coach__next {
  margin-left: auto; height: 36px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--hv-accent);
  color: var(--hv-on-accent); font: 600 12px var(--hv-font-sans); cursor: pointer;
}

/* ── Toasts ───────────────────────────────────────────────────────────── */
.hv-toasts {
  position: fixed; right: 16px; bottom: 88px; z-index: 80; display: flex; flex-direction: column; gap: 8px;
  max-width: min(92vw, 360px); pointer-events: none;
}
.hv-toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--hv-bg-surface); border: 1px solid var(--hv-border); box-shadow: var(--hv-shadow-lg);
  color: var(--hv-text); font: 500 12px var(--hv-font-sans); animation: hv-slide-up .3s var(--hv-ease) both;
  pointer-events: auto; transition: opacity .3s var(--hv-ease);
}
.hv-toast.is-leaving { opacity: 0; }
.hv-toast i { color: var(--hv-info); }
.hv-toast[data-kind="ok"] i { color: var(--hv-ok); }
.hv-toast[data-kind="warn"] i { color: var(--hv-warn); }
.hv-toast[data-kind="bad"] i { color: var(--hv-bad); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@supports (padding: max(0px)) {
  .hv-top { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
  .hv-drawer { padding-left: max(12px, env(safe-area-inset-left)); }
}
@media (max-width: 1023.98px) {
  .hv-side { display: none; }
  .hv-top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hv-top__burger, .hv-top__search, .hv-top__mark { display: grid; }
  .hv-top__title { display: block; }
  .hv-crumbs { display: none; }
  .hv-banner { padding: 10px 16px; }
  .hv-main { padding: 16px 16px 96px; }
  .hv-foot { padding: 16px 16px 24px; }
  .hv-coach__card[data-step="1"] { left: 12px; top: 64px; }
  .hv-coach__card[data-step="3"] { right: 12px; }
}
@media (max-width: 1279.98px) {
  .hv-fresh { padding: 5px 9px; }
  .hv-fresh__long { display: none; }
  .hv-fresh__short { display: inline-flex; }
}
@media (max-width: 575.98px) {
  .hv-fresh { padding: 4px 8px; }
  .hv-fresh__tz { display: none; }
  .hv-palette__box { top: 8vh; }
}

/* ── Keyboard cheat sheet (shell.js openKeys; "?") ───────────────────── */
.hv-keys { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.hv-keys[hidden] { display: none; }
.hv-keys__overlay { position: absolute; inset: 0; background: var(--hv-bg-overlay); animation: hv-fade .2s var(--hv-ease) both; }
.hv-keys__box {
  position: relative; width: min(100%, 540px); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
  background: var(--hv-bg-surface); border: 1px solid var(--hv-border); border-radius: 14px; box-shadow: var(--hv-shadow-lg);
  padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 12px; animation: hv-scale-in .2s var(--hv-ease) both;
}
.hv-keys__head { display: flex; align-items: center; gap: 12px; }
.hv-keys__title { margin: 0; font: 700 16px var(--hv-font-display); color: var(--hv-text); flex: 1; }
.hv-keys__hint { font: 500 11px var(--hv-font-sans); color: var(--hv-text-muted); }
.hv-keys__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 22px; }
.hv-keys__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--hv-border); font: 400 13px var(--hv-font-sans); color: var(--hv-text-2);
}
.hv-keys__kbd {
  font: 600 11px var(--hv-font-mono); background: var(--hv-bg-sunken); border: 1px solid var(--hv-border-strong);
  border-radius: 5px; padding: 2px 7px; white-space: nowrap; color: var(--hv-text);
}

/* ── Print: shell disappears, the page body prints on its own ─────────── */
@media print {
  .hv-side, .hv-top, .hv-progress, .hv-banner, .hv-drawer, .hv-overlay, .hv-palette, .hv-toasts, .hv-coach, .hv-foot { display: none !important; }
  .hv-main { padding: 0; max-width: none; }
  body.hv-body { background: #fff; }
}
