/* Рацион и корзина: экраны передачи корзины в приложение сети (transfer.js). Только токены из tokens.css. */
.tr { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--f-text); opacity: 0; transform: translateY(14px); transition: opacity .22s ease, transform .22s ease; padding-top: 54px; }
.tr.fixed { position: fixed; }
.tr.on { opacity: 1; transform: none; }
:where(.tr) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.tr:focus { outline: none; }
:where(.tr) svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* верхняя полоса */
.tr-top { flex: none; display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; height: 52px; }
.tr-x { width: 44px; height: 44px; margin-left: 8px; border-radius: 50%; display: grid; place-items: center; }
.tr-x:active { background: var(--sand); }
.tr-x svg { width: 22px; height: 22px; }
.tr-ttl { text-align: center; line-height: 1.15; min-width: 0; }
.tr-ttl small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2-bg); }
.tr-ttl b { display: block; font-size: 15.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* тело */
.tr-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; padding: 0 20px 20px; }
.tr-body::-webkit-scrollbar { display: none; }
.tr-foot { flex: none; padding: 10px 20px 34px; background: var(--bg); border-top: 1px solid var(--line); }

/* кнопки */
.tr-main { width: 100%; min-height: 62px; padding: 10px 18px; border-radius: 20px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.2; box-shadow: 0 14px 22px -14px rgba(47, 107, 71, .95); transition: transform .12s; }
.tr-main:active { transform: scale(.985); }
.tr-main svg { width: 22px; height: 22px; }
.tr-sec { width: 100%; height: 52px; border-radius: 16px; background: var(--sand); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; font-size: 15px; transition: transform .12s; }
.tr-sec:active { transform: scale(.985); }
.tr-sec svg { width: 19px; height: 19px; }
.tr button:disabled { opacity: .65; cursor: default; }
.tr button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* режим link */
.tr-hero { text-align: center; padding: 22px 6px 20px; }
.tr-cm { display: block; margin: 0 auto 14px; width: 60px; height: 60px; border-radius: 50%; background: #fff; border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.tr-cm img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-hero h2 { font: 700 22px/1.2 var(--f-head); letter-spacing: -.02em; }
.tr-hero p { margin-top: 8px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-2-bg); }
.tr-steps { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.tr-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.tr-steps i { width: 30px; height: 30px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; font: 700 13px/1 var(--f-head); font-style: normal; }
.tr-steps span { padding-top: 4px; }
.tr-err { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--sale); text-align: center; }
.tr-alt { margin-top: 12px; }
.tr-spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: tr-rot .8s linear infinite; }
@keyframes tr-rot { to { transform: rotate(360deg); } }

/* режим checklist */
.tr-prog { position: sticky; top: 0; z-index: 2; margin: 0 -20px; padding: 6px 20px 12px; background: var(--bg); }
.tr-pn { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tr-pn b { font: 700 26px/1.1 var(--f-head); letter-spacing: -.02em; }
.tr-pn b em { font-style: normal; font-size: 15px; font-weight: 600; color: var(--ink-2-bg); letter-spacing: 0; }
.tr-pn span { font-size: 13px; font-weight: 700; color: var(--ink-2-bg); text-align: right; }
.tr-bar { position: relative; height: 8px; margin-top: 10px; border-radius: 4px; background: var(--sand); overflow: hidden; }
.tr-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: var(--accent); transition: width .35s ease; }
.tr-fin { margin: 4px 0 12px; padding: 14px 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); text-align: center; }
.tr-fin b { display: block; font: 700 16px/1.25 var(--f-head); }
.tr-fin span { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tr-h { margin: 14px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2-bg); }
.tr-list { display: grid; gap: 10px; }

.tr-card { display: grid; grid-template-columns: 68px 1fr; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); max-height: 220px; overflow: hidden; transition: max-height .3s ease, opacity .25s ease, transform .3s ease, padding .3s ease, margin .3s ease; }
.tr-card.out { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -10px; opacity: 0; transform: translateY(26px) scale(.97); }
.tr-ph { width: 68px; height: 68px; border-radius: 16px; background: var(--tint-straw); overflow: hidden; display: grid; place-items: center; color: var(--ink-2); }
.tr-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-ph svg { width: 26px; height: 26px; }
.tr-ph.t1 { background: var(--tint-butter); } .tr-ph.t2 { background: var(--tint-clay); } .tr-ph.t3 { background: var(--tint-sage); }
.tr-ph.t4 { background: var(--tint-sky); } .tr-ph.t5 { background: var(--tint-rose); }
.tr-inf { min-width: 0; }
.tr-nm { font-size: 14.5px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-qp { margin-top: 5px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tr-qp b { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.tr-act { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.tr-act.one { grid-template-columns: 1fr; }
.tr-open, .tr-put { height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 800; white-space: nowrap; transition: transform .12s; }
.tr-open:active, .tr-put:active { transform: scale(.98); }
.tr-open { background: var(--sand); color: var(--ink); padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.tr-open svg { width: 17px; height: 17px; }
.tr-put { background: var(--accent); color: var(--on-accent); padding: 0 18px; }
.tr-put svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* положено */
.tr-done { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 8px 8px 8px 8px; border-radius: 16px; background: rgba(255, 252, 246, .6); box-shadow: 0 0 0 1px var(--line); animation: tr-in .3s ease; }
@keyframes tr-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.tr-done .tr-ph { width: 38px; height: 38px; border-radius: 11px; position: relative; }
.tr-done .tr-ph img { opacity: .55; }
.tr-done .tr-nm { font-size: 13.5px; font-weight: 700; -webkit-line-clamp: 1; color: var(--ink-2-bg); text-decoration: line-through; text-decoration-thickness: 1px; }
.tr-back { height: 34px; padding: 0 12px; border-radius: 12px; background: var(--sand); font-size: 12.5px; font-weight: 800; color: var(--ink); }
.tr-tick { position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.tr-tick svg { width: 10px; height: 10px; stroke-width: 3; }
.tr-empty { padding: 28px 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-2-bg); }

/* тост */
.tr-toast { position: absolute; z-index: 5; left: 20px; right: 20px; bottom: 110px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.3; text-align: center; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; }
.tr-toast.on { opacity: 1; transform: none; }

/* телефон: без рамки устройства, шапка Telegram снаружи */
@media (max-width: 520px), (max-height: 700px) and (max-width: 900px) {
  .tr { padding-top: max(10px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px)); }
  .tr-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .tr-toast { bottom: 96px; }
}
@media (max-width: 380px) {
  .tr-main { font-size: 16px; }
  .tr-card { grid-template-columns: 60px 1fr; padding: 10px; }
  .tr-ph { width: 60px; height: 60px; }
  .tr-open, .tr-put { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .tr, .tr-bar i, .tr-card, .tr-toast { transition: none; }
  .tr-done { animation: none; } .tr-spin { animation-duration: 2s; }
}

/* ===== визуал, итерация 1: список в магазине крупно и компактно =====
   Карточка: фото | название, количество и цена, ссылка «Открыть» | круглая отметка «Положил» справа под большой палец.
   Зелень одна: полоса прогресса и отметки; кнопка-ссылка тихая. */
.tr-card { grid-template-columns: 60px minmax(0, 1fr) 52px; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 10px 10px 10px; }
.tr-card > .tr-ph { grid-row: 1 / span 2; width: 60px; height: 60px; border-radius: 14px; align-self: center; }
.tr-card .tr-inf { grid-column: 2; grid-row: 1; align-self: end; }
.tr-card .tr-nm { font-size: 15.5px; line-height: 1.22; }
.tr-card .tr-qp { margin-top: 3px; justify-content: flex-start; gap: 10px; }
.tr-card .tr-qp b { font: 700 15px/1 var(--f-head); letter-spacing: -.02em; }
.tr-act, .tr-act.one { display: contents; }
.tr-open { grid-column: 2; grid-row: 2; justify-self: start; align-self: start; height: 30px; margin: 0 0 -4px -6px; padding: 0 6px; border-radius: 9px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 700; gap: 5px; }
.tr-open svg { width: 14px; height: 14px; }
.tr-open:active { background: var(--sand); transform: none; }
.tr-put { grid-column: 3; grid-row: 1 / span 2; justify-self: end; width: 52px; height: 52px; padding: 0; border-radius: 50%; background: var(--card); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); font-size: 0; gap: 0; transition: transform .14s ease, background-color .14s ease, color .14s ease; }
.tr-put svg { width: 24px; height: 24px; stroke-width: 2.6; }
.tr-put:active { transform: scale(.9); background: var(--accent); color: var(--on-accent); }
.tr-card.out .tr-put { background: var(--accent); color: var(--on-accent); }
.tr-list { gap: 8px; }
.tr-done { padding: 7px 8px; }
.tr-done .tr-nm { font-size: 14px; }
@media (max-width: 380px) {
  .tr-card { grid-template-columns: 54px minmax(0, 1fr) 48px; padding: 9px; }
  .tr-card > .tr-ph { width: 54px; height: 54px; }
  .tr-put { width: 48px; height: 48px; }
  .tr-open, .tr-put { font-size: 0; } .tr-open { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .tr-put { transition: none; } }

/* ===== визуал, итерация 7: «Корзина готова» - отметка успеха на логотипе, шаги одной карточкой ===== */
.tr-hero { position: relative; }
.tr-hero:has(+ .tr-main[data-open])::after { content: ""; position: absolute; top: 62px; left: calc(50% + 14px); width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--bg);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat; }
@media (prefers-reduced-motion: no-preference) {
  .tr.on .tr-hero:has(+ .tr-main[data-open])::after { animation: tr-ok .5s cubic-bezier(.3, 1.6, .5, 1) .2s both; }
  .tr.on .tr-main[data-open] { animation: tr-up .4s cubic-bezier(.2, .8, .2, 1) .12s both; }
}
@keyframes tr-ok { from { transform: scale(0); } to { transform: none; } }
@keyframes tr-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tr-steps { gap: 0; padding: 4px 0; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.tr-steps li { background: none; box-shadow: none; border-radius: 0; padding: 12px 16px; }
.tr-steps li + li { border-top: 1px dashed var(--line); }
