/* =====================================================================================
   Static & policy pages v4 (phase 23) — contact · faq · rules · privacy · editorial-policy
   One system, prefix `sp-`. Layout under the shared «بوم بازار» _PageHero:
     .sp-doc  : [sticky TOC (inline-start = right in RTL)] [content column]
     .sp-sec  : numbered section card with icon, deep-link anchor and list rows
     .sp-glance: 4 summary tiles («در یک نگاه»)
     contact  : .sp-channels + .sp-form ;  faq: .sp-search + .sp-chips + .sp-qa accordion
   Behaviour: js/ds/pages.js (scroll-spy + reading progress, FAQ filter, copy-link).
   Every colour comes from DS tokens, so both themes follow; tones are per-component --tone.
   ===================================================================================== */
.sp { --sp-gap: clamp(1rem, .6rem + 1.4vw, 1.75rem); padding-block-end: clamp(3rem, 2rem + 3vw, 5rem); }
.sp :where(h2, h3) { margin: 0; }
.sp-wrap { width: min(100% - 2rem, 76rem); margin-inline: auto; }

/* ---------- intro + at-a-glance tiles ---------- */
.sp-intro { margin-block: var(--sp-gap); padding: clamp(1.25rem, .9rem + 1.4vw, 2rem); border-radius: var(--ds-r-xl);
  background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1); }
html.dark-theme .sp-intro { border-color: hsl(var(--hairline)); }
.sp-intro__p { margin: 0 0 1.25rem; font-size: clamp(.95rem, .9rem + .2vw, 1.05rem); line-height: 2.05; color: var(--ds-text-2); max-width: 62rem; }
.sp-intro__p strong { color: var(--ds-text); }
.sp-glance { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .sp-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .sp-glance { grid-template-columns: minmax(0, 1fr); } }
.sp-glance__i { --tone: 199 89% 48%; display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--ds-r-lg);
  background: linear-gradient(160deg, hsl(var(--tone) / .09), transparent 70%), var(--ds-surface-1);
  border: 1px solid hsl(var(--tone) / .18); }
.sp-glance__i:nth-child(4n+2) { --tone: 262 80% 60%; } .sp-glance__i:nth-child(4n+3) { --tone: 160 75% 38%; } .sp-glance__i:nth-child(4n+4) { --tone: 38 92% 50%; }
.sp-glance__ic { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--ds-r-md); color: #fff;
  background: linear-gradient(145deg, hsl(var(--tone)), hsl(var(--tone) / .75)); box-shadow: 0 6px 14px -8px hsl(var(--tone) / .8); }
.sp-glance__ic svg { width: 1.1rem; height: 1.1rem; }
.sp-glance__t { display: block; font-weight: 800; font-size: .9rem; color: var(--ds-text); line-height: 1.6; }
.sp-glance__d { display: block; font-size: .8rem; line-height: 1.8; color: var(--ds-text-2); }

/* ---------- doc layout: TOC + content ---------- */
.sp-doc { display: grid; gap: var(--sp-gap); align-items: start; margin-block-start: var(--sp-gap); }
@media (min-width: 1024px) { .sp-doc { grid-template-columns: 17.5rem minmax(0, 1fr); } }
.sp-doc__body { display: grid; gap: var(--sp-gap); min-width: 0; }

.sp-toc { position: relative; min-width: 0; }
@media (min-width: 1024px) { .sp-toc { position: sticky; top: 6.25rem; max-height: calc(100vh - 7.5rem); overflow: auto; scrollbar-width: thin; } }
.sp-toc__box { border-radius: var(--ds-r-xl); background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1); overflow: hidden; }
html.dark-theme .sp-toc__box { border-color: hsl(var(--hairline)); }
.sp-toc__sum { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; cursor: pointer; list-style: none;
  font-weight: 800; font-size: .92rem; color: var(--ds-text); }
.sp-toc__sum::-webkit-details-marker { display: none; }
.sp-toc__sum svg { width: 1.05rem; height: 1.05rem; color: var(--ds-primary); flex: none; }
.sp-toc__count { margin-inline-start: auto; font-size: .75rem; font-weight: 700; color: var(--ds-text-2); background: var(--ds-surface-2);
  padding: .1rem .55rem; border-radius: var(--ds-r-pill); }
html.dark-theme .sp-toc__count { background: hsl(0 0% 100% / .06); }
.sp-toc__chev { width: 1rem; height: 1rem; color: var(--ds-text-2); transition: transform .25s ease; }
.sp-toc__box[open] .sp-toc__chev { transform: rotate(180deg); }
@media (min-width: 1024px) { .sp-toc__sum { cursor: default; pointer-events: none; } .sp-toc__chev { display: none; } }
.sp-toc__bar { height: 3px; margin: 0 1rem; border-radius: 3px; background: var(--ds-surface-2); overflow: hidden; }
html.dark-theme .sp-toc__bar { background: hsl(0 0% 100% / .07); }
.sp-toc__bar > i { display: block; height: 100%; width: calc(var(--sp-p, 0) * 100%); background: linear-gradient(90deg, hsl(199 89% 48%), hsl(262 80% 62%));
  border-radius: inherit; transition: width .15s linear; margin-inline-start: 0; }
.sp-toc__list { list-style: none; margin: 0; padding: .5rem; display: grid; gap: 2px; counter-reset: none; }
.sp-toc__a { position: relative; display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .65rem; border-radius: var(--ds-r-md);
  font-size: .85rem; font-weight: 600; line-height: 1.7; color: var(--ds-text-2); text-decoration: none; text-align: start;
  transition: background-color .15s ease, color .15s ease; }
.sp-toc__a:hover { background: var(--ds-surface-2); color: var(--ds-text); }
html.dark-theme .sp-toc__a:hover { background: hsl(0 0% 100% / .05); }
.sp-toc__n { flex: none; min-width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: var(--ds-r-sm); font-size: .72rem; font-weight: 800;
  background: var(--ds-surface-2); color: var(--ds-text-2); font-variant-numeric: tabular-nums; transition: background-color .2s ease, color .2s ease; }
html.dark-theme .sp-toc__n { background: hsl(0 0% 100% / .06); }
.sp-toc__a[aria-current="true"] { color: var(--ds-primary-ink); background: var(--ds-primary-soft); font-weight: 800; }
html.dark-theme .sp-toc__a[aria-current="true"] { color: hsl(199 89% 68%); }
.sp-toc__a[aria-current="true"] .sp-toc__n { background: var(--ds-primary); color: #fff; }
.sp-toc__a[aria-current="true"]::before { content: ""; position: absolute; inset-inline-start: -.5rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--ds-primary); }

/* ---------- section card ---------- */
.sp-sec { --tone: 199 89% 48%; position: relative; scroll-margin-top: 6.5rem; padding: clamp(1.15rem, .8rem + 1.3vw, 1.9rem);
  border-radius: var(--ds-r-xl); background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1);
  transition: border-color .35s ease, box-shadow .35s ease; }
html.dark-theme .sp-sec { border-color: hsl(var(--hairline)); }
.sp-sec.is-current { border-color: hsl(var(--tone) / .35); box-shadow: 0 18px 40px -30px hsl(var(--tone) / .7), var(--ds-shadow-1); }
.sp-sec--danger { --tone: 351 80% 52%; }
.sp-sec__head { display: flex; align-items: center; gap: .8rem; margin-block-end: 1rem; }
.sp-sec__ic { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--ds-r-lg);
  color: hsl(var(--tone)); background: hsl(var(--tone) / .1); box-shadow: inset 0 0 0 1px hsl(var(--tone) / .18); }
.sp-sec__ic svg { width: 1.3rem; height: 1.3rem; }
.sp-sec__k { display: block; font-size: .72rem; font-weight: 800; color: hsl(var(--tone)); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sp-sec__title { font-size: clamp(1.05rem, .95rem + .45vw, 1.3rem); font-weight: 900; line-height: 1.6; color: var(--ds-text); }
.sp-sec__link { margin-inline-start: auto; flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--ds-r-md);
  color: var(--ds-text-2); opacity: 0; transition: opacity .2s ease, background-color .2s ease, color .2s ease; border: 0; background: transparent; cursor: pointer; }
.sp-sec:hover .sp-sec__link, .sp-sec__link:focus-visible { opacity: 1; }
.sp-sec__link:hover { background: var(--ds-surface-2); color: var(--ds-primary); }
.sp-sec__link svg { width: 1rem; height: 1rem; }
.sp-sec__link.is-copied { opacity: 1; color: var(--ds-up-ink); }
@media (hover: none) { .sp-sec__link { opacity: .7; } }
.sp-sec__lead { margin: 0 0 .85rem; font-size: .95rem; line-height: 2; color: var(--ds-text); font-weight: 600; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.sp-list > li { position: relative; padding: .55rem 0; padding-inline-start: 1.6rem;
  font-size: .92rem; line-height: 2; color: var(--ds-text-2); border-top: 1px dashed var(--ds-line); }
.sp-list > li:first-child { border-top: 0; }
html.dark-theme .sp-list > li { border-top-color: hsl(0 0% 100% / .07); }
.sp-list > li::before { content: ""; position: absolute; inset-inline-start: .2rem; top: 1.15rem; width: .55rem; height: .55rem; border-radius: 3px;
  background: hsl(var(--tone) / .85); transform: rotate(45deg); }
.sp-alert { display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 1rem; padding: .9rem 1rem; border-radius: var(--ds-r-lg);
  background: var(--ds-danger-soft); color: hsl(351 75% 38%); font-size: .88rem; font-weight: 700; line-height: 1.95;
  box-shadow: inset 0 0 0 1px hsl(351 80% 52% / .22); }
html.dark-theme .sp-alert { color: hsl(351 90% 76%); background: hsl(351 80% 52% / .12); }
.sp-alert svg { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .3rem; }
.sp-alert--info { background: var(--ds-primary-soft); color: var(--ds-primary-ink); box-shadow: inset 0 0 0 1px hsl(199 89% 48% / .22); }
html.dark-theme .sp-alert--info { color: hsl(199 89% 72%); background: hsl(199 89% 48% / .12); }

/* ---------- closing strip: updated + related pages + CTA ---------- */
.sp-end { display: grid; gap: 1rem; padding: clamp(1.15rem, .8rem + 1.3vw, 1.9rem); border-radius: var(--ds-r-xl);
  background: radial-gradient(120% 120% at 100% 0%, hsl(199 89% 48% / .10), transparent 55%), var(--ds-surface-1);
  border: 1px solid var(--ds-line); }
html.dark-theme .sp-end { border-color: hsl(var(--hairline)); background: radial-gradient(120% 120% at 100% 0%, hsl(199 89% 48% / .16), transparent 55%), var(--ds-surface-1); }
@media (min-width: 768px) { .sp-end { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.sp-end__t { font-size: 1.05rem; font-weight: 900; color: var(--ds-text); margin: 0 0 .25rem; }
.sp-end__d { margin: 0; font-size: .88rem; line-height: 1.9; color: var(--ds-text-2); }
.sp-end__btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.sp-related { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.sp-related a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: var(--ds-r-pill); font-size: .8rem; font-weight: 700;
  color: var(--ds-text-2); background: var(--ds-surface-2); text-decoration: none; transition: color .15s ease, background-color .15s ease; }
html.dark-theme .sp-related a { background: hsl(0 0% 100% / .06); }
.sp-related a:hover { color: var(--ds-primary-ink); background: var(--ds-primary-soft); }
html.dark-theme .sp-related a:hover { color: hsl(199 89% 70%); }
.sp-related svg { width: .9rem; height: .9rem; }
.sp-updated { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; color: var(--ds-text-2); }
.sp-updated svg { width: .95rem; height: .95rem; }

/* ---------- team cards (editorial) ---------- */
.sp-team { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.sp-person { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--ds-r-xl); text-decoration: none;
  background: var(--ds-surface-1); border: 1px solid var(--ds-line); transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .25s ease, box-shadow .35s ease; }
html.dark-theme .sp-person { border-color: hsl(var(--hairline)); }
.sp-person:hover { transform: translateY(-3px); border-color: hsl(199 89% 48% / .4); box-shadow: 0 18px 36px -26px hsl(199 89% 48% / .7); }
.sp-person__av { flex: none; width: 3rem; height: 3rem; border-radius: var(--ds-r-lg); display: grid; place-items: center; font-weight: 900; font-size: 1.15rem; color: #fff;
  background: linear-gradient(145deg, hsl(201 90% 40%), hsl(262 70% 52%)); }
.sp-person__n { display: block; font-weight: 900; font-size: .95rem; color: var(--ds-text); }
.sp-person__r { display: block; font-size: .78rem; font-weight: 800; color: var(--ds-primary-ink); margin-block: .1rem .35rem; }
html.dark-theme .sp-person__r { color: hsl(199 89% 68%); }
.sp-person__s { display: block; font-size: .82rem; line-height: 1.85; color: var(--ds-text-2); }

/* ---------- contact ---------- */
.sp-channels { display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr); margin-block: var(--sp-gap); }
@media (min-width: 768px) { .sp-channels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sp-ch { --tone: 199 89% 48%; position: relative; display: flex; flex-direction: column; gap: .6rem; padding: 1.15rem 1.2rem 1.1rem; border-radius: var(--ds-r-xl); overflow: hidden;
  text-decoration: none; isolation: isolate;
  background: radial-gradient(130% 100% at 100% 0%, hsl(var(--tone) / .12), transparent 60%), var(--ds-surface-1);
  border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1);
  transition: transform .4s cubic-bezier(.22,1,.36,1), border-color .25s ease, box-shadow .4s ease; }
html.dark-theme .sp-ch { border-color: hsl(var(--hairline)); background: radial-gradient(130% 100% at 100% 0%, hsl(var(--tone) / .18), transparent 60%), var(--ds-surface-1); }
.sp-ch--tg { --tone: 200 80% 50%; } .sp-ch--mail { --tone: 262 75% 60%; }
.sp-ch:hover { transform: translateY(-4px); border-color: hsl(var(--tone) / .45); box-shadow: 0 22px 40px -26px hsl(var(--tone) / .8); }
.sp-ch__top { display: flex; align-items: center; gap: .75rem; }
.sp-ch__ic { flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: var(--ds-r-lg); color: #fff;
  background: linear-gradient(145deg, hsl(var(--tone)), hsl(var(--tone) / .72)); box-shadow: 0 10px 20px -10px hsl(var(--tone) / .85);
  transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.sp-ch:hover .sp-ch__ic { transform: rotate(-8deg) scale(1.06); }
.sp-ch__ic svg { width: 1.35rem; height: 1.35rem; }
.sp-ch__t { display: block; font-weight: 900; font-size: 1rem; color: var(--ds-text); }
.sp-ch__tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 800; color: var(--ds-up-ink); }
.sp-ch__tag::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px hsl(160 84% 39% / .2); }
.sp-ch__d { margin: 0; font-size: .85rem; line-height: 1.9; color: var(--ds-text-2); }
.sp-ch__go { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 800; color: hsl(var(--tone)); }
html:not(.dark-theme) .sp-ch__go { color: var(--ds-primary-ink); }
html:not(.dark-theme) .sp-ch--mail .sp-ch__go { color: hsl(262 60% 45%); }
.sp-ch__go svg { width: 1rem; height: 1rem; transition: transform .3s ease; }
.sp-ch:hover .sp-ch__go svg { transform: translateX(-4px); }
.sp-ch__val { font-size: .8rem; font-weight: 700; color: var(--ds-text-2); direction: ltr; unicode-bidi: isolate; }

.sp-cgrid { display: grid; gap: var(--sp-gap); align-items: start; }
@media (min-width: 1024px) { .sp-cgrid { grid-template-columns: minmax(0, 1fr) 21rem; } }
.sp-card { padding: clamp(1.15rem, .8rem + 1.4vw, 2rem); border-radius: var(--ds-r-xl); background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-1); }
html.dark-theme .sp-card { border-color: hsl(var(--hairline)); }
.sp-card__t { font-size: 1.15rem; font-weight: 900; color: var(--ds-text); margin: 0 0 .3rem; }
.sp-card__d { margin: 0 0 1.25rem; font-size: .88rem; line-height: 1.9; color: var(--ds-text-2); }
.sp-fgrid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .sp-fgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-field { display: grid; gap: .4rem; min-width: 0; }
.sp-field__l { font-size: .82rem; font-weight: 800; color: var(--ds-text); }
.sp-field__l small { font-weight: 600; color: var(--ds-text-2); }
.sp-field__box { position: relative; }
.sp-field__box > svg { position: absolute; inset-inline-start: .85rem; top: 50%; translate: 0 -50%; width: 1rem; height: 1rem; color: var(--ds-text-2); pointer-events: none; transition: color .2s ease; }
.sp-field__box--ta > svg { top: 1.05rem; translate: none; }
html .sp-field__in { width: 100%; min-height: 3rem; padding: .7rem .95rem; padding-inline-start: 2.6rem; border-radius: var(--ds-r-md); font: inherit; font-size: .92rem;
  color: var(--ds-text); background: var(--ds-bg); border: 1px solid var(--ds-line-strong); outline: none; box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
html.dark-theme .sp-field__in { background: hsl(0 0% 100% / .03); border-color: hsl(0 0% 100% / .14); }
html .sp-field__in::placeholder { color: var(--ds-text-3); }
html .sp-field__in:focus { border-color: var(--ds-primary); box-shadow: 0 0 0 4px var(--ds-primary-soft); outline: none; }
.sp-field__box:focus-within > svg { color: var(--ds-primary); }
html textarea.sp-field__in { min-height: 9.5rem; resize: vertical; line-height: 1.95; padding-block: .8rem; }
.sp-field__err { font-size: .78rem; font-weight: 700; color: var(--ds-down-ink); }
.sp-field__err:empty { display: none; }
html .sp-field__in.input-validation-error { border-color: var(--ds-danger); }
.sp-field__foot { display: flex; justify-content: space-between; gap: 1rem; font-size: .75rem; color: var(--ds-text-2); }
.sp-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1.25rem; }
.sp-form__note { font-size: .78rem; line-height: 1.8; color: var(--ds-text-2); display: inline-flex; gap: .4rem; align-items: center; }
.sp-form__note svg { width: .95rem; height: .95rem; color: var(--ds-up-ink); flex: none; }
.sp-ok { display: flex; gap: .7rem; align-items: center; margin-bottom: 1.25rem; padding: .9rem 1rem; border-radius: var(--ds-r-lg); font-weight: 800; font-size: .9rem;
  background: var(--ds-up-soft); color: hsl(160 84% 26%); box-shadow: inset 0 0 0 1px hsl(160 84% 39% / .25); }
html.dark-theme .sp-ok { color: hsl(160 70% 62%); }
.sp-ok svg { width: 1.2rem; height: 1.2rem; flex: none; }
.sp-side { display: grid; gap: var(--sp-gap); }
@media (min-width: 1024px) { .sp-side { position: sticky; top: 6.25rem; } }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; counter-reset: sp; }
.sp-steps li { counter-increment: sp; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .7rem; font-size: .85rem; line-height: 1.85; color: var(--ds-text-2); }
.sp-steps li::before { content: counter(sp); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--ds-r-md); font-weight: 900; font-size: .8rem;
  background: var(--ds-primary-soft); color: var(--ds-primary-ink); }
html.dark-theme .sp-steps li::before { color: hsl(199 89% 70%); }
.sp-steps strong { display: block; color: var(--ds-text); font-size: .88rem; }
.sp-quick { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.sp-quick a { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: var(--ds-r-md); font-size: .85rem; font-weight: 700; color: var(--ds-text); text-decoration: none;
  transition: background-color .15s ease, color .15s ease; }
.sp-quick a:hover { background: var(--ds-surface-2); color: var(--ds-primary-ink); }
html.dark-theme .sp-quick a:hover { background: hsl(0 0% 100% / .05); color: hsl(199 89% 70%); }
.sp-quick svg { width: 1rem; height: 1rem; color: var(--ds-text-2); flex: none; }
.sp-quick a > span { flex: 1; min-width: 0; }

/* ---------- FAQ ---------- */
.sp-faqbar { position: sticky; top: 4.6rem; z-index: 5; display: grid; gap: .75rem; margin-block: var(--sp-gap) 1rem; padding: .75rem; border-radius: var(--ds-r-xl);
  background: color-mix(in srgb, var(--ds-surface-1) 92%, transparent); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-2); }
html.dark-theme .sp-faqbar { border-color: hsl(var(--hairline)); }
@media (min-width: 1024px) { .sp-faqbar { top: 5.5rem; } }
.sp-search { position: relative; }
.sp-search > svg { position: absolute; inset-inline-start: 1rem; top: 50%; translate: 0 -50%; width: 1.1rem; height: 1.1rem; color: var(--ds-text-2); pointer-events: none; }
html .sp-search__in { width: 100%; height: 3.1rem; padding-inline: 2.85rem 3rem; border-radius: var(--ds-r-md); font: inherit; font-size: .95rem; color: var(--ds-text);
  background: var(--ds-bg); border: 1px solid var(--ds-line-strong); outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
html.dark-theme .sp-search__in { background: hsl(0 0% 100% / .03); border-color: hsl(0 0% 100% / .14); }
html .sp-search__in:focus { border-color: var(--ds-primary); box-shadow: 0 0 0 4px var(--ds-primary-soft); }
.sp-search__in::-webkit-search-cancel-button { display: none; }
.sp-search__x { position: absolute; inset-inline-end: .5rem; top: 50%; translate: 0 -50%; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: var(--ds-r-md);
  border: 0; background: transparent; color: var(--ds-text-2); cursor: pointer; }
.sp-search__x:hover { background: var(--ds-surface-2); color: var(--ds-text); }
.sp-search__x[hidden] { display: none; }
.sp-search__x svg { width: 1rem; height: 1rem; }
.sp-chips { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.sp-chips::-webkit-scrollbar { display: none; }
.sp-chip { flex: none; display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem; padding-inline: .85rem; border-radius: var(--ds-r-pill); border: 1px solid var(--ds-line);
  background: transparent; font: inherit; font-size: .82rem; font-weight: 700; color: var(--ds-text-2); cursor: pointer; transition: all .18s ease; }
html.dark-theme .sp-chip { border-color: hsl(0 0% 100% / .12); }
.sp-chip svg { width: .95rem; height: .95rem; }
.sp-chip:hover { color: var(--ds-text); background: var(--ds-surface-2); }
html.dark-theme .sp-chip:hover { background: hsl(0 0% 100% / .05); }
.sp-chip[aria-pressed="true"] { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff; }
.sp-chip__n { font-size: .7rem; font-weight: 800; padding: 0 .4rem; border-radius: var(--ds-r-pill); background: hsl(0 0% 50% / .14); }
.sp-chip[aria-pressed="true"] .sp-chip__n { background: hsl(0 0% 100% / .22); }
.sp-faqmeta { margin: 0 0 .75rem; font-size: .8rem; font-weight: 700; color: var(--ds-text-2); min-height: 1.3em; }
.sp-qgroup { margin-block-end: 1.5rem; }
.sp-qgroup[hidden] { display: none; }
.sp-qgroup__h { display: flex; align-items: center; gap: .6rem; margin-block-end: .75rem; font-size: 1.05rem; font-weight: 900; color: var(--ds-text); }
.sp-qgroup__h svg { width: 1.1rem; height: 1.1rem; color: var(--ds-primary); }
.sp-qa { border-radius: var(--ds-r-lg); background: var(--ds-surface-1); border: 1px solid var(--ds-line); transition: border-color .2s ease, box-shadow .3s ease; }
html.dark-theme .sp-qa { border-color: hsl(var(--hairline)); }
.sp-qa + .sp-qa { margin-top: .55rem; }
.sp-qa[hidden] { display: none; }
.sp-qa[open] { border-color: hsl(199 89% 48% / .4); box-shadow: 0 16px 34px -28px hsl(199 89% 48% / .8); }
.sp-qa__q { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem; cursor: pointer; list-style: none; font-weight: 800; font-size: .93rem; line-height: 1.75; color: var(--ds-text); }
.sp-qa__qt { flex: 1; min-width: 0; margin: 0; font: inherit; color: inherit; }
.sp-qa__q::-webkit-details-marker { display: none; }
.sp-qa__q:focus-visible { outline: 3px solid var(--ds-primary); outline-offset: 2px; border-radius: var(--ds-r-lg); }
.sp-qa__pm { position: relative; flex: none; margin-inline-start: auto; width: 1.9rem; height: 1.9rem; border-radius: var(--ds-r-md); background: var(--ds-surface-2); transition: background-color .2s ease, transform .3s ease; }
html.dark-theme .sp-qa__pm { background: hsl(0 0% 100% / .06); }
.sp-qa__pm::before, .sp-qa__pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: .75rem; height: 2px; margin: -1px 0 0 -.375rem; border-radius: 2px; background: var(--ds-text-2); transition: transform .3s ease, background-color .2s ease; }
.sp-qa__pm::after { transform: rotate(90deg); }
.sp-qa[open] .sp-qa__pm { background: var(--ds-primary); }
.sp-qa[open] .sp-qa__pm::before, .sp-qa[open] .sp-qa__pm::after { background: #fff; }
.sp-qa[open] .sp-qa__pm::after { transform: rotate(0); }
.sp-qa__a { padding: 0 1.1rem 1.1rem; font-size: .9rem; line-height: 2.05; color: var(--ds-text-2); }
.sp-qa__a p { margin: 0; padding-top: .85rem; border-top: 1px dashed var(--ds-line); }
html.dark-theme .sp-qa__a p { border-top-color: hsl(0 0% 100% / .08); }
@media (prefers-reduced-motion: no-preference) { .sp-qa[open] .sp-qa__a { animation: sp-drop .35s cubic-bezier(.22,1,.36,1); } }
@keyframes sp-drop { from { opacity: 0; transform: translateY(-6px); } }
mark.sp-hl { background: hsl(45 93% 58% / .45); color: inherit; border-radius: 3px; padding: 0 1px; }
html.dark-theme mark.sp-hl { background: hsl(45 93% 50% / .35); }
.sp-empty { text-align: center; padding: 2.5rem 1rem; border-radius: var(--ds-r-xl); border: 1px dashed var(--ds-line-strong); color: var(--ds-text-2); }
.sp-empty[hidden] { display: none; }
.sp-empty b { display: block; font-size: 1.05rem; color: var(--ds-text); margin-bottom: .35rem; }
.sp-empty p { margin: 0 0 1rem; font-size: .88rem; }
.sp-wrap > .sp-cgrid:first-child { margin-top: var(--sp-gap); }
.sp-wrap > .sp-cgrid:first-child .sp-faqbar { margin-top: 0; }
@media (min-width: 768px) { .sp-chips { flex-wrap: wrap; overflow: visible; } }

/* contact submit: spinner sits on the arrow's slot (js/site-auth.js toggles opacity + .animate-spin) */
.sp-submit { position: relative; }
.sp-submit svg { width: 1.1rem; height: 1.1rem; transition: opacity .2s ease, transform .3s ease; }
.sp-submit:hover svg:not(#spinner-icon) { transform: translateX(-4px); }
.sp-submit__spin { position: absolute; inset-inline-end: var(--ds-sp-6, 1.5rem); top: 50%; margin-top: -.55rem; opacity: 0; pointer-events: none; }
.sp-submit__spin.animate-spin { animation: sp-spin 1s linear infinite; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-submit:disabled { cursor: progress; }
[data-sp-counter] { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
/* LTR inputs (e-mail) inside an RTL box: the icon stays on the right, so pad that side instead */
html .sp-field__in[dir="ltr"] { padding-inline-start: .95rem; padding-inline-end: 2.6rem; text-align: left; }

/* ---------- Telegram connect status (/chart/telegram-connect, phase 24) ---------- */
.tgc { --tg-tone: var(--ds-primary); --tg-soft: var(--ds-primary-soft);
  position: relative; isolation: isolate; overflow: hidden; max-width: 640px; margin-inline: auto; display: grid; justify-items: center;
  gap: 18px; text-align: center; padding: clamp(28px, 20px + 3vw, 52px) clamp(18px, 12px + 3vw, 48px);
  border-radius: var(--ds-r-xl); background: var(--ds-surface-1); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-2); }
.tgc--ok { --tg-tone: var(--ds-up-ink); --tg-soft: var(--ds-up-soft); }
.tgc--warn { --tg-tone: var(--ds-gold-ink); --tg-soft: var(--ds-gold-soft); }
.tgc--err { --tg-tone: var(--ds-danger); --tg-soft: var(--ds-danger-soft); }
.tgc > * { margin: 0; }
.tgc__glow { position: absolute; inset: -40% -20% auto; height: 70%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--tg-soft), transparent); }
.tgc::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, hsl(199 89% 55%), var(--tg-tone)); }
.tgc__plate { position: relative; width: 76px; height: 76px; border-radius: var(--ds-r-xl); display: grid; place-items: center;
  color: var(--tg-tone); background: var(--tg-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tg-tone) 25%, transparent); }
.tgc__plate::after { content: ""; position: absolute; inset: -8px; border-radius: var(--ds-r-xl); border: 1px dashed color-mix(in srgb, var(--tg-tone) 30%, transparent); }
.tgc__plate .icon { width: 32px; height: 32px; }
.tgc__text { display: grid; gap: 8px; justify-items: center; }
.tgc__text > * { margin: 0; }
.tgc__kicker { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ds-fs-2xs); font-weight: var(--ds-fw-black);
  color: hsl(199 89% 48%); padding: 3px 10px; border-radius: var(--ds-r-pill); background: hsl(199 89% 48% / .1); }
.tgc__kicker .icon { width: 13px; height: 13px; }
.tgc__title { font-size: var(--ds-fs-h2); line-height: 1.5; font-weight: var(--ds-fw-black); color: var(--ds-text); text-wrap: balance; }
.tgc__lead { font-size: var(--ds-fs-body); line-height: 2; color: var(--ds-text-2); max-width: 32rem; text-wrap: pretty; }
.tgc-steps { list-style: none; padding: 0; width: 100%; max-width: 440px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: none; }
.tgc-steps li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: var(--ds-fs-2xs); font-weight: var(--ds-fw-bold); color: var(--ds-text-3); }
.tgc-steps li + li::before { content: ""; position: absolute; top: 15px; inset-inline-end: 50%; width: 100%; height: 2px; z-index: -1;
  background: var(--ds-line); margin-inline-end: 0; }
.tgc-steps li.is-done + li::before { background: var(--ds-up-ink); }
.tgc-steps__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: var(--ds-fs-xs); font-weight: var(--ds-fw-black);
  color: var(--ds-text-3); background: var(--ds-surface-2); box-shadow: 0 0 0 4px var(--ds-surface-1), inset 0 0 0 1px var(--ds-line); }
.tgc-steps__dot .icon { width: 16px; height: 16px; }
.tgc-steps li.is-done { color: var(--ds-text-2); }
.tgc-steps li.is-done .tgc-steps__dot { color: #fff; background: var(--ds-up-ink); box-shadow: 0 0 0 4px var(--ds-surface-1); }
.tgc-steps li.is-now { color: var(--ds-text); }
.tgc-steps li.is-now .tgc-steps__dot { color: var(--tg-tone); background: var(--tg-soft); box-shadow: 0 0 0 4px var(--ds-surface-1), inset 0 0 0 2px var(--tg-tone); }
.tgc__alert { width: 100%; text-align: start; margin: 0; }
.tgc__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.tgc__acts .ds-btn { --_h: 46px; font-weight: var(--ds-fw-black); }
.tgc__acts .icon { width: 16px; height: 16px; }
.tgc__form { display: contents; }
.tgc__foot { font-size: var(--ds-fs-xs); color: var(--ds-text-3); }
@media (max-width: 479px) {
  .tgc__acts { flex-direction: column; }
  .tgc__acts .ds-btn { width: 100%; }
}
/* p29: document lists (privacy / rules / editorial) get the same hover as article lists —
   a soft tint, a 3px slide toward the reading end and a marker that pops. */
.sp-list > li { border-radius: var(--ds-r-md); padding-inline-end: .6rem;
  transition: translate .45s cubic-bezier(.22,1,.36,1), background-color .3s ease, border-color .3s ease; }
.sp-list > li::before { transition: transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .45s ease; }
@media (hover: hover) {
  .sp-list > li:hover { background-color: hsl(var(--tone, 199 89% 48%) / .07); translate: -3px 0; border-top-color: transparent; }
  .sp-list > li:hover + li { border-top-color: transparent; }
  .sp-list > li:hover::before { transform: rotate(45deg) scale(1.45); box-shadow: 0 0 12px hsl(var(--tone, 199 89% 48%) / .55); }
}
@media (prefers-reduced-motion: reduce) { .sp-list > li, .sp-list > li::before { transition: none; } .sp-list > li:hover { translate: none; } }

/* p29: the FAQ bar sticks flush under the header at every header height (64 / 56 mobile / 54 condensed)
   instead of a fixed 4.6–5.5rem that left a see-through gap; denser glass so cards don't read through it. */
html body .sp-faqbar { top: calc(var(--site-hdr, 64px) + .5rem); transition: top .3s cubic-bezier(.22,1,.36,1);
  background: color-mix(in srgb, var(--ds-surface-1) 96%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.sp-qgroup { scroll-margin-top: calc(var(--site-hdr, 64px) + 9rem); }
