/* InsightHub help — design aligned with the new sg5.biz site (dark navy, teal accent,
   Montserrat + Roboto self-hosted from ../fonts/). Content sections keep their ids. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #7fcbad; --primary-dark: #5fb596; --text: #ffffff; --text-muted: #aeaacb;
  --bg: #111821; --bg-alt: #161e2a; --bg-card: #1b2330; --border: rgba(255,255,255,0.1); --border-strong: rgba(255,255,255,0.18);
  --radius: 12px; --wrap: 1200px;
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal, .totop { transition: none !important; } }
body { font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .btn, .brand-title, .toc h2, .eyebrow { font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--primary); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--primary); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 700; z-index: 100; }
.skip:focus { left: 0.5rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(17,24,33,0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.hdr-inner { max-width: var(--wrap); margin: 0 auto; padding: 0.7rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--border-strong); }
.brand-title { font-weight: 600; font-size: 0.98rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand-title b { color: var(--primary); font-weight: 800; }
.hdr-nav { display: flex; align-items: center; gap: 0.35rem; }
.hdr-nav > a:not(.btn) { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 0.4rem 0.7rem; border-radius: 6px; }
.hdr-nav > a:not(.btn):hover { color: var(--text); background: var(--border); }
.lang-switch { display: flex; gap: 0.15rem; margin: 0 0.35rem; padding: 0.15rem; border: 1px solid var(--border); border-radius: 999px; }
.lang-switch a { color: var(--text-muted); text-decoration: none; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.lang-switch a.active { color: var(--bg); background: var(--primary); }
.lang-switch a:not(.active):hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.05rem; border-radius: 999px; font-weight: 700; font-size: 0.88rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Hero with search */
.help-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: radial-gradient(circle at 15% 20%, rgba(127,203,173,0.16), transparent 45%), var(--bg); }
.help-hero .gridlines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent); pointer-events: none; }
.help-hero .wrap { position: relative; padding-top: 3.2rem; padding-bottom: 2.6rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--primary); }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--primary); border-radius: 2px; }
.help-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0.8rem 0 0.7rem; font-weight: 800; }
.help-hero h1 .hl { color: var(--primary); }
.help-hero .lead { color: var(--text-muted); font-size: 1.06rem; max-width: 62ch; }
.help-search { margin-top: 1.5rem; max-width: 528px; position: relative; } /* ≈ the visible text edge of the lead’s first line */
.help-search .field { position: relative; }
.help-search input { width: 100%; padding: 0.95rem 1.1rem 0.95rem 3rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font: inherit; font-size: 1rem; box-shadow: 0 20px 50px -30px rgba(0,0,0,0.8); }
.help-search input::placeholder { color: var(--text-muted); }
.help-search input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(127,203,173,0.2); }
.help-search svg { position: absolute; left: 1.05rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.help-search .hint { display: block; margin: 0.55rem 0 0 1.1rem; font-size: 0.78rem; color: var(--text-muted); min-height: 1.2em; }
.help-search .hint b { color: var(--primary); }

/* Layout */
.layout { max-width: var(--wrap); margin: 2.25rem auto 4rem; padding: 0 1.5rem; display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 2.75rem; align-items: start; }
.toc { position: sticky; top: 4.6rem; max-height: calc(100vh - 5.4rem); overflow-y: auto; padding: 1rem 0.5rem 1rem 0; scrollbar-width: thin; }
.toc h2 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin: 0 0 0.75rem 0.85rem; font-weight: 700; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc li.is-hidden { display: none; }
.toc a { display: block; color: var(--text-muted); text-decoration: none; padding: 0.38rem 0.85rem; margin-left: -1px; border-left: 2px solid transparent; font-size: 0.9rem; line-height: 1.35; border-radius: 0 6px 6px 0; }
.toc a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.toc a.active { color: var(--primary); border-left-color: var(--primary); background: rgba(127,203,173,0.06); font-weight: 600; }
.toc .toc-empty { color: var(--text-muted); font-size: 0.85rem; padding: 0.5rem 0.85rem; display: none; }
.toc.is-filtered .toc-empty.show { display: block; }

.toc-mobile { display: none; margin-bottom: 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1.1rem; }
.toc-mobile summary { cursor: pointer; font-weight: 700; color: var(--text); font-family: "Montserrat", sans-serif; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; color: var(--primary); font-size: 1.2rem; }
.toc-mobile[open] summary::after { content: "–"; }
.toc-mobile ul { list-style: none; margin: 0.75rem 0 0; padding: 0; columns: 2; column-gap: 1.5rem; }
.toc-mobile li.is-hidden { display: none; }
.toc-mobile a { display: block; color: var(--text-muted); text-decoration: none; padding: 0.3rem 0; font-size: 0.9rem; }
.toc-mobile a:hover { color: var(--text); }

/* Content */
.content { max-width: 800px; min-width: 0; }
.content section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem 2rem 1.9rem; margin-bottom: 1.35rem; scroll-margin-top: 5.2rem; }
.content section.is-hidden { display: none; }
.content section h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 0.9rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.7rem; }
.content section h2::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--primary); flex: 0 0 auto; box-shadow: 0 0 0 4px rgba(127,203,173,0.15); }
.content section h3 { font-size: 1.02rem; font-weight: 700; color: var(--text); margin: 1.5rem 0 0.5rem; scroll-margin-top: 5.2rem; }
.content section p { color: var(--text-muted); margin-bottom: 1rem; }
.content section ul, .content section ol { color: var(--text-muted); margin: 0 0 1rem 1.25rem; }
.content section li { margin-bottom: 0.4rem; }
.content section li::marker { color: var(--primary); }
.content section strong { color: var(--text); font-weight: 600; }
.content section a { color: var(--primary); text-decoration: none; border-bottom: 1px solid rgba(127,203,173,0.35); }
.content section a:hover { border-bottom-color: var(--primary); }
.content section code { background: var(--bg); border: 1px solid var(--border); padding: 0.1rem 0.45rem; border-radius: 5px; font-size: 0.85em; color: var(--primary); }
.content section pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.95rem 1.1rem; overflow-x: auto; max-width: 100%; margin-bottom: 1rem; }
.content section pre code { background: none; border: 0; padding: 0; font-size: 0.82em; color: inherit; white-space: pre; }
.content section table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-bottom: 1rem; display: block; overflow-x: auto; }
.content section th, .content section td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.content section th { color: var(--text); font-weight: 600; }
.content section figure { margin: 1.4rem 0; }
.content section figure img { max-width: 100%; height: auto; display: block; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); box-shadow: 0 30px 60px -40px rgba(0,0,0,0.9); }
.content section figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.faq-item { border-top: 1px solid var(--border); padding: 1.1rem 0; }
.faq-item:last-child { padding-bottom: 0; }
.faq-item h3 { margin-top: 0; }
.faq-item p:last-child { margin-bottom: 0; }
.content .back { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 1.5rem; padding: 0.6rem 1.1rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-weight: 700; font-family: "Montserrat", sans-serif; font-size: 0.9rem; }
.content .back:hover { border-color: var(--primary); color: var(--primary); }

/* Footer + back-to-top */
.help-footer { border-top: 1px solid var(--border); padding: 1.6rem 0 2.2rem; color: var(--text-muted); font-size: 0.85rem; }
.help-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem 1.5rem; }
.help-footer nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.help-footer a { color: var(--text-muted); text-decoration: none; }
.help-footer a:hover { color: var(--text); }
.totop { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); display: grid; place-items: center; text-decoration: none; font-weight: 700; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 40; }
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; margin-top: 1.5rem; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .content section { padding: 1.3rem 1.2rem 1.4rem; }
  .brand-title { display: none; } .brand-sep { display: none; }
  .hdr-nav > a:not(.btn):not(.lang-switch a) { display: none; }
}
@media (max-width: 560px) { .toc-mobile ul { columns: 1; } .hdr-nav .btn { padding: 0.5rem 0.8rem; } }

/* Small screens: code blocks scroll inside their box, inline code wraps (2026-09-07) */
.content section pre { overflow-x: auto; max-width: 100%; }
.content code { overflow-wrap: anywhere; }
