/* Buyer cabinet + login presentation.
   The Worker serves every page with `style-src 'self'`, so inline style attributes
   are blocked by CSP. Everything the cabinet renders must come from classes here. */

/* 100vh на мобиле считается по свёрнутой панели браузера и даёт лишнюю прокрутку;
   строка выше остаётся запасной для движков без dvh. */
.cabinet-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* --- header --- */
.cabinet-nav { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(11, 10, 8, .86); }
/* Шапка прижата к краям экрана, поэтому вырез отодвигаем сами. */
.cabinet-nav { flex-wrap: wrap; row-gap: 10px; padding-inline: max(32px, env(safe-area-inset-left, 0px)) max(32px, env(safe-area-inset-right, 0px)); }
.cabinet-nav-right { flex-wrap: wrap; justify-content: flex-end; }
/* Кнопка уехала из шапки на профиль и стала там основным действием — 44px под палец. */
.cabinet-nav-email-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; border: 1px solid rgba(244, 239, 231, .14); border-radius: 99px; background: transparent; padding: 5px 12px; color: rgba(244, 239, 231, .55); font: 12px 'JetBrains Mono', ui-monospace, monospace; cursor: pointer; transition: border-color .15s, color .15s; }
.cabinet-nav-email-btn:hover { border-color: rgba(244, 239, 231, .32); color: #f4efe7; }
.cabinet-nav-form { display: inline; margin: 0; }

/* --- вкладки ---
   Шапка несёт весь роутинг: почта и «Выйти» уехали в профиль. Вкладка — тап, а не
   текст, поэтому 44px по высоте даже там, где подпись в одно слово. */
.cabinet-tabs { display: flex; align-items: center; gap: 6px; }
.cabinet-tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 99px;
  color: rgba(244, 239, 231, .62); font: 600 14px/1.2 'Golos Text', sans-serif;
  text-decoration: none; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.cabinet-tab:hover { color: #f4efe7; }
.cabinet-tab[aria-current="page"] { border-color: rgba(46, 91, 255, .5); background: rgba(46, 91, 255, .14); color: #dfe5ff; }

.cabinet-breadcrumbs { min-width: 0; }
.cabinet-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; color: rgba(244, 239, 231, .55); font: 12px/1.5 'JetBrains Mono', ui-monospace, monospace; }
.cabinet-breadcrumbs li { display: flex; min-width: 0; max-width: 100%; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.cabinet-breadcrumbs li:not(:last-child)::after { content: '/'; color: rgba(244, 239, 231, .3); }
.cabinet-breadcrumbs a { color: inherit; text-decoration: none; }
.cabinet-breadcrumbs a:hover { color: #f4efe7; }
.cabinet-breadcrumbs [aria-current="page"] { color: rgba(244, 239, 231, .82); }

/* --- «Сейчас» ---
   Блок живёт секцией внутри .cabinet-shell, поэтому гасим отступ, который секции
   достаётся от лендинга; поля даёт .cabinet-card-body. Рамку не трогаем: у
   .cabinet-card она своя, и border-top: 0 срезал бы ей верхнюю грань. */
.cabinet-now { padding: 0; }
.cabinet-now .dv-title { font-size: clamp(22px, 4.6vw, 30px); line-height: 1.15; }
.cabinet-now-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.cabinet-now-action .button { width: auto; padding-inline: 32px; }

/* --- список продуктов ---
   Кликабельна вся строка, а не название: на телефоне попасть в ссылку-слово нечем. */
.product-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.product-link {
  display: flex; align-items: center; gap: 6px 16px; min-height: 56px; padding: 12px 18px;
  border: 1px solid rgba(244, 239, 231, .14); border-radius: 12px;
  background: rgba(244, 239, 231, .02); color: #f4efe7; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.product-link:hover { border-color: rgba(46, 91, 255, .5); background: rgba(46, 91, 255, .07); }
.product-link-title { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; }
.product-link-state { flex: 0 1 auto; min-width: 0; text-align: right; font: 12px/1.4 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .62); }
.product-link::after { content: ""; flex: none; width: 7px; height: 7px; border-top: 1.5px solid rgba(244, 239, 231, .45); border-right: 1.5px solid rgba(244, 239, 231, .45); transform: rotate(45deg); }
.product-preview { display: flex; flex-direction: column; align-items: flex-start; min-height: 178px; gap: 9px; padding: 18px; }
.product-preview .product-link-title { flex: 0; font-size: 18px; line-height: 1.2; }
.product-preview::after { position: absolute; top: 22px; right: 20px; }
.product-preview:not(a)::after { display: none; }
.product-preview { position: relative; }
.product-preview-kicker, .product-preview-meta { color: rgba(244, 239, 231, .62); font: 11px/1.45 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .05em; }
.product-preview-meta { margin-top: auto; letter-spacing: 0; }
.product-preview .product-link-state { margin-top: auto; text-align: left; }
.product-preview-action { width: 100%; margin-top: auto; }
.product-link-simple { grid-column: 1 / -1; }
.product-preview-screen, .product-preview-terminal { display: flex; box-sizing: border-box; width: 100%; height: 58px; overflow: hidden; border: 1px solid rgba(126, 151, 255, .36); border-radius: 7px; }
.product-preview-screen { position: relative; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 44%, rgba(79, 115, 255, .52), rgba(28, 35, 72, .48) 42%, rgba(12, 12, 18, .9)); }
.product-preview-play { color: #e7ebff; font: 18px/1 system-ui, sans-serif; font-style: normal; text-shadow: 0 0 18px rgba(139, 160, 255, .8); }
.product-preview-duration { position: absolute; right: 7px; bottom: 6px; color: rgba(244, 239, 231, .84); font: 10px/1 'JetBrains Mono', ui-monospace, monospace; font-style: normal; }
.product-preview-ticks { position: absolute; right: 7px; bottom: 6px; left: 7px; display: flex; gap: 3px; padding-right: 44px; }
.product-preview-ticks i { height: 2px; flex: 1; background: rgba(244, 239, 231, .48); }
.product-preview-ticks i:first-child { background: #91a7ff; }
.product-preview-terminal { align-items: center; gap: 5px; padding: 8px; background: linear-gradient(135deg, rgba(22, 30, 55, .85), rgba(13, 15, 19, .9)); }
.product-preview-terminal::before { content: '>_'; color: #91a7ff; font: 12px 'JetBrains Mono', ui-monospace, monospace; }
.product-preview-terminal i { padding: 4px 5px; border: 1px solid rgba(126, 151, 255, .25); border-radius: 3px; color: rgba(225, 231, 255, .8); font: 9px/1 'JetBrains Mono', ui-monospace, monospace; font-style: normal; }

/* --- профиль --- */
.profile-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; padding: 13px 0; border-top: 1px solid rgba(244, 239, 231, .1); }
.profile-row:first-child { padding-top: 0; border-top: 0; }
.profile-row > :first-child { color: rgba(244, 239, 231, .62); font-size: 13px; }
.profile-row > :last-child { color: #f4efe7; font-size: 14px; text-align: right; overflow-wrap: anywhere; }

/* --- покупки ---
   Заказов со временем станет много, поэтому строка держит одно: что куплено и
   когда. Название крупнее даты — по нему ищут глазами. */
.purchase-list { display: grid; gap: 2px; margin: 16px 0 0; padding: 0; list-style: none; }
.purchase { display: grid; gap: 3px; padding: 12px 0; border-top: 1px solid rgba(244, 239, 231, .1); }
.purchase:first-child { padding-top: 0; border-top: 0; }
.purchase-title { font-size: 15px; font-weight: 700; color: #f4efe7; }
.purchase-meta { font: 12px/1.45 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .62); }
/* Возврат и спор не прячем: человек должен видеть, что заказ был. */
.purchase.is-void .purchase-title { color: rgba(244, 239, 231, .55); text-decoration: line-through; }
.purchase.is-void .purchase-meta { color: #ffb258; }

/* Выход — последнее действие на странице, и физически последнее. */
.profile-logout { margin-top: 4px; }
.profile-logout .logout-form { max-width: none; margin: 0; }
.profile-logout .logout-btn { width: 100%; min-height: 48px; color: rgba(244, 239, 231, .72); }
.profile-logout .logout-btn:hover { border-color: rgba(255, 122, 112, .5); color: #ffaaa2; }

/* --- анкета «о себе» ---
   Один вопрос за раз: спрашиваем только `next`, всё остальное лежит списком ниже
   и правится по тапу. Ничего не блокирует — пустая анкета не мешает кабинету. */
.profile-about .cabinet-card-body { display: grid; gap: 16px; }
.profile-about .dv-title { font-size: clamp(19px, 3.6vw, 23px); }
.profile-progress { margin: 0; font: 12px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .06em; color: rgba(244, 239, 231, .62); }
.profile-question { display: grid; gap: 10px; padding: 18px; border: 1px solid rgba(46, 91, 255, .35); border-radius: 12px; background: rgba(46, 91, 255, .07); }
.profile-q { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; color: #f4efe7; }
/* Зачем спрашиваем — не мелкий шрифт под полем, а часть вопроса: без него не отвечают. */
.profile-why { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(244, 239, 231, .62); }
/* Ровно 16px: на меньшем размере iOS Safari зумит страницу на фокусе поля. */
.profile-input { width: 100%; border: 1px solid rgba(244, 239, 231, .2); border-radius: 9px; background: rgba(244, 239, 231, .035); color: #f4efe7; padding: 12px; font: 16px/1.45 'Golos Text', sans-serif; }
textarea.profile-input { min-height: 84px; resize: vertical; }
.profile-input:focus { border-color: #7e97ff; outline: 0; box-shadow: 0 0 0 3px rgba(126, 151, 255, .16); }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-chip { min-height: 44px; padding: 0 15px; border: 1px solid rgba(244, 239, 231, .18); border-radius: 99px; background: rgba(244, 239, 231, .03); color: rgba(244, 239, 231, .78); font: 600 14px/1.2 'Golos Text', sans-serif; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.profile-chip[aria-pressed="true"] { border-color: #2e5bff; background: rgba(46, 91, 255, .18); color: #fff; }
.profile-chip:focus-visible, .profile-known-open:focus-visible, .profile-skipped summary:focus-visible { outline: 2px solid #7e97ff; outline-offset: 2px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-actions .cabinet-btn { min-height: 44px; padding: 12px 24px; }
.profile-error { margin: 0; color: #ffaaa2; font-size: 13.5px; line-height: 1.5; }
.profile-error:empty { display: none; }
.profile-done { margin: 0; font-size: 14.5px; color: #b9c6ff; }

.profile-known { display: grid; gap: 6px; }
.profile-known-row { display: grid; }
/* Кликабельна вся строка: попасть в слово-ссылку на телефоне нечем. */
.profile-known-open { display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid rgba(244, 239, 231, .12); border-radius: 10px; background: transparent; color: #f4efe7; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.profile-known-label { flex: none; color: rgba(244, 239, 231, .62); font-size: 13px; }
.profile-known-value { min-width: 0; text-align: right; font-size: 14px; overflow-wrap: anywhere; }
.profile-known-value.is-empty { color: rgba(244, 239, 231, .5); font-size: 13px; }
.profile-skipped summary { display: flex; align-items: center; min-height: 44px; color: rgba(244, 239, 231, .62); font-size: 13.5px; cursor: pointer; }
.profile-skipped .profile-known { margin-top: 8px; }

@media (hover: hover) {
  .profile-chip:hover { border-color: rgba(46, 91, 255, .55); color: #f4efe7; }
  .profile-known-open:hover { border-color: rgba(46, 91, 255, .5); background: rgba(46, 91, 255, .07); }
}

/* --- greeting --- */
.cabinet-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.cabinet-head-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cabinet-hello { margin: 0; font-size: clamp(28px, 5vw, 38px); font-weight: 900; letter-spacing: -.02em; color: #f4efe7; }
.cabinet-sub { font-size: 14px; color: rgba(244, 239, 231, .5); }
.cabinet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(244, 239, 231, .16); border-radius: 99px; padding: 6px 13px; font: 11px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: rgba(244, 239, 231, .55); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(244, 239, 231, .3); }
.chip.is-on { border-color: rgba(46, 91, 255, .5); color: #b9c6ff; }
.chip.is-on::before { background: #2e5bff; }

/* --- cards ---
   Cabinet cards are <section> elements, so they inherit the landing page's
   generous section padding. Reset it: the card owns its own spacing. */
.cabinet-card { padding: 0; transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.cabinet-card:hover { border-color: rgba(244, 239, 231, .24); }
.cabinet-card-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cabinet-card-main { min-width: 260px; flex: 1; }
.cabinet-card-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.cabinet-card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 22px 26px 18px; flex-wrap: wrap; }
.kicker-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cabinet-card-note { padding: 0 26px 22px; }

.cabinet-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: auto; padding: 14px 26px; border-radius: 10px; font: 600 15px/1.2 'Golos Text', sans-serif; text-decoration: none; }
.cabinet-btn-block { display: block; width: 100%; text-align: center; margin-top: 22px; }
.cabinet-btn .glyph-download { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid currentColor; }
.cabinet-btn .glyph-play { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
.cabinet-btn[disabled] { background: transparent; color: rgba(244, 239, 231, .45); border: 1px solid rgba(244, 239, 231, .16); cursor: not-allowed; }
.state-line { font: 12px 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .5); text-align: right; }
/* .dv-meta объявлен в styles.css с .4 — это меньше 4.5:1 на #0b0a08. Правим здесь,
   потому что cabinet.css подключается после styles.css. */
.dv-meta { color: rgba(244, 239, 231, .62); }

/* --- personal review intake --- */
.personal-review-card .cabinet-card-body { padding: 26px; }
.personal-review-form { display: grid; gap: 22px; margin-top: 24px; }
.personal-review-form fieldset { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1px solid rgba(244,239,231,.12); border-radius: 12px; }
.personal-review-form legend { padding: 0 7px; color: rgba(244,239,231,.76); font: 600 12px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.personal-review-form legend span { display: inline-grid; width: 19px; height: 19px; place-items: center; margin-right: 6px; border-radius: 50%; background: rgba(46,91,255,.22); color: #b9c6ff; }
.personal-review-form label { display: grid; gap: 7px; color: rgba(244,239,231,.8); font-size: 14px; font-weight: 600; }
.personal-review-form label em { color: rgba(244,239,231,.62); font-size: 12px; font-style: normal; font-weight: 400; }
/* Ровно 16px: на меньшем размере iOS Safari зумит страницу на фокусе поля. */
.personal-review-form input,.personal-review-form textarea { width: 100%; border: 1px solid rgba(244,239,231,.2); border-radius: 9px; background: rgba(244,239,231,.035); color: #f4efe7; padding: 12px; font: 16px/1.45 'Golos Text',sans-serif; }
.personal-review-form textarea { min-height: 88px; resize: vertical; }.personal-review-form input:focus,.personal-review-form textarea:focus { border-color: #7e97ff; outline: 0; box-shadow: 0 0 0 3px rgba(126,151,255,.16); }
.personal-slot-note { margin: -2px 0 2px; color: rgba(244,239,231,.48); font-size: 13px; }.personal-slot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.personal-slot>b { grid-column: 1/-1; font-size: 14px; }.personal-slot em { color: rgba(244,239,231,.62); font-size: 12px; font-style: normal; font-weight: 400; }.personal-form-actions { display: grid; gap: 10px; }.personal-form-error { margin: 18px 0 0; color: #ffaaa2; font-size: 14px; }

/* --- recording card --- */
.recording-empty { aspect-ratio: 16/9; background: #0e0d0b; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.recording-empty-inner { max-width: 340px; }
.recording-empty-ring { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 1px solid rgba(244, 239, 231, .25); display: flex; align-items: center; justify-content: center; }
.recording-empty-ring i { width: 12px; height: 12px; border: 2px solid #7e97ff; border-radius: 50%; border-left-color: transparent; animation: spin 1.4s linear infinite; }
.recording-empty-title { margin-top: 16px; font-size: 16px; font-weight: 700; }
.recording-empty-text { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: rgba(244, 239, 231, .55); }
.recording-empty-text p { margin: 0; }

/* Compact "poster" band with the watch CTA — no empty 16:9 hole. */
.recording-open {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  padding: 26px;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(46, 91, 255, .18), transparent 62%),
    repeating-linear-gradient(135deg, #0e0d0b 0 14px, #12100d 14px 28px);
  border-block: 1px solid rgba(244, 239, 231, .08);
}
.recording-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 0 26px 24px; }
.watch-progress { flex: 1; min-width: 220px; }
.watch-progress-track { height: 5px; border-radius: 99px; background: rgba(244, 239, 231, .12); overflow: hidden; }
.watch-progress-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2e5bff, #7e97ff); transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.watch-progress-note { margin-top: 8px; font: 11.5px 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .62); letter-spacing: .05em; }

/* --- отзыв ---
   Одна и та же разметка живёт карточкой в кабинете и страницей, открытой по
   ссылке из письма, поэтому у блока нет собственных отступов от края: их даёт
   либо .cabinet-card-body, либо .service-hero. */
.feedback-card .cabinet-card-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 26px 24px; }
.feedback-hero .feedback-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin-top: 22px; }
.feedback-card .dv-desc, .feedback-card .dv-title { margin: 0; }

/* Кнопки шкалы тянутся в ряд и переносятся, но не мельчают ниже пальца. */
.fb-scale { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-score {
  flex: 1 1 auto; min-width: 44px; min-height: 46px; padding: 0 6px;
  border: 1px solid rgba(244, 239, 231, .16); border-radius: 10px;
  background: rgba(244, 239, 231, .03); color: rgba(244, 239, 231, .75);
  font: 700 16px/1 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s, transform .15s;
}
@media (hover: hover) {
  .fb-score:hover { border-color: rgba(46, 91, 255, .55); color: #f4efe7; transform: translateY(-1px); }
}
.fb-score:focus-visible { outline: 2px solid #7e97ff; outline-offset: 2px; }
.fb-score.is-active { border-color: #2e5bff; background: rgba(46, 91, 255, .16); color: #fff; }

/* Все четыре подсказки — на странице из письма, где решение принимают вслепую. */
.fb-anchors { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.5; color: rgba(244, 239, 231, .55); }
.fb-anchors b { color: #f4efe7; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Одна живая — под выбранной цифрой; пустая строка не должна прыгать вёрсткой. */
.fb-anchor-live { min-height: 20px; margin: 0; font: 13.5px/1.5 'Golos Text', sans-serif; color: #b9c6ff; }

.fb-comment { width: 100%; resize: vertical; min-height: 84px; font: 16px/1.5 'Golos Text', sans-serif; }
.fb-publish { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: rgba(244, 239, 231, .6); cursor: pointer; }
.fb-publish[hidden] { display: none; }
.fb-publish input { width: 16px; height: 16px; accent-color: #2e5bff; }
.fb-status:empty { display: none; }

.fb-next { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 18px; border: 1px solid rgba(46, 91, 255, .35); border-radius: 12px; background: rgba(46, 91, 255, .08); animation: cabinet-rise .4s cubic-bezier(.2, .7, .2, 1) both; }
.fb-next[hidden] { display: none; }
.fb-next p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #dfe5ff; }

/* --- toast ---
   Нижний край — зона жеста «домой», поэтому поднимаем тост над вырезом. */
.cabinet-toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 130%); display: flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid rgba(244, 239, 231, .18); border-radius: 12px; background: rgba(17, 15, 13, .96); color: #f4efe7; font-size: 14px; box-shadow: 0 22px 50px -26px rgba(0, 0, 0, .95); transition: transform .32s cubic-bezier(.2, .7, .2, 1), opacity .32s; opacity: 0; pointer-events: none; }
.cabinet-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* --- states --- */
.cabinet-narrow { max-width: 520px; margin: 40px auto; }
.state-card { padding: 32px 28px; }
.state-title { margin: 14px 0 0; font-size: clamp(22px, 4vw, 27px); font-weight: 900; line-height: 1.15; color: #f4efe7; }
.state-text { margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: rgba(244, 239, 231, .6); }
.state-support { margin-top: 14px; font-size: 13px; color: rgba(244, 239, 231, .62); }
.dv-kicker.is-warn { color: #ffb258; }
.dv-kicker.is-error { color: #ff7a70; }
.download-error-text { font-size: 13.5px; line-height: 1.5; color: rgba(244, 239, 231, .75); }
.download-error-text p { margin: 0; }

/* --- skeletons --- */
.sk-stack { display: flex; flex-direction: column; gap: 12px; }
.sk-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sk-col { display: flex; flex-direction: column; gap: 10px; }
.sk-pad { padding: 18px 22px; display: flex; flex-direction: column; gap: 9px; }
.sk-w-40 { width: 40px; } .sk-w-90 { width: 90px; } .sk-w-110 { width: 110px; } .sk-w-120 { width: 120px; }
.sk-w-140 { width: 140px; } .sk-w-160 { width: 160px; } .sk-w-170 { width: 170px; } .sk-w-220 { width: 220px; }
.sk-w-240 { width: 240px; } .sk-w-250 { width: 250px; }
.sk-h-10 { height: 10px; } .sk-h-11 { height: 11px; } .sk-h-12 { height: 12px; } .sk-h-14 { height: 14px; }
.sk-h-16 { height: 16px; } .sk-h-32 { height: 32px; } .sk-h-44 { height: 44px; border-radius: 10px; }
.sk-video { aspect-ratio: 16/9; background: rgba(244, 239, 231, .05); display: flex; align-items: center; justify-content: center; }
.sk-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(244, 239, 231, .12); border-top-color: #2e5bff; animation: spin .9s linear infinite; }
/* Микротекст на #0b0a08: ниже .62 контраст падает под 4.5:1. */
.sk-caption { font: 11px 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .62); text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* --- cabinet footer --- */

/* --- login: link sent --- */
.link-sent-card { width: 100%; }
.link-sent-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(46, 91, 255, .15); border: 1px solid rgba(46, 91, 255, .5); display: flex; align-items: center; justify-content: center; }
.link-sent-icon i { width: 12px; height: 7px; border-left: 2.5px solid #7e97ff; border-bottom: 2.5px solid #7e97ff; transform: rotate(-45deg) translateY(-2px); }
.link-sent-title { margin: 20px 0 0; font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; color: #f4efe7; }
.link-sent-text { margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: rgba(244, 239, 231, .6); }
.link-sent-text b { color: #f4efe7; font-weight: 600; }
.link-sent-actions { display: grid; gap: 12px; margin-top: 24px; }
.link-sent-actions .button { min-height: 52px; }
.link-sent-alt { margin-top: 16px; font-size: 13px; }
.link-sent-mail { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* --- watch page extras --- */
.watch-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(244, 239, 231, .1); font-size: 14px; color: rgba(244, 239, 231, .75); }
.watch-resume button { border: 1px solid rgba(244, 239, 231, .22); border-radius: 8px; background: transparent; color: inherit; font: inherit; padding: 6px 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.watch-resume button:hover { border-color: #2e5bff; color: #fff; }
.watch-chapters { padding: 4px 16px 18px; }
.watch-chapters-title { font: 11px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: rgba(244, 239, 231, .62); margin: 10px 0; }
.watch-chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; padding: 0; margin: 0; list-style: none; }
.watch-chapter { display: flex; gap: 14px; align-items: baseline; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: #f4efe7; font: 14.5px 'Golos Text', sans-serif; text-align: left; cursor: pointer; transition: background .15s; }
.watch-chapter:hover { background: rgba(244, 239, 231, .06); }
.watch-chapter[aria-current="true"] { background: rgba(46, 91, 255, .14); }
.watch-chapter-time { font: 12px 'JetBrains Mono', ui-monospace, monospace; color: #7e97ff; flex: none; }
.watch-chapter-now { margin-left: auto; font: 10px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: #8fa4ff; }
.watch-hint { margin-top: 12px; font: 11.5px/1.6 'JetBrains Mono', ui-monospace, monospace; color: rgba(244, 239, 231, .62); }
.watch-hint kbd { border: 1px solid rgba(244, 239, 231, .2); border-radius: 4px; padding: 1px 5px; margin: 0 2px; font: inherit; color: rgba(244, 239, 231, .65); }

/* --- motion ---
   The entry animation is gated behind `.is-entering`, which cabinet.js sets on
   the first paint of each route: `render()` rebuilds the whole subtree on every
   state change, and the live-phase timer re-renders on its own, so an
   unconditional animation would replay the cabinet every minute.
   Список продуктов и ссылка «← Продукты» — тоже прямые дети шелла: без них
   страница появлялась бы рывком, пока карточки всплывают. */
@keyframes cabinet-rise { from { opacity: 0; transform: translateY(14px); } }
.cabinet-shell.is-entering > .cabinet-head,
.cabinet-shell.is-entering > .product-links,
.cabinet-shell.is-entering > .cabinet-breadcrumbs,
.cabinet-shell.is-entering > section { animation: cabinet-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
/* Выход теперь один на всё приложение и живёт в профиле — значит это уже не
   мелкая служебная ссылка в углу, а обычная кнопка под палец. */
.profile-row .cabinet-nav-logout-btn { min-height: 44px; padding: 10px 0; }
.cabinet-shell.is-entering > section:nth-of-type(1) { animation-delay: .06s; }
.cabinet-shell.is-entering > section:nth-of-type(2) { animation-delay: .12s; }
.cabinet-shell.is-entering > section:nth-of-type(3) { animation-delay: .18s; }
.cabinet-shell.is-entering > section:nth-of-type(4) { animation-delay: .24s; }
.cabinet-shell.is-entering > section:nth-of-type(n+5) { animation-delay: .3s; }

/* На тач-экране :hover залипает после тапа и карточка остаётся приподнятой. */
@media (hover: hover) {
  .cabinet-card:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -30px rgba(0, 0, 0, .9); }
}

/* The one animation that carries meaning: something is live right now. */
@keyframes cabinet-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 91, 255, .55); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(46, 91, 255, 0); }
}
.chip.is-on::before { animation: cabinet-pulse 2.4s infinite; }
.livestream-card.is-live { border-color: rgba(46, 91, 255, .5); animation: live-breathe 3.4s ease-in-out infinite; }
.livestream-card.is-live .dv-kicker::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; vertical-align: 1px; border-radius: 50%; background: #2e5bff; animation: cabinet-pulse 2s infinite; }
@keyframes live-breathe { 50% { border-color: rgba(46, 91, 255, .85); box-shadow: 0 0 34px -12px rgba(46, 91, 255, .7); } }

[data-stream-countdown] { font-variant-numeric: tabular-nums; }

/* Progress that is still moving gets a sheen; a finished bar stays still. */
.watch-progress-fill { position: relative; overflow: hidden; }
.watch-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255, 255, 255, .4) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: progress-sheen 2.8s 1.2s infinite ease-in-out;
}
.watch-progress-fill.is-complete::after { animation: none; }
@keyframes progress-sheen { 45%, 100% { transform: translateX(100%); } }

.cabinet-toast i { flex: none; width: 11px; height: 6px; border-left: 2px solid #7e97ff; border-bottom: 2px solid #7e97ff; transform: rotate(-45deg) translateY(-2px) scale(.4); opacity: 0; }
.cabinet-toast.is-visible i { animation: toast-check .3s .12s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes toast-check { to { opacity: 1; transform: rotate(-45deg) translateY(-2px) scale(1); } }

@media (max-width: 640px) {
  .watch-chapter-list { grid-template-columns: 1fr; }
  .personal-slot { grid-template-columns: 1fr; }
  .cabinet-card-side { align-items: stretch; width: 100%; }
  .cabinet-btn { width: 100%; }
  .state-line { text-align: left; }
  .cabinet-nav { padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
  /* Три вкладки уходят под бренд и делят ширину поровну — так они влезают на 360px. */
  .cabinet-tabs { width: 100%; gap: 5px; }
  .cabinet-tab { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .cabinet-breadcrumbs ol { gap: 3px 6px; }
  .cabinet-breadcrumbs li { gap: 6px; }
  .cabinet-now-action { margin-top: 16px; }
  .cabinet-now-action > * { width: 100%; }
  .product-links { grid-template-columns: 1fr; }
  .product-link { padding: 12px 14px; }
  .product-preview { min-height: 0; padding: 16px; }
  .product-preview-terminal { gap: 3px; padding: 7px; }
  .product-preview-terminal i { padding: 4px; font-size: 8px; }
  /* Подпись и значение на 360px не помещаются в строку — кладём их в две. */
  .profile-row { flex-direction: column; align-items: flex-start; }
  .profile-row > :last-child { text-align: left; }
  /* Одиннадцать кнопок в ряд на телефоне — это пиксели. Колонок столько, сколько
     влезает при 44px под палец, и «10» стоит в своей, а не растягивается на
     остаток строки, как это делал flex-basis. */
  .fb-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); }
  .fb-score { min-width: 0; padding: 0 2px; }
  /* На 360px анкета — одна колонка: кнопки под палец, подпись над значением. */
  .profile-question { padding: 14px; }
  .profile-actions { display: grid; }
  .profile-known-open { flex-direction: column; align-items: flex-start; gap: 2px; }
  .profile-known-value { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-score:hover { transform: none; }
  .fb-next { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cabinet-card:hover { transform: none; box-shadow: none; }
  .watch-progress-fill, .cabinet-toast { transition: none; }
  .cabinet-tab, .product-link { transition: none; }
  .recording-empty-ring i, .sk-spinner { animation-duration: 2.4s; }
  .cabinet-shell.is-entering > .cabinet-head,
  .cabinet-shell.is-entering > .product-links,
  .cabinet-shell.is-entering > .cabinet-breadcrumbs,
  .cabinet-shell.is-entering > section { animation: none; }
  .chip.is-on::before, .livestream-card.is-live, .livestream-card.is-live .dv-kicker::before,
  .watch-progress-fill::after { animation: none; }
  .cabinet-toast i { opacity: 1; transform: rotate(-45deg) translateY(-2px); }
  .cabinet-toast.is-visible i { animation: none; }
  .profile-chip, .profile-known-open { transition: none; }
}
