:root {
  --green: #0b3d2e;
  --green-2: #11553f;
  --orange: #ff6b1a;
  --bg: #f3f6f4;
  --text: #0e1d17;
  --muted: #5d6c65;
  --border: #dfe7e2;
  --code-bg: #0f1f19;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font: 16px/1.7 var(--font); color: var(--text); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: #c2410c; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--green); color: #fff; }
.top-inner { width: min(1100px, 100% - 32px); margin: 0 auto; min-height: 56px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.top .brand { font-weight: 800; letter-spacing: .02em; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.top .brand i { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, #ff8a3d, var(--orange)); display: inline-block; }
.top nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14.5px; margin-left: auto; }
.top nav a { color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 600; }
.top nav a:hover, .top nav a[aria-current] { color: #fff; }

/* ---------- layout ---------- */
.layout { width: min(1100px, 100% - 32px); margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding: 36px 0 80px; }
.toc { position: sticky; top: 76px; align-self: start; font-size: 14.5px; max-height: calc(100vh - 100px); overflow: auto; }
.toc strong { display: block; margin-bottom: 8px; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--border); color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--orange); }
main { min-width: 0; }
.eyebrow { color: var(--orange); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 6px 0 12px; letter-spacing: -.02em; }
h2 { font-size: 26px; line-height: 1.25; margin: 52px 0 14px; padding-top: 8px; letter-spacing: -.01em; }
h3 { font-size: 19px; margin: 30px 0 8px; }
h4 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--muted); }
ul, ol { padding-left: 22px; margin: 0 0 16px; }
li { margin: 4px 0; }
code { font: 0.9em var(--mono); background: #eef3f0; padding: 1px 6px; border-radius: 6px; }
pre { background: var(--code-bg); color: #d7efe3; border-radius: 12px; padding: 16px 18px; overflow: auto; font: 13.5px/1.55 var(--mono); margin: 12px 0 20px; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
pre[data-lang]::before { content: attr(data-lang); display: block; font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: #7fb99d; margin-bottom: 8px; }
table { border-collapse: collapse; width: 100%; margin: 12px 0 22px; font-size: 14.5px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
td code { white-space: nowrap; }

/* ---------- callouts ---------- */
.note, .warn, .ok { border-radius: 12px; padding: 14px 18px; margin: 16px 0 22px; border: 1px solid; font-size: 15.5px; }
.note p:last-child, .warn p:last-child, .ok p:last-child { margin-bottom: 0; }
.note { background: #eef6ff; border-color: #cfe3fa; }
.warn { background: #fff4e8; border-color: #ffd9b3; }
.ok { background: #e9f7ef; border-color: #bfe5cd; }
.note > b:first-child, .warn > b:first-child, .ok > b:first-child { display: block; margin-bottom: 2px; }

/* ---------- screenshots ---------- */
figure { margin: 18px 0 26px; }
figure img { border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(11, 61, 46, .12); }
figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 18px 0 26px; align-items: start; }
.phones figure { margin: 0; }
.phones figure img { border-radius: 22px; border-width: 5px; border-color: #0a1511; background: #0a1511; }
.phones.two { grid-template-columns: repeat(2, minmax(0, 260px)); }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 4px 0 14px 52px; margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 36px; height: 36px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 800; display: grid; place-items: center; }
.steps > li > b:first-child { display: block; font-size: 17px; margin-bottom: 2px; }

/* ---------- cards on the hub ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 22px 0 34px; }
.card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: 18px; padding: 22px; background: var(--bg); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(11, 61, 46, .14); }
.card h3 { margin: 0 0 6px; }
.card p { color: var(--muted); margin: 0 0 10px; font-size: 15px; }
.card span { color: #c2410c; font-weight: 700; font-size: 14.5px; }
.tag { display: inline-block; font: 700 12px var(--font); padding: 2px 9px; border-radius: 999px; background: #e9eeeb; color: var(--muted); vertical-align: middle; }
.tag.must { background: #ffe9db; color: #c2410c; }
.tag.later { background: #e8eefc; color: #3b5bb5; }
.diagram { margin: 18px 0 26px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 640px; height: auto; }
footer { border-top: 1px solid var(--border); padding: 22px 0 34px; color: var(--muted); font-size: 14px; }
footer .wrap { width: min(1100px, 100% - 32px); margin: 0 auto; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .toc { position: static; max-height: none; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; background: var(--bg); }
  .top nav { margin-left: 0; }
}

/* ---------- printing / PDF ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  html { scroll-behavior: auto; }
  body { font-size: 11.5pt; }
  .top, .toc { display: none; }
  .layout { display: block; width: 100%; padding: 0; }
  h2 { break-after: avoid; margin-top: 28px; }
  h3, h4 { break-after: avoid; }
  pre, figure, table, .note, .warn, .ok, .phones, .diagram { break-inside: avoid; }
  pre { white-space: pre-wrap; word-break: break-word; font-size: 9.5pt; }
  .phones { grid-template-columns: repeat(4, 1fr); }
  .phones.two { grid-template-columns: repeat(2, 1fr); }
  a { color: inherit; text-decoration: none; }
  figure img { box-shadow: none; }
}
