/*
 * HOOUP Assistant Widget — Split View drawer с табами «Техподдержка» и «ИИ ассистент».
 * Основан на архитектуре NFS Auto (nfs-ai-assistant.css), адаптирован под HOOUP:
 *  - Десктоп (≥ 992px): панель и backdrop поверх контента, без padding-right
 *    у body (как offcanvas поиска #searchCanvas) — тело не сжимается.
 *  - < 992px — оверлей + backdrop, scroll-lock как раньше.
 *  - fullscreen — панель на всё окно
 */

:root {
    --hooup-aw-panel-width: clamp(380px, 32vw, 500px);
    --hooup-aw-top: 16px;
    --hooup-aw-bottom: 16px;
    --hooup-aw-gap: 16px;
    --hooup-aw-radius: 0px;
    --hooup-aw-border: #e5e5e5;
    --hooup-aw-border-strong: #000000;
    --hooup-aw-surface: #ffffff;
    --hooup-aw-surface-muted: #f7f7f7;
    --hooup-aw-text: #000000;
    --hooup-aw-text-muted: #6c6c6c;
    --hooup-aw-accent-rgb: 0, 0, 0;
    --hooup-aw-accent: rgb(var(--hooup-aw-accent-rgb));
    --hooup-aw-accent-soft: #f5f5f5;
    --hooup-aw-cta: #111111;
    --hooup-aw-cta-hover: #333333;
    --hooup-aw-user-bubble: #111111;
    --hooup-aw-user-text: #ffffff;
    --hooup-aw-ai-bubble: #ffffff;
    --hooup-aw-ai-text: #000000;
    --hooup-aw-fab-offcanvas-offset: 0px;
    --hooup-aw-z-panel: 1200;
    --hooup-aw-z-backdrop: 1190;
    --hooup-aw-z-fab: 1180;
}

/* Scroll-lock для мобильных и fullscreen */
body.hooup-assistant-scroll-locked {
    position: fixed;
    inset: 0;
    width: 100%;
    overflow: hidden;
}

/* (раньше transition padding-right на body для split view — больше не используем) */

/* При открытой панели гасим горизонтальный скролл у всей страницы,
   чтобы сжатый навбар/контент не создавали случайный x-скролл. */
body.hooup-assistant-open {
    overflow-x: hidden;
}

/* ============================================================
 * FAB — ч/б стиль (как у прежней кнопки .support-chat-fab)
 * ============================================================ */
.hooup-assistant-fab {
    position: fixed;
    right: calc(max(16px, env(safe-area-inset-right, 0px)) + var(--hooup-aw-fab-offcanvas-offset, 0px));
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #111;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    z-index: var(--hooup-aw-z-fab);
    transition: right 220ms ease, background 150ms ease, transform 150ms ease,
                box-shadow 150ms ease, opacity 180ms ease,
                visibility 0s linear 0s;
}

.hooup-assistant-fab:hover {
    background: #000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.hooup-assistant-fab:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

.hooup-assistant-fab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.hooup-assistant-fab svg {
    width: 26px;
    height: 26px;
}

/* Скрыть FAB, когда панель открыта */
body.hooup-assistant-open .hooup-assistant-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.88);
    transition: transform 200ms ease, opacity 180ms ease, visibility 0s linear 180ms;
}

/* ============================================================
 * Backdrop (при открытой панели, кроме fullscreen)
 * ============================================================ */
.hooup-assistant-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--hooup-aw-z-backdrop);
}

.hooup-assistant-backdrop[hidden] {
    display: none;
}

/* ============================================================
 * Панель (drawer)
 * ============================================================ */
.hooup-assistant-panel {
    position: fixed;
    top: var(--hooup-aw-top);
    right: var(--hooup-aw-gap);
    bottom: var(--hooup-aw-bottom);
    width: var(--hooup-aw-panel-width);
    max-width: calc(100vw - (var(--hooup-aw-gap) * 2));
    z-index: var(--hooup-aw-z-panel);
    display: flex;
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 260ms ease, opacity 220ms ease,
                visibility 220ms ease, top 260ms ease, bottom 260ms ease,
                right 260ms ease, width 260ms ease;
}

body.hooup-assistant-open .hooup-assistant-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hooup-assistant-panel__shell {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    background: var(--hooup-aw-surface);
    border: 1px solid var(--hooup-aw-border);
    border-radius: var(--hooup-aw-radius);
    box-shadow: none;
    overflow: hidden;
}

/* ============================================================
 * Шапка панели: табы + actions
 * ============================================================ */
.hooup-assistant-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 12px;
    border-bottom: 1px solid var(--hooup-aw-border);
    background: #fff;
}

.hooup-assistant-tabs {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    min-width: 0;
}

.hooup-assistant-tab {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--hooup-aw-border);
    background: #fff;
    color: var(--hooup-aw-text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 180ms ease, color 180ms ease,
                border-color 180ms ease;
}

.hooup-assistant-tab:hover {
    border-color: var(--hooup-aw-border-strong);
    color: var(--hooup-aw-text);
}

.hooup-assistant-tab.is-active {
    background: var(--hooup-aw-cta);
    border-color: var(--hooup-aw-border-strong);
    color: #fff;
    box-shadow: none;
}

.hooup-assistant-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hooup-assistant-tab__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.hooup-assistant-tab:focus-visible {
    outline: 1px solid var(--hooup-aw-border-strong);
    outline-offset: 0;
}

.hooup-assistant-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hooup-assistant-iconbtn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--hooup-aw-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.hooup-assistant-iconbtn:hover {
    background: var(--hooup-aw-surface-muted);
    color: var(--hooup-aw-text);
}

.hooup-assistant-iconbtn:focus-visible {
    outline: 1px solid var(--hooup-aw-border-strong);
    outline-offset: 0;
}

.hooup-assistant-iconbtn svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
 * Панели контента (одна активная за раз)
 * ============================================================ */
.hooup-assistant-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hooup-assistant-pane {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
}

.hooup-assistant-pane.is-active {
    display: flex;
}

/* Пэйн «Техподдержка» адаптирует встраиваемый support_messenger */
.hooup-assistant-pane--support {
    padding: 0;
}

.hooup-assistant-pane--support .support-messenger {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--hooup-aw-surface);
}

/* Прячем заголовок встроенного support-messenger — у нас свой таб */
.hooup-assistant-pane--support .support-messenger__head {
    display: none;
}

.hooup-assistant-pane--support .support-messenger__toolbar {
    flex-wrap: nowrap;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 24, 39, 0.28) transparent;
    padding-bottom: 2px;
}

.hooup-assistant-pane--support .support-messenger__toolbar::-webkit-scrollbar {
    height: 4px;
}

.hooup-assistant-pane--support .support-messenger__toolbar::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.22);
    border-radius: 999px;
}

.hooup-assistant-pane--support .support-messenger__tool--labeled {
    padding: 0 8px;
    gap: 4px;
}

.hooup-assistant-pane--support .support-messenger__tool {
    height: 30px;
    min-height: 30px;
}

.hooup-assistant-pane--support .support-messenger__tool-icon {
    width: 14px;
    height: 14px;
}

.hooup-assistant-pane--support .support-messenger__tool-text {
    font-size: 9px;
}

/* ============================================================
 * Пэйн «ИИ ассистент»
 * ============================================================ */
.hooup-assistant-pane--ai {
    background: var(--hooup-aw-surface);
    min-width: 0;
}

/* Корневой контейнер: main + sidebar (sidebar — drawer-оверлей) */
.hooup-assistant-ai {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hooup-assistant-ai__main {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Верхняя полоска main-части: кнопка меню + название чата */
.hooup-assistant-ai__topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hooup-aw-border);
    background: #fff;
    min-width: 0;
}

.hooup-assistant-ai__menu-toggle {
    flex-shrink: 0;
}

.hooup-assistant-ai__topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--hooup-aw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.hooup-assistant-ai__topbar-title-btn {
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: color 140ms ease, background 140ms ease;
}

.hooup-assistant-ai__topbar-title-btn:hover:not(:disabled) {
    color: var(--hooup-aw-text);
    background: var(--hooup-aw-surface-muted);
}

.hooup-assistant-ai__topbar-title-btn:disabled {
    cursor: default;
    opacity: 1;
}

.hooup-assistant-ai__topbar-title-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 1px var(--hooup-aw-border-strong) inset;
}

.hooup-assistant-ai__chat-rename {
    flex-shrink: 0;
}

/* ============================================================
 * Sidebar со списком чатов (drawer внутри панели)
 * ============================================================ */
.hooup-assistant-ai__sidebar {
    position: absolute;
    inset: 0 0 0 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    background: var(--hooup-aw-surface);
    transform: translateX(-102%);
    transition: transform 240ms ease;
    will-change: transform;
    min-width: 0;
}

.hooup-assistant-ai__sidebar.is-open {
    transform: translateX(0);
    box-shadow: none;
}

.hooup-assistant-ai__sidebar-topline {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    border-bottom: 1px solid var(--hooup-aw-border);
}

.hooup-assistant-ai__sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai__sidebar-brand svg {
    width: 18px;
    height: 18px;
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai__sidebar-brand strong {
    color: var(--hooup-aw-text);
    font-weight: 700;
}

.hooup-assistant-ai__sidebar-actions {
    flex-shrink: 0;
    padding: 12px 14px 8px;
}

.hooup-assistant-ai__new-chat {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    background: var(--hooup-aw-cta);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 160ms ease, transform 160ms ease;
}

.hooup-assistant-ai__new-chat:hover {
    background: var(--hooup-aw-cta-hover);
    filter: none;
}

.hooup-assistant-ai__new-chat:active {
    transform: translateY(1px);
}

.hooup-assistant-ai__new-chat svg {
    width: 16px;
    height: 16px;
}

.hooup-assistant-ai__sidebar-search {
    flex-shrink: 0;
    position: relative;
    padding: 2px 14px 10px;
}

.hooup-assistant-ai__sidebar-search svg {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-60%);
    width: 15px;
    height: 15px;
    color: var(--hooup-aw-text-muted);
    pointer-events: none;
}

.hooup-assistant-ai__sidebar-search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border-radius: 0;
    border: 1px solid var(--hooup-aw-border);
    background: var(--hooup-aw-surface-muted);
    color: var(--hooup-aw-text);
    font: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color 160ms ease, background 160ms ease;
    box-sizing: border-box;
}

.hooup-assistant-ai__sidebar-search-input:focus {
    background: #fff;
    border-color: var(--hooup-aw-border-strong);
}

.hooup-assistant-ai__sidebar-search-input::placeholder {
    color: var(--hooup-aw-text-muted);
}

.hooup-assistant-ai__chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hooup-assistant-ai__chat-list::-webkit-scrollbar {
    width: 6px;
}

.hooup-assistant-ai__chat-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 0;
}

.hooup-assistant-ai__chat-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hooup-assistant-ai__chat-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hooup-aw-text);
    padding: 6px 6px 2px;
}

.hooup-assistant-ai__chat-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: start;
    gap: 4px 8px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
    outline: none;
}

.hooup-assistant-ai__chat-item:hover {
    background: var(--hooup-aw-surface-muted);
    border-color: var(--hooup-aw-border);
}

.hooup-assistant-ai__chat-item.is-active {
    background: #fff;
    border-color: var(--hooup-aw-border-strong);
}

.hooup-assistant-ai__chat-item.is-active .hooup-assistant-ai__chat-item-title {
    color: var(--hooup-aw-text);
    font-weight: 600;
}

.hooup-assistant-ai__chat-item:focus-visible {
    box-shadow: 0 0 0 1px var(--hooup-aw-border-strong) inset;
}

.hooup-assistant-ai__chat-item-pin {
    grid-column: 1;
    grid-row: 1 / 3;
    color: var(--hooup-aw-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.hooup-assistant-ai__chat-item-pin svg {
    width: 12px;
    height: 12px;
}

.hooup-assistant-ai__chat-item:not(.is-pinned) .hooup-assistant-ai__chat-item-pin {
    visibility: hidden;
}

.hooup-assistant-ai__chat-item-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 13.5px;
    color: var(--hooup-aw-text);
    line-height: 1.35;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hooup-assistant-ai__chat-item-time {
    grid-column: 2;
    grid-row: 2;
    font-size: 11.5px;
    color: var(--hooup-aw-text-muted);
    margin-top: 2px;
}

.hooup-assistant-ai__chat-item-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 140ms ease;
}

.hooup-assistant-ai__chat-item:hover .hooup-assistant-ai__chat-item-actions,
.hooup-assistant-ai__chat-item:focus-within .hooup-assistant-ai__chat-item-actions {
    opacity: 1;
}

.hooup-assistant-ai__chat-action {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--hooup-aw-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hooup-assistant-ai__chat-action:hover {
    background: var(--hooup-aw-surface-muted);
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai__chat-action svg {
    width: 13px;
    height: 13px;
}

/* Диалог переименования чата */
.hooup-assistant-ai__rename {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.hooup-assistant-ai__rename[hidden] {
    display: none !important;
}

.hooup-assistant-ai__rename-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.hooup-assistant-ai__rename-card {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    padding: 18px 16px 14px;
    background: #fff;
    border: 1px solid var(--hooup-aw-border-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hooup-assistant-ai__rename-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai__rename-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--hooup-aw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hooup-assistant-ai__rename-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    padding: 9px 10px;
    font-size: 13.5px;
    color: var(--hooup-aw-text);
    background: #fff;
    outline: none;
}

.hooup-assistant-ai__rename-input:focus {
    border-color: var(--hooup-aw-text);
    box-shadow: 0 0 0 1px var(--hooup-aw-text) inset;
}

.hooup-assistant-ai__rename-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.hooup-assistant-ai__rename-btn {
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    background: #fff;
    color: var(--hooup-aw-text);
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hooup-assistant-ai__rename-btn:hover {
    background: var(--hooup-aw-surface-muted);
}

.hooup-assistant-ai__rename-btn--primary {
    background: var(--hooup-aw-text);
    color: #fff;
    border-color: var(--hooup-aw-text);
}

.hooup-assistant-ai__rename-btn--primary:hover {
    background: #000;
    border-color: #000;
}

.hooup-assistant-ai__sidebar-empty {
    flex: 0 0 auto;
    padding: 24px 18px;
    font-size: 13px;
    color: var(--hooup-aw-text-muted);
    text-align: center;
    line-height: 1.45;
}

.hooup-assistant-ai__sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--hooup-aw-border);
    padding: 10px 14px;
    background: #fff;
}

.hooup-assistant-ai__user {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.hooup-assistant-ai__user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 1px solid var(--hooup-aw-border-strong);
    background: #fff;
    color: var(--hooup-aw-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.hooup-assistant-ai__user-info {
    min-width: 0;
}

.hooup-assistant-ai__user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--hooup-aw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hooup-assistant-ai__user-email {
    font-size: 11.5px;
    color: var(--hooup-aw-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backdrop внутри пэйна — только когда sidebar открыт на узких экранах */
.hooup-assistant-ai__sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.hooup-assistant-ai__sidebar-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.hooup-assistant-ai-messages {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 16px 16px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.hooup-assistant-ai-messages:empty::before {
    content: "";
}

/* Вводный экран */
.hooup-assistant-ai-intro {
    padding: 10px 4px 4px;
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hooup-aw-text);
    padding: 4px 10px;
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    background: #fff;
    margin-bottom: 10px;
}

.hooup-assistant-ai-intro__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai-intro__body {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--hooup-aw-text-muted);
}

.hooup-assistant-ai-intro__body p {
    margin: 0 0 6px;
}

.hooup-assistant-ai-intro__body ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.hooup-assistant-ai-intro__body li {
    margin-bottom: 4px;
}

.hooup-assistant-ai-notice {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 0;
    background: #fff;
    border: 1px solid var(--hooup-aw-border);
    border-left: 2px solid var(--hooup-aw-border-strong);
    color: var(--hooup-aw-text);
    font-size: 12.5px;
    line-height: 1.4;
}

/* Сообщения */
.hooup-assistant-ai-msg {
    max-width: 86%;
    padding: 10px 12px;
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.hooup-assistant-ai-msg--user {
    align-self: flex-end;
    background: var(--hooup-aw-user-bubble);
    color: var(--hooup-aw-user-text);
}

.hooup-assistant-ai-msg--ai {
    align-self: flex-start;
    background: var(--hooup-aw-ai-bubble);
    color: var(--hooup-aw-ai-text);
}

.hooup-assistant-ai-msg--ai.is-pending {
    background: var(--hooup-aw-surface-muted);
    border-style: dashed;
    color: var(--hooup-aw-text-muted);
    white-space: normal;
}

.hooup-assistant-ai-msg__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-style: normal;
    color: var(--hooup-aw-text, #111);
}

.hooup-assistant-ai-msg__status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--hooup-aw-accent, #d62828);
    border-radius: 50%;
    animation: hooup-ai-status-pulse 1.1s ease-in-out infinite;
}

@keyframes hooup-ai-status-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.hooup-assistant-ai-msg__status-label {
    flex: 1 1 auto;
    min-width: 0;
}

.hooup-assistant-ai-msg__status-log {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 12px;
    font-style: normal;
    color: var(--hooup-aw-text-muted);
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hooup-assistant-ai-msg__status-log:empty {
    display: none;
}

.hooup-assistant-ai-msg__status-log li {
    padding: 2px 0;
    border-top: 1px dashed var(--hooup-aw-border, rgba(0, 0, 0, 0.1));
}

.hooup-assistant-ai-msg__status-log li:first-child {
    border-top: 0;
}

.hooup-assistant-ai-msg__meta {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.6;
}

/* =======================================================================
 *  AI ACTION CARDS — inline-анкета мерок и T-pose фото в чате ассистента.
 * ======================================================================= */
.hooup-assistant-ai-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.hooup-assistant-ai-action__card {
    background: var(--hooup-aw-surface, #fff);
    border: 1px solid var(--hooup-aw-border, #e5e5e5);
    border-radius: 10px;
    padding: 14px 14px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hooup-assistant-ai-action__title {
    font-weight: 600;
    font-size: 14px;
    color: var(--hooup-aw-text, #000);
    letter-spacing: 0.01em;
}

.hooup-assistant-ai-action__hint {
    font-size: 12px;
    color: var(--hooup-aw-text-muted, #6c6c6c);
    line-height: 1.4;
}

.hooup-assistant-ai-action__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.hooup-assistant-ai-action__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.hooup-assistant-ai-action__label {
    color: var(--hooup-aw-text-muted, #6c6c6c);
    letter-spacing: 0.01em;
}

.hooup-assistant-ai-action__input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--hooup-aw-border, #dcdcdc);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--hooup-aw-text, #000);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.hooup-assistant-ai-action__input:focus {
    outline: 0;
    border-color: var(--hooup-aw-accent, #000);
}

.hooup-assistant-ai-action__input:disabled {
    opacity: 0.6;
    background: var(--hooup-aw-surface-muted, #f7f7f7);
}

.hooup-assistant-ai-action__status {
    font-size: 12px;
    color: var(--hooup-aw-text-muted, #6c6c6c);
    min-height: 16px;
}

.hooup-assistant-ai-action__status:not(:empty) {
    padding: 6px 8px;
    background: var(--hooup-aw-surface-muted, #f7f7f7);
    border-radius: 6px;
}

.hooup-assistant-ai-action__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hooup-assistant-ai-action__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hooup-assistant-ai-action__btn--primary {
    background: var(--hooup-aw-accent, #000);
    color: #fff;
    border-color: var(--hooup-aw-accent, #000);
}

.hooup-assistant-ai-action__btn--primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.hooup-assistant-ai-action__btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.hooup-assistant-ai-action__btn--ghost {
    background: transparent;
    color: var(--hooup-aw-text, #000);
    border-color: var(--hooup-aw-border-strong, #000);
}

.hooup-assistant-ai-action__btn--ghost:hover {
    background: var(--hooup-aw-surface-muted, #f7f7f7);
}

@media (max-width: 480px) {
    .hooup-assistant-ai-action__fields {
        grid-template-columns: 1fr;
    }
}

/* Текст ответа ИИ: HTML из renderAiText (Markdown), не pre-wrap */
.hooup-assistant-ai-msg__text {
    white-space: normal;
}

.hooup-assistant-ai-msg__text p {
    margin: 0 0 8px;
}

.hooup-assistant-ai-msg__text p:last-child {
    margin-bottom: 0;
}

.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h {
    margin: 12px 0 6px;
    font-weight: 600;
    line-height: 1.35;
}

.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h:first-child {
    margin-top: 0;
}

.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h1 {
    font-size: 1.125rem;
}

.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h2 {
    font-size: 1.0625rem;
}

.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h3,
.hooup-assistant-ai-msg__text .hooup-assistant-ai-md__h4 {
    font-size: 1rem;
}

.hooup-assistant-ai-md__table-wrap {
    margin: 8px 0 10px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hooup-assistant-ai-md__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.4;
}

.hooup-assistant-ai-md__table th,
.hooup-assistant-ai-md__table td {
    border: 1px solid var(--hooup-aw-border, #e5e5e5);
    padding: 6px 8px;
    vertical-align: top;
}

.hooup-assistant-ai-md__table th {
    background: var(--hooup-aw-surface-muted, #f7f7f7);
    font-weight: 600;
}

.hooup-assistant-ai-md__table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.hooup-assistant-ai-md__list {
    margin: 6px 0 8px;
    padding-left: 18px;
    list-style: disc;
}

.hooup-assistant-ai-md__list li {
    margin-bottom: 4px;
}

.hooup-assistant-ai-md__list li:last-child {
    margin-bottom: 0;
}

.hooup-assistant-ai-msg__text strong {
    font-weight: 600;
}

.hooup-assistant-ai-msg__text em {
    font-style: italic;
}

.hooup-assistant-ai-msg__text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hooup-assistant-ai-msg__text + .hooup-assistant-ai-msg__attachments {
    margin-top: 8px;
}

.hooup-assistant-ai-msg__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.hooup-assistant-ai-msg__image {
    max-width: 220px;
    max-height: 220px;
    border: 1px solid var(--hooup-aw-border);
    border-radius: 0;
    display: block;
    cursor: zoom-in;
    object-fit: cover;
    background: var(--hooup-aw-surface-muted);
}

.hooup-assistant-ai-msg--user .hooup-assistant-ai-msg__image {
    background: rgba(255, 255, 255, 0.1);
}

.hooup-assistant-ai-msg__file {
    padding: 6px 10px;
    border: 1px solid var(--hooup-aw-border);
    border-radius: 0;
    background: var(--hooup-aw-surface-muted);
    font-size: 12.5px;
    color: inherit;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hooup-assistant-ai-msg--user .hooup-assistant-ai-msg__file {
    background: rgba(255, 255, 255, 0.18);
}

/* Композер (новый): вложения + textarea + тулбар с кнопками */
.hooup-assistant-ai-composer {
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    border: 0;
    border-top: 1px solid var(--hooup-aw-border);
    border-radius: 0;
    background: var(--hooup-aw-surface);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hooup-assistant-ai-composer:focus-within {
    border-color: transparent;
    box-shadow: none;
}

.hooup-assistant-ai-composer.is-dragover {
    box-shadow: none;
}

/* Список вложений: чипы с превью */
.hooup-assistant-ai-composer__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-width: 0;
}

.hooup-assistant-ai-attachment {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 26px 4px 4px;
    background: var(--hooup-aw-surface-muted);
    border: 1px solid var(--hooup-aw-border);
    border-radius: 0;
    max-width: 100%;
    min-width: 0;
}

.hooup-assistant-ai-attachment__thumb {
    width: 36px;
    height: 36px;
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--hooup-aw-surface-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hooup-aw-text-muted);
}

.hooup-assistant-ai-attachment__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hooup-assistant-ai-attachment__thumb svg {
    width: 16px;
    height: 16px;
}

.hooup-assistant-ai-attachment__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 4px;
}

.hooup-assistant-ai-attachment__name {
    font-size: 12.5px;
    color: var(--hooup-aw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.hooup-assistant-ai-attachment__size {
    font-size: 11px;
    color: var(--hooup-aw-text-muted);
}

.hooup-assistant-ai-attachment__remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: 1px solid var(--hooup-aw-border);
    border-radius: 0;
    background: #fff;
    color: var(--hooup-aw-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hooup-assistant-ai-attachment__remove:hover {
    background: #f5f5f5;
    color: #000;
}

.hooup-assistant-ai-attachment__remove svg {
    width: 11px;
    height: 11px;
}

/* Поле ввода */
.hooup-assistant-ai-composer__field {
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

.hooup-assistant-ai-composer__textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 28px;
    max-height: 180px;
    box-sizing: border-box;
    resize: none;
    border: none;
    background: transparent;
    outline: none;
    color: var(--hooup-aw-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    padding: 4px 2px 2px;
}

.hooup-assistant-ai-composer__textarea::placeholder {
    color: var(--hooup-aw-text-muted);
}

/* Нижняя панель: инструменты + подсказка + отправить */
.hooup-assistant-ai-composer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    min-width: 0;
}

.hooup-assistant-ai-composer__tools {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.hooup-assistant-ai-composer__tool {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--hooup-aw-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.hooup-assistant-ai-composer__tool:hover {
    background: var(--hooup-aw-surface-muted);
    color: var(--hooup-aw-text);
}

.hooup-assistant-ai-composer__tool:focus-visible {
    outline: 1px solid var(--hooup-aw-border-strong);
    outline-offset: 0;
}

.hooup-assistant-ai-composer__tool svg {
    width: 16px;
    height: 16px;
}

.hooup-assistant-ai-composer__hint {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 11.5px;
    color: var(--hooup-aw-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hooup-assistant-ai-composer__hint kbd {
    display: inline-block;
    padding: 1px 5px;
    margin: 0 1px;
    border-radius: 0;
    background: var(--hooup-aw-surface-muted);
    border: 1px solid rgba(226, 232, 240, 0.96);
    color: var(--hooup-aw-text);
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
}

/* Кнопка «Отправить» */
.hooup-assistant-ai-composer__send {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: 0;
    background: var(--hooup-aw-cta);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, opacity 160ms ease,
                filter 160ms ease, transform 160ms ease;
}

.hooup-assistant-ai-composer__send:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.hooup-assistant-ai-composer__send:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.hooup-assistant-ai-composer__send svg {
    width: 14px;
    height: 14px;
}

/* Скрываем лейбл кнопки «Отправить» на узких */
@media (max-width: 540px) {
    .hooup-assistant-ai-composer__send-label {
        display: none;
    }

    .hooup-assistant-ai-composer__send {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    .hooup-assistant-ai-composer__hint {
        display: none;
    }
}

/* Скрываем подсказку при недостатке места (панель узкая) */
@container (max-width: 520px) {
    .hooup-assistant-ai-composer__hint {
        display: none;
    }
}

/* Drag-n-drop overlay */
.hooup-assistant-ai-composer__dropzone {
    position: absolute;
    inset: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.92);
    border: 1px dashed var(--hooup-aw-border-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--hooup-aw-accent);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
}

.hooup-assistant-ai-composer__dropzone svg {
    width: 22px;
    height: 22px;
}

/* Скроллбар в списке сообщений */
.hooup-assistant-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.hooup-assistant-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.14);
    border-radius: 0;
}

/* ============================================================
 * Десктоп (≥ 992px): панель на всю высоту справа, оверлей — без сжатия body.
 * ============================================================ */
@media (min-width: 992px) {
    body.hooup-assistant-open:not(.hooup-assistant-fullscreen) .hooup-assistant-panel {
        top: 0;
        right: 0;
        bottom: 0;
        width: var(--hooup-aw-panel-width);
        max-width: var(--hooup-aw-panel-width);
    }

    body.hooup-assistant-open:not(.hooup-assistant-fullscreen) .hooup-assistant-panel__shell {
        border: 0;
        border-left: 1px solid var(--hooup-aw-border-strong);
        border-radius: 0;
        box-shadow: none;
    }
}

/* ============================================================
 * Fullscreen
 * ============================================================ */
body.hooup-assistant-fullscreen .hooup-assistant-panel {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
}

body.hooup-assistant-fullscreen .hooup-assistant-panel__shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.hooup-assistant-fullscreen .hooup-assistant-backdrop {
    display: none !important;
}

/* ============================================================
 * Планшет / мобильные (< 992px): оверлей + backdrop
 * Split View не активен — навбар и так в мобильном режиме Bootstrap.
 * ============================================================ */
@media (max-width: 991.98px) {
    body.hooup-assistant-offcanvas-active .hooup-assistant-fab {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px) scale(0.88);
        transition: transform 200ms ease, opacity 180ms ease, visibility 0s linear 180ms;
    }

    .hooup-assistant-panel {
        top: 12px;
        right: 12px;
        bottom: 12px;
        width: min(100vw - 24px, 520px);
    }

    .hooup-assistant-fab {
        width: 54px;
        height: 54px;
    }

    .hooup-assistant-fab svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --hooup-aw-gap: 0px;
    }

    .hooup-assistant-panel {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-width: none;
    }

    .hooup-assistant-panel__shell {
        border-radius: 0;
        border: 0;
        box-shadow: none;
    }

    .hooup-assistant-header {
        padding: 8px 8px 8px 10px;
    }

    .hooup-assistant-tab {
        font-size: 12.5px;
        padding: 0 8px;
    }

    .hooup-assistant-tab svg {
        width: 14px;
        height: 14px;
    }

    /* Fullscreen-кнопка на мобильных не нужна — панель и так на весь экран */
    .hooup-assistant-iconbtn--fullscreen {
        display: none;
    }

    .hooup-assistant-ai-messages {
        padding: 12px 12px 4px;
    }

    .hooup-assistant-ai-composer {
        padding: 8px 10px 10px;
    }
}

/* ==========================================================================
   Guest gate — плашка «Войдите в аккаунт» поверх ИИ-панели
   Показывается, когда data-ai-auth="0" (пользователь не авторизован).
   ========================================================================== */
.hooup-assistant-ai__guest-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 28px);
    background: var(--hooup-aw-surface, #ffffff);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: hooup-ai-gate-fade 220ms ease-out both;
}

.hooup-assistant-ai__guest-gate[hidden] { display: none !important; }

@keyframes hooup-ai-gate-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hooup-assistant-ai__guest-gate-card {
    max-width: 440px;
    width: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    text-align: center;
}

.hooup-assistant-ai__guest-gate-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111111;
    color: #ffffff;
}

.hooup-assistant-ai__guest-gate-icon svg {
    width: 28px;
    height: 28px;
}

.hooup-assistant-ai__guest-gate-title {
    max-width: 24ch;
    margin: 0 auto 10px;
    font-size: clamp(16px, 1.3vw + 10px, 21px);
    font-weight: 600;
    line-height: 1.3;
    color: #111111;
    text-wrap: balance;
}

.hooup-assistant-ai__guest-gate-text {
    max-width: 34ch;
    font-size: clamp(12.5px, 0.45vw + 11px, 14px);
    line-height: 1.55;
    color: #4b5563;
    margin: 0 auto 18px;
}

.hooup-assistant-ai__guest-gate-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.hooup-assistant-ai__guest-gate-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #111111;
    background: #ffffff;
    color: #111111;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
    min-width: 128px;
}

.hooup-assistant-ai__guest-gate-btn:hover {
    background: #f5f5f5;
}

.hooup-assistant-ai__guest-gate-btn:active {
    transform: translateY(1px);
}

.hooup-assistant-ai__guest-gate-btn--primary {
    background: #111111;
    color: #ffffff;
}

.hooup-assistant-ai__guest-gate-btn--primary:hover {
    background: #000000;
}

.hooup-assistant-ai__guest-gate-hint {
    max-width: 34ch;
    font-size: 12px;
    line-height: 1.5;
    color: #9ca3af;
    margin: 0 auto;
}

/* Когда пользователь не авторизован, блокируем клики по подложке ИИ-панели,
   чтобы случайно не открыть сайдбар/composer под плашкой. */
.hooup-assistant-ai.is-guest-locked .hooup-assistant-ai__main,
.hooup-assistant-ai.is-guest-locked .hooup-assistant-ai__sidebar,
.hooup-assistant-ai.is-guest-locked .hooup-assistant-ai__menu-toggle {
    pointer-events: none;
    user-select: none;
    filter: saturate(0.4) opacity(0.5);
}

/* relative на родителе — плашке нужно позиционироваться внутри */
.hooup-assistant-ai {
    position: relative;
}

@media (max-width: 560px) {
    .hooup-assistant-ai__guest-gate {
        padding: 14px;
    }
    .hooup-assistant-ai__guest-gate-card {
        max-width: none;
    }
    .hooup-assistant-ai__guest-gate-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hooup-assistant-ai__guest-gate-title {
        max-width: 18ch;
        font-size: 15px;
    }
    .hooup-assistant-ai__guest-gate-text {
        max-width: none;
        font-size: 12.5px;
    }
    .hooup-assistant-ai__guest-gate-btn {
        width: 100%;
        min-width: 0;
        padding: 10px 14px;
    }
    .hooup-assistant-ai__guest-gate-hint {
        max-width: none;
    }
}

/* =================================================================
   AI Product Preview Cards (meta.products — deep_search results)
   ================================================================= */
.hooup-ai-products {
    margin: 10px 0 6px;
    border-radius: 14px;
    background: #f8f8f8;
    padding: 12px;
    border: 1px solid #e8e8e8;
}
.hooup-ai-products__head {
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #7a7a7a;
    margin-bottom: 10px;
    font-weight: 600;
}
.hooup-ai-products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
}
.hooup-ai-product {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hooup-ai-product:hover {
    border-color: #111;
    box-shadow: 0 6px 18px -10px rgba(0,0,0,.25);
    transform: translateY(-1px);
}
.hooup-ai-product__image {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #f1f1f1 linear-gradient(135deg, #eee 25%, #f6f6f6 50%, #eee 75%);
    background-size: 400% 100%;
    animation: hooup-ai-skel 1.4s linear infinite;
    overflow: hidden;
}
.hooup-ai-product__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: none;
}
.hooup-ai-product__image--broken::after {
    content: '📷';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #bbb;
}
.hooup-ai-product__badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 999px;
    color: #fff;
}
.hooup-ai-product__badge--sale { background: #e53935; }
.hooup-ai-product__badge--oos  { background: #888; }

.hooup-ai-product__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}
.hooup-ai-product__cat {
    font-size: 10.5px;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hooup-ai-product__name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hooup-ai-product__sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}
.hooup-ai-product__size {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    color: #333;
    background: #fafafa;
    line-height: 1.2;
}
.hooup-ai-product__size--more {
    color: #888;
    background: transparent;
    border-style: dashed;
}
.hooup-ai-product__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}
.hooup-ai-product__price-now {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}
.hooup-ai-product__price-old {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}

@keyframes hooup-ai-skel {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Мобильная адаптация */
@media (max-width: 520px) {
    .hooup-ai-products { padding: 10px; }
    .hooup-ai-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ========================================================================
   Группы карточек товаров (комплекты: «Верх», «Низ», «Верхняя одежда»)
   ======================================================================== */
.hooup-ai-products-groups {
    margin: 10px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hooup-ai-products-groups__section {
    border-radius: 14px;
    background: #f8f8f8;
    padding: 12px;
    border: 1px solid #e8e8e8;
}
.hooup-ai-products-groups__title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e2e2;
}
.hooup-ai-products-groups__label {
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 700;
    color: #2f2f2f;
}
.hooup-ai-products-groups__count {
    font-size: 11px;
    color: #8a8a8a;
}

/* ========================================================================
   Стилист-бриф (карточный опросник в чате) — строгая ч/б стилистика HOOUP.
   Соответствует остальным блокам виджета: прямоугольные рамки, чёрный
   акцент, белый фон, без «цветных» акцентов. Выбранное состояние — полная
   инверсия (чёрный фон / белый текст), чтобы сохранить контрастность и
   минимализм бренда.
   ======================================================================== */
.hooup-assistant-ai-action--collect-stylist-brief {
    margin-bottom: 12px;
}
.hooup-stylist-brief {
    background: var(--hooup-aw-surface);
    border: 1px solid var(--hooup-aw-border-strong);
    border-radius: var(--hooup-aw-radius);
    padding: 16px;
    color: var(--hooup-aw-text);
}
.hooup-stylist-brief__intro {
    font-size: 13.5px;
    color: var(--hooup-aw-text);
    margin-bottom: 6px;
    line-height: 1.5;
}
.hooup-stylist-brief__help {
    font-size: 12px;
    color: var(--hooup-aw-text-muted);
    margin-bottom: 14px;
    line-height: 1.45;
}
.hooup-stylist-brief__questions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.hooup-stylist-brief__question {
    background: var(--hooup-aw-surface);
    border: 1px solid var(--hooup-aw-border);
    border-radius: var(--hooup-aw-radius);
    padding: 14px;
}
.hooup-stylist-brief__section {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--hooup-aw-text);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--hooup-aw-border);
}
.hooup-stylist-brief__qtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--hooup-aw-text);
    margin-bottom: 6px;
    line-height: 1.35;
}
.hooup-stylist-brief__qprompt {
    font-size: 12.5px;
    color: var(--hooup-aw-text-muted);
    margin-bottom: 12px;
    line-height: 1.45;
}
.hooup-stylist-brief__options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.hooup-stylist-brief__option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    background: var(--hooup-aw-surface);
    border: 1px solid var(--hooup-aw-border);
    border-radius: var(--hooup-aw-radius);
    cursor: pointer;
    text-align: left;
    color: var(--hooup-aw-text);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.hooup-stylist-brief__option:hover {
    background: var(--hooup-aw-surface-muted);
    border-color: var(--hooup-aw-border-strong);
}
.hooup-stylist-brief__option.is-selected {
    background: var(--hooup-aw-cta);
    border-color: var(--hooup-aw-cta);
    color: #ffffff;
}
.hooup-stylist-brief__option.is-selected .hooup-stylist-brief__option-title,
.hooup-stylist-brief__option.is-selected .hooup-stylist-brief__option-desc {
    color: #ffffff;
}
.hooup-stylist-brief__option:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.hooup-stylist-brief__option--any {
    grid-column: 1 / -1;
    background: var(--hooup-aw-surface-muted);
    border-style: dashed;
}
.hooup-stylist-brief__option-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hooup-aw-text);
    line-height: 1.3;
}
.hooup-stylist-brief__option-desc {
    font-size: 12px;
    color: var(--hooup-aw-text-muted);
    line-height: 1.35;
}
.hooup-stylist-brief__free {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--hooup-aw-border);
}
.hooup-stylist-brief__free-label {
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--hooup-aw-text);
    font-weight: 700;
    margin-bottom: 6px;
}
.hooup-stylist-brief__free-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    padding: 10px 12px;
    border-radius: var(--hooup-aw-radius);
    border: 1px solid var(--hooup-aw-border);
    font: inherit;
    font-size: 13px;
    color: var(--hooup-aw-text);
    background: var(--hooup-aw-surface);
    box-sizing: border-box;
    transition: border-color .15s ease;
}
.hooup-stylist-brief__free-input:focus {
    outline: none;
    border-color: var(--hooup-aw-border-strong);
}
.hooup-stylist-brief__free-input::placeholder {
    color: var(--hooup-aw-text-muted);
}
.hooup-stylist-brief__free-hint {
    font-size: 11.5px;
    color: var(--hooup-aw-text-muted);
    margin-top: 6px;
    line-height: 1.4;
}
.hooup-stylist-brief__footer-help {
    font-size: 12px;
    color: var(--hooup-aw-text-muted);
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--hooup-aw-border);
    line-height: 1.45;
}
.hooup-stylist-brief__status {
    min-height: 18px;
    font-size: 12px;
    margin-top: 10px;
    color: var(--hooup-aw-text-muted);
}
.hooup-stylist-brief__status--ok {
    color: var(--hooup-aw-text);
    background: var(--hooup-aw-surface-muted);
    padding: 8px 12px;
    border-radius: var(--hooup-aw-radius);
    border: 1px solid var(--hooup-aw-border-strong);
    font-weight: 600;
}
.hooup-stylist-brief__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.hooup-stylist-brief__btn {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: var(--hooup-aw-radius);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hooup-stylist-brief__btn--primary {
    background: var(--hooup-aw-cta);
    color: #ffffff;
    border-color: var(--hooup-aw-cta);
}
.hooup-stylist-brief__btn--primary:hover:not(:disabled) {
    background: var(--hooup-aw-cta-hover);
    border-color: var(--hooup-aw-cta-hover);
}
.hooup-stylist-brief__btn--ghost {
    background: var(--hooup-aw-surface);
    color: var(--hooup-aw-text);
    border-color: var(--hooup-aw-border-strong);
}
.hooup-stylist-brief__btn--ghost:hover:not(:disabled) {
    background: var(--hooup-aw-text);
    color: #ffffff;
    border-color: var(--hooup-aw-text);
}
.hooup-stylist-brief__btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 520px) {
    .hooup-stylist-brief {
        padding: 14px;
    }
    .hooup-stylist-brief__question {
        padding: 12px;
    }
    .hooup-stylist-brief__options {
        grid-template-columns: 1fr;
    }
}
