/* ==========================================================================
   НадзорАссистент (клиенты + незарегистрированные) и АдминАссистент
   (только админка). Волны-оверлей на всю ширину низа экрана, центральный
   текст-статус, полный чат с черновиком. Самодостаточный слой стилей.
   ========================================================================== */

:root {
    --na-green: #1fa45c;
    --na-green-2: #2fc46f;
    --na-green-deep: #128a48;
    --na-green-tint: #e9f7ef;
    --na-green-line: #cdebda;
    --na-blue: #3a7ccd;
    --na-blue-2: #5b9ae8;
    --na-blue-deep: #2b5fa8;
    --na-blue-tint: #e9f2ff;
    --na-blue-line: #cfe2fb;
    --na-navy: #0b2036;
    --na-navy-2: #102b48;
    --na-ink: #13283f;
    --na-muted: #7a8697;
    --na-faint: #a5afbd;
    --na-bg: #f6f8fa;
    --na-line: #e7ebf0;
    --na-user-bg: #e9f2ff;
    --na-user-line: #cfe2fb;
    --na-user-ink: #14395f;
    --na-danger: #ee4444;
    --na-accent: var(--na-green);
    --na-accent-2: var(--na-green-2);
    --na-accent-deep: var(--na-green-deep);
    --na-accent-tint: var(--na-green-tint);
    --na-accent-line: var(--na-green-line);
    --na-shadow-fab: 0 10px 28px rgba(4, 22, 44, 0.38), 0 2px 8px rgba(4, 22, 44, 0.28);
    --na-shadow-win: 0 34px 90px rgba(3, 18, 36, 0.38), 0 10px 28px rgba(3, 18, 36, 0.24);
    --na-ease-spring: cubic-bezier(0.24, 1.28, 0.36, 1);
    --na-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --na-motion-fluid: 560ms;
    --na-dock-h: 264px;
}

/* скоуп АдминАссистента — фирменный синий */
.na-scope-admin {
    --na-accent: var(--na-blue);
    --na-accent-2: var(--na-blue-2);
    --na-accent-deep: var(--na-blue-deep);
    --na-accent-tint: var(--na-blue-tint);
    --na-accent-line: var(--na-blue-line);
}

/* ==========================================================================
   1. Плавающая кнопка (FAB)
   ========================================================================== */

.na-fab {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 95000;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 120% at 30% 22%, var(--na-navy-2) 0%, var(--na-navy) 62%);
    box-shadow: var(--na-shadow-fab), 0 0 0 0 rgba(31, 164, 92, 0);
    opacity: 0;
    transform: translateY(18px) scale(0.6);
    pointer-events: none;
    transition:
        opacity 0.34s var(--na-ease-out),
        transform 0.5s var(--na-ease-spring),
        box-shadow 0.3s var(--na-ease-out),
        background 0.3s var(--na-ease-out);
    -webkit-tap-highlight-color: transparent;
}

.na-fab--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.na-fab:hover {
    transform: translateY(-2px) scale(1.05);
}

.na-fab:active {
    transform: translateY(0) scale(0.94);
}

.na-fab:focus-visible {
    outline: 3px solid rgba(47, 196, 111, 0.65);
    outline-offset: 3px;
}

.na-fab__logo {
    width: 34px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.4s var(--na-ease-spring);
}

.na-fab:hover .na-fab__logo {
    transform: scale(1.08);
}

.na-fab--visible.na-fab--idle {
    animation: na-fab-glow 3.4s ease-in-out infinite;
}

@keyframes na-fab-glow {
    0%, 100% { box-shadow: var(--na-shadow-fab), 0 0 0 5px var(--na-accent-tint); }
    50% { box-shadow: var(--na-shadow-fab), 0 0 0 11px transparent; }
}

.na-fab--listening::before,
.na-fab--processing::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid var(--na-accent-2);
    animation: na-fab-ring 1.6s var(--na-ease-out) infinite;
    pointer-events: none;
}

.na-fab--processing::before {
    border-style: dashed;
    animation: na-fab-spin 2.6s linear infinite, na-fab-ring 2.2s ease-out infinite;
}

@keyframes na-fab-ring {
    0% { transform: scale(0.92); opacity: 0.9; }
    100% { transform: scale(1.42); opacity: 0; }
}

@keyframes na-fab-spin {
    to { transform: rotate(360deg); }
}

.na-fab--unread::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--na-danger);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(238, 68, 68, 0.55);
    animation: na-unread-pop 0.45s var(--na-ease-spring) both;
}

@keyframes na-unread-pop {
    0% { transform: scale(0); }
    70% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.na-tooltip {
    position: absolute;
    right: 84px;
    bottom: 8px;
    max-width: 300px;
    background: var(--na-navy);
    color: #fff;
    border-radius: 16px;
    padding: 14px 16px 15px;
    box-shadow: 0 18px 44px rgba(3, 18, 36, 0.4);
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: opacity 0.25s var(--na-ease-out), transform 0.3s var(--na-ease-spring);
    z-index: 1;
}

.na-fab-wrap:hover .na-tooltip,
.na-fab-wrap:focus-within .na-tooltip,
.na-tooltip.na-tooltip--forced {
    opacity: 1;
    transform: translateX(0);
}

.na-tooltip::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 24px;
    width: 14px;
    height: 14px;
    background: var(--na-navy);
    transform: rotate(45deg);
    border-radius: 3px;
}

.na-tooltip__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    margin: 0 0 5px;
}

.na-tooltip__title i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--na-accent-2);
    box-shadow: 0 0 8px var(--na-accent-2);
    flex: none;
}

.na-tooltip__text {
    margin: 0;
    font-size: 12.8px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

.na-fab-wrap {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 95000;
    pointer-events: none;
}

.na-fab-wrap .na-fab {
    position: absolute;
    right: 26px;
    bottom: 26px;
}

/* ==========================================================================
   2. Оверлей ассистента: тёмный блюр на весь экран, крупное блеклое лого,
   волны внизу, push-to-talk + клавиатура, пилюля и мини-версия (жидкое стекло)
   ========================================================================== */

.na-ovl {
    position: fixed;
    inset: 0;
    z-index: 96000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.42s var(--na-ease-out), visibility 0s linear 0.42s;
}

.na-ovl--open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* тёмный блюр на весь экран */
.na-ovl__bg {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 20, 0.62);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    border: 0;
    padding: 0;
    cursor: default;
}

/* крупное блеклое лого по центру фона */
.na-ovl__brandlogo {
    position: absolute;
    left: 50%;
    top: 47%;
    width: min(92vmin, 900px);
    transform: translate(-50%, -50%) scale(1.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.9s var(--na-ease-out) 0.12s, transform 1.5s var(--na-ease-spring) 0.12s;
}

.na-ovl--open .na-ovl__brandlogo {
    opacity: 0.08;
    transform: translate(-50%, -50%) scale(1);
}

.na-ovl__brandlogo img {
    width: 100%;
    display: block;
    filter: blur(1.2px) drop-shadow(0 0 80px rgba(91, 154, 232, 0.22));
}

/* --- шапка: левый верхний угол --- */

.na-ovl__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    color: #fff;
    z-index: 5;
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.4s var(--na-ease-out) 0.16s, transform 0.6s var(--na-ease-spring) 0.16s;
}

.na-ovl--open .na-ovl__topbar {
    opacity: 1;
    transform: translateY(0);
}

.na-ovl__topbar img.na-ovl__toplogo {
    width: 34px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.na-ovl__top-title {
    min-width: 0;
    margin-right: auto;
}

.na-ovl__top-title strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.na-ovl__top-title small {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.na-ovl__topbar .na-win-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.na-ovl__topbar .na-win-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateY(-1px);
}

.na-ovl__topbar .na-win-btn:active {
    transform: scale(0.9);
}

/* --- центральный текст --- */

.na-ovl__stage {
    position: absolute;
    left: 50%;
    top: 34%;
    bottom: 330px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 12px;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    z-index: 3;
    max-height: 40vh;
}

.na-ovl__stage > :first-child { margin-top: auto; }
.na-ovl__stage:hover,
.na-ovl__stage:focus-visible { scrollbar-color: var(--na-faint) transparent; }
.na-ovl__stage::-webkit-scrollbar { width: 0.2rem; }
.na-ovl__stage::-webkit-scrollbar-thumb { background: transparent; border-radius: 1rem; }
.na-ovl__stage:hover::-webkit-scrollbar-thumb,
.na-ovl__stage:focus-visible::-webkit-scrollbar-thumb { background: var(--na-faint); }
.na-ovl__stage:focus-visible { outline: thin solid var(--na-blue-2); outline-offset: 0.2rem; }

.na-line {
    flex: none;
    width: 100%;
    font-size: 15px;
    line-height: 1.55;
    color: var(--na-muted);
    opacity: 0.6;
    transition: opacity 0.4s var(--na-ease-out), font-size 0.3s var(--na-ease-out);
    overflow-wrap: break-word;
}

.na-line--current {
    font-size: clamp(20px, 2.6vw, 28px);
    line-height: 1.4;
    font-weight: 700;
    color: #fff;
    opacity: 1;
    text-shadow: 0 2px 26px rgba(58, 124, 205, 0.5);
}

.na-line--agent { color: #fff; }

.na-line--user {
    color: var(--na-blue-2);
    font-style: italic;
}

.na-line--current.na-line--user {
    color: #bfd9ff;
    text-shadow: 0 2px 22px rgba(58, 124, 205, 0.55);
}

.na-line--status { color: #cfe2fb; }

.na-line--current.na-line--status {
    color: #dcebff;
    font-weight: 600;
}

.na-line--error,
.na-line--current.na-line--error {
    color: #ff8f8f;
    text-shadow: 0 2px 22px rgba(238, 68, 68, 0.4);
}

/* слова с пружинным появлением */
.na-w {
    display: inline-block;
    white-space: pre-wrap;
    animation: na-word-in 0.65s var(--na-ease-spring) both;
    animation-delay: calc(var(--i) * 46ms);
}

@keyframes na-word-in {
    0% { opacity: 0; transform: translateY(14px) scale(0.9); filter: blur(5px); }
    60% { transform: translateY(-2px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.na-line--pulse {
    animation: na-line-pulse 0.3s var(--na-ease-out);
}

@keyframes na-line-pulse {
    0% { transform: scale(0.98); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.na-caret {
    display: inline-block;
    width: 2.5px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -0.12em;
    background: var(--na-accent-2);
    border-radius: 2px;
    animation: na-caret-blink 1.05s steps(1) infinite;
}

@keyframes na-caret-blink {
    0%, 55% { opacity: 1; }
    56%, 100% { opacity: 0.15; }
}

.na-dots {
    display: inline-flex;
    gap: 5px;
    margin-left: 10px;
    vertical-align: middle;
}

.na-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    animation: na-dot 1.2s ease-in-out infinite;
}

.na-dots i:nth-child(2) { animation-delay: 0.15s; }
.na-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes na-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* --- две круглые кнопки: микрофон (push-to-talk) + клавиатура --- */

.na-ovl__controls {
    position: absolute;
    left: 50%;
    bottom: 210px;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 22px;
    opacity: 0;
    translate: 0 26px;
    transition: opacity 0.3s var(--na-ease-out), translate 0.3s var(--na-ease-out);
}

.na-ovl--open .na-ovl__controls {
    opacity: 1;
    translate: 0 0;
    transition:
        opacity 0.45s var(--na-ease-out) 0.28s,
        translate 0.7s var(--na-ease-spring) 0.28s;
}

.na-ovl__controls[data-mode="text"] {
    opacity: 0;
    translate: 0 18px;
    pointer-events: none;
    transition: opacity 0.24s var(--na-ease-out), translate 0.3s var(--na-ease-out);
}

.na-ctl-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 60%);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    color: #fff;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        inset 0 -1px 2px rgba(255, 255, 255, 0.08),
        0 18px 44px rgba(2, 10, 24, 0.5);
    transition: transform 0.35s var(--na-ease-spring), background 0.25s var(--na-ease-out), box-shadow 0.3s var(--na-ease-out);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.na-ctl-btn svg { width: 28px; height: 28px; }

.na-ctl-btn:hover { transform: translateY(-3px) scale(1.04); }

.na-ctl-btn:active { transform: scale(0.94); }

.na-ctl-btn--mic.na-ovl__mic--on {
    background: linear-gradient(150deg, var(--na-accent-2) 0%, var(--na-accent-deep) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    animation: na-mic-pulse 1.8s ease-out infinite;
    transform: scale(1.08);
}

@keyframes na-mic-pulse {
    0% { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 0 rgba(91, 154, 232, 0.45), 0 18px 44px rgba(2, 10, 24, 0.5); }
    70% { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 22px rgba(91, 154, 232, 0), 0 18px 44px rgba(2, 10, 24, 0.5); }
    100% { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 0 0 0 rgba(91, 154, 232, 0), 0 18px 44px rgba(2, 10, 24, 0.5); }
}

/* --- строка ввода (морф из кнопок) --- */

.na-ovl__composer {
    position: absolute;
    left: 50%;
    bottom: 210px;
    transform: translateX(-50%) scale(0.6);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(640px, calc(100vw - 44px));
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 60%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    padding: 7px 7px 7px 20px;
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 18px 50px rgba(2, 10, 24, 0.45);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.24s var(--na-ease-out),
        transform 0.55s var(--na-ease-spring),
        background 0.25s var(--na-ease-out);
}

.na-ovl__controls[data-mode="text"] ~ .na-ovl__composer,
.na-ovl[data-input="text"] .na-ovl__composer {
}

.na-ovl__controls[data-mode="text"] + .na-ovl__composer {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
    transition:
        opacity 0.3s var(--na-ease-out) 0.1s,
        transform 0.6s var(--na-ease-spring) 0.08s,
        background 0.25s var(--na-ease-out);
}

/* фокус: без рамки — зелёный текст */
.na-ovl__composer input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    padding: 10px 4px;
    text-overflow: ellipsis;
    transition: color 0.25s var(--na-ease-out);
}

.na-ovl__composer input::placeholder { color: rgba(255, 255, 255, 0.45); transition: color 0.25s var(--na-ease-out); }

.na-ovl__composer:focus-within input { color: var(--na-accent-2); }
.na-ovl__composer input:focus,
.na-ovl__composer input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
}
.na-ovl__composer:focus-within input::placeholder { color: color-mix(in srgb, var(--na-accent-2) 65%, transparent); }

.na-ovl__send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    flex: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--na-accent-2), var(--na-accent-deep));
    color: #fff;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--na-accent) 45%, transparent);
    transition: transform 0.3s var(--na-ease-spring), box-shadow 0.25s var(--na-ease-out), opacity 0.2s var(--na-ease-out);
}

.na-ovl__send svg { width: 19px; height: 19px; }

.na-ovl__send:disabled { opacity: 0.45; cursor: default; pointer-events: none; }

.na-ovl__send:active { transform: scale(0.9); }

/* сообщение «улетает» вверх */
.na-fly {
    position: fixed;
    z-index: 96600;
    transform: translate(-50%, 0);
    font-size: 15px;
    font-weight: 700;
    color: #dcebff;
    text-shadow: 0 2px 22px rgba(58, 124, 205, 0.6);
    pointer-events: none;
    transition: transform 0.7s var(--na-ease-spring), opacity 0.65s var(--na-ease-out);
    max-width: 60vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- волны: прижаты к самому низу --- */

.na-ovl__waves-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 240px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(2, 7, 18, 0) 0%, rgba(2, 7, 18, 0.42) 62%, rgba(2, 7, 18, 0.66) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s var(--na-ease-out) 0.2s;
}

.na-ovl--open .na-ovl__waves-zone {
    opacity: 1;
}

.na-ovl__waves {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* статус-подпись слева над волнами */
.na-ovl__wave-cap {
    position: absolute;
    left: 28px;
    bottom: 196px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.6px;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.62);
    pointer-events: none;
    transition: color 0.3s var(--na-ease-out), opacity 0.3s var(--na-ease-out);
    white-space: nowrap;
}

.na-ovl__wave-cap i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--na-faint);
    transition: background 0.3s var(--na-ease-out), box-shadow 0.3s var(--na-ease-out);
}

.na-ovl__wave-cap--live {
    color: rgba(255, 255, 255, 0.78);
}

.na-ovl__wave-cap--live i {
    background: var(--na-accent-2);
    box-shadow: 0 0 10px var(--na-accent-2);
    animation: na-dot 1.2s ease-in-out infinite;
}

.na-ovl__wave-cap--err {
    color: #ff9d9d;
}

.na-ovl__wave-cap--err i {
    background: var(--na-danger);
    box-shadow: 0 0 10px rgba(238, 68, 68, 0.8);
}

/* --- сворачивание --- */

.na-ovl--min .na-ovl__stage,
.na-ovl--min .na-ovl__controls,
.na-ovl--min .na-ovl__composer,
.na-ovl--min .na-ovl__topbar,
.na-ovl--min .na-ovl__brandlogo {
    opacity: 0;
    transition: opacity 0.26s var(--na-ease-out);
}

.na-ovl--min .na-ovl__controls { translate: 0 30px; }
.na-ovl--min .na-ovl__composer { transform: translateX(-50%) scale(0.6); }

.na-ovl--min .na-ovl__bg {
    opacity: 0;
    transition: opacity 0.34s var(--na-ease-out) 0.08s;
}

.na-ovl--min .na-ovl__waves-zone {
    opacity: 0;
    transition: opacity 0.34s var(--na-ease-out) 0.1s;
}

.na-ovl--min .na-ovl__waves,
.na-ovl--min .na-ovl__wave-cap {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.3s var(--na-ease-out) 0.06s, transform 0.42s var(--na-ease-out) 0.06s;
}

/* --- пилюля: жидкое стекло, iOS-стайл --- */

.na-pill {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 95000;
    width: 88px;
    height: 88px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.2) 0%, rgba(120, 165, 230, 0.1) 45%, rgba(255, 255, 255, 0.04) 100%),
        rgba(14, 30, 56, 0.35);
    backdrop-filter: blur(26px) saturate(1.7);
    -webkit-backdrop-filter: blur(26px) saturate(1.7);
    box-shadow:
        inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
        inset 0 -1px 2px rgba(255, 255, 255, 0.12),
        inset 0 0 24px rgba(120, 170, 240, 0.12),
        0 22px 55px rgba(2, 10, 24, 0.55);
    opacity: 0;
    transform: scale(0.4) translateY(26px);
    pointer-events: none;
    transition: transform 0.6s var(--na-ease-spring), opacity 0.32s var(--na-ease-out), box-shadow 0.3s var(--na-ease-out);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.na-pill--visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    animation: na-pill-breathe 4.6s ease-in-out infinite;
}

@keyframes na-pill-breathe {
    0%, 100% { box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.45), inset 0 -1px 2px rgba(255, 255, 255, 0.12), inset 0 0 24px rgba(120, 170, 240, 0.12), 0 22px 55px rgba(2, 10, 24, 0.55); }
    50% { box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.45), inset 0 -1px 2px rgba(255, 255, 255, 0.12), inset 0 0 34px rgba(120, 170, 240, 0.22), 0 22px 60px rgba(2, 10, 24, 0.6); }
}

.na-pill:hover {
    transform: scale(1.06);
    cursor: grab;
}

.na-pill:active { transform: scale(0.94); cursor: grabbing; }

.na-pill img {
    width: 46px;
    height: 46px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

/* стеклянный блик сверху */
.na-pill::before {
    content: "";
    position: absolute;
    left: 10%;
    right: 22%;
    top: 7%;
    height: 34%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

/* зелёный индикатор жизни */
.na-pill::after {
    content: "";
    position: absolute;
    bottom: 8px;
    right: 12px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--na-accent-2);
    box-shadow: 0 0 10px var(--na-accent-2);
}

.na-pill--mic .na-pill--dot::after,
.na-pill.na-pill--mic::after {
    animation: na-dot 1.1s ease-in-out infinite;
}

/* --- мини-версия (жидкое стекло) --- */

.na-mini-backdrop {
    position: fixed;
    inset: 0;
    z-index: 95499;
    border: 0;
    background: color-mix(in srgb, var(--na-navy) 12%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--na-motion-fluid) var(--na-ease-out);
}
.na-mini-backdrop--visible { opacity: 1; pointer-events: auto; }

.na-mini {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%) translateY(30px) scale(0.7);
    z-index: 95500;
    width: min(380px, calc(100vw - 32px));
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 55%),
        rgba(10, 22, 44, 0.55);
    backdrop-filter: blur(28px) saturate(1.7);
    -webkit-backdrop-filter: blur(28px) saturate(1.7);
    box-shadow:
        inset 0 1.5px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 30px 70px rgba(2, 10, 24, 0.6);
    padding: 10px 18px 16px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s var(--na-ease-spring), opacity 0.3s var(--na-ease-out);
    touch-action: auto;
    transform-origin: center bottom;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.na-mini--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

.na-mini__grab {
    width: 44px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 auto 10px;
    cursor: grab;
}

.na-mini__head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    flex: none;
}
.na-mini__grab, .na-mini__head, .na-mini__waves, .na-mini__foot { touch-action: none; }

.na-mini__head img {
    width: 26px;
    height: 26px;
    display: block;
}

.na-mini__title { flex: 1; min-width: 0; }

.na-mini__title strong {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.2;
}

.na-mini__title small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.na-mini__expand {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s var(--na-ease-spring), background 0.2s var(--na-ease-out);
}

.na-mini__expand:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.na-mini__expand svg { width: 17px; height: 17px; }

.na-mini__waves {
    width: 100%;
    height: 64px;
    display: block;
    margin: 6px 0 2px;
    flex: none;
}

.na-mini__text {
    min-height: 2.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    flex: 0 1 auto;
    font-size: 13.4px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.na-mini__text .na-line {
    display: inline;
    width: auto;
}

.na-mini__text b { font-weight: 700; color: #fff; }
.na-mini__text:hover, .na-mini__text:focus-visible { scrollbar-color: var(--na-faint) transparent; }
.na-mini__text::-webkit-scrollbar { width: 0.2rem; }
.na-mini__text::-webkit-scrollbar-thumb { background: transparent; border-radius: 1rem; }
.na-mini__text:hover::-webkit-scrollbar-thumb { background: var(--na-faint); }

.na-mini__foot {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
    flex: none;
}

.na-mini__composer {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    margin-top: 0.75rem;
}
.na-mini--typing .na-mini__composer { display: flex; }
.na-mini__composer input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--na-faint);
    border-radius: 1rem;
    background: var(--na-bg);
    color: var(--na-ink);
    font: inherit;
    padding: 0.7rem 0.9rem;
}
.na-mini__composer input:focus-visible { outline: 2px solid var(--na-accent-2); outline-offset: 2px; }
.na-mini__expand:focus-visible, .na-mini__mic:focus-visible, .na-mini__kb:focus-visible { outline: 2px solid var(--na-accent-2); outline-offset: 3px; }
.na-mini__expand:active { transform: scale(0.94); }
.na-mini__mic--on { background: var(--na-accent-deep); box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--na-accent) 25%, transparent); }
.na-mini__composer button:disabled { opacity: 0.5; cursor: wait; }

.na-ovl__actions {
    position: absolute;
    inset: 5rem 1.5rem 14rem;
    z-index: 3;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--na-bg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
}
.na-ovl__actions[hidden] { display: none; }
.na-ovl--tools .na-ovl__stage { visibility: hidden; }
.na-ovl__actions .btn {
    background: color-mix(in srgb, var(--na-navy) 65%, transparent);
    color: var(--na-bg);
    border: 1px solid var(--na-faint);
}
.na-ovl__actions .btn:focus-visible { outline: 2px solid var(--na-accent-2); outline-offset: 2px; }
.na-ovl__actions .btn:disabled { opacity: 0.5; cursor: wait; }
.na-ovl__actions .form-group, .na-action-result { max-width: 40rem; width: 100%; margin-inline: auto; }

.na-mini__mic,
.na-mini__kb {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: transform 0.3s var(--na-ease-spring), background 0.2s var(--na-ease-out);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.na-mini__kb { background: linear-gradient(145deg, var(--na-accent-2), var(--na-accent-deep)); border-color: transparent; }

.na-mini__mic:hover, .na-mini__kb:hover { transform: scale(1.06); }
.na-mini__mic:active, .na-mini__kb:active { transform: scale(0.92); }

.na-mini__mic svg, .na-mini__kb svg { width: 21px; height: 21px; }

/* ==========================================================================
   4. Тосты
   ========================================================================== */

.na-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 97000;
    transform: translateX(-50%) translateY(16px);
    background: var(--na-navy);
    color: #fff;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 13.4px;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(3, 18, 36, 0.4);
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 0;
    transition: opacity 0.3s var(--na-ease-out), transform 0.35s var(--na-ease-spring);
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.na-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.na-toast svg { width: 17px; height: 17px; color: var(--na-accent-2); flex: none; }

/* ==========================================================================
   5. Адаптив
   ========================================================================== */

@media (max-width: 1100px) {
    .na-full__body {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .na-draft {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 72%;
        border-left: 0;
        border-top: 1px solid var(--na-line);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -18px 50px rgba(3, 18, 36, 0.22);
        transform: translateY(104%);
        transition: transform 0.42s var(--na-ease-spring);
        z-index: 6;
    }

    .na-draft--open {
        transform: translateY(0);
    }

    .na-chip--draft {
        display: inline-flex;
    }

    .na-draft::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 4.5px;
        border-radius: 99px;
        background: #dbe2e9;
    }
}

@media (max-width: 760px) {
    :root {
        --na-dock-h: 236px;
    }

    .na-fab {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 58px;
        height: 58px;
    }

    .na-fab-wrap .na-fab {
        position: absolute;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .na-fab-wrap .na-tooltip,
    .na-tooltip { display: none; }

    .na-ovl__stage {
        top: auto;
        bottom: 252px;
        width: calc(100vw - 32px);
        max-height: 30vh;
    }

    .na-line--current { font-size: 17px; }
    .na-line { font-size: 13px; }

    .na-ovl__topbar { padding: 12px 14px; gap: 9px; }
    .na-ovl__topbar img.na-ovl__toplogo { width: 28px; height: 28px; }
    .na-ovl__top-title strong { font-size: 15px; }
    .na-ovl__top-title small { font-size: 10.8px; }
    .na-ovl__topbar .na-win-btn { width: 34px; height: 34px; }

    .na-ovl__brandlogo { width: 130vmin; top: 42%; }

    .na-ovl__controls { bottom: 158px; gap: 18px; }
    .na-ctl-btn { width: 66px; height: 66px; }
    .na-ctl-btn svg { width: 24px; height: 24px; }

    .na-ovl__composer {
        width: calc(100vw - 28px);
        bottom: 158px;
        padding-left: 16px;
    }

    .na-ovl__waves-zone { height: 150px; }
    .na-ovl__wave-cap { bottom: 118px; left: 18px; }

    .na-pill {
        right: 18px;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        width: 74px;
        height: 74px;
        border-radius: 27px;
    }

    .na-pill img { width: 38px; height: 38px; }

    .na-mini { bottom: 20px; }

    .na-full {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        transform: translateY(30px);
    }

    .na-full__head { padding: 10px 12px; }

    .na-chip--side {
        display: inline-flex;
    }

    .na-chip__txt { display: none; }
    .na-chip { padding: 8px 11px; }
    .na-win-btn--expand { display: none; }
    .na-full__head-actions { gap: 6px; }
    .na-full__brand { gap: 8px; margin-right: 6px; }

    .na-side {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(310px, 86vw);
        border-right: 0;
        box-shadow: 20px 0 60px rgba(3, 18, 36, 0.25);
        border-radius: 0 22px 22px 0;
        transform: translateX(-106%);
        transition: transform 0.4s var(--na-ease-spring);
        z-index: 6;
    }

    .na-side--open {
        transform: translateX(0);
    }

    .na-full__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .na-messages { padding: 16px 14px 10px; }

    .na-msg { max-width: 88%; }
    .na-msg--card { max-width: 94%; }

    .na-composer { padding-left: 10px; padding-right: 10px; gap: 7px; }
    .na-composer__mic, .na-composer__send { width: 41px; height: 41px; }
}

@media (max-width: 380px) {
    .na-line--current { font-size: 17px; }
    .na-ovl__mic, .na-ovl__send { width: 37px; height: 37px; }
}

/* ==========================================================================
   6. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .na-fab, .na-fab--visible.na-fab--idle,
    .na-fab--listening::before, .na-fab--processing::before,
    .na-ctl-btn--mic.na-ovl__mic--on, .na-pill--visible, .na-dots i, .na-caret,
    .na-draft__bar i::after,
    .na-draft__create.na-draft__create--ready {
        animation: none !important;
    }

    .na-w, .na-line, .na-msg, .na-card, .na-dialog,
    .na-ovl, .na-ovl__waves-zone, .na-ovl__composer, .na-ovl__topbar,
    .na-ovl__brandlogo, .na-ovl__controls, .na-pill, .na-mini, .na-mini-backdrop, .na-fly,
    .na-full, .na-side, .na-draft, .na-faq-pop {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
