/* Sparkling How-to — шаги + экран (префикс htc__) */
.htc {
  --k-bg: var(--sp-bg, #00050B); --k-card: var(--sp-card, #111924); --k-text: var(--sp-text, #F8FCFF);
  --k-accent: var(--sp-accent, #009CFF); --k-dots: var(--sp-accent, #009CFF); --k-bg-opacity: .35; --k-interval: 6s;
  --k-soft: color-mix(in srgb, var(--k-text) 72%, transparent);
  --k-muted: color-mix(in srgb, var(--k-text) 45%, transparent);
  --k-line: color-mix(in srgb, var(--k-text) 9%, transparent);
  --k-panel: color-mix(in srgb, var(--k-card) 70%, var(--k-bg));
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0; padding: 72px 20px; background: var(--k-bg); color: var(--k-text);
  font-family: var(--sp-font, Arial, Helvetica, sans-serif);
}
.htc *, .htc *::before, .htc *::after { box-sizing: border-box; }
.htc::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--k-dots) 22%, transparent) 1.1px, transparent 1.3px); background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(60% 50% at 50% 30%, #000 10%, transparent 75%); mask-image: radial-gradient(60% 50% at 50% 30%, #000 10%, transparent 75%); opacity: .45; }
.htc--nodots::before { display: none; }
.htc__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: var(--k-bg-opacity); pointer-events: none; }

/* защита от стилей темы */
.htc h2, .htc h3, .htc p, .htc ol, .htc li, .htc dl, .htc dt, .htc dd, .htc figure, .htc figcaption { text-transform: none; letter-spacing: normal; }
.htc ol { list-style: none; margin: 0; padding: 0; }
.htc li::before, .htc li::marker { content: none; }
.htc figure { margin: 0; }
.htc img { max-width: 100%; height: auto; border: 0; }
.htc button.htc__toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; width: 100%; cursor: pointer; font-family: inherit; color: inherit; }

.htc__inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: center; }
.htc--phone-left .htc__inner { grid-template-columns: 380px minmax(0, 1fr); }
.htc--phone-left .htc__phone-wrap { order: -1; }
.htc__tag { display: inline-block; padding: 8px 12px; border: 1px solid var(--k-line); border-radius: 8px; background: color-mix(in srgb, var(--k-card) 90%, transparent);
  font: 600 12px/1 var(--sp-mono, "Courier New", monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--k-text); }
.htc .htc__title { margin: 14px 0 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -.035em; color: var(--k-text); }
.htc .htc__lead { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--k-soft); }

/* шаги */
.htc .htc__list { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.htc .htc__step { margin: 0; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--k-line); background: var(--k-panel); transition: border-color .2s, background .2s; }
.htc .htc__step-title { margin: 0; font-size: 16.5px; line-height: 1.35; font-weight: 600; color: var(--k-text); }
.htc__toggle:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 4px; border-radius: 10px; }
.htc__num { flex: none; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--k-text) 6%, transparent);
  display: flex; align-items: center; justify-content: center; font: 700 14px/1 var(--sp-mono, "Courier New", monospace); color: var(--k-soft); transition: background .2s, color .2s; }
.htc__body { padding-left: 54px; }
.htc__text { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--k-soft); }
.htc__text p { margin: 0 0 8px; } .htc__text p:last-child { margin-bottom: 0; }
.htc__text a { color: var(--k-accent); text-decoration: none; } .htc__text a:hover { text-decoration: underline; }
.htc__text strong, .htc__text b { color: var(--k-text); }
.htc__bar { display: none; height: 3px; margin-top: 12px; border-radius: 2px; background: color-mix(in srgb, var(--k-text) 8%, transparent); overflow: hidden; }
.htc__bar i { display: block; height: 100%; width: 0; background: var(--k-accent); }

.htc .htc__step.is-active { background: linear-gradient(180deg, color-mix(in srgb, var(--k-accent) 8%, transparent), transparent 70%), var(--k-card);
  border-color: color-mix(in srgb, var(--k-accent) 40%, transparent); }
.htc__step.is-active .htc__num { background: var(--k-accent); color: var(--k-bg); }

/* JS включён: свёрнуты неактивные шаги (без JS всё раскрыто) */
.htc--js .htc__step:not(.is-active) .htc__body { display: none; }
.htc--js.htc--auto .htc__step.is-active .htc__bar { display: block; }
.htc--js.htc--auto.htc--running .htc__step.is-active .htc__bar i { animation: htc-fill var(--k-interval) linear forwards; }
.htc--paused .htc__step.is-active .htc__bar i { animation-play-state: paused !important; }
@keyframes htc-fill { from { width: 0; } to { width: 100%; } }

.htc__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.htc .htc__btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 12px; background: var(--k-accent); color: var(--k-bg);
  font: 700 14px/1.2 Arial, Helvetica, sans-serif; text-decoration: none; border: 1px solid transparent; }
.htc .htc__btn:hover { filter: brightness(1.1); color: var(--k-bg); }
.htc .htc__btn--ghost { background: transparent; border-color: var(--k-line); color: var(--k-text); font-weight: 400; }
.htc .htc__btn--ghost:hover { color: var(--k-text); border-color: color-mix(in srgb, var(--k-text) 25%, transparent); }

/* телефон */
.htc__phone { width: 320px; aspect-ratio: 320 / 620; margin: 0 auto; border-radius: 44px; background: color-mix(in srgb, var(--k-bg) 80%, #000);
  border: 1px solid color-mix(in srgb, var(--k-text) 14%, transparent); padding: 14px;
  box-shadow: 0 30px 80px color-mix(in srgb, var(--k-accent) 12%, transparent); }
.htc__screens { position: relative; height: 100%; border-radius: 32px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--k-card) 85%, var(--k-text) 3%), var(--k-panel)); }
.htc__screen { position: absolute; inset: 0; padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s; }
.htc__screen.is-active { opacity: 1; visibility: visible; }
.htc__screen--img { padding: 0; }
.htc__screen--img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.htc__bar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--k-muted); }
.htc .htc__msg { align-self: flex-end; max-width: 82%; margin: 4px 0 0; padding: 10px 12px; border-radius: 14px 14px 4px 14px; background: var(--k-accent); color: var(--k-bg); font-size: 13px; line-height: 1.35; font-weight: 600; }
.htc .htc__rep { align-self: flex-start; max-width: 86%; margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: color-mix(in srgb, var(--k-text) 7%, transparent); font-size: 13px; line-height: 1.4; color: var(--k-soft); }
.htc .htc__card { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--k-text) 5%, transparent); border: 1px solid var(--k-line); font-size: 13px; }
.htc__card div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.htc .htc__card dt { margin: 0; color: var(--k-soft); font-weight: 400; }
.htc .htc__card dd { margin: 0; color: var(--k-text); font-weight: 700; text-align: right; }
.htc__cf { margin-top: auto; padding: 13px; border-radius: 12px; background: var(--k-accent); color: var(--k-bg); text-align: center; font-weight: 700; font-size: 15px; }
.htc .htc__caption { margin: 14px 0 0; text-align: center; font: 600 11px/1.4 var(--sp-mono, "Courier New", monospace); letter-spacing: .1em; text-transform: uppercase; color: var(--k-muted); }

@media (max-width: 860px) {
  .htc { padding: 52px 16px; }
  .htc__inner, .htc--phone-left .htc__inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  /* телефон между заголовком и шагами */
  .htc__content { display: contents; }
  .htc__head { order: 1; } .htc__phone-wrap, .htc--phone-left .htc__phone-wrap { order: 2; } .htc .htc__list { order: 3; margin-top: 0; } .htc__btns { order: 4; margin-top: 0; }
  .htc__phone { width: 230px; border-radius: 36px; padding: 11px; }
  .htc__screens { border-radius: 27px; }
  .htc__body { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .htc__screen { transition: none; }
  .htc--running .htc__step.is-active .htc__bar i { animation: none; width: 100%; }
}
