/* Shared by the online manuals and the PDF build. */
:root {
  --bg: #f3f5f8; --surface: #fff; --text: #202e40; --muted: #596a7e;
  --border: #dce3ec; --accent: #235fb4; --accent-soft: #eaf2fc; --code-bg: #edf1f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18232e; --surface: #222e3a; --text: #f3f6f8; --muted: #aebbc7;
    --border: #3a4a5b; --accent: #8cbdff; --accent-soft: #2b4054; --code-bg: #304050;
  }
}
:root[data-theme="dark"] {
  --bg: #18232e; --surface: #222e3a; --text: #f3f6f8; --muted: #aebbc7;
  --border: #3a4a5b; --accent: #8cbdff; --accent-soft: #2b4054; --code-bg: #304050;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.75 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; left: 16px; top: -100px; padding: 12px; background: var(--surface); z-index: 10; }
.skip-link:focus { top: 12px; }
.layout { display: flex; gap: 48px; max-width: 1280px; margin: auto; padding: 0 32px; }
.toc { position: sticky; top: 0; align-self: flex-start; width: 252px; flex: 0 0 252px; height: 100vh; overflow-y: auto; padding: 32px 0; }
.toc a { display: block; padding: 7px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .85rem; }
.toc a:hover { background: var(--surface); color: var(--text); }
.toc a.sub { padding-left: 28px; font-size: .8rem; }
.toc h2 { margin: 28px 12px 12px; color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.toc .manual-brand { color: var(--text); font-size: 1.35rem; font-weight: 750; line-height: 1.2; padding: 0 12px 28px; }
.brand-mark { float: left; display: grid; place-items: center; width: 40px; height: 40px; margin-right: 12px; background: #235fb4; color: #fff; border-radius: 6px; font-size: 24px; }
.brand-caption { display: block; font-size: .7rem; font-weight: 450; color: var(--muted); margin-top: 4px; }
.content { flex: 1; min-width: 0; max-width: 880px; padding: 32px 0 48px; }
.doc-header { position: relative; overflow: hidden; background: #20364f; color: #fff; padding: 42px; border-radius: 12px; border-top: 4px solid #6aaaff; }
.doc-header .eyebrow { margin: 0 0 20px; color: #b5d6ff; font-size: .7rem; font-weight: 750; letter-spacing: .18em; }
.doc-header h1 { margin: 0 0 20px; font-size: clamp(2rem, 3.5vw, 3.2rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 750; }
.hero-description { max-width: 560px; color: #d5e0ed; margin: 0; line-height: 1.7; }
.header-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.btn-pdf { display: inline-flex; align-items: center; gap: 20px; background: #fff; color: #20364f; padding: 10px 16px; border-radius: 6px; text-decoration: none; font-size: .85rem; font-weight: 700; }
.btn-pdf:hover { background: #e0eeff; }
.header-meta { color: #bdd0e5; font-size: .75rem; }
.quick-start { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 36px; }
.quick-start a { position: relative; display: flex; flex-direction: column; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; }
.quick-start a:hover { border-color: var(--accent); }
.card-number { color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .08em; margin-bottom: 16px; }
.quick-start strong { font-size: .88rem; line-height: 1.45; margin-bottom: 8px; }
.quick-start a > span:not(.card-number):not(.card-arrow) { color: var(--muted); font-size: .78rem; line-height: 1.6; }
.card-arrow { position: absolute; right: 16px; top: 14px; color: var(--muted); }
section { scroll-margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 30px 36px; margin-bottom: 18px; }
section > h2 { font-size: 1.4rem; line-height: 1.35; letter-spacing: -.02em; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
section h3 { font-size: 1rem; margin: 26px 0 8px; scroll-margin-top: 24px; }
p { margin: 12px 0; }
section > :last-child { margin-bottom: 0; }
ul, ol { padding-left: 24px; }
li { padding-left: 5px; margin: 10px 0; }
li::marker { color: var(--accent); font-weight: 700; }
code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 16px 20px; border-radius: 0 6px 6px 0; margin: 22px 0; font-size: .92rem; }
.muted, .doc-footer { color: var(--muted); }
.doc-footer { font-size: .78rem; margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 1000px) {
  .layout { gap: 24px; padding: 0 24px; }
  .toc { width: 220px; flex-basis: 220px; }
  .doc-header { padding: 30px; }
  .quick-start { grid-template-columns: 1fr; }
  .quick-start a { padding: 16px 20px 16px 52px; }
  .card-number { position: absolute; left: 18px; top: 17px; }
  .quick-start strong { margin-bottom: 2px; padding-right: 14px; }
  section { padding: 24px; }
}
@media (max-width: 720px) {
  .layout { display: block; padding: 0 16px; }
  .toc { position: static; width: auto; height: auto; padding: 24px 0 0; }
  .toc > a:not(.manual-brand) { display: inline-block; margin: 0 4px 6px 0; padding: 7px 10px; border: 1px solid var(--border); background: var(--surface); font-size: .75rem; }
  .toc > a.sub { display: none; }
  .toc h2 { margin: 20px 0 10px; }
  .toc .manual-brand { padding-left: 0; }
  .content { padding-top: 24px; }
  .doc-header { padding: 28px 24px; }
  section { padding: 24px 20px; }
  section > h2 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Screenshots shown inside a phone bezel. Images are dark-themed app captures,
   so the dark frame reads as a device on the light manual page. */
.shots { display: flex; flex-wrap: wrap; gap: 24px; margin: 26px 0 6px; align-items: flex-start; }
figure.phone { margin: 0; flex: 0 0 auto; width: 234px; max-width: 100%; }
figure.phone .frame { background: #0f1722; border: 1px solid var(--border); border-radius: 26px; padding: 8px; box-shadow: 0 12px 30px rgba(20,35,55,.18); }
figure.phone img { display: block; width: 100%; border-radius: 18px; }
figure.phone figcaption { margin-top: 12px; color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; }
@media (max-width: 720px) { .shots { gap: 16px; justify-content: center; } figure.phone { width: 200px; } }
/* Plan comparison table. */
.plan-table-wrap { overflow-x: auto; margin: 18px 0; }
.plan-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.plan-table th, .plan-table td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.plan-table thead th { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.plan-table td:nth-child(3), .plan-table td:nth-child(4), .plan-table td:nth-child(5) { text-align: center; }
.plan-table tbody tr:last-child td { font-style: italic; color: var(--muted); }
/* Collapsible owner/member blocks. */
.manual-details { border: 1px solid var(--border); border-radius: 8px; margin: 16px 0; background: var(--surface); }
.manual-details > summary { cursor: pointer; padding: 14px 18px; font-size: 1rem; list-style: none; display: flex; align-items: center; gap: 10px; }
.manual-details > summary::-webkit-details-marker { display: none; }
.manual-details > summary::before { content: "▸"; color: var(--accent); transition: transform .15s ease; }
.manual-details[open] > summary::before { transform: rotate(90deg); }
.manual-details[open] > summary { border-bottom: 1px solid var(--border); }
.details-body { padding: 6px 14px 18px; }
.details-body > :first-child { margin-top: 10px; }
/* "What to click" navigation callout. */
.how { margin: 14px 0; padding: 9px 14px; background: var(--accent-soft); border-radius: 6px; font-size: .9rem; line-height: 1.6; }
.how strong { color: var(--accent); }
/* Back-to-app button: only shown when the manual is opened from the chat app
   (body gets .from-chat via a query flag); hidden on direct /manual visits. */
.manual-back { position: fixed; top: 12px; left: 12px; z-index: 50; display: none; align-items: center; gap: 8px; padding: 9px 15px; background: var(--accent); color: #fff; border: none; border-radius: 999px; font: 600 .85rem/1 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(20,35,55,.25); }
.manual-back:hover { filter: brightness(1.06); }
body.from-chat { padding-top: 58px; }
body.from-chat .manual-back { display: inline-flex; }
/* Explicit print colors also support wkhtmltopdf's older CSS engine. */
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body { background: #fff; color: #202e40; font-size: 11pt; }
  .toc, .btn-pdf, .no-print, .skip-link, .header-meta { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .content { max-width: none; padding: 0; }
  .doc-header { background: #fff; color: #202e40; padding: 20px 0; border: 0; border-bottom: 2px solid #235fb4; border-radius: 0; }
  .doc-header h1 { font-size: 28pt; }
  .doc-header .eyebrow, .hero-description { color: #596a7e; }
  .header-actions { display: none; }
  section { background: #fff; border: 0; padding: 20px 0 0; margin: 0; }
  section > h2 { page-break-before: always; break-before: page; padding-top: 0; border: 0; }
  h2, h3 { page-break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .note { border: 1px solid #bbb; background: #f4f4f4; page-break-inside: avoid; }
  a { color: #202e40; text-decoration: none; }
  .doc-footer { color: #596a7e; }
  .shots { gap: 8mm; page-break-inside: avoid; margin: 6mm 0; }
  figure.phone { width: 50mm; page-break-inside: avoid; }
  figure.phone .frame { box-shadow: none; border: 1px solid #c8c8c8; background: #eef1f4; padding: 2mm; border-radius: 4mm; }
  figure.phone img { border-radius: 3mm; }
  figure.phone figcaption { color: #596a7e; font-size: 8.5pt; }
  .plan-table { font-size: 9.5pt; page-break-inside: avoid; }
  .plan-table th, .plan-table td { border: 1px solid #bbb; }
  .plan-table thead th { background: #eef2f7; }
  /* Force collapsed sections to print their full content. */
  .manual-details { border: 1px solid #ccc; page-break-inside: avoid; }
  .manual-details > summary { font-weight: 700; }
  .manual-details > summary::before { content: ""; }
  .manual-details > *:not(summary) { display: block !important; }
  .how { background: #eef2f7; }
}
