/* =========================================================================
   WITHE HELP — layout & article styles
   Tokens (colours, radii, type) come from ../shared/style.css so the help
   site tracks the app's branding automatically. Only help-specific layout
   lives here.
   ========================================================================= */

html { scroll-behavior: smooth; }
body { min-height: 100vh; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Shell: ink sidebar + stage (same fork as the app, 880px) ---- */
.h-shell { display: flex; min-height: 100vh; }

.h-side {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 264px;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.h-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 16px;
  color: inherit;
}
.h-brand:hover { text-decoration: none; }
.h-brand img { width: 38px; height: 20px; display: block; flex-shrink: 0; }
.h-brand .name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.h-brand .sub  { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.4); letter-spacing: .04em; text-transform: uppercase; }

.h-search {
  margin: 0 14px 10px;
  position: relative;
}
.h-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: var(--r-control);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.07);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
}
.h-search input::placeholder { color: rgba(255,255,255,.4); }
.h-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: rgba(255,255,255,.1); }
.h-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: rgba(255,255,255,.45); pointer-events: none; }

.h-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.h-nav::-webkit-scrollbar { width: 6px; }
.h-nav::-webkit-scrollbar-track { background: transparent; }
.h-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border: none; }

.h-nav-home {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; margin-bottom: 6px;
  border: none; border-radius: 12px; background: transparent;
  color: #9BA3AF; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.h-nav-home:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.h-nav-home.is-active { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.h-nav-home svg { width: 18px; height: 18px; }
.h-nav-home.is-active svg { color: #4DA3E8; }

.h-nav-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.38);
  padding: 14px 12px 6px;
}
.h-nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: #C3C8D1;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}
.h-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.h-nav-item.is-active { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; }
.h-nav-empty { padding: 12px; color: rgba(255,255,255,.45); font-size: 13px; }

.h-side-foot {
  padding: 14px 20px;
  font-size: 11.5px;
  color: rgba(255,255,255,.35);
  line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,.07);
}
.h-side-app {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.2;
}
.h-side-app:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.h-side-app svg { width: 16px; height: 16px; flex-shrink: 0; color: #4DA3E8; }
.h-side-app small { display: block; font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,.45); margin-top: 2px; }

.h-top-app { flex-shrink: 0; text-decoration: none; }
.h-top-app:hover { text-decoration: none; }

/* ---------- Stage ---------- */
.h-stage { margin-left: 264px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.h-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 28px;
  background: var(--frost-canvas);
  backdrop-filter: var(--frost-blur);
  -webkit-backdrop-filter: var(--frost-blur);
}
.h-top-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.h-top .w-tabs { padding: 0; }
.h-menu-btn { display: none; }

.h-main { flex: 1; padding: 26px 32px 60px; }
.h-foot { padding: 0 32px 28px; font-size: 11px; line-height: 1.4; color: var(--ink-muted); text-align: center; }
.h-inner { max-width: 760px; }

/* ---------- Role pills (reuse the app's white-selected pill) ---------- */
.h-roles { display: flex; align-items: center; gap: 10px; }

/* ---------- Home ---------- */
.h-hero { margin-bottom: 26px; }
.h-hero .w-page-eyebrow { margin-bottom: 4px; }
.h-hero p { font-size: 15px; line-height: 1.55; color: var(--ink-muted); margin: 10px 0 0; max-width: 60ch; }

.h-roleswitch {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 18px 0 30px;
}
.h-rolecard {
  display: block;
  padding: 14px 14px 12px;
  border-radius: var(--r-card);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-micro);
  color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.h-rolecard:hover { border-color: var(--hairline-firm); text-decoration: none; }
.h-rolecard:active { transform: scale(.99); }
.h-rolecard.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-micro); }
.h-rolecard .t { font-size: 15px; font-weight: 700; }
.h-rolecard .d { font-size: 12.5px; line-height: 1.45; color: var(--ink-muted); margin-top: 4px; }
.h-rolecard .k { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--accent-strong); }

.h-sec-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin: 26px 0 10px; }
.h-sec-title:first-of-type { margin-top: 0; }

.h-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.h-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-micro);
  color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.h-card:hover { border-color: var(--hairline-firm); text-decoration: none; }
.h-card:active { transform: scale(.99); }
.h-card .w-heading { white-space: normal; }
.h-card .w-meta { font-size: 13px; }
.h-card .h-card-sec { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-strong); }

/* ---------- Article ---------- */
.h-article-head { margin-bottom: 8px; }
.h-article-head .w-page-title { margin-bottom: 8px; }
.h-summary { font-size: 15.5px; line-height: 1.5; color: var(--ink-muted); margin: 0 0 12px; max-width: 62ch; }
.h-for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; }
.h-for .lbl { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-right: 2px; }

.h-figure { margin: 0 0 22px; }
.h-figure img { display: block; width: 100%; border-radius: var(--r-card); border: 1px solid var(--hairline-firm); box-shadow: var(--shadow-lift); }
.h-figure figcaption { font-size: 12.5px; color: var(--ink-muted); margin-top: 8px; }
/* Phone captures are tall and narrow: show them at phone width, not page width */
.h-figure.is-phone { display: flex; flex-direction: column; align-items: center; }
.h-figure.is-phone img { width: 100%; max-width: 330px; border-radius: 26px; border: 6px solid var(--primary); }
/* An inline figure inside a guide body, e.g. <figure class="h-figure is-phone"> */
.h-body .h-figure { margin: 6px 0 22px; }
.h-body .h-figure img { box-shadow: var(--shadow-micro); }

.h-body { font-size: 15px; line-height: 1.6; color: var(--ink); }
.h-body > :first-child { margin-top: 0; }
.h-body p { margin: 0 0 14px; }
.h-body h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 10px; }
.h-body ul { padding-left: 20px; margin: 0 0 14px; }
.h-body li { margin-bottom: 6px; }
.h-body li::marker { color: var(--ink-faint); }
.h-body em { font-style: normal; font-weight: 600; }

.h-path {
  display: inline-block;
  font-size: 12.5px; font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-wash);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.h-ui {
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--hairline-firm);
  box-shadow: var(--shadow-micro);
  white-space: nowrap;
  font-size: .93em;
}

.h-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 18px; }
.h-steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 54px;
  margin: 0 0 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-micro);
}
.h-steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 11px;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}

.h-tip, .h-note {
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  position: relative;
}
.h-tip::before, .h-note::before {
  position: absolute; left: 14px; top: 12px;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.h-tip  { background: var(--good-wash); color: #14532D; }
.h-tip::before  { content: "✓"; background: var(--good); color: #fff; }
.h-note { background: var(--warn-wash); color: #7C2D12; }
.h-note::before { content: "!"; background: var(--warn); color: #fff; }

.h-table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--hairline-firm); }
.h-table th, .h-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.h-table th { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-sunk); }
.h-table tr:last-child td { border-bottom: none; }
.h-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.h-table-wrap .h-table { margin: 0; min-width: 520px; }
.h-table-roles td:not(:first-child) { text-align: center; white-space: nowrap; }

.h-whatsnew { list-style: none; padding: 0; margin: 0; }
.h-whatsnew li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline-firm); }
.h-whatsnew li:last-child { border-bottom: none; }
.h-whatsnew .d { flex-shrink: 0; width: 82px; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.h-whatsnew .t { font-size: 14.5px; line-height: 1.5; }

.h-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--hairline-firm); }
.h-pager a {
  flex: 1; max-width: 48%;
  padding: 12px 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--hairline-firm);
  background: var(--surface);
  color: var(--ink);
}
.h-pager a:hover { background: var(--surface-sunk); text-decoration: none; }
.h-pager a.next { text-align: right; margin-left: auto; }
.h-pager .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); }
.h-pager .t { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; }

.h-notfound { padding: 40px 0; color: var(--ink-muted); }

/* Search results */
.h-results .h-card mark { background: var(--accent-wash); color: var(--accent-strong); border-radius: 3px; padding: 0 1px; }

/* ---------- Mobile fork ---------- */
.h-backdrop { display: none; }

@media (max-width: 880px) {
  /* style.css makes the app's .w-stage the scroller on phones and locks
     html/body. The help site has no .w-stage, so give the scroll back. */
  html, body { height: auto; overflow: visible; }
  body.nav-open { overflow: hidden; }

  .h-side {
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2,.7,.3,1);
    width: min(84vw, 320px);
    box-shadow: var(--shadow-lift);
  }
  body.nav-open .h-side { transform: none; }
  .h-backdrop { display: block; position: fixed; inset: 0; z-index: 95; background: rgba(15,23,42,.4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .h-backdrop { opacity: 1; pointer-events: auto; }

  .h-stage { margin-left: 0; }
  .h-top { padding: 10px 14px; gap: 8px; }
  .h-top-label { display: none; }
  .h-top .w-tabs { flex: 1; min-width: 0; }
  .h-menu-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: var(--r-control);
    border: 1px solid var(--hairline-firm);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }
  .h-menu-btn svg { width: 20px; height: 20px; }

  .h-top-app { width: 38px; padding: 0; height: 38px; }
  .h-top-app-lbl { display: none; }

  .h-main { padding: 18px 14px 48px; }
  .h-foot { padding: 0 14px 22px; }
  .w-page-title { font-size: 30px; }
  .h-roleswitch { grid-template-columns: 1fr 1fr; }
  .h-cards { grid-template-columns: 1fr; }
  .h-body { font-size: 15.5px; }
  .h-pager { flex-direction: column; }
  .h-pager a { max-width: none; }
  .h-pager a.next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .h-side, .h-backdrop, .h-card, .h-rolecard { transition: none; }
}

@media print {
  .h-side, .h-top, .h-pager, .h-backdrop, .h-foot { display: none !important; }
  .h-stage { margin: 0; }
  .h-main { padding: 0; }
  body { background: #fff; }
}
