/* ==========================================================================
   lighter — documentation pages (help/*). Loaded AFTER style.css.
   Adds the docs shell (left guide sidebar + content) + doc-prose components.
   Reuses tokens, buttons, callouts, cards, defs from style.css.
   ========================================================================== */

/* -------- Docs shell --------------------------------------------------- */
.docs {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  width: min(1220px, 94vw);
  margin-inline: auto;
  padding-block: 32px 80px;
  align-items: start;
}

/* -------- Guide sidebar ------------------------------------------------ */
.guide {
  position: sticky; top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto; overscroll-behavior: contain;
  padding-right: 8px;
}
.guide-group { margin-bottom: 20px; }
.guide-group h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); font-weight: 800; padding: 0 12px; margin-bottom: 6px;
}
.guide a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px; font-size: 14.5px; font-weight: 600;
  color: var(--muted); transition: color 0.15s, background 0.15s;
}
.guide a:hover { color: var(--text); background: var(--surface-2); }
.guide a.is-active { color: var(--accent-strong); background: var(--accent-soft); font-weight: 720; }
.guide a svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }

/* -------- Doc content -------------------------------------------------- */
.doc { min-width: 0; max-width: 820px; }
.doc-crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.doc-crumb a:hover { color: var(--accent-strong); }
.doc-hero { margin-bottom: 8px; }
.doc-hero .eyebrow { margin-bottom: 14px; }
.doc h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 850; }
.doc .lead { margin-top: 16px; font-size: clamp(17px, 1.7vw, 20px); color: var(--muted); line-height: 1.55; }

.doc h2 {
  font-size: clamp(21px, 2.4vw, 28px); font-weight: 800; margin-top: 48px; padding-top: 8px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.doc h2 + p, .doc h3 + p { margin-top: 10px; }
.doc h3 { font-size: 18.5px; font-weight: 760; margin-top: 30px; scroll-margin-top: calc(var(--header-h) + 16px); }
.doc p { margin-top: 14px; color: var(--text); }
.doc p.muted { color: var(--muted); }
.doc a.link { color: var(--accent-strong); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.doc a.link:hover { text-decoration-color: var(--accent); }
.doc ul, .doc ol { margin-top: 14px; padding-left: 22px; color: var(--text); }
.doc li { margin-top: 7px; }
.doc ul.plain { list-style: none; padding-left: 0; }
.doc strong { font-weight: 720; }
.doc code, .kbd {
  font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); color: var(--code-text);
  padding: 1.5px 6px; border-radius: 6px; border: 1px solid var(--hairline);
}
.doc hr { border: none; border-top: 1px solid var(--hairline); margin: 40px 0; }

/* -------- Numbered steps ----------------------------------------------- */
.steps { list-style: none; counter-reset: step; padding-left: 0; margin-top: 20px; display: grid; gap: 14px; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 16px 18px 16px 58px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.steps > li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 820; font-size: 15px;
  background: var(--accent-grad); color: var(--on-accent); box-shadow: 0 3px 10px var(--glow-1);
}
.steps > li > strong:first-child { display: block; font-weight: 760; margin-bottom: 2px; }
.steps ul, .steps ol { margin-top: 8px; }

/* -------- Figure / screenshot ------------------------------------------ */
.figure { margin: 24px 0; }
.figure .media { width: 100%; }
.figure figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.figure figcaption b { color: var(--text); font-weight: 700; }
.figure--art .media { max-width: 340px; margin-inline: auto; }

/* -------- Tables ------------------------------------------------------- */
.doc .table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.doc thead th { background: var(--surface-2); font-weight: 720; white-space: nowrap; }
.doc tbody tr:last-child td { border-bottom: none; }
.doc tbody tr:hover { background: var(--surface-2); }

/* Status pill helpers (docs) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 720; }
.pill--new { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent-strong); }
.pill--hold { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); color: var(--warning); }
.pill--approve { background: color-mix(in srgb, var(--success) 20%, var(--surface)); color: var(--success); }
.pill--cancel { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); }
.pill--trash { background: var(--surface-3); color: var(--muted); }

/* -------- Mini glossary card ------------------------------------------- */
.glosscard { background: var(--surface); border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--radius); padding: 22px 24px; margin: 24px 0; }
.glosscard h3 { font-size: 17px; margin-bottom: 10px; }

/* -------- Prev / next + back ------------------------------------------- */
.doc-nav { display: flex; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.doc-nav a { flex: 1; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.15s; }
.doc-nav a:hover { border-color: var(--accent); }
.doc-nav .dir { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.doc-nav .ttl { font-weight: 740; margin-top: 3px; color: var(--text); }
.doc-nav .next { text-align: right; }

/* -------- Mobile guide toggle ------------------------------------------ */
.guide-toggle { display: none; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
  .guide-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); font-weight: 700; margin-bottom: 8px;
  }
  .guide-toggle::after { content: "▾"; margin-left: auto; color: var(--muted); }
  .guide {
    position: static; max-height: none; overflow: visible; display: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; margin-bottom: 14px;
  }
  .guide.open { display: block; }
  .doc { max-width: none; }
}
