/* Стили суперчата — эталон designs/design-research/ibrandai_web_public.html */
:root {
    --primary-red: #ff4d4d;
    --text-dark: #2d3436;
    --text-gray: #636e72;
    --bg-light: #f9f9f9;
    --sc-header-pad-y: 10px;
    --sc-header-pad-x: 16px;
    --sc-shell-pad: 12px;
    --sc-shell-gap: 12px;
    --sc-chip-pad-y: 8px;
    --sc-chip-pad-x: 12px;
    --sc-history-pad: 12px 14px 10px;
    --sc-controls-pad: 10px 12px 12px;
    --sc-input-min-h: 56px;
}

body.superchat-ibrandai {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.superchat-ibrandai header {
    background: white;
    padding: var(--sc-header-pad-y) var(--sc-header-pad-x);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    z-index: 100;
    flex-shrink: 0;
    min-height: 52px;
}

.superchat-ibrandai .header-back {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #eceff1;
    background: #fff;
    color: #636e72;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}

.superchat-ibrandai .superchat-header-exit-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #eceff1;
    background: #fff;
    color: #636e72;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.superchat-ibrandai .superchat-header-exit-close:hover {
    background: #f3f4f6;
    color: #2d3436;
}

.superchat-ibrandai .brand {
    font-size: 20px;
    font-weight: 600;
    color: black;
    display: flex;
    align-items: center;
    line-height: 1.1;
}

.superchat-ibrandai .brand span {
    color: var(--primary-red);
}

.superchat-ibrandai .anastasia-label {
    font-size: 15px;
    color: #999;
    font-weight: 400;
    margin-left: 2px;
    font-style: italic;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    padding: 2px 6px;
    transition: color 0.2s, background 0.2s;
    line-height: 1.2;
}

.superchat-ibrandai .anastasia-label:hover,
.superchat-ibrandai .anastasia-label:focus-visible {
    color: var(--primary-red);
    background: #fff5f5;
    outline: none;
}

.superchat-ibrandai .header-actions-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.superchat-ibrandai .header-chat-sessions {
    position: relative;
}

.superchat-ibrandai .superchat-sessions-toggle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #eceff1;
    background: #fff;
    color: #636e72;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.superchat-ibrandai .superchat-sessions-toggle:hover {
    border-color: #ffb4b4;
    color: var(--primary-red);
    background: #fff7f7;
}

.superchat-ibrandai #superchat-sessions-scrim {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(15, 23, 42, 0.18);
    display: none;
}

.superchat-ibrandai #superchat-sessions-scrim.open {
    display: block;
}

.superchat-ibrandai #superchat-sessions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, calc(100vw - 32px));
    max-height: min(70vh, 420px);
    z-index: 190;
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eceff1;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.superchat-ibrandai #superchat-sessions-dropdown.open {
    display: flex;
}

.superchat-ibrandai .superchat-sessions-new {
    padding: 10px 12px 10px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
    flex-shrink: 0;
}

.superchat-ibrandai .superchat-sessions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.superchat-ibrandai .superchat-sessions-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

.superchat-ibrandai .superchat-sessions-modal-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.superchat-ibrandai .superchat-sessions-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.superchat-ibrandai .superchat-sessions-section-hint {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #6b7280;
}

.superchat-ibrandai .superchat-sessions-field-label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 4px;
}

.superchat-ibrandai #superchat-new-chat-title {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}

.superchat-ibrandai .superchat-sessions-create-btn {
    margin-top: 8px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    background: var(--primary-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.superchat-ibrandai .superchat-sessions-list-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.superchat-ibrandai .superchat-sessions-list-label {
    flex-shrink: 0;
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.superchat-ibrandai #superchat-session-list,
.superchat-ibrandai .superchat-sessions-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 88px;
    max-height: min(48vh, 320px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.superchat-ibrandai #superchat-session-list::-webkit-scrollbar,
.superchat-ibrandai .superchat-sessions-scroll::-webkit-scrollbar {
    width: 6px;
}

.superchat-ibrandai #superchat-session-list::-webkit-scrollbar-thumb,
.superchat-ibrandai .superchat-sessions-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.superchat-ibrandai .superchat-session-row {
    display: flex;
    border-bottom: 1px solid #f3f4f6;
}

.superchat-ibrandai .superchat-session-row.active {
    background: #fff7f7;
}

.superchat-ibrandai .superchat-session-open {
    flex: 1;
    min-width: 0;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 8px 8px 12px;
    cursor: pointer;
}

.superchat-ibrandai .superchat-session-open:hover {
    background: #f9fafb;
}

.superchat-ibrandai .superchat-session-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.superchat-ibrandai .superchat-session-preview {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.35;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.superchat-ibrandai .superchat-session-preview.is-empty {
    color: #d1d5db;
    font-style: italic;
}

.superchat-ibrandai .superchat-session-close {
    width: 34px;
    border: 0;
    background: transparent;
    color: #c4c9d2;
    font-size: 17px;
    cursor: pointer;
}

.superchat-ibrandai .superchat-session-close:hover {
    color: #ef4444;
    background: #fff5f5;
}

.superchat-ibrandai .superchat-session-empty {
    padding: 14px 12px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
}

.superchat-ibrandai .superchat-session-empty.is-error {
    color: #dc2626;
}

.superchat-ibrandai #superchat-session-delete-dialog {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.96);
}

.superchat-ibrandai #superchat-session-delete-dialog.open {
    display: flex;
}

.superchat-ibrandai .superchat-session-delete-card {
    width: 100%;
    max-width: 240px;
    text-align: center;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1px solid #eceff1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    background: #fff;
}

.superchat-ibrandai .superchat-session-delete-card p {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
}

.superchat-ibrandai .superchat-session-delete-actions {
    display: flex;
    gap: 8px;
}

.superchat-ibrandai .controls-area-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.superchat-ibrandai .anastasia-human-route-banner {
    width: 100%;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.3;
    min-height: 0;
}

.superchat-ibrandai .anastasia-human-route-banner .anastasia-human-route-text {
    flex: 1;
    min-width: 0;
}

.superchat-ibrandai .context-case-readonly {
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: 6px;
}

.superchat-ibrandai .anastasia-human-route-back {
    border: 0;
    background: rgba(255, 255, 255, 0.55);
    color: inherit;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.superchat-ibrandai .anastasia-human-route-back:hover {
    background: rgba(255, 255, 255, 0.9);
}

.superchat-ibrandai .anastasia-human-route-banner.is-compact {
    width: auto;
    margin-bottom: 4px;
    padding: 0;
    background: transparent;
    justify-content: flex-start;
}

.superchat-ibrandai .anastasia-human-route-banner.is-compact .anastasia-human-route-back {
    font-size: 11px;
    padding: 5px 10px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.superchat-ibrandai .superchat-compose-contact {
    width: 100%;
    margin-bottom: 6px;
}

.superchat-ibrandai .superchat-compose-contact.hidden {
    display: none;
}

.superchat-ibrandai .order-human-actions-compose {
    margin-bottom: 0;
}

.superchat-ibrandai .order-human-actions-compose .order-human-btn {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: 11px;
    border-radius: 999px;
}

.superchat-ibrandai .superchat-compose-contact-inner .order-human-sheet {
    margin-top: 6px;
}

.superchat-ibrandai .order-human-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.superchat-ibrandai .order-human-btn {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.superchat-ibrandai .order-human-btn.is-ai { background: #f3f4f6; color: #374151; }
.superchat-ibrandai .order-human-btn.is-human { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.superchat-ibrandai .order-human-sheet { display: flex; flex-direction: column; gap: 6px; }
.superchat-ibrandai .order-human-sheet.hidden { display: none !important; }

.superchat-ibrandai .order-human-pick {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 9px 10px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
}

.superchat-ibrandai .order-human-service-only-note {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #9a3412;
}

.superchat-ibrandai .order-hero-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0 12px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eceff1;
}

.superchat-ibrandai .order-hero-contact-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.superchat-ibrandai .order-hero-contact-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6b7280;
}

.superchat-ibrandai .order-hero-contact-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    word-break: break-word;
}

.superchat-ibrandai .order-hero-contact-phone {
    color: #b91c1c;
    text-decoration: none;
}

.superchat-ibrandai .order-hero-contact-phone:hover {
    text-decoration: underline;
}

.superchat-ibrandai .order-hero-actions-block {
    margin-bottom: 12px;
}

.superchat-ibrandai .order-human-actions-hero {
    margin-bottom: 6px;
}

.superchat-ibrandai .order-hero-actions-note {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
}

.superchat-ibrandai .superchat-session-delete-actions [data-delete-act="yes"] {
    border: 0;
    background: var(--primary-red);
    color: #fff;
}

.superchat-ibrandai .superchat-session-delete-actions [data-delete-act="no"] {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
}

.superchat-ibrandai .header-legacy-link {
    font-size: 11px;
    color: #9aa4af;
    text-decoration: none;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.superchat-ibrandai .header-legacy-link:hover {
    color: var(--primary-red);
}

.superchat-ibrandai .main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    padding: var(--sc-shell-pad);
    gap: var(--sc-shell-gap);
}

.superchat-ibrandai .main-container.anastasia-full .context-panel {
    display: none !important;
}

.superchat-ibrandai .main-container.anastasia-full .chat-panel {
    flex: 1;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

.superchat-ibrandai .chat-panel {
    flex: 1.65;
    min-width: 0;
    background: white;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    min-height: 0;
}

.superchat-ibrandai .thread-chips {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: var(--sc-chip-pad-y) var(--sc-chip-pad-x) calc(var(--sc-chip-pad-y) + 2px);
    margin-bottom: 0;
    background: #fff;
    border-bottom: 1px solid #eceff1;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

.superchat-ibrandai .thread-chips-main,
.superchat-ibrandai .thread-chips-archive-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.superchat-ibrandai .thread-chips-main {
    flex: 1 1 auto;
    min-width: 0;
}

.superchat-ibrandai .thread-chips-archive-row {
    flex: 1 1 100%;
    width: 100%;
    padding-top: 0;
}

.superchat-ibrandai .thread-scope-banner {
    flex-shrink: 0;
    margin: 0;
    padding: 7px 12px;
    font-size: 11px;
    line-height: 1.35;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.superchat-ibrandai .thread-scope-banner.hidden {
    display: none;
}

/* Вкладки задач — компактные chips, меньше высоты полосы */
.superchat-ibrandai .thread-chip {
    position: relative;
    border: 1px solid rgba(236, 239, 241, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
    color: #4b5563;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.superchat-ibrandai .thread-chip.has-close {
    padding-right: 28px;
}

.superchat-ibrandai .thread-chip.etalon-pin {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #c2410c;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.1);
}

.superchat-ibrandai .thread-chip.archived {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border: 1px solid #e5e7eb;
    color: #9aa4af;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.superchat-ibrandai .thread-chip-close {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    color: #9aa4af;
}

.superchat-ibrandai .thread-chip-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #c0392b;
}

.superchat-ibrandai .thread-chip.active .thread-chip-close {
    color: rgba(255, 255, 255, 0.9);
}

.superchat-ibrandai .thread-chip.active .thread-chip-close:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.superchat-ibrandai .thread-chips .thread-chip:hover {
    transform: none;
    background: linear-gradient(180deg, #fff7f7 0%, #fef2f2 100%);
    border-color: #f5d0cf;
    color: #b45352;
    box-shadow: 0 8px 18px rgba(204, 85, 83, 0.12);
}

.superchat-ibrandai .thread-chips .thread-chip.active {
    transform: none;
    background: linear-gradient(135deg, #d76663 0%, #c84d4b 100%);
    border: 1px solid transparent;
    color: #fff;
    box-shadow: 0 12px 28px rgba(204, 85, 83, 0.28);
}

.superchat-ibrandai .thread-chip.etalon-pin.active {
    background: linear-gradient(135deg, #d76663 0%, #c84d4b 100%);
    color: #fff;
    border-color: transparent;
}

.superchat-ibrandai .thread-chip.archive-toggle {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border: 1px dashed #d1d5db;
    color: #6b7280;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.superchat-ibrandai .thread-chip.archive-toggle:hover {
    border-color: #9ca3af;
    color: #374151;
}

.superchat-ibrandai .thread-chip.archive-toggle.active {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #9ca3af;
    color: #111827;
    transform: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.superchat-ibrandai .thread-chip.archive-more {
    cursor: pointer;
    pointer-events: auto;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    color: #9ca3af;
    font-size: 12px;
    box-shadow: none;
}

.superchat-ibrandai #chat-history {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--sc-history-pad);
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    z-index: 1;
    gap: 10px;
    background: #fdfdfd;
    min-height: 0;
    align-items: stretch;
}

.superchat-ibrandai #chat-history .msg.user {
    align-self: flex-end;
}

.superchat-ibrandai #chat-history .msg.partner,
.superchat-ibrandai #chat-history .msg.service,
.superchat-ibrandai #chat-history .msg.notify-line {
    align-self: flex-start;
    max-width: min(85%, 520px);
}

/* Ответы Анастасии — шире по горизонтали, меньше «квадрат» и пустоты справа */
.superchat-ibrandai #chat-history .msg.bot {
    align-self: flex-start;
    width: fit-content;
    max-width: min(88%, 680px);
    padding: 9px 16px 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.superchat-ibrandai .main-container.anastasia-full #chat-history .msg.bot {
    max-width: min(90%, 760px);
}

.superchat-ibrandai .msg-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.72;
    font-weight: 800;
    margin-bottom: 4px;
}

.superchat-ibrandai .msg-time {
    margin-top: 5px;
    font-size: 10px;
    opacity: 0.58;
}

.superchat-ibrandai .msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.superchat-ibrandai .msg.visible {
    opacity: 1;
    transform: translateY(0);
}

.superchat-ibrandai .msg.bot {
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    color: #2d3436;
    border: 1px solid #eceff1;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.superchat-ibrandai .msg.bot .msg-body {
    max-width: 62ch;
}

.superchat-ibrandai #chat-history .msg.user {
    max-width: min(78%, 480px);
}

.superchat-ibrandai .msg.user {
    background: var(--primary-red);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.superchat-ibrandai .msg.partner {
    background: #ecfdf5;
    color: #166534;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.superchat-ibrandai .msg.service {
    background: #fff7ed;
    color: #c2410c;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.superchat-ibrandai .msg.notify-line {
    max-width: 92%;
    font-size: 12px;
    color: #636e72;
    background: #f8fafc;
    border: none;
    padding: 8px 12px;
}

.superchat-ibrandai .feed-empty-note {
    align-self: center;
    text-align: center;
    font-size: 14px;
    color: #9aa4af;
    padding: 24px 12px;
}

.superchat-ibrandai .controls-area {
    padding: var(--sc-controls-pad);
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    flex-shrink: 0;
}

.superchat-ibrandai .input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.superchat-ibrandai #textInput {
    width: 100%;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 15px;
    transition: border-color 0.3s;
    resize: none;
    min-height: var(--sc-input-min-h);
    max-height: 200px;
    line-height: 1.45;
    box-sizing: border-box;
    font-family: inherit;
    overflow-y: auto;
}

.superchat-ibrandai #textInput:focus {
    border-color: var(--primary-red);
}

.superchat-ibrandai .mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f2f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    color: #636e72;
}

.superchat-ibrandai .mic-btn:hover:not(:disabled) {
    background: #ffe8e8;
    color: var(--primary-red);
}

.superchat-ibrandai .mic-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.superchat-ibrandai .mic-btn.listen-unavailable {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25);
}

.superchat-ibrandai .mic-btn.active {
    background: var(--primary-red);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.2);
}

.superchat-ibrandai .mic-btn.active svg,
.superchat-ibrandai .mic-btn.speaking svg {
    fill: currentColor;
}

.superchat-ibrandai .mic-btn.speaking {
    animation: superchat-mic-pulse 1.5s infinite ease-in-out;
}

@keyframes superchat-mic-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.superchat-ibrandai .send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.superchat-ibrandai .send-btn svg {
    width: 22px;
    fill: var(--primary-red);
}

.superchat-ibrandai .context-panel {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-height: 0;
    position: relative;
}

.superchat-ibrandai .section-title {
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 18px;
    color: #2d3436;
}

.superchat-ibrandai .order-box {
    background: white;
    border: 1px solid #eceff1;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.superchat-ibrandai .workspace-note {
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 14px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.superchat-ibrandai .runtime-status {
    margin: 0 12px 6px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.superchat-ibrandai .runtime-status.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.superchat-ibrandai .runtime-status.success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Правая панель — сохраняем рабочие блоки runtime без лишних полос в чате */
.superchat-ibrandai .workspace-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.superchat-ibrandai .context-overlay-actions {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.superchat-ibrandai .context-overlay-actions button,
.superchat-ibrandai .workspace-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #eceff1;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
}

.superchat-ibrandai .chat-panel.collapsed,
.superchat-ibrandai .context-panel.collapsed {
    flex: 0 0 92px;
    overflow: hidden;
}

.superchat-ibrandai .chat-panel.collapsed .thread-chips,
.superchat-ibrandai .chat-panel.collapsed #chat-history,
.superchat-ibrandai .chat-panel.collapsed .controls-area {
    display: none;
}

.superchat-ibrandai .chat-panel.hidden-pane,
.superchat-ibrandai .context-panel.hidden-pane {
    display: none;
}

.superchat-ibrandai .chat-launcher,
.superchat-ibrandai .context-launcher {
    position: fixed;
    bottom: 20px;
    z-index: 45;
    display: none;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 12px 16px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(17, 24, 39, 0.2);
}

.superchat-ibrandai .chat-launcher {
    left: 20px;
    background: #111827;
    color: white;
}

.superchat-ibrandai .context-launcher {
    right: 20px;
    background: white;
    color: #111827;
}

.superchat-ibrandai .chat-launcher.visible,
.superchat-ibrandai .context-launcher.visible {
    display: inline-flex;
}

@media (max-width: 1100px) {
    .superchat-ibrandai .main-container {
        flex-direction: column;
        min-height: 0;
        flex: 1;
        overflow: hidden;
    }

    .superchat-ibrandai .chat-panel {
        flex: 1 1 58%;
        min-height: 260px;
    }

    .superchat-ibrandai .context-panel {
        flex: 1 1 34%;
        min-height: 180px;
    }

    .superchat-ibrandai .header-legacy-link {
        display: none;
    }
}

@media (max-width: 720px) {
    :root {
        --sc-shell-pad: 8px;
        --sc-chip-pad-y: 6px;
        --sc-chip-pad-x: 10px;
        --sc-controls-pad: 8px 10px 10px;
    }

    .superchat-ibrandai header {
        gap: 8px;
    }

    .superchat-ibrandai .brand {
        font-size: 18px;
    }

    .superchat-ibrandai .anastasia-label {
        font-size: 14px;
    }
}

/* Правая рабочая зона (бронь / заказ) */
.superchat-ibrandai .hero-box {
    border: 1px solid #eceff1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.superchat-ibrandai .brand-hero-visual {
    width: 110px;
    height: 110px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #fdf2f2 0%, #fff7ed 100%);
    border: 1px solid #f2e3dd;
    flex-shrink: 0;
}

.superchat-ibrandai .brand-hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.superchat-ibrandai .brand-hero-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.superchat-ibrandai .brand-logo-badge {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #a94745;
}

.superchat-ibrandai .brand-caption {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a6a62;
    font-weight: 800;
    margin-bottom: 5px;
}

.superchat-ibrandai .brand-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.superchat-ibrandai .brand-hero-chip {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #f8d4d3;
}

.superchat-ibrandai .brand-hero-chip.secondary {
    background: #fff;
    color: #6b7280;
    border: 1px solid #ead7d1;
}

.superchat-ibrandai .workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.superchat-ibrandai .order-client-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.superchat-ibrandai .order-client-status-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6b7280;
}

.superchat-ibrandai .order-client-status-value {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
}

.superchat-ibrandai .workspace-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.superchat-ibrandai .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: #4b5563;
    margin-top: 8px;
}

.superchat-ibrandai .summary-row strong {
    color: #111827;
    text-align: right;
}

.superchat-ibrandai .summary-row.discount strong {
    color: #c2410c;
}

.superchat-ibrandai .summary-row.total-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f2f6;
    font-size: 15px;
    font-weight: 700;
}

.superchat-ibrandai .order-grid-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #a94745;
}

.superchat-ibrandai .event-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
}

.superchat-ibrandai .event-item {
    position: relative;
    padding-left: 14px;
    cursor: pointer;
    border-radius: 10px;
}

.superchat-ibrandai .event-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--primary-red);
}

.superchat-ibrandai .event-label {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9aa4af;
    font-weight: 800;
}

.superchat-ibrandai .event-text {
    margin-top: 4px;
    font-size: 13px;
    color: #111827;
    line-height: 1.4;
}

.superchat-ibrandai .primary-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 700;
    cursor: pointer;
}

.superchat-ibrandai .secondary-btn {
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 700;
    cursor: pointer;
}

.superchat-ibrandai .map-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 70;
}

.superchat-ibrandai .map-modal.open {
    display: flex;
}

.superchat-ibrandai .map-modal-dialog {
    width: min(920px, 100%);
    height: min(78vh, 760px);
    background: white;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.superchat-ibrandai .map-modal-head {
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f7;
}

.superchat-ibrandai .map-frame {
    flex: 1;
    width: 100%;
    border: 0;
}

.superchat-ibrandai .order-items-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.superchat-ibrandai .order-grid-card {
    border: 1px solid #eceff1;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
    min-width: 0;
}

.superchat-ibrandai .order-grid-card-thumb {
    width: 100%;
    aspect-ratio: 1.1;
    border-radius: 10px;
    background: #f1f2f6;
    overflow: hidden;
    margin-bottom: 8px;
}

.superchat-ibrandai .order-grid-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.superchat-ibrandai .order-grid-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #2d3436;
    line-height: 1.3;
}

.superchat-ibrandai .order-grid-card-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #636e72;
}

/* Этало — правая панель как ibrandai_web_public */
.superchat-ibrandai .etalon-workspace-box {
    background: white;
    border: 1px solid #eceff1;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.superchat-ibrandai .etalon-workspace-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

.superchat-ibrandai .etalon-workspace-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.superchat-ibrandai .etalon-order-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f2f6;
}

.superchat-ibrandai .etalon-order-item:last-of-type {
    border-bottom: none;
}

.superchat-ibrandai .etalon-order-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f2f6;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #eceff1;
}

.superchat-ibrandai .etalon-order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.superchat-ibrandai .etalon-order-item-body {
    flex: 1;
    min-width: 0;
}

.superchat-ibrandai .etalon-order-item-title {
    font-weight: 700;
    font-size: 16px;
    color: #2d3436;
}

.superchat-ibrandai .etalon-order-item-meta {
    font-size: 14px;
    color: #636e72;
    margin-top: 2px;
}

.superchat-ibrandai .etalon-order-item-price {
    font-weight: 700;
    font-size: 16px;
    color: #2d3436;
    white-space: nowrap;
}

.superchat-ibrandai .etalon-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.superchat-ibrandai .etalon-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
}

.superchat-ibrandai .etalon-summary-chip.cashback {
    background: #fff7ed;
    color: #c2410c;
}

.superchat-ibrandai .etalon-summary-chip.earn {
    background: #ecfdf5;
    color: #15803d;
}

.superchat-ibrandai .etalon-totals-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f2f6;
}

.superchat-ibrandai .etalon-payable-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f2f6;
}

.superchat-ibrandai .etalon-payable-label {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
}

.superchat-ibrandai .etalon-payable-value {
    font-size: 22px;
    font-weight: 800;
    color: #2d3436;
}

.superchat-ibrandai .etalon-checkout-block {
    margin-top: 18px;
}

.superchat-ibrandai .etalon-step-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 6px;
}

.superchat-ibrandai .etalon-checkout-title {
    margin: 0 0 16px;
    font-size: 30px;
    line-height: 1.1;
}

.superchat-ibrandai .etalon-form-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.superchat-ibrandai .etalon-form-label + .etalon-form-field {
    margin-bottom: 0;
}

.superchat-ibrandai .etalon-form-field {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 4px;
}

.superchat-ibrandai .etalon-form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.45;
}

.superchat-ibrandai .etalon-primary-btn {
    width: 100%;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

/* app-v8 iframe: без дублирующей шапки, лента + чипы заказов на всю высоту */
html.shell-content,
html.shell-content body.superchat-ibrandai {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

html.shell-content body.superchat-ibrandai {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

html.shell-content body.superchat-ibrandai > header {
    display: none;
}

html.shell-content body.superchat-ibrandai .main-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 0;
}

html.shell-content body.superchat-ibrandai .chat-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

html.shell-content body.superchat-ibrandai #runtime-chat-pane {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

html.shell-content body.superchat-ibrandai .chat-launcher,
html.shell-content body.superchat-ibrandai .context-launcher {
    display: none;
}
