/* User guide - same palette as the popup; bundled/system fonts so it works fully offline */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/BricolageGrotesque-800.woff2") format("woff2"); font-weight: 800; font-display: block; }
:root {
  --bg: #fff;
  --surface: #fafafa;
  --border: #ececef;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --green-text: #15803d;
  --amber-soft: #fef3c7;
  --amber-text: #92400e;
  --code-bg: #f4f4f5;
  --header: #18181b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #18181b;
    --border: #27272a;
    --text: #f4f4f5;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --accent: #60a5fa;
    --accent-soft: #172554;
    --green: #22c55e;
    --green-soft: #14532d;
    --green-text: #86efac;
    --amber-soft: #422006;
    --amber-text: #fcd34d;
    --code-bg: #27272a;
    --header: #09090b;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.top { background: var(--header); color: #fff; }
.top-inner { max-width: 1040px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 12px; }
/* logo (brand/: 1a "stamp", on-dark variant) */
.logo { width: 36px; height: 36px; flex: none; }
.logo svg { width: 100%; height: 100%; display: block; }
.logo .bf-shadow { fill: #fff4ea; }
.title h1 { margin: 0; font-family: "Bricolage Grotesque", "Arial Black", sans-serif; font-weight: 800; font-size: 21px; letter-spacing: -.03em; line-height: 1.15; color: #fff4ea; }
.title h1 .fill { color: #ff4d12; }
.sub { font-size: 13px; color: #a1a1aa; }
.version { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; }
.version:empty { display: none; }

/* layout */
.layout { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc a { padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.toc a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
main { min-width: 0; max-width: 720px; }

/* type */
.lead { margin: 0 0 20px; font-size: 17px; color: var(--text-2); }
section { padding-top: 12px; margin-top: 36px; border-top: 1px solid var(--border); }
h2 { margin: 12px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 26px 0 6px; font-size: 16px; font-weight: 600; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
code, kbd { font-family: var(--mono); font-size: .86em; }
code { padding: 1px 5px; border-radius: 4px; background: var(--code-bg); }
kbd { padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); white-space: nowrap; }

/* numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 36px; margin: 10px 0; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* flow strip */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 18px; }
.flow div { position: relative; padding: 12px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: center; font-size: 13px; line-height: 1.35; }
.flow b { display: block; margin-bottom: 2px; color: var(--accent); font-size: 12px; }
.flow div:not(:last-child)::after { content: "›"; position: absolute; right: -8px; top: 50%; transform: translate(50%, -50%); color: var(--muted); font-size: 16px; }

/* callouts */
.callout { margin: 16px 0; padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 14px; }
.callout.tip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.callout.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber-text) 25%, transparent); color: var(--amber-text); }

/* tables */
table { width: 100%; margin: 8px 0 16px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
td:first-child { white-space: nowrap; }
#troubleshooting td:first-child, #settings td:first-child { white-space: normal; min-width: 150px; }

/* inline replicas of popup UI */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.on { background: #18181b; color: #4ade80; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700; }
.badge.blue { background: #2563eb; }
.badge.green { background: #16a34a; }
.badge.none { border: 1px dashed var(--muted); }
.badge.gray { background: #71717a; }
.qmark.power-dot { background: rgba(34,197,94,.18); color: #16a34a; font-size: 11px; }
.btn { display: inline-block; padding: 0 8px; border-radius: 6px; background: #2563eb; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn.green { background: #16a34a; }
.btn.small { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.qmark, .logo-inline { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.qmark { background: #18181b; color: #fff; border-radius: 50%; }
.logo-inline { background: #ff4d12; color: #fff; }

footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* narrow screens: contents become a scrollable row */
@media (max-width: 760px) {
  /* minmax(0, …): a plain 1fr track grows to fit the nowrap contents row */
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px 16px 48px; }
  .toc { position: static; min-width: 0; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .toc a { white-space: nowrap; }
  .top-inner { padding: 14px 16px; }
  .flow { grid-template-columns: 1fr; }
  .flow div:not(:last-child)::after { content: "⌄"; right: 50%; top: auto; bottom: -13px; transform: translateX(50%); }
  td:first-child { white-space: normal; }
}
