/* Окно заявки «Подбор за 3 шага» (js/lead.js). Слева — наряд-заявка, который заполняется по ответам, справа — шаги.
   Живёт вне #site (у #site container-type ломает position: fixed), поэтому токены берутся с :root (tokens.css). */

:where(.lq, .lq *, .lq *::before, .lq *::after) { box-sizing: border-box; }
:where(.lq) img { display: block; max-width: 100%; }
:where(.lq) a { color: inherit; text-decoration: none; }
:where(.lq) :is(button, input) { font: inherit; color: inherit; }
:where(.lq) :is(h2, p, dl, dd, ol) { margin: 0; padding: 0; }
.lq {
  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-in: cubic-bezier(.4, 0, 1, 1);
  --e-sheet: cubic-bezier(.32, .72, 0, 1);
  --lq-px: 32px;
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; visibility: hidden;
  font-family: var(--f-body), system-ui, sans-serif; font-weight: var(--fw-b); font-size: var(--fs-body); line-height: 1.5;
  color: var(--text); -webkit-font-smoothing: antialiased;
  transition: visibility 0s linear 260ms;
}
.lq.is-in { visibility: visible; transition: none; }
.lq :focus-visible:not(.ctl) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lq .mono { font-family: var(--f-label), ui-monospace, monospace; font-weight: 500; letter-spacing: 0; }
.lq .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lq .ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.lq-back { position: absolute; inset: 0; background: rgba(4, 5, 6, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity 200ms linear; }
.lq.is-in .lq-back { opacity: 1; transition-duration: 260ms; }

.lq-dlg { position: relative; z-index: 1; width: min(1080px, 100%); height: min(720px, calc(100dvh - 48px)); display: grid; grid-template-columns: minmax(330px, 37%) minmax(0, 1fr); overflow: hidden;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); border-radius: var(--r-lg);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(26px) scale(.975); transition: opacity 200ms linear, transform 240ms var(--e-in); }
.lq.is-in .lq-dlg { opacity: 1; transform: none; transition: opacity 260ms linear, transform 520ms var(--e-out); }

.lq-x { position: absolute; top: 18px; right: 18px; z-index: 6; width: 42px; height: 42px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); transition: transform .25s var(--e-out), border-color .15s, color .15s; }
.lq-x .ic { width: 18px; height: 18px; }
.lq-x:hover { transform: rotate(90deg); border-color: var(--accent); color: var(--text); }
.lq-grab { display: none; }

.lq-ov { font-family: var(--f-label); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); }
.lq-h { font-family: var(--f-head); font-weight: var(--fw-h); letter-spacing: var(--h-ls); line-height: 1.1; font-size: clamp(27px, 2.5vw, 36px); text-wrap: balance; outline: none; }
.lq-hl { background: var(--accent); color: var(--on-accent); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lq-sub { color: var(--muted); max-width: 46ch; margin-top: 10px; }
.lq-lbl { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 10px; }

/* ---------- Наряд-заявка ---------- */
.lq-aside { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 24px; min-height: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 45% at 30% 100%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--border) 27%, transparent) 0 1px, transparent 1px calc(var(--u) * 1.75)),
    var(--bg2);
  border-right: 1px solid var(--border); }
.lq-tk-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lq-date { font-size: var(--fs-xs); color: var(--muted); }

.lq-vis { position: relative; flex: none; aspect-ratio: 16 / 9.5; border-radius: calc(var(--r-lg) - 6px); overflow: hidden; background: #050607; isolation: isolate;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent); }
.lq-vis img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 500ms linear, transform 900ms var(--e-out); }
.lq-vis img.is-on { opacity: 1; transform: none; }
.lq-vis::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(5, 6, 7, .65)); }
.lq-crn { position: absolute; z-index: 3; width: 16px; height: 16px; border: 0 solid var(--accent); pointer-events: none; }
.lq-crn:nth-of-type(1) { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.lq-crn:nth-of-type(2) { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.lq-crn:nth-of-type(3) { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.lq-crn:nth-of-type(4) { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }
.lq-vis-cap { position: absolute; left: 38px; bottom: 13px; z-index: 3; font-family: var(--f-label); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.lq-scan { position: absolute; top: 8%; bottom: 8%; left: 6%; width: 2px; z-index: 4; opacity: 0; pointer-events: none;
  background: linear-gradient(transparent, var(--accent) 25%, var(--accent) 75%, transparent); box-shadow: 0 0 16px 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.lq-scan::after { content: ""; position: absolute; top: 0; bottom: 0; right: 2px; width: 90px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent)); }
.lq-vis.is-scan .lq-scan { animation: lqScan 1000ms cubic-bezier(.45, 0, .55, 1) both; }
@keyframes lqScan { 0% { left: 6%; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 94%; opacity: 0; } }

.lq-tk { display: grid; border-top: 1px dashed color-mix(in srgb, var(--text) 18%, transparent); }
.lq-tk > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed color-mix(in srgb, var(--text) 12%, transparent); }
.lq-tk dt { font-family: var(--f-label); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lq-tk dd { position: relative; justify-self: start; max-width: 100%; font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; margin-left: -4px; border-radius: 3px; }
.lq-tk dd.is-empty { color: color-mix(in srgb, var(--muted) 60%, transparent); font-weight: 500; letter-spacing: .2em; }
/* Новое значение «прописывается» маркером — тот же акцент, что в заголовках */
.lq-tk dd.is-new { animation: lqMark 900ms var(--e-out); }
@keyframes lqMark { 0% { background: var(--accent); color: var(--on-accent); clip-path: inset(0 100% 0 0); } 35% { background: var(--accent); color: var(--on-accent); clip-path: inset(0 0 0 0); } 100% { background: transparent; clip-path: inset(0 0 0 0); } }

.lq-flow { display: grid; gap: 8px; list-style: none; margin: 4px 0 0; padding: 0; font-size: var(--fs-xs); color: var(--muted); }
.lq-flow li { display: flex; gap: 12px; align-items: baseline; }
.lq-flow b { font-family: var(--f-label); font-size: 10.5px; font-weight: 700; color: var(--accent-text); }
@media (max-height: 760px) { .lq-flow { display: none; } }
.lq-count { margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); }
.lq-num { grid-row: span 2; min-width: 1.6ch; font-family: var(--f-head); font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -.03em; color: var(--accent-text); font-variant-numeric: tabular-nums; overflow: hidden; }
.lq-num span { display: block; }
.lq-num.is-roll span { animation: lqRoll 420ms var(--e-out); }
@keyframes lqRoll { from { transform: translateY(60%); opacity: 0; } }
.lq-num.is-dim { color: var(--muted); }
.lq-count-t { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.lq-count-t b { color: var(--text); font-weight: 600; }
.lq-see { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-text); width: max-content; }
.lq-see .ic { width: 14px; height: 14px; transition: transform .18s; }
.lq-see:hover .ic { transform: translateX(3px); }
.lq-see[hidden] { display: none; }

.lq-stamp { position: absolute; z-index: 5; right: 34px; bottom: 132px; padding: 8px 16px 6px; border: 3px solid var(--accent); border-radius: 8px; color: var(--accent);
  font-family: var(--f-label); font-weight: 800; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.1; text-align: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg2) 55%, transparent); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transform: rotate(-11deg) scale(1.9); }
.lq-stamp small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.lq.is-sent .lq-stamp { animation: lqStamp 520ms cubic-bezier(.2, 1.4, .4, 1) 260ms forwards; }
@keyframes lqStamp { 0% { opacity: 0; transform: rotate(-11deg) scale(1.9); } 60% { opacity: 1; } 100% { opacity: .95; transform: rotate(-11deg) scale(1); } }

/* ---------- Шаги ---------- */
.lq-main { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.lq-main::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(165deg, color-mix(in srgb, var(--text) 5%, transparent), transparent 38%); }
.lq-prog { position: relative; display: flex; gap: 10px; padding: 26px 86px 0 var(--lq-px); list-style: none; }
.lq-prog li { flex: 1; min-width: 0; }
.lq-prog button { display: grid; gap: 9px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: default; }
.lq-prog li.is-done button { cursor: pointer; }
.lq-prog i { position: relative; display: block; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.lq-prog i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 520ms var(--e-out); }
.lq-prog li.is-cur i::after { transform: scaleX(.5); }
.lq-prog li.is-done i::after { transform: scaleX(1); }
.lq-prog span { display: flex; gap: 8px; font-family: var(--f-label); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.lq-prog span b { font-weight: 700; color: color-mix(in srgb, var(--muted) 70%, transparent); }
.lq-prog li.is-cur span, .lq-prog li.is-cur span b { color: var(--text); }
.lq-prog li.is-done span b { color: var(--accent-text); }
.lq-prog li.is-done button:hover span { color: var(--text); }

.lq-scroll { position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lq-pane { display: grid; gap: 22px; align-content: start; padding: 28px var(--lq-px) 28px; }
.lq-pane[hidden] { display: none !important; }

/* Появление лесенкой; направление зависит от того, вперёд или назад */
.lq [data-st] { opacity: 0; transform: translateX(var(--from, 18px)); }
.lq.is-in .lq-pane.is-on [data-st] { opacity: 1; transform: none; transition: opacity 260ms linear, transform 460ms var(--e-out); transition-delay: calc(var(--st-d, 60ms) + var(--i, 0) * 40ms); }
.lq.is-out .lq-pane.is-on [data-st] { opacity: 1; transform: none; }
.lq.is-back { --from: -18px; }
.lq-pane.is-leave { opacity: 0; transform: translateX(calc(var(--from, 18px) * -1)); transition: opacity 160ms linear, transform 160ms var(--e-in); }

/* Шаг 1: плитки */
.lq-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lq-tile { --mx: 50%; --my: 50%; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 2px 14px; align-items: start; align-content: start; min-height: 128px; padding: 18px; cursor: pointer;
  border-radius: calc(var(--r-sm) + 4px); border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 2.5%, transparent);
  transition: border-color .2s, background-color .2s, transform .2s var(--e-out); }
.lq-tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(240px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); }
.lq-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.lq-tile:hover::before { opacity: 1; }
.lq-tile:active { transform: scale(.985); }
.lq-tile input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lq-tile .icon-box { grid-row: span 3; width: 46px; height: 46px; transition: background-color .2s, color .2s, border-color .2s; }
.lq-tile b { font-size: calc(var(--fs-body) * 1.06); font-weight: 700; line-height: 1.25; padding-right: 26px; }
.lq-tile .xs { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.lq-tile .mono { align-self: end; margin-top: 10px; font-size: 11px; color: var(--muted); }
.lq-tile .mono:empty { display: none; }
.lq-ck { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.lq-ck .ic { width: 13px; height: 13px; stroke-width: 2.6; color: var(--on-accent); opacity: 0; transform: scale(.4); transition: opacity .15s, transform .3s var(--e-out); }
.lq-tile:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.lq-tile:has(input:checked) .icon-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lq-tile:has(input:checked) .lq-ck { background: var(--accent); border-color: var(--accent); }
.lq-tile:has(input:checked) .lq-ck .ic { opacity: 1; transform: none; }
.lq-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Чипсы: тип рейки, марки, модели */
.lq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lq-chips:empty { display: none; }
.lq-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); font-size: var(--fs-sm); font-weight: 600; color: var(--text); white-space: nowrap;
  transition: border-color .15s, background-color .15s, color .15s, transform .15s var(--e-out); }
.lq-chip:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.lq-chip:active { transform: scale(.96); }
.lq-chip i { font-style: normal; font-family: var(--f-label); font-size: 10.5px; color: var(--muted); }
.lq-chip .ic { width: 15px; height: 15px; }
.lq-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lq-chip.is-on, .lq-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lq-chip.is-on i, .lq-chip:has(input:checked) i { color: color-mix(in srgb, var(--on-accent) 60%, transparent); }
.lq-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lq-chips.is-pop .lq-chip { animation: lqPop 360ms var(--e-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
@keyframes lqPop { from { opacity: 0; transform: translateY(6px) scale(.94); } }

/* Поля с плавающей подписью — как в шторке заказа */
.lq-f { position: relative; display: grid; min-width: 0; }
.lq-f .ctl { height: 60px; padding: 22px 46px 6px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: calc(var(--fs-body) * .98);
  border-color: color-mix(in srgb, var(--text) 16%, var(--border)); }
.lq-f .ctl::placeholder { color: transparent; transition: color .15s; }
.lq-f .ctl:focus::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.lq-l { position: absolute; left: 17px; top: 19px; font-size: calc(var(--fs-body) * .95); color: var(--muted); pointer-events: none; white-space: nowrap;
  transform-origin: 0 0; transition: transform .22s var(--e-out), color .2s; }
.lq-l i { font-style: normal; opacity: .6; }
.lq-f .ctl:focus + .lq-l, .lq-f .ctl:not(:placeholder-shown) + .lq-l { transform: translateY(-11px) scale(.76); }
.lq-f .ctl:focus + .lq-l { color: var(--accent-text); }
.lq-f-no .ctl { font-family: var(--f-label), ui-monospace, monospace; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; height: 68px; padding-top: 26px; }
.lq-f-no .lq-l { top: 23px; font-family: var(--f-body); letter-spacing: 0; }
.lq-f-no .ctl:focus + .lq-l, .lq-f-no .ctl:not(:placeholder-shown) + .lq-l { transform: translateY(-13px) scale(.76); }
.lq-ok { position: absolute; right: 16px; top: 20px; width: 20px; height: 20px; color: var(--accent-text); pointer-events: none; }
.lq-ok path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--e-out); }
.lq-f.is-valid .lq-ok path { stroke-dashoffset: 0; }
.lq-err { display: grid; grid-template-rows: 0fr; font-style: normal; font-size: var(--fs-xs); color: var(--danger); transition: grid-template-rows .22s var(--e-out), margin-top .22s var(--e-out); }
.lq-err > span { overflow: hidden; min-height: 0; }
.lq-f.is-error .lq-err { grid-template-rows: 1fr; margin-top: 6px; }
.lq-f.is-error .ctl { border-color: var(--danger); }
.lq-f.is-error .ctl:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.lq-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; }
.lq-car { display: grid; gap: 12px; }
.lq-hint { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.lq-hint .ic { width: 16px; height: 16px; margin-top: 1px; }
.lq-mode[hidden] { display: none; }
.lq-mode { display: grid; gap: 12px; }
.is-shake { animation: lqShake 320ms var(--e-out); }
@keyframes lqShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.lq .check { font-size: var(--fs-xs); line-height: 1.45; }

/* Переключатели с подложкой, которая переезжает под выбранный пункт */
.lq-seg { --n: 2; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 4px; border-radius: calc(var(--r-sm) + 4px); background: var(--bg); border: 1px solid var(--border); }
.lq-seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: var(--r-sm); background: var(--accent); transition: transform .32s var(--e-out); }
.lq-seg:has(label:nth-of-type(2) input:checked) .lq-seg-pill { transform: translateX(100%); }
.lq-seg:has(label:nth-of-type(3) input:checked) .lq-seg-pill { transform: translateX(200%); }
.lq-seg:has(label:nth-of-type(4) input:checked) .lq-seg-pill { transform: translateX(300%); }
.lq-seg label { position: relative; z-index: 1; cursor: pointer; min-width: 0; }
.lq-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.lq-seg span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); transition: color .2s; white-space: nowrap; }
.lq-seg span .ic { width: 16px; height: 16px; }
.lq-seg input:checked + span { color: var(--on-accent); }
.lq-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* Счётчик в шагах — на узких экранах, где наряда слева нет */
.lq-live { display: none; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 7%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); font-size: var(--fs-xs); color: var(--muted); }
.lq-live b { color: var(--text); }
.lq-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: lqPulse 1.8s infinite; }
@keyframes lqPulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.lq-note { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.lq-note .ic { width: 16px; height: 16px; margin-top: 1px; }
.lq-fail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--e-out); }
.lq-fail > div { overflow: hidden; min-height: 0; }
.lq-fail p { padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent); color: #FFB4AA; font-size: var(--fs-sm); }
.lq-fail a { color: #fff; font-weight: 700; white-space: nowrap; }
.lq-form.is-fail .lq-fail { grid-template-rows: 1fr; }

/* Низ: назад / далее */
.lq-foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--lq-px) calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, var(--bg)); }
.lq-foot[hidden] { display: none; }
.lq-prev { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); transition: color .15s; }
.lq-prev .ic { width: 16px; height: 16px; transform: rotate(180deg); transition: transform .18s; }
.lq-prev:hover { color: var(--text); }
.lq-prev:hover .ic { transform: rotate(180deg) translateX(3px); }
.lq-prev.is-off { visibility: hidden; }
.lq-next { position: relative; overflow: hidden; min-width: 230px; }
.lq-next::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 38%; pointer-events: none; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); }
.lq-next.is-shine::before { animation: lqShine 900ms var(--e-out) both; }
@keyframes lqShine { to { left: 130%; } }
.lq-next.is-loading .ic { display: none; }
.lq-next.is-soft { background: transparent; color: var(--text); border-color: color-mix(in srgb, var(--text) 40%, transparent); box-shadow: none; }

/* Успех */
.lq-done { text-align: center; justify-items: center; align-content: center; min-height: 100%; }
.lq-done .lq-sub { margin-inline: auto; }
.lq-tick { width: 84px; height: 84px; color: var(--accent); overflow: visible; }
.lq-tick circle, .lq-tick path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lq-tick circle { stroke-dasharray: 183; stroke-dashoffset: 183; transform: rotate(-90deg); transform-origin: center; }
.lq-tick path { stroke-dasharray: 40; stroke-dashoffset: 40; }
.lq-tick .halo { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; transform-origin: center; transform: scale(.4); opacity: 0; }
.lq.is-in .lq-pane.is-on .lq-tick circle:not(.halo) { animation: lqDraw 520ms var(--e-out) 120ms forwards; }
.lq.is-in .lq-pane.is-on .lq-tick path { animation: lqDraw 380ms var(--e-out) 420ms forwards; }
.lq.is-in .lq-pane.is-on .lq-tick .halo { animation: lqHalo 700ms var(--e-out) 340ms forwards; }
@keyframes lqDraw { to { stroke-dashoffset: 0; } }
@keyframes lqHalo { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
.lq-done-act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lq-sum { display: none; width: 100%; max-width: 420px; text-align: left; }

/* Планшет: наряда слева нет, окно уже */
@media (max-width: 900px) {
  .lq-dlg { width: min(640px, 100%); grid-template-columns: minmax(0, 1fr); }
  .lq-aside { display: none; }
  .lq-live { display: grid; }
  .lq-sum { display: grid; }
  .lq-sum .lq-tk { border-top: 0; }
  .lq-sum .lq-tk > div:has(dd.is-empty) { display: none; }
}

/* Телефон: шторка снизу, закрывается свайпом вниз за ручку */
@media (max-width: 620px) {
  .lq { --lq-px: 20px; place-items: end stretch; padding: 0; }
  .lq-dlg { width: 100%; height: auto; max-height: 94dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; grid-template-rows: auto minmax(0, 1fr);
    opacity: 1; transform: translateY(100%); transition: transform 260ms var(--e-in); }
  .lq.is-in .lq-dlg { transform: none; transition: transform 480ms var(--e-sheet); }
  .lq-dlg.is-drag { transition: none !important; }
  .lq-grab { display: block; height: 22px; cursor: grab; touch-action: none; position: relative; }
  .lq-grab::before { content: ""; position: absolute; left: 50%; top: 9px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: color-mix(in srgb, var(--text) 35%, transparent); }
  .lq-x { top: 14px; right: 12px; width: 36px; height: 36px; }
  .lq-prog { padding: 8px 60px 0 var(--lq-px); gap: 8px; }
  .lq-prog span { font-size: 9.5px; letter-spacing: .08em; }
  .lq-pane { padding-block: 20px; gap: 18px; }
  .lq-h { font-size: 26px; }
  .lq-sub { margin-top: 8px; font-size: var(--fs-sm); }
  .lq-tiles { gap: 10px; }
  .lq-tile { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; min-height: 0; padding: 14px; gap: 4px; }
  .lq-tile .icon-box { grid-row: auto; width: 40px; height: 40px; margin-bottom: 6px; }
  .lq-tile b { font-size: var(--fs-body); padding-right: 0; }
  .lq-tile .mono { margin-top: 4px; }
  .lq-ck { top: 12px; right: 12px; }
  .lq-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 10px; }
  .lq-seg span { gap: 6px; font-size: 12.5px; }
  .lq-seg-via span { gap: 0; }
  .lq-seg-via span .ic { display: none; }
  .lq-foot { gap: 10px; }
  .lq-next { min-width: 0; flex: 1; }
  .lq-chip { height: 36px; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .lq *, .lq *::before, .lq *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 120ms !important; transition-delay: 0s !important; }
  .lq .lq-dlg, .lq [data-st] { transform: none !important; }
}
