.wizard-back {
  position: fixed;
  top: 22px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  transition: border-color .18s ease, background-color .18s ease;
  z-index: 11;
}

.wizard-back:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.wizard-back img { flex: 0 0 20px; filter: brightness(0) invert(1); }
body.wizard-active .language-switch { position: fixed; top: 22px; right: 24px; }
.wizard-section {
  width: min(640px, 100%);
  margin: 118px auto 40px;
  padding: 32px 44px 36px;
  text-align: center;
}
.wizard-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; margin-bottom: 28px; }
.wizard-step-meta { text-align: left; }
.wizard-summary { display: flex; justify-content: flex-end; align-items: center; gap: 10px; font-size: 18px; line-height: 1.5; font-weight: 650; color: var(--muted); text-align: right; }
.wizard-progress { display: flex; gap: 5px; padding: 0; margin: 9px 0 0; list-style: none; width: 94px; }
.wizard-progress li { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background-color .24s ease; }
.wizard-progress li.is-current, .wizard-progress li.is-complete { background: var(--primary); }
.wizard-step-label { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.wizard-title { margin: 0 auto 18px; max-width: 510px; font-size: 24px; line-height: 1.4; font-weight: 650; letter-spacing: 0; outline: none; text-wrap: pretty; }
.wizard-title-group { position: relative; margin: 0 auto 18px; max-width: 510px; }
.wizard-instructions { padding-left: 1.5em; margin: 0; text-align: left; font-size: 20px; line-height: 1.5; font-weight: 650; }
.wizard-instructions li + li { margin-top: 10px; }
.wizard-instructions li::marker { color: var(--primary); }
.wizard-external { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; max-width: 100%; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 16px; font-weight: 650; color: var(--primary-dark); }
.wizard-external:hover { border-color: var(--primary); }
.wizard-external img { flex: 0 0 18px; opacity: .7; }
#telegramGuideLink { background: #087eaf; border-color: #087eaf; color: #fff; }
#telegramGuideLink:hover { background: #076c97; border-color: #076c97; }
#telegramGuideLink img { filter: brightness(0) invert(1); opacity: 1; }
.wizard-helper { margin: 14px auto 0; max-width: 450px; font-size: 14px; line-height: 1.5; font-weight: 400; color: var(--muted); }
.wizard-order-hint { margin: -4px auto 18px; }
.wizard-contact { margin: 18px auto 0; max-width: 370px; font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--muted); }
.wizard-next { display: block; width: 100%; margin-top: 28px; min-height: 50px; border-radius: 8px; font-size: 16px; }
.wizard-next:disabled { background: var(--primary); opacity: .45; cursor: not-allowed; }
.wizard-input { margin-top: 18px; text-align: left; }
.wizard-section.telegram-confirmation-active #accountDataField { display: block; }
.wizard-section.telegram-confirmation-active #accountDataInput { height: 208px; min-height: 208px; max-height: 208px; resize: none; }
.wizard-input input, .wizard-input textarea { border-radius: 8px; font-size: 14px; line-height: 1.5; font-weight: 400; }
.wizard-input textarea::placeholder, .wizard-input input::placeholder { color: #7b837d; font-family: ui-sans-serif, system-ui, sans-serif; opacity: 1; }
.wizard-input textarea:read-only, .wizard-input input:read-only { background: var(--surface-soft); color: var(--muted); }
.wizard-section .inline-result { text-align: left; overflow-wrap: anywhere; }
.wizard-section .inline-result:empty { display: none; }
.wizard-section .error-card, .wizard-section .message-card { font-size: 14px; line-height: 1.5; }
#wizardFixBtn { width: 100%; margin-top: 20px; border-radius: 8px; }
.wizard-example-wrap { display: inline-block; vertical-align: baseline; margin-left: 6px; }
.wizard-example-row { position: relative; }
.wizard-example-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 4px 3px; font-size: 15px; font-weight: 650; color: var(--primary); background: transparent; border-radius: 4px; transition: background-color .18s ease, color .18s ease; }
.wizard-example-btn span { text-decoration: underline dotted; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.wizard-example-btn:hover, .wizard-example-btn[aria-expanded="true"] { color: var(--primary-dark); background: var(--surface-soft); }
.wizard-example-btn:hover span { text-decoration-style: solid; }
.wizard-example-btn img { opacity: .7; }
.wizard-example { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: min(540px, calc(100vw - 48px)); z-index: 20; padding: 40px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 32px #0002; text-align: center; }
.wizard-example > img { display: block; width: 100%; height: auto; border-radius: 4px; }
.wizard-icon-btn { display: grid; place-items: center; position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; padding: 0; background: transparent; border-radius: 6px; }
.wizard-icon-btn:hover { background: var(--surface-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wizard-section .hidden, .wizard-back.hidden { display: none !important; }

@media (max-width: 600px) {
  .wizard-back { left: 10px; top: 16px; }
  body.wizard-active .language-switch { right: 10px; top: 16px; }
  .wizard-section { margin: 84px auto 20px; padding: 24px 20px; }
  .wizard-header { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 24px; }
  .wizard-summary { font-size: 17px; gap: 8px; }
  .wizard-title { font-size: 20px; line-height: 1.4; margin-bottom: 16px; }
  .wizard-title-group { margin-bottom: 16px; }
  .wizard-instructions { font-size: 18px; }
  .wizard-next { margin-top: 24px; }
  .wizard-helper, .wizard-contact { font-size: 13px; }
  .wizard-section.telegram-confirmation-active #accountDataInput { height: 192px; min-height: 192px; max-height: 192px; font-size: 16px; }
  .wizard-input input { font-size: 16px; }
  .wizard-example { width: min(500px, calc(100vw - 48px)); }
}

@media (max-width: 360px) {
  .wizard-summary { font-size: 16px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-section *, .wizard-back { transition: none !important; }
}
