/* Финальный слой: графики, эмодзи-спрайт, нижняя панель, выбор чата, настройки, ИИ-разбор. Грузится последним. */

/* ---------- эмодзи: статичный кадр из спрайта сразу, анимация — поверх, когда загрузится ---------- */
.tge--sprite { background-repeat: no-repeat; }
.tge.tge--live { background-image: none; }

/* ---------- графики ---------- */
/* график внутри карточки — без второй рамки и без своего фона (раньше ios.css рисовал рамку в рамке без отступов) */
.card > .chart.chart, .card > .chart--tap.chart--tap {
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.bars { padding-top: 6px; }
/* подписи оси — та же сетка, что у столбиков: каждая подпись ровно под своим столбиком */
.axis--grid { display: flex; gap: 4px; justify-content: stretch; }
.axis--grid span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; overflow: visible; }
.chart:has(.bars--hours) .axis--grid, .chart:has(.bars--dense) .axis--grid { gap: 2px; }
.chart:has(.bars--short) .axis--grid { gap: 12px; }
.axis--grid span:first-child { justify-content: flex-start; }
.chart:has(.bars--hours) .axis--grid span:first-child { justify-content: center; }
.axis { font-size: 11px; letter-spacing: 0; }

/* ---------- нижняя панель: капсула со скользящей подсветкой ---------- */
.tabbar { position: fixed; padding: 6px; gap: 0; isolation: isolate; overflow: hidden; }
.tabbar__ind {
  position: absolute; z-index: -1; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / var(--n, 6));
  transform: translateX(calc(var(--i, 0) * 100%));
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .04);
  transition: transform .5s cubic-bezier(.3, 1.35, .55, 1);
}
.tab { position: relative; background: none !important; box-shadow: none !important; color: rgba(235, 235, 245, .55);
  padding: 7px 2px 6px; gap: 3px; transition: color .25s var(--ease), transform .18s var(--ease); -webkit-tap-highlight-color: transparent; }
.tab:active { transform: scale(.92); }
.tab .tge { width: 26px; height: 26px; opacity: .55; filter: grayscale(.6); transition: opacity .25s var(--ease), filter .25s var(--ease), transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.tab.on { color: #fff; }
.tab.on .tge { opacity: 1; filter: none; transform: translateY(-1px) scale(1.12); }
.tab.on span { font-weight: 700; }
.tab.pop .tge { animation: tabpop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tabpop { 0% { transform: scale(.7); } 60% { transform: translateY(-2px) scale(1.2); } 100% { transform: translateY(-1px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .tabbar__ind, .tab .tge { transition: none; } .tab.pop .tge { animation: none; } }
html.no-anim *, html.no-anim *::before, html.no-anim *::after { animation-duration: 0s !important; transition-duration: 0s !important; }

/* ---------- верхняя панель: выбор чата и настройки ---------- */
.topnav__row { gap: 8px; }
.topnav__row .brand, .brand__mark { flex: none; }
.chatpick {
  flex: 0 1 auto; margin-right: auto;
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 190px; height: 32px; padding: 0 10px 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 13px; font-weight: 600;
}
.chatpick b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chatpick span { display: flex; flex: none; }
.chatpick svg { flex: none; width: 12px; height: 12px; opacity: .6; }
.iconbtn { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -2px -6px -2px 0; border-radius: 999px; color: var(--muted); }
.iconbtn:active { background: rgba(255, 255, 255, .1); }
.iconbtn svg { width: 20px; height: 20px; }

.chatlist { display: flex; flex-direction: column; max-height: 56vh; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; }
.chatrow { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; border-radius: 12px; text-align: left; }
.chatrow:active { background: rgba(255, 255, 255, .06); }
.chatrow.on { background: rgba(10, 132, 255, .16); }
.chatrow .ava { width: 36px; height: 36px; flex: none; }
.chatrow__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chatrow__t b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatrow__t span { font-size: 13px; color: var(--muted); }
.chatrow__all { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 999px; background: rgba(10, 132, 255, .22); color: var(--accent); font-weight: 700; }

/* настройки отображения */
.settings { display: flex; flex-direction: column; gap: 4px; }
.settings h3 { margin: 4px 0 8px; font-size: 20px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px 0; border-bottom: .5px solid var(--sep, rgba(255, 255, 255, .08)); }
.setrow:last-child { border-bottom: 0; }
.setrow > div { display: flex; flex-direction: column; min-width: 0; }
.setrow b { font-weight: 500; font-size: 16px; }
.setrow small { color: var(--muted); font-size: 13px; }
.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px; background: rgba(120, 120, 128, .36); transition: background-color .25s var(--ease); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s cubic-bezier(.3, 1.3, .5, 1); }
.switch.on { background: #30d158; }
.switch.on::after { transform: translateX(20px); }
.segmini { display: flex; flex: none; padding: 2px; border-radius: 9px; background: rgba(118, 118, 128, .24); }
.segmini button { padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmini button.on { background: rgba(255, 255, 255, .18); color: #fff; }

/* компактный вид */
html.compact .view { gap: 22px; }
html.compact .hero__num { font-size: 52px; }
html.compact .bubbles { gap: 6px; }

/* ---------- ИИ-разбор ---------- */
.ai { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.ai__head { display: flex; align-items: center; gap: 10px; }
.ai__badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(10, 132, 255, .2); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.ai__title { font-size: 22px; font-weight: 800; line-height: 1.15; }
.ai__text { font-size: 16px; line-height: 1.45; color: rgba(235, 235, 245, .86); }
.ai__list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ai__list li { display: flex; gap: 10px; font-size: 15px; line-height: 1.4; }
.ai__list li b { flex: none; min-width: 64px; color: var(--accent); font-variant-numeric: tabular-nums; }
.ai__quote { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 14px; color: var(--muted); }
.ai__foot { font-size: 12px; color: var(--faint); }
.ai__wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.ai__dots i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: currentColor; animation: aidot 1s infinite ease-in-out; }
.ai__dots i:nth-child(2) { animation-delay: .15s; }
.ai__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aidot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* стиль смеха */
.laughs { display: flex; flex-direction: column; gap: 10px; }
.laughs__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.laughs__row span { font-size: 15px; }
.laughs__row em { font-style: normal; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.laughs__bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(120, 120, 128, .2); overflow: hidden; }
.laughs__bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: barin .7s var(--ease) both; }
@keyframes barin { from { transform: scaleX(0); } }
.laughs__sample { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 400px) { .topnav__row:has(.chatpick) .tag { display: none; } .topnav__row:has(.chatpick) .get-pro__full { display: none; } .topnav__row:has(.chatpick) .get-pro__short { display: inline; } }

/* ---------- главный экран: компактно и по делу ---------- */
.home { gap: 14px; }
.hero-home { padding-top: 8px; }
.hero-home h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.hero-home p { margin-top: 6px; font-size: 15px; line-height: 1.4; }
.home__actions { display: flex; flex-direction: column; gap: 10px; }
.home .note { font-size: 12px; color: var(--faint); text-align: center; justify-content: center; }

/* загрузка файла из чата: настоящий прогресс вместо бегущей полоски */
.bar--pct i { animation: none; width: var(--pct, 0%); transform: none; transition: width .3s var(--ease); }

/* «Как выгрузить»: строгий список, как в Настройках iOS — без кружков и плюсов */
.howto summary { font-weight: 600; font-size: 15px; }
.howto summary::after { content: ''; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg) translateY(-3px); transition: transform .25s var(--ease); font-size: 0; }
.howto[open] summary::after { content: ''; transform: rotate(-135deg) translateY(-2px); }
.howto .seg { margin-top: 2px; }
.howto .seg button { min-height: 32px; padding: 5px; font-size: 13px; }
.howto[open] > .steps { margin-top: 10px; gap: 0; }
.howto .step { padding: 10px 0; gap: 12px; font-size: 14px; border-top: .5px solid var(--sep, rgba(255, 255, 255, .08)); }
.howto .step:first-child { border-top: 0; }
.howto .step::before { width: 14px; height: auto; border-radius: 0; background: none; color: var(--faint); font-weight: 600; font-size: 14px; line-height: 1.45; place-items: start; font-family: var(--sans); font-variant-numeric: tabular-nums; }

/* ---------- главный экран v2: одна главная кнопка, файл из чата — ячейка списка ---------- */
.home { gap: 18px; padding-top: calc(var(--top) + 16px); }
.home > .brand { font-size: 15px; font-weight: 600; opacity: .9; }
.hero-home { padding-top: 6px; }
.hero-home h1 { font-size: 28px; line-height: 1.1; }
.hero-home p { color: var(--muted); }
.home__actions { gap: 4px; }
.home__actions .btn--main { min-height: 50px; font-size: 16px; font-weight: 600; border-radius: 14px; }
.linkbtn { display: flex; justify-content: center; align-items: center; min-height: 40px; font-size: 14px; color: var(--accent); cursor: pointer; }
.linkbtn:active { opacity: .6; }
.filecell { display: flex; align-items: stretch; border-radius: 16px; background: var(--glass-bg); border: .5px solid var(--glass-edge);
  box-shadow: var(--glass-hi); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); overflow: hidden; }
.filecell__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; text-align: left; }
.filecell__main:active, .filecell__del:active { background: rgba(255, 255, 255, .06); }
.filecell__ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(10, 132, 255, .18); }
.filecell__ico .tge { width: 20px; height: 20px; }
.filecell__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.filecell__t b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecell__t small { font-size: 13px; color: var(--muted); }
.filecell__go { flex: none; font-size: 15px; font-weight: 600; color: var(--accent); }
.filecell__del { flex: none; width: 48px; display: grid; place-items: center; border-left: .5px solid var(--sep, rgba(255, 255, 255, .08)); }
.filecell__del .tge { width: 20px; height: 20px; opacity: .55; }
.home .note { margin-top: auto; }

/* карточка для сторис: заглушка пока рисуется */
.preview { position: relative; }
.preview.is-loading img { visibility: hidden; }
.preview__wait { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; }
.preview.is-loading .preview__wait { display: flex; }

.chev { flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; color: rgba(235, 235, 245, .3); }
.chev svg { width: 7px; height: 12px; }
.ach-prev__head .chev { align-self: center; }

/* ---------- глубокие метрики ---------- */
.how { margin-top: 10px; font-size: 12px; line-height: 1.4; color: var(--faint); }
.sec > .how { margin-top: 8px; padding: 0 4px; }
.big-verdict { font-size: 19px; font-weight: 700; line-height: 1.25; margin-bottom: 12px; }
.split { display: flex; flex-direction: column; gap: 6px; }
.split__bar { height: 10px; border-radius: 999px; background: rgba(120, 120, 128, .3); overflow: hidden; }
.split__bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; animation: barin .7s var(--ease) both; }
.split__names { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.split__names span:last-child { text-align: right; }
.parts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.parts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: .5px solid var(--sep, rgba(255, 255, 255, .08)); font-size: 15px; }
.parts li b { font-weight: 600; color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.cmp { display: flex; flex-direction: column; }
.cmp__row { display: grid; grid-template-columns: 1fr auto 22px auto; align-items: center; gap: 8px; padding: 9px 0; border-top: .5px solid var(--sep, rgba(255, 255, 255, .08)); font-size: 15px; font-variant-numeric: tabular-nums; }
.cmp__row:first-child { border-top: 0; padding-top: 0; }
.cmp__name { color: var(--muted); min-width: 0; }
.cmp__a { color: var(--faint); text-align: right; }
.cmp__b { font-weight: 600; text-align: right; min-width: 52px; }
.cmp__arrow { text-align: center; color: var(--faint); font-weight: 700; }
.cmp__arrow.good { color: #30d158; }
.cmp__arrow.bad { color: #ff9f0a; }

/* логотип */
.brand__mark { background: none !important; padding: 0; overflow: hidden; }
.brand__mark svg, .boot__mark svg { display: block; width: 100%; height: 100%; }
