/* Pathium manual pages. Builds on site.css (theme tokens, header, footer, theme switch). */

.manual {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  flex: 1;
  padding: 30px 20px 28px;
  line-height: 1.65;
  font-size: 1.02rem;
}
.manual h1 {
  margin: 8px 0 12px;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2rem, 7vw, 2.7rem);
  letter-spacing: -0.01em;
  line-height: 1.12;
}
.manual .lede { margin: 0 0 26px; font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.manual .lede strong { color: var(--text); font-weight: 600; }
.manual p { margin: 0 0 14px; color: var(--muted); }
.manual p strong, .manual li strong { color: var(--text); font-weight: 600; }
.manual a { color: var(--accent); text-underline-offset: 3px; }
.manual a:hover { filter: brightness(1.15); }
.manual ul, .manual ol { margin: 0 0 16px; padding-left: 1.25em; color: var(--muted); }
.manual li { margin: 0 0 8px; padding-left: 4px; }
.manual ul li::marker { color: var(--accent); }
.manual ol.steps-list { list-style: none; counter-reset: s; padding-left: 0; }
.manual ol.steps-list li { counter-increment: s; position: relative; padding: 0 0 12px 40px; margin: 0; }
.manual ol.steps-list li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent); font-size: 0.8rem; font-weight: 700;
  display: grid; place-items: center;
}

/* breadcrumb + on-this-page + sections */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs span { opacity: 0.6; }
.toc {
  margin: 0 0 30px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.toc p { margin: 0 0 8px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 28px; }
.toc li { margin: 0 0 6px; padding: 0; break-inside: avoid; }
.toc a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { color: var(--accent); }
.msec { display: flow-root; margin: 0 0 8px; }
.manual h2 {
  margin: 36px 0 12px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 1.28rem; letter-spacing: -0.01em; line-height: 1.3; scroll-margin-top: 20px;
}
.manual .msec:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 8px; }

/* tips */
.tip {
  margin: 0 0 16px; padding: 14px 16px 4px; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 9%, var(--card)); border-left: 3px solid var(--accent);
}
.tip > strong { display: block; margin-bottom: 4px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tip p { color: var(--text); opacity: 0.9; }

/* screenshots: a phone frame; the dark and light versions swap with the site theme.
   On wide screens each section puts its screenshots in a column beside the text. */
.mrow { display: block; }
.mfigs { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.m-shot { margin: 8px auto 10px; text-align: center; }
.m-shot .phone {
  position: relative; display: inline-block; margin: 0; width: min(62vw, 250px); padding: 6px; border-radius: 40px; background: #0d0d0f;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
:root[data-theme="light"] .m-shot .phone { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.2); }
.m-shot img { display: block; width: 100%; height: auto; border-radius: 34px; background: #111; }
.m-shot .shot-light { display: none; }
:root[data-theme="light"] .m-shot .shot-dark { display: none; }
:root[data-theme="light"] .m-shot .shot-light { display: block; }
.m-shot figcaption { margin: 10px auto 0; max-width: 30ch; font-size: 0.84rem; line-height: 1.45; color: var(--muted); }
@media (min-width: 900px) {
  .manual { max-width: 980px; }
  .mrow { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 44px; align-items: start; }
  .mfigs { position: sticky; top: 18px; }
  .m-shot .phone { width: 212px; }
  .mrow .mtext > :last-child { margin-bottom: 0; }
  /* text-only pages stay in a comfortable reading width */
  .manual > h1, .manual > .lede, .manual > .toc, .manual > .crumbs { max-width: 700px; }
  .msec > .mtext, .msec > h2 { max-width: 700px; }
}

/* tap-to-enlarge */
.m-shot .zoom { cursor: zoom-in; border: 0; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.m-shot .zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.zoom-dialog { padding: 0; border: 0; background: transparent; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; color: #fff; }
.zoom-dialog::backdrop { background: rgba(0, 0, 0, 0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.zoom-dialog[open] { display: flex; flex-direction: column; align-items: center; }
.zoom-scroll { flex: 1; min-height: 0; width: 100%; overflow: auto; display: flex; padding: 18px; }
.zoom-scroll img { margin: auto; display: block; max-height: calc(100dvh - 90px); max-width: 100%; width: auto; height: auto; border-radius: 26px; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.zoom-dialog.actual .zoom-scroll img { max-height: none; max-width: none; width: 1206px; border-radius: 40px; cursor: zoom-out; }
.zoom-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.zoom-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.zoom-hint { margin: 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); font-size: 0.8rem; color: rgba(255, 255, 255, 0.65); }

/* previous / next */
.pager { display: flex; justify-content: space-between; gap: 14px; margin: 38px 0 6px; padding-top: 22px; border-top: 1px solid var(--line); clear: both; }
.pager a {
  display: block; flex: 1 1 0; max-width: 48%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.35;
}
.pager a:hover { border-color: var(--accent); }
.pager a span { display: block; margin-bottom: 2px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pager .next { text-align: right; margin-left: auto; }

/* manual home */
.mgrid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 6px 0 30px; align-items: start; }
.mcat { padding: 20px 20px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; scroll-margin-top: 20px; }
.manual .mcat h2 { margin: 0 0 8px; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.mcat h2 i { width: 12px; height: 12px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 10px color-mix(in srgb, var(--cat) 60%, transparent); }
.mcat ul { list-style: none; margin: 0; padding: 0; }
.mcat li { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mcat li:first-child { border-top: 0; }
.mcat li a { display: block; padding: 12px 2px; text-decoration: none; color: var(--text); }
.mcat li a:hover strong { color: var(--cat); }
.mcat li a strong { display: block; font-weight: 600; }
.mcat li a span { display: block; margin-top: 2px; font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
@media (min-width: 760px) { .mgrid { grid-template-columns: 1fr 1fr; } }

/* search */
.msearch { position: relative; margin: 0 0 24px; }
.msearch input {
  width: 100%; padding: 14px 16px 14px 44px; font: inherit; font-size: 1.02rem; color: var(--text);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 20px;
  border: 1px solid var(--line); border-radius: 14px; outline: none; -webkit-appearance: none; appearance: none;
}
.msearch input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; max-height: 60vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.results a { display: block; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.results a:first-child { border-top: 0; }
.results a:hover, .results a[aria-selected="true"] { background: var(--card); }
.results .rt { font-weight: 600; }
.results .rc { margin-left: 8px; font-size: 0.78rem; color: var(--muted); }
.results .rx { display: block; margin-top: 2px; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.results mark { background: color-mix(in srgb, var(--accent) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.results .none { padding: 14px 16px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.manual .note { margin-top: 6px; font-size: 0.92rem; }

@media print {
  .mrow { display: block; } .mfigs { position: static; } .m-shot { break-inside: avoid; }
  .m-shot .shot-dark { display: none !important; }
  .m-shot .shot-light { display: block !important; }
  .pager, .msearch, .toc { display: none; }
}
