/* Video Hustler — Mini App
   Тёмная база, стеклянный знак VH на фоне, лайм как единственный акцент,
   жирный наклонный капс Exo 2 для акцентов — как в wordmark. */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(../assets/fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(../assets/fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(../assets/fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(../assets/fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(../assets/fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(../assets/fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(../assets/fonts/onest-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(../assets/fonts/onest-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(../assets/fonts/unbounded-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(../assets/fonts/unbounded-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap; src: url(../assets/fonts/exo-2-cyrillic-800-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap; src: url(../assets/fonts/exo-2-latin-800-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 900; font-display: swap; src: url(../assets/fonts/exo-2-cyrillic-900-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 900; font-display: swap; src: url(../assets/fonts/exo-2-latin-900-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #050606;
  --lime: #cbf94a;
  --lime-hi: #e4ff8a;
  --lime-ink: #11160a;
  --lime-08: rgba(203, 249, 74, 0.08);
  --lime-12: rgba(203, 249, 74, 0.12);
  --lime-30: rgba(203, 249, 74, 0.3);
  --lime-50: rgba(203, 249, 74, 0.5);
  --text: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.72);
  --faint: rgba(245, 242, 234, 0.56);
  --danger: #ff8a78;
  --fill: rgba(255, 255, 255, 0.04);
  --fill-hi: rgba(255, 255, 255, 0.1);
  --well: rgba(0, 0, 0, 0.45);
  --stroke: rgba(255, 255, 255, 0.12);
  --stroke-hi: rgba(255, 255, 255, 0.18);

  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --snap: cubic-bezier(0.77, 0, 0.18, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Unbounded", var(--font);
  --font-display: "Exo 2", var(--font);

  /* Безопасные зоны: Telegram выставляет свои переменные, браузер — env(). */
  --safe-top: max(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}

*, *::before, *::after { box-sizing: border-box; }

/* Каркас как у нативного приложения: сама страница не двигается,
   прокручивается только .app и только по вертикали. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  position: fixed;
  inset: 0;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* Акцидентный шрифт бренда: жирный наклонный капс, как в wordmark. */
.d { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- фон: стеклянный знак ---------- */

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.backdrop__mark {
  position: absolute; left: 50%; top: calc(var(--safe-top) - 40px);
  width: min(460px, 118vw); aspect-ratio: 1; margin-left: calc(min(460px, 118vw) / -2);
  transition: opacity 600ms var(--ease), transform 700ms var(--ease);
}
.backdrop__mark img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  transform-origin: 50% 60%;
  animation: turn 14s ease-in-out infinite alternate;
}
@keyframes turn {
  from { transform: perspective(900px) rotateY(-14deg) rotateX(4deg) translateY(0); }
  to { transform: perspective(900px) rotateY(14deg) rotateX(-3deg) translateY(-14px); }
}
.backdrop__caustic {
  position: absolute; left: 50%; top: calc(var(--safe-top) + 120px); width: 200px; height: 200px; margin-left: -100px;
  border-radius: 50%; background: radial-gradient(circle, rgba(228, 255, 138, 0.35), transparent 65%);
  filter: blur(30px); mix-blend-mode: screen;
  animation: caustic 9s ease-in-out infinite alternate;
  transition: opacity 600ms var(--ease);
}
@keyframes caustic {
  from { transform: translate3d(-60px, 40px, 0) scale(0.9); opacity: 0.5; }
  to { transform: translate3d(70px, -30px, 0) scale(1.2); opacity: 0.9; }
}
.backdrop__fade {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--safe-top) + 560px);
  background: linear-gradient(180deg, rgba(5, 6, 6, 0.15) 0%, rgba(5, 6, 6, 0) 22%, rgba(5, 6, 6, 0.7) 66%, var(--bg) 96%);
}
/* В редакторе и при обработке знак уходит на второй план. */
body[data-screen="editor"] .backdrop__mark,
body[data-screen="task"] .backdrop__mark { opacity: 0.18; transform: translate3d(0, -90px, 0) scale(0.8); }
body[data-screen="editor"] .backdrop__caustic,
body[data-screen="task"] .backdrop__caustic { opacity: 0; }

/* ---------- стекло ---------- */

.plate {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 20px 44px -18px rgba(0, 0, 0, 0.8);
}
/* Лаймовые уголки — фирменная деталь главных форм. */
.plate--corners::before, .plate--corners::after {
  content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border: 0 solid var(--lime);
}
.plate--corners::before { left: -1px; top: -1px; border-left-width: 3px; border-top-width: 3px; border-top-left-radius: var(--r-xl); }
.plate--corners::after { right: -1px; bottom: -1px; border-right-width: 3px; border-bottom-width: 3px; border-bottom-right-radius: var(--r-xl); }

/* Жидкое стекло: толстая линза с бликом по краю. */
.lg {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(10px) saturate(190%) brightness(1.08);
  backdrop-filter: blur(10px) saturate(190%) brightness(1.08);
  box-shadow: inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.38), inset -1px -1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 24px rgba(255, 255, 255, 0.06), 0 14px 36px rgba(0, 0, 0, 0.55);
}

.card { border-radius: var(--r-xl); padding: 14px; }

/* ---------- каркас и экраны ---------- */

.app {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Только вертикальная прокрутка: без сдвига вбок, щипка и зума двойным тапом. */
  touch-action: pan-y;
  scrollbar-width: none;
}
.app::-webkit-scrollbar { display: none; }

.screen {
  position: relative;
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 24px);
  min-height: 100%;
  overflow-x: clip;
}
.screen.is-active { display: flex; animation: screen-in 360ms var(--ease) backwards; }
/* Запас под клавиатурой iOS (--kb ставит watchKeyboard): поле можно докрутить над ней. */
.screen::after { content: ""; flex: none; height: var(--kb, 0px); }
/* Сам экран только проявляется: transform на нём сломал бы position: fixed у нижней панели. */
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }

/* Блоки экрана всплывают друг за другом */
.screen.is-active > * { animation: rise 640ms var(--ease) backwards; }
.screen.is-active > *:nth-child(2) { animation-delay: 60ms; }
.screen.is-active > *:nth-child(3) { animation-delay: 120ms; }
.screen.is-active > *:nth-child(4) { animation-delay: 180ms; }
.screen.is-active > *:nth-child(5) { animation-delay: 240ms; }
.screen.is-active > *:nth-child(6) { animation-delay: 300ms; }
.screen.is-active > *:nth-child(n+7) { animation-delay: 360ms; }
.screen.is-active > .dock { animation: dock-in 640ms var(--ease) 200ms backwards; }
.screen.is-active > .outline { animation: none; }
.screen.is-active > .ticker { animation: band 760ms var(--ease) 260ms backwards; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }

/* ---------- шапка ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.topbar__word { height: 20px; width: auto; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 14px/1 var(--font); color: var(--lime);
}
.avatar:empty { visibility: hidden; }

/* ---------- главная ---------- */

.hero { padding: 0 4px; margin-top: clamp(150px, 31vh, 250px); }
.hero__title {
  margin: 0;
  font: 600 34px/1.06 var(--font-head); letter-spacing: -0.045em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.hero__title span { color: var(--lime); }
.hero__lead { margin: 10px 0 0; color: var(--muted); font-size: 15px; max-width: 32ch; }

/* Лаймовая бегущая лента сайтов под наклоном */
.ticker {
  position: relative; z-index: 2;
  margin: 10px -24px 4px; height: 38px;
  display: flex; align-items: center; overflow: hidden;
  background: var(--lime); color: var(--lime-ink);
  transform: rotate(-4deg); transform-origin: left center;
  animation: band 760ms var(--ease) 260ms backwards;
}
@keyframes band { from { transform: rotate(-4deg) scaleX(0); } to { transform: rotate(-4deg) scaleX(1); } }
.ticker__track { display: flex; width: max-content; font-size: 17px; white-space: nowrap; animation: marquee 16s linear infinite; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* Сцена формы: за стеклом едут огромные контурные слова */
.stage { position: relative; }
.outline {
  position: absolute; z-index: 0; left: -16px; right: -16px; top: 26px;
  overflow: hidden; pointer-events: none; opacity: 0.9;
}
.outline__row { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.outline__row--back { animation-direction: reverse; animation-duration: 34s; }
.outline__row span {
  font-size: 110px; line-height: 1; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.4px rgba(203, 249, 74, 0.42);
}
.outline--top { top: calc(var(--safe-top) + 4px); opacity: 0.45; }
.outline--top .outline__row span { font-size: 92px; -webkit-text-stroke-color: rgba(203, 249, 74, 0.5); }

.source { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }

/* ---------- поле ---------- */

.field {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 8px 0 14px;
  border-radius: var(--r-md);
  background: var(--well);
  border: 1px solid var(--stroke);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.field:focus-within { border-color: var(--lime-50); box-shadow: 0 0 0 4px var(--lime-08); }
.field.is-error { border-color: rgba(255, 138, 120, 0.6); box-shadow: 0 0 0 4px rgba(255, 138, 120, 0.1); animation: shake 320ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.field__icon { color: var(--faint); flex: none; display: grid; }
.field__input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none;
  font-size: 16px; font-weight: 600;
}
.field__input::placeholder { color: var(--faint); font-weight: 500; }
.field__error { margin: -2px 4px 0; color: var(--danger); font-size: 13px; line-height: 1.35; animation: rise 260ms var(--ease); }
.field__hint { margin: -4px 4px 0; color: var(--muted); font-size: 13px; }
.field__hint--accent { margin-top: -2px; color: var(--lime); line-height: 1.35; animation: rise 260ms var(--ease); }
/* Подсказываем, куда нажать: лаймовая волна вокруг поля */
.field.is-attention { border-color: var(--lime-50); animation: attention 1.1s var(--ease) 2; }
@keyframes attention { from { box-shadow: 0 0 0 0 rgba(203, 249, 74, 0.5); } to { box-shadow: 0 0 0 12px rgba(203, 249, 74, 0); } }
/* «Вставить» и крестик сменяют друг друга в слоте одной ширины — поле ввода не прыгает. */
.field__action { flex: none; width: 104px; height: 44px; display: flex; align-items: center; justify-content: flex-end; }

.pill-btn {
  flex: none; height: 40px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--lime-50);
  color: var(--lime); font-size: 14px;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.pill-btn:active { transform: scale(0.95); background: var(--lime-12); }

.source__hint { margin: -2px 4px 0; color: var(--faint); font-size: 12.5px; text-align: center; }
.source__hint:empty { display: none; }

/* ---------- кнопки ---------- */

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 20px;
  border-radius: var(--r-md);
  font: italic 900 17px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em;
  transition: transform 160ms var(--ease), background 200ms var(--ease), color 200ms var(--ease), opacity 200ms var(--ease), box-shadow 200ms var(--ease);
}
.btn:active:not(:disabled) { transform: translate3d(2px, 2px, 0); }
.btn--primary {
  background: var(--lime); color: var(--lime-ink);
  box-shadow: 4px 4px 0 rgba(203, 249, 74, 0.25);
}
/* Блик пробегает по лайму раз в несколько секунд */
.btn--primary::after, .bar-btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  background-size: 260% 100%;
  animation: sheen 3.6s ease-in-out infinite;
}
@keyframes sheen { 0%, 55% { background-position: 150% 0; } 85%, 100% { background-position: -60% 0; } }
.btn--primary:disabled { background: var(--lime-12); color: rgba(203, 249, 74, 0.55); box-shadow: none; }
.btn--primary:disabled::after { display: none; }
.btn--big { justify-content: space-between; height: 58px; font-size: 22px; }
.btn--big .btn__icon svg { width: 26px; height: 26px; stroke-width: 2.4; }
.btn--ghost { background: var(--fill); border: 1px solid var(--stroke-hi); color: var(--text); }
.btn--ghost:active:not(:disabled) { background: var(--fill-hi); }
.btn--danger-text { color: var(--danger); }
.btn__icon { display: grid; transition: transform 220ms var(--ease); }
.btn--primary:not(:disabled):active .btn__icon { transform: translateX(4px); }

.spinner {
  display: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.btn.is-loading .btn__icon { display: none; }
.btn.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--muted);
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.icon-btn--sm { width: 40px; height: 40px; }
.icon-btn:active { transform: scale(0.92); background: var(--fill-hi); color: var(--text); }

.link-btn { color: var(--lime); font-size: 14px; font-weight: 600; padding: 10px 4px; min-height: 44px; }
.link-btn:active { opacity: 0.6; }

.upload-btn { height: 50px; font-size: 16px; }
.upload-btn__fill {
  position: absolute; inset: 0; transform-origin: left;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--lime-12), var(--lime-30));
  transition: transform 200ms linear;
}
.upload-btn .btn__label { position: relative; }
.upload-btn.is-loading { pointer-events: none; }

/* ---------- плитки и переключатели ---------- */

.tile {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--lime-08); color: var(--lime);
  border: 1px solid var(--lime-30);
}

.setting-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); cursor: pointer; }
.setting-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setting-row__title { font-weight: 600; }
.setting-row__sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.switch { position: relative; flex: none; display: inline-flex; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch__track {
  width: 52px; height: 32px; border-radius: 999px; padding: 3px;
  background: var(--fill-hi); border: 1px solid var(--stroke);
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
}
.switch__thumb {
  display: block; width: 24px; height: 24px; border-radius: 50%;
  background: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 320ms var(--spring), background 220ms var(--ease);
}
.switch input:checked + .switch__track { background: var(--lime); border-color: var(--lime); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(20px); background: var(--lime-ink); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ---------- недавние ---------- */

.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.section-head h2 { margin: 0; font-size: 14px; letter-spacing: 0.08em; color: var(--faint); }
.section-head__meta { color: var(--faint); font-size: 13px; }

.history { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.history__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 8px 0 8px 4px;
  border-top: 1px solid var(--stroke);
  text-align: left; cursor: pointer;
  animation: rise 520ms var(--ease) backwards;
  transition: background 200ms var(--ease);
}
.history-item:active { background: var(--lime-08); }
.history-item__num {
  flex: none; width: 46px;
  font-size: 32px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.4px rgba(203, 249, 74, 0.6);
}
.history-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.history-item__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item__meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .icon-btn { color: var(--lime); }

/* ---------- редактор: исходник ---------- */

.clip { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-lg); }
.clip__frame {
  position: relative; flex: none; overflow: hidden;
  width: 104px; aspect-ratio: 16 / 9; border-radius: var(--r-sm);
  background: linear-gradient(135deg, #1d2120, #141617);
}
/* Своё видео можно посмотреть: карточка раскрывается во всю ширину. */
.clip:has(.clip__frame.is-playing) { flex-direction: column; align-items: stretch; }
.clip:has(.clip__frame.is-playing) .clip__frame { width: 100%; }
.media__img, .media__video { width: 100%; height: 100%; object-fit: cover; }
.media__video { position: absolute; inset: 0; background: #000; object-fit: contain; }
.media__img.is-empty { opacity: 0; }
.badge {
  position: absolute; z-index: 1;
  height: 20px; padding: 0 6px; border-radius: 6px;
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(5, 6, 6, 0.65);
}
.badge:empty { display: none; }
.badge--time { bottom: 4px; right: 4px; }
.clip__frame.is-playing .badge { display: none; }
.media__play {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  display: grid; place-items: center; color: var(--lime-ink);
  background: rgba(203, 249, 74, 0.94);
  transition: transform 200ms var(--spring), opacity 200ms var(--ease);
}
.media__play:active { transform: scale(0.9); }
.clip__frame.is-playing .media__play { opacity: 0; }
.clip__body { min-width: 0; flex: 1; display: flex; flex-direction: column; padding-right: 6px; }
.clip__title {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.clip__meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.clip__site:not(:empty) { color: var(--lime); }
.clip__site:not(:empty)::after { content: " · "; color: var(--muted); }
.clip__thumb { width: 96px; height: 54px; border-radius: var(--r-sm); object-fit: cover; background: #1d2120; flex: none; }
.clip__thumb[src=""] { visibility: hidden; }

/* ---------- редактор: шаги ---------- */

.tools { display: flex; flex-direction: column; gap: 14px; }
.sec { position: relative; z-index: 1; }
.screen.is-active .tools > .sec:not([hidden]) { animation: sec-in 620ms var(--ease) backwards; }
.screen.is-active .tools > .sec:nth-child(2) { animation-delay: 60ms; }
.screen.is-active .tools > .sec:nth-child(3) { animation-delay: 120ms; }
@keyframes sec-in { from { opacity: 0; transform: translate3d(-18px, 0, 0); } }

.sec__head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.sec__num {
  font-size: 26px; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.2px rgba(203, 249, 74, 0.7);
}
.sec__title { margin: 0; font-size: 18px; letter-spacing: 0.03em; }
.sec__value { margin-left: auto; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; transition: color 200ms var(--ease); }
.tool.is-on .sec__value { color: var(--lime); }
.tool.is-disabled { opacity: 0.4; pointer-events: none; }
.tool__panel { padding: 14px; border-radius: var(--r-lg); }
.tool__foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: -8px; }
.tool__hint { margin: 10px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Что забираем: при выборе лайм заливает плитку слева направо */
.outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.outs button {
  position: relative; overflow: hidden;
  height: 84px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  border-radius: 14px; border: 1px solid var(--stroke-hi);
  background: var(--fill); color: var(--text); text-align: left;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: color 260ms var(--ease) 120ms, border-color 260ms var(--ease), transform 160ms var(--ease);
}
.outs button::before {
  content: ""; position: absolute; inset: 0; background: var(--lime);
  transform: scaleX(0); transform-origin: left;
  transition: transform 460ms var(--snap);
}
.outs button > * { position: relative; }
.outs button[aria-checked="true"] { color: var(--lime-ink); border-color: var(--lime); }
.outs button[aria-checked="true"]::before { transform: scaleX(1); }
.outs button:active { transform: skewX(-4deg) scale(0.97); }
.outs button:disabled { opacity: 0.35; }
.outs__label { font-size: 22px; line-height: 1; }
.outs__sub { font-size: 12px; font-weight: 600; opacity: 0.8; }

/* Качество: лента плашек */
.chips-scroll {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none;
  touch-action: pan-x pan-y; overscroll-behavior-x: contain;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.q-chip {
  position: relative; flex: none; scroll-snap-align: center;
  min-width: 84px; height: 62px; padding: 0 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: var(--r-md); border: 1px solid var(--stroke-hi);
  background: var(--fill);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background 220ms var(--ease), border-color 220ms var(--ease), color 220ms var(--ease), transform 160ms var(--ease);
}
.q-chip:active { transform: skewX(-6deg) scale(0.96); }
.q-chip__label { display: flex; align-items: center; gap: 5px; font: italic 900 19px/1 var(--font-display); }
.q-chip__size { color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.q-chip__star { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.q-chip.is-over .q-chip__size { color: var(--faint); }
.q-chip[aria-checked="true"] { background: var(--lime-12); border-color: var(--lime); color: var(--lime); }
.q-chip[aria-checked="true"] .q-chip__size { color: var(--lime); }

/* Варианты «до N МБ», качество GIF, формат звука */
.size-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.size-chip {
  min-width: 0; min-height: 62px; padding: 8px 10px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px;
  border-radius: var(--r-md); text-align: left;
  background: var(--fill); border: 1px solid var(--stroke-hi);
  transition: background 220ms var(--ease), border-color 220ms var(--ease), transform 160ms var(--ease);
}
.size-chip:active { transform: skewX(-6deg) scale(0.96); }
.size-chip__label { max-width: 100%; font: italic 900 15px/1.1 var(--font-display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.size-chip__sub { max-width: 100%; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size-chip[aria-checked="true"] { background: var(--lime-12); border-color: var(--lime); }
.size-chip[aria-checked="true"] .size-chip__label, .size-chip[aria-checked="true"] .size-chip__sub { color: var(--lime); }
.size-chip--ghost { background: none; border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Превью GIF: кадры фрагмента крупно и лентой, каждый можно рассмотреть */
.gifprev { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--well); }
.gifprev__stage {
  position: relative; display: flex; max-width: 100%; line-height: 0; overflow: hidden;
  border-radius: var(--r-sm); background: #000; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.gifprev__stage.is-still { cursor: default; }
.gifprev__canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 280px; }
.gifprev__src { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gifprev__tag, .gifprev__spec { top: 6px; line-height: 1; }
.gifprev__tag { left: 6px; color: var(--lime); }
.gifprev__spec { right: 6px; }
.gifprev__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lime); transform: scaleX(0); transform-origin: left center; }
.gifprev__stage.is-playing .media__play, .gifprev__stage.is-still .media__play { opacity: 0; }
.gifprev__stage.is-still .gifprev__bar { display: none; }
.gifprev__reel {
  align-self: stretch; display: flex; gap: 4px; overflow-x: auto; margin-top: 8px; padding: 2px;
  scroll-padding-inline: 8px; scrollbar-width: none;
}
.gifprev__reel::-webkit-scrollbar { display: none; }
.gifprev__cell {
  flex: none; height: 72px; padding: 0; border: 0; border-radius: 6px; background: #1b1e1d center no-repeat;
  opacity: 0.7;
}
.gifprev__cell.is-on { opacity: 1; box-shadow: inset 0 0 0 2px var(--lime); }
.gifprev__foot { display: flex; justify-content: space-between; gap: 10px; margin: 10px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.gifprev__foot b { flex: none; color: var(--lime); font-weight: 500; }

/* Обрезка: время крупно, под ним лента */
.time-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.time-row__arrow { color: var(--lime); font-size: 22px; }
.stepper {
  display: flex; align-items: center; height: 52px; border-radius: var(--r-md);
  background: var(--well); border: 1px solid var(--stroke);
}
.stepper button { width: 40px; height: 100%; flex: none; display: grid; place-items: center; color: var(--muted); }
.stepper button:active { color: var(--lime); }
.stepper button svg { width: 18px; height: 18px; }
.stepper input {
  flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: none; padding: 0;
  text-align: center; font-size: 19px; font-variant-numeric: tabular-nums;
}

.trimmer { position: relative; height: 52px; margin: 14px 0; touch-action: none; user-select: none; }
.trimmer__strip {
  position: absolute; inset: 0; border-radius: var(--r-sm); overflow: hidden;
  background-color: #1b1e1d; background-size: auto 100%; background-repeat: repeat-x;
}
.trimmer__strip.is-frames { background-size: 100% 100%; background-repeat: no-repeat; }
.trimmer__strip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35)); }
.trimmer__shade { position: absolute; top: 0; bottom: 0; background: rgba(5, 6, 6, 0.72); }
.trimmer__shade--l { left: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.trimmer__shade--r { right: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.trimmer__range {
  position: absolute; top: -3px; bottom: -3px;
  border: 3px solid var(--lime); border-left-width: 0; border-right-width: 0;
  border-radius: var(--r-sm);
  box-shadow: 0 0 24px -4px rgba(203, 249, 74, 0.5);
  cursor: grab;
}
.trimmer__handle {
  position: absolute; top: -3px; bottom: -3px; width: 16px;
  background: var(--lime);
  display: grid; place-items: center; cursor: ew-resize;
}
.trimmer__handle::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: rgba(17, 22, 10, 0.55); }
.trimmer__handle::after { content: ""; position: absolute; inset: -6px -14px; } /* увеличенная зона касания */
.trimmer__handle--l { left: -2px; border-radius: var(--r-sm) 3px 3px var(--r-sm); }
.trimmer__handle--r { right: -2px; border-radius: 3px var(--r-sm) var(--r-sm) 3px; }
.trimmer.is-dragging .trimmer__range { cursor: grabbing; }

/* Формат кадра */
.segmented {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  padding: 4px; border-radius: var(--r-md);
  background: var(--well); border: 1px solid var(--stroke);
}
.segmented__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2));
  transform: translateX(calc(100% * var(--i, 0)));
  border-radius: 9px; background: var(--lime);
  transition: transform 420ms var(--spring);
}
.segmented--sm { margin-bottom: 12px; }
.segmented button {
  position: relative; z-index: 1; height: 40px;
  color: var(--muted); font-weight: 600; font-size: 14px;
  transition: color 220ms var(--ease);
}
.segmented button[aria-checked="true"] { color: var(--lime-ink); }

.fit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fit-opt {
  min-width: 0; padding: 10px 6px; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--fill); border: 1px solid var(--stroke-hi);
  transition: background 220ms var(--ease), border-color 220ms var(--ease), transform 160ms var(--ease);
}
.fit-opt:active { transform: skewX(-4deg) scale(0.96); }
.fit-opt[aria-checked="true"] { background: var(--lime-12); border-color: var(--lime); }
.fit-opt__box { width: 100%; height: 96px; display: grid; place-items: center; }
.fit-opt__frame {
  position: relative; overflow: hidden; width: var(--dst-w, 54px); height: var(--dst-h, 96px);
  border-radius: 6px; background: #1b1e1d; border: 1px solid var(--stroke-hi);
  transition: border-color 200ms var(--ease), width 320ms var(--ease), height 320ms var(--ease);
}
.fit-opt__frame--src { width: var(--src-w, 76px); height: var(--src-h, 43px); }
.fit-opt[aria-checked="true"] .fit-opt__frame { border-color: var(--lime); }
.fit-opt__img, .fit-opt__bg { position: absolute; inset: 0; background: var(--thumb, none) center / cover no-repeat; }
.fit-opt__frame--blur .fit-opt__bg { inset: -8px; filter: blur(6px) brightness(0.75); }
.fit-opt__frame--blur .fit-opt__img {
  inset: auto; left: 50%; top: 50%; width: var(--in-w, 54px); height: var(--in-h, 30px);
  transform: translate(-50%, -50%); transition: width 320ms var(--ease), height 320ms var(--ease);
}
.fit-opt__label { max-width: 100%; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fit-opt[aria-checked="true"] .fit-opt__label { color: var(--lime); }

/* Вес: оценка качества */
.estimate { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: var(--r-md); background: var(--well); }
.estimate__text { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.estimate__text b { color: var(--text); font-weight: 600; }
.meter { display: flex; gap: 3px; flex: none; align-items: flex-end; height: 22px; }
.meter i { width: 5px; border-radius: 1px; background: var(--fill-hi); transform: skewX(-12deg); transition: background 260ms var(--ease); }
.meter i:nth-child(1) { height: 7px; } .meter i:nth-child(2) { height: 12px; } .meter i:nth-child(3) { height: 17px; } .meter i:nth-child(4) { height: 22px; }
.meter[data-level="1"] i:nth-child(-n+1),
.meter[data-level="2"] i:nth-child(-n+2),
.meter[data-level="3"] i:nth-child(-n+3),
.meter[data-level="4"] i:nth-child(-n+4) { background: var(--lime); }
.meter[data-level="1"] i:nth-child(1) { background: var(--danger); }

.preset-note { margin: -2px 6px 0; color: var(--faint); font-size: 12.5px; text-align: center; }
.preset-note button { color: var(--lime); font-weight: 600; font-size: 12.5px; padding: 12px 4px; }

/* ---------- нижняя панель ---------- */

.dock-spacer { flex: 1; min-height: 96px; }
.dock {
  position: fixed; z-index: 20; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100vw);
  display: flex; gap: 8px;
  padding: 18px 14px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, rgba(5, 6, 6, 0), rgba(5, 6, 6, 0.92) 34%);
}
@keyframes dock-in { from { opacity: 0; transform: translate3d(-50%, 100%, 0); } to { opacity: 1; transform: translate3d(-50%, 0, 0); } }
.dock--stack .btn { flex: 1; }

.bar-btn {
  position: relative; overflow: hidden; flex: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px; padding: 0 20px; border-radius: 14px;
  background: var(--lime); color: var(--lime-ink); text-align: left;
  box-shadow: 5px 5px 0 rgba(203, 249, 74, 0.22);
  transition: transform 160ms var(--ease), background 260ms var(--ease);
}
.bar-btn:active:not(:disabled) { transform: translate3d(2px, 2px, 0); }
.bar-btn__label { font-size: 23px; line-height: 1; }
.bar-btn__sum { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.bar-btn__size { font-size: 21px; font-variant-numeric: tabular-nums; }
.bar-btn__meta { max-width: 170px; font-size: 12px; font-weight: 600; opacity: 0.72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-btn.is-loading .bar-btn__sum { display: none; }
.bar-btn.is-loading .spinner { display: block; }
.dock.is-warn .bar-btn { background: #ffb4a3; box-shadow: 5px 5px 0 rgba(255, 138, 120, 0.25); }

/* ---------- обработка ---------- */

.ring-wrap { position: relative; width: 208px; height: 208px; margin: 14px auto 0; }
.ring-wrap::before {
  content: ""; position: absolute; inset: 22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(203, 249, 74, 0.2), transparent 70%);
  filter: blur(18px); animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.14); opacity: 0.55; } }
.ring-wrap__wave { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--lime); opacity: 0; pointer-events: none; }
.ring-wrap[data-state="done"] .ring-wrap__wave { animation: wave 900ms var(--ease) 200ms backwards; }
@keyframes wave { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(1.7); opacity: 0; } }
.ring { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring__track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 10; }
.ring__bar {
  fill: none; stroke: url(#ring-grad); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 540.35; stroke-dashoffset: 540.35;
  filter: drop-shadow(0 0 8px rgba(203, 249, 74, 0.5));
  transition: stroke-dashoffset 700ms var(--ease), stroke 300ms;
}
.ring-wrap[data-indeterminate] .ring { animation: spin 1.4s linear infinite; }
.ring-wrap[data-indeterminate] .ring__bar { stroke-dashoffset: 400 !important; }
.ring__check, .ring__cross {
  fill: none; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 120; stroke-dashoffset: 120; transform: rotate(90deg); transform-origin: 100px 100px;
}
.ring__check { stroke: var(--lime); }
.ring__cross { stroke: var(--danger); }
.ring__center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.ring__value { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring__value::after { content: "%"; font-size: 20px; margin-left: 2px; color: var(--muted); }
.ring__value.is-text::after { content: none; }
.ring__value.is-text { font-size: 26px; }
.ring__label { margin-top: 8px; color: var(--muted); font-size: 13px; }

.ring-wrap[data-state="done"] .ring__bar { stroke-dashoffset: 0 !important; }
.ring-wrap[data-state="done"] .ring__check { animation: draw 560ms var(--ease) 240ms forwards; }
.ring-wrap[data-state="error"] .ring__bar,
.ring-wrap[data-state="cancelled"] .ring__bar { stroke: var(--danger); filter: none; stroke-dashoffset: 0 !important; opacity: 0.35; }
.ring-wrap[data-state="error"] .ring__cross,
.ring-wrap[data-state="cancelled"] .ring__cross { animation: draw 420ms var(--ease) 120ms forwards; }
.ring-wrap:not([data-state="running"]) .ring__center { opacity: 0; transform: scale(0.85); }
.ring-wrap:not([data-state="running"]) .ring { animation: none; }
.ring-wrap[data-state="done"] { animation: pop 640ms var(--spring); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 40% { transform: scale(1.06); } }

.task-title { margin: 8px 0 0; text-align: center; font-size: 28px; line-height: 1; }
.task-detail { margin: -4px 0 0; min-height: 20px; text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.task-detail.is-error { color: var(--danger); }

.steps { list-style: none; margin: 4px 0 0; padding: 6px 16px; counter-reset: step; }
.step { display: flex; align-items: center; gap: 12px; min-height: 50px; color: var(--faint); counter-increment: step; transition: color 300ms var(--ease); }
.step + .step { border-top: 1px solid var(--stroke); }
.step::before {
  content: "0" counter(step); width: 34px; flex: none;
  font: italic 900 22px/1 var(--font-display);
  color: transparent; -webkit-text-stroke: 1.1px rgba(203, 249, 74, 0.6);
}
.step__dot {
  order: 3; width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--stroke-hi);
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
}
.step__dot svg { opacity: 0; transform: scale(0.4); transition: opacity 260ms var(--ease), transform 420ms var(--spring); }
.step__name { flex: 1; font-weight: 600; }
.step__pct { font-size: 13px; font-variant-numeric: tabular-nums; }
.step.is-active { color: var(--text); }
.step.is-active .step__dot { border-color: var(--lime); animation: pulse 1.6s ease-in-out infinite; }
.step.is-done { color: var(--muted); }
.step.is-done .step__dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.step.is-done .step__dot svg { opacity: 1; transform: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(203, 249, 74, 0.12); } 50% { box-shadow: 0 0 0 8px rgba(203, 249, 74, 0); } }

.task-note { margin: 0; text-align: center; color: var(--faint); font-size: 13px; padding: 0 12px; }

/* ---------- лист и тост ---------- */

.sheet { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.sheet__overlay { position: absolute; inset: 0; background: rgba(5, 6, 6, 0.6); opacity: 0; transition: opacity 280ms var(--ease); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet__panel {
  position: absolute; left: 50%; bottom: 0;
  width: min(520px, 100%); transform: translate3d(-50%, 105%, 0);
  max-height: 82vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 8px 16px calc(var(--safe-bottom) + 18px);
  border-radius: 24px 24px 0 0; border-bottom: 0;
  background: linear-gradient(180deg, rgba(36, 39, 38, 0.86), rgba(14, 16, 16, 0.96));
  transition: transform 460ms var(--ease);
}
.sheet.is-open { pointer-events: auto; }
.sheet.is-open .sheet__overlay { opacity: 1; }
.sheet.is-open .sheet__panel { transform: translate3d(-50%, 0, 0); }
.sheet__grip { width: 100%; height: 24px; display: grid; place-items: center; cursor: pointer; }
.sheet__grip::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--stroke-hi); }
.sheet__title { margin: 4px 4px 14px; font-size: 22px; line-height: 1.05; }
.sheet__body { display: flex; flex-direction: column; gap: 10px; }
.sheet__text { margin: -6px 4px 4px; color: var(--muted); font-size: 14px; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 12px;
  border-radius: var(--r-md); background: var(--fill); border: 1px solid var(--stroke); text-align: left;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.sheet-item:active { transform: scale(0.985); background: var(--fill-hi); }
.sheet-item__num { width: 34px; flex: none; font: italic 900 24px/1 var(--font-display); color: transparent; -webkit-text-stroke: 1.2px rgba(203, 249, 74, 0.7); }
.sheet-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-item__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item__meta { color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; z-index: 50; left: 50%; top: calc(var(--safe-top) + 12px);
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; line-height: 1.35;
  background: rgba(24, 27, 26, 0.88); border: 1px solid var(--stroke-hi);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  transform: translate3d(-50%, -140%, 0); opacity: 0;
  transition: transform 460ms var(--spring), opacity 260ms var(--ease);
  pointer-events: none;
}
.toast.is-shown { transform: translate3d(-50%, 0, 0); opacity: 1; }
.toast[data-tone="error"] [data-icon] { color: var(--danger); }
.toast [data-icon] { color: var(--lime); display: grid; }

/* ---------- иконки ---------- */

[data-icon] svg { width: 20px; height: 20px; display: block; }
.tile[data-icon] svg { width: 19px; height: 19px; }
.icon-btn--sm [data-icon] svg { width: 18px; height: 18px; }
.media__play svg { width: 18px; height: 18px; margin-left: 2px; }

/* ---------- скелетоны ---------- */

.shimmer {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- заставка и вход ---------- */

.splash { flex: 1; display: grid; place-items: center; min-height: 70dvh; }
.splash__mark { width: 96px; height: auto; animation: splash 1.6s ease-in-out infinite; }
@keyframes splash { 50% { transform: scale(1.06); opacity: 0.7; } }

.gate { display: flex; flex-direction: column; gap: 12px; padding: clamp(120px, 26vh, 220px) 4px 4px; }
.gate--outside { padding-top: clamp(220px, 40vh, 320px); }
.gate__title { margin: 0; font-size: 48px; line-height: 0.94; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.gate__title span { color: var(--lime); }
.gate__lead { margin: 0; color: var(--muted); max-width: 32ch; }

.request-card { display: flex; flex-direction: column; gap: 12px; }
.request-card__status { display: flex; align-items: center; gap: 12px; }
.request-card__text { display: flex; flex-direction: column; min-width: 0; }
.request-card__title { font-weight: 600; }
.request-card__sub { color: var(--muted); font-size: 13.5px; }
.request-card__sub:empty { display: none; }
.request-card:has(> .btn:only-child) { padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.request-card .btn { width: 100%; }

@media (min-width: 560px) {
  .screen { padding-top: calc(var(--safe-top) + 28px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .backdrop__mark img, .backdrop__caustic, .ticker__track, .outline__row { animation: none !important; }
}
