/*
 * The EzyClub guides (inc/guides.php): on screen in the club console and on
 * the platform site, and as A4 print documents (templates/app/guides/_print.twig,
 * printed to PDF by bin/guide-pdfs.py). Self-contained: its own tokens, so it
 * reads the same inside the console's styles and the marketing site's.
 */
.gd, .gd-lib, .gd-print {
  /* Text and lines come from the page the guide sits in (the console's site.css or the marketing
     site's marketing.css define --ink, --ink-2, --line), so they follow that page's light/dark choice —
     including the ◐ toggle, which can differ from the device's setting. */
  --gd-ink: var(--ink, #1c2330); --gd-ink-2: var(--ink-2, #4a5566); --gd-line: var(--line, #dde2e8); --gd-soft: var(--surface-2, var(--bg-2, #f3f6f8));
  --gd-brand: #0E6B55; --gd-brand-soft: #e3f1ec; --gd-warm: #E29B2E; --gd-warn-soft: #fbf1df; --gd-warn: #9a5b00;
  /* One clean sans-serif for reading, whatever the surrounding page uses (the console's body is a serif). */
  --gd-font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* The accent and callout colours in dark mode — on the same rule as the host pages: the device's
   setting unless the ◐ toggle chose light, or the toggle chose dark. (Print is always light.) */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gd, :root:not([data-theme="light"]) .gd-lib { --gd-brand: #4fc1a0; --gd-brand-soft: #16302a; --gd-warn-soft: #33280f; --gd-warn: #f0b85a; }
}
@media screen {
  :root[data-theme="dark"] .gd, :root[data-theme="dark"] .gd-lib { --gd-brand: #4fc1a0; --gd-brand-soft: #16302a; --gd-warn-soft: #33280f; --gd-warn: #f0b85a; }
}
/* The print document always sets its own light colours. */
.gd-print { --gd-ink: #1c2330; --gd-ink-2: #4a5566; --gd-line: #dde2e8; --gd-soft: #f3f6f8; }

/* ---------- the library ---------- */
.gd-lib { color: var(--gd-ink); }
.gd-group { margin: 0 0 26px; }
.gd-group > h2 { font-size: 1.05rem; margin: 0 0 10px; color: var(--gd-ink-2); letter-spacing: .02em; }
.gd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.gd-card { border: 1px solid var(--gd-line); border-radius: 10px; padding: 14px 16px; background: var(--gd-soft); display: flex; flex-direction: column; }
.gd-card h3 { font-size: 1.02rem; margin: 2px 0 6px; }
.gd-card h3 a { color: inherit; text-decoration: none; }
.gd-card h3 a:hover { text-decoration: underline; }
.gd-card p { margin: 0 0 8px; font-size: .9rem; line-height: 1.45; color: var(--gd-ink-2); }
.gd-card-aud { font-size: .72rem !important; text-transform: uppercase; letter-spacing: .06em; color: var(--gd-brand) !important; margin: 0 !important; }
.gd-card-links { margin-top: auto !important; display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem !important; }
.gd-card-links a { color: var(--gd-brand); font-weight: 600; }
.gd-card.soon { opacity: .8; }
.gd-pill { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--gd-line); color: var(--gd-ink-2); }
.gd-handbook { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; color: var(--gd-ink-2); font-size: .9rem; }

/* ---------- one guide on screen ---------- */
.gd { color: var(--gd-ink); max-width: 1120px; font-family: var(--gd-font); }
.gd-head { margin: 0 0 18px; }
.gd-eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gd-brand); margin: 0 0 4px; }
.gd-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.15; margin: 0 0 8px; }
.gd-lede { font-size: 1.1rem; color: var(--gd-ink-2); max-width: 60ch; margin: 0 0 14px; line-height: 1.55; }
.gd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gd-btn { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--gd-brand); color: #fff; font-weight: 600; font-size: .88rem; text-decoration: none; border: 1px solid var(--gd-brand); }
.gd-btn.ghost { background: transparent; color: var(--gd-brand); }
.gd-soon { border: 1px dashed var(--gd-line); border-radius: 10px; padding: 18px; background: var(--gd-soft); max-width: 64ch; }
.gd-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.gd-toc { position: sticky; top: 14px; font-size: .9rem; line-height: 1.4; border-left: 2px solid var(--gd-line); padding-left: 14px; max-height: calc(100vh - 28px); overflow-y: auto; }
.gd-toc summary { font-weight: 700; cursor: pointer; margin-bottom: 8px; list-style: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gd-ink-2); }
.gd-toc summary::-webkit-details-marker { display: none; }
.gd-toc ol { margin: 0; padding-left: 18px; }
.gd-toc li { margin: 0 0 7px; }
.gd-toc a { color: var(--gd-ink-2); text-decoration: none; }
.gd-toc a:hover { color: var(--gd-brand); text-decoration: underline; }
.gd-pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 6px; border-top: 1px solid var(--gd-line); padding-top: 14px; }
.gd-pager a { text-decoration: none; color: var(--gd-brand); font-weight: 600; max-width: 48%; }
.gd-pager a span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gd-ink-2); font-weight: 400; }
.gd-next { text-align: right; margin-left: auto; }
@media (max-width: 820px) {
  .gd-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .gd-toc { position: static; border: 1px solid var(--gd-line); border-radius: 10px; padding: 10px 14px; background: var(--gd-soft); max-height: none; }
  .gd-toc summary { margin: 0; }
  .gd-toc summary::after { content: ' ▾'; color: var(--gd-ink-2); }
  .gd-toc ol { margin-top: 8px; }
}

/* ---------- the body (screen and print) ---------- */
.gd-body { font-family: var(--gd-font); font-size: 1.0625rem; line-height: 1.7; max-width: 50rem; color: var(--gd-ink); }
.gd-body p, .gd-body li, .gd-body td { color: var(--gd-ink); }
.gd-body h2 { font-family: var(--gd-font); font-size: 1.5rem; line-height: 1.25; margin: 40px 0 12px; padding-top: 18px; border-top: 1px solid var(--gd-line); scroll-margin-top: 16px; }
.gd-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.gd-body h3 { font-family: var(--gd-font); font-size: 1.15rem; margin: 26px 0 8px; }
.gd-body p, .gd-body ul, .gd-body ol { margin: 0 0 14px; }
.gd-body ul, .gd-body ol { padding-left: 22px; }
.gd-body li { margin: 0 0 7px; }
.gd-body a { color: var(--gd-brand); }
.gd-body code { font-size: .9em; background: var(--gd-soft); padding: 1px 5px; border-radius: 4px; }
.gd-body ol.steps { list-style: none; counter-reset: gdstep; padding-left: 0; }
.gd-body ol.steps > li { counter-increment: gdstep; position: relative; padding-left: 38px; margin-bottom: 10px; }
.gd-body ol.steps > li::before { content: counter(gdstep); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--gd-brand); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.gd-body aside.tip, .gd-body aside.warn { border-left: 4px solid var(--gd-brand); background: var(--gd-brand-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 0 0 14px; }
.gd-body aside.warn { border-color: var(--gd-warm); background: var(--gd-warn-soft); }
.gd-body aside > :last-child { margin-bottom: 0; }
.gd-body table.gtable { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: .92rem; }
.gd-body table.gtable th, .gd-body table.gtable td { border-bottom: 1px solid var(--gd-line); padding: 7px 8px; text-align: left; vertical-align: top; }
.gd-body table.gtable th { background: var(--gd-soft); font-weight: 700; }
.gd-body figure.shot { margin: 8px 0 22px; }
.gd-body figure.shot img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--gd-line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
@media screen { .gd-body figure.shot img { cursor: zoom-in; } }
/* A screenshot opened full size (templates/app/guides/_screen.twig). */
.gd-zoom { position: fixed; inset: 0; z-index: 1000; background: rgba(12,16,22,.88); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.gd-zoom img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.gd-zoom p { position: fixed; bottom: 10px; left: 0; right: 0; text-align: center; color: #e8ecf1; font: .85rem var(--gd-font); margin: 0; }
.gd-body figure.shot figcaption { font-size: .9rem; color: var(--gd-ink-2); margin-top: 8px; line-height: 1.45; }
@media (max-width: 820px) { .gd-body table.gtable { display: block; overflow-x: auto; } }
/* On paper a wide table can't scroll: it shrinks its type and wraps long words so every column fits the A4 page. */
@media print {
  .gd-body table.gtable { display: table; table-layout: fixed; font-size: 8.5pt; overflow: visible; }
  .gd-body table.gtable th, .gd-body table.gtable td { padding: 4px 5px; overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
}

/* ---------- A4 print documents ---------- */
@page { size: A4; margin: 18mm 16mm 20mm; }
.gd-print { margin: 0; color: #1c2330; font: 10.5pt/1.5 "Helvetica Neue", Arial, "Liberation Sans", sans-serif; background: #fff; }
.gd-print .gd-body { max-width: none; font-size: 10.5pt; font-family: inherit; line-height: 1.5; }
.gd-print .gd-body h2 { border-top: 0; padding-top: 0; }
.gd-print .gd-body h2 { font-size: 15pt; margin: 18pt 0 6pt; break-after: avoid; page-break-after: avoid; }
.gd-print .gd-body h3 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
.gd-print .gd-body figure, .gd-print .gd-body table, .gd-print .gd-body aside, .gd-print .gd-body ol.steps > li { break-inside: avoid; page-break-inside: avoid; }
.gd-print .gd-body figure.shot img { max-height: 105mm; width: auto; margin: 0 auto; }
.gd-print .gd-body p, .gd-print .gd-body li { orphans: 3; widows: 3; }
.gd-print .gd-body a { color: #0E6B55; text-decoration: none; }
.gd-print .gd-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #4a5566; word-break: break-all; }
.gp-cover { height: 250mm; display: flex; flex-direction: column; justify-content: center; break-after: page; page-break-after: always; }
.gp-mark { display: flex; align-items: center; gap: 12px; font-size: 20pt; font-weight: 800; color: #0E6B55; margin-bottom: 40mm; }
.gp-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 9pt; color: #0E6B55; margin: 0 0 6pt; font-weight: 700; }
.gp-cover h1 { font-size: 30pt; line-height: 1.1; margin: 0 0 10pt; }
.gp-aud { font-size: 12pt; color: #4a5566; max-width: 140mm; margin: 0; }
.gp-meta { margin-top: auto; border-top: 2px solid #0E6B55; padding-top: 8pt; font-size: 9.5pt; color: #4a5566; display: flex; justify-content: space-between; }
.gp-meta p { margin: 0; }
.gp-contents { margin: 0 0 16pt; padding-bottom: 12pt; border-bottom: 1px solid #dde2e8; }
.gd-print.handbook .gp-contents { break-after: page; page-break-after: always; border: 0; }   /* one guide: the body follows its contents; the handbook's long list gets its own page */
.gp-contents-h { font-size: 18pt; margin: 0 0 12pt; }
.gp-toc { margin: 0; padding-left: 18pt; font-size: 11pt; }
.gp-toc li { margin: 0 0 5pt; }
.gp-toc ol { padding-left: 16pt; margin: 4pt 0 8pt; font-size: 9.5pt; color: #4a5566; }
.gp-toc a { color: inherit; text-decoration: none; }
.gp-doc + .gp-doc { break-before: page; page-break-before: always; }
.gp-doc-head { margin: 0 0 14pt; padding-bottom: 8pt; border-bottom: 2px solid #0E6B55; }
.gp-doc-head h1 { font-size: 22pt; margin: 0 0 4pt; }
@media print { .gd-actions, .gd-pager, .gd-toc { display: none; } }
