/* dev-doc Help Center — shared stylesheet. Static pages, no build step. */
/* Dark only, and the SAME tokens as the app (frontend/tailwind.config.js). The default is
   the classic theme (original slate-blue tokens, system font); `data-theme="brand"`
   (Settings → Appearance, read by help.js from the same storage key) switches to the
   dev-doc.io look: charcoal surfaces, softened ink, one soft cyan accent. */
:root {
  color-scheme: dark;
  --bg: #0f1522;
  --bg-elev: #172033;
  --bg-elev-2: #1e293b;
  --border: #2b3850;
  --text: #e5e9f0;
  --text-muted: #9aa6b8;
  --heading: #ffffff;
  --accent: #3b82f6;
  --on-accent: #ffffff;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --good: #10b981;
  --good-soft: rgba(16, 185, 129, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --marker: #facc15;
  --marker-text: #111827;
  --code-bg: #0b1220;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --header-h: 60px;
}
/* A filled accent surface carries --on-accent (dark) text in brand: white on cyan is ~2.4:1. */
:root[data-theme="brand"] {
  --bg: #1a1a1a;
  --bg-elev: #242424;
  --bg-elev-2: #2b2b2b;
  --border: #333333;
  --text: #d0d5dc;
  --text-muted: #959ea9;
  --heading: #e3e7ec;
  --accent: #3cb4dc;
  --on-accent: #141414;
  --accent-soft: rgba(60, 180, 220, 0.12);
  --marker-text: #1a1a1a;
  --code-bg: #141414;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="brand"] body { font-family: "Jura", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
input, button, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand { font-family: "Jura", system-ui, sans-serif; color: var(--heading); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; margin: 2.4rem 0 0.8rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.12rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin: 0.25rem 0; }
code, kbd { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 0.05rem 0.35rem; }
.ui { font-weight: 600; color: var(--heading); background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 0.4rem; white-space: nowrap; }

/* ── Header ───────────────────────────────────────────── */
.help-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.help-header .brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; color: var(--heading); white-space: nowrap; }
.help-header .brand:hover { text-decoration: none; }
.help-header .brand img { height: 28px; width: auto; }
.help-header .brand span { color: var(--text-muted); font-weight: 500; }
.help-header .spacer { flex: 1; }
.help-header .back-to-app { font-size: 0.9rem; white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 1rem; }

/* ── Search ───────────────────────────────────────────── */
.search { position: relative; width: min(440px, 100%); }
.search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7b0bc' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 70vh; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; z-index: 40;
}
.search-results[hidden] { display: none; }
.result { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.result:hover, .result.active { background: var(--accent-soft); text-decoration: none; }
.result .r-title { font-weight: 600; color: var(--heading); }
.result .r-where { font-size: 0.8rem; color: var(--text-muted); }
.result .r-snippet { font-size: 0.86rem; color: var(--text-muted); margin-top: 2px; }
.result mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.no-results { padding: 12px; color: var(--text-muted); font-size: 0.92rem; }
.search-hero { margin: 1.4rem 0 2rem; width: 100%; }
.search-hero .search { width: 100%; }
.search-hero .search input { padding: 14px 16px 14px 44px; font-size: 1.05rem; border-radius: 12px; background-position: 16px center; }
.search-hero .search-results { position: static; max-height: none; margin-top: 10px; box-shadow: none; }

/* ── Layout ───────────────────────────────────────────── */
.help-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.help-nav {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 22px 14px 40px 20px;
  border-right: 1px solid var(--border);
  font-size: 0.93rem;
}
.help-nav h4 { margin: 1.3rem 0 0.4rem; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.help-nav h4:first-child { margin-top: 0; }
.help-nav ul { list-style: none; padding: 0; margin: 0; }
.help-nav a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text); }
.help-nav a:hover { background: var(--bg-elev-2); text-decoration: none; }
.help-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { padding: 32px 40px 80px; min-width: 0; max-width: 980px; }
.lead { font-size: 1.12rem; color: var(--text-muted); margin-bottom: 1.6rem; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--text-muted); }

/* ── Building blocks ──────────────────────────────────── */
.summary-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 1.6rem; }
.summary-box > div { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.summary-box strong { display: block; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.note, .tip, .warn { border-radius: var(--radius); padding: 12px 16px; margin: 1rem 0 1.4rem; border: 1px solid var(--border); border-left-width: 4px; }
.note { background: var(--accent-soft); border-left-color: var(--accent); }
.tip { background: var(--good-soft); border-left-color: var(--good); }
.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }
.note strong:first-child, .tip strong:first-child, .warn strong:first-child { color: var(--heading); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 2px 0 14px 46px; margin: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.9rem;
}
.steps > li::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; color: var(--heading); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 0.6rem 0 1.6rem; }
.card { display: block; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--text); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }
.card .tag { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

table.simple { width: 100%; border-collapse: collapse; margin: 0.4rem 0 1.4rem; font-size: 0.93rem; }
table.simple th, table.simple td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.simple th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--bg-elev); }
.table-wrap { overflow-x: auto; }

details.faq { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; margin: 0 0 10px; }
details.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--heading); }
details.faq[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }

/* ── Annotated screenshots ────────────────────────────── */
figure.shot { margin: 1rem 0 1.2rem; }
.shot-frame { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--code-bg); line-height: 0; }
.shot-frame img { display: block; width: 100%; height: auto; }
figure.shot figcaption { font-size: 0.86rem; color: var(--text-muted); margin-top: 8px; text-align: center; }
.shot-box {
  position: absolute; border: 2px solid var(--marker); border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); transition: box-shadow .2s, background .2s; pointer-events: none;
}
.shot-frame.focus .shot-box { opacity: 0.25; }
.shot-frame.focus .shot-box.active { opacity: 1; background: rgba(250, 204, 21, 0.10); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); }
.shot-marker {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--marker); color: var(--marker-text);
  font: 700 13px/1 system-ui, sans-serif; line-height: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); border: 2px solid var(--bg);
  cursor: pointer; z-index: 2; text-decoration: none;
}
.shot-marker:hover, .shot-marker.active { transform: translate(-50%, -50%) scale(1.15); text-decoration: none; }
.shot-zoom { position: absolute; right: 8px; bottom: 8px; z-index: 3; line-height: 1; font-size: 0.78rem; padding: 4px 8px; border-radius: 6px; background: rgba(19, 19, 19, 0.85); color: var(--text); border: 1px solid var(--border); }

ol.callouts { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 8px; }
ol.callouts > li {
  position: relative; padding: 10px 14px 10px 50px; margin: 0;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
ol.callouts > li::before {
  content: attr(data-n);
  position: absolute; left: 12px; top: 10px;
  min-width: 26px; height: 26px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--marker); color: var(--marker-text); font-weight: 700; font-size: 0.85rem;
}
ol.callouts > li.active { border-color: var(--marker); background: color-mix(in srgb, var(--marker) 8%, var(--bg-elev)); }
ol.callouts > li > strong:first-child { color: var(--heading); }

/* ── Next steps / footer ──────────────────────────────── */
.next-steps { margin-top: 2.6rem; }
.page-footer { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ── Index page ───────────────────────────────────────── */
.hero { padding: 8px 0 0; }
.hero h1 { font-size: 2.3rem; }
.path { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0.6rem 0 2rem; counter-reset: p; }
.path a { position: relative; display: block; padding: 14px 14px 14px 52px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; counter-increment: p; }
.path a::before { content: counter(p); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 0.88rem; }
.path a span { display: block; font-weight: 400; font-size: 0.82rem; color: var(--text-muted); }
.path a:hover { border-color: var(--accent); text-decoration: none; }

/* ── Small screens ────────────────────────────────────── */
@media (max-width: 900px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-nav { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 290px; height: auto; background: var(--bg-elev); z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .help-nav { transform: none; }
  .nav-toggle { display: inline-block; }
  main { padding: 22px 16px 60px; }
  .help-header { gap: 10px; padding: 0 12px; }
  .help-header .brand span, .help-header .back-to-app { display: none; }
  .help-header .search { flex: 1; width: auto; }
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.8rem; }
  .shot-marker { min-width: 18px; height: 18px; font-size: 10px; border-width: 1px; }
}
@media print {
  .help-header, .help-nav, .search-results, .shot-zoom { display: none !important; }
  .help-layout { display: block; }
  main { max-width: none; padding: 0; }
}

/* Plain annotated picture (no capture-generated overlay): a third-party window the screenshot
   tool cannot reach, with its numbers drawn into the image itself. */
figure.still { margin: 1rem 0 1.2rem; }
figure.still img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
figure.still figcaption { font-size: 0.86rem; color: var(--text-muted); margin-top: 8px; text-align: center; }
