/* GrainFlow 2, заход 2: карусель результатов, жесты, главная цифра, «Сравнить», избранные маршруты */

/* ---------- Результаты расчёта каруселью ---------- */
.rc-bar { display: flex; align-items: center; gap: 10px; margin: 2px 2px 8px; }
.rc-pos { color: var(--muted); font-size: var(--fs-s); font-weight: 700; }
.rc-dots { display: flex; gap: 5px; flex: 1; justify-content: center; }
.rc-dots i { width: 6px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 20%, transparent); transition: width .3s var(--spring, ease), background .2s ease; }
.rc-dots i.is-on { width: 18px; background: var(--accent); }
.rc-mode { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: 700; }
.rc-carousel { display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - 28px); gap: 10px; align-items: start;
  margin: 0 calc(-1 * var(--page-x, 16px)) 12px; padding: 4px var(--page-x, 16px) 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--page-x, 16px); scrollbar-width: none; }
.rc-carousel::-webkit-scrollbar { display: none; }
.rc-carousel > .result-card { scroll-snap-align: start; margin: 0 !important; min-width: 0; }
@media (min-width: 760px) { .rc-carousel { grid-auto-columns: calc(50% - 6px); } }

/* ---------- Жесты в списках ---------- */
.list-tray > .entity { touch-action: pan-y; z-index: 1; background-clip: padding-box; }
.list-tray > .entity.is-swiping { transition: none !important; }
.list-tray > .entity:not(.is-swiping) { transition: transform .45s var(--spring, ease), background .15s ease; }
.swipe-bg { position: absolute; left: 0; right: 0; z-index: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #fff; font-weight: 800; font-size: var(--fs-s); background: #8e8e93; }
.swipe-bg span { display: inline-flex; align-items: center; gap: 6px; opacity: .55; transition: opacity .15s ease, transform .2s var(--spring, ease); }
.swipe-bg .icon { width: 18px; height: 18px; }
.swipe-bg[data-side="call"] { background: #34c759; }
.swipe-bg[data-side="price"] { background: #0a7cff; }
.swipe-bg[data-side="call"] .swipe-price, .swipe-bg[data-side="price"] .swipe-call { visibility: hidden; }
.swipe-bg.is-armed span { opacity: 1; transform: scale(1.06); }

/* ---------- Карточка: главная цифра сверху ---------- */
.gf-hero { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--edit-line, var(--line)); border-radius: 18px; background: var(--edit-card, var(--surface)); box-shadow: var(--shadow-1); }
.gf-hero-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gf-hero-price b { font-size: 2.6rem; line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.gf-hero-price span { color: var(--muted); font-weight: 700; }
.gf-hero-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gf-hero-main > span { display: grid; gap: 2px; }
.gf-hero-main b { font-size: 1.6rem; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.gf-hero-main small { color: var(--muted); font-size: var(--fs-xs); }
.gf-hero-sub { margin: 0; color: var(--muted); font-size: var(--fs-s); }
.gf-hero-sub.is-stale { color: var(--negative); font-weight: 600; }
.gf-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gf-hero-chips span { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: 700; }
.gf-compare-btn { justify-self: start; padding: 7px 12px; border: 1px solid var(--accent); border-radius: 999px; background: none; color: var(--accent); font: inherit; font-size: var(--fs-s); font-weight: 700; }
.gf-compare-btn.is-on { background: var(--accent); color: #fff; }

/* ---------- «Сравнить» ---------- */
.gf-compare-pill { position: fixed; z-index: 45; left: 50%; bottom: calc(var(--tabbar-h, 64px) + var(--safe-b, 0px) + 14px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 999px; background: var(--text); color: var(--surface); font: inherit; font-weight: 800; font-size: var(--fs-s); box-shadow: 0 10px 28px rgba(0, 0, 0, .28); }
.gf-compare-pill[hidden] { display: none; }
.gf-compare-pill .icon { width: 16px; height: 16px; }
body.modal-open .gf-compare-pill { display: none; }
.gf-compare { display: grid; gap: 12px; }
.gf-cmp-scroll { overflow-x: auto; margin: 0 -2px; border: 1px solid var(--edit-line, var(--line)); border-radius: 16px; background: var(--edit-card, var(--surface)); }
.gf-cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.gf-cmp th, .gf-cmp td { padding: 10px 10px; border-bottom: 1px solid var(--edit-line, var(--line)); text-align: left; vertical-align: top; }
.gf-cmp tbody tr:last-child th, .gf-cmp tbody tr:last-child td { border-bottom: 0; }
.gf-cmp tbody th { color: var(--muted); font-weight: 650; white-space: nowrap; }
.gf-cmp thead th { position: sticky; top: 0; background: var(--edit-card, var(--surface)); }
.gf-cmp-name { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; text-align: left; }
.gf-cmp .is-best { color: var(--positive); }
.gf-cmp-note { margin: 0; font-size: var(--fs-xs); }

/* ---------- Мои маршруты ---------- */
.t-route-chips { display: grid; gap: 8px; }
.t-route { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; transition: transform .3s var(--spring, ease); }
.t-route b { font-size: var(--fs-s); font-weight: 750; }
.t-route small { color: var(--muted); font-size: var(--fs-xs); }
.t-route:active { transform: scale(.98); transition-duration: .06s; }
.gf-star { color: var(--muted); }
.gf-star.is-on { color: #ffb800; }
.gf-star.is-on .icon { fill: currentColor; }
