/* ═══ Help & Learn: one design system for /help and its six tabs ════════════
   Used by pages/help-hub.ejs and the tab pages (quick-start, tutorials,
   help, help-article, education, help-glossary, changelog).

   Tokens: the light values are defined here on :root; dark comes from
   css/ix-deep-dark.css (injected into every page), which redefines the same
   canonical names under :root[data-theme="dark"] with the mirrored values
   (same hue and chroma, lightness only). Nothing below sets a colour outside
   these tokens, so dark is light mirrored by construction.

   Layout: full width (owner rule). Long-form reading text keeps a comfortable
   measure (.hl-measure, about 70 characters) inside the full-width page. */

:root {
  --canvas: #fbfaf8; --surface: #ffffff; --raised: #fdfcfa; --chip: #f4f1ec;
  --line: #efece6; --line-2: #e6e2da;
  --ink: #1c1a17; --ink-2: #5c5751; --muted: #6f6a62;
  --accent: #d97757; --accent-ink: #a94e2c; --accent-soft: #fbeee7; --accent-line: #f3d3c6; --on-accent: #ffffff;
  --up: #2a7350; --up-soft: #e9f2ec; --up-line: #c6ddc9;
  --blue: #3f8ed6; --blue-soft: #e8f1f9;
  --violet: #8a63e0; --violet-soft: #f1edfb;
  --gold: #8f6b33; --gold-soft: #f6efe2;
  --warn: #9a6b13; --warn-soft: #fbf3e2;
  --hl-radius: 14px;
  --hl-shadow: 0 1px 2px rgba(28, 26, 23, 0.04), 0 10px 28px -18px rgba(28, 26, 23, 0.22);
  --hl-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --hl-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --hl-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media screen {
  :root[data-theme="dark"] { --hl-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -20px rgba(0, 0, 0, 0.6); }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
.hl-body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--hl-sans); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.006em; }
.hl-body *, .hl-body *::before, .hl-body *::after { box-sizing: border-box; }
.hl-body [hidden] { display: none !important; }
.hl-body .material-symbols-outlined { font-size: 18px; line-height: 1; vertical-align: middle; }
.hl-page { width: 100%; padding: 24px 28px 64px; }
html[data-ix-embed] .hl-page { padding: 22px 26px 48px; }
.hl-measure { max-width: 70ch; }
.hl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hl-body a { color: inherit; }
.hl-link { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.hl-link:hover { text-decoration: underline; }
.hl-body :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── Section header (each tab page) ───────────────────────────────────────── */
.hl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.hl-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 6px; }
.hl-eyebrow .material-symbols-outlined { font-size: 15px; }
.hl-title { font-family: var(--hl-serif); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; margin: 0; color: var(--ink); }
.hl-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; max-width: 70ch; }
.hl-h2 { font-family: var(--hl-serif); font-weight: 600; font-size: 18px; letter-spacing: -0.012em; margin: 0 0 12px; color: var(--ink); }
.hl-h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* ── Surfaces ─────────────────────────────────────────────────────────────── */
.hl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--hl-radius); }
.hl-card.pad { padding: 18px 20px; }
.hl-card.hover { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.hl-card.hover:hover { border-color: var(--line-2); box-shadow: var(--hl-shadow); }
.hl-grid { display: grid; gap: 14px; }
.hl-grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hl-grid.cols-auto-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hl-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 1080px) { .hl-split { grid-template-columns: 1fr; } }

/* ── Buttons, chips, pills ────────────────────────────────────────────────── */
.hl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border-radius: 10px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s, color .15s; }
.hl-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.hl-btn .material-symbols-outlined { font-size: 17px; }
.hl-btn.primary { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.hl-btn.primary:hover { color: var(--on-accent); filter: brightness(1.06); }
.hl-btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.hl-btn.ghost:hover { background: var(--chip); color: var(--ink); }
.hl-btn.sm { min-height: 32px; padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.hl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.hl-chip:hover { color: var(--ink); border-color: var(--ink-2); }
.hl-chip[aria-pressed="true"], .hl-chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); font-weight: 600; }
.hl-chip .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.hl-chip.on .n, .hl-chip[aria-pressed="true"] .n { color: var(--accent-ink); }
.hl-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hl-chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hl-chips.scroll::-webkit-scrollbar { display: none; }
.hl-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.hl-pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.hl-pill.up { background: var(--up-soft); color: var(--up); border-color: var(--up-line); }
.hl-pill .material-symbols-outlined { font-size: 13px; }
.hl-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.hl-meta span { display: inline-flex; align-items: center; gap: 4px; }
.hl-meta .material-symbols-outlined { font-size: 15px; }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.hl-search { position: relative; }
.hl-search > .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; pointer-events: none; }
.hl-search input { width: 100%; min-height: 42px; padding: 9px 14px 9px 40px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.hl-search input::placeholder { color: var(--muted); }
.hl-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.hl-bar { height: 6px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.hl-bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .5s ease; }
.hl-bar.up > i { background: var(--up); }

/* ── Illustration tiles (theme-aware SVG art: shapes fill from tokens) ──── */
.hl-art { position: relative; border-radius: 12px; overflow: hidden; background: var(--chip); border: 1px solid var(--line); }
.hl-art svg { display: block; width: 100%; height: 100%; }
.hl-art .a-bg { fill: var(--surface); }
.hl-art .a-line { fill: var(--line-2); }
.hl-art .a-ink { fill: var(--ink-2); }
.hl-art .a-mute { fill: var(--line); }
.hl-art.t-accent .a-key { fill: var(--accent); } .hl-art.t-accent .a-soft { fill: var(--accent-soft); }
.hl-art.t-up .a-key { fill: var(--up); } .hl-art.t-up .a-soft { fill: var(--up-soft); }
.hl-art.t-blue .a-key { fill: var(--blue); } .hl-art.t-blue .a-soft { fill: var(--blue-soft); }
.hl-art.t-violet .a-key { fill: var(--violet); } .hl-art.t-violet .a-soft { fill: var(--violet-soft); }
.hl-art.t-gold .a-key { fill: var(--gold); } .hl-art.t-gold .a-soft { fill: var(--gold-soft); }
.hl-art .a-stroke { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hl-art.t-accent .a-stroke { stroke: var(--accent); } .hl-art.t-up .a-stroke { stroke: var(--up); } .hl-art.t-blue .a-stroke { stroke: var(--blue); }
.hl-art.t-violet .a-stroke { stroke: var(--violet); } .hl-art.t-gold .a-stroke { stroke: var(--gold); }
.hl-art .a-icon { position: absolute; right: 12px; bottom: 10px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.hl-art .a-icon .material-symbols-outlined { font-size: 19px; }

/* ── Icon badge ───────────────────────────────────────────────────────────── */
.hl-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.hl-ico .material-symbols-outlined { font-size: 20px; }
.hl-ico.up { background: var(--up-soft); color: var(--up); border-color: var(--up-line); }
.hl-ico.plain { background: var(--chip); color: var(--ink-2); border-color: var(--line); }

/* ── Empty / error ────────────────────────────────────────────────────────── */
.hl-empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line-2); border-radius: var(--hl-radius); }
.hl-empty .material-symbols-outlined { display: block; font-size: 28px; margin: 0 auto 8px; color: var(--muted); }

/* ── Long-form reading (articles, guides, lessons) ────────────────────────── */
.hl-prose { font-size: 15.5px; line-height: 1.72; color: var(--ink); max-width: 70ch; }
.hl-prose h2 { font-family: var(--hl-serif); font-size: 21px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; margin: 32px 0 10px; }
.hl-prose h3 { font-size: 16px; font-weight: 650; margin: 24px 0 8px; }
.hl-prose p { margin: 0 0 14px; color: var(--ink); }
.hl-prose ul, .hl-prose ol { margin: 0 0 16px; padding-left: 22px; }
.hl-prose li { margin: 4px 0; }
.hl-prose strong { font-weight: 650; }
.hl-prose code { font-family: var(--hl-mono); font-size: 0.88em; background: var(--chip); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.hl-prose a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hl-prose blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink); }
.hl-prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 0 0 16px; }
.hl-prose th, .hl-prose td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.hl-prose th { font-weight: 650; color: var(--ink-2); }

@media (max-width: 700px) {
  .hl-page { padding: 16px 16px 48px; }
  html[data-ix-embed] .hl-page { padding: 14px 16px 40px; }
  .hl-title { font-size: 22px; }
  .hl-prose { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .hl-body *, .hl-body *::before, .hl-body *::after { transition: none !important; animation: none !important; }
}
.hl-body [tabindex="-1"]:focus { outline: none; }
