/* Docs (docs/*.html): a side index of all topics and a reading column. Builds on style.css (tokens, nav, footer) and
   fx.css (.legal spacing, .store, .toc). The menu paths of the app are drawn as a row of chips, the one thing that
   repeats on every page, so a reader can match them to the buttons on the phone. */

.docs__wrap { width: min(100% - 2 * var(--gutter), 74rem); margin-inline: auto; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(28px, 4.5vw, 72px); align-items: start; }

/* ---------- side index ---------- */
.dnav { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 4px 24px 0; scrollbar-width: thin; }
.dnav summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgb(var(--ink-rgb) / .72); font-weight: 800; color: var(--text); }
.dnav summary::-webkit-details-marker { display: none; }
.dnav summary::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--ease); }
.dnav details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.dnav summary:focus-visible { outline: 2.5px solid var(--sun); outline-offset: 3px; }
.js .dnav summary small { font-weight: 600; color: var(--dim); }
.dnav__home { display: block; margin: 0 0 14px; font: 400 1.15rem/1.1 var(--display); color: var(--text); text-decoration: none; }
.dnav__home[aria-current="page"] { color: var(--sun); }
.dnav ol { list-style: none; margin: 0; padding: 0; }
.dnav > details > ol, .dnav__list { display: grid; gap: 2px; }
.dnav li a { display: block; padding: 7px 12px; border-left: 3px solid transparent; border-radius: 0 10px 10px 0; color: var(--dim); font-weight: 700; font-size: .96rem; line-height: 1.3; text-decoration: none; }
.dnav li a:hover { color: var(--text); background: rgb(var(--v-rgb) / .14); }
.dnav li a:focus-visible { outline: 2.5px solid var(--sun); outline-offset: -2px; }
.dnav li a[aria-current="page"] { color: var(--sun); border-left-color: var(--sun); background: rgb(var(--v-rgb) / .12); }
.dnav li ol { margin: 2px 0 8px 15px; border-left: 1.5px solid var(--line); }
.dnav li ol a { font-weight: 600; font-size: .9rem; padding: 5px 10px; border-left: 0; border-radius: 8px; }

/* ---------- reading column ---------- */
.doc { min-width: 0; max-width: 46rem; }
.doc h1 { font-size: clamp(2.1rem, 5.2vw, 3.8rem); }
.doc .lead { margin-top: 26px; }
.doc__body { margin-top: clamp(30px, 4vw, 48px); display: grid; gap: clamp(34px, 4.4vw, 52px); }
.doc__body section { padding-top: clamp(20px, 2.6vw, 28px); border-top: 2px solid var(--line); }
.doc__body section > * + * { margin-top: 14px; }
.doc__body h2 { font: 400 clamp(1.35rem, 2.3vw, 1.8rem)/1.15 var(--display); letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.doc__body h3 { font-weight: 800; font-size: 1.05rem; color: var(--text); margin-top: 24px; }
.doc__body p, .doc__body li, .doc__body dd { color: var(--dim); }
.doc__body strong, .doc__body em { color: var(--text); }
.doc__body em { font-style: normal; font-weight: 700; }
.doc__body ul, .doc__body ol { margin-bottom: 0; padding-left: 1.25em; }
.doc__body li + li { margin-top: 7px; }
.doc__body ol.steps { counter-reset: step; list-style: none; padding-left: 0; display: grid; gap: 10px; }
.doc__body ol.steps > li { counter-increment: step; position: relative; margin: 0; padding-left: 44px; min-height: 30px; }
.doc__body ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: var(--on-violet); font-weight: 800; font-size: .9rem; }
.doc__body [id] { scroll-margin-top: 96px; }
[id] { scroll-margin-top: 96px; }

/* where to find it: the menu path as chips */
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.where > b { font-weight: 800; color: var(--text); margin-right: 2px; }
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; vertical-align: middle; }
.path > span { display: inline-block; padding: 2px 9px 3px; border-radius: 8px; border: 1.5px solid rgb(var(--v-rgb) / .55); background: rgb(var(--v-rgb) / .16); color: var(--text); font-weight: 700; font-size: .9em; line-height: 1.35; white-space: nowrap; }
.path > span + span::before { content: "\203A" / ""; margin: 0 7px 0 -1px; color: var(--sun); font-weight: 800; }
.path > span + span { border-left-width: 1.5px; }
.ui { display: inline-block; padding: 0 7px 1px; border-radius: 7px; border: 1.5px solid var(--line); background: rgb(var(--ink-rgb) / .6); color: var(--text); font-weight: 700; font-size: .92em; }

.tip { padding: 14px 16px 15px; border-radius: 14px; border-left: 4px solid var(--sun); background: rgb(var(--ink-rgb) / .66); }
.tip p { color: var(--dim); }
.tip p + p { margin-top: 8px; }
.tip strong { color: var(--sun); }
.doc .store div { background: rgb(var(--ink-rgb) / .62); }

/* screenshots */
.shot { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 16px; }
.shot img { display: block; width: 210px; max-width: 46%; height: auto; border-radius: 22px; border: 1.5px solid var(--line); background: var(--ink-2); }
.shot--wide img { width: 100%; max-width: 100%; border-radius: 16px; }
.shot figcaption { flex-basis: 100%; font-size: .88rem; color: var(--dim); }
/* how-to screenshots: the numbers drawn on a picture are the step numbers in the text next to it.
   Several pictures sit in one row that scrolls sideways when the column is too narrow. */
.shot__row { flex: 1 1 100%; min-width: 0; display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 8px; scrollbar-width: thin; }
.shot__row { align-items: flex-start; }
/* style.css gives .shot (the gallery on the start page) a fixed width, a tilt and a hover lift; none of that here */
.doc__body { grid-template-columns: minmax(0, 1fr); }
.doc__body > section { min-width: 0; }
.doc__body .shot { width: auto; flex: none; rotate: 0deg; transform: none; transition: none; cursor: auto; }
.doc__body .shot:hover::after { content: none; }
.shot__row img { flex: 0 0 auto; width: 260px; max-width: none; scroll-snap-align: start; border-radius: 18px; }
.shot__row img.is-strip { width: 360px; max-width: 100%; border-radius: 14px; }
.shot__row:focus-visible { outline: 2.5px solid var(--sun); outline-offset: 4px; border-radius: 18px; }

/* previous / next */
.pager { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: block; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); text-decoration: none; color: var(--text); font-weight: 800; }
.pager a small { display: block; font-weight: 600; color: var(--dim); font-size: .85rem; margin-bottom: 2px; }
.pager a:hover, .pager a:focus-visible { border-color: var(--sun); }
.pager__next { text-align: right; grid-column: 2; }

/* ---------- overview ---------- */
.tiles { list-style: none; margin: clamp(30px, 4vw, 48px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 14px; }
.tiles a { display: grid; gap: 8px; height: 100%; padding: 18px 18px 20px; border-radius: 18px; border: 1.5px solid var(--line); background: rgb(var(--ink-rgb) / .62); text-decoration: none; color: var(--text); transition: border-color .2s var(--ease); }
.tiles a:hover, .tiles a:focus-visible { border-color: var(--sun); }
.tiles h2 { font: 400 1.25rem/1.15 var(--display); }
.tiles p { color: var(--dim); font-size: .96rem; }
.tiles .path { font-size: .86rem; margin-top: 2px; }
.tiles__first { grid-column: 1 / -1; }
.tiles__first a { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 28px; padding: 22px 24px; }
.tiles__first a > div { display: grid; gap: 10px; justify-items: start; max-width: 34em; }
.tiles__first h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.tiles__first a > img { width: 104px; height: auto; border-radius: 14px; border: 1.5px solid var(--line); }
.overview__more { margin-top: clamp(28px, 4vw, 44px); color: var(--dim); max-width: 40em; }

@media (max-width: 960px) {
  .docs__wrap { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .dnav { position: static; max-height: none; overflow: visible; padding: 0; }
  .dnav details[open] > ol, .dnav details[open] > .dnav__list { margin-top: 10px; padding: 10px 6px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: rgb(var(--ink-rgb) / .72); }
  .dnav__home { margin: 8px 12px 4px; }
}
@media (min-width: 961px) {
  .js .dnav summary { display: none; }
}
@media (max-width: 560px) {
  .tiles__first a { grid-template-columns: minmax(0, 1fr); }
  .tiles__first a > img { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager__next { grid-column: 1; }
  .shot img { width: 160px; }
  .shot__row img { width: 220px; }
  .shot__row img.is-strip { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .dnav summary::after, .tiles a { transition: none; }
}
