/* Secondary pages (support, legal, learn, affiliates) in the app's look.
   Load order: /assets/v3.css (nav + footer, shared with the homepage), then app-tokens.css, then this file.
   Everything here is scoped under .pg so it can't touch the nav or the footer. */

.pg { max-width: 1180px; margin: 28px auto 0; padding: 0 0 8px; text-shadow: none; font: 400 14px/1.5 var(--bl-font); color: var(--bl-ink); }
@media (max-width: 1220px) { .pg { margin-inline: calc(var(--pad) - var(--gap)); } }   /* same side edges as the nav and the footer */
.pg :focus-visible { outline: 2px solid var(--bl-focus); outline-offset: 2px; }
.pg ::selection { background: color-mix(in srgb,var(--ink) 18%,transparent); }
.pg a { color: var(--bl-ink); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--bl-accent); color: var(--bl-on-accent); font: 600 13px var(--bl-font); }
.skip:focus { left: 16px; }

/* Page head */
.pg-head { padding: 40px 4px 28px; }
.pg-head .bl-eyebrow { display: block; margin-bottom: 12px; }
.pg-title { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.pg-lede { margin: 12px 0 0; max-width: 640px; font-size: 15.5px; line-height: 1.55; color: var(--bl-muted); }
.pg-meta { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* The page itself is now the app's rounded panel (v3.css .page), so this wrapper just holds the content. */
.pg-panel { padding: 0 4px; }

/* Document layout: sticky contents rail + reading column */
.pg-doc { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
.pg-toc { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow: auto; }
.pg-toc .bl-eyebrow { padding: 0 10px 8px; }
.pg-toc a { display: flex; align-items: center; min-height: 30px; padding: 4px 10px; border-radius: var(--bl-r-xs); font-size: 13px; line-height: 1.3; color: var(--bl-muted); transition: background .15s, color .15s; }
.pg-toc a:hover { background: var(--bl-wash-8); color: var(--bl-ink); }
@media (max-width: 900px) { .pg-doc { grid-template-columns: 1fr; gap: 0; } .pg-toc { display: none; } }

.pg-body { max-width: 720px; min-width: 0; }
.pg-body > section { scroll-margin-top: 92px; padding: 28px 0; border-top: 1px solid var(--bl-rule); }
.pg-body > section:first-child { padding-top: 0; border-top: 0; }
.pg-body > section:last-child { padding-bottom: 4px; }
.pg-body h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.2px; line-height: 1.3; }
.pg-body h3 { margin: 22px 0 6px; font-size: 14.5px; font-weight: 600; letter-spacing: -.1px; }
.pg-body p, .pg-body li { font-size: 14.5px; line-height: 1.7; color: color-mix(in srgb,var(--ink) 78%,transparent); }
.pg-body p { margin: 0 0 12px; }
.pg-body ul, .pg-body ol { margin: 0 0 12px; padding-left: 20px; }
.pg-body li { margin: 0 0 6px; }
.pg-body li::marker { color: var(--bl-faint); }
.pg-body b, .pg-body strong { color: var(--bl-ink); font-weight: 600; }
.pg-body a { text-decoration: underline; text-decoration-color: var(--bl-rule); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.pg-body a:hover { text-decoration-color: var(--bl-ink); }
.pg-body code { font: 12.5px var(--bl-mono); padding: 1px 6px; border-radius: 5px; background: var(--bl-wash-8); color: var(--bl-ink); word-break: break-word; }
.pg-lead { font-size: 15.5px !important; color: var(--bl-ink) !important; }
.pg-where { display: inline-flex; margin: -4px 0 14px; }

/* Callout: a #141414 tile, no border */
.pg-callout { margin: 16px 0 4px; padding: 14px 16px; border-radius: var(--bl-r-lg); background: var(--bl-card); color: var(--bl-ink) !important; font-size: 14px !important; }
/* Owner's draft notes: visible, but clearly not part of the text */
.pg-draft { display: flex; gap: 10px; align-items: baseline; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--bl-r-md); border: 1px dashed var(--bl-line-2); font-size: 12.5px !important; line-height: 1.5 !important; color: var(--bl-muted) !important; }
.pg-draft::before { content: 'Draft'; flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--bl-ink); }

/* Tables inside a tile */
.pg-table { margin: 16px 0; padding: 6px 6px 2px; border-radius: var(--bl-r-lg); background: var(--bl-card); overflow-x: auto; }
.pg-table .bl-table { min-width: 520px; }
.pg-table td { color: color-mix(in srgb,var(--ink) 86%,transparent); }
.pg-table td:first-child { font-weight: 600; color: var(--bl-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* CTA tile at the end of a page */
.pg-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 10px; padding: 18px 20px; border-radius: var(--bl-r-lg); background: var(--bl-card); }
.pg-cta h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.pg-cta p { margin: 0; font-size: 13.5px; color: var(--bl-muted); max-width: 520px; }

/* Install command (support help + learn) */
.pg-cmd { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--bl-r-md); background: var(--bl-wash-6); }
.pg-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12.5px var(--bl-mono); color: var(--bl-ink); padding: 6px 0; background: none; scrollbar-width: none; }
.pg-cmd code::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- Support */
.sp { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; align-items: start; }
@media (max-width: 960px) { .sp { grid-template-columns: 1fr; } }
.sp-card { background: var(--bl-card); border-radius: var(--bl-r-lg); padding: 22px 22px 24px; }
@media (max-width: 640px) { .sp-card { padding: 16px; } }
.sp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.sp-card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sp-form { display: flex; flex-direction: column; gap: 18px; }
.sp-form .bl-field > label { display: flex; justify-content: space-between; gap: 8px; }
.sp-form .bl-input { font-size: 14px; }
.sp-form textarea.bl-input { min-height: 168px; }
.sp-count { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--bl-faint); font-variant-numeric: tabular-nums; }
.sp-hint { margin: 0; font-size: 12px; color: var(--bl-muted); }
.sp-err { margin: 0; font-size: 12.5px; color: var(--bl-danger); }
.sp-err:empty { display: none; }
.bl-input[aria-invalid=true] { box-shadow: 0 0 0 1px color-mix(in srgb,var(--danger) 55%,transparent); }

/* Account row above the email field */
.sp-acct { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 44px; padding: 8px 10px 8px 12px; border-radius: var(--bl-r-md); background: var(--bl-wash-4); }
.sp-acct p { margin: 0; flex: 1; min-width: 180px; font-size: 13px; color: var(--bl-muted); }
.sp-acct p b { color: var(--bl-ink); font-weight: 600; }
.sp-acct img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.sp-gsi { min-height: 40px; display: flex; align-items: center; }
.sp-email { position: relative; }
.sp-email .bl-input[readonly] { color: var(--bl-muted); cursor: default; padding-right: 76px; }
.sp-email .bl-btn { position: absolute; right: 8px; top: 8px; }

/* Drop zone */
.sp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 128px; padding: 18px; border-radius: var(--bl-r-md); border: 1px dashed var(--bl-line-2); background: var(--bl-wash-4); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.sp-drop:hover, .sp-drop.is-over { background: var(--bl-wash-8); border-color: color-mix(in srgb,var(--ink) 40%,transparent); }
.sp-drop:focus-within { box-shadow: var(--bl-focus-ring); border-color: color-mix(in srgb,var(--ink) 40%,transparent); }
.sp-drop svg { width: 22px; height: 22px; color: var(--bl-muted); }
.sp-drop b { font-size: 13.5px; font-weight: 600; }
.sp-drop span { font-size: 12px; color: var(--bl-muted); }
.sp-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sp-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-files:empty { display: none; }
.sp-file { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border-radius: var(--bl-r-md); background: var(--bl-wash-4); }
.sp-thumb { width: 48px; height: 48px; border-radius: var(--bl-r-sm); background: var(--bl-wash-8); object-fit: cover; display: block; }
.sp-file-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-file-name { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sp-file-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-file-name span { flex: none; color: var(--bl-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sp-file .bl-bar-track > i { width: 0; transition: width .2s linear; }
.sp-file.is-done .bl-bar-track > i { background: var(--bl-profit); }
.sp-file.is-failed .bl-bar-track > i { background: var(--bl-danger); width: 100%; }
.sp-file .bl-bar-track { visibility: hidden; }
.sp-file.is-up .bl-bar-track, .sp-file.is-done .bl-bar-track, .sp-file.is-failed .bl-bar-track { visibility: visible; }
.sp-file .bl-icon-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.sp-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 2px; }
.sp-actions .sp-hint { flex: 1; min-width: 200px; }
.sp-alert { padding: 10px 14px; border-radius: var(--bl-r-md); background: color-mix(in srgb,var(--danger) 10%,transparent); color: var(--bl-danger); font-size: 13px; }
.sp-alert[hidden] { display: none; }
.bl-btn.is-busy { pointer-events: none; opacity: .85; }
.sp-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--on-accent) 25%, transparent); border-top-color: var(--on-accent); animation: sp-spin .7s linear infinite; }
.sp-spin[hidden] { display: none; }
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* Success */
.sp-done { text-align: center; padding: 36px 8px 24px; }
.sp-done[hidden] { display: none; }
.sp-done .bl-eyebrow { display: block; }
.sp-done .sp-ticket { max-width: none; color: var(--bl-ink);  margin: 14px 0 10px; font-size: clamp(44px, 9vw, 72px); font-weight: 780; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px color-mix(in srgb,var(--ink) 22%,transparent); outline: none; }
.sp-done p { margin: 0 auto 8px; max-width: 460px; font-size: 14.5px; color: color-mix(in srgb,var(--ink) 78%,transparent); }
.sp-done p b { color: var(--bl-ink); }
.sp-done .bl-divider { max-width: 420px; margin: 22px auto; background: var(--bl-rule); }
.sp-next { list-style: none; margin: 0 auto 22px; padding: 0; max-width: 420px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.sp-next li { display: flex; gap: 10px; font-size: 13.5px; color: var(--bl-muted); }
.sp-next li b { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bl-wash-9); color: var(--bl-ink); font-size: 11px; font-weight: 600; }

/* Help column */
.sp-help { display: flex; flex-direction: column; gap: 10px; }
.sp-help .sp-card { padding: 18px; }
.sp-help h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.sp-help p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--bl-muted); }
.sp-help p:last-child { margin-bottom: 0; }
.sp-help p b { color: var(--bl-ink); font-weight: 600; }
.sp-help code { font: 12px var(--bl-mono); color: var(--bl-ink); word-break: break-all; }
.sp-help .pg-cmd { margin: 0 0 10px; }
.sp-paths { list-style: none; margin: 0; padding: 0; }
.sp-paths li { padding: 9px 0; border-top: 1px solid var(--bl-rule); font-size: 12.5px; color: var(--bl-muted); }
.sp-paths li:first-child { border-top: 0; padding-top: 0; }
.sp-paths code { display: block; margin-top: 2px; }

/* ---------------------------------------------------------------- Affiliates */
.af-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 860px) { .af-hero { grid-template-columns: 1fr; } }
.af-bio { display: flex; flex-direction: column; gap: 4px; }
.af-bio-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.af-av { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bl-wash-9); font-weight: 700; }
.af-bio-top div { display: flex; flex-direction: column; font-size: 12.5px; color: var(--bl-muted); }
.af-bio-top div b:first-child { font-size: 14px; color: var(--bl-ink); }
.af-bio p { margin: 0; font-size: 13.5px; color: color-mix(in srgb,var(--ink) 82%,transparent); }
.af-bio .af-link { margin-top: 6px; color: var(--bl-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bl-rule); }
.af-tagline { margin-top: auto !important; padding-top: 14px; }
.af-code b { display: block; margin: 12px 0 6px; font-size: 40px; font-weight: 780; letter-spacing: .02em; line-height: 1; }
.af-code p { margin: 0; font-size: 13px; color: var(--bl-muted); }
.af-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .af-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .af-steps { grid-template-columns: 1fr; } }
.af-steps li { counter-increment: s; font-size: 13.5px; line-height: 1.55; color: color-mix(in srgb,var(--ink) 82%,transparent); }
.af-steps li::before { content: counter(s, decimal-leading-zero); display: block; margin-bottom: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--bl-eyebrow); }
.pg-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.pg-sec-head:first-child { margin-top: 0; }
.af-form fieldset { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.af-form fieldset + fieldset { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--bl-rule); }
.af-form legend { grid-column: 1 / -1; padding: 0; margin-bottom: 2px; }
.af-form .is-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .af-form fieldset { grid-template-columns: 1fr; } }
.af-form .bl-field > label small { margin-left: 6px; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--bl-faint); }
.af-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.af-chips label { position: relative; }
.af-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.af-chips span { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: var(--bl-r-pill); border: 1px solid transparent; background: var(--bl-wash-8); color: var(--ink-2); font-size: 12.5px; font-weight: 500; transition: background .15s, color .15s; }
.af-chips label:hover span { background: var(--bl-seg-on); color: var(--bl-ink); }
.af-chips input:checked + span { background: var(--bl-accent); color: var(--bl-on-accent); font-weight: 600; }
.af-chips input:focus-visible + span { outline: 2px solid var(--bl-focus); outline-offset: 2px; }
.af-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.af-submit p { margin: 0; font-size: 13px; color: var(--bl-muted); }
.af-fine { margin: 16px 2px 0; font-size: 12.5px; color: var(--bl-muted); }
.af-fine a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bl-rule); }

@media (prefers-reduced-motion: reduce) { .pg *, .pg *::before { transition: none !important; animation: none !important; } }
.sp-form fieldset { all: unset; display: flex; flex-direction: column; gap: 18px; }
.pg-where .bl-tag { height: auto; min-height: 22px; padding: 4px 8px; line-height: 1.35; color: var(--bl-muted); }
.pg-panel > .pg-draft { margin-bottom: 18px; }
.sp-email .bl-btn[hidden] { display: none; }
.sp-help .pg-cmd code { white-space: normal; word-break: break-all; line-height: 1.5; }
.bl-field > .sp-drop { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--bl-ink); }
.sp-done .sp-ticket:focus, .sp-done .sp-ticket:focus-visible { outline: none; }
.sp-done .sp-err { color: var(--bl-danger); font-size: 13px; }
.af-form legend { float: left; width: 100%; }
.af-form .bl-field > label { line-height: 16px; }
.af-form .bl-field > label small { line-height: 16px; }

/* Email fallback shown while online tickets aren't set up yet (pages.js emailFallback) */
.sp-fallback { display: grid; gap: 12px; justify-items: start; padding: 8px 0; }
.sp-fallback h3 { margin: 0; font-size: 18px; font-weight: 600; }
.sp-fallback p { margin: 0; color: var(--bl-muted, #8c8c8c); line-height: 1.55; max-width: 52ch; }
