.sms-test-workspace { padding: 20px; margin-bottom: 18px; min-width: 0; border: 1px solid #d5e2dc; border-radius: 16px; background: #f6f9f7; scroll-margin-top: 72px; }
.sms-test-heading, .sms-test-heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sms-test-heading { margin-bottom: 16px; }
.sms-test-heading h3 { margin: 3px 0 0; color: #173f35; font-size: 24px; }
.sms-test-badge { background: #fff0c2; color: #674500; font-size: 10px; font-weight: 800; border-radius: 6px; padding: 6px 8px; letter-spacing: .04em; }
.sms-phone-frame { max-width: 820px; margin: auto; background: white; border: 1px solid #d6e1db; border-radius: 18px; overflow: hidden; box-shadow: 0 5px 20px #173f3508; }
.sms-test-identity { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: white; }
.sms-contact-avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 50%; background: #e4eee8; color: #1a5742; font-weight: 800; font-size: 15px; }
.sms-contact-name { display: grid; gap: 4px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sms-contact-name strong { font-size: 16px; color: #163d31; }
.sms-contact-name small { font-size: 12px; color: #587166; }
.sms-test-boundary { padding: 7px 16px; background: #fff6de; color: #725718; text-align: center; font-size: 11px; line-height: 1.4; }
.sms-conversation-context { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid #e3ebe6; font-size: 11px; color: #61766b; }
.sms-conversation-context small { font-size: inherit; }
.sms-test-conversation { position: relative; padding: 0 18px; background: #fbfcfb; }
.sms-test-history-note { text-align: center; margin: 0; padding: 12px 8px 8px; font-size: 10px; line-height: 1.4; color: #75857c; }
.sms-test-history { height: clamp(240px, 36dvh, 380px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 8px 4px 20px; scrollbar-width: thin; }
.sms-test-message { max-width: 82%; align-self: flex-start; min-width: 0; flex-shrink: 0; overflow-wrap: anywhere; }
.sms-message-bubble { background: #eef1ef; color: #263f34; border-radius: 17px 17px 17px 4px; padding: 11px 14px; }
.sms-message-bubble p { white-space: pre-wrap; line-height: 1.5; margin: 0; font-size: 14px; }
#sms-test-workspace .sms-message-bubble p { color: inherit; }
#sms-test-workspace #sms-test-history-note { font-size: 10px; line-height: 1.4; color: #75857c; }
.sms-test-outbound { align-self: flex-end; }
.sms-test-outbound .sms-message-bubble { background: #195d47; color: white; border-radius: 17px 17px 4px 17px; }
.sms-test-message footer { display: grid; gap: 2px; margin-top: 5px; color: #718278; font-size: 10px; line-height: 1.35; padding: 0 3px; }
.sms-test-message footer small { font-size: inherit; }
.sms-test-outbound footer { text-align: right; }
.sms-test-message.sms-test-consent { align-self: center; max-width: 95%; text-align: center; }
.sms-test-consent .sms-message-bubble { background: none; padding: 5px 8px 0; color: #7a877e; }
.sms-test-consent .sms-message-bubble p { font-size: 10px; }
#sms-test-workspace .sms-test-consent .sms-message-bubble p { font-size: 10px; }
.sms-test-consent footer { font-size: 9px; margin-top: 1px; }
.sms-test-consent footer span { display: none; }
.sms-test-outcomes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; justify-content: flex-end; }
.sms-test-outcomes button { font-size: 10px; padding: 5px 8px; min-height: 30px; }
.sms-new-messages { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); white-space: nowrap; box-shadow: 0 3px 14px #173f3520; }
.sms-test-compose { border-top: 1px solid #e1e9e3; padding: 12px 16px 10px; background: white; display: grid; gap: 8px; }
.sms-compose-tools { display: flex; gap: 8px; align-items: center; }
.sms-compose-tools select { width: 180px; max-width: 55%; font: inherit; font-size: 12px; color: #526b5e; background: #f6f8f6; border: 1px solid #e0e7e2; border-radius: 7px; padding: 7px 8px; min-height: 34px; }
.sms-compose-tools button { font-size: 12px; padding: 7px 10px; }
.sms-compose-input { display: flex; align-items: flex-end; gap: 8px; }
.sms-compose-input textarea { flex: 1; width: 100%; min-width: 0; min-height: 44px; max-height: 120px; box-sizing: border-box; resize: none; border: 1px solid #bdcfc3; border-radius: 18px; padding: 11px 14px; font: inherit; font-size: 14px; line-height: 1.5; background: #fbfdfb; }
.sms-compose-input button { flex-shrink: 0; min-height: 44px; border-radius: 20px; padding: 9px 16px; }
.sms-compose-caption { display: flex; justify-content: space-between; gap: 10px; color: #718278; font-size: 10px; line-height: 1.4; }
#sms-test-count { font-size: inherit; white-space: nowrap; }
#sms-test-feedback { min-height: 16px; margin: 0; color: #526c5e; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
#sms-test-feedback.sms-test-error { color: #9d2525; }
#sms-test-consent-prompt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f3f7f3; border-radius: 8px; padding: 8px; }
#sms-test-consent-prompt small { font-size: 10px; color: #62786a; }
.sms-test-tools { max-width: 820px; margin: 16px auto 0; color: #607568; font-size: 12px; }
.sms-test-tools summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.sms-test-tools label, .sms-test-tools textarea { display: block; margin: 8px 0; }
.sms-test-tools textarea { box-sizing: border-box; width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #c9d7ce; font: inherit; }
.sms-test-tools small { display: block; margin-top: 8px; font-size: 11px; line-height: 1.5; }
.sms-test-keywords { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sms-test-empty { padding: 24px; color: #62766b; background: #f1f6f2; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.sms-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sms-test-workspace button:disabled { opacity: .5; cursor: not-allowed; }
.sms-test-workspace :focus-visible, .sms-notifications :focus-visible { outline: 3px solid #428d75; outline-offset: 3px; }
.sms-test-workspace [hidden], .sms-notifications [hidden] { display: none !important; }
.sms-prepared-workbench { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 20px; max-width: 960px; margin: 16px auto; }
.sms-prepared-workbench > *, .sms-prepared-picker { min-width: 0; }
.sms-prepared-picker { border: 1px solid #bed3c8; border-radius: 10px; background: #fff; color: #173f35; }
.sms-prepared-picker > summary { cursor: pointer; padding: 12px; font-size: 1rem; font-weight: 700; }
.sms-prepared-picker > summary span { display: inline-block; margin-left: 8px; font-size: .8125rem; color: #506a5e; font-weight: 400; }
.sms-prepared-catalog { padding: 0 12px 12px; }
.sms-prepared-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.sms-prepared-edit { padding: 6px !important; align-self: stretch; }
.sms-prepared-library-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.sms-prepared-catalog .sms-prepared-archived { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 400; }
.sms-prepared-archived input { width: 18px !important; height: 18px !important; min-height: 0 !important; flex: 0 0 18px; margin: 0; }
.sms-prepared-editor { display: grid; gap: 12px; border-top: 1px solid #bed3c8; padding-top: 14px; margin-top: 12px; }
.sms-prepared-editor[hidden] { display: none; }
.sms-prepared-editor h4 { margin: 0; font-size: 1rem; }
.sms-prepared-editor input:not([type=checkbox]), .sms-prepared-editor textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; border: 1px solid #bed3c8; border-radius: 7px; font: inherit; font-size: 16px; background: white; color: #173f35; }
.sms-prepared-editor textarea { min-height: 160px; resize: vertical; }
.sms-prepared-editor small, .sms-prepared-library-status, [data-template-feedback] { font-size: .8125rem !important; line-height: 1.5; color: #506a5e; overflow-wrap: anywhere; }
.sms-prepared-catalog label { display: grid; gap: 6px; font-size: .875rem; font-weight: 600; }
.sms-prepared-search { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid #bed3c8; border-radius: 7px; padding: 10px; font: inherit; font-size: 1rem; background: white; }
.sms-prepared-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; margin-top: 10px; }
.sms-test-workspace .sms-prepared-option { display: grid; gap: 4px; width: 100%; min-height: 52px; text-align: left; border: 1px solid #d7e3dc; border-radius: 7px; background: #f5f9f6; color: #173f35; padding: 10px; cursor: pointer; font: inherit; white-space: normal; overflow-wrap: anywhere; }
.sms-prepared-option:hover { background: #e3f0e9; }
.sms-prepared-option span { font-size: .8125rem; color: #506a5e; }
.sms-prepared-option strong { font-size: .9375rem; line-height: 1.4; }
.sms-prepared-draft { display: grid; gap: 10px; align-content: start; }
.sms-prepared-draft > label { font-size: 1rem; font-weight: 700; color: #173f35; }
.sms-test-workspace .sms-prepared-selection, .sms-test-workspace .sms-prepared-empty { margin: 0; font-size: .875rem; color: #506a5e; line-height: 1.5; }
.sms-prepared-draft textarea { box-sizing: border-box; width: 100%; min-width: 0; resize: vertical; min-height: 210px; max-height: 500px; border: 1px solid #a8c3b5; border-radius: 10px; padding: 14px; font: inherit; font-size: 1rem; line-height: 1.6; color: #173f35; background: white; }
.sms-prepared-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sms-test-workspace .sms-prepared-actions button { min-height: 44px; font-size: .875rem; }
.sms-test-workspace #sms-prepared-status { margin: 0; min-height: 22px; color: #506a5e; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.sms-prepared-draft > small { color: #526b5e; font-size: .8125rem; line-height: 1.5; }
@media (max-width: 680px) {
  .sms-prepared-workbench { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sms-prepared-list { max-height: 200px; }
}
[data-sms-unread] { display: inline-flex; justify-content: center; min-width: 18px; padding: 2px 5px; border-radius: 10px; background: #ae3f38; color: white; font-size: 10px; line-height: 1.3; }
.sms-notifications { position: fixed; right: 22px; bottom: 22px; z-index: 220; }
.sms-notification-trigger { cursor: pointer; border: 1px solid #d4e0d7; background: #174e3b; color: white; border-radius: 28px; padding: 13px 18px; font: inherit; font-size: 13px; box-shadow: 0 4px 18px #153e3325; }
.sms-notifications-panel { position: absolute; right: 0; bottom: 60px; width: min(365px, calc(100vw - 32px)); background: white; border: 1px solid #d4e0d7; border-radius: 16px; box-shadow: 0 12px 48px #153e3330; padding: 16px; box-sizing: border-box; color: #244434; }
.sms-notifications-panel header, .sms-notifications-panel footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sms-notifications-panel header strong { display: grid; gap: 4px; font-size: 16px; }
.sms-notifications-panel header small { color: #6d7e73; font-size: 10px; font-weight: 500; }
.sms-notifications-panel > p { font-size: 11px; line-height: 1.5; color: #68796d; }
.sms-notifications-panel footer { margin-top: 10px; font-size: 10px; line-height: 1.4; color: #718076; }
#sms-notifications-list { max-height: min(400px, 48dvh); overflow-y: auto; }
.sms-notification-item { display: flex; gap: 12px; justify-content: space-between; text-align: left; width: 100%; cursor: pointer; font: inherit; background: #f2f7f3; border: 1px solid #e1e9e3; border-radius: 10px; padding: 12px; margin: 6px 0; color: #254435; }
.sms-notification-item > span { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.sms-notification-item strong { font-size: 13px; }
.sms-notification-item small { color: #728177; font-size: 10px; }
.sms-notification-item span span { font-size: 12px; line-height: 1.4; }
.sms-notification-item b { align-self: flex-start; font-size: 11px; background: #1b6048; color: white; border-radius: 10px; padding: 2px 6px; }
.sms-notifications-empty { font-size: 13px; padding: 18px 0; color: #6c7e71; }
.customer-upload-tools { display: block; }
.customer-upload-tools > summary { cursor: pointer; padding: 8px 0; color: #365644; font-weight: 700; font-size: 14px; }
.customer-upload-tools > summary small { display: block; margin: 6px 0 0 18px; color: #7b8b7d; font-size: 11px; font-weight: 400; }
.customer-upload-tools[open] > summary { margin-bottom: 18px; border-bottom: 1px solid #e3e9e1; padding-bottom: 16px; }
.customer-upload-explainer { font-size: 12px; line-height: 1.6; padding: 12px; border-radius: 8px; background: #f3f6f0; color: #657259; }
@media (max-width: 820px) {
  .sms-test-workspace { padding: 10px; border-radius: 12px; }
  .sms-test-heading { margin-bottom: 12px; gap: 8px; }
  .sms-test-heading h3 { font-size: 20px; }
  .sms-test-heading-actions { gap: 6px; }
  .sms-test-heading .section-kicker { font-size: 9px; }
  .sms-test-badge { font-size: 8px; padding: 5px 6px; }
  .sms-test-workspace button { min-height: 44px; }
  .sms-test-identity { padding: 12px 10px; gap: 8px; }
  .sms-contact-avatar { flex-basis: 34px; height: 34px; font-size: 12px; }
  .sms-contact-name strong { font-size: 13px; }
  .sms-contact-name small { font-size: 11px; }
  .sms-test-identity button { font-size: 11px; padding: 6px 9px; }
  .sms-conversation-context { font-size: 10px; padding: 8px 10px; }
  .sms-test-conversation { padding: 0 8px; }
  .sms-test-history { height: clamp(225px, 35dvh, 340px); gap: 13px; }
  .sms-test-message { max-width: 88%; }
  .sms-message-bubble { padding: 10px 12px; }
  .sms-message-bubble p { font-size: 13px; }
  .sms-test-compose { padding: 10px; }
  .sms-compose-tools { gap: 6px; }
  .sms-compose-tools select { min-width: 0; width: 55%; font-size: 16px; min-height: 44px; padding: 6px; }
  .sms-compose-tools button { font-size: 11px; padding: 6px 8px; }
  .sms-compose-input textarea, .sms-test-tools textarea { font-size: 16px; }
  .sms-compose-input button { padding: 8px 11px; font-size: 12px; }
  .sms-compose-caption { font-size: 9px; }
  .sms-notifications { right: 16px; bottom: 16px; }
  body:has(#ticket-detail-modal.open) .sms-notification-trigger { display: none; }
  body:has(#ticket-detail-modal.open) .sms-notifications-panel { bottom: 0; }
}
.sms-live-frame .sms-test-identity { flex-wrap:wrap; }
.sms-live-frame .sms-contact-name strong { font-size:1rem; }
.sms-live-frame .sms-conversation-context { font-size:.875rem; }
.sms-live-frame .sms-message-bubble p { font-size:1rem; line-height:1.5; }
.sms-live-frame .sms-test-compose { display:grid; gap:.75rem; }
.sms-live-frame .sms-test-compose > p { margin:0; }
.sms-live-frame .sms-compose-caption { font-size:.8125rem; }
.sms-live-frame .sms-compose-tools button,.sms-live-frame .sms-compose-input button { font-size:.875rem; min-height:44px; }
.sms-live-contact-hint { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; font-size:.875rem; line-height:1.5; color:#37594e; }
.sms-live-contact-hint span { flex:1 1 220px; }
.sms-live-contact-hint button { min-height:44px; }
.sms-live-first-notice { font-size:.875rem; padding:.65rem .75rem; border-left:3px solid #a3c3b7; background:#f4f8f6; }
.sms-live-first-notice summary { cursor:pointer; }
.sms-live-first-notice p { line-height:1.5; margin:.5rem 0; }
.sms-live-first-notice small { font-size:.8125rem; }
.sms-live-frame .sms-live-permission { margin:0; font-size:.875rem; line-height:1.5; }
.sms-live-frame .sms-live-permission p { margin:.6rem 0; }
.sms-live-frame .sms-live-permission select,.sms-live-frame .sms-live-permission textarea { width:100%; box-sizing:border-box; font:inherit; font-size:1rem; padding:.6rem; border:1px solid #b6cdc4; border-radius:8px; background:white; color:#173f35; }
.sms-live-frame .sms-live-permission button { min-height:44px; margin-top:.5rem; }
.sms-live-stop-tools { margin-top:.75rem; padding-top:.75rem; border-top:1px solid #d7e3de; }
.sms-live-frame #sms-live-template .sms-prepared-picker { margin:0; }
.sms-prepared-heading { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; padding:.75rem; font-size:1rem; }
.sms-prepared-heading .sms-prepared-count { font-size:.8125rem; color:#506a5e; }
.sms-prepared-heading button { margin-left:auto; min-height:44px; font-size:.875rem; }
.sms-live-frame #sms-live-prepared[aria-expanded="true"] { background:#c4ddd2; box-shadow:inset 0 0 0 1px #5f8a79; }
.sms-live-frame #sms-live-diagnostics { background:transparent; border-top:1px solid #e0e9e5; color:#4d675e; }
.sms-live-frame #sms-live-history .sms-test-empty { font-size:.875rem; }
.sms-live-frame .sms-conversation-context { flex-wrap:wrap; gap:.5rem; }
.sms-live-frame select { max-width:100%; min-width:0; }
.sms-live-permission { padding:.75rem; background:#f4f7f6; border-radius:8px; margin-bottom:.75rem; }
.sms-live-permission summary { cursor:pointer; font-weight:700; }
.sms-live-permission label { display:block; margin-top:.5rem; }
.sms-live-permission textarea { width:100%; box-sizing:border-box; }
.sms-live-permission .sms-live-confirm { display:flex; gap:.5rem; align-items:flex-start; }
.sms-live-confirm input { width:auto; margin-top:.2rem; }
.sms-live-frame .sms-compose-caption { flex-wrap:wrap; gap:.3rem; }
.sms-live-frame .sms-compose-caption span { flex:1 1 210px; }
.sms-live-history-tools { display:flex; gap:.5rem; flex-wrap:wrap; padding:.5rem; }
.sms-live-media { font-size:.85rem; border-top:1px solid currentColor; padding-top:.5rem; }
.sms-live-unmatched { border-top:1px solid #ccd8d5; padding:.75rem; overflow-wrap:anywhere; }
.sms-live-unmatched select { display:block; width:100%; min-width:0; margin:.5rem 0; }
@media(max-width:480px) { .sms-live-frame .sms-compose-input { flex-wrap:wrap; } .sms-live-frame .sms-compose-input textarea { flex-basis:100%; } .sms-live-frame .sms-compose-input button { width:100%; } }
.sms-live-frame { max-width:960px; border-radius:14px; }
.sms-live-frame .sms-test-history { height:clamp(240px,40dvh,460px); }
.sms-live-frame .sms-test-message footer { font-size:.75rem; }
.sms-live-frame .sms-compose-tools { flex-wrap:wrap; }
.sms-live-frame .sms-photo-hint { font-size:.875rem; color:#526b60; }
.sms-live-more { border-top:1px solid #e0e9e5; padding-top:.5rem; }
.sms-live-more > summary { cursor:pointer; color:#446258; padding:.5rem 0; font-size:.875rem; }
.sms-live-more[open] > div,.sms-live-more[open] > details { margin-top:.75rem; }
.sms-live-frame .sms-photo-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; max-width:440px; }
.sms-photo-grid:not(:empty) { margin-top:.5rem; }
.sms-live-frame .sms-photo-thumb { min-width:0; width:100%; padding:0; overflow:hidden; border:1px solid #c4d4cb; background:white; border-radius:10px; color:#173f35; cursor:zoom-in; font:inherit; }
.sms-photo-thumb img { display:block; width:100%; aspect-ratio:4/3; object-fit:cover; }
.sms-photo-thumb span { display:block; padding:.5rem; font-size:.875rem; }
.sms-photo-original,.sms-photo-pending { grid-column:1/-1; display:grid; gap:.35rem; padding:.75rem; font-size:.875rem; line-height:1.5; color:inherit; }
.sms-photo-viewer { box-sizing:border-box; width:min(950px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); border:1px solid #b6ccc1; border-radius:14px; padding:1rem; color:#173f35; background:white; }
.sms-photo-viewer::backdrop { background:#102b24b8; }
.sms-photo-viewer header { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:.75rem; font-size:1rem; }
.sms-photo-viewer button { min-height:44px; font-size:.875rem; }
.sms-photo-viewer > img { display:block; width:100%; max-height:calc(100dvh - 180px); object-fit:contain; background:#f3f6f4; }
.sms-photo-viewer > a { display:inline-block; padding:.75rem 0; font-size:.875rem; color:#174f3b; }
.customer-upload-tools > summary { font-size:.875rem; }
.customer-upload-tools > summary small { font-size:.8125rem; }
.customer-upload-tools:not([open]) { padding:.5rem 1rem; border:0; background:transparent; }
@media(max-width:480px) { .sms-live-frame .sms-photo-hint { flex-basis:100%; } .sms-live-frame .sms-test-message { max-width:94%; } .sms-photo-viewer { padding:.75rem; } }
/* Attachment controls stay in the ordinary conversation flow. */
.sms-attachment-help { display:block; margin:6px 0 10px; color:#536b65; line-height:1.5; }
.sms-attachment-draft { display:flex; align-items:center; gap:12px; flex-wrap:wrap; border:1px solid #b8cec5; border-radius:12px; padding:10px; margin:8px 0 12px; background:#f4f8f6; }
.sms-attachment-draft[hidden] { display:none; }
.sms-attachment-draft > span { flex:1 1 140px; overflow-wrap:anywhere; font-size:13px; }
.sms-attachment-draft img,.sms-attachment-draft video { display:block; max-width:180px; max-height:130px; border-radius:8px; }
.sms-video-attachment { min-width:0; display:flex; flex-direction:column; gap:6px; max-width:100%; }
.sms-video-attachment video { display:block; width:100%; max-height:300px; background:#172c27; border-radius:10px; }
.sms-video-attachment a { color:inherit; text-decoration:underline; }
.sms-video-attachment small { font-size:11px; line-height:1.4; }
