/* ЭХО — дизайн-система */
@font-face { font-family: Unbounded; font-weight: 500; font-display: swap; src: url(/admin/fonts/unbounded-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: Unbounded; font-weight: 700; font-display: swap; src: url(/admin/fonts/unbounded-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: Unbounded; font-weight: 900; font-display: swap; src: url(/admin/fonts/unbounded-cyrillic-900-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: 500; font-display: swap; src: url(/admin/fonts/unbounded-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Unbounded; font-weight: 700; font-display: swap; src: url(/admin/fonts/unbounded-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Unbounded; font-weight: 900; font-display: swap; src: url(/admin/fonts/unbounded-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/admin/fonts/manrope-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: Manrope; font-weight: 600; font-display: swap; src: url(/admin/fonts/manrope-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: Manrope; font-weight: 800; font-display: swap; src: url(/admin/fonts/manrope-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/admin/fonts/manrope-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/admin/fonts/manrope-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/admin/fonts/manrope-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: Mono; font-weight: 500; font-display: swap; src: url(/admin/fonts/jetbrains-mono-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0400-045F; }
@font-face { font-family: Mono; font-weight: 500; font-display: swap; src: url(/admin/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #07060b; --bg2: #0d0b15; --bg3: #14111f;
  --panel: rgba(255, 255, 255, .035); --panel2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .085); --line2: rgba(255, 255, 255, .16);
  --ink: #f4f0ff; --muted: rgba(244, 240, 255, .56); --faint: rgba(244, 240, 255, .32);
  --voice: #c6ff3d; --ref: #ff3d8b; --violet: #7b5cff; --cyan: #59d6ff;
  --gold: #ffd23d; --silver: #d6dcef; --bronze: #ff9b5c; --danger: #ff4d5e;
  --grid: rgba(255, 255, 255, .06);
  --r: 22px; --r-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --display: Unbounded, 'Arial Black', sans-serif; --ui: Manrope, 'Segoe UI', sans-serif; --mono: Mono, Consolas, monospace;
  --cx: 50vw; --cy: 30vh;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 500 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--voice); color: #0b0a10; }
:focus-visible { outline: 2px solid var(--voice); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- фон: северное сияние, зерно, прожектор */
.aurora { position: fixed; inset: -20vmax; z-index: -3; pointer-events: none; filter: blur(70px) saturate(1.2); opacity: .9; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
.aurora i:nth-child(1) { width: 60vmax; height: 50vmax; left: 0; top: 4vmax; background: radial-gradient(closest-side, rgba(123, 92, 255, .55), transparent); }
.aurora i:nth-child(2) { width: 55vmax; height: 45vmax; right: 0; top: 0; background: radial-gradient(closest-side, rgba(255, 61, 139, .32), transparent); animation-duration: 31s; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 50vmax; height: 40vmax; left: 30vmax; bottom: 0; background: radial-gradient(closest-side, rgba(198, 255, 61, .14), transparent); animation-duration: 37s; animation-delay: -15s; }
.aurora i:nth-child(4) { width: 40vmax; height: 40vmax; left: 10vmax; bottom: 10vmax; background: radial-gradient(closest-side, rgba(89, 214, 255, .16), transparent); animation-duration: 43s; animation-delay: -4s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(8vmax, -5vmax, 0) scale(1.15) rotate(25deg); }
  100% { transform: translate3d(-6vmax, 6vmax, 0) scale(.92) rotate(-15deg); }
}
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }
.spot { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(600px circle at var(--cx) var(--cy), rgba(198, 255, 61, .06), transparent 60%); }
/* запись и финальный показ: фон замирает, чтобы видео и линия голоса шли без рывков */
.calm .aurora i, .calm .grain, .calm .eq i, .calm .marquee > div { animation-play-state: paused !important; }
.calm .grain { display: none; }
/* во время записи и показа ничего не перерисовывается каждый кадр: крутящаяся рамка кнопок и свет за мышью тоже стоят */
.calm .ring::before { animation: none !important; }
.calm .spot { display: none; }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55)); }

/* ---------- типографика */
.display { font-family: var(--display); font-weight: 900; letter-spacing: -.02em; line-height: .92; text-transform: uppercase; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.lime { color: var(--voice); } .pink { color: var(--ref); }
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; animation: chIn .7s var(--spring) both; }
@keyframes chIn { from { opacity: 0; transform: translateY(.6em) rotate(8deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.rise { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- логотип с эквалайзером */
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .04em; }
.brand small { font: 500 10px/1.2 var(--mono); letter-spacing: .16em; color: var(--muted); text-transform: uppercase; max-width: 90px; }
.eq { display: inline-flex; align-items: center; gap: 3px; height: 26px; }
.eq i { width: 4px; border-radius: 4px; background: linear-gradient(var(--voice), var(--ref)); animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: -.2s; } .eq i:nth-child(2) { height: 90%; animation-delay: -.5s; }
.eq i:nth-child(3) { height: 60%; animation-delay: -.1s; } .eq i:nth-child(4) { height: 100%; animation-delay: -.7s; }
.eq i:nth-child(5) { height: 50%; animation-delay: -.35s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- кнопки */
.btn { --bg: var(--panel2); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink);
  font: 800 14px/1 var(--ui); letter-spacing: .01em; cursor: pointer; white-space: nowrap; isolation: isolate;
  transition: transform .35s var(--spring), background .25s, border-color .25s, box-shadow .3s, opacity .2s; }
.btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 70%); }
.btn:hover::after { opacity: 1; }
.btn:hover { border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: scale(.96) !important; }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn .k { font: 500 10px/1 var(--mono); padding: 4px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .55; }
.btn-lg { height: 62px; padding: 0 32px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 12px; }
.btn-ghost { --bg: rgba(255, 255, 255, .02); }
.btn-lime { --bg: var(--voice); color: #0b0a10; border-color: transparent; box-shadow: 0 10px 40px -10px rgba(198, 255, 61, .55); }
.btn-pink { --bg: var(--ref); color: #fff; border-color: transparent; box-shadow: 0 10px 40px -10px rgba(255, 61, 139, .6); }
.btn-white { --bg: #fff; color: #0b0a10; border-color: transparent; }
.btn-danger { --bg: rgba(255, 77, 94, .12); border-color: rgba(255, 77, 94, .4); color: #ffb3bb; }
/* вращающееся кольцо свечения */
.ring::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; z-index: -2;
  background: conic-gradient(from var(--a, 0deg), transparent 0 60%, var(--voice), var(--ref), var(--violet), transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 3.2s linear infinite; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel); display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--spring), background .2s; }
.icon-btn:hover { background: var(--panel2); transform: rotate(8deg); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: recPulse 1.4s infinite; }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); } 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }

/* ---------- панели, поля */
.glass { background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); font: 600 12px/1 var(--ui); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--voice); box-shadow: 0 0 10px var(--voice); }
.chip.warn .dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.chip.bad .dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.field { display: grid; gap: 6px; }
.field > span { font: 600 12px/1.2 var(--ui); color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); outline: none; transition: border-color .2s, background .2s; }
.input:focus { border-color: var(--voice); background: rgba(0, 0, 0, .4); }
textarea.input { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 12px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: var(--bg3); }

/* ---------- модальные окна */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(4, 3, 8, .72); backdrop-filter: blur(10px); animation: fadeIn .3s both; }
.modal > .glass { width: min(560px, 100%); padding: 32px; animation: pop .5s var(--spring) both; max-height: calc(100vh - 48px); overflow: auto; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } }

/* ---------- тосты */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast { padding: 14px 18px; border-radius: 14px; background: rgba(20, 17, 31, .92); border: 1px solid var(--line2); backdrop-filter: blur(14px); max-width: 380px; animation: toastIn .45s var(--spring) both; box-shadow: 0 20px 50px -20px #000; }
.toast-ok { border-color: rgba(198, 255, 61, .45); } .toast-err { border-color: rgba(255, 77, 94, .55); }
.toast.out { animation: toastOut .4s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.confetti-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* ---------- бегущая строка */
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee > div { display: inline-flex; gap: 48px; animation: marq 28s linear infinite; padding-left: 48px; }
@keyframes marq { to { transform: translateX(-50%); } }

/* скроллбары */
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* диагностика показа (клавиша D) */
.diag { position: absolute; left: 12px; top: 12px; z-index: 5; display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .82); color: #fff; font: 500 12px/1.35 var(--mono, monospace); max-width: calc(100% - 24px); pointer-events: none; }
.diag b { color: var(--voice); margin-bottom: 4px; }
.diag div { display: flex; gap: 10px; } .diag span { color: rgba(255, 255, 255, .55); min-width: 190px; } .diag i { font-style: normal; }
.ico { display: inline-flex; line-height: 0; }
