/* Модуль «Телефония»: «жизнь одного звонка» и особенности мини-виджетами.
   Разметка — resources/views/site/modules/telephony.blade.php, сценарий — telephony.js */
.tlx, .tlf {
    --call: #0b7487; --call-soft: #e2f3f6; --call-ink: #064652;
    --c-cl: #34d1bf; --c-op: #6e9bff; --c-ai: #a58bff;
    --deep: #06171b; --deep-2: #0c2228; --deep-line: rgba(255, 255, 255, .08); --deep-ink: #e4f1f2; --deep-mut: #8eaaae;
    --ce: cubic-bezier(.2, .7, .2, 1);
    --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}
.tlx-head { max-width: 800px; }
.tlx-head .lead { margin-top: 18px; }

/* ── Пульт ── */
.tlx-console {
    position: relative; margin-top: 40px; padding: 22px; border-radius: 22px; color: var(--deep-ink); overflow: hidden; isolation: isolate; user-select: none;
    background: radial-gradient(700px 300px at 0% 0%, rgba(52, 209, 191, .22), transparent 70%), radial-gradient(700px 360px at 100% 100%, rgba(110, 155, 255, .22), transparent 70%), var(--deep);
    box-shadow: 0 30px 80px rgba(6, 23, 27, .25);
}
.tlx-console::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(90deg, var(--deep-line) 0 1px, transparent 1px 40px); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); opacity: .5; }
.tlx.is-fast .tlx-console *, .tlx.is-fast .tlx-console *::before, .tlx.is-fast .tlx-console *::after { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; }

.tlx-top { display: flex; align-items: center; gap: 12px; }
.tlx-src-i { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(52, 209, 191, .14); color: var(--c-cl); flex: none; }
.tlx-src { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tlx-src b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlx-src small { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--deep-mut); }
.tlx-lang { display: inline-flex; align-items: center; gap: 5px; }
.tlx-lang i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.tlx-timer { margin-left: auto; font: 600 22px/1 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; color: #fff; }
.tlx-st { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, .08); color: var(--deep-ink); transition: background .3s, color .3s; }
.tlx-st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tlx-st[data-s='ring'], .tlx-st[data-s='queue'] { background: rgba(255, 190, 80, .16); color: #ffcf7a; }
.tlx-st[data-s='ring'] i, .tlx-st[data-s='queue'] i, .tlx-st[data-s='talk'] i, .tlx-st[data-s='stt'] i, .tlx-st[data-s='ai'] i { animation: tlx-blink 1s ease-in-out infinite; }
.tlx-st[data-s='talk'] { background: rgba(255, 92, 92, .16); color: #ff9a9a; }
.tlx-st[data-s='miss'] { background: rgba(255, 92, 92, .16); color: #ff9a9a; }
.tlx-st[data-s='rec'], .tlx-st[data-s='stt'] { background: rgba(110, 155, 255, .18); color: #a8c2ff; }
.tlx-st[data-s='ai'] { background: rgba(165, 139, 255, .2); color: #cdbdff; }
.tlx-st[data-s='done'] { background: rgba(52, 209, 191, .18); color: #7eeadc; }
@keyframes tlx-blink { 50% { opacity: .25; } }

/* Маршрут */
.tlx-route { display: flex; align-items: center; margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--deep-line); min-height: 64px; }
.tlx-node { display: flex; align-items: center; gap: 8px; flex: none; max-width: 240px; opacity: .38; transition: opacity .35s; }
.tlx-node > span { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--deep-ink); flex: none; transition: background .3s, color .3s; }
.tlx-node b { font-size: 13px; font-weight: 500; line-height: 1.25; }
.tlx-node.is-on, .tlx-node.is-done, .tlx-node.is-miss { opacity: 1; }
.tlx-node.is-on > span { background: var(--c-cl); color: var(--deep); }
.tlx-node.is-on > span::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c-cl); animation: tlx-ring 1.2s ease-out infinite; }
@keyframes tlx-ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.tlx-node.is-done > span { background: rgba(52, 209, 191, .18); color: var(--c-cl); }
.tlx-node.is-miss > span { background: rgba(255, 92, 92, .18); color: #ff9a9a; }
.tlx-node.is-miss b { color: #ffb0b0; }
.tlx-wire { position: relative; flex: 1; min-width: 24px; height: 2px; margin: 0 12px; background: rgba(255, 255, 255, .1); border-radius: 2px; overflow: hidden; }
.tlx-wire i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--c-cl), var(--c-op)); transform-origin: left; transform: scaleX(0); transition: transform .7s var(--ce); }
.tlx-wire.is-on i { transform: none; }
.tlx-wire.is-on::after { content: ''; position: absolute; top: -2px; width: 18px; height: 6px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px #fff; animation: tlx-pkt 1.4s linear infinite; }
@keyframes tlx-pkt { from { left: -18px; } to { left: 100%; } }

.tlx-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; margin-top: 18px; }
.tlx-left { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* Волна */
.tlx-wave { position: relative; height: 178px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--deep-line); overflow: hidden; }
.tlx-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tlx-lane-l { position: absolute; left: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(6, 23, 27, .75); color: var(--c); transition: box-shadow .3s; }
.tlx-lane-l[data-lane='0'] { top: 10px; }
.tlx-lane-l[data-lane='1'] { bottom: 10px; }
.tlx-lane-l em { font: 600 10.5px/1 var(--mono); font-style: normal; opacity: .75; }
.tlx-lane-l.is-speak { box-shadow: 0 0 0 1px var(--c), 0 0 16px -2px var(--c); }
.tlx-recb { position: absolute; right: 12px; top: 10px; display: inline-flex; align-items: center; gap: 5px; font: 700 11px/1 var(--mono); letter-spacing: .06em; color: #ff8a8a; opacity: 0; transition: opacity .3s; }
.tlx-recb i { width: 8px; height: 8px; border-radius: 50%; background: #ff5c5c; animation: tlx-blink 1s infinite; }
.tlx-wave.is-live .tlx-recb { opacity: 1; }
.tlx-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: #fff; box-shadow: 0 0 12px #fff; opacity: 0; }
.tlx-wave.is-scan .tlx-playhead { opacity: 1; animation: tlx-sweep 2.6s linear forwards; }
@keyframes tlx-sweep { from { left: 0; } to { left: 100%; } }

/* Субтитры / расшифровка */
.tlx-caps { display: flex; flex-direction: column; height: 268px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--deep-line); overflow: hidden; }
.tlx-caps-h { padding: 10px 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--deep-mut); border-bottom: 1px solid var(--deep-line); flex: none; }
.tlx-caps-b { position: relative; flex: 1; min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 36px); mask-image: linear-gradient(transparent, #000 36px); }
.tlx-caps-in { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 9px; }
.tlx-caps-e { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; font-size: 14px; color: var(--deep-mut); }
.tlx-ln { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; animation: tlx-in .4s var(--ce) both; }
@keyframes tlx-in { from { opacity: 0; transform: translateY(8px); } }
.tlx-ln > span { justify-self: start; height: 20px; padding: 0 7px; border-radius: 6px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.tlx-ln p { font-size: 14px; line-height: 1.42; color: #fff; }
.tlx-ln p small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--deep-mut); animation: tlx-in .4s var(--ce) both; }
.tlx-ln p small::before { content: '↳ '; color: var(--c); }
.tlx-ln p small em { font: 600 10.5px/1 var(--mono); font-style: normal; color: var(--c); margin-right: 5px; }
.tlx-ln.is-cur p::after { content: ''; display: inline-block; width: 7px; height: 14px; margin-left: 3px; vertical-align: -2px; background: var(--c); animation: tlx-blink .8s steps(1) infinite; }
.tlx-ev { align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #7eeadc; background: rgba(52, 209, 191, .14); animation: tlx-in .4s var(--ce) both; }

/* Правая панель */
.tlx-side { position: relative; min-width: 0; height: 460px; border-radius: 14px; background: #fff; color: var(--ink); overflow: hidden; }
.tlx-pane { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 16px; animation: tlx-pane .5s var(--ce) both; }
@keyframes tlx-pane { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.tlx-pane-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.tlx-pane-h .i { color: var(--call); }
/* экран у трубки */
.tlx-screen { flex: 1; display: flex; flex-direction: column; border-radius: 16px; padding: 16px; background: #0b0c10; color: #fff; box-shadow: inset 0 0 0 6px #1c1d24; }
.tlx-sc-face { flex: 1; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #3a4a6a, #12151f 70%); color: rgba(255, 255, 255, .55); position: relative; }
.tlx-sc-face > span:first-child { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.tlx-sc-face > span:first-child .i { width: 30px; height: 30px; }
.tlx-sc-face em { position: absolute; left: 8px; top: 8px; font-size: 11px; font-style: normal; padding: 3px 7px; border-radius: 5px; background: rgba(0, 0, 0, .45); }
.tlx-sc-text { min-height: 92px; margin-top: 12px; }
.tlx-sc-text p { font-size: 16px; line-height: 1.38; font-weight: 500; animation: tlx-in .4s var(--ce) both; }
.tlx-sc-text small { display: block; margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .5); }
.tlx-sc-hint { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; color: #9fe9de; min-height: 42px; }
.tlx-sc-hint i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: tlx-blink 1.2s infinite; }
.tlx-sc-hint[data-h='2'] { color: #ffd38a; }
.tlx-sc-open { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #22a35a; color: #fff; animation: tlx-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tlx-pop { from { opacity: 0; transform: scale(.6); } }
/* звонок из чата */
.tlx-chat { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tlx-chat-who { display: flex; align-items: center; gap: 10px; }
.tlx-chat-who > span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: hsl(200 70% 92%); color: hsl(200 45% 32%); font-weight: 600; font-size: 13px; }
.tlx-chat-who b { display: block; font-size: 15px; }
.tlx-chat-who small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #1c8f4e; }
.tlx-chat-last { padding: 10px 12px; border-radius: 12px; border-bottom-left-radius: 4px; background: var(--panel); font-size: 13.5px; }
.tlx-chat-last small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.tlx-chat-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 500; transition: background .3s, transform .15s; }
.tlx-chat-btn.is-press { transform: scale(.96); background: var(--call); }
.tlx-chat-btn.is-live { background: var(--call); }
.tlx-chat-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tlx-chat-steps div { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-card); font-size: 13px; opacity: .45; transition: opacity .3s, border-color .3s, background .3s; }
.tlx-chat-steps div > span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--chip); color: var(--ink-2); flex: none; }
.tlx-chat-steps div.is-on { opacity: 1; border-color: var(--call); background: var(--call-soft); }
.tlx-chat-steps div.is-on > span { background: var(--call); color: #fff; }
.tlx-chat-note { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
/* вопросы звонка ИИ */
.tlx-q { display: flex; flex-direction: column; gap: 8px; }
.tlx-q > div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-card); }
.tlx-q small { display: block; font-size: 12px; color: var(--muted); }
.tlx-q b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--ph); font-weight: 500; }
.tlx-q > div.is-ans { border-color: #d9d0fb; background: #fbfaff; }
.tlx-q > div.is-ans b { color: var(--ink); font-weight: 600; animation: tlx-in .4s var(--ce) both; }
.tlx-q > div.is-ans small { color: #6a4fd0; }
.tlx-q-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tlx-q-meta div { padding: 8px 10px; border-radius: 10px; background: var(--panel); font-size: 12px; color: var(--muted); }
.tlx-q-meta b { display: block; font-size: 14px; color: var(--ink); }
.tlx-branch { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 600; animation: tlx-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.tlx-branch small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
/* карточка ИИ */
.tlx-card { display: flex; flex-direction: column; gap: 10px; }
.tlx-card-r { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; animation: tlx-in .4s var(--ce) both; }
.tlx-card-r > small { padding-top: 3px; font-size: 12px; color: var(--muted); }
.tlx-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--call-soft); color: var(--call-ink); }
.tlx-chip.is-ok { background: var(--ok-soft); color: var(--ok); }
.tlx-chip.is-none { background: var(--chip); color: var(--muted); font-weight: 500; }
.tlx-chip.is-bad { background: var(--bad-soft); color: var(--bad); }
.tlx-sc { display: grid; grid-template-columns: 1fr; gap: 3px; }
.tlx-sc span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlx-sc span i { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; font-style: normal; flex: none; background: var(--chip); color: var(--faint); }
.tlx-sc span i .i { width: 10px; height: 10px; }
.tlx-sc span.is-ok i { background: var(--ok-soft); color: var(--ok); animation: tlx-pop .4s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--k) * .12s); }
.tlx-sc-pct { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tlx-sc-pct i { flex: 1; height: 5px; border-radius: 3px; background: var(--row); overflow: hidden; }
.tlx-sc-pct i i { display: block; height: 100%; width: var(--p); background: var(--call); border-radius: inherit; animation: tlx-grow 1s var(--ce) both; }
@keyframes tlx-grow { from { width: 0; } }
.tlx-sc-pct b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tlx-sum { padding: 10px 12px; border-radius: 10px; background: var(--panel); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.tlx-sum::after { content: ''; display: inline-block; width: 6px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--call); animation: tlx-blink .8s steps(1) infinite; }
.tlx-sum.is-done::after { display: none; }
.tlx-card-ai { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 11.5px; color: #6a4fd0; }

/* Управление */
.tlx-ctl { display: flex; align-items: stretch; gap: 14px; margin-top: 14px; }
.tlx-tabs { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tlx-tab { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--line-card); background: #fff; transition: border-color .2s, box-shadow .2s; }
.tlx-tab:hover { border-color: #b9dfe5; }
.tlx-tab[aria-selected='true'] { border-color: var(--call); box-shadow: 0 8px 24px rgba(11, 116, 135, .14); }
.tlx-tab-i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--call-soft); color: var(--call); flex: none; }
.tlx-tab[aria-selected='true'] .tlx-tab-i { background: var(--call); color: #fff; }
.tlx-tab-t { min-width: 0; display: flex; flex-direction: column; }
.tlx-tab-t b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlx-tab-t small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlx-tab-bar { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--row); overflow: hidden; font-style: normal; }
.tlx-tab-bar i { display: block; height: 100%; background: var(--call); transform-origin: left; transform: scaleX(0); }
.tlx-btns { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

/* ── Особенности ── */
.tlf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.tlf-card { border: 1px solid var(--line-card); border-radius: 18px; background: #fff; overflow: hidden; padding-bottom: 22px; }
.tlf-wide { grid-column: span 2; }
.tlf-full { grid-column: 1 / -1; }
.tlf-card h3 { display: flex; align-items: center; gap: 8px; margin: 20px 22px 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.tlf-card h3 .i { color: var(--call); }
.tlf-card > p { margin: 0 22px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); max-width: 680px; }
.tlf-vis { position: relative; height: 240px; padding: 20px; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f2fafb, #fbfdfd); }
.tlf-vis::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; pointer-events: none; opacity: .5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='60' viewBox='0 0 240 60'%3E%3Cpath d='M0 30 Q 10 6 20 30 T 40 30 T 60 30 Q 70 14 80 30 T 100 30 Q 110 2 120 30 T 140 30 T 160 30 Q 170 18 180 30 T 200 30 Q 210 8 220 30 T 240 30' fill='none' stroke='%230b7487' stroke-opacity='.18' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x 0 0 / 240px 60px; }
.tlf.is-on .tlf-vis::before { animation: tlf-wave 6s linear infinite; }
@keyframes tlf-wave { to { background-position: -240px 0; } }
.tlf .tlf-vis *, .tlf .tlf-vis *::before, .tlf .tlf-vis *::after { animation-play-state: paused; }
.tlf.is-on .tlf-vis *, .tlf.is-on .tlf-vis *::before, .tlf.is-on .tlf-vis *::after { animation-play-state: running; }

/* очередь */
.tlf-queue .tlf-vis { display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; align-items: center; gap: 0; padding-inline: 24px; }
.tlf-q-srcs { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.tlf-q-src { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 10px; background: #fff; border: 1px solid var(--line-card); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tlf-src 8s ease-in-out infinite; animation-delay: calc(var(--k) * 2s); }
.tlf-q-src i { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--call-soft); color: var(--call); flex: none; font-style: normal; }
@keyframes tlf-src { 0%, 2% { border-color: var(--line-card); } 4%, 14% { border-color: var(--call); box-shadow: 0 0 0 4px rgba(11, 116, 135, .1); } 4%, 6%, 8%, 10% { transform: translateX(0); } 5%, 9% { transform: translateX(2px); } 18%, 100% { border-color: var(--line-card); box-shadow: none; } }
.tlf-q-bus { position: relative; height: 188px; }
.tlf-q-wire { position: absolute; left: 0; right: 50%; height: 2px; top: calc(19px + var(--k) * 48px); background: #cfe5e8; font-style: normal; }
.tlf-q-wire::after { content: ''; position: absolute; right: 0; top: 0; width: 2px; height: calc((94px - (19px + var(--k) * 48px))); background: #cfe5e8; }
.tlf-q-wire:nth-child(n+3)::after { top: auto; bottom: 0; height: calc((19px + var(--k) * 48px) - 94px); }
.tlf-q-wire b { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--call); opacity: 0; box-shadow: 0 0 8px var(--call); animation: tlf-pkt 8s linear infinite; animation-delay: calc(var(--k) * 2s); }
@keyframes tlf-pkt { 0%, 4% { left: 0; opacity: 0; } 6% { opacity: 1; } 16% { left: calc(100% - 8px); opacity: 1; } 18%, 100% { left: calc(100% - 8px); opacity: 0; } }
.tlf-q-trunk { position: absolute; left: 50%; right: 0; top: 93px; height: 2px; background: var(--call); }
.tlf-q-op { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line-card); box-shadow: 0 10px 28px rgba(6, 70, 82, .1); text-align: center; }
.tlf-q-ava { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--call); color: #fff; animation: tlf-glow 2s ease-out infinite; }
@keyframes tlf-glow { 0% { box-shadow: 0 0 0 0 rgba(11, 116, 135, .35); } 100% { box-shadow: 0 0 0 14px rgba(11, 116, 135, 0); } }
.tlf-q-op b { font-size: 13.5px; }
.tlf-q-slots { display: flex; gap: 4px; }
.tlf-q-slots i { width: 22px; height: 6px; border-radius: 3px; background: var(--call); animation: tlf-slot 8s steps(1) infinite; animation-delay: calc(var(--k) * 2s + .9s); }
@keyframes tlf-slot { 0% { background: var(--call); } 50%, 100% { background: #d7ebee; } }
.tlf-q-op small { font-size: 12px; color: var(--muted); }
.tlf-q-op small span { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* в один клик */
.tlf-click .tlf-vis { display: flex; flex-direction: column; justify-content: center; gap: 0; }
.tlf-c-step { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line-card); animation: tlf-step 6s ease-in-out infinite; }
.tlf-c-step.is-2 { animation-name: tlf-step2; }
.tlf-c-step > span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--call-soft); color: var(--call); flex: none; }
.tlf-c-step b { display: block; font-size: 13.5px; }
.tlf-c-step small { display: block; font-size: 12px; color: var(--muted); }
@keyframes tlf-step { 0%, 4% { border-color: var(--line-card); } 8%, 42% { border-color: var(--call); box-shadow: 0 6px 18px rgba(11, 116, 135, .14); } 46%, 100% { border-color: var(--line-card); box-shadow: none; } }
@keyframes tlf-step2 { 0%, 50% { border-color: var(--line-card); } 54%, 92% { border-color: var(--call); box-shadow: 0 6px 18px rgba(11, 116, 135, .14); } 96%, 100% { border-color: var(--line-card); box-shadow: none; } }
.tlf-c-step.is-1 > span { animation: tlf-shake 6s ease-in-out infinite; }
.tlf-c-step.is-2 > span { animation: tlf-shake 6s ease-in-out infinite; animation-delay: 2.76s; }
@keyframes tlf-shake { 0%, 8%, 30%, 100% { transform: none; } 10%, 14%, 18%, 22%, 26% { transform: rotate(-12deg); } 12%, 16%, 20%, 24%, 28% { transform: rotate(12deg); } }
.tlf-c-line { position: relative; width: 2px; height: 32px; margin-left: 31px; background: repeating-linear-gradient(var(--call) 0 4px, transparent 4px 8px); font-style: normal; }

/* темы */
.tlf-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; height: 100%; }
.tlf-chips span { height: 28px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 999px; background: #fff; border: 1px solid var(--line-card); font-size: 12.5px; white-space: nowrap; animation: tlf-chip 12s ease-in-out infinite; animation-delay: calc(var(--k) * 1s); }
.tlf-chips span.is-more { color: var(--muted); border-style: dashed; animation: none; }
@keyframes tlf-chip { 0%, 1% { background: #fff; color: var(--ink); border-color: var(--line-card); } 3%, 8% { background: var(--call); color: #fff; border-color: var(--call); transform: scale(1.05); } 11%, 100% { background: #fff; color: var(--ink); border-color: var(--line-card); transform: none; } }

/* флаги */
.tlf-flags .tlf-vis { display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.tlf-fl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 11px; background: #fff; border: 1px solid var(--line-card); font-size: 13px; }
.tlf-fl-row > span { color: var(--call); display: grid; }
.tlf-fl-row em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.tlf-fl-row.is-flag { border-color: #f0c9c9; background: #fffafa; animation: tlf-flag 7s var(--ce) infinite; }
@keyframes tlf-flag { 0%, 20% { border-color: var(--line-card); background: #fff; } 26%, 100% { border-color: #f0c9c9; background: #fffafa; } }
.tlf-fl-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; font-style: normal; background: var(--bad-soft); color: var(--bad); animation: tlf-flagchip 7s var(--ce) infinite; }
@keyframes tlf-flagchip { 0%, 22% { opacity: 0; transform: scale(.6); } 28%, 100% { opacity: 1; transform: none; } }
.tlf-fl-bin { display: flex; align-items: center; gap: 7px; margin-top: 4px; padding: 9px 12px; border-radius: 11px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }
.tlf-fl-bin b { margin-left: auto; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: var(--warn); color: #fff; font-size: 12px; animation: tlf-bump 7s var(--ce) infinite; }
@keyframes tlf-bump { 0%, 30% { transform: none; } 34% { transform: scale(1.3); } 40%, 100% { transform: none; } }

/* скрипт */
.tlf-script .tlf-vis { display: flex; align-items: center; gap: 18px; }
.tlf-ring { position: relative; width: 108px; height: 108px; flex: none; }
.tlf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tlf-ring circle { fill: none; stroke: #dceef1; stroke-width: 10; }
.tlf-ring circle.v { stroke: var(--call); stroke-linecap: round; stroke-dasharray: var(--p) 100; }
.tlf.is-on .tlf-ring circle.v { animation: tlf-ring 2s var(--ce) both; }
@keyframes tlf-ring { from { stroke-dasharray: 0 100; } }
.tlf-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.tlf-sc-list { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tlf-sc-list li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlf-sc-list li i { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-style: normal; background: var(--ok-soft); color: var(--ok); flex: none; }
.tlf-sc-list li.is-no i { background: var(--bad-soft); color: var(--bad); }
.tlf.is-on .tlf-sc-list li i { animation: tlf-tick 1s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(.3s + var(--k) * .25s); }
@keyframes tlf-tick { from { transform: scale(0); } }

/* поиск */
.tlf-search .tlf-vis { display: flex; flex-direction: column; gap: 8px; }
.tlf-s-in { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1.5px solid var(--call); color: var(--muted); }
.tlf-s-q { display: inline-block; overflow: hidden; white-space: nowrap; color: var(--ink); font-size: 14px; border-right: 2px solid var(--call); padding-right: 1px; width: calc(var(--n) * 1ch + 3px); font-family: var(--mono); }
.tlf.is-on .tlf-s-q { animation: tlf-type 6s steps(9) infinite; }
@keyframes tlf-type { 0% { width: 0; } 35%, 100% { width: calc(var(--n) * 1ch + 3px); } }
.tlf-s-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.tlf-s-chips span { height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--call-soft); color: var(--call-ink); font-size: 11.5px; font-weight: 600; }
.tlf-s-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line-card); font-size: 12.5px; }
.tlf.is-on .tlf-s-row { animation: tlf-row 6s var(--ce) infinite; animation-delay: calc(var(--k) * .15s); }
@keyframes tlf-row { 0%, 30% { opacity: 0; transform: translateY(6px); } 38%, 100% { opacity: 1; transform: none; } }
.tlf-s-row time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tlf-s-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlf-s-row mark { background: #fff0b3; color: inherit; border-radius: 3px; padding: 0 1px; }
.tlf-s-row em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; color: var(--call); font-variant-numeric: tabular-nums; }

/* отчёт */
.tlf-report .tlf-vis { display: flex; align-items: center; padding-inline: 24px; }
.tlf-r-t { width: 100%; background: #fff; border: 1px solid var(--line-card); border-radius: 12px; overflow: hidden; font-size: 13px; }
.tlf-r-h, .tlf-r-r { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) 80px 80px 80px; gap: 10px; align-items: center; padding: 8px 14px; }
.tlf-r-h { font-size: 11.5px; color: var(--muted); background: var(--hover-soft); border-bottom: 1px solid var(--line); }
.tlf-r-r { border-bottom: 1px solid var(--row); }
.tlf-r-r:last-child { border-bottom: 0; }
.tlf-r-r > span:first-child { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlf-r-r > span:first-child .i { color: var(--call); }
.tlf-r-r > span { font-variant-numeric: tabular-nums; }
.tlf-r-bar { display: flex; align-items: center; gap: 8px; }
.tlf-r-bar > i { flex: 1; height: 6px; border-radius: 3px; background: var(--row); overflow: hidden; font-style: normal; }
.tlf-r-bar > i i { display: block; height: 100%; width: var(--a); background: linear-gradient(90deg, #34d1bf, var(--call)); border-radius: inherit; }
.tlf.is-on .tlf-r-bar > i i { animation: tlf-grow 1.2s var(--ce) both; animation-delay: calc(var(--k) * .12s); }
@keyframes tlf-grow { from { width: 0; } }
.tlf-r-bar b { font-weight: 600; width: 36px; text-align: right; }
.tlf-r-r .is-bad { color: var(--bad); font-weight: 600; }
.tlf-r-rep { display: flex; gap: 3px; align-items: center; color: var(--faint); }
.tlf-r-rep i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* перевод */
.tlf-translate .tlf-vis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; height: 260px; padding-inline: 28px; }
.tlf-t-pick small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.tlf-t-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.tlf-t-langs span { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; background: #fff; border: 1px solid var(--line-card); font-size: 14px; font-weight: 500; transition: background .3s, color .3s, border-color .3s; }
.tlf-t-langs span.is-on { background: var(--call); border-color: var(--call); color: #fff; box-shadow: 0 6px 16px rgba(11, 116, 135, .25); }
.tlf-t-langs span.is-search { color: var(--muted); border-style: dashed; font-weight: 400; }
.tlf-t-screen { position: relative; height: 196px; border-radius: 18px; background: #0b0c10; box-shadow: inset 0 0 0 7px #1c1d24, 0 20px 40px rgba(6, 23, 27, .2); padding: 20px 22px; color: #fff; overflow: hidden; }
.tlf-t-screen > small { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(255, 255, 255, .45); }
.tlf-t-msg { position: absolute; left: 22px; right: 22px; top: 46px; bottom: 18px; display: flex; flex-direction: column; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s var(--ce); }
.tlf-t-msg.is-on { opacity: 1; transform: none; }
.tlf-t-msg p { font-size: 17px; line-height: 1.4; font-weight: 500; }
.tlf-t-msg span { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9fe9de; }
.tlf-t-msg span i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: tlx-blink 1.2s infinite; }

/* ── Адаптив ── */
@media (max-width: 1279px) {
    .tlx-main { grid-template-columns: minmax(0, 1fr) 300px; }
    .tlx-node b { font-size: 12px; }
    .tlf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tlf-wide, .tlf-full { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
    .tlx-main { grid-template-columns: 1fr; }
    .tlx-side { height: 400px; }
    .tlx-ctl { flex-direction: column; }
    .tlx-btns { flex-direction: row; justify-content: flex-end; }
}
@media (max-width: 767px) {
    .tlx-console { padding: 14px; margin-inline: -8px; border-radius: 18px; }
    .tlx-src-i { width: 36px; height: 36px; }
    .tlx-src b { font-size: 14px; }
    .tlx-timer { font-size: 16px; }
    .tlx-top { flex-wrap: wrap; }
    .tlx-st { order: 5; }
    .tlx-route { overflow-x: auto; scrollbar-width: none; padding: 10px; }
    .tlx-route::-webkit-scrollbar { display: none; }
    .tlx-node b { display: none; }
    .tlx-node.is-on b { display: block; max-width: 130px; }
    .tlx-wave { height: 140px; }
    .tlx-caps { height: 250px; }
    .tlx-ln { grid-template-columns: 1fr; gap: 3px; }
    .tlx-side { height: auto; min-height: 380px; }
    .tlx-pane { position: relative; inset: auto; min-height: 380px; }
    .tlx-tabs { grid-template-columns: 1fr; }
    .tlx-btns { justify-content: center; }
    .tlf-grid { grid-template-columns: 1fr; }
    .tlf-queue .tlf-vis { grid-template-columns: minmax(0, 1fr) 128px; padding-inline: 16px; gap: 10px; }
    .tlf-q-bus { display: none; }
    .tlf-q-op { padding: 12px 8px; }
    .tlf-report .tlf-vis { padding-inline: 12px; height: auto; }
    .tlf-r-h, .tlf-r-r { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px 44px; gap: 6px; padding: 7px 10px; font-size: 12px; }
    .tlf-r-h span:last-child, .tlf-r-r > span:last-child { display: none; }
    .tlf-r-bar > i { display: none; }
    .tlf-translate .tlf-vis { grid-template-columns: 1fr; height: auto; gap: 18px; padding-inline: 16px; }
    .tlf-t-screen { height: 200px; }
    .tlf-script .tlf-vis { gap: 12px; padding-inline: 14px; }
    .tlf-ring { width: 88px; height: 88px; }
}
.tlf-r-h span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
