.layout-chat .list {
    display: flex;
    flex-direction: column;
}

.layout-chat #conversations {
    flex-grow: 1;
}

.layout-chat {
    display: flex;
}

.layout-chat .list {
    flex: 0 0 380px;
    overflow: hidden;
}

.layout-chat .chat {
    flex: 1;
}

.layout-chat .card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.layout-chat .context {
    flex: 0 0 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}


/* ===== CHAT COMPONENTS ===== */
.list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    position: relative;
    overflow-x: hidden;
}

.list h3 {
    padding: 16px;
    margin: 0;
    border-bottom: 1px solid #e6e8eb;
    font-size: 15px;
    font-weight: 600;
}

.list ul {
    list-style: none;
    padding: 0;
    margin: 0;

    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.list li {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f1f3;
}

.list-search {
    padding: 8px 12px;
    /*border-bottom: 1px solid #e6e8eb;*/
    box-sizing: border-box;

    display: flex;
    /* 🔑 */
    gap: 6px;
}

.list-search input {
    flex: 1;
    width: auto;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    outline: none;

    height: 36px;
    box-sizing: border-box;
}

/* CHAT LIST LAYOUT FIX */



/* LIST PAGINATION FOOTER */
.list-pagination-footer {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 19px 16px;
    background: white;
}






.list-header h3 {
    display: flex;
    gap: 6px;
    align-items: center;
}


.chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.chat-box {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e6e8eb;
    background: #fff;
}

.chat-header-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* CHAT HEADER LAYOUT */
.chat .view-header {
    display: flex;
    align-items: center;
}

.chat .view-header #chatStatus {
    margin-left: auto;
}

.chat-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e40af;
    font-weight: 600;
}

/* CHAT BODY LAYOUT */
.chat .view-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}


/* CHAT BUBBLES */
.chat-box p {
    max-width: 70%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.4;
}

.chat-box p.visitor {
    background: var(--chat-bg-visitor);
    color: var(--text-primary);
    align-self: flex-start;
}

.chat-box p.operator {
    background: var(--chat-bg-operator);
    color: var(--text-invert);
    align-self: flex-end;
}


.chat-box p.ai {
    margin-left: auto;

    background: linear-gradient(135deg,
            var(--chat-bg-ai-dark),
            var(--chat-bg-ai),
            var(--chat-bg-ai-light));
    color: var(--chat-text-ai);

    max-width: 72%;

    position: relative;
    padding-top: 22px;
    line-height: 1.45;
}

.chat-box p.ai::before {
    content: "Asystent AI";
    position: absolute;
    top: 6px;
    left: 12px;

    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4px;

    opacity: 0.55;
}

.chat-box p.system {
    align-self: center;

    background: var(--chat-bg-system);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px 14px;
    margin: 0 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--chat-text-system);
    font-style: normal;
    text-align: center;
    max-width: 70%;


    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.msg-time {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
}

.chat-box p.system .msg-time {
    opacity: var(--chat-time-system);
}

.chat-box p.operator .msg-time {
    opacity: var(--chat-time-operator);
}

.chat-box p.visitor .msg-time {
    opacity: var(--chat-time-visitor);
}

.chat-box p.ai .msg-time {
    opacity: var(--chat-time-ai);
}

.chat-placeholder {
    margin: auto;
    color: var(--text-secondary);
    font-size: 13px;
}


.composer {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    background: transparent;
    position: relative;
    /* === MODERN CHAT FRAME === */
    border-radius: 14px;
    background: var(--chat-bg-system);
    padding: 0;
    border: 1px solid rgba(21, 101, 192, 0.25);

    background-origin: border-box;
    background-clip: padding-box, border-box;

    /*box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: box-shadow .15s ease, transform .05s ease;*/
}

.composer input {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #d0d3d8;
    font-size: 13px;
    outline: none;
}

.composer-stack {
    display: flex;
    flex-direction: column;
    border: 1px solid #d0d3d8;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: var(--chat-bg-system);

}

/* TOOLBAR SPACER */
.toolbar-spacer {
    flex: 1;
}

.composer-textarea {
    display: block;
    /* KLUCZ */
    width: 100%;
    min-height: 90px;
    max-height: 180px;
    overflow-y: auto;
    /* wracamy do auto */
    box-sizing: border-box;
    /* KLUCZ */
    padding: 12px;
    border: none;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    background: var(--chat-bg-system);
    font-family: inherit;
}

.composer-textarea::-webkit-scrollbar {
    width: 8px;
}

.composer-textarea::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 6px;
}

.composer-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

.composer-textarea:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px 12px;
    border-top: 1px solid #f1f5f9;
    background: var(--chat-bg-system);
}

/* SHORTCUTS — COMPOSER */
.composer-shortcuts {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* COMPOSER KEYBOARD HINTS */
.composer-hints {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    margin-bottom: 0px;
    user-select: none;
}

.composer-hints strong {
    font-weight: 500;
    color: var(--text-secondary);
}

.composer-hints kbd {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--text-secondary);
    font-family: inherit;
    border: 2px solid #e5e7eb;
}

.composer-separator {
    opacity: 0.5;
}

.composer-footer .btn-send:hover {
    background: #1f75d6;
    /* jaśniejszy niż #1565C0 */
}

.composer-translation-area {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.typing {
    font-style: italic;
    color: var(--text-secondary);
    height: 18px;
    margin-top: 4px;
}


/* ===== CONTEXT COMPONENT ===== */
.context {
    font-size: 12px;
}

.context .view-body {
    padding: 16px;
}

.context h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
}

.context-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #374151;
}

.context-row span:first-child {
    color: var(--text-secondary);
}


.layout-settings .context {
    flex: 0 0 20%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.layout-admin .context {
    flex: 0 0 25%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}


.btn-send {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-send:hover {
    background: #0F4FA8;
}

.btn-send:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
}


/* ===== AI MENU (DYNAMIC POPUP) ===== */
.ai-menu {
    position: absolute;
    min-width: 200px;

    background: var(--chat-bg-system);
    border-radius: 10px;
    border: 1px solid #e5e7eb;

    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 60;

    animation: aiFadeIn 0.12s ease;
}

@keyframes aiFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-menu-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #334155;
    transition: background 0.12s ease, color 0.12s ease;
}

.ai-menu-item:hover {
    background: rgba(21, 101, 192, 0.08);
    color: #1565C0;
}

.ai-menu-item:active {
    background: rgba(21, 101, 192, 0.14);
}

/* ==== OWNERSHIP STATES (FINAL SaaS PRO) ==== */

/* bazowa kropka */
.owner-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    bottom: 1px;
    left: 0px;
    border: 2px solid #fff;
    z-index: 2;
}

/* 🟢 wolna rozmowa */
.owner-free {
    background: #22c55e;
}

/* ⚪ cudza rozmowa */
.owner-other {
    background: #6b7280;
    border: 2px solid #fff;
}


/* ===== AVATAR INACTIVE (USERS) ===== */
.conversation-avatar.avatar-inactive {
    background: #e5e7eb !important;
    color: #6b7280 !important;
}

.conversation-avatar.avatar-inactive .avatar-icon svg {
    stroke: #6b7280;
    fill: #6b7280;
}



/* ===============================
   TRANSLATION AREA
================================= */


.translation-group {
    display: flex;
    position: relative;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.translation-visitor {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    opacity: 0.85;
}

.translation-separator {
    opacity: 0.4;
}

.translation-toggle {
    height: 30px;
    width: 96px;
    /* stała szerokość */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #1565C0;
    background: white;
    color: #1565C0;
    cursor: pointer;
    transition: 0.15s ease;

    margin-left: auto;
}

.translation-toggle.active {
    background: #1565C0;
    color: white;
}

/* ===============================
   TRANSLATION DROPDOWN
================================= */
.translation-dropdown {
    position: absolute;
    top: 38px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 96px;
    z-index: 20;
}

.translation-dropdown button {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #1565C0;
    background: white;
    color: #1565C0;
    cursor: pointer;
    transition: 0.15s ease;
    width: 100%;
}

.translation-dropdown button:hover {
    background: #1565C0;
    color: white;
}




/* ===== CHAT MESSAGE SPACING ===== */

/* mały odstęp dla każdej kolejnej wiadomości */
.chat-box p.operator+p.operator,
.chat-box p.visitor+p.visitor,
.chat-box p.ai+p.ai,
.chat-box p.system+p.system {
    margin-top: 4px;
}

/* duży odstęp gdy zmienia się nadawca */
.chat-box p.operator+p:not(.operator),
.chat-box p.visitor+p:not(.visitor),
.chat-box p.ai+p:not(.ai),
.chat-box p.system+p:not(.system) {
    margin-top: 30px;
}

/* większy odstęp przed komunikatem systemowym */
.chat-box p.ai+p.system,
.chat-box p.operator+p.system,
.chat-box p.visitor+p.system {
    margin-top: 40px;
}

/* większy odstęp po komunikacie systemowym */
.chat-box p.system+p.ai,
.chat-box p.system+p.operator {
    margin-top: 40px;
}


/* =====================================
   CHAT CONTEXT
===================================== */

.context-chat .view-body {
    padding: 16px;
}

.chat-context-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-client-card {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 16px;
    border-radius: 14px;

    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.chat-client-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.chat-client-avatar {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    font-size: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: #f1f5f9;
    color: #64748b;

    font-weight: 700;
}

.chat-client-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    text-align: center;
}

.chat-client-country {
    margin-top: 4px;

    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    text-align: center;
}

.chat-client-stats {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chat-stat-badge {
    padding: 5px 10px;

    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;

    font-size: 12px;
    font-weight: 500;
    color: #475569;
}

.chat-client-divider {
    width: 100%;
    height: 1px;

    margin: 16px 0 12px;

    background: rgba(15, 23, 42, 0.08);
}

.chat-client-contact {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 28px;

    padding-top: 2px;

    width: 100%;
}

.chat-client-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;
}

.chat-client-contact-item svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {

    .chat-client-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

}

.chat-client-contact-row {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}

.chat-client-contact-row span:first-child {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}



.chat-section-card {
    display: flex;
    flex-direction: column;

    padding: 16px;
    border-radius: 14px;

    border: 1px solid #e5e7eb;
    background: #ffffff;
}



.chat-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;

    margin-bottom: 14px;
}

.chat-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-field+.chat-field {
    margin-top: 8px;
}

.chat-field-label {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.chat-field-value {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
}

.chat-crm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 0;
}

.chat-crm-row+.chat-crm-row {
    border-top: 1px solid #f1f5f9;
}

.chat-crm-row .chat-field-value {
    text-align: right;
}

.chat-crm-row .chat-field-label {
    margin-bottom: 0;
}



.chat-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 18px;
}

.chat-section-heading-icon {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;

    flex-shrink: 0;
}

.chat-section-heading-icon svg {
    width: 18px;
    height: 18px;
}

.chat-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    margin-bottom: 8px;

    border: 1px solid #eef2f7;
    border-radius: 12px;

    background: #fafbfc;
}

.chat-activity-item:last-child {
    margin-bottom: 0;
}

.chat-activity-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(99, 102, 241, 0.06);
    color: #64748b;

    flex-shrink: 0;
}

.chat-activity-icon svg {
    width: 18px;
    height: 18px;
}

.chat-field-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 2px;
}

.chat-field-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}



.chat-history-item {
    display: flex;
    gap: 12px;

    padding: 8px 0;
}

.chat-history-item+.chat-history-item {
    border-top: 1px solid #f1f5f9;
}

.chat-history-time {
    width: 42px;
    flex-shrink: 0;

    font-size: 12px;
    color: #64748b;
}

.chat-history-text {
    font-size: 13px;
    color: #0f172a;
}



.chat-field-label-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-field-label-icon svg {
    width: 14px;
    height: 14px;

    color: #64748b;
    flex-shrink: 0;
}



.chat-insight-intent {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;

    padding: 6px 12px;

    border-radius: 999px;

    background: rgba(59, 130, 246, .08);
    border: 1px solid rgba(59, 130, 246, .16);

    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;

    margin-bottom: 14px;
}

.chat-insight-confidence {
    margin-bottom: 14px;
}

.chat-confidence-bar {
    width: 100%;
    height: 8px;

    margin-top: 8px;

    border-radius: 999px;
    overflow: hidden;

    background: #eef2f7;
}

.chat-confidence-fill {
    height: 100%;

    border-radius: 999px;

    background: #3b82f6;
}

.chat-confidence-value {
    margin-top: 6px;

    font-size: 12px;
    font-weight: 600;

    color: #475569;
}



.chat-tech-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 8px 0;
}

.chat-tech-row+.chat-tech-row {
    border-top: 1px solid #f1f5f9;
}

.chat-tech-row span {
    font-size: 12px;
    color: #64748b;
}

.chat-tech-row strong {
    font-size: 13px;
    color: #0f172a;
}



/* =====================================
   AUTOMATION TIMELINE
===================================== */

.chat-box .automation-timeline {
    align-self: center;
    width: min(520px, 86%);
    margin: 34px 0;
    padding: 18px 20px;

    border: 1px solid #e5e7eb;
    border-radius: 18px;

    background: #ffffff;
}

.automation-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 18px;

    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.automation-timeline-icon {
    font-size: 15px;
}

.automation-timeline-list {
    position: relative;

    display: flex;
    flex-direction: column;
    gap: 18px;
}

.automation-timeline-list::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;

    width: 1px;
    background: #e5e7eb;
}

.automation-timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
}

.automation-timeline-marker {
    width: 13px;
    height: 13px;
    margin-top: 3px;

    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #94a3b8;

    position: relative;
    z-index: 1;
}

.automation-timeline-content {
    min-width: 0;
}

.automation-timeline-title {
    margin-bottom: 4px;

    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.automation-timeline-body {
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

.automation-timeline-body strong {
    color: #0f172a;
    font-weight: 700;
}

.automation-timeline-item-clicked .automation-timeline-marker {
    background: #22c55e;
}

.automation-timeline-item-lead .automation-timeline-marker {
    background: #3b82f6;
}

.automation-timeline-item-finished .automation-timeline-marker {
    background: #0f172a;
}

.automation-lead-card {
    margin-top: 8px;
    padding: 12px 14px;

    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;

    background: rgba(59, 130, 246, 0.04);

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.automation-lead-card div {
    font-size: 13px;
    line-height: 1.4;
    color: #475569;
}

.automation-lead-card strong {
    color: #0f172a;
    font-weight: 700;
}



/* =====================================
   SYSTEM FORM CARD
===================================== */

.chat-box p.system-form-message {
    padding: 0;
    border: none;
    background: transparent;
    max-width: 520px;
    width: 100%;

    text-align: left;
    align-items: stretch;
    justify-content: flex-start;
}

.system-form-card {
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    padding: 16px 18px;

    min-width: 360px;
    max-width: 460px;

    text-align: left;
}

.system-form-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 12px;
}

.system-form-card-icon {
    font-size: 16px;
    line-height: 1;
}

.system-form-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.system-form-card-source {
    margin-top: 2px;

    font-size: 12px;
    color: #64748b;
}

.system-form-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-form-card-body div {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.system-form-card-body strong {
    color: #0f172a;
    font-weight: 700;
}



.chat-mobile-back {
    display: none;
}

/* =====================================================
   CHAT — MOBILE <768
   ===================================================== */

@media (max-width: 767px) {

    #view-chat {
        display: flex;
    }

    #view-chat .list,
    #view-chat .chat {
        flex: 1 1 auto;
        width: 100%;
    }

    /* domyślnie tylko lista */

    #view-chat .list {
        display: flex;
    }

    #view-chat .chat {
        display: none;
    }

    /* po otwarciu rozmowy */

    body.chat-mobile-conversation-open #view-chat .list {
        display: none;
    }

    body.chat-mobile-conversation-open #view-chat .chat {
        display: flex;
    }

    .chat-mobile-back {
        display: inline-flex;
        min-width: auto;
        padding: 0 12px;
        height: 34px;
        margin-right: 12px;
        flex-shrink: 0;
    }

    /* Search menu — mobile */

    #view-chat {
        position: relative;
    }

    #view-chat #searchMenu {
        left: auto !important;
        right: 12px !important;

        width: 280px;
        max-width: calc(100vw - 24px);

        transform: none !important;
    }

    /* ======= MOBILE TOOLBAR ========= */

    #view-chat .tool-format {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        min-width: 74px;
        padding: 0 12px;

        background: #fff;

        border: 1px solid #dbe4f0;
        border-radius: 8px;

        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 500;

        transition: .18s;
    }

    #view-chat .tool-format:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    #view-chat .composer-toolbar .tool-btn[data-tool]:not(.tool-ai):not(.tool-format) {
        display: none !important;
    }




}




/* =====================================================
   CHAT — TABLET 768–1023
   ===================================================== */

@media (min-width: 768px) and (max-width: 1023px) {

    #view-chat .list {
        flex: 0 0 220px;
    }

    #view-chat .list-search {
        padding: 8px 10px;
        gap: 4px;
    }

    #view-chat .list-search input {
        min-width: 0;
        font-size: 12px;
        padding: 8px 8px;
    }

    #view-chat .search-more-btn {
        width: 32px;
        height: 34px;
        flex: 0 0 32px;
    }

    #view-chat #conversations li {
        padding: 10px 10px;
        gap: 6px;
    }

    #view-chat .conversation-row {
        gap: 8px;
    }

    #view-chat .list-pagination-footer {
        gap: 6px;
        padding: 14px 10px;
    }

    #view-chat .load-more {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        font-size: 12px;
    }

    #view-chat .page-size-wrapper {
        gap: 6px;
        margin-left: 0;
    }

    #view-chat .page-size-label {
        font-size: 10px;
    }

    #view-chat .page-size-select {
        width: 46px;
        padding: 4px;
    }

    /* ======= TABLET TOOLBAR ========= */

    #view-chat .tool-format {

        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        min-width: 74px;
        padding: 0 12px;

        background: #fff;

        border: 1px solid #dbe4f0;
        border-radius: 8px;

        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 500;

        transition: .18s;
    }

    #view-chat .tool-format:hover {

        border-color: var(--primary-color);
        color: var(--primary-color);

    }

    #view-chat .composer-toolbar .tool-btn[data-tool]:not(.tool-ai):not(.tool-format) {
        display: none !important;
    }

}



/* =====================================================
   CHAT — LAPTOP NARROW 1024–1249
   ===================================================== */

@media (min-width: 1024px) and (max-width: 1249px) {

    #view-chat .list {
        flex-basis: 300px;
    }

    .chat-box .automation-timeline {
        width: min(440px, 82%);
    }

}



/* =====================================================
   CHAT — Desktop XL tight width with context open 
   ===================================================== */

@media (min-width: 1600px) and (max-width: 1699px) {

    body:not(.context-collapsed) #view-chat .composer-footer {
        gap: 8px;
    }

    body:not(.context-collapsed) #view-chat .composer-shortcuts {
        flex: 1 1 auto;
        min-width: 0;
    }

    body:not(.context-collapsed) #view-chat .tool-shortcut {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        padding: 0 10px;
    }

}