/* Shared SMS header: one recipient for history and composition. */
.text-messages-content > .section-header { display:flex; align-items:flex-start; flex-wrap:wrap; gap:8px 16px; }
.sms-address-header { display:flex; align-items:flex-start; flex-wrap:wrap; justify-content:space-between; gap:8px 16px; flex:1; min-width:0; font:12px/18px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.sms-address-route { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 16px; min-width:0; }
.sms-address-label { color:#6b7280; font-size:11px; margin-right:4px; }
.sms-address-number { color:#4b5563; font-size:11px; font-variant-numeric:tabular-nums; margin-left:5px; }
.sms-recipient-role { color:#6b7280; font-size:11px; margin-left:4px; }
.sms-recipient-picker { position:relative; min-width:0; }
.sms-recipient-picker summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px; padding:2px 5px; margin:-2px -5px; border:1px solid transparent; border-radius:5px; color:#374151; cursor:pointer; list-style:none; }
.sms-recipient-picker summary::-webkit-details-marker { display:none; }
.sms-recipient-picker summary:hover { background:#f9fafb; border-color:#e5e7eb; }
.sms-recipient-picker summary strong { font-size:12px; font-weight:500; }
.sms-recipient-picker summary > span:last-child { color:#6b7280; }
.sms-recipient-options { position:absolute; top:calc(100% + 8px); left:0; z-index:60; width:280px; max-width:calc(100vw - 48px); max-height:240px; overflow:auto; border:1px solid #e5e7eb; background:white; border-radius:8px; padding:4px; box-shadow:0 8px 24px #11182726; }
.sms-recipient-options button { display:block; width:100%; text-align:left; padding:9px 12px; border:0; border-radius:5px; background:white; color:#374151; font:inherit; font-size:12px; line-height:18px; cursor:pointer; }
.sms-recipient-options button strong { display:block; font-size:12px; font-weight:500; }
.sms-recipient-options button span { display:block; color:#6b7280; font-size:11px; }
.sms-recipient-options button:hover,.sms-recipient-options button[aria-pressed=true] { background:#f0f1ff; }
.sms-address-from { color:#4b5563; font-size:11px; }
.sms-history-toggle { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; color:#6b7280; font-size:11px; cursor:pointer; }
.sms-history-toggle input { width:13px; height:13px; margin:0; accent-color:#6366f1; }
.sms-recipient-picker summary:focus-visible,.sms-recipient-options button:focus-visible { outline:3px solid #b8bbff; outline-offset:2px; }
#standalone-chat-container .section-header h5,#inbox-sms-chat-widget .section-header h5 { display:none; }
@media(max-width:540px) { .sms-recipient-role { display:none; } .sms-address-header { gap:6px; } .sms-address-route { width:100%; } }

.sms-modal-header { flex-wrap:wrap; gap:6px 16px; }
.sms-modal-header > .sms-address-header { flex-basis:100%; order:3; }
.sms-modal-header > .sms-address-header .sms-address-route { gap:6px 14px; }
.sms-modal-header .sms-recipient-options { z-index:100; }

.sms-referral-recipient { max-width:100%; min-width:0; border:1px solid transparent; border-radius:5px; background:white; color:#374151; padding:2px 4px; font:12px/18px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.sms-referral-recipient:hover { border-color:#e5e7eb; background:#f9fafb; }

.text-messages-content > .section-header[hidden] { display:none; }

.sms-review-panel { width:min(672px,calc(100vw - 32px)); max-height:90dvh; overflow:auto; padding:20px; }
.sms-review-panel .chat-container { max-height:45dvh; }

/* Let the thread use the modal's remaining height; keep composition in view. */
#standalone-chat-body { display:flex; min-height:0; overflow:hidden; }
#standalone-chat-container, #standalone-chat-container .text-messages-container { display:flex; flex:1; flex-direction:column; min-height:0; width:100%; }
#standalone-chat-container .text-messages-content { display:flex !important; flex:1; flex-direction:column; min-height:0; }
#standalone-chat-container .text-messages-content[style*="display: none"] { display:none !important; }
#standalone-chat-container .chat-container { flex:1; min-height:0; max-height:none; }
#standalone-chat-container .sms-compose-box { flex-shrink:0; }
.sms-message-route { color:inherit; font-size:11px; line-height:16px; margin-bottom:5px; overflow-wrap:anywhere; }
.sms-attach-image { width:32px; height:32px; padding:0; justify-content:center; border-radius:6px; }
.sms-attach-icon { font-size:22px; line-height:1; }
.sms-attach-image:focus-visible { outline:2px solid #6366f1; outline-offset:2px; }

/* Menu rows share one grid so the image button cannot retain icon-only sizing. */
.sms-compose-menu-options > button { display:grid; grid-template-columns:18px 1fr; align-items:center; justify-content:start; gap:10px; width:100%; min-height:36px; height:auto; padding:9px 10px; text-align:left; line-height:18px; white-space:nowrap; }
.sms-compose-menu-options > button > i { width:18px; text-align:center; line-height:18px; }
.communication-action-bubbles { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:8px 0; }
.communication-action-bubbles button { border:1px solid #ddd6ee; background:#faf8fd; color:#5b467f; border-radius:16px; padding:5px 10px; font-size:12px; line-height:18px; cursor:pointer; }
.communication-action-bubbles button:hover { background:#f0ebf7; }
.communication-action-bubbles button:disabled { opacity:.5; cursor:wait; }

.sms-suggestions-row { flex-shrink:0; display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:0 0 6px; }
.sms-suggestions-row[hidden] { display:none; }
.sms-suggestions-row .communication-action-bubbles { display:contents; margin:0; }

.sms-suggestions-row .communication-action-bubbles button:focus-visible { outline:2px solid #7c6a99; outline-offset:2px; }

.text-messages-content > .sms-compose-box { margin-top:0; padding-top:8px; }
