/* The /how-to-use guide. Same palette as the phone pages (app.css), plus a dark theme. */
:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #15171b; --soft: #5b6270; --line: #e2ded5;
  --accent: #2f5bea; --accent-soft: #e8eefd;
  --code-bg: #15171b; --code-ink: #e8eaee; --code-line: #2a2f3a;
  --callout-bg: #fff7ed; --callout-line: #fed7aa; --callout-ink: #7c2d12;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13; --card: #161a21; --ink: #f2f4f7; --soft: #9aa3b2; --line: #2a2f3a;
    --accent: #6f93ff; --accent-soft: #1b2440;
    --code-bg: #0a0c10; --code-ink: #e8eaee; --code-line: #262b35;
    --callout-bg: #2a1a0c; --callout-line: #6b3a12; --callout-ink: #fed7aa;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16.5px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.page {
  max-width: 1120px; margin: 0 auto; padding: 40px 16px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px;
}
@media (min-width: 960px) {
  .page { grid-template-columns: 220px minmax(0, 1fr); column-gap: 48px; padding: 56px 32px 80px; }
  .hero, .foot { grid-column: 1 / -1; }
  .toc { position: sticky; top: 24px; align-self: start; }
}

/* ---------------------------------------------------------------- hero */
.hero { max-width: 760px; }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 14px; text-wrap: balance; }
.lede { font-size: 18.5px; color: var(--soft); margin: 0 0 22px; text-wrap: pretty; }
.try { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 15px;
  background: var(--accent); color: #fff; text-decoration: none; border: 1px solid var(--accent);
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn:hover { filter: brightness(1.08); }

/* ----------------------------------------------------------------- toc */
.toc { font-size: 14.5px; }
.toc-title { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--soft); text-decoration: none; }
.toc li a:hover { color: var(--ink); border-left-color: var(--soft); }
.toc li a.is-here { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 959px) {
  .toc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
  .toc ol { columns: 2 180px; border-left: 0; }
  .toc li a { padding-left: 0; border-left: 0; margin: 0; }
}

/* ------------------------------------------------------------- content */
.content { min-width: 0; max-width: 820px; }
section { padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
section:last-child { border-bottom: 0; }
h2 { font-size: 27px; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 14px; display: flex; align-items: center; gap: 12px; }
h2 .n {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 800;
}
h3 { font-size: 19px; margin: 28px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
li::marker { color: var(--soft); }

:not(pre) > code {
  font-size: .88em; padding: 1px 5px; border-radius: 5px;
  background: var(--accent-soft); color: var(--ink); overflow-wrap: anywhere;
}
kbd {
  font-size: 13px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; white-space: nowrap;
}

/* ----------------------------------------------------------- code blocks */
.code-block { position: relative; margin: 0 0 18px; }
pre.code {
  margin: 0 0 18px; padding: 16px 18px; border-radius: 14px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line);
  font-size: 13.5px; line-height: 1.55; tab-size: 2;
}
.code-block pre.code { margin: 0; padding-top: 40px; }
.copy {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  font: 600 12.5px system-ui, sans-serif; color: var(--code-ink);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.copy:hover { background: rgba(255, 255, 255, .16); }
.copy.done { color: #86efac; border-color: #86efac; }

/* -------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); background: color-mix(in srgb, var(--line) 35%, var(--card)); }
td:first-child { white-space: nowrap; }
td:first-child:has(br), td:first-child:has(a) { white-space: normal; min-width: 200px; }
table.keys td:first-child { width: 150px; }

/* ------------------------------------------------------ steps & lists */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps li { counter-increment: step; position: relative; padding: 0 0 12px 44px; margin: 0; }
ol.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--accent); background: var(--accent-soft);
}
ul.ticks { list-style: none; padding: 0; }
ul.ticks li { position: relative; padding-left: 26px; }
ul.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 800; }

.callout { background: var(--callout-bg); border: 1px solid var(--callout-line); color: var(--callout-ink); border-radius: 14px; padding: 14px 16px; margin: 0 0 18px; }
.callout p { margin: 0; }
.callout kbd { color: var(--ink); }

/* ------------------------------------------------------------ patterns */
.patterns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 8px; }
.pattern {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.pattern b { color: var(--accent); }
.pattern span { font-size: 14px; color: var(--soft); line-height: 1.45; }
.pattern:hover { border-color: var(--accent); }

.foot { font-size: 14px; color: var(--soft); text-align: center; }
