:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #0d1117;
  --muted: #5b6472;
  --border: #e1e4ea;
  --accent: #0a7cff;
  --accent-ink: #ffffff;
  --good: #1a9e4b;
  --good-bg: #e7f7ec;
  --warn: #c27100;
  --warn-bg: #fff4e0;
  --info-bg: #e8f2ff;
  --red: #e5372b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #151922;
    --surface-2: #1d2230;
    --text: #eef1f6;
    --muted: #9aa3b2;
    --border: #262c3a;
    --accent: #3d9bff;
    --accent-ink: #ffffff;
    --good: #3ddc74;
    --good-bg: rgba(61, 220, 116, .12);
    --warn: #ffb547;
    --warn-bg: rgba(255, 181, 71, .12);
    --info-bg: rgba(61, 155, 255, .13);
    --red: #ff5a4f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6.4vw, 52px); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(23px, 4.4vw, 30px); font-weight: 750; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: .6em 0; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .95em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.progress { display: flex; align-items: center; gap: 10px; flex: 0 1 260px; }
.progress__bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--good)); border-radius: inherit; transition: width .45s ease; }
.progress__txt { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .2s, border-color .2s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--lg { min-height: 56px; font-size: 18px; padding: 0 28px; }
.btn--block { width: 100%; }
.btn--done { margin-top: 18px; background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); width: 100%; max-width: 320px; }
.is-done .btn--done { opacity: .6; }

/* ---------- hero ---------- */
.hero { padding-top: 44px; padding-bottom: 12px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--muted); max-width: 680px; margin: 16px 0 22px; }
.need { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.need__item { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.ico { font-size: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

/* ---------- tips ---------- */
.tip { border-radius: 14px; padding: 12px 14px; margin: 14px 0; font-size: 15.5px; background: var(--surface-2); border-left: 4px solid var(--muted); }
.tip--info { background: var(--info-bg); border-left-color: var(--accent); }
.tip--warn { background: var(--warn-bg); border-left-color: var(--warn); }
.tip--good { background: var(--good-bg); border-left-color: var(--good); }

/* ---------- blocks ---------- */
.block { margin-top: 36px; }
.block > *:not(.block__head) { }
.block__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.block__head p { margin: 4px 0 0; }
.section-title { text-align: center; margin: 56px 0 6px; }

.step-num {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 20px;
}
.step-num--warn { background: var(--warn); }
.step-num--good { background: var(--good); }
.step-num--alt { background: #8e5cf7; }

/* ---------- checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.checklist label { display: flex; gap: 14px; padding: 16px; cursor: pointer; }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--border); margin-top: 1px;
  display: grid; place-items: center; transition: .15s;
}
.checklist input:checked + .box { background: var(--good); border-color: var(--good); }
.checklist input:checked + .box::after { content: "✓"; color: #fff; font-weight: 800; }
.checklist input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.checklist .muted { font-size: 15px; }

/* ---------- steps ---------- */
.step {
  display: grid; grid-template-columns: 1fr 290px; gap: 32px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 28px; margin-top: 22px; box-shadow: var(--shadow); position: relative;
  transition: border-color .3s;
}
.step.is-done { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.step.is-done .step-num:not(.step-num--good) { background: var(--good); }
.step__head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.step--wide { grid-template-columns: 1fr; }
.step--final { grid-template-columns: 1fr; border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }

.phone {
  margin: 0; justify-self: center; width: 100%; max-width: 270px;
  border-radius: 34px; padding: 8px; background: #000;
  box-shadow: 0 0 0 2px #2b2f38, 0 18px 40px rgba(0, 0, 0, .28);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 27px; cursor: zoom-in; }
.phone--crop { border-radius: 22px; max-width: 260px; }
.phone--crop img { border-radius: 16px; }

.step-shot { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; margin-top: 8px; }
.step__text--after { border-top: 1px dashed var(--border); padding-top: 20px; }

/* ---------- details ---------- */
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.faq-mini { margin-top: 12px; font-size: 15.5px; }
.faq-mini summary { color: var(--warn); font-weight: 650; display: inline-flex; gap: 6px; align-items: center; }
.faq-mini summary::before { content: "?"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--warn-bg); font-size: 13px; }
.faq-mini p { background: var(--surface-2); padding: 10px 14px; border-radius: 12px; }

.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-top: 10px; }
.faq summary { padding: 16px 48px 16px 18px; font-weight: 650; position: relative; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--muted); transition: transform .2s; }
.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { padding: 0 18px; color: var(--muted); }
.faq p:last-child { padding-bottom: 14px; }

/* ---------- generator ---------- */
.gen {
  margin-top: 6px; border-radius: 20px; padding: 20px;
  background: linear-gradient(180deg, var(--info-bg), transparent 140px), var(--surface);
  border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--border));
}
.gen.flash { animation: flash .5s ease; }
@keyframes flash { 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); } }
.gen__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gen__head p { margin: 4px 0 0; }
.gen__controls { display: flex; gap: 10px; flex-wrap: wrap; }
.gen select {
  min-height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 16px; padding: 0 12px; max-width: 100%;
}
.gen__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.field, .phone-split > div {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 12px 12px 14px;
  transition: border-color .2s, background .2s;
}
.field__label, .phone-split small { grid-column: 1; font-size: 13px; color: var(--muted); }
.field__label i { font-style: normal; opacity: .75; }
.field__val { grid-column: 1; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; word-break: break-word; user-select: all; -webkit-user-select: all; }
.field .copy, .phone-split .copy { grid-column: 2; grid-row: 1 / span 2; }
.field__hint { grid-column: 2; grid-row: 1 / span 2; font-size: 13px; color: var(--warn); text-align: right; max-width: 110px; line-height: 1.25; }
.field--skip { opacity: .7; }
.field--skip .field__val { font-size: 15px; font-weight: 500; }
.field.copied, .phone-split .copied { border-color: var(--good); }
.field--phone { grid-column: 1 / -1; display: block; }
.field--phone > .field__label { display: block; margin-bottom: 8px; }
.phone-split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.phone-split > div { background: var(--surface-2); }
.copy {
  min-height: 42px; padding: 0 14px; border-radius: 11px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 650; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.copy:active { transform: scale(.96); }
.copy.ok { background: var(--good); }

/* ---------- apps ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 14px 0; }
.app {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.app:hover { border-color: var(--accent); }
.app__ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--accent), #8e5cf7); flex: none; }
.app b { display: block; }
.app small { color: var(--muted); font-size: 13px; }
.app__go { margin-left: auto; background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 99px; font-size: 14px; font-weight: 700; }

/* ---------- plan B ---------- */
.planb { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 18px 40px; margin: 0; box-shadow: var(--shadow); }
.planb li { margin: 8px 0; padding-left: 4px; }

.block--cta { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px 16px; margin-top: 44px; max-width: 948px; }
.block--cta .hero__cta { justify-content: center; margin: 16px 0; }

.footer { padding: 32px 16px 48px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- toast / lightbox / confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: #111; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: grid; place-items: center; z-index: 60; padding: 16px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 18px; }
.confetti { position: fixed; top: -12px; width: 8px; height: 14px; border-radius: 2px; z-index: 70; pointer-events: none; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(720deg); opacity: .8; } }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 28px; }
  .lead { font-size: 17.5px; }
  .hero__cta .btn { flex: 1 1 100%; }
  .step { padding: 20px 16px; gap: 14px; border-radius: 20px; }
  .step { display: flex; flex-direction: column; align-items: stretch; }
  .step > .step__text:first-child { display: contents; }
  .step__head { order: -2; margin-bottom: 0; }
  .step > .step__text:first-child > p, .step > .step__text:first-child > .tip { margin: 0; }
  .step > .step__text:first-child > .btn--done { margin-top: 4px; }
  .step > .phone { order: -1; max-width: 220px; align-self: center; }
  .step__head h3 { font-size: 19px; }
  .btn--done { max-width: none; }
  .step-shot { grid-template-columns: 1fr; gap: 14px; }
  .step-shot .phone--crop { max-width: 240px; }
  .gen { padding: 14px; margin-left: -4px; margin-right: -4px; }
  .gen__controls { width: 100%; }
  .gen__controls select, .gen__controls .btn { flex: 1 1 100%; }
  .gen__grid { grid-template-columns: 1fr; }
  .phone-split { grid-template-columns: 1fr; }
  .progress { flex-basis: 150px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* ---------- плашка «Актуально на …» ---------- */
.fresh {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 6px 12px; border-radius: 99px; font-size: 14px;
  background: var(--good-bg); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.fresh b { font-weight: 700; }
.fresh__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- поделиться ---------- */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.share-line { margin-top: 14px; }

/* ---------- режим «по одному шагу» ---------- */
.view-toggle {
  display: flex; width: max-content; max-width: 100%; margin: 18px auto 0; padding: 4px; gap: 4px;
  background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border);
}
.view-toggle button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
}
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.wiz-dots { display: none; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.wizard .wiz-dots { display: flex; }
.wiz-dots button {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; padding: 0;
}
.wiz-dots button.is-done { border-color: var(--good); color: var(--good); }
.wiz-dots button.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

.wizard .step:not(.is-active) { display: none; }
.wizard .step.is-active { animation: stepIn .28s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } }

.wiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--border);
}
.wiz-nav[hidden] { display: none; }
.wiz-nav__in { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.wiz-nav__in .btn { flex: 1; max-width: 220px; }
.wiz-nav__in .btn:disabled { opacity: .4; cursor: default; }
.wiz-nav__pos { flex: none; font-size: 14px; color: var(--muted); font-weight: 650; text-align: center; margin: 0 auto; font-variant-numeric: tabular-nums; }
.wiz-nav-on .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
.wiz-nav-on .footer { padding-bottom: 110px; }
@media (max-width: 760px) {
  .wiz-nav__in .btn { max-width: none; min-height: 50px; padding: 0 12px; }
  .view-toggle button { padding: 0 12px; font-size: 14px; }
}
.wizard .step .btn--done { display: none; }
@media (max-width: 760px) { .wiz-dots { gap: 6px; } .wiz-dots button { width: 32px; height: 32px; font-size: 14px; } }

/* ---------- оценка ---------- */
.rate { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.rate[hidden] { display: none; }
.block--cta .rate { max-width: 460px; margin: 18px auto 0; }
.rate__q { margin: 0 0 10px; font-weight: 700; }
.rate__btns { display: flex; justify-content: center; gap: 10px; }
.rate__btns button {
  flex: 1; max-width: 160px; min-height: 48px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 650; font-size: 16px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .08s;
}
.rate__btns button:active { transform: scale(.96); }
.rate__btns [data-vote="up"][aria-pressed="true"] { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.rate__btns [data-vote="down"][aria-pressed="true"] { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.rate__msg { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.rate__count { margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--good) 18%, transparent); font-size: 14px; font-variant-numeric: tabular-nums; }
.rate__count[hidden] { display: none; }
.app__ico--img { background: none; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.app__ico--img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand__logo { width: 26px; height: 26px; border-radius: 7px; display: block; }

/* ---------- генератор: подсказка «что дальше» ---------- */
.gen [data-key] { position: relative; }
.gen [data-key].is-next {
  border-color: var(--accent); background: var(--info-bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: nextPulse 1.8s ease-in-out infinite;
}
@keyframes nextPulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 10%, transparent); } }
.gen [data-key].is-filled { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }
.gen [data-key].is-filled .copy { background: var(--good); }
.gen [data-key].is-filled .field__val { opacity: .75; }
.next-badge {
  position: absolute; top: -11px; right: 12px; z-index: 1;
  padding: 2px 10px; border-radius: 99px; background: var(--accent); color: #fff;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; pointer-events: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.gen__done {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; text-align: center;
  background: var(--good-bg); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent);
  font-weight: 600; animation: stepIn .3s ease;
}
.gen__done[hidden] { display: none; }

/* ---------- ссылка на шаг ---------- */
.step-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 10px;
  border: 1px dashed var(--border); border-radius: 10px; background: none; color: var(--muted);
  font: inherit; font-size: 13.5px; cursor: pointer; align-self: flex-start;
}
.step-link:hover { color: var(--accent); border-color: var(--accent); }
.step .step__text > .step-link { display: flex; width: max-content; }
@media (max-width: 760px) { .step > .step__text:first-child > .step-link { margin-top: 0; } }
