/* Дизайн «A»: светло-серый фон, белые карточки с крупным скруглением, синий акцент */
:root {
  --bg: #f2f2f4; --surface: #ffffff; --text: #111113; --muted: #5c5c66; --line: #ececf0;
  --accent: #0a5bd8; --accent-text: #ffffff; --chip: #f2f2f4; --dark: #111113; --dark-2: #2a2a2f;
  --good: #146c34; --good-bg: #e8f5ec;
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e10; --surface: #1a1a1d; --text: #f2f2f3; --muted: #a3a3ad; --line: #2a2a2f;
          --accent: #4d8bff; --accent-text: #ffffff; --chip: #26262b; --dark: #26262b; --dark-2: #34343a;
          --good: #6ee7a0; --good-bg: rgb(52 199 89 / .14); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { padding: 16px 0 32px; min-height: 60vh; }
h1 { font-size: clamp(26px, 4vw, 34px); margin: 0; font-weight: 800; letter-spacing: -.035em; }
.muted { color: var(--muted); margin: 0; }

/* кнопки */
button, .btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-text); border: 0;
  border-radius: 14px; padding: 11px 18px; min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s cubic-bezier(.23, 1, .32, 1), filter .15s; }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.dark { background: var(--dark); color: #fff; }
.btn.soft { background: var(--chip); color: var(--text); }
.btn.light { background: #fff; color: #111113; }
.btn.dim { background: var(--dark-2); color: #fff; }
/* отклик на нажатие вместо серой вспышки iOS */
a, button, summary, select { -webkit-tap-highlight-color: transparent; }
a.btn:active, .flt-go:active { transform: scale(.97); }
@media (hover: hover) { a.btn:hover { filter: brightness(1.08); } }

/* шапка */
.top { background: rgb(255 255 255 / .85); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 2px; height: 26px; margin-right: auto; text-decoration: none;
  font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: -.03em; color: var(--text); }
.brand img { height: 100%; width: auto; display: block; }
.addr { display: flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.addr svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
@media (hover: hover) { .addr:hover { color: var(--text); } }
.contacts { display: flex; align-items: center; gap: 8px; }
.ct { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px;
  border-radius: 22px; background: var(--chip); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600;
  transition: transform .12s cubic-bezier(.23, 1, .32, 1), filter .15s; }
.ct svg { width: 20px; height: 20px; flex: none; }
.ct.call { background: var(--dark); color: #fff; padding: 0 12px; }
.ct.call span { display: none; }
.ct:active { transform: scale(.94); }
@media (hover: hover) { .ct:hover { filter: brightness(.95); } .ct.call:hover { filter: brightness(1.25); } }
@media (min-width: 900px) { .ct.call { padding: 0 18px 0 14px; } .ct.call span { display: inline; } }
@media (max-width: 720px) { .addr { display: none; } }
@media (prefers-color-scheme: dark) {
  .top { background: rgb(14 14 16 / .85); }
  .brand img { filter: invert(1); }
}

/* фильтры: две строки по три поля, как в варианте B */
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface);
  border-radius: 20px; overflow: hidden; margin: 0 0 10px; }
.filters label { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px 10px; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.filters label:nth-child(3n) { border-right: 0; }
.filters label:nth-child(n+4) { border-bottom: 0; }
.filters label > span { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters select, .filters input { font: inherit; font-size: 16px; font-weight: 700; color: var(--text); background: transparent;
  border: 0; padding: 0; min-height: 24px; width: 100%; min-width: 0; outline: none; -webkit-appearance: none; appearance: none;
  text-overflow: ellipsis; }
.filters input::placeholder { color: var(--muted); font-weight: 500; }
.filters label:focus-within { background: var(--chip); }
.flt-go { grid-column: 1 / -1; border-radius: 0; }
.js .flt-go { display: none; }
@media (min-width: 900px) {
  .filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .filters label { border-bottom: 0; }
  .filters label:nth-child(3n) { border-right: 1px solid var(--line); }
  .filters label:nth-child(6) { border-right: 0; }
}
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* выбранные фильтры */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px 0 12px; border-radius: 17px;
  background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: transform .12s cubic-bezier(.23, 1, .32, 1); }
.chip svg { width: 16px; height: 16px; }
.chip:active { transform: scale(.95); }
.reset { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 600; }

/* заголовок каталога */
.head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 18px 0 12px; }
.head .muted { font-size: 14px; }
.sort { margin-left: auto; position: relative; }
.sort select { font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface); border: 0;
  border-radius: 18px; height: 36px; padding: 0 30px 0 14px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.sort::after { content: ""; position: absolute; right: 13px; top: 14px; width: 6px; height: 6px; pointer-events: none;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* карточки: фото слева, данные справа (середина между A и B) */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card { display: flex; gap: 12px; padding: 8px; height: 100%; text-decoration: none; background: var(--surface);
  border-radius: var(--radius); transition: transform .2s cubic-bezier(.23, 1, .32, 1), box-shadow .2s; }
/* наведение только с мышью: на телефоне подъём «залипал» после касания */
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(0 0 0 / .08); } }
.card:active { transform: scale(.985); transition-duration: .1s; }
.ph { flex: none; width: 116px; aspect-ratio: 116 / 160; align-self: flex-start; border-radius: 16px; overflow: hidden; background: var(--chip); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; padding: 4px 4px 4px 0; }
.card h2 { font-size: 18px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.025em; }
.color { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.specs { display: flex; flex-wrap: wrap; gap: 4px; }
.specs span { display: flex; flex-direction: column; flex: 1 1 auto; padding: 5px 8px; border-radius: 10px; background: var(--chip); }
.specs small { font-size: 10px; line-height: 1.3; color: var(--muted); }
.specs b { font-size: 13px; line-height: 1.3; white-space: nowrap; }
.specs .good { background: var(--good-bg); }
.specs .good small, .specs .good b { color: var(--good); }
.prices { margin-top: auto; }
.price { margin: 0; font-weight: 800; font-size: 21px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.price-note { margin: 0; font-size: 12px; color: var(--muted); }
.price2 { margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.price2 b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

/* сервис магазина */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.bento > div { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--surface); }
.bento b { font-size: 16px; line-height: 1.25; }
.bento div span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.bento .wide, .bento-ti { grid-column: 1 / -1; }
.bento-ti { justify-content: space-between; gap: 12px; padding: 20px; border-radius: var(--radius); text-align: left; }
.bento-ti span { display: flex; flex-direction: column; gap: 4px; }
.bento-ti b { font-size: 20px; letter-spacing: -.02em; }
.bento-ti small { font-size: 14px; font-weight: 500; opacity: .85; }
.bento-ti svg { width: 28px; height: 28px; flex: none; }
.bento-ti:active { transform: scale(.985); }
@media (min-width: 900px) {
  .bento { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; }
  .bento .wide, .bento-ti { grid-column: auto; }
}

.empty { text-align: center; padding: 56px 0; color: var(--muted); }
.empty h1 { color: var(--text); margin-bottom: 8px; }
/* пустой каталог: пока нет выгрузки, это первое, что видит посетитель */
.empty-card { max-width: 520px; margin: 8px auto; padding: 32px 24px 28px; text-align: center;
  background: var(--surface); border-radius: var(--radius);
  animation: rise .45s cubic-bezier(.23, 1, .32, 1) backwards .05s; }
.empty-ic { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--chip); color: var(--accent);
  box-sizing: content-box; }
.empty-card h2 { margin: 14px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.empty-card p { margin: 0 auto; max-width: 400px; color: var(--muted); }
.empty-card .cta { justify-content: center; margin-top: 20px; }
.empty-card .cta .btn { flex: 1 1 180px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .empty-card { animation: none; } }

/* страница устройства */
.crumb { margin: 0 0 12px; }
.crumb a { color: var(--muted); text-decoration: none; font-weight: 500; }
.device { display: grid; gap: 20px; grid-template-columns: 1fr; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; align-items: flex-start;
  border-radius: var(--radius); }
.gallery img { flex: 0 0 92%; width: 92%; min-width: 0; height: auto; aspect-ratio: 4 / 5; object-fit: contain;
  background: var(--surface); border-radius: var(--radius); scroll-snap-align: center; }
.gallery-wrap { position: relative; min-width: 0; }
/* номер фото на телефоне, где листают вбок */
.gal-n { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 3px 9px; border-radius: 999px;
  background: rgb(0 0 0 / .55); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  pointer-events: none; }
.info { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.info h1 { margin-bottom: 8px; font-size: 28px; }
.price.big { font-size: 32px; }
.price2.big { margin: 6px 0 18px; font-size: 13px; }
.price2.big b { font-size: 18px; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 20px; padding-top: 16px;
  border-top: 1px solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; }
.cta .btn { flex: 1 1 auto; }
@media (min-width: 820px) {
  .device { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: start; }
  .gallery { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; scroll-snap-type: none; }
  .gallery img { flex: none; width: 100%; }
  .gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 1 / 1; }
  .info { position: sticky; top: 80px; }
  .gal-n { display: none; }
}

/* подвал: адрес и связь */
.foot { display: grid; gap: 14px; padding: 12px 0 32px; }
.visit { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius); background: var(--dark); color: #fff; }
.visit small { font-size: 14px; color: #a6a6b0; }
.visit-addr { font-size: 20px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
@media (hover: hover) { .visit-addr:hover { text-decoration: underline; text-underline-offset: 4px; } }
.visit-cta { display: flex; gap: 8px; margin-top: 2px; }
.visit-cta .btn { flex: 1; min-height: 48px; }
@media (min-width: 720px) {
  .visit { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 24px; padding: 24px 28px; }
  .visit small { grid-column: 1; }
  .visit-addr { grid-column: 1; font-size: 24px; }
  .visit-cta { grid-column: 2; grid-row: 1 / span 2; }
  .visit-cta .btn { min-width: 150px; }
}
.legal { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* кнопки Trade-in в каталоге и карточке (компьютер) */
.ti-inline { padding: 0; min-height: 0; border-radius: 14px; background: none; color: inherit; font: inherit;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ti-inline .btn { gap: 8px; }
.ti-inline svg { width: 18px; height: 18px; flex: none; }
.ti-open .btn { min-height: 36px; padding: 6px 16px; border-radius: 18px; font-size: 14px; }
@media (hover: hover) { .ti-inline:hover .btn { filter: brightness(1.08); } }
.ti-inline.tap .btn { animation: fab-tap .45s cubic-bezier(.34, 1.56, .64, 1); }
.ti-inline.tap svg { animation: fab-spin .5s ease; }

/* плавающая кнопка Trade-in справа внизу (только телефон) */
.ti-fab { position: fixed; z-index: 40; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom));
  padding: 8px; min-height: 0; border-radius: 999px; background: transparent; color: var(--accent-text);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  animation: fab-in .5s cubic-bezier(.34, 1.56, .64, 1) backwards .4s; }
.ti-fab-in { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px 0 18px;
  border-radius: 999px; background: var(--accent); font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  box-shadow: 0 10px 24px rgb(10 91 216 / .35), 0 2px 6px rgb(0 0 0 / .15);
  transition: box-shadow .2s, transform .2s; }
.ti-fab svg { width: 20px; height: 20px; flex: none; }
.ti-fab.tap .ti-fab-in { animation: fab-tap .45s cubic-bezier(.34, 1.56, .64, 1); }
.ti-fab.tap svg { animation: fab-spin .5s ease; }
.ti-fab:focus-visible { outline: none; }
.ti-fab:focus-visible .ti-fab-in { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) {
  .ti-fab:hover .ti-fab-in { transform: translateY(-2px); box-shadow: 0 14px 30px rgb(10 91 216 / .42), 0 3px 8px rgb(0 0 0 / .15); }
}
@media (min-width: 641px) { .ti-fab { display: none; } }
@media (max-width: 640px) {
  .ti-inline { display: none; }
  .foot { padding-bottom: 96px; }
}
@keyframes fab-in { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes fab-tap { 0% { transform: none; } 30% { transform: scale(.88); } 100% { transform: none; } }
@keyframes fab-spin { to { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .ti-fab, .ti-fab-in, .ti-fab svg, .ti-inline .btn, .ti-inline svg { animation: none !important; transition: none; } }

/* всплывающее преимущество: на компьютере справа внизу, на телефоне сверху */
.perk { position: fixed; right: 24px; bottom: 24px; z-index: 50; width: min(380px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .18), 0 4px 12px rgb(0 0 0 / .08);
  opacity: 0; transform: translateY(24px); transition: opacity .2s ease-in, transform .2s ease-in; }
/* появляется плавно, уходит быстрее */
.perk.show { opacity: 1; transform: none;
  transition: opacity .3s ease-out, transform .45s cubic-bezier(.23, 1, .32, 1); }
.perk-item { display: flex; align-items: center; gap: 12px; padding: 16px 40px 16px 18px; min-height: 104px; }
.perk-txt { display: grid; gap: 4px; flex: 1; min-width: 0; }
.perk-txt b { font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.perk-txt span { font-size: 14px; line-height: 1.4; color: var(--muted); }
.perk-art { flex: none; width: 96px; height: 72px; position: relative; display: grid; place-items: center; }
.perk-ic { width: 64px; height: 64px; filter: drop-shadow(0 4px 8px rgb(0 0 0 / .15)); }
.perk-art .app { position: absolute; width: 38px; height: 38px; filter: drop-shadow(0 3px 6px rgb(0 0 0 / .18)); }
.perk-art .a1 { left: 2px;  top: 2px;  transform: rotate(-14deg); }
.perk-art .a2 { left: 50px; top: -2px; transform: rotate(11deg); }
.perk-art .a3 { left: 14px; top: 38px; transform: rotate(9deg); }
.perk-art .a4 { left: 56px; top: 34px; transform: rotate(-9deg); }
.perk-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; min-height: 0; padding: 0;
  border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; font-weight: 400; line-height: 1; }
.perk-x:hover { background: var(--chip); color: var(--text); }
@media (max-width: 640px) {
  .perk { top: 10px; bottom: auto; left: 10px; right: 10px; width: auto; transform: translateY(-24px); }
  .perk.show { transform: none; }
  .perk-item { min-height: 88px; padding: 12px 38px 12px 14px; }
  .perk-txt b { font-size: 15px; }
  .perk-txt span { font-size: 13px; }
  .perk-art { width: 84px; height: 64px; transform: scale(.9); }
}
@media (prefers-reduced-motion: reduce) { .perk, .perk.show { transition: none; } }
@media (prefers-reduced-motion: reduce) { .card, .btn, .ct, .chip { transition: none; } .card:active { transform: none; } }

/* окно Trade-in: на компьютере по центру, на телефоне выезжает снизу */
.ti { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0;
  border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgb(0 0 0 / .3); }
.ti::backdrop { background: rgb(17 17 19 / .45); }
.ti-form { display: grid; gap: 16px; padding: 22px 20px 20px; }
.ti-grab { display: none; }
.ti-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ti h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.ti .muted { font-size: 14px; }
.ti-x { flex: none; width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: var(--chip); color: var(--text); }
.ti-x svg { width: 18px; height: 18px; }
.ti-field, .ti-seg { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ti-field > span, .ti-seg legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ti-field > span { margin-bottom: 0; }
.ti-field select { font: inherit; font-size: 17px; font-weight: 700; color: var(--text); background: var(--chip); border: 0;
  border-radius: 16px; height: 52px; padding: 0 14px; width: 100%; }
.ti-field select:disabled { opacity: .55; }
/* переключатели-сегменты */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--chip); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label span { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 6px; border-radius: 12px;
  font-size: 15px; font-weight: 700; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.seg input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgb(17 17 19 / .12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-hint { display: flex; align-items: center; justify-content: center; height: 44px; font-size: 14px; color: var(--muted); }
@media (prefers-color-scheme: dark) { .seg input:checked + span { background: #3a3a41; } }
.ti-result { padding: 16px 18px; border-radius: 20px; background: var(--chip); font-size: 14px; line-height: 1.4; color: var(--muted); }
.ti-result.ok { display: grid; gap: 4px; background: var(--accent); color: #fff; }
.ti-result.ok small { font-size: 14px; opacity: .85; }
.ti-result.ok b { font-size: 36px; line-height: 1.05; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ti-result.ok span { font-size: 13px; opacity: .85; }
.ti-result.warn { background: rgb(245 158 11 / .14); color: var(--text); }
.ti-result.pop b { animation: ti-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes ti-pop { from { opacity: 0; transform: scale(.85); } }
.ti-cta { display: flex; gap: 8px; }
.ti-cta .btn { flex: 1; min-height: 52px; border-radius: 16px; }
.ti-cta .btn.dark { flex: 1.4; }
@media (max-width: 640px) {
  .ti { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: calc(100dvh - 24px); }
  .ti-form { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); gap: 14px; }
  .ti-grab { display: block; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
}

/* появление и исчезновение окна */
.ti[open] { animation: ti-in .32s cubic-bezier(.2, .9, .3, 1.15); }
.ti[open]::backdrop { animation: ti-fade .3s ease; }
.ti.closing { animation: ti-out .2s ease forwards; }
.ti.closing::backdrop { animation: ti-fade .2s ease reverse forwards; }
@keyframes ti-in { from { opacity: 0; transform: translateY(28px) scale(.94); } }
@keyframes ti-out { to { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes ti-fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .ti[open] { animation: ti-up .38s cubic-bezier(.23, 1, .32, 1); }
  .ti.closing { animation: ti-down .22s ease-in forwards; }
}
@keyframes ti-up { from { transform: translateY(100%); } }
@keyframes ti-down { to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .ti[open], .ti.closing, .ti[open]::backdrop, .ti.closing::backdrop { animation: none; } }
