/* Setup guide. Extends the .legal reading column from /styles.css: same
   68ch measure, same type scale, same hairline rhythm. No raw colours outside
   the print block, which has to pin the light palette by value. */
.guide h2,.guide h3,.guide [id]{scroll-margin-top:88px}
/* Privacy drops the first h2's rule because it sits under the date. Here the
   contents list sits between, so every section keeps its rule. */
.guide h2:first-of-type{border-top:1px solid var(--hair);padding-top:28px;margin-top:56px}
.legal .guide__intro{margin:20px 0 0;font-size:19px;line-height:31px;color:var(--ink)}
.guide h3{font-family:var(--serif);font-weight:500;font-size:21px;line-height:1.3;letter-spacing:-.005em;color:var(--ink);margin:40px 0 12px}
.guide h2+h3{margin-top:20px}
.guide kbd{font:500 15px/1 'IBM Plex Mono',ui-monospace,monospace;letter-spacing:.04em;color:var(--ink)}

.crumb{display:inline-flex;align-items:center;min-height:44px;margin:-12px 0 8px;font-size:15px;text-decoration:none}
.crumb::before{content:"←";margin-right:8px}

/* Numbered steps. One counter per list; a list that continues a count says so
   with start="", and these rules pick the count up there. */
.steps{margin:0 0 16px;padding:0;list-style:none;counter-reset:s}
.steps[start="2"]{counter-reset:s 1}.steps[start="3"]{counter-reset:s 2}.steps[start="4"]{counter-reset:s 3}.steps[start="5"]{counter-reset:s 4}.steps[start="6"]{counter-reset:s 5}.steps[start="7"]{counter-reset:s 6}.steps[start="8"]{counter-reset:s 7}.steps[start="9"]{counter-reset:s 8}.steps[start="10"]{counter-reset:s 9}.steps[start="11"]{counter-reset:s 10}.steps[start="12"]{counter-reset:s 11}
.guide .steps>li{counter-increment:s;padding-left:40px;margin:0 0 16px;break-inside:avoid}
.guide .steps>li::before{content:counter(s);left:0;top:0;width:24px;height:auto;background:none;text-align:right;font:500 15px/29px 'IBM Plex Mono',ui-monospace,monospace;color:var(--ink)}
@media (max-width:820px){.guide .steps>li::before{line-height:27px}}

/* The one thing worth marking: the action that erases every device. */
.guide .mark{position:relative}
.guide .mark::before{content:"";position:absolute;left:-15px;top:11px;width:7px;height:7px;border-radius:50%;background:var(--gold)}

.legal .guide__end{margin:56px 0 0;padding-top:28px;border-top:1px solid var(--hair);font-size:15px;line-height:26px}
.legal .toc-back{margin:24px 0 0;font-size:15px}
.toc-back a{display:inline-flex;align-items:center;min-height:44px}

/* Next task: one quiet row at the end of a section that hands on. */
.next{display:grid;gap:2px;margin:28px 0 0;padding:14px 0;border-top:1.5px solid var(--ink);border-bottom:1px solid var(--hair);text-decoration:none;color:var(--ink)}
.next__k{font:500 12px/16px 'IBM Plex Mono',ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--ink3)}
.next__t{font:400 22px/1.3 var(--serif)}
.next:hover .next__t{color:var(--accent)}
.next__t::after{content:" →"}

/* Hub: three tasks, then the screens people arrive stuck on. */
.tasks{margin:36px 0 0;border-top:1.5px solid var(--ink)}
.tasks a{display:grid;grid-template-columns:24px minmax(0,1fr);gap:4px 14px;padding:18px 0 20px;border-bottom:1px solid var(--hair);text-decoration:none;color:var(--ink)}
.tasks__n{grid-row:1;font:500 14px/34px 'IBM Plex Mono',ui-monospace,monospace;color:var(--ink3)}
.tasks__t{font:400 28px/34px var(--serif);letter-spacing:-.01em}
.tasks__d{grid-column:2;font-size:16px;line-height:26px;color:var(--ink2);text-wrap:pretty}
.tasks a:hover .tasks__t{color:var(--accent)}
.guide .screens{margin:4px 0 0;border-top:1px solid var(--hair)}
.guide .screens li{margin:0;padding:0}
.guide .screens li::before{content:none}
.screens a{display:flex;align-items:center;min-height:48px;padding:8px 0;border-bottom:1px solid var(--hair);font-size:16px;line-height:1.4;color:var(--ink);text-decoration:none}
.screens a::after{content:"→";margin-left:auto;padding-left:16px;color:var(--ink3)}
.screens a:hover{color:var(--accent)}

/* Contents lists use <ol>; keep the .legal tick off them. */
.guide .toc li{margin:0;padding:0;font-size:inherit;line-height:inherit}
.guide .toc li::before{content:none}
.toc ol{margin:0;padding:0;list-style:none}
.toc{margin:32px 0 8px;border-top:1.5px solid var(--ink)}
.toc__label{display:block;padding:14px 0 4px;font:500 12px/16px 'IBM Plex Mono',ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--ink3)}
.toc a{display:flex;align-items:center;min-height:44px;padding:6px 0;border-bottom:1px solid var(--hair);font:400 19px/1.3 var(--serif);color:var(--ink);text-decoration:none}
.toc a:hover{color:var(--accent)}
.toc ol ol a{padding-left:16px;font:400 15px/1.4 var(--sans);color:var(--ink2)}
.toc ol ol li:last-child a{border-bottom:0}
@media (min-width:1100px){
  .legal.guide:not(.guide--hub){max-width:calc(68ch + 264px);display:grid;grid-template-columns:200px minmax(0,68ch);column-gap:64px;align-items:start}
  .guide:not(.guide--hub)>*{grid-column:2}
  /* Not a second bar: it rides beside the column, so it never stacks under .hdr. */
  .guide>.toc{grid-column:1;grid-row:1/span 400;position:sticky;top:96px;max-height:calc(100vh - 120px);overflow:auto;margin:8px 0 0}
  .toc a{min-height:40px;font-size:17px}
  /* The sidebar lists sections only; the situations stay in the phone list. */
  .toc ol ol{display:none}
  .toc-back{display:none}
}

/* Screens: closed by default, so nothing downloads until asked (lazy images
   inside a closed <details> are not fetched). */
.shot{margin:2px 0 0}
.shot>summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:15px;color:var(--accent);cursor:pointer;list-style:none}
.shot>summary::-webkit-details-marker{display:none}
.shot>summary::before{content:"+";width:12px;font:500 15px/1 'IBM Plex Mono',ui-monospace,monospace}
.shot[open]>summary::before{content:"−"}
.shot img{display:block;width:100%;height:auto;margin:6px 0 8px;border:1px solid var(--hair);border-radius:6px;background:var(--surface)}
.shot--phone img{max-width:260px;border-radius:14px}
:root[data-theme="dark"] .shot img{filter:brightness(.8) contrast(1.05)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .shot img{filter:brightness(.8) contrast(1.05)}}

/* Device rail: the device's name runs down the margin beside its steps. */
.handoff{margin:28px 0 8px}
.dev{margin:0 0 20px;padding-top:16px;border-top:1.5px solid var(--ink)}
.guide .dev h3{margin:0 0 14px}
.dev__body{display:grid;grid-template-columns:22px minmax(0,1fr);column-gap:16px}
.dev__rail{border-right:1px solid var(--hair)}
/* Sticky inside its own group only: it travels down beside the steps and
   stops at the group's end, so it never stacks under the header. */
.dev__rail span{position:sticky;top:84px;display:block;padding:2px 0 12px;writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap;font:500 11px/22px 'IBM Plex Mono',ui-monospace,monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--ink3)}
.dev--alt .dev__rail{border-right:2px solid var(--ink)}
.dev--alt .dev__rail span{color:var(--ink)}
.dev .steps{margin:0}
.guide .dev .steps>li{padding-left:36px}

/* Situations fold like the FAQ on the home page: the heading is the row you
   tap, so the exact sentence on screen is the thing you scan for. */
.fix{border-top:1px solid var(--hair)}
.fix:last-of-type{border-bottom:1px solid var(--hair)}
.fix>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:60px;padding:12px 0;cursor:pointer;list-style:none}
.fix>summary::-webkit-details-marker{display:none}
.fix>summary::after{content:"+";flex:none;font-size:22px;line-height:1;color:var(--ink3);transition:transform .25s ease}
.fix[open]>summary::after{transform:rotate(45deg)}
.fix>summary:hover h3{color:var(--accent)}
.guide .fix h3{margin:0;font-size:19px}
.fix>summary+*{margin-top:2px}
.fix>:last-child{margin-bottom:22px}
.guide h2+.fix{margin-top:20px}

/* "You'll need": the time it takes and the two or three things to have ready,
   before the contents, so nobody starts a ten-minute job with five to spare. */
.need{margin:24px 0 0;padding:18px 20px 6px;background:var(--plate);border-radius:14px}
.legal .need p{margin:0}
.need__time{font:500 12px/16px 'IBM Plex Mono',ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--gold-ink)}
.need__label{margin-top:10px!important;font-size:15px!important;font-weight:500;color:var(--ink)!important}
.legal .need ul{margin:6px 0 0}
.legal .need li{margin:0 0 8px;font-size:16px;line-height:26px}

/* The one or two things a guide has to say loudly: the kit is shown once,
   and erasing a paired phone erases the rest. */
.warn{margin:20px 0 24px;padding:16px 20px;border:1.5px solid var(--gold);border-radius:14px}
.legal .warn p{margin:0 0 8px;font-size:16px;line-height:26px}
.legal .warn p:last-child{margin-bottom:0}
.warn__label{font-weight:500!important;color:var(--ink)!important}

/* Help page: a fold's own screenshot stays inside the fold. */
.fix .shot{margin:0 0 12px}

@media print{
  @page{size:letter;margin:.5in .6in}
  :root,:root[data-theme="dark"],:root:not([data-theme="light"]){
    --bg:#FFFFFF;--surface:#FFFFFF;--sunken:#F1EEE6;--hair:#D6D0C1;
    --ink:#1C211E;--ink2:#2F3531;--ink3:#5A5F59;
    --accent:#1F4A3A;--gold:#B8893A;--gold-ink:#7A5A1C;color-scheme:light}
  body{background:var(--bg);color:var(--ink);font-size:10pt}
  .hdr,.ftr,.toc,.toc-back,.shot,.crumb,.next{display:none!important}
  .need,.warn{break-inside:avoid;padding:6pt 10pt;margin:6pt 0}
  .wrap{max-width:none;padding:0}
  .legal{max-width:none;padding:0}
  .legal h1{font-size:22pt}
  .legal .guide__intro{margin-top:6pt;font-size:11pt;line-height:1.38}
  .legal h2,.guide h2:first-of-type{font-size:15pt;margin:14pt 0 4pt;padding-top:8pt;break-after:avoid}
  .guide h3{font-size:11.5pt;margin:9pt 0 3pt;break-after:avoid}
  .legal p,.legal li{font-size:10pt;line-height:1.38;margin-bottom:3.5pt;orphans:3;widows:3}
  .legal ul,.steps{margin-bottom:4pt}
  .legal li::before{top:.7em}
  .guide .steps>li{padding-left:20pt;margin-bottom:3pt}
  .guide .steps>li::before{width:13pt;font-size:10pt;line-height:inherit}
  .guide .mark::before{left:-11pt;top:.5em}
  .guide a{color:var(--ink);text-decoration:none}
  .guide a[data-url]::after{content:" (" attr(data-url) ")"}
  .screens a::after{content:none}
  .tasks a{padding:6pt 0}
  .tasks__t{font-size:14pt;line-height:1.3}
  .tasks__d{font-size:10pt;line-height:1.38}
  .legal .guide__end{margin-top:12pt;padding-top:6pt;font-size:9.5pt;break-inside:avoid}
  .dev{padding-top:8pt;margin-bottom:10pt}
  .dev__body{grid-template-columns:14pt minmax(0,1fr);column-gap:10pt}
  .dev__rail span{position:static;font-size:8pt;line-height:14pt}
  .guide .dev .steps>li{padding-left:20pt}
  /* Every situation prints open, so the sheet carries every answer. */
  .fix::details-content{content-visibility:visible;block-size:auto}
  .fix,.fix:last-of-type{border:0}
  .fix>summary{display:block;min-height:0;padding:0}
  .fix>summary::after{content:none}
  .guide .fix h3{margin:9pt 0 3pt;font-size:11.5pt}
  .fix>:last-child{margin-bottom:4pt}
}

/* "Stuck?": a scripted tree (stuck.js). Inline on the hub, a floating panel
   on every other guide page. Same tokens as the rest, so it themes itself. */
.stuck{display:grid;gap:12px}
.stuck--inline{margin:16px 0 0;padding:20px;background:var(--plate);border-radius:14px}
.stuck p{margin:0}
.stuck .stuck__q{font:400 22px/1.3 var(--serif);letter-spacing:-.005em;color:var(--ink);outline:0}
.stuck__opts{display:grid;gap:8px}
.stuck__opts--row{grid-template-columns:1fr 1fr}
.stuck__opt{display:flex;align-items:center;min-height:48px;padding:10px 14px;border:1px solid var(--hair);border-radius:10px;background:var(--surface);font:400 16px/1.35 var(--sans);color:var(--ink);text-align:left;cursor:pointer;transition:border-color .15s ease}
.stuck__opt:hover{border-color:var(--accent);color:var(--ink)}
.stuck__opt:focus-visible,.stuck__back:focus-visible,.stuck-btn:focus-visible,.stuck-panel__close:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.stuck__a{display:grid;gap:10px;padding:14px 16px;background:var(--surface);border-radius:10px;border-left:3px solid var(--accent)}
.stuck__a--warn{border-left-color:var(--gold)}
.stuck__a p{font-size:16px;line-height:26px;color:var(--ink)}
.stuck__more{justify-self:start;font-size:15px}
.stuck__more::after{content:" →"}
.stuck .stuck__ask{margin-top:4px;font-size:15px;color:var(--ink2)}
.stuck__back{justify-self:start;min-height:44px;padding:0;border:0;background:none;font:400 15px/1 var(--sans);color:var(--ink2);cursor:pointer}
.stuck__back:hover{color:var(--accent)}
.stuck .stuck__note{font-size:15px;line-height:24px;color:var(--ink2)}
.stuck__field{display:grid;gap:6px}
.stuck__field label{font-size:14px;font-weight:500;color:var(--ink)}
.stuck__field input,.stuck__field textarea,.stuck__field select{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font:400 16px/1.4 var(--sans);color:var(--ink)}
.stuck__field textarea{resize:vertical}
.stuck .stuck__never{padding:10px 12px;border:1.5px solid var(--gold);border-radius:10px;font-size:14px;line-height:22px;color:var(--ink)}
.stuck .stuck__err{font-size:14px;font-weight:500;color:var(--ink)}
.stuck__send{width:100%}

.stuck-btn{position:fixed;right:20px;bottom:20px;z-index:20;height:48px;padding:0 20px;border:0;border-radius:24px;background:var(--accent);color:var(--on-accent);font:500 16px/1 var(--sans);box-shadow:var(--card-sh);cursor:pointer}
.stuck-btn:hover{background:var(--accent-hover)}
.stuck-panel{position:fixed;right:20px;bottom:20px;z-index:20;width:min(380px,calc(100vw - 40px));max-height:calc(100vh - 120px);display:flex;flex-direction:column;background:var(--bg);border:1px solid var(--hair);border-radius:16px;box-shadow:var(--card-sh)}
.stuck-panel[hidden],.stuck-btn[hidden]{display:none}
.stuck-panel__head{display:flex;align-items:center;justify-content:space-between;padding:8px 8px 8px 20px;border-bottom:1px solid var(--hair)}
.stuck-panel__title{font:500 12px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink3)}
.stuck-panel__close{width:44px;height:44px;border:0;background:none;font-size:24px;line-height:1;color:var(--ink2);cursor:pointer}
.stuck--panel{padding:18px 20px 16px;overflow:auto}
@media (max-width:600px){
  .stuck-btn{right:16px;bottom:16px}
  .stuck-panel{right:0;left:0;bottom:0;width:auto;max-height:85vh;border-radius:16px 16px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
  .stuck--inline{padding:16px}
  .stuck__opts--row{grid-template-columns:1fr}
}
@media print{.stuck-btn,.stuck-panel,.stuck--inline{display:none!important}}
.legal .guide__more{margin:14px 0 0;font-size:15px;color:var(--ink2)}
/* One setup page: each step's number and time sits above its heading. */
.guide h2 .guide__k{display:block;margin:0 0 6px;font:500 12px/16px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--gold-ink)}
.guide h2+p[id]{margin-top:0}
/* The helper should read as the one thing you can talk to on the page:
   a green header and edge, like the button that opens it. */
.stuck-panel{border-color:var(--accent);overflow:hidden}
.stuck-panel__head{background:var(--accent);border-bottom-color:var(--accent)}
.stuck-panel__title{color:var(--on-accent)}
.stuck-panel__close{color:var(--on-accent)}
.stuck-panel__close:focus-visible{outline-color:var(--on-accent);outline-offset:-4px}
