/* ================================================
   DECISION TEAM — HELP SCREEN
   The ONLY net-new CSS this feature adds. Reuses the
   design system (dt-base/dt-components) and app shell
   (customer.css). Mirrors the Documents module menu
   (.doc-sidebar) — the sticky variant is .doc-sidebar-sticky.
   All values come from existing design tokens.
   ================================================ */

/* Widen the content column for the two-pane help layout.
   NOTE: unlike Documents, we DON'T make .dt-content overflow:hidden —
   this page is meant to scroll as one long page; the menu sticks. */
.dt-content:has(.help-page) .dt-content-inner { max-width: 1120px; }

/* ---- Two-pane shell ---- */
.help-page {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
}

.help-main { flex: 1; min-width: 0; }

/* =====================================================
   MODULE MENU — left rail (desktop), .doc-sidebar look
   .doc-sidebar-sticky: stays put while the page scrolls
   ===================================================== */
.doc-sidebar-sticky {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: var(--space-2);
  align-self: flex-start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.help-nav__header {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: var(--space-2) var(--space-3) var(--space-1);
}

.help-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.help-nav__item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.help-nav__item.active,
.help-nav__item[aria-current="true"] {
  background: var(--bg-subtle);
  border-left-color: var(--accent-500);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

.help-nav__item:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

.help-nav__num {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  width: 1.25rem;
  flex-shrink: 0;
}

.help-nav__item.active .help-nav__num,
.help-nav__item[aria-current="true"] .help-nav__num { color: var(--accent-500); }

/* ---- Page intro ---- */
.help-hero { margin-bottom: var(--space-6); }

.help-hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.help-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  margin: 0;
  max-width: 60ch;
  line-height: var(--leading-relaxed);
}

/* ---- Tour sections ---- */
.help-section {
  scroll-margin-top: var(--space-4);
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border-subtle);
}
.help-section:first-of-type { border-top: none; padding-top: var(--space-4); }

.help-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-500);
  margin-bottom: var(--space-2);
}

.help-section__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-3);
}

.help-section__lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 64ch;
  margin-bottom: var(--space-5);
}

.help-section__body {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 64ch;
  margin-top: var(--space-5);
}
.help-section__body strong { color: var(--text-primary); }

/* =====================================================
   FIGURE SYSTEM — multiple images per section, varied
   shapes/sizes. Captions only, no annotations.
   Each is a raw <figure> → swap placeholder for <img>.
   ===================================================== */
.help-figure { margin: var(--space-5) 0; }

.help-figcaption {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
  line-height: var(--leading-snug);
}

/* placeholder frame (stands in for the real screenshot) */
.help-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg,
      var(--bg-subtle), var(--bg-subtle) 10px,
      var(--bg-canvas) 10px, var(--bg-canvas) 20px);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
}
.help-shot__inner { padding: var(--space-4); }
.help-shot__label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}
.help-shot__desc { font-size: var(--text-sm); max-width: 44ch; margin: 0 auto; }

/* size / shape variants */
.help-figure--lg .help-shot   { aspect-ratio: 16 / 10; }          /* big landscape */
.help-figure--tall .help-shot { aspect-ratio: 3 / 4; }            /* full scrolled flow — full width, tall */

/* multiple images per section — all full-width, stacked */
.help-figures { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin: var(--space-5) 0; }
.help-figures .help-figure { margin: 0; }

/* ---- Closing CTA ---- */
.help-closer {
  margin-top: var(--space-10);
  padding: var(--space-6);
  text-align: center;
  background: linear-gradient(135deg, var(--advisory-50) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--advisory-100);
  border-radius: var(--radius-lg);
}
.help-closer__title { font-size: var(--text-xl); font-weight: var(--font-semibold); margin-bottom: var(--space-2); }
.help-closer__text { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-4); }

/* =====================================================
   HELP HOME (landing) — two doorways + FAQ list
   ===================================================== */
.help-home { max-width: 720px; }

.help-doors {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.help-door {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.help-door:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}

/* The featured doorway is styled identically to the plain doors — it reads as a
   standard index-row box (solid surface + border), matching the rest of the app
   rather than the mockup's gradient. */

.help-door__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--primary-600);
}
.help-door__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.75; }

.help-door__body { flex: 1; min-width: 0; }
.help-door__title { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-primary); margin: 0 0 2px; }
.help-door__desc  { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; line-height: var(--leading-snug); }

.help-door__arrow { flex-shrink: 0; color: var(--text-tertiary); }
.help-door:hover .help-door__arrow { color: var(--text-primary); }
.help-door__arrow svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---- FAQ list (native <details>, zero JS) ---- */
/* Clear separation from the doorways above (kept even if the doors' margin
   changes), matching the breathing room between tour sections. */
.help-faqs { margin-top: var(--space-10); }

.help-faqs__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.help-faq { border-bottom: 1px solid var(--border-subtle); }
.help-faq:first-of-type { border-top: 1px solid var(--border-subtle); }

.help-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
}
.help-faq__q::-webkit-details-marker { display: none; }
.help-faq__q::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: rotate(45deg);
  transition: transform var(--duration-fast) var(--ease-out);
}
.help-faq[open] .help-faq__q::after { transform: rotate(-135deg); }
.help-faq__q:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; border-radius: var(--radius-sm); }

.help-faq__a { padding: 0 0 var(--space-4); }
.help-faq__a p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-2);
  max-width: 64ch;
}

/* =====================================================
   RECIPES — index (situation-first cards)
   ===================================================== */
.help-recipe-group { margin-bottom: var(--space-8); }

.help-recipe-group__label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.help-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}

.help-recipe-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-500);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.help-recipe-card:hover {
  border-color: var(--border-default);
  border-left-color: var(--accent-500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  color: inherit;
}
.help-recipe-card__situation { font-size: var(--text-base); font-weight: var(--font-semibold); color: var(--text-primary); }
.help-recipe-card__teaser    { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-snug); }

/* =====================================================
   RECIPE detail — the playbook
   ===================================================== */
.help-recipe { max-width: 720px; }

.help-recipe__back { margin-bottom: var(--space-5); }

.help-recipe__intro {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 64ch;
  margin-bottom: var(--space-8);
}

.help-recipe__steps-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-5);
}

.help-step { display: flex; gap: var(--space-4); margin-bottom: var(--space-6); }

.help-step__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-800);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
}

.help-step__content { flex: 1; min-width: 0; }
.help-step__text {
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  margin: var(--space-1) 0 0;
}
.help-step .help-figure { margin: var(--space-4) 0 0; }

/* reserved Start action (off in v1) */
.help-recipe__start {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-8) 0;
  padding: var(--space-5) var(--space-6);
  background: var(--advisory-50);
  border: 1px solid var(--advisory-100);
  border-radius: var(--radius-lg);
}
.help-recipe__start .dt-btn { pointer-events: none; opacity: 0.65; }
.help-recipe__start-note { font-size: var(--text-sm); color: var(--text-tertiary); }

.help-recipe__related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* =====================================================
   RESPONSIVE — left rail collapses to top pills
   ===================================================== */
@media (max-width: 820px) {
  .help-page { flex-direction: column; gap: var(--space-4); }

  .doc-sidebar-sticky {
    position: sticky;
    top: 0;
    width: auto;
    max-height: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;          /* pills wrap onto multiple rows instead of overflowing off the right */
    gap: var(--space-2);
    padding: var(--space-3) 0;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 10;
  }
  .help-nav__header { display: none; }
  .help-nav__item {
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
    border-left-width: 1px;
    border-radius: var(--radius-full);
    padding: var(--space-1) var(--space-3);
  }
  .help-nav__item.active,
  .help-nav__item[aria-current="true"] {
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
  }
  .help-nav__num { display: none; }
}

/* =====================================================
   GO-DEEPER PILLS — under each section's basics. The
   doors to single-feature deep-dive how-to pages.
   A pill links only if its page exists; others = "soon".
   ===================================================== */
.help-pills { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-6); }
.help-pills__label {
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); margin-right: var(--space-1);
}
.help-pill {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: var(--font-medium);
  color: var(--text-secondary); text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.help-pill:hover { border-color: var(--accent-500); color: var(--text-primary); background: var(--bg-subtle); transform: translateY(-1px); }
.help-pill:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; }
/* not-yet-built deep-dive: visible in the design, but not a dead link */
.help-pill--soon { color: var(--text-tertiary); border-style: dashed; cursor: default; pointer-events: none; }
.help-pill--soon::after {
  content: 'soon'; margin-left: var(--space-1);
  font-size: 0.625rem; font-weight: var(--font-semibold);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary);
}

/* Real screenshot inside a help figure (replaces the dashed placeholder) */
.help-img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Theme-matched screenshots. Each shot ships a dark + light variant; both are in the
   DOM and CSS shows the one matching the active theme. _LayoutDT sets an explicit
   data-theme on <html> before paint, so these drive the swap with no flash and no JS.
   The prefers-color-scheme block is a no-script fallback only. */
.help-img--light { display: none; }
.help-img--dark  { display: block; }
@media (prefers-color-scheme: light) {
  .help-img--light { display: block; }
  .help-img--dark  { display: none; }
}
[data-theme="dark"]  .help-img--light { display: none; }
[data-theme="dark"]  .help-img--dark  { display: block; }
[data-theme="light"] .help-img--light { display: block; }
[data-theme="light"] .help-img--dark  { display: none; }

/* =====================================================
   RECIPES at scale — category quick-nav + coming-soon
   cards. The index holds ~20 now and up to ~50 over time.
   ===================================================== */
/* coming-soon recipe (visible in the index, not a dead link) */
.help-recipe-card--soon { border-left-color: var(--border-hover); cursor: default; pointer-events: none; }
.help-recipe-card--soon .help-recipe-card__situation { color: var(--text-secondary); }
.help-recipe-card__soon-tag {
  align-self: flex-start; margin-top: var(--space-2);
  font-size: 0.625rem; font-weight: var(--font-semibold);
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary);
  border: 1px dashed var(--border-hover); border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}
/* category quick-nav at the top of the index (keeps ~50 scannable) */
.help-recipe-jump { margin: var(--space-2) 0 var(--space-8); }
