/* User Manual (website /manual and dashboard /help): language chooser, reader, search, numbered steps and screenshots.
   Plain, calm and readable: 15px body text, short lines, big tap targets. Logo colours only. */

.manual-page { max-width: 1240px; }

/* ------------------------------------------------------------------ language chooser */
.manual-choose { max-width: 760px; margin: 0 auto; padding: 28px 0 8px; text-align: center; }
.manual-choose h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -.025em; font-weight: 700; margin: 14px 0 10px; }
.manual-choose .lead { font-size: 15px; color: var(--muted); max-width: 520px; margin: 0 auto 26px; }
.lang-cards { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.lang-card { position: relative; display: grid; gap: 2px; justify-items: center; padding: 22px 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-align: center; transition: transform var(--mid) var(--ease), border-color var(--fast), box-shadow var(--mid) var(--ease); }
.lang-card b { font-size: 26px; font-weight: 650; line-height: 1.3; color: var(--indigo); }
.lang-card span { font-size: 13px; color: var(--muted); }
.lang-card > svg { width: 16px; height: 16px; stroke: var(--brass-700); margin-top: 8px; transition: transform var(--fast) var(--ease); }
.lang-card:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: 0 16px 28px -20px rgba(37, 42, 99, .5); text-decoration: none; }
.lang-card:hover > svg { transform: translateX(3px); }
.lang-card:focus-visible { outline: none; box-shadow: var(--ring); }
.lang-last { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--brass-tint); color: var(--brass-700); font-size: 11px; font-style: normal; font-weight: 700; }

/* ------------------------------------------------------------------ top bar: search + language */
.manual-top { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.manual-search { position: relative; flex: 1; min-width: min(100%, 320px); }
.manual-search > svg { position: absolute; left: 14px; top: 12px; width: 18px; height: 18px; stroke: var(--faint); pointer-events: none; }
.manual-search input[type=search] { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); font-size: 15px; box-shadow: var(--shadow-xs); }
.manual-search input[type=search]:focus { border-color: var(--accent); }
.manual-results, .manual-empty { position: absolute; z-index: 40; top: 50px; left: 0; right: 0; max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 20px 40px -14px rgba(37, 42, 99, .3); }
.manual-results[hidden], .manual-empty[hidden] { display: none; }
.mres { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); cursor: pointer; }
.mres:hover, .mres.is-active { background: var(--indigo-tint); text-decoration: none; }
.mres-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.mres-top b { font-weight: 650; color: var(--indigo); }
.mres-part { padding: 1px 8px; border-radius: 999px; background: var(--brass-tint); color: var(--brass-700); font-size: 11.5px; font-weight: 650; }
.mres-snip { font-size: 13.5px; color: var(--graphite); line-height: 1.5; }
.mres mark { background: rgba(196, 154, 82, .3); color: inherit; border-radius: 3px; padding: 0 1px; }
.manual-empty { padding: 14px 16px; }
.manual-empty p { margin: 0 0 10px; font-size: 14px; }
.manual-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-sugg button { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--accent); cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.manual-sugg button:hover { background: var(--indigo-tint); border-color: var(--accent); }
.manual-lang { white-space: nowrap; }

/* ------------------------------------------------------------------ contents + reader */
.manual-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.manual-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; font-size: 13.5px; }
.manual-toc summary { list-style: none; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); cursor: default; margin-bottom: 8px; }
.manual-toc summary::-webkit-details-marker { display: none; }
.toc-group { display: grid; gap: 1px; margin-bottom: 14px; }
.toc-group b { margin: 4px 0 4px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-700); }
.toc-group a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-left: 2px solid transparent; border-radius: 0 8px 8px 0; color: var(--muted); transition: background var(--fast), color var(--fast), border-color var(--fast); }
.toc-group a svg { width: 14px; height: 14px; flex: none; stroke: currentColor; }
.toc-group a:hover { background: var(--surface-hi); color: var(--text); text-decoration: none; }
.toc-group a[aria-current="true"] { background: var(--indigo-tint); border-left-color: var(--indigo); color: var(--indigo); font-weight: 600; }

.manual.js .msec { display: none; }
.manual.js .msec.on { display: block; animation: m-up .3s var(--ease) both; --rise: 8px; }
.msec { min-width: 0; }
.msec + .msec { margin-top: 56px; }
.msec-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.msec-ico { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--indigo); color: var(--brass-300); }
.msec-ico svg { width: 22px; height: 22px; stroke: currentColor; }
.msec-group { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brass-700); }
.msec-head h2 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.25; letter-spacing: -.02em; font-weight: 700; margin: 0 0 4px; scroll-margin-top: 90px; }
.msec-head h2:focus { outline: none; }
.msec-sum { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.msec-open { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.msec-open svg { width: 13px; height: 13px; stroke: currentColor; }

.mpart { margin: 0 0 18px; scroll-margin-top: 90px; }
.mpart h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--indigo); }
.mpart p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--graphite); max-width: 70ch; }
.mexample { padding: 14px 16px; border-radius: 12px; background: var(--brass-tint); border: 1px solid color-mix(in srgb, var(--brass) 35%, #fff); }
.mexample h3 { color: var(--brass-700); }

/* the steps sit beside the pictures; the number on a step is the number drawn on the picture */
.mhow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-hi); }
.mhow:not(:has(.mhow-shots)) { grid-template-columns: 1fr; }
.msteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.msteps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; font-size: 15px; line-height: 1.65; color: var(--text); scroll-margin-top: 90px; transition: background var(--mid); }
.msteps-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brass); color: var(--indigo-700); font-size: 13px; font-weight: 800; box-shadow: 0 0 0 3px rgba(196, 154, 82, .2); }
.mhow-shots { display: grid; gap: 14px; position: sticky; top: 90px; }
.mshot { margin: 0; }
.mshot a { display: block; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 14px 30px -22px rgba(37, 42, 99, .55); cursor: zoom-in; transition: transform var(--mid) var(--ease), box-shadow var(--mid); }
.mshot a:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -22px rgba(37, 42, 99, .6); }
.mshot img { display: block; width: 100%; height: auto; }
.mshot figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.mshot-note { margin: 0; }
.mmistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mmistakes li { padding: 10px 14px; border-left: 3px solid var(--hot); border-radius: 0 10px 10px 0; background: var(--surface-hi); scroll-margin-top: 90px; }
.mmistakes p { margin: 0; font-size: 14.5px; line-height: 1.65; }
.mmistakes p + p { margin-top: 2px; }
.mfaq { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; scroll-margin-top: 90px; }
.mfaq summary { padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; position: relative; padding-right: 36px; }
.mfaq summary::-webkit-details-marker { display: none; }
.mfaq summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--accent); }
.mfaq[open] summary::after { content: "–"; }
.mfaq p { margin: 0; padding: 0 14px 12px; font-size: 14.5px; line-height: 1.7; color: var(--graphite); }
.is-hit { animation: m-hit 2.2s var(--ease); }
@keyframes m-hit { 0%, 55% { background: rgba(196, 154, 82, .3); box-shadow: 0 0 0 6px rgba(196, 154, 82, .3); } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }

.msec-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.msec-nav a { display: inline-flex; align-items: center; gap: 10px; max-width: 48%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.msec-nav a:hover { border-color: var(--accent); text-decoration: none; }
.msec-nav a[rel="next"] { margin-left: auto; text-align: right; }
.msec-nav small { display: block; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.msec-nav svg { width: 16px; height: 16px; flex: none; stroke: var(--accent); }

.manual-zoom { width: min(96vw, 1400px); max-height: 94vh; padding: 10px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.manual-zoom::backdrop { background: rgba(27, 30, 51, .6); }
.manual-zoom img { display: block; max-width: 100%; max-height: calc(94vh - 20px); margin: 0 auto; }
.manual-zoom [data-zoom-close] { position: absolute; top: 14px; right: 14px; background: var(--surface); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1000px) {
  .manual-grid { grid-template-columns: 1fr; gap: 16px; }
  .manual-toc { position: static; max-height: none; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-hi); }
  .manual-toc summary { cursor: pointer; margin: 0; }
  .manual-toc details:not([open]) summary { margin: 0; }
  .manual-toc summary::after { content: "▾"; float: right; color: var(--faint); }
  .mhow { grid-template-columns: 1fr; }
  .mhow-shots { position: static; }
}
@media (max-width: 600px) {
  .mhow { padding: 14px; }
  .msec-head { gap: 10px; }
  .msec-ico { width: 38px; height: 38px; }
  .msec-nav a { max-width: 100%; flex: 1; }
  .msec-nav { flex-direction: column; }
  .msec-nav a[rel="next"] { margin-left: 0; }
  .manual-lang { width: 100%; justify-content: center; }
  .lang-card b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .manual.js .msec.on, .is-hit { animation: none; } .lang-card, .mshot a { transition: none; } }
@media print {
  .manual-top, .manual-toc, .msec-nav, .site-nav, .site-foot, .sidebar, .appbar, .wa-fab, .guide-fab { display: none !important; }
  .manual.js .msec { display: block !important; page-break-before: always; }
  .mhow { grid-template-columns: 1fr; background: none; }
  .mhow-shots { position: static; }
}
