/* ==========================================================
   User guide (guide.html): sidebar index, quick search, annotated screenshots.
   Uses the site's colours (style.css) and logical properties, like the rest of the site.
   ========================================================== */

.guide-head .search { position: relative; max-width: 560px; margin-block-start: 1.2rem; }
.guide-head .search input { padding-inline-start: 2.6rem; font-size: 1.05rem; background: var(--surface); }
.guide-head .search .ico { position: absolute; inset-inline-start: .8rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; }
.search-info { color: var(--muted); font-size: .92rem; margin-block-start: .5rem; min-height: 1.4em; }

.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.5rem; padding-block: 2.5rem 5rem; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: .93rem; padding-inline-end: .5rem; }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc [data-toc] > ol > li { margin-block-end: .5rem; }
.toc a { color: var(--text); text-decoration: none; display: block; padding: .15rem .5rem; border-radius: 6px; }
.toc a:hover { background: var(--green-tint); color: var(--green-dark); }
.toc a.on { background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.toc [data-toc] > ol > li > a { font-weight: 600; color: var(--heading); }
.toc ol ol { padding-inline-start: .8rem; margin-block-start: .15rem; }
.toc .hidden { display: none; }
.toc-mobile { display: none; }

.guide-body { min-width: 0; }
.chapter { margin-block-end: 3.5rem; }
.chapter > h2 { display: flex; align-items: center; gap: .7rem; font-size: 1.7rem; font-weight: 600; padding-block-end: .6rem; border-block-end: 2px solid var(--green); scroll-margin-top: 84px; }
.chapter > h2 .tile { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--green-tint); flex: none; }
.topic { scroll-margin-top: 84px; padding-block: 1.2rem .4rem; }
.topic h3 { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.topic p, .topic li { color: var(--text); }
.topic ol, .topic ul { padding-inline-start: 1.3rem; }
.topic li { margin-block-end: .35rem; }
.topic.hidden, .chapter.hidden { display: none; }
.ui { font-weight: 600; color: var(--heading); background: var(--alt); border: 1px solid var(--border); border-radius: 5px; padding: 0 .35em; white-space: nowrap; }
kbd { font: inherit; }

/* Platform badges */
.os { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .1rem .55rem; border-radius: 20px; background: var(--pill-bg); color: var(--pill-text); vertical-align: middle; }
.os .ico { width: 14px; height: 14px; stroke: currentColor; }

/* Tips and warnings */
.tip, .warn { border-radius: var(--radius); padding: .8rem 1rem; margin-block: 1rem; display: flex; gap: .7rem; align-items: flex-start; }
.tip { background: var(--green-tint); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); }
.warn { background: #fff4e5; border: 1px solid #f0b46a; }
.tip .ico, .warn .ico { margin-block-start: .15rem; }
.warn .ico { stroke: var(--orange); }
.tip p, .warn p { margin: 0; }

/* Annotated screenshots: numbered markers placed in % over the image, explained in the list beside it */
.shot { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 1.5rem; align-items: start; margin-block: 1.2rem 1.6rem; }
.shot.wide { grid-template-columns: minmax(0, 360px) 1fr; }
.shot figure { margin: 0; position: relative; }
.shot img { width: 100%; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); background: var(--surface); }
.mk { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; font-size: .82rem; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.box { position: absolute; border: 2.5px solid var(--orange); border-radius: 8px; pointer-events: none; }
.legend { list-style: none; padding: 0 !important; margin: 0; counter-reset: none; }
.legend li { position: relative; padding-inline-start: 2.3rem; margin-block-end: .7rem; }
.legend li b.n { position: absolute; inset-inline-start: 0; top: .05rem; width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.shots-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-block: 1rem; }
.shots-row figure { margin: 0; }
.shots-row img { width: 100%; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.shots-row figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-block-start: .4rem; }

/* Diagrams */
.diagram { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-block: 1rem 1.5rem; }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { color: var(--muted); font-size: .9rem; margin-block-start: .5rem; text-align: center; }

/* Tables */
.gtable { width: 100%; border-collapse: collapse; margin-block: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
.gtable th, .gtable td { text-align: start; padding: .6rem .8rem; border-block-end: 1px solid var(--border); vertical-align: top; }
.gtable th { background: var(--alt); color: var(--heading); font-weight: 600; }
.gtable tr:last-child td { border-block-end: 0; }
.state { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; white-space: nowrap; }
.state i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-inline-start: 2.6rem; margin-block-end: .9rem; }
.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem; }

mark.hit { background: #ffe58a; color: inherit; padding: 0 .1em; border-radius: 3px; }
.no-results { display: none; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; color: var(--muted); }
.no-results.show { display: block; }

/* In the app (?app=1): no site header or footer; the search stays on top */
.in-app .guide-head { padding-block: 1rem; }
.in-app .guide-head h1, .in-app .guide-head .lead { display: none; }
.in-app .toc, .in-app .toc-mobile { top: 8px; }

@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); padding-block-start: 1rem; }
  .gtable { display: block; overflow-x: auto; }
  .guide-head h1 { font-size: 1.9rem; }
  .toc { display: none; }
  .toc-mobile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-block-end: 1.5rem; }
  .toc-mobile summary { cursor: pointer; padding: .8rem 1rem; font-weight: 600; color: var(--heading); }
  .toc-mobile .toc { display: block; position: static; max-height: none; padding: 0 1rem 1rem; }
  .shot, .shot.wide { grid-template-columns: 1fr; }
  .shot figure { max-width: 320px; margin-inline: auto; }
}
@media print { .site-header, .site-footer, .toc, .toc-mobile, .guide-head .search, .search-info { display: none !important; } .guide { display: block; } }
