/* The Downpay Help Center theme: candidate 1 ("Help Center") from the design
   canvas, built on the Downpay Design System. Colours, spacing, radii and type
   come from tokens.css (generated from design/tokens.json); this file only
   arranges them. Where the docs need something the system does not define,
   design/README.md says what was decided. */

/* ---- fonts: self-hosted, SIL Open Font License (fonts/OFL-*.txt) ---------- */
@font-face { font-family: Figtree; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/figtree-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/figtree-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Figtree; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/figtree-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/fonts/figtree-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Figtree; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/figtree-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Figtree; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/figtree-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo Narrow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/archivo-narrow-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo Narrow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/fonts/archivo-narrow-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- the docs' own scale and layout (design/README.md) -------------------- */
:root {
  --docs-title: 40px;          /* article and category titles */
  --docs-h1: 28px;             /* an article's top sections (Crisp-era h1) */
  --docs-h2: 22px;
  --docs-h3: 18px;
  --docs-body: 16px;
  --docs-leading: 1.6;         /* longer reading than the marketing 1.35 */
  --docs-measure: 720px;
  --docs-page: 1280px;
  --docs-gutter: 24px;
  --docs-header: 64px;
  --docs-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Warning callouts: the system's warning amber fails as text on white
     (2.4:1), so the label uses a darker amber that passes on the tint (5.3:1). */
  --docs-warning-ground: #fff4e0;
  --docs-warning-ink: #8a5a00;
}

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--dp-surface);
  color: var(--dp-text);
  font-family: var(--dp-font-sans);
  font-size: var(--docs-body);
  line-height: var(--docs-leading);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--dp-link); }
a:hover { color: var(--dp-link-hover); }
:focus-visible { outline: 2px solid var(--dp-violet); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--dp-black); color: var(--dp-white); padding: 8px 14px; border-radius: var(--dp-radius-card); z-index: 10; }
.skip-link:focus { left: 8px; color: var(--dp-white); }
.label, .nav-label, .nav-section, .callout-label, .brand-label {
  font-family: var(--dp-font-label);
  font-weight: var(--dp-label-weight);
  letter-spacing: var(--dp-label-tracking);
  text-transform: uppercase;
}

/* ---- buttons: the system's pill ------------------------------------------ */
.button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--dp-radius-pill); border: var(--dp-border-button) solid transparent;
  font-family: var(--dp-font-label); font-weight: var(--dp-label-weight);
  font-size: var(--dp-label-size); letter-spacing: var(--dp-label-tracking); text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.button-primary { background: var(--dp-action); color: var(--dp-text-inverse); }
.button-primary:hover { background: #5a4ee0; color: var(--dp-text-inverse); } /* darker, so the white label keeps 5.5:1 */
.button-secondary { background: transparent; color: var(--dp-text); border-color: var(--dp-border-strong); }
.button-secondary:hover { background: var(--dp-black); color: var(--dp-white); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- header and footer --------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--dp-border); background: var(--dp-surface); }
.site-header-inner {
  max-width: var(--docs-page); margin: 0 auto; padding: 10px var(--docs-gutter);
  min-height: var(--docs-header); display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--dp-text); text-decoration: none; }
.brand:hover { color: var(--dp-text); }
.brand .logo { width: 112px; height: auto; display: block; }
.brand-label { font-size: var(--dp-label-size); color: var(--dp-text-muted); padding-left: 12px; border-left: 1px solid var(--dp-hairline); line-height: 1.6; }
.site-nav { margin-left: auto; display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: 15px; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--dp-border); margin-top: 80px; }
.site-footer-inner {
  max-width: var(--docs-page); margin: 0 auto; padding: 32px var(--docs-gutter);
  display: flex; gap: 12px 24px; flex-wrap: wrap; font-size: 14px; color: var(--dp-text-muted);
}
.site-footer a { color: var(--dp-text-muted); }

/* ---- search -------------------------------------------------------------- */
.search {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 56px; padding: 0 6px 0 20px;
  background: var(--dp-surface); border: var(--dp-border-field) solid var(--dp-field-border);
  border-radius: var(--dp-radius-pill);
}
.search:focus-within { border-color: var(--dp-border-strong); box-shadow: 0 0 0 1px var(--dp-border-strong); }
.search-icon { display: flex; color: var(--dp-text-muted); }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--dp-text); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-compact { flex: 1 1 260px; max-width: 440px; height: 40px; padding: 0 16px; border-color: transparent; background: var(--dp-surface-sunken); }
.search-compact .search-input { font-size: 15px; }

/* ---- home ---------------------------------------------------------------- */
.home-hero { background: var(--dp-surface-sunken); }
.home-hero-inner {
  max-width: 760px; margin: 0 auto; padding: 72px var(--docs-gutter) 64px;
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.home-title { margin: 0; font-size: var(--dp-h2-size); font-weight: var(--dp-h2-weight); line-height: var(--dp-h2-leading); }
.home-popular { margin: 0; font-size: 15px; color: var(--dp-text-muted); }
.home-popular a { color: var(--dp-text-muted); }
.home { max-width: var(--docs-page); margin: 0 auto; padding: 64px var(--docs-gutter) 0; display: flex; flex-direction: column; gap: 64px; }
.section-heading { margin: 0 0 24px; font-size: var(--dp-h5-size); font-weight: var(--dp-h5-weight); line-height: var(--dp-h5-leading); }
.section-heading-sm { margin: 0 0 12px; font-size: var(--docs-h3); font-weight: 500; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 40px 48px; }
.topic { display: flex; flex-direction: column; gap: 8px; padding-top: 20px; border-top: 1px solid var(--dp-hairline); }
.topic-title { margin: 0 0 4px; font-size: 20px; font-weight: 500; line-height: 1.3; }
.topic-title a { text-decoration: none; }
.topic-title a:hover { text-decoration: underline; }
.topic-link { color: var(--dp-text-muted); text-decoration: none; line-height: 1.4; }
.topic-link:hover { text-decoration: underline; }
.topic-all { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; font-weight: 500; text-decoration: none; }
.home-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: start; }
.link-list { margin: 0; padding: 0; list-style: none; }
.link-list li { padding: 12px 0; border-bottom: 1px solid var(--dp-border); line-height: 1.4; }
.link-list a { text-decoration: none; }
.link-list a:hover { text-decoration: underline; }

/* ---- help panel ---------------------------------------------------------- */
.help-panel { background: var(--dp-surface-sunken); border-radius: var(--dp-radius-card); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.help-panel-title { margin: 0; font-size: var(--dp-h5-size); font-weight: var(--dp-h5-weight); line-height: var(--dp-h5-leading); }
.help-panel-text { margin: 0; color: var(--dp-text-muted); }
.article .help-panel { margin-top: 56px; }
.category .help-panel { margin-top: 56px; }

/* ---- breadcrumbs, category pages ----------------------------------------- */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--dp-text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--dp-text-muted); }
.category { max-width: 880px; margin: 0 auto; padding: 32px var(--docs-gutter) 0; }
.category-title { margin: 0; font-size: var(--docs-title); font-weight: 500; line-height: 1.2; }
.category-count { margin: 8px 0 32px; color: var(--dp-text-muted); }
.category-section { margin: 40px 0 8px; font-size: var(--dp-label-size); font-family: var(--dp-font-label); font-weight: var(--dp-label-weight); letter-spacing: var(--dp-label-tracking); text-transform: uppercase; color: var(--dp-text-muted); }
.article-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--dp-hairline); }
.article-list li { padding: 14px 0; border-bottom: 1px solid var(--dp-border); display: flex; flex-direction: column; gap: 2px; }
.article-list a { font-size: 17px; text-decoration: none; }
.article-list a:hover { text-decoration: underline; }
.article-list-description { color: var(--dp-text-muted); font-size: 15px; }

/* ---- article layout: nav | article | on this page ------------------------- */
.article-layout {
  max-width: var(--docs-page); margin: 0 auto; padding: 32px var(--docs-gutter) 0;
  display: grid; grid-template-columns: 220px minmax(0, var(--docs-measure)) 200px;
  justify-content: space-between; gap: 48px; align-items: start;
}
.article-nav, .page-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; font-size: 14px; padding-top: 44px; }
.nav-label { font-size: 12px; color: var(--dp-text-muted); text-decoration: none; padding-bottom: 8px; }
a.nav-label:hover { color: var(--dp-text); }
.nav-section { font-size: 11px; color: var(--dp-text-muted); padding: 16px 0 4px; }
.nav-link { display: block; padding: 6px 12px; margin-left: -12px; border-radius: var(--dp-radius-card); color: var(--dp-text-muted); text-decoration: none; line-height: 1.35; }
.nav-link:hover { color: var(--dp-text); background: var(--dp-surface-sunken); }
.nav-link.is-current { color: var(--dp-text); font-weight: 600; background: var(--dp-surface-sunken); }
.toc-link { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--dp-border); color: var(--dp-text-muted); text-decoration: none; line-height: 1.35; }
.toc-link:hover { color: var(--dp-text); border-left-color: var(--dp-text); }
.toc-level-2 { padding-left: 24px; }

@media (max-width: 1180px) {
  .article-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .page-toc { display: none; }
}
@media (max-width: 860px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-nav { display: none; }
}
/* Where the right-hand column shows, it replaces the Crisp-era "On this page"
   block inside the article; everywhere else that block is the table of contents. */
@media (min-width: 1181px) {
  .article-layout:has(.page-toc) .inline-toc { display: none; }
}

/* ---- the article itself -------------------------------------------------- */
.article-title { margin: 0; font-size: var(--docs-title); font-weight: 500; line-height: 1.2; }
.article-description { margin: 16px 0 0; font-size: var(--dp-body-md-size); line-height: 1.45; color: var(--dp-text-statement); }
.article-body { margin-top: 24px; }
.article-body > :first-child { margin-top: 0; }
.article-body p, .article-body ul, .article-body ol, .article-body table, .article-body pre, .article-body .callout, .article-body .embed { margin: 0 0 18px; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin: 4px 0; }
.article-body li > p { margin: 0; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5 { font-weight: 500; line-height: 1.25; scroll-margin-top: 24px; }
.article-body h1 { font-size: var(--docs-h1); margin: 48px 0 16px; }
.article-body h2 { font-size: var(--docs-h2); margin: 36px 0 12px; }
.article-body h3 { font-size: var(--docs-h3); margin: 28px 0 10px; }
.article-body h4, .article-body h5 { font-size: var(--docs-body); font-weight: 600; margin: 24px 0 8px; }
.article-body h6 {
  margin: 24px 0 8px; font-family: var(--dp-font-label); font-weight: var(--dp-label-weight);
  font-size: 13px; letter-spacing: var(--dp-label-tracking); text-transform: uppercase; color: var(--dp-text-muted);
}
.article-body hr { border: 0; border-top: 1px solid var(--dp-border); margin: 32px 0; }
.article-body hr + hr { display: none; } /* Crisp-era articles double their rules for spacing */
.article-body img { border-radius: var(--dp-radius-card); border: 1px solid var(--dp-border); }
.article-body a { text-underline-offset: 2px; }
.article-body strong { font-weight: 600; }
.article-body code {
  font-family: var(--docs-mono); font-size: 0.875em;
  background: var(--dp-surface-sunken); border: 1px solid var(--dp-border); border-radius: 4px; padding: 1px 5px;
}
.article-body pre { background: var(--dp-surface-sunken); border-radius: var(--dp-radius-card); padding: 16px 20px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--dp-border); text-align: left; vertical-align: top; }
.article-body th {
  background: var(--dp-surface-sunken); font-family: var(--dp-font-label); font-weight: var(--dp-label-weight);
  font-size: 13px; letter-spacing: var(--dp-label-tracking); text-transform: uppercase;
}
.article-body .embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--dp-radius-media); }

/* The Crisp-era in-article table of contents, on screens without the column. */
.inline-toc { background: var(--dp-surface-sunken); border-radius: var(--dp-radius-card); padding: 4px 20px 8px; margin: 0 0 24px; font-size: 15px; }
.inline-toc hr { display: none; }
.inline-toc h6 { margin-top: 14px; }
.inline-toc p, .inline-toc ul { margin: 0 0 6px; }
.inline-toc a { text-decoration: none; }
.inline-toc a:hover { text-decoration: underline; }

/* Callouts: _plugins/callouts.rb writes .callout-note, -tip and -warning. */
.callout {
  position: relative; background: var(--dp-surface-sunken); border-radius: var(--dp-radius-card);
  padding: 18px 22px 18px 56px;
}
.callout::before {
  content: ""; position: absolute; left: 22px; top: 20px; width: 20px; height: 20px;
  background: currentColor; -webkit-mask: var(--callout-icon) center / contain no-repeat; mask: var(--callout-icon) center / contain no-repeat;
}
.callout > :last-child { margin-bottom: 0; }
.callout p { margin: 0 0 8px; }
.callout-label { margin: 0 0 4px !important; font-size: 13px; line-height: 1.4; }
.callout-note { --callout-icon: url(/assets/icons/info.svg); color: var(--dp-text); }
.callout-tip { --callout-icon: url(/assets/icons/lightbulb.svg); }
.callout-tip::before, .callout-tip .callout-label { color: var(--dp-primary-1); }
.callout-tip { color: var(--dp-text); }
.callout-warning { --callout-icon: url(/assets/icons/warning.svg); background: var(--docs-warning-ground); }
.callout-warning::before, .callout-warning .callout-label { color: var(--docs-warning-ink); }

/* ---- related, 404 and search ---------------------------------------------- */
.related { margin-top: 40px; }
.not-found, .search-page { max-width: var(--docs-measure); margin: 0 auto; padding: 64px var(--docs-gutter) 0; }
.not-found h1, .search-page h1 { margin: 0 0 16px; font-size: var(--docs-title); font-weight: 500; line-height: 1.2; }
.search-page .search { margin-bottom: 24px; }
.search-status { color: var(--dp-text-muted); margin: 0 0 8px; }
.search-results { margin: 0; padding: 0; list-style: none; }
.search-results li { padding: 16px 0; border-bottom: 1px solid var(--dp-border); }
.search-results a { font-size: 18px; text-decoration: none; }
.search-results a:hover { text-decoration: underline; }
.search-result-meta { display: block; font-size: 14px; color: var(--dp-text-muted); }

@media (max-width: 640px) {
  :root { --docs-title: 32px; --docs-h1: 24px; --docs-h2: 20px; --docs-gutter: 20px; }
  .home-title { font-size: var(--dp-h3-size); }
  .home-hero-inner { padding: 48px var(--docs-gutter) 40px; }
  .search .button { display: none; }
  .site-nav { margin-left: 0; }
  .help-panel { padding: 24px; }
}

@media print {
  .site-header, .site-footer, .article-nav, .page-toc, .help-panel, .related { display: none; }
  .article-layout { display: block; }
  .inline-toc { display: block !important; }
}
