/* CRM V2 inbox. Load after the existing messenger feature styles. */
html[data-crm-ui="v2"] .crm-v2-inbox .empty-actions .btn { min-height:38px; padding:8px 14px; border-radius:9px; font-size:13px; box-shadow:none; }
html[data-crm-ui="v2"] .crm-v2-inbox .empty-actions .btn-primary { background:var(--primary,#087F8D); border:1px solid var(--primary,#087F8D); color:var(--brand-on-accent,#fff); }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-empty .empty-actions .btn-primary { background:var(--bg-card,#fff); border-color:var(--border-color,#d3dade); color:var(--text-primary,#0b1f2a); }
@media (max-width:768px) { html[data-crm-ui="v2"] .crm-v2-inbox .empty-actions .btn { min-height:44px; } }
html[data-crm-ui="v2"] body > #crm-v2-export-print-document { display: none; }
@media print {
    @page crm-v2-conversation-export { size: A4; margin: 14mm; }
    html[data-crm-ui="v2"]:has(body > #crm-v2-export-print-document) { background: #fff !important; color-scheme: light !important; }
    html[data-crm-ui="v2"] body:has(> #crm-v2-export-print-document) { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
    html[data-crm-ui="v2"] body:has(> #crm-v2-export-print-document) > :not(#crm-v2-export-print-document) { display: none !important; }
    html[data-crm-ui="v2"] body > #crm-v2-export-print-document { display: block !important; page: crm-v2-conversation-export; width: auto; margin: 0; padding: 0; background: #fff; color: #172b35; font: 10pt/1.45 var(--font-family, Geist, Arial, sans-serif); }
    html[data-crm-ui="v2"] #crm-v2-export-print-document h1 { margin: 0 0 8pt; color: #172b35; font-size: 18pt; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document h2 { margin: 16pt 0 6pt; font-size: 13pt; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document header { margin-bottom: 12pt; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document p { margin: 0 0 6pt; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document table { width: 100%; table-layout: fixed; border-collapse: collapse; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document thead { display: table-header-group; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document tr { break-inside: avoid; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document th,
    html[data-crm-ui="v2"] #crm-v2-export-print-document td { padding: 6pt; border: 1px solid #ccd7d9; color: #172b35; vertical-align: top; text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document td { background: #fff !important; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document th { background: #edf3f1; font-weight: 650; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document a { color: #16516c; text-decoration: underline; overflow-wrap: anywhere; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document .crm-v2-export-print-notes article { margin-bottom: 9pt; padding: 8pt; border: 1px solid #ccd7d9; break-inside: avoid; }
    html[data-crm-ui="v2"] #crm-v2-export-print-document .crm-v2-export-print-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
}
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form { display: grid; gap: 12px; min-width: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form > p { margin: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form input[type="checkbox"] { accent-color: var(--primary, #00707F); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form fieldset { display: flex; flex-wrap: wrap; gap: 10px 16px; border: 1px solid var(--border-color); border-radius: 9px; padding: 12px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form > label:has(select) { flex-direction: column; align-items: stretch; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form [data-export-dates]:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form [data-export-dates] label { flex-direction: column; align-items: stretch; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-summary { padding-top: 16px; border-top: 1px solid var(--border-color); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-summary pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; font: inherit; padding: 12px; background: var(--bg-hover); border-radius: 9px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-form .text-muted { font-size: 12px; }
html[data-crm-ui="v2"] .crm-v2-inbox {
    --wa-surface: var(--crm-v2-surface, #fff);
    --wa-soft: #f0f2f2;
    --wa-selected: #e9eeef;
    --wa-canvas: #eee9e1;
    --wa-pattern: rgba(105, 91, 72, .12);
    --wa-incoming: #fff;
    --wa-outgoing: #d7f5e6;
    --wa-accent: #0b7a62;
    --wa-on-accent: #fff;
    --wa-chip: #d7f5e6;
    --wa-note: #fff4cc;
    --wa-note-border: #d4a72c;
    --text-primary: #0b1f2a;
    --text-secondary: #3e525c;
    --text-muted: #5b6d76;
    --border-color: #dce2e4;
    --wa-shadow: 0 1px 1px rgba(11, 20, 26, .14);
    min-height: 0;
    isolation: isolate;
    font-size: 14px;
    line-height: 1.45;
}
html[data-crm-ui="v2"][data-theme="dark"] .crm-v2-inbox {
    --wa-surface: #14232b;
    --wa-soft: #20323a;
    --wa-selected: #2b414b;
    --wa-canvas: #111e25;
    --wa-pattern: rgba(184, 202, 209, .08);
    --wa-incoming: #20323a;
    --wa-outgoing: #164f43;
    --wa-accent: #63d5b8;
    --wa-on-accent: #092b23;
    --wa-chip: #224a40;
    --wa-note: #423919;
    --wa-note-border: #9b863c;
    --text-primary: #ecf2f4;
    --text-secondary: #ccdade;
    --text-muted: #b2c2c8;
    --border-color: #354951;
}
html[data-crm-ui="v2"] .crm-v2-inbox .chat-sidebar {
    width: clamp(360px, 29vw, 420px);
    flex-shrink: 0;
}
html[data-crm-ui="v2"] .crm-v2-inbox .chat-sidebar-header { padding: 14px 14px 8px 20px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-list-heading { margin-bottom: 12px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-list-heading h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-search input { min-height: 38px; border-radius: 9px; background: var(--wa-soft); }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-filters { padding-top: 10px; gap: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-filter-btn { border-radius: 999px; min-height: 32px; padding: 5px 12px; font-size: 13px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-filter-btn.active { color: var(--wa-accent); background: var(--wa-chip); font-weight: 600; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-closed-filter { display: flex; align-items: center; width: 100%; gap: 20px; border-radius: 0; margin-top: 8px; min-height: 44px; background: transparent; text-align: start; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-closed-filter > i:last-child { margin-inline-start: auto; font-size: 11px; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation { position: relative; min-height: 72px; padding: 10px 16px 10px 14px; gap: 13px; border: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation::after { content: ""; position: absolute; inset: auto 0 0 76px; height: 1px; background: var(--border-color); opacity: .65; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation:focus-visible { outline: 2px solid var(--wa-accent); outline-offset: -3px; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation .avatar { width: 49px; height: 49px; background: var(--wa-chip); color: var(--wa-accent); font-size: 19px; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation .crm-v2-unknown-avatar { background: var(--wa-selected); color: var(--text-muted); }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-name-row { gap: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-info { overflow: hidden; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-name { min-width: 0; font-size: 15px; font-weight: 500; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-item.unread .conversation-name { font-weight: 650; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-channel { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-preview { margin-top: 4px; font-size: 13px; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-meta { min-width: 42px; align-self: stretch; justify-content: space-between; gap: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-item:is(:hover, :focus-within) .conversation-meta { opacity: 1; }
html[data-crm-ui="v2"] .crm-v2-inbox .conversation-time { font-size: 11px; font-variant-numeric: tabular-nums; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation-badges { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-assigned-avatar { display: grid; place-items: center; flex: 0 0 20px; box-sizing: border-box; width: 20px; min-width: 20px; height: 20px; border: 1px solid var(--wa-accent); border-radius: 50%; background: var(--wa-surface); color: var(--wa-accent); font-size: 10px; font-weight: 650; line-height: 1; }
html[data-crm-ui="v2"] .crm-v2-inbox .badge-count { min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header { min-height: 60px; padding: 8px 16px; gap: 10px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header .avatar { width: 40px; height: 40px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-info { min-width: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-name { font-size: 15px; font-weight: 650; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-status { font-size: 12px; gap: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-actions { gap: 4px; flex-wrap: wrap; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-header-shortcuts { display: flex; position: relative; order: 2; align-items: center; gap: 3px; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-conversation-primary { display: inline-flex; order: 3; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 13px; border: 0; border-radius: 999px; background: var(--wa-accent); color: var(--wa-on-accent); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
html[data-crm-ui="v2"] .crm-v2-inbox .messages-container { background-image: radial-gradient(var(--wa-pattern) .7px, transparent .8px), radial-gradient(var(--wa-pattern) .5px, transparent .6px); background-position: 0 0, 9px 10px; background-size: 20px 20px, 29px 29px; padding: 24px clamp(18px, 4vw, 64px); gap: 7px; }
html[data-crm-ui="v2"] .crm-v2-inbox .message { position: relative; width: fit-content; max-width: min(82%, 620px); padding: 7px 10px 6px; border-radius: 8px; font-size: 14px; line-height: 1.45; overflow: visible; }
html[data-crm-ui="v2"] .crm-v2-inbox .message.inbound::before { content: ""; position: absolute; inset: 0 auto auto -7px; border-right: 8px solid var(--wa-incoming); border-bottom: 12px solid transparent; }
html[data-crm-ui="v2"] .crm-v2-inbox .message.outbound::before { content: ""; position: absolute; inset: 0 -7px auto auto; border-left: 8px solid var(--wa-outgoing); border-bottom: 12px solid transparent; }
html[data-crm-ui="v2"] .crm-v2-inbox .message-time { margin: 4px 0 0 12px; justify-content: flex-end; font-size: 11px; font-variant-numeric: tabular-nums; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-message-sender { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; padding-inline-end: 18px; font-size: 12px; font-weight: 650; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-message-sender.is-ai { color: #00606d; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-message-sender.is-agent { color: #1a52a8; }
html[data-crm-ui="v2"][data-theme="dark"] .crm-v2-inbox .crm-v2-message-sender.is-ai { color: #8bdce8; }
html[data-crm-ui="v2"][data-theme="dark"] .crm-v2-inbox .crm-v2-message-sender.is-agent { color: #adcbff; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-message-content { overflow-wrap: anywhere; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-message-ticks { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
html[data-crm-ui="v2"] .crm-v2-inbox .message-status.read { color: #2a7cc4; }
html[data-crm-ui="v2"] .crm-v2-inbox .message-status svg { width: 18px; height: 12px; vertical-align: middle; }
html[data-crm-ui="v2"] .crm-v2-inbox .msg-dropdown { z-index: 3; }
html[data-crm-ui="v2"] .crm-v2-inbox .msg-dropdown-btn { min-width: 28px; min-height: 28px; }
html[data-crm-ui="v2"] .crm-v2-inbox .message audio { max-width: min(250px, 100%) !important; }
html[data-crm-ui="v2"] .crm-v2-inbox .message :is(img, video) { max-width: 100% !important; }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-area { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); background: var(--wa-soft); }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-row { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 8px; align-items: flex-end; }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-input-wrapper { position: relative; background: var(--wa-surface); border-radius: 22px; padding: 2px 10px; border: 1px solid transparent; }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-input-wrapper:focus-within { border-color: var(--wa-accent); }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-input { min-height: 42px; font-size: 14px; padding: 10px 4px; }
html[data-crm-ui="v2"] .crm-v2-inbox :is(.compose-send, .voice-record-btn) { width: 42px; height: 42px; border-radius: 50%; background: var(--wa-accent); color: var(--wa-on-accent); }
html[data-crm-ui="v2"] .crm-v2-inbox .compose-actions { padding-bottom: 2px; }
html[data-crm-ui="v2"] .crm-v2-inbox .contact-info-panel { background: var(--wa-soft); }
html[data-crm-ui="v2"] .crm-v2-inbox .contact-info-panel.open { width: 340px; }
html[data-crm-ui="v2"] .crm-v2-inbox .contact-info-panel .cip-inner { width: 340px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-header { min-height: 60px; background: var(--wa-surface); padding: 10px 18px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-profile { background: var(--wa-surface); margin-bottom: 10px; padding: 24px 18px 18px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-avatar { width: 96px; height: 96px; font-size: 32px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-name { font-size: 20px; font-weight: 650; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-actions { background: var(--wa-surface); padding: 12px; gap: 6px; margin-bottom: 10px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-action-btn { min-height: 68px; padding: 8px 4px; border: 1px solid var(--border-color); background: var(--wa-surface); color: var(--wa-accent); border-radius: 10px; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-section { background: var(--wa-surface); margin-bottom: 10px; padding: 16px 20px; border: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox .cip-section-title { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
html[data-crm-ui="v2"] .crm-v2-inbox :is(.contact-menu, .msg-dropdown-menu, .assign-dropdown) { background: var(--wa-surface); color: var(--text-primary); border-radius: 10px; box-shadow: 0 4px 18px rgba(11, 20, 26, .18); }
html[data-crm-ui="v2"] .crm-v2-inbox :is(.contact-menu-item, .contact-menu-action, .msg-menu-item, .assign-item) { min-height: 44px; }
html[data-crm-ui="v2"] .crm-v2-inbox :is(button, a, input, textarea, select):focus-visible { outline: 2px solid var(--wa-accent); outline-offset: 2px; }
html[data-crm-ui="v2"] #messenger-modals .modal { border-radius: 14px; box-shadow: 0 16px 56px rgba(5, 35, 48, .25); }
html[data-crm-ui="v2"] #messenger-modals .modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color, #dce2e4); }
html[data-crm-ui="v2"] #messenger-modals .modal-body { padding: 20px 22px; }
html[data-crm-ui="v2"] #messenger-modals .modal-footer { padding: 14px 22px; }
html[data-crm-ui="v2"] #messenger-modals .btn-primary { border-radius: 999px; background: var(--primary, #0b7a62); color: var(--brand-on-accent, #fff); }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-notes-panel { background: var(--wa-soft); border-inline-start: 1px solid var(--border-color); }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-note-visibility { font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
html[data-crm-ui="v2"] .crm-v2-inbox .note-card { background: var(--wa-note); color: var(--text-primary); border: 1px dashed var(--wa-note-border); border-radius: 8px; box-shadow: none; }
html[data-crm-ui="v2"] .crm-v2-inbox .notes-compose textarea { background: var(--wa-note); color: var(--text-primary); }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-media-preview { display: flex; gap: 12px; align-items: center; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-media-meta { display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-quick-reply { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal { --inbox-dialog-accent: var(--primary-color, #0b7a62); color: var(--text-primary); padding: 20px; overflow-y: auto; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .modal-dialog { border-radius: 14px; max-width: min(860px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--bg-card, #fff); box-shadow: 0 16px 56px rgba(5, 35, 48, .25); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal:has(.crm-v2-dialog-grid) .modal-dialog { width: min(860px, 100%) !important; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal :is(.modal-body, .modal-content) { overflow-y: auto; min-height: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-color); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal :is(.modal-header h3, .modal-header h2) { margin: 0; font-size: 19px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .modal-body { padding: 20px 22px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .btn-primary { border-radius: 999px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-dialog-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-dialog-selection { min-width: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-dialog-preview { min-width: 0; padding: 16px; border-radius: 10px; background: var(--bg-tertiary, #f0f2f2); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-preview-wall { background: #eee9e1; background-image: radial-gradient(rgba(105, 91, 72, .12) .7px, transparent .8px); background-size: 20px 20px; padding: 20px; border-radius: 10px; color: #0b1f2a; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-preview-bubble { padding: 12px; border-radius: 8px; background: #d7f5e6; color: #0b1f2a; box-shadow: 0 1px 1px rgba(11, 20, 26, .14); overflow-wrap: anywhere; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-cards { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; margin-bottom: 16px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-card { padding: 12px; text-align: start; font: inherit; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 9px; cursor: pointer; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-card.is-selected { border-color: var(--inbox-dialog-accent); box-shadow: inset 3px 0 var(--inbox-dialog-accent); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-card:disabled { opacity: .55; cursor: not-allowed; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-template-card-body { display: block; font-size: 13px; color: var(--text-secondary); }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-options { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-options > p { grid-column: 1 / -1; margin: 0; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-option small { display: block; margin-top: 4px; font-weight: 400; white-space: normal; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-option { display: flex; align-items: center; gap: 12px; min-height: 88px; padding: 16px; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-primary); background: var(--bg-card); text-align: start; font: inherit; cursor: pointer; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-option > i { color: var(--inbox-dialog-accent); font-size: 22px; }
html[data-crm-ui="v2"] .crm-v2-inbox-modal :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--inbox-dialog-accent); outline-offset: 2px; }
@container messenger-chat (max-width: 640px) {
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header { flex-wrap: wrap; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-info { flex: 1 1 calc(100% - 110px); }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-actions { width: 100%; padding: 3px 0 0; justify-content: space-between; }
    html[data-crm-ui="v2"] .crm-v2-inbox .message { max-width: 90%; }
    html[data-crm-ui="v2"] .crm-v2-inbox .messages-container { padding-inline: 20px; }
}
@media (max-width: 1100px) and (min-width: 769px) {
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-sidebar { width: 340px; }
}
@media (max-width: 768px) {
    html[data-crm-ui="v2"] .crm-v2-inbox-modal { padding: 12px; }
    html[data-crm-ui="v2"] .crm-v2-inbox-modal .modal-dialog { max-height: calc(100dvh - 24px); }
    html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-dialog-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    html[data-crm-ui="v2"] .crm-v2-inbox-modal :is(button, input, select) { min-height: 44px; }
    html[data-crm-ui="v2"] .crm-v2-inbox-modal .crm-v2-export-options { grid-template-columns: minmax(0, 1fr); }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-sidebar { width: 100%; }
    html[data-crm-ui="v2"] .crm-v2-inbox :is(.chat-action-btn, .chat-filter-btn, .cip-close, .crm-v2-conversation-primary, .compose-send, .voice-record-btn, .reply-bar-close, .media-preview-close) { min-width: 44px; min-height: 44px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-filters { gap: 4px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-filter-btn { padding-inline: 10px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header { padding: 6px 10px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header .avatar { width: 40px; height: 40px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-header-info { flex-basis: calc(100% - 110px); }
    html[data-crm-ui="v2"] .crm-v2-inbox .chat-ai-label { display: none; }
    /* Reserve the existing, always-visible 44px message-menu touch target. */
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-whatsapp .message { padding-inline-end: 56px; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-whatsapp .crm-v2-message-sender { padding-inline-end: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox .crm-v2-header-shortcuts { display: none; }
    /* Two 44px rows, with no redundant separator or toolbar padding. Identity,
       takeover controls and longer translations may grow naturally. */
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .chat-header { grid-template-columns: 44px 44px minmax(0, 1fr); min-height: 0; padding: 4px 10px; row-gap: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .chat-header > .avatar { width: 44px; height: 44px; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .chat-header > .chat-header-actions { min-height: 44px; justify-content: flex-end; padding-top: 0; border-top: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .chat-header-actions > .header-action-group { margin-left: 0 !important; margin-inline-start: 0 !important; gap: 4px; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .chat-header-actions :is(.chat-ai-toggle, .messenger-translation-control) { width: 44px; min-width: 44px; height: 44px; padding: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox.messenger-layout.messenger-whatsapp.chat-open .messenger-translation-control > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox .compose-area { padding-inline: 8px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .compose-row { gap: 4px; }
    html[data-crm-ui="v2"] .crm-v2-inbox .compose-input-wrapper { flex: 1 0 calc(100% - 104px); order: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox .compose-actions { order: 2; width: 100%; }
    html[data-crm-ui="v2"] .crm-v2-inbox .compose-right-actions { margin-inline-start: 0; }
    html[data-crm-ui="v2"] .crm-v2-inbox .contact-info-panel.open { width: min(100%, 380px); }
    html[data-crm-ui="v2"] .crm-v2-inbox .contact-info-panel .cip-inner { width: 100%; }
    html[data-crm-ui="v2"] #messenger-modals .modal { max-height: calc(100dvh - 24px); width: calc(100% - 24px); margin: 12px; }
    html[data-crm-ui="v2"] #messenger-modals :is(button, input, select) { min-height: 44px; }
}
