/* ─────────────────────────────────────────────────────────────────────────────
   guide.css - v65 per-feature walkthroughs: dim + spotlight ring + step card.
   v5.0.0: the Guide hub (a <dialog> of guide cards, quick tour pinned on top),
   a progress bar on the step card, and the "you finished" card. Design-system
   tokens first, the v4 tokens as fallbacks, so it reads right with the dsLook
   flag on or off.
   Sits above everything (drawer 1200, sidebar 1300, toasts 2200 → guide 6000);
   the hub is a modal <dialog>, so it lives in the top layer.
   ───────────────────────────────────────────────────────────────────────────── */

.hg-dim {
  position: fixed; inset: 0; z-index: 6000;
  background: transparent;   /* the ring's giant box-shadow does the dimming */
}
.hg-ring {
  position: fixed; z-index: 6001; pointer-events: none;
  border: 2px solid var(--bg-brand-primary, var(--gold)); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(17, 22, 34, .48), 0 0 0 5px rgba(252, 210, 59, .28);
  transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease;
}
.hg-card {
  position: fixed; z-index: 6002; display: none; box-sizing: border-box;
  background: var(--bg-neutral-primary, var(--panel)); color: var(--text-neutral-primary, var(--text));
  border: 1px solid var(--border-neutral-primary, var(--line)); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(10, 14, 24, .35);
  padding: 14px 16px 12px; font-family: var(--font-body, var(--font-sans, system-ui));
}
.hg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hg-kicker {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--text-neutral-tertiary, var(--text-dim));
}
.hg-count {
  flex: none; font-size: 11.5px; font-variant-numeric: tabular-nums;
  color: var(--text-neutral-tertiary, var(--text-dim));
}
.hg-x {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  color: var(--text-neutral-tertiary, var(--text-dim)); font-size: 14px; line-height: 1; padding: 0;
}
.hg-x:hover { color: var(--text-neutral-primary, var(--text)); background: var(--bg-neutral-secondary, var(--panel-2)); }
.hg-progress {
  height: 3px; border-radius: 99px; overflow: hidden; margin-bottom: 11px;
  background: var(--bg-neutral-tertiary, var(--line));
}
.hg-progress i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--bg-brand-primary, var(--gold)); transition: width .25s ease;
}
.hg-title {
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.35; margin-bottom: 5px;
}
.hg-text { font-size: 13px; line-height: 1.55; color: var(--text-neutral-primary, var(--text)); }
.hg-text i { color: var(--text-neutral-secondary, var(--text-dim)); }
.hg-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.hg-link {
  flex: 1; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--text-neutral-secondary, var(--text-dim));
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
.hg-link:hover { color: var(--text-neutral-primary, var(--text)); text-decoration-color: currentColor; }
.hg-btns { display: inline-flex; gap: 8px; flex: none; }
.hg-keys {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border-neutral-secondary, var(--line));
  font-size: 11px; color: var(--text-neutral-tertiary, var(--text-dim));
}
/* v4 fallback buttons (only when ds.js is missing) */
.hg-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 13px; font-family: inherit;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.hg-btn:hover { border-color: var(--gold-deep); }
.hg-btn.primary { background: var(--gold); border-color: var(--gold-deep); color: #1c2433; font-weight: 600; }

/* "you finished" card: centered on a scrim, offers the next guide */
.hg-donewrap {
  position: fixed; inset: 0; z-index: 6000; display: grid; place-items: center; padding: 16px;
  background: rgba(17, 22, 34, .48);
}
.hg-card.hg-donecard { position: relative; display: block; width: min(380px, calc(100vw - 32px)); }
.hg-done-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; margin-bottom: 10px;
  background: var(--bg-success-subtle, rgba(46, 160, 67, .14)); color: var(--text-success-primary, #2e7d32);
  font-size: 22px;
}

/* shellbar Guide button */
.guide-btn { display: inline-flex; align-items: center; }
.guide-btn .guide-ic { width: 14px; height: 14px; margin-right: 6px; }

/* ── the Guide hub ─────────────────────────────────────────────────────────── */
.gh {
  box-sizing: border-box; width: min(880px, calc(100vw - 32px)); max-height: min(88vh, 900px);
  padding: 0; overflow: hidden;
  border: 1px solid var(--border-neutral-primary, var(--line)); border-radius: 16px;
  background: var(--bg-neutral-primary, var(--panel)); color: var(--text-neutral-primary, var(--text));
  box-shadow: var(--shadow-xl, 0 24px 60px rgba(10, 14, 24, .35));
  font-family: var(--font-body, var(--font-sans, system-ui));
}
.gh[open] { display: flex; flex-direction: column; }
.gh::backdrop { background: rgba(17, 22, 34, .5); }
.gh-in { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.gh-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-neutral-secondary, var(--line));
}
.gh-head-ic {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-brand-tertiary, var(--gold-dim)); color: var(--text-neutral-primary, var(--text)); font-size: 19px;
}
.gh-head-txt { flex: 1; min-width: 0; }
.gh-title { margin: 1px 0 0; font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: 0; text-transform: none; }
.gh-sub { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-neutral-secondary, var(--text-dim)); }
.gh-x {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  background: none; border: 0; border-radius: 8px; cursor: pointer; font-size: 16px;
  color: var(--text-neutral-tertiary, var(--text-dim));
}
.gh-x:hover { color: var(--text-neutral-primary, var(--text)); background: var(--bg-neutral-secondary, var(--panel-2)); }
.gh-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 4px; }

.gh-hero, .gh-card {
  display: flex; gap: 14px; width: 100%; box-sizing: border-box; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.gh-hero:focus-visible, .gh-card:focus-visible { outline: 2px solid var(--bg-brand-primary, var(--gold)); outline-offset: 2px; }
.gh-hero {
  align-items: center; padding: 16px; margin-bottom: 20px; border-radius: 14px;
  border: 1px solid var(--border-brand-primary, var(--gold-deep));
  background: var(--bg-brand-tertiary, var(--gold-dim));
}
.gh-hero:hover { box-shadow: var(--shadow-md, 0 6px 18px rgba(10, 14, 24, .14)); }
.gh-hero-ic {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--bg-brand-primary, var(--gold)); color: var(--text-on-brand, #1c2433); font-size: 23px;
}
.gh-kick { font-size: 11.5px; font-weight: 600; color: var(--text-neutral-secondary, var(--text-dim)); }
.gh-hero-name { font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.gh-cta {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 8px;
  background: var(--bg-brand-primary, var(--gold)); color: var(--text-on-brand, #1c2433);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.gh-cta .hm-svg-icon { font-size: 14px; }

.gh-group { margin-bottom: 18px; }
.gh-gtitle {
  margin: 0 0 8px; font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--text-neutral-tertiary, var(--text-dim));
}
.gh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gh-card {
  align-items: flex-start; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border-neutral-primary, var(--line));
  background: var(--bg-neutral-primary, var(--panel));
}
.gh-card:hover { background: var(--bg-neutral-secondary, var(--panel-2)); }
.gh-card.is-here { border-color: var(--text-info-primary, var(--followup)); }
.gh-ic {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--bg-neutral-secondary, var(--panel-2)); color: var(--text-neutral-secondary, var(--text)); font-size: 17px;
}
.gh-card:hover .gh-ic { background: var(--bg-neutral-primary, var(--panel)); }
.gh-txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.gh-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.gh-blurb { font-size: 12.5px; line-height: 1.45; color: var(--text-neutral-secondary, var(--text-dim)); }
.gh-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px;
  font-size: 11.5px; color: var(--text-neutral-tertiary, var(--text-dim));
}
.gh-tags { display: inline-flex; gap: 4px; }
.gh-tag {
  display: inline-block; padding: 1px 6px; border-radius: 99px; font-size: 10.5px;
  border: 1px solid var(--line); color: var(--text);
}
.gh-go { flex: none; align-self: center; font-size: 16px; color: var(--text-neutral-tertiary, var(--text-dim)); }
.gh-card:hover .gh-go { color: var(--text-neutral-primary, var(--text)); }

.gh-foot {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px 16px;
  border-top: 1px solid var(--border-neutral-secondary, var(--line));
  font-size: 12.5px; color: var(--text-neutral-secondary, var(--text-dim));
}
.gh-tip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.gh-tip .hm-svg-icon { flex: none; font-size: 15px; }
.gh-foot .gh-count { flex: none; font-variant-numeric: tabular-nums; color: var(--text-neutral-tertiary, var(--text-dim)); }

@media (max-width: 640px) {
  .gh { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .gh-head { padding: 14px 14px 12px; }
  .gh-body { padding: 12px 14px 2px; }
  .gh-hero { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .gh-hero .gh-txt { flex-basis: calc(100% - 60px); }
  .gh-cta { width: 100%; justify-content: center; }
  .gh-grid { grid-template-columns: 1fr; }
  .gh-foot { padding: 10px 14px 14px; flex-wrap: wrap; }
  .hg-keys { display: none; }   /* no arrow keys on a phone */
}
