/**
 * Support Composer Shell — 3 cấp (compact / medium / large), Zalo-like.
 * Admin/portal: 50px → 120px → 180px+scroll
 * Widget:       44px → 140px → 140px+scroll
 */
.scs-shell {
    --scs-zalo-blue: #0068ff;
    --scs-zalo-bar: #f0f2f5;
    --scs-zalo-line: #e4e6eb;
    --scs-zalo-ink: #050505;
    --scs-zalo-muted: #8a8d91;
    --scs-zalo-icon: #65676b;
    --scs-icon-size: 34px;
    --scs-icon-svg: 20px;
    --scs-iconbar-h: 44px;
    --scs-line-h: 20px;
    --scs-input-h-compact: 58px;
    --scs-input-h-medium-max: 120px;
    --scs-input-h-large-max: 180px;
    --scs-input-py: 15px;
    --scs-action-h: 36px;
    --scs-shell-radius: 10px;
    background: #fff;
    border: 1px solid var(--scs-zalo-line);
    border-radius: var(--scs-shell-radius);
    overflow: visible;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Tin rỗng: glow nhẹ trên ô nhập — không alert */
.scs-shell.is-nudge-empty {
    border-color: var(--scs-zalo-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.28) !important;
}
.sc-ed-field.is-nudge-empty,
.sc-ed-wrap.is-nudge-empty .sc-ed-field {
    outline: none !important;
}

/* ── Icon bar — gọn kiểu Summernote / Zalo ── */
.scs-iconbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    min-height: var(--scs-iconbar-h);
    height: var(--scs-iconbar-h);
    background: #f8f9fa24;
    border-bottom: 1px solid var(--scs-zalo-line);
    flex-wrap: nowrap;
    box-sizing: border-box;
}
.scs-iconbar-left,
.scs-iconbar-end {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.scs-iconbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}

.scs-iconbtn {
    width: var(--scs-icon-size);
    height: var(--scs-icon-size);
    border-radius: 8px;
    margin-right: 8px;
    border: solid 0px #cccccc21;
    background: transparent;
    color: #5c6b7a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.scs-iconbtn:hover {
    background: #e9ecef;
    color: #1c1e21;
}
.scs-iconbtn.is-active,
.scs-iconbtn[aria-expanded="true"] {
    background: #dee2e6;
    color: var(--scs-zalo-blue);
    box-shadow: inset 0 0 0 1px rgba(0, 104, 255, 0.15);
}
.scs-iconbtn svg {
    display: block;
    width: var(--scs-icon-svg);
    height: var(--scs-icon-svg);
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Gợi ý nhanh — chip dropdown */
.scs-quick-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.scs-quick-pop {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 240px;
    max-width: 340px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 80;
    scrollbar-width: thin;
}
.scs-quick-pop[hidden] { display: none !important; }
.scs-quick-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--scs-zalo-ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease;
}
.scs-quick-chip:hover,
.scs-quick-chip:focus-visible {
    background: #f0f2f5;
    outline: none;
}
.scs-quick-chip-emoji {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-size: 15px;
    line-height: 1;
}
.scs-quick-chip-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scs-quick-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--scs-zalo-muted);
    text-align: center;
}

/* Preview ảnh / file đã chọn */
.scs-attach-preview {
    display: none;
    padding: 8px 10px 10px;
    background: #fafbfc;
    border-top: 1px solid #eef0f2;
}
.scs-attach-preview.is-visible {
    display: block;
}
.scs-attach-preview[hidden] {
    display: none !important;
}
.scs-attach-preview .support-upload-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px !important;
    align-items: flex-start;
    margin: 0 !important;
}
.scs-attach-preview .support-upload-slot {
    flex: 0 0 auto !important;
    width: auto !important;
    display: none;
}
/* JS sync gán/xóa attribute hidden theo is-empty — không phụ thuộc :has() */
.scs-attach-preview .support-upload-slot:not([hidden]) {
    display: block !important;
}
.scs-attach-preview .support-upload-slot[hidden] {
    display: none !important;
}
.scs-attach-preview .support-img-zone {
    position: relative;
    width: 72px !important;
    height: 72px !important;
    aspect-ratio: 1 !important;
    border-radius: 8px !important;
    border: 1px solid #dee2e6 !important;
    background: #fff !important;
    overflow: hidden;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.scs-attach-preview .support-img-zone.is-media {
    border-style: solid !important;
    border-color: #dee2e6 !important;
    background: #f8f9fa !important;
}
.scs-attach-preview .support-img-zone img,
.scs-attach-preview .support-img-zone .js-preview-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}
.scs-attach-preview .support-img-zone.is-empty {
    display: none !important;
}
.scs-attach-preview .support-img-overlay {
    opacity: 0 !important;
    pointer-events: none;
}
.scs-attach-preview .support-img-zone.has-img .support-img-overlay,
.scs-attach-preview .support-img-zone.has-media .support-img-overlay {
    opacity: 0 !important;
}
.scs-attach-preview .support-img-del {
    display: inline-flex !important;
    top: 4px !important;
    right: 4px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border: 1.5px solid #fff !important;
    border-radius: 50% !important;
    background: #ef4444 !important;
    color: #fff !important;
    font-size: 10px !important;
    line-height: 1 !important;
    padding: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 5;
    align-items: center;
    justify-content: center;
}
.scs-attach-preview .support-img-del i {
    font-size: 9px !important;
    line-height: 1;
}
.scs-attach-preview .support-img-zone.is-media.has-doc .support-img-overlay,
.scs-attach-preview .support-img-zone.is-media.has-audio .support-img-overlay {
    opacity: 1 !important;
    background: rgba(248, 250, 252, 0.92) !important;
    color: #475569 !important;
}
.scs-attach-preview .support-img-zone.is-media.has-doc .support-img-overlay i,
.scs-attach-preview .support-img-zone.is-media.has-audio .support-img-overlay i {
    font-size: 1.4rem !important;
    color: #dc2626 !important;
}

/* ── Hàng nhập ── */
.scs-input-row {
    background: #fff;
    min-width: 0;
    border-bottom: 0;
    overflow: visible;
}
.scs-input-inner {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    min-width: 0;
    overflow: visible;
}
.scs-field-row {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.support-wrap .scs-shell .sc-ed-wrap {
    border: 0;
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.sc-ed-field {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    font-size: 14px !important;
    line-height: var(--scs-line-h) !important;
    color: var(--scs-zalo-ink) !important;
    padding: var(--scs-input-py) 12px !important;
    transition: min-height 0.18s ease, max-height 0.18s ease;
    overflow-y: hidden !important;
    resize: none !important;
    background: #fff !important;
    word-break: break-word;
    white-space: pre-wrap;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sc-ed-field::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.sc-ed-field:empty:before {
    content: attr(data-placeholder);
    color: var(--scs-zalo-muted) !important;
    font-style: normal !important;
    pointer-events: none;
}

/* Cấp 1 — thu gọn 1 dòng */
.scs-shell[data-level="compact"] .sc-ed-field {
    min-height: var(--scs-input-h-compact) !important;
    max-height: var(--scs-input-h-compact) !important;
    overflow: hidden !important;
}

/* Cấp 2 — tự giãn 2–5 dòng */
.scs-shell[data-level="medium"] .sc-ed-field {
    min-height: calc(var(--scs-line-h) * 2 + var(--scs-input-py) * 2) !important;
    max-height: var(--scs-input-h-medium-max) !important;
    overflow-y: auto !important;
}

/* Cấp 3 — tối đa + cuộn trong ô */
.scs-shell[data-level="large"] .sc-ed-field {
    min-height: calc(var(--scs-line-h) * 4 + var(--scs-input-py) * 2) !important;
    max-height: var(--scs-input-h-large-max) !important;
    overflow-y: auto !important;
}

/* ── Inline actions (cấp 1: bên phải ô nhập) ── */
.scs-inline-actions {
    display: none;
    align-items: center;
    align-self: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 0 8px 0 4px;
    z-index: 5;
}
.scs-shell[data-level="compact"] .scs-inline-actions {
    display: inline-flex;
}

/* ── Bottom bar (cấp 2–3: format + thao tác) ── */
.scs-bottom-bar {
    display: none;
    background: #fff;
    border-top: 1px solid var(--scs-zalo-line);
}
.scs-shell[data-level="medium"] .scs-bottom-bar,
.scs-shell[data-level="large"] .scs-bottom-bar {
    display: block;
}

/* Admin/profile: format bar chỉ khi bấm T */
.scs-shell--format-on-demand .scs-bottom-bar {
    display: none !important;
}
.scs-shell--format-on-demand.is-format-on .scs-bottom-bar {
    display: block !important;
}
.scs-shell--format-on-demand .scs-inline-actions {
    display: inline-flex !important;
}
.scs-shell--format-on-demand.is-format-on .scs-inline-actions {
    display: none !important;
}
.scs-shell--format-on-demand .sc-ed-field {
    transition: none !important;
}

.scs-format-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px;
    min-height: 36px;
    background: #fff;
}
.scs-format-inner {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    flex: 0 1 auto;
    min-width: 0;
}
.scs-fmt-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--scs-zalo-icon);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s ease;
}
.scs-fmt-btn:hover {
    background: var(--scs-zalo-bar);
    color: var(--scs-zalo-ink);
}
.scs-format-sep {
    width: 1px;
    height: 20px;
    background: var(--scs-zalo-line);
    margin: 0 4px;
    flex-shrink: 0;
}
.scs-format-extra {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.scs-action-strip {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
}
.scs-shell .scs-action-strip .support-composer-actions,
.scs-shell .scs-inline-actions .support-composer-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

/* Nút thao tác trong shell — gọn hơn trang cũ */
.scs-shell .support-composer-more {
    position: relative;
    flex: 0 0 auto;
}
.scs-shell .support-composer-more-btn {
    width: var(--scs-action-h) !important;
    height: var(--scs-action-h) !important;
    min-width: var(--scs-action-h) !important;
    padding: 0 !important;
    border: 0px solid var(--scs-zalo-line) !important;
    border-radius: 30px !important;
    background: #fff !important;
    color: var(--scs-zalo-icon) !important;
    box-shadow: none !important;
    font-size: 15px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.scs-shell .support-composer-more-btn:hover,
.scs-shell .support-composer-more-btn.is-open,
.scs-shell .support-composer-more-btn[aria-expanded="true"] {
    background: var(--scs-zalo-bar) !important;
    color: var(--scs-zalo-ink) !important;
    border-color: var(--scs-zalo-line) !important;
}
.scs-shell .support-composer-more-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 300;
    min-width: 220px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.scs-shell .scs-bottom-bar .support-composer-more-panel,
.scs-shell .scs-action-strip .support-composer-more-panel {
    top: calc(100% + 8px);
    bottom: auto;
}
.scs-shell .support-composer-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #047857;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.scs-shell .support-composer-more-item:hover {
    background: #ecfdf5;
    color: #065f46;
}
.scs-shell .support-composer-more-item i {
    width: 1.1em;
    text-align: center;
    flex: 0 0 auto;
}
.scs-shell .support-composer-more-item--danger {
    color: #dc2626;
}
.scs-shell .support-composer-more-item--danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.scs-shell .support-composer-more-panel.is-floating {
    position: fixed !important;
    z-index: 10060 !important;
    right: auto !important;
    bottom: auto !important;
}

.scs-shell .support-emoji-btn,
.scs-shell .ep-trigger-btn {
    width: var(--scs-action-h) !important;
    height: var(--scs-action-h) !important;
    min-width: var(--scs-action-h) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--scs-zalo-icon) !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.scs-shell .support-emoji-btn:hover,
.scs-shell .ep-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--scs-zalo-ink) !important;
}
.scs-shell .support-emoji-btn svg,
.scs-shell .ep-trigger-btn svg {
    width: 22px !important;
    height: 22px !important;
}

.scs-shell .support-composer-actions .btn-gemini,
.scs-shell .scs-inline-actions .btn-gemini {
    height: var(--scs-action-h) !important;
    min-height: var(--scs-action-h) !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    white-space: nowrap;
}

/* Nút Gửi đồng bộ widget / admin / portal — Lucide arrow-up */
.scs-shell .scs-send-btn,
.scs-shell button.btn-gemini.scs-send-btn,
.scs-shell .scs-pill-send,
.ola-sw-ft .scs-shell .ola-sw-send,
.ola-sw-ft .scs-shell .scs-send-btn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #0068ff !important;
    color: #fff !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    font-size: 0 !important;
    line-height: 0 !important;
    white-space: nowrap;
    overflow: visible !important;
}
.scs-shell .scs-send-btn:hover,
.scs-shell button.btn-gemini.scs-send-btn:hover,
.scs-shell .scs-pill-send:hover,
.ola-sw-ft .scs-shell .ola-sw-send:hover,
.ola-sw-ft .scs-shell .scs-send-btn:hover {
    background: #0054d1 !important;
    color: #fff !important;
}
.scs-shell .scs-send-btn:active,
.scs-shell button.btn-gemini.scs-send-btn:active,
.ola-sw-ft .scs-shell .ola-sw-send:active {
    transform: scale(0.94);
}
.scs-shell .scs-send-btn svg,
.scs-shell .scs-pill-send svg,
.ola-sw-ft .scs-shell .ola-sw-send svg,
.ola-sw-ft .scs-shell .scs-send-btn svg {
    width: 18px !important;
    height: 18px !important;
    display: block;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}
.scs-shell .scs-send-btn.is-submitting,
.scs-shell button.btn-gemini.scs-send-btn.is-submitting,
.scs-shell .scs-pill-send.is-submitting {
    width: auto !important;
    min-width: 36px !important;
    max-width: none !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    border-radius: 17px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: #fff !important;
    flex: 0 0 auto !important;
    gap: 6px;
}

.scs-shell .support-char-count {
    font-size: 12px !important;
    color: var(--scs-zalo-muted) !important;
    white-space: nowrap;
    margin: 0 4px 0 0 !important;
    flex: 0 0 auto;
}
.scs-shell .support-char-count.is-over {
    color: #e41e3f !important;
}
.scs-shell .scs-iconbar .support-char-count,
.scs-shell[data-level="compact"] .support-char-count {
    display: none !important;
}

.scs-shell .support-template-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.scs-shell[data-level="compact"] .scs-format-bar .support-template-toolbar-group {
    display: none !important;
}

/* Upload zone cũ — ẩn footer large (đã chuyển sang scs-attach-preview) */
.scs-footer {
    display: none !important;
}
.scs-shell .support-reply-composer {
    margin-top: 0 !important;
    border: 0;
    background: transparent;
}

/* Ẩn upload box style cũ khi nằm trong shell */
.scs-shell .support-upload-box {
    margin-top: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ── Widget: Zalo-style — 😊 📷 📎 | textbox | Gửi ── */
.ola-sw-ft .scs-shell {
    --scs-input-h-compact: 40px;
    --scs-input-h-medium-max: 120px;
    --scs-input-h-large-max: 120px;
    --scs-input-py: 10px;
    --scs-pill-bg: #f0f2f5;
    --scs-pill-border: transparent;
    --scs-circle: #eef0f3;
    position: relative;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0;
    overflow: visible;
    box-shadow: none !important;
}
.ola-sw-ft .scs-shell .scs-iconbar {
    display: none !important;
}
.ola-sw-ft .scs-shell .scs-composer-line,
.ola-sw-ft .scs-shell .scs-composer-line--pill {
    display: flex;
    align-items: flex-end;
    gap: 0;
    width: 100%;
    min-width: 0;
}
/* LiveChat-style pill: [+] input [⚡][😊][↑] */
.ola-sw-ft .scs-shell .scs-pill {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 6px 8px 6px 6px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-radius 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ola-sw-ft .scs-shell.is-multiline .scs-pill {
    border-radius: 22px;
    align-items: flex-end;
}
.ola-sw-ft .scs-shell .scs-pill:focus-within {
    border-color: #98a2b3;
    box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.08);
}
.ola-sw-ft .scs-shell .scs-pill-btn {
    appearance: none;
    -webkit-appearance: none;
    position: static !important;
    transform: none !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f2f4f7 !important;
    color: #344054 !important;
    box-shadow: none !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.ola-sw-ft .scs-shell .scs-pill-btn:hover,
.ola-sw-ft .scs-shell .scs-pill-btn.is-active {
    background: #e4e7ec !important;
    color: #101828 !important;
}
.ola-sw-ft .scs-shell .scs-pill-btn:active {
    transform: scale(0.96);
}
.ola-sw-ft .scs-shell .scs-pill-btn svg {
    display: block;
    width: 18px;
    height: 18px;
}
.ola-sw-ft .scs-shell .scs-btn-plus {
    background: #f2f4f7 !important;
}
.ola-sw-ft .scs-shell .scs-plus-wrap,
.ola-sw-ft .scs-shell .scs-quick-wrap--tool {
    position: relative;
    flex-shrink: 0;
    align-self: center;
}
.ola-sw-ft .scs-shell .scs-plus-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 92;
    min-width: 168px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e4e7ec;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
}
/* Mobile: panel overflow:hidden cắt menu — dùng fixed + JS đặt vị trí */
.ola-sw-ft .scs-shell .scs-plus-menu.is-floating {
    position: fixed !important;
    right: auto;
    z-index: 1000050 !important;
    max-width: min(220px, calc(100vw - 16px));
}
.ola-sw-ft .scs-shell .scs-plus-menu[hidden] {
    display: none !important;
}
.ola-sw-ft .scs-shell .scs-plus-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #101828;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}
.ola-sw-ft .scs-shell .scs-plus-item:hover,
.ola-sw-ft .scs-shell .scs-plus-item:focus-visible {
    background: #f2f4f7;
    outline: none;
}
.ola-sw-ft .scs-shell .scs-plus-item__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eff4ff;
    color: #0068ff;
    flex-shrink: 0;
}
.ola-sw-ft .scs-shell .scs-plus-item__ico svg {
    width: 18px;
    height: 18px;
}
.ola-sw-ft .scs-shell .scs-plus-item[data-kind="file"] .scs-plus-item__ico {
    background: #f2f4f7;
    color: #475467;
}
.ola-sw-ft .scs-shell .scs-quick-wrap--tool .scs-quick-pop {
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 10px);
    z-index: 91;
}
.ola-sw-ft .scs-shell .scs-pill-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
}
.ola-sw-ft .scs-shell .scs-input-inner {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-end;
    gap: 0;
    min-width: 0;
    padding: 2px 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.ola-sw-ft .scs-shell.is-multiline .scs-input-inner {
    border-radius: 0;
}
.ola-sw-ft .scs-shell .scs-input-inner .ola-sw-composer {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: stretch;
    min-width: 0;
    gap: 0;
    width: 100%;
}
.ola-sw-ft .scs-shell .ola-sw-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}
.ola-sw-ft .scs-shell .ola-sw-input-wrap textarea {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none !important;
    font-size: 14px !important;
    line-height: var(--scs-line-h) !important;
    padding: 8px 4px !important;
    color: var(--scs-zalo-ink) !important;
    width: 100% !important;
    display: block;
}
.ola-sw-ft .scs-shell.scs-shell--widget .ola-sw-input-wrap textarea {
    min-height: 34px;
    max-height: var(--scs-input-h-medium-max);
    overflow-y: auto !important;
}
.ola-sw-ft .scs-shell[data-level="compact"] .ola-sw-input-wrap textarea {
    min-height: 34px;
    max-height: 34px;
    overflow: hidden !important;
}
.ola-sw-ft .scs-shell[data-level="medium"] .ola-sw-input-wrap textarea,
.ola-sw-ft .scs-shell[data-level="large"] .ola-sw-input-wrap textarea {
    min-height: calc(var(--scs-line-h) * 2 + 8px);
    max-height: var(--scs-input-h-medium-max);
    overflow-y: auto !important;
}
.ola-sw-ft .scs-shell .scs-attach-hidden,
.ola-sw-ft .scs-shell .ola-sw-attach-wrap {
    display: none !important;
}
.ola-sw-ft .scs-shell .ola-sw-inline-actions,
.ola-sw-ft .scs-shell .scs-widget-action-wrap {
    display: none !important;
}
.ola-sw-ft .scs-shell .scs-pill-send,
.ola-sw-ft .scs-shell .scs-composer-line .ola-sw-send,
.ola-sw-ft .scs-shell .scs-composer-line .scs-send-btn {
    position: static !important;
    transform: none !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex-shrink: 0;
    align-self: center;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #0068ff !important;
    color: #fff !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
.ola-sw-ft .scs-shell .scs-pill-send:hover,
.ola-sw-ft .scs-shell .scs-composer-line .ola-sw-send:hover,
.ola-sw-ft .scs-shell .scs-composer-line .scs-send-btn:hover {
    background: #0054d1 !important;
}
.ola-sw-ft .scs-shell .scs-pill-send svg,
.ola-sw-ft .scs-shell .scs-composer-line .ola-sw-send svg {
    width: 18px;
    height: 18px;
}
.ola-sw-ft .scs-shell .scs-pill-send:disabled,
.ola-sw-ft .scs-shell .scs-composer-line .ola-sw-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
/* legacy tool-row (nếu còn) — ẩn trong layout pill */
.ola-sw-ft .scs-shell--livechat .scs-tool-row {
    display: none !important;
}
.ola-sw-ft .scs-shell[data-level="compact"] .scs-bottom-bar,
.ola-sw-ft .scs-shell[data-level="medium"] .scs-bottom-bar,
.ola-sw-ft .scs-shell[data-level="large"] .scs-bottom-bar {
    display: none !important;
}
.ola-sw-ft .scs-shell .ola-sw-char-count {
    display: none !important;
}

/* Margin trang */
.support-edit-page .thread-ft > .scs-shell,
.support-detail-page .thread-ft > .scs-shell,
.support-create-composer > .scs-shell {
    margin-top: 8px;
}

/* ── Modal tiêu đề gợi ý (⚡) — nổi, không đẩy layout ── */
.scs-quick-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.scs-quick-modal[hidden] {
    display: none !important;
}
.scs-quick-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.scs-quick-modal__panel {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: scs-quick-modal-in 0.18s ease-out;
}
@keyframes scs-quick-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.scs-quick-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}
.scs-quick-modal__title {
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
}
.scs-quick-modal__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #65676b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.scs-quick-modal__close:hover {
    background: #e9ecef;
    color: #1c1e21;
}
.scs-quick-modal__body {
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.scs-quick-modal__body .scs-quick-chip {
    border-radius: 8px;
}
.scs-quick-modal__body .scs-quick-chip-text {
    white-space: normal;
    line-height: 1.35;
}
body.scs-quick-modal-open {
    overflow: hidden;
}

/* Admin / format-on-demand: khung ngoài bo 4 góc đồng nhất */
.scs-shell.scs-shell--format-on-demand {
    --scs-shell-radius: 10px;
    border-radius: var(--scs-shell-radius);
}
.scs-shell.scs-shell--admin {
    --scs-shell-radius: 10px;
    border-color: #dfe3e8;
    border-radius: var(--scs-shell-radius);
    overflow: visible;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.scs-shell.scs-shell--admin > .scs-iconbar {
    border-bottom: 1px solid var(--scs-zalo-line);
    border-top-left-radius: calc(var(--scs-shell-radius) - 1px);
    border-top-right-radius: calc(var(--scs-shell-radius) - 1px);
    overflow: hidden;
}
.scs-shell.scs-shell--admin:not(.is-format-on) > .scs-input-row {
    border-bottom-left-radius: calc(var(--scs-shell-radius) - 1px);
    border-bottom-right-radius: calc(var(--scs-shell-radius) - 1px);
    overflow: visible;
}
.scs-shell.scs-shell--admin:not(.is-format-on) .sc-ed-field {
    border-bottom-left-radius: calc(var(--scs-shell-radius) - 1px);
}
.scs-shell.scs-shell--admin.is-format-on > .scs-bottom-bar {
    border-bottom-left-radius: calc(var(--scs-shell-radius) - 1px);
    border-bottom-right-radius: calc(var(--scs-shell-radius) - 1px);
    overflow: visible;
}
.scs-shell.scs-shell--admin .scs-bottom-bar,
.scs-shell.scs-shell--admin .scs-format-bar,
.scs-shell.scs-shell--admin .scs-action-strip,
.scs-shell.scs-shell--admin .scs-inline-actions,
.scs-shell.scs-shell--admin .support-composer-more {
    overflow: visible;
}
.scs-shell.scs-shell--admin > .scs-input-row,
.scs-shell.scs-shell--admin > .scs-attach-preview,
.scs-shell.scs-shell--admin > .scs-bottom-bar,
.scs-shell.scs-shell--admin .scs-input-inner,
.scs-shell.scs-shell--admin .scs-field-row,
.scs-shell.scs-shell--admin .sc-ed-wrap,
.scs-shell.scs-shell--admin .sc-ed-field {
    border-radius: 0;
    box-shadow: none;
}
.scs-shell.scs-shell--admin .scs-inline-actions {
    padding-right: 0px;
}
.scs-shell.scs-shell--admin > .scs-bottom-bar {
    border-top: 1px solid var(--scs-zalo-line);
}
.scs-shell.scs-shell--admin > .scs-attach-preview {
    border-top: 1px solid #eef0f2;
}

/* Create portal: khớp Admin Edit — không lộ textarea / wrap ngoài shell */
.support-create-composer > textarea.sc-ed-source,
.support-create-composer > .support-composer-input.sc-ed-source,
.thread-ft > textarea.sc-ed-source,
.thread-ft > .support-composer-input.sc-ed-source {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    z-index: -1 !important;
}
.support-create-composer > .sc-ed-wrap,
.thread-ft > .sc-ed-wrap {
    display: none !important;
}

/* PC: nút Gửi luôn trong flex — không absolute / không bị neo vv-width cắt mép phải */
@media (min-width: 1025px) {
    .support-desk--portal #pnlReply.thread-ft,
    .support-desk--portal #pnlReply .scs-shell {
        width: auto !important;
        max-width: none !important;
    }
    .support-desk--portal #pnlReply .scs-send-btn,
    .support-desk--portal #pnlReply button.btn-gemini.scs-send-btn {
        position: static !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        z-index: auto !important;
    }
    .support-desk--portal #pnlReply .scs-send-btn:active,
    .support-desk--portal #pnlReply button.btn-gemini.scs-send-btn:active {
        transform: scale(0.94) !important;
    }
    .support-desk--portal #pnlReply .scs-input-inner {
        padding-right: 8px !important;
        overflow-x: visible !important;
    }
}

@media (max-width: 1024px) {
    /*
     * iPhone Chrome/Safari: font < 16px → zoom khi focus → tràn ngang, che nút Gửi.
     * PC DevTools không zoom nên vẫn “OK” khi thu nhỏ.
     */
    .scs-shell {
        --scs-line-h: 22px;
    }
    .scs-shell .sc-ed-field {
        font-size: 16px !important;
        line-height: var(--scs-line-h) !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    .scs-shell,
    .scs-shell .scs-input-row,
    .scs-shell .scs-input-inner,
    .support-desk #pnlReply.thread-ft {
        touch-action: pan-y;
        overscroll-behavior-x: none;
    }

    /* Portal iPhone: ghim nút Gửi — không phụ thuộc hàng flex bị scroll ngang */
    .support-desk--portal #pnlReply.thread-ft {
        position: relative !important;
        overflow-x: clip !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .support-desk--portal #pnlReply .scs-shell,
    .support-desk--portal #pnlReply .scs-input-row {
        position: relative !important;
        overflow-x: clip !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .support-desk--portal #pnlReply .scs-input-inner {
        padding-right: 44px !important;
        overflow-x: hidden !important;
    }
    .support-desk--portal #pnlReply .scs-send-btn,
    .support-desk--portal #pnlReply button.btn-gemini.scs-send-btn {
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 20 !important;
        margin: 0 !important;
    }
    .support-desk--portal #pnlReply .scs-send-btn:active,
    .support-desk--portal #pnlReply button.btn-gemini.scs-send-btn:active {
        transform: translateY(-50%) scale(0.94) !important;
    }
    .support-desk--portal #pnlReply .scs-send-btn.is-submitting,
    .support-desk--portal #pnlReply button.btn-gemini.scs-send-btn.is-submitting {
        position: absolute !important;
        right: 6px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        max-width: 46vw !important;
    }
    /* Khi visualViewport neo width (JS) */
    html.ola-vv-kb .support-desk--portal #pnlReply.thread-ft {
        width: var(--ola-vv-width, 100%) !important;
        max-width: var(--ola-vv-width, 100%) !important;
    }
    .support-desk--portal #pnlReply .scs-iconbar {
        overflow-x: hidden !important;
    }
}

@media (max-width: 575.98px) {
    /* Khóa tràn ngang — vẫn giữ ô nhập nhìn thấy (min-height + không collapse wrap) */
    .scs-shell,
    .scs-shell.scs-shell--admin {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .scs-shell > .scs-iconbar {
        min-width: 0 !important;
        overflow-x: hidden !important;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .scs-shell > .scs-iconbar::-webkit-scrollbar {
        display: none;
        height: 0;
    }
    .scs-shell .scs-iconbtn {
        margin-right: 2px !important;
    }
    .scs-shell .scs-input-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .scs-shell .scs-input-inner {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 2px !important;
        padding: 6px 8px 6px 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .scs-shell .scs-field-row,
    .scs-shell .sc-ed-wrap {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    .scs-shell .sc-ed-field {
        min-width: 0 !important;
        min-height: var(--scs-input-h-compact, 44px) !important;
        width: auto !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .scs-shell .scs-inline-actions,
    .scs-shell .scs-inline-actions .support-composer-actions {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        padding: 0 2px 0 0 !important;
        margin: 0 !important;
        align-items: center !important;
    }
    .scs-shell .support-composer-more-btn,
    .scs-shell .support-emoji-btn,
    .scs-shell .ep-trigger-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
    .scs-shell .scs-send-btn,
    .scs-shell button.btn-gemini.scs-send-btn {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        flex: 0 0 34px !important;
    }
    .support-desk #pnlReply.thread-ft,
    .support-desk .thread-ft {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    .scs-shell .scs-format-inner {
        flex-wrap: wrap;
    }
    .scs-footer-uploads .support-upload-grid {
        flex-wrap: wrap !important;
    }
    .scs-attach-preview .support-img-zone {
        width: 64px !important;
        height: 64px !important;
    }
}
