/* Sweet manual: seven colour-coded chapters, a colour rail for navigation,
   storyboard steps beside real UI. Built by _build.py; edit content there. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  --ink:#141414; --ink-2:#3f3f46; --ink-3:#52525b; --ink-4:#71717a;
  --line:#e4e4e7; --line-2:#f4f4f5; --bg:#ffffff; --bg-2:#fafafa;
  --c1:#dd7e3c; --c2:#d1a910; --c3:#6fac3e; --c4:#36ab76; --c5:#23a3b7; --c6:#6a7bd1; --c7:#9b5fe0;
  --display:"Space Grotesk","Inter",system-ui,sans-serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Menlo,monospace;
  --chapter:var(--c1); --chapter-soft:#fbf3ec; --chapter-text:#9a4c16;
}
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{ margin:0; background:var(--bg); color:var(--ink); font-family:var(--sans); font-size:15px; line-height:1.6; -webkit-font-smoothing:antialiased; }
a{ color:inherit; text-decoration:none; }
code{ font-family:var(--mono); font-size:.9em; }
p code, li code, td code{ background:var(--line-2); border-radius:4px; padding:1px 5px; }
.skip{ position:absolute; left:-9999px; }
.skip:focus{ left:12px; top:12px; z-index:50; background:#fff; padding:8px 12px; border:2px solid var(--ink); border-radius:8px; }

/* chapter colours */
.ch1{ --chapter:var(--c1); --chapter-soft:#fbf3ec; --chapter-text:#9a4c16; }
.ch2{ --chapter:var(--c2); --chapter-soft:#faf5e1; --chapter-text:#7a6206; }
.ch3{ --chapter:var(--c3); --chapter-soft:#f1f7ec; --chapter-text:#466e25; }
.ch4{ --chapter:var(--c4); --chapter-soft:#ebf6f0; --chapter-text:#226b4a; }
.ch5{ --chapter:var(--c5); --chapter-soft:#e9f6f8; --chapter-text:#156674; }
.ch6{ --chapter:var(--c6); --chapter-soft:#eff1fa; --chapter-text:#3d4ea6; }
.ch7{ --chapter:var(--c7); --chapter-soft:#f5effc; --chapter-text:#6a35ab; }

/* layout: rail + main */
.m{ display:grid; grid-template-columns:56px minmax(0,1fr); min-height:100vh; }
.m.home{ grid-template-columns:232px minmax(0,1fr); }
.rail{ position:sticky; top:0; height:100vh; border-right:1px solid var(--line); display:flex; flex-direction:column; align-items:center; }
.rail-logo{ height:64px; display:flex; align-items:center; }
.rail-logo img{ width:24px; height:24px; border-radius:6px; display:block; }
.rail-bars{ flex:1; width:100%; display:flex; flex-direction:column; align-items:center; gap:6px; padding:8px 0 24px; }
.rail-bars a{ width:8px; flex:1; border-radius:4px; transition:width .15s ease; }
.rail-bars a:hover{ width:14px; }
.rail-bars a[aria-current]{ width:22px; flex:3; border-radius:6px; }
.b1{ background:var(--c1); } .b2{ background:var(--c2); } .b3{ background:var(--c3); } .b4{ background:var(--c4); } .b5{ background:var(--c5); } .b6{ background:var(--c6); } .b7{ background:var(--c7); }

/* home rail: labelled */
.home .rail{ flex-direction:row; align-items:stretch; }
.home .rail-stripe{ width:12px; display:flex; flex-direction:column; }
.home .rail-stripe span{ flex:1; }
.home .rail-list{ flex:1; display:flex; flex-direction:column; }
.home .rail-list .brand{ height:72px; display:flex; align-items:center; gap:8px; padding:0 18px; font-family:var(--display); font-weight:700; font-size:17px; letter-spacing:-.02em; }
.home .rail-list .brand img{ width:24px; height:24px; border-radius:6px; }
.home .rail-list a.chap{ flex:1; display:flex; flex-direction:column; justify-content:center; padding:0 18px; border-top:1px solid var(--line-2); font-weight:600; }
.home .rail-list a.chap:hover{ background:var(--bg-2); }
.home .rail-list a.chap span{ font-family:var(--mono); font-size:11px; font-weight:400; color:var(--ink-4); }

.main{ min-width:0; }
.topbar{ height:72px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:flex-end; gap:20px; padding:0 40px; font-size:14px; font-weight:500; }
.topbar a{ color:var(--ink-3); } .topbar a:hover{ color:var(--ink); }
.topbrand{ display:none; margin-right:auto; align-items:center; gap:8px; font-family:var(--display); font-weight:700; font-size:16px; letter-spacing:-.02em; color:var(--ink) !important; }
.topbrand img{ width:22px; height:22px; border-radius:5px; }
.btn{ height:36px; padding:0 14px; border-radius:8px; background:var(--ink); color:#fff !important; display:inline-flex; align-items:center; font-weight:500; font-size:14px; border:0; cursor:pointer; font-family:inherit; }
.btn:hover{ opacity:.88; }
.linkbtn{ background:none; border:0; padding:0; font:inherit; cursor:pointer; color:inherit; }

/* home */
.hero{ padding:72px 64px 56px; display:flex; flex-direction:column; gap:28px; max-width:1080px; }
.hero h1{ margin:0; font-family:var(--display); font-weight:700; font-size:clamp(56px,7vw,104px); letter-spacing:-.045em; line-height:.92; }
.hero p{ margin:0; font-size:20px; line-height:1.5; color:var(--ink-2); max-width:34rem; }
.searchline{ display:flex; align-items:center; gap:14px; border-bottom:2px solid var(--ink); padding:10px 0; max-width:640px; cursor:text; background:none; border-top:0; border-left:0; border-right:0; font:inherit; color:var(--ink-4); font-size:22px; text-align:left; }
.searchline svg{ flex:0 0 auto; }
.searchline span{ flex:1; }
kbd{ font-family:var(--mono); font-size:12px; color:var(--ink-3); border:1px solid #d4d4d8; border-radius:5px; padding:2px 6px; background:#fff; }
.tiles{ padding:0 64px 80px; display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:2px; }
.tile{ display:flex; flex-direction:column; min-height:300px; border:1px solid var(--line); }
.tile:hover{ border-color:var(--ink); }
.tile-top{ height:132px; padding:18px 20px; display:flex; align-items:flex-end; justify-content:space-between; background:var(--chapter); }
.tile-num{ font-family:var(--display); font-weight:700; font-size:64px; letter-spacing:-.05em; line-height:.8; }
.tile-meta{ font-size:13px; font-weight:600; }
.tile-body{ padding:18px 20px; display:flex; flex-direction:column; gap:8px; }
.tile-body b{ font-family:var(--display); font-weight:700; font-size:24px; letter-spacing:-.02em; }
.tile-body span{ color:var(--ink-3); line-height:1.55; }
.tile.dark{ background:var(--ink); color:#fff; border-color:var(--ink); justify-content:space-between; padding:22px 20px; }
.tile.dark b{ font-family:var(--display); font-weight:700; font-size:24px; letter-spacing:-.02em; line-height:1.15; }
.tile.dark span{ color:#d4d4d8; line-height:1.55; }

/* chapter banner */
.banner{ background:var(--chapter); padding:24px 56px 34px; display:flex; flex-direction:column; gap:26px; }
.banner-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:14px; font-weight:600; flex-wrap:wrap; }
.banner-top nav{ display:flex; align-items:center; gap:18px; }
.banner-title{ display:flex; align-items:flex-end; gap:28px; flex-wrap:wrap; }
.banner-num{ font-family:var(--display); font-weight:700; font-size:clamp(96px,12vw,160px); letter-spacing:-.06em; line-height:.75; }
.banner-title h1{ margin:0; font-family:var(--display); font-weight:700; font-size:clamp(34px,4.2vw,52px); letter-spacing:-.035em; line-height:.98; }
.banner-title .lede{ margin:10px 0 0; font-size:17px; line-height:1.5; max-width:640px; }
.banner-title > div{ padding-bottom:6px; max-width:680px; }
.banner h1.cmd{ font-family:var(--mono); font-weight:600; letter-spacing:-.04em; }
.pills{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px; font-size:14px; font-weight:600; }
.pills a{ height:34px; padding:0 14px; border-radius:999px; background:rgba(20,20,20,.1); display:inline-flex; align-items:center; white-space:nowrap; }
.pills a:hover, .pills a.on{ background:var(--ink); color:#fff; }
.pills.mono a{ font-family:var(--mono); font-size:13px; font-weight:500; border-radius:6px; height:30px; padding:0 10px; }

/* storyboard steps */
.step{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:56px; padding:64px 56px; border-bottom:1px solid var(--line); align-items:center; scroll-margin-top:12px; }
.step.solo{ grid-template-columns:minmax(0,1fr); }
.step-text{ display:flex; flex-direction:column; gap:14px; max-width:520px; }
.step.solo .step-text{ max-width:760px; }
.step-k{ font-family:var(--mono); font-size:13px; color:var(--chapter-text); }
.step h2{ margin:0; font-family:var(--display); font-weight:700; font-size:34px; letter-spacing:-.03em; line-height:1.05; }
.step h3{ margin:10px 0 0; font-size:16px; font-weight:600; }
.step p, .step li{ margin:0; font-size:16px; line-height:1.65; color:var(--ink-2); }
.step ul, .step ol{ margin:0; padding-left:20px; display:flex; flex-direction:column; gap:6px; }
.step strong{ color:var(--ink); }
.note{ border-left:3px solid var(--chapter); padding-left:12px; color:var(--ink-3) !important; font-size:15px !important; }
.step-fig{ margin:0; background:var(--chapter-soft); border-radius:16px; padding:40px; display:flex; justify-content:center; }
.step a:not(.btn){ text-decoration:underline; text-underline-offset:3px; }

/* ui vignettes */
.ui{ width:100%; max-width:400px; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 20px 40px -24px rgba(20,20,20,.3); overflow:hidden; font-size:14px; }
.ui-bar{ height:3px; background:linear-gradient(90deg,var(--c1),var(--c2),var(--c3),var(--c4),var(--c5),var(--c6),var(--c7)); }
.ui-pad{ padding:18px; display:flex; flex-direction:column; gap:10px; }
.ui-title{ font-family:var(--display); font-weight:700; font-size:19px; }
.ui-field{ height:38px; border:1px solid var(--line); border-radius:8px; padding:0 12px; display:flex; align-items:center; color:var(--ink-4); }
.ui-btn{ height:38px; border-radius:8px; background:var(--ink); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:500; }
.ui-pad.ui-file{ gap:0; }
.ui-file{ font-family:var(--mono); font-size:12.5px; line-height:1.7; color:var(--ink-2); display:flex; flex-direction:column; }
.ui-file b{ color:var(--ink); font-weight:500; }
.ui-file .fn{ font-family:var(--sans); font-size:12px; color:var(--ink-4); margin-bottom:4px; }
.chat{ width:100%; max-width:420px; display:flex; flex-direction:column; gap:10px; font-size:14px; line-height:1.5; }
.me{ align-self:flex-end; max-width:80%; background:var(--ink); color:#fff; border-radius:16px 16px 4px 16px; padding:10px 14px; }
.it{ align-self:flex-start; max-width:88%; background:#fff; border:1px solid var(--line); border-radius:16px 16px 16px 4px; padding:10px 14px; color:var(--ink-2); box-shadow:0 12px 24px -18px rgba(20,20,20,.3); }
.chip{ align-self:flex-start; display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-3); background:#fff; border:1px solid var(--line); border-radius:999px; padding:5px 12px; }
.dot{ width:7px; height:7px; border-radius:50%; flex:0 0 auto; display:inline-block; }
.replies{ display:flex; flex-wrap:wrap; gap:6px; }
.replies span{ border:1px solid var(--line); background:#fff; border-radius:999px; padding:5px 12px; font-size:13px; font-weight:500; }
.replies span:first-child{ border-color:var(--ink); }
.rows{ border:1px solid var(--line-2); border-radius:10px; }
.rows > div{ display:flex; gap:10px; padding:10px 12px; border-bottom:1px solid var(--line-2); align-items:baseline; }
.rows > div:last-child{ border-bottom:0; }
.rows .dot{ position:relative; top:-1px; }
.rows span{ color:var(--ink-3); }
.tabs3{ display:inline-flex; align-self:flex-start; padding:3px; gap:2px; border-radius:8px; background:var(--line-2); font-size:13px; font-weight:500; }
.tabs3 span{ padding:4px 12px; color:var(--ink-4); }
.tabs3 span.on{ background:#fff; color:var(--ink); border-radius:6px; box-shadow:0 1px 2px rgba(0,0,0,.08); }
.log{ background:#141416; color:#e4e4e7; border-radius:12px; padding:14px 16px; font-family:var(--mono); font-size:12.5px; line-height:1.9; width:100%; max-width:420px; }
.log .k{ color:#7cc6d1; } .log .d{ color:#71717a; }
.tiles4{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.tiles4 span{ height:52px; border:1px solid var(--line); border-radius:10px; display:flex; align-items:center; justify-content:center; font-family:var(--display); font-weight:700; font-size:18px; }
.tiles4 span.on{ border-color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }

/* tables of rates, option rows */
.rates{ width:100%; border-collapse:collapse; font-size:15px; }
.rates th{ text-align:left; font-weight:600; color:var(--ink-3); font-size:13px; padding:0 0 8px; border-bottom:2px solid var(--ink); }
.rates td{ padding:12px 0; border-bottom:1px solid var(--line); vertical-align:top; }
.rates th:last-child{ text-align:right; }
.rates td:last-child{ text-align:right; font-weight:600; white-space:nowrap; }
.opts{ display:flex; flex-direction:column; }
.opt{ display:grid; grid-template-columns:minmax(200px,.6fr) minmax(0,1fr) minmax(0,.9fr); gap:24px; padding:18px 0; border-top:1px solid var(--line); align-items:baseline; }
.opt:first-child{ border-top:2px solid var(--ink); }
.opt:last-child{ border-bottom:1px solid var(--line); }
.opt > code:first-child{ font-size:15px; font-weight:600; background:none; padding:0; }
.opt > span{ color:var(--ink-2); line-height:1.6; }
.opt > code:last-child{ font-size:13px; color:var(--ink-3); background:none; padding:0; }

/* code */
.term{ background:#141416; border-radius:14px; overflow:hidden; box-shadow:0 30px 60px -30px rgba(20,20,20,.5); width:100%; }
.term-bar{ display:flex; align-items:center; gap:7px; height:40px; padding:0 10px 0 14px; border-bottom:1px solid #27272a; }
.term-bar i{ width:10px; height:10px; border-radius:50%; background:#3f3f46; }
.term-bar .copy{ margin-left:auto; }
.copy{ height:28px; padding:0 10px; border:1px solid #3f3f46; border-radius:6px; background:transparent; color:#e4e4e7; font:500 12px var(--sans); cursor:pointer; }
.copy:hover{ border-color:#71717a; }
.term pre{ margin:0; padding:20px 22px; font-family:var(--mono); font-size:14px; line-height:1.75; color:#f4f4f5; white-space:pre-wrap; word-break:break-word; }
.term pre .p{ color:#71717a; } .term pre .s{ color:#7cc6d1; } .term pre .c{ color:#71717a; }
.term figcaption{ padding:0 22px 18px; font-size:13.5px; color:#a1a1aa; }

/* command builder */
.builder{ display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:48px; padding:48px 56px; border-bottom:1px solid var(--line); align-items:start; }
.builder h2{ margin:0; font-family:var(--display); font-weight:700; font-size:30px; letter-spacing:-.03em; line-height:1.05; }
.builder p{ margin:0; font-size:16px; color:var(--ink-2); }
.toggles{ display:flex; flex-direction:column; gap:8px; }
.toggle{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; padding:12px 14px; border-radius:10px; cursor:pointer; border:1px solid var(--line); background:#fff; color:var(--ink); font-family:var(--sans); }
.toggle b{ font-family:var(--mono); font-size:14px; font-weight:600; }
.toggle span{ font-size:13.5px; opacity:.8; }
.toggle[aria-pressed="true"]{ background:var(--ink); color:#fff; border-color:var(--ink); }

.section{ padding:48px 56px 64px; display:flex; flex-direction:column; gap:14px; border-bottom:1px solid var(--line); }
.section h2{ margin:0 0 6px; font-family:var(--display); font-weight:700; font-size:30px; letter-spacing:-.03em; }
.section p{ margin:0; font-size:16px; color:var(--ink-2); max-width:760px; }

/* next chapter band */
.next{ display:flex; align-items:center; justify-content:space-between; background:var(--chapter); padding:36px 56px; }
.next span{ display:flex; flex-direction:column; gap:4px; }
.next small{ font-size:14px; font-weight:600; }
.next b{ font-family:var(--display); font-weight:700; font-size:40px; letter-spacing:-.03em; }
.next:hover svg{ transform:translateX(4px); }
.next svg{ transition:transform .15s ease; }
.foot{ padding:28px 56px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:16px; font-size:13px; color:var(--ink-4); border-top:1px solid var(--line); }
.foot nav{ display:flex; flex-wrap:wrap; gap:18px; }
.foot a:hover{ color:var(--ink); }

/* search dialog */
.search{ position:fixed; inset:0; z-index:40; background:rgba(20,20,20,.35); display:none; align-items:flex-start; justify-content:center; padding:10vh 16px 16px; }
.search.open{ display:flex; }
.search-box{ width:100%; max-width:640px; background:#fff; border-radius:16px; box-shadow:0 30px 80px -20px rgba(0,0,0,.45); overflow:hidden; }
.search-box label{ display:flex; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid var(--line); }
.search-box input{ flex:1; min-width:0; border:0; outline:none; font:inherit; font-size:18px; color:var(--ink); background:transparent; }
.search-results{ max-height:60vh; overflow:auto; padding:6px; }
.search-results a{ display:flex; gap:12px; padding:10px 12px; border-radius:10px; align-items:flex-start; }
.search-results a:hover, .search-results a.sel{ background:var(--line-2); }
.search-results .sw{ width:10px; height:30px; border-radius:3px; flex:0 0 auto; margin-top:2px; }
.search-results b{ display:block; font-weight:600; }
.search-results small{ color:var(--ink-4); font-size:13px; }
.search-empty{ padding:18px; color:var(--ink-4); font-size:14px; }

/* phone */
@media (max-width:860px){
  .m, .m.home{ grid-template-columns:minmax(0,1fr); }
  .rail{ position:sticky; top:0; z-index:20; height:8px; flex-direction:row; border:0; }
  .rail-logo{ display:none; }
  .rail-bars{ flex-direction:row; padding:0; gap:0; height:8px; }
  .rail-bars a, .rail-bars a:hover{ width:auto; height:8px; border-radius:0; }
  .rail-bars a[aria-current]{ width:auto; border-radius:0; }
  .home .rail{ height:8px; }
  .home .rail-list{ display:none; }
  .home .rail-stripe{ width:100%; flex-direction:row; height:8px; }
  .topbar{ padding:0 16px; height:60px; gap:14px; }
  .topbar .topbrand{ display:inline-flex; }
  .topbar a[href="/"]{ display:none; }
  .hero{ padding:40px 16px 32px; gap:20px; }
  .hero p{ font-size:17px; }
  .searchline{ font-size:18px; }
  .tiles{ padding:0 16px 48px; }
  .tile{ min-height:0; }
  .tile-top{ height:96px; }
  .banner{ padding:12px 16px 22px; gap:16px; }
  .banner-top{ font-size:13px; }
  .banner-title{ gap:12px; }
  .banner-title .lede{ font-size:15.5px; }
  .pills{ flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; }
  .step, .builder{ grid-template-columns:minmax(0,1fr); gap:24px; padding:32px 16px; }
  .step h2{ font-size:26px; }
  .step-fig{ padding:22px; }
  .section{ padding:32px 16px 40px; }
  .opt{ grid-template-columns:minmax(0,1fr); gap:6px; }
  .next{ padding:24px 16px; } .next b{ font-size:28px; }
  .foot{ padding:24px 16px; }
}
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } .rail-bars a, .next svg{ transition:none; } }
