/* The supplied screenshots show the existing 1920px Figma canvas at 1300px.
   Keep its verified component geometry and use a fixed desktop display scale.
   Unlike the old resize script, this never varies text size with the viewport. */
@media (min-width: 1181px) {
  :root { zoom: .6770833333; --vw: 19.2px; }
  .nav { position: absolute; left: 50%; margin-left: 0; transform: translateX(-50%); gap: 13.25px; }
  .hdr .btn { min-width: 278px; }
}
@media (min-width: 1600px) { :root { zoom: .8333333333; } }
@media (min-width: 1920px) { :root { zoom: 1; } }

html { scroll-padding-top: 150px; }
body { overflow-x: clip; }
.td__position-mobile { display: none; }

/* Preserve the thin rail, but make the existing calculator easier to operate. */
input[type=range] { height: 24px; margin-top: 3px; margin-bottom: -9px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: var(--radius-chip); background: rgba(202,183,254,.3); }
input[type=range]::-moz-range-track { height: 6px; border-radius: var(--radius-chip); background: rgba(202,183,254,.3); }
input[type=range]::-webkit-slider-thumb { margin-top: -9px; }

@media (max-width: 1180px) {
  .steps__way { display: none; }
  .td__position-desktop { display: none; }
  .td__position-mobile { display: inline; }
  .hero__grid, .td__grid, .calc__panel, .lead__grid { grid-template-columns: minmax(0,1fr); }
  .nav__drop { max-width: calc(100vw - 48px); }
  .hero__cards .card { padding: 24px; }
  .hero__cards .card__txt { max-width: none; }
  .hero__cards .card__ico { position: static; align-self: flex-end; width: 104px; height: 104px; margin-top: 16px; transform: none; }
  .ch .card { padding: 24px; overflow: hidden; }
  .ch__grid .card .card__ico { position: static; align-self: flex-end; margin-top: 12px; transform: none; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .hdr__in { padding-inline: 24px; gap: 8px; }
  .nav { gap: 0; }
  .nav__group > summary, .nav__link { padding-inline: 8px; font-size: 15px; }
  .hdr .btn { min-width: 0; font-size: 15px; padding-inline: 18px; }
}

@media (max-width: 640px) {
  :root {
    --fs-base: 16px; --lh-base: 24px;
    --fs-lg: 16px; --lh-lg: 23px;
    --fs-sm: 14px; --lh-sm: 21px;
    --fs-xs: 13px; --lh-xs: 19px;
  }
  html { scroll-padding-top: 88px; }
  h2 { font-size: 26px; line-height: 30px; letter-spacing: 0; }
  .hero h1 { font-size: 32px; line-height: 36px; letter-spacing: 0; margin-left: 0; overflow-wrap: anywhere; }
  .hero__lead { margin-top: 24px; }
  .hero__cards .card { min-height: 150px; padding: 24px 112px 24px 24px; }
  .hero__cards .card__ico { position: absolute; width: 108px; height: 108px; right: 4px; bottom: 0; margin-top: 0; transform: none; }
  .hero__cards h3 { font-size: 20px; line-height: 23px; }
  .td__panel { padding-inline: 16px; }
  .td__grid { margin-left: 0; }
  .td__aside { margin-left: 0; }
  .td__list a { overflow-wrap: anywhere; }
  .btn--wide { font-size: 13px; padding-inline: 12px; gap: 8px; white-space: nowrap; }
  .btn--wide .ico { width: 20px; height: 20px; }
  .callout { font-size: 15px; line-height: 22px; padding: 12px; }
  .chat { min-width: 0; }
  .chat__in { font-size: 16px; }
  .chip { min-height: 44px; }
  .field__row { gap: 10px; }
  .field__num { width: 96px; }
  .calc__out { padding: 18px 14px; }
  .calc__loss { padding: 18px 14px; }
  .calc__loss b { font-size: 28px; line-height: 34px; letter-spacing: 0; }
  .calc__row { gap: 10px; }
  .calc__row span { min-width: 0; }
  .calc__row b { font-size: 16px; }
  .steps__grid { gap: 32px; }
  .step { position: relative; display: grid; grid-template-columns: 88px minmax(0,1fr); column-gap: 16px; }
  .step__ring { grid-column: 1; grid-row: 1 / 4; width: 88px; height: 88px; }
  .step__disc { width: 64px; height: 64px; }
  .step__disc .ico { width: 44px; height: 44px; }
  .step__when { grid-column: 2; margin-top: 3px; font-size: 13px; line-height: 18px; }
  .step h3 { grid-column: 2; max-width: none; margin-top: 6px; font-size: 18px; line-height: 22px; letter-spacing: 0; }
  .step p { grid-column: 2; margin-top: 8px; font-size: 14px; line-height: 20px; }
  .step:not(:last-child)::after {
    content: ''; position: absolute; left: 43px; top: 88px; bottom: -32px;
    border-left: 1px dashed var(--accent); pointer-events: none;
  }
  .ch .card { min-height: 0; padding: 24px; overflow: hidden; }
  .ch__grid .card .card__ico { position: static; align-self: flex-end; margin-top: 12px; transform: none; }
  .card--tall .card__ico { transform: none; }
  .ftr { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
}

/* ==== Шапка 17.09: телефон и часы; после первого экрана — доводы вместо меню ====
   Меню и доводы стоят в одной ячейке сетки (.hdr__slot), телефон и «Позвонить» —
   в другой (.hdr__act). Смена — прозрачностью и сдвигом, без display:none,
   поэтому ширина шапки не прыгает и переход плавный. */
.hdr__proof, .hdr__ring, .hdr__tel { display: none; }
.hdr__proof { margin: 0; padding: 0; list-style: none; align-items: center; gap: 28px; }
.hdr__proof li { display: flex; align-items: center; gap: 8px; white-space: nowrap; font: 600 var(--fs-lg)/1.2 var(--font-h); color: var(--ink); }
.hdr__proof .ico { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: #fff; fill: none; stroke: var(--teal-500); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hdr__call { display: grid; justify-items: end; gap: 4px; text-align: right; }
.hdr__phone { font: 700 28px/1.15 var(--font-h); color: var(--ink); text-decoration: none; white-space: nowrap; }
.hdr__phone:hover { color: var(--accent-strong); }
.hdr__hours { display: flex; align-items: center; gap: 8px; font-size: 17px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; }
.hdr__hours i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-h); }
.hdr__hours.is-open i { background: var(--teal-500); box-shadow: 0 0 0 4px rgba(1,132,127,.16); }
/* «Позвонить» — белая пилюля с бирюзовой обводкой: мягкая мятная кнопка сливалась с мятной шапкой. */
.hdr .btn.hdr__ring { min-width: 0; margin: 0; padding-inline: 26px; justify-content: center; gap: 10px; background: #fff; color: var(--teal-800); font-weight: 600; box-shadow: inset 0 0 0 2px var(--teal-400); }
.hdr .btn.hdr__ring:hover, .hdr .btn.hdr__ring:focus-visible { background: var(--teal-50); color: var(--teal-800); }
.hdr__tel { width: 48px; height: 48px; border-radius: 50%; place-items: center; background: #fff; color: var(--teal-800); }
.hdr__tel .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Над липкой шапкой — та же мята: встроенные браузеры (Telegram, Safari на iOS)
   показывают страницу и под своей панелью, и там просвечивал текст статьи. */
.hdr::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--teal-100); pointer-events: none; }

@media (min-width: 901px) {
  .hdr__slot, .hdr__act { display: grid; align-items: center; }
  .hdr__slot > *, .hdr__act > * { grid-area: 1 / 1; }
  .hdr__act { justify-items: end; margin-left: auto; }
  .hdr__slot .nav { position: static; transform: none; margin: 0; }
  .hdr__proof { display: flex; }
  .hdr__ring { display: inline-flex; }
  .hdr__slot .nav, .hdr__call, .hdr__proof, .hdr__ring {
    transition: opacity .28s var(--ease-out), transform .36s var(--ease-out), visibility 0s linear 0s;
  }
  .hdr__proof, .hdr__ring { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none;
    transition: opacity .28s var(--ease-out), transform .36s var(--ease-out), visibility 0s linear .36s; }
  .hdr.is-compact .hdr__slot .nav, .hdr.is-compact .hdr__call { opacity: 0; visibility: hidden; transform: translateY(-10px); pointer-events: none;
    transition: opacity .2s var(--ease-out), transform .3s var(--ease-out), visibility 0s linear .3s; }
  .hdr.is-compact .hdr__proof, .hdr.is-compact .hdr__ring { opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity .32s var(--ease-out) .08s, transform .4s var(--ease-out) .08s, visibility 0s linear 0s; }
  .hdr .hdr__act + .btn { margin-left: 20px; }
}
@media (min-width: 1181px) {
  .hdr__in { padding-left: 64px; padding-right: 56px; gap: 16px; }
  .hdr__slot { margin-left: 8px; }
  .nav { gap: 2px; }
  .nav__group > summary, .nav__link { padding-inline: 11px; }
  .hdr .btn:not(.hdr__ring) { min-width: 0; padding-inline: 28px; justify-content: center; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .hdr__slot { margin-left: auto; }
  .hdr__act { margin-left: 8px; }
  .hdr__hours { display: none; }
  .hdr__phone { font-size: 16px; }
  .hdr .hdr__act + .btn { margin-left: 12px; }
  .hdr__proof { gap: 16px; }
  .hdr__proof li { font-size: 15px; }
  .hdr__proof li:nth-child(3) { display: none; }
  .hdr .btn.hdr__ring { font-size: 15px; padding-inline: 16px; }
}
@media (max-width: 900px) {
  .hdr__call, .hdr__act { display: none; }
  .hdr__slot { display: contents; }
  .hdr__tel { display: grid; margin-left: auto; }
  .burger { margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .hdr__slot .nav, .hdr__call, .hdr__proof, .hdr__ring { transition: none !important; transform: none !important; }
}

/* ---- окно обратного звонка ---- */
.cb { width: calc(100% - 32px); max-width: 460px; padding: 32px; border: 0; border-radius: var(--radius-l); background: #fff; color: var(--ink); box-shadow: 0 24px 48px rgba(0,79,80,.14); }
.cb::backdrop { background: rgba(0,57,58,.35); }
.cb__x { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--teal-50); color: var(--ink-2); font-size: 26px; line-height: 1; cursor: pointer; }
.cb__k { display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: var(--radius-chip); background: var(--teal-100); color: var(--teal-800); font: 700 var(--fs-xs)/1 var(--font-h); }
.cb__h { margin: 0 40px 20px 0; font: 700 26px/1.2 var(--font-h); letter-spacing: -.02em; }
.cb .form { padding: 0; box-shadow: none; gap: 14px; }
.cb .form .btn { width: 100%; }
.cb__or { margin: 16px 0 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.cb__or a { color: var(--accent-strong); font-weight: 700; white-space: nowrap; }
@media (min-width: 1181px) { .cb { max-width: 640px; padding: 48px; } .cb__h { font-size: 36px; } }

/* ---- круглая кнопка звонка: кольца расходятся, при наведении выезжает номер ---- */
.callfab { position: fixed; right: 20px; bottom: 112px; z-index: 49; display: block; border-radius: 50%; text-decoration: none; }
.callfab__phone { position: absolute; right: 30px; top: 50%; padding: 14px 44px 14px 20px; border-radius: var(--radius-chip); background: #fff; box-shadow: 0 16px 40px rgba(0,79,80,.14); white-space: nowrap; font: 700 17px/1 var(--font-h); color: var(--ink); opacity: 0; transform: translate(12px, -50%); pointer-events: none; transition: opacity .22s, transform .32s var(--ease-out); }
.callfab:hover .callfab__phone, .callfab:focus-visible .callfab__phone { opacity: 1; transform: translate(0, -50%); }
.callfab:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.callfab__disc { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; box-shadow: 0 10px 28px rgba(0,79,80,.22); transition: transform .28s var(--ease-out); }
.callfab:hover .callfab__disc { transform: scale(1.08); }
.callfab__disc .ico { position: relative; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callfab__ring { position: absolute; inset: 0; border-radius: 50%; background: var(--grad-a); opacity: .5; animation: callRing 6s ease-out infinite; pointer-events: none; }
.callfab__ring--delay { animation-delay: 3s; }
@keyframes callRing { 0% { transform: scale(1); opacity: .5; } 18% { transform: scale(1.45); opacity: 0; } 100% { transform: scale(1.45); opacity: 0; } }
@media (min-width: 1181px) { .callfab { right: 30px; bottom: 150px; } }

/* ---- нижняя панель телефона ---- */
.mbar { display: none; }
@media (max-width: 900px) {
  .callfab { display: none; }
  .mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 24px rgba(0,79,80,.10); }
  .mbar__it { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px; border: 0; border-radius: 16px; background: var(--teal-50); color: var(--teal-800); font: 600 13px/1.2 var(--font-h); text-decoration: none; cursor: pointer; }
  .mbar__it .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mbar__it--main { background: linear-gradient(90deg, var(--grad-a-h), var(--grad-b-h)); color: #fff; font-size: 15px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  /* Пилюлю консультанта заменяет «Написать»; окно чата — над панелью. */
  #cnslt #cnslt-btn { display: none !important; }
  #cnslt, #cnslt.is-open { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
  .cookie { bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .callfab__ring { animation: none; opacity: 0; }
  .callfab, .callfab__disc, .callfab__phone { transition: none; }
}

/* ---- контакты в подвале: телефон и график работы ---- */
.ftr__contacts { margin-top: 20px; }
.ftr .ftr__phone { display: inline-block; font: 700 22px/1.2 var(--font-h); color: #fff; text-decoration: none; }
.ftr__contacts p { margin: 6px 0 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--ink-dark); }

/* ==== Анимации сайта (владелец 17.09: «красивые анимации по всему сайту») ====
   Всё — только при prefers-reduced-motion: no-preference. Появление при прокрутке
   получают лишь элементы НИЖЕ первого экрана (класс .rv ставит скрипт), поэтому
   при сбое скрипта ничего не остаётся невидимым. Сдвиги — через translate/opacity. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .art-hero h1 { animation: mcHeroIn .8s var(--ease-out) both; }
  .hero__lead, .hero__cta, .art-lead, .art-meta, .crumbs { animation: mcUp .6s var(--ease-out) .12s both; }
  .hero__cards, .art-hero__form { animation: mcUp .7s var(--ease-out) .24s both; }
  @keyframes mcHeroIn { from { opacity: 0; filter: blur(10px); translate: 0 10px; } to { opacity: 1; filter: none; translate: 0 0; } }
  @keyframes mcUp { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

  .rv { opacity: 0; translate: 0 24px; transition: opacity .45s var(--ease-out), translate .55s var(--ease-out); transition-delay: var(--rv-d, 0s); }
  .rv.is-in { opacity: 1; translate: 0 0; }

  .card, .tpl, .stat, .blog-card, .err-list li { transition: translate .28s var(--ease-out), box-shadow .28s var(--ease-out), opacity .6s var(--ease-out); }
  .card:hover, .tpl:hover, .stat:hover, .err-list li:hover { translate: 0 -4px; }
  .rv.is-in.card:hover, .rv.is-in.tpl:hover, .rv.is-in.stat:hover { translate: 0 -4px; }
  .card:hover .card__ico, .stat:hover img, .blog-card:hover img { animation: mcFloat 1.8s ease-in-out infinite; }
  @keyframes mcFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

  .btn:not(.btn--soft):not(.hdr__ring) { position: relative; overflow: hidden; isolation: isolate; }
  .btn:not(.btn--soft):not(.hdr__ring)::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.32) 50%, transparent 70%); translate: -120% 0; transition: translate .8s var(--ease-out); pointer-events: none; }
  .btn:not(.btn--soft):not(.hdr__ring):hover::after { translate: 120% 0; }
  .btn:active, .mbar__it:active, .tpl__copy:active { scale: .97; }

  .faq__item.is-open .faq__a { animation: mcUp .35s var(--ease-out); }
  .is-bump { display: inline-block; animation: mcBump .4s var(--ease-out); }
  @keyframes mcBump { 40% { scale: 1.07; } }
  .toc a:not(.btn) { transition: color .2s, translate .2s var(--ease-out); }
  .toc a:not(.btn):hover { translate: 4px 0; }
}
