.cc-booking .cc-chat-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(540px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid #d8e0ea;
  border-radius: 18px;
  background: #fff;
  color: #203149;
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: auto;
  box-shadow: 0 24px 80px #0004;
}
.cc-booking .cc-chat-dialog:not([open]) { display: none; }
.cc-booking .cc-chat-dialog::backdrop { background: rgba(15,23,42,.55); }
.cc-booking .cc-chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cc-booking .cc-chat-header h2 { flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cc-booking .cc-chat-dialog button { width: auto; min-height: 44px; margin: 0; padding: 10px 16px; border: 1px solid #ced7e2; border-radius: 10px; background: #fff; color: #203149; font: inherit; font-weight: 600; line-height: 1.4; box-shadow: none; text-transform: none; }
.cc-booking .cc-chat-dialog button:hover:not(:disabled) { background: #f1f4f8; }
.cc-booking .cc-chat-dialog .cc-chat-close { flex: 0 0 auto; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.cc-booking .cc-chat-dialog .cc-chat-reference { margin: 6px 0 14px; color: #586578; font-size: 13px; }
.cc-booking .cc-chat-dialog .cc-chat-connection { margin: 0 0 12px; padding: 7px 10px; border-radius: 8px; background: #fff5e3; color: #76500d; font-size: 12px; }
.cc-booking .cc-chat-dialog .cc-chat-connection.cc-chat-connected { background: #e6f3ed; color: #226643; }
.cc-booking .cc-chat-dialog .cc-chat-status { margin: 0 0 12px; color: #586578; font-size: 14px; overflow-wrap: anywhere; }
.cc-booking .cc-chat-dialog .cc-chat-status:empty { display: none; }
.cc-booking .cc-chat-messages { height: clamp(140px, 32dvh, 280px); overflow: auto; overscroll-behavior: contain; padding: 12px; background: #f4f6f9; border-radius: 12px; }
.cc-booking .cc-chat-messages.cc-chat-empty { display: grid; place-items: center; text-align: center; color: #586578; }
.cc-booking .cc-chat-bubble { max-width: 88%; margin: 8px 0; padding: 12px; border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.cc-booking .cc-chat-bubble.cc-chat-mine { margin-left: auto; background: #e6f3ed; }
.cc-booking .cc-chat-bubble p { white-space: pre-wrap; margin: 6px 0; }
.cc-booking .cc-chat-bubble small { font-size: 12px; color: #526174; }
.cc-booking .cc-chat-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 0; }
.cc-booking .cc-chat-pages[hidden] { display: none; }
.cc-booking .cc-chat-form { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; }
.cc-booking .cc-chat-form label { display: block; margin: 0; font-size: 14px; font-weight: 600; }
.cc-booking .cc-chat-form textarea { display: block; width: 100%; height: 88px; min-height: 88px; max-height: 160px; box-sizing: border-box; margin: 6px 0 0; padding: 10px 12px; border: 1px solid #bec5cf; border-radius: 10px; background: #fff; color: #203149; font: inherit; line-height: 1.5; box-shadow: none; resize: vertical; }
.cc-booking .cc-chat-form textarea:focus-visible { outline: 3px solid #eab25d; outline-offset: 2px; }
.cc-booking .cc-chat-form button[type="submit"] { justify-self: end; border-color: #ffb544; background: #ffb544; color: #17202c; }
.cc-booking .cc-chat-form button[type="submit"]:hover:not(:disabled) { background: #ffca70; }
@media (max-width: 480px) {
  .cc-booking .cc-chat-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 16px; border-radius: 14px; }
  .cc-booking .cc-chat-header { gap: 10px; }
  .cc-booking .cc-chat-header h2 { font-size: 19px; }
}

.cc-booking .cc-chat-form { display:flex; align-items:flex-end; gap:8px; }
.cc-booking .cc-chat-form label { flex:1; min-width:0; }
.cc-booking .cc-chat-form textarea { height:44px; min-height:44px; max-height:110px; margin:0; border-radius:22px; padding:10px 14px; resize:vertical; }
.cc-booking .cc-chat-form button { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; margin:0; padding:10px; border:0; border-radius:50%; background:#ffb544; color:#17202c; }
.cc-booking .cc-chat-form button svg { display:block; width:22px; height:22px; }
.cc-booking .cc-chat-form .cc-chat-mic.cc-chat-recording { background:#b82c25; color:#fff; }
.cc-booking .cc-chat-bubble audio { display:block; width:100%; max-width:320px; margin:8px 0; }
.cc-booking .cc-chat-bubble small { display:block; margin-top:6px; }
.cc-booking .cc-chat-bubble a { display:block; padding:10px 0; color:#235f8b; text-decoration:underline; }
.cc-booking .cc-chat-voice-preview { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; padding:12px; border:1px solid #d8e0ea; border-radius:12px; }
.cc-booking .cc-chat-voice-preview[hidden] { display:none; }
.cc-booking .cc-chat-voice-preview audio { width:100%; }
.cc-booking .cc-chat-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:380px) { .cc-booking .cc-chat-form { gap:5px; } .cc-booking .cc-chat-form button { flex-basis:40px; width:40px; height:40px; min-height:40px; } }

/* Keep controls inside the panel; only the conversation scrolls. */
.cc-booking .cc-chat-dialog[open] { display:flex; flex-direction:column; height:min(680px,calc(100dvh - 32px)); overflow:hidden; }
.cc-booking .cc-chat-dialog > * { min-width:0; flex-shrink:0; }
.cc-booking .cc-chat-dialog .cc-chat-messages { flex:1 1 0; min-width:0; min-height:0; height:auto; width:100%; overflow-x:hidden; overflow-y:auto; -webkit-overflow-scrolling:touch; }
.cc-booking .cc-chat-dialog .cc-chat-bubble { min-width:0; max-width:88%; }
.cc-booking .cc-chat-dialog .cc-chat-bubble audio { min-width:0; width:100%; max-width:100%; }
.cc-booking .cc-chat-dialog .cc-chat-form { display:flex; width:100%; min-width:0; align-items:flex-end; gap:8px; margin-top:12px; }
.cc-booking .cc-chat-dialog .cc-chat-form label { flex:1 1 0; min-width:0; margin:0; }
.cc-booking .cc-chat-dialog .cc-chat-form textarea { width:100%; min-width:0; height:44px; min-height:44px; max-height:96px; padding:10px 12px; font-size:16px; line-height:22px; resize:none; overflow-y:auto; }
.cc-booking .cc-chat-dialog .cc-chat-form button { flex:0 0 44px; width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; padding:10px; border-radius:50%; }
.cc-booking .cc-chat-dialog .cc-chat-status { max-height:72px; overflow-y:auto; }
.cc-booking .cc-chat-dialog .cc-chat-voice-preview { min-width:0; max-height:160px; overflow-y:auto; }
.cc-booking .cc-chat-dialog .cc-chat-voice-preview audio { display:block; flex:1 0 100%; min-width:0; max-width:100%; }
.cc-booking .cc-chat-dialog .cc-chat-voice-preview button { flex:1 1 auto; min-width:0; padding:8px 10px; font-size:13px; }
@media(max-width:600px), (max-height:500px) {
  .cc-booking .cc-chat-dialog[open] {
    inset:auto 0 auto; top:calc(var(--cc-chat-viewport-top,0px) + 8px); margin:0 auto;
    width:calc(100vw - 16px); max-width:540px;
    height:calc(var(--cc-chat-viewport-height,100dvh) - 16px);
    max-height:calc(var(--cc-chat-viewport-height,100dvh) - 16px);
    padding:12px; padding-bottom:max(12px,env(safe-area-inset-bottom)); border-radius:14px;
  }
  .cc-booking .cc-chat-dialog .cc-chat-header { gap:10px; align-items:flex-start; }
  .cc-booking .cc-chat-dialog .cc-chat-header h2 { font-size:18px; line-height:1.25; }
  .cc-booking .cc-chat-dialog .cc-chat-close { min-height:40px; padding:8px 10px; }
  .cc-booking .cc-chat-dialog .cc-chat-reference { margin:4px 0 8px; }
  .cc-booking .cc-chat-dialog .cc-chat-connection { margin-bottom:8px; padding:6px 8px; font-size:11px; }
  .cc-booking .cc-chat-dialog .cc-chat-status { margin-bottom:8px; max-height:48px; font-size:13px; }
  .cc-booking .cc-chat-dialog .cc-chat-messages { padding:8px; }
  .cc-booking .cc-chat-dialog .cc-chat-bubble { max-width:94%; padding:10px; }
  .cc-booking .cc-chat-dialog .cc-chat-form { gap:6px; margin-top:10px; }
  .cc-booking .cc-chat-dialog .cc-chat-voice-preview { margin-top:8px; padding:8px; gap:6px; max-height:132px; }
}
@media(max-width:360px) {
  .cc-booking .cc-chat-dialog .cc-chat-form { gap:4px; }
  .cc-booking .cc-chat-dialog .cc-chat-form button { flex-basis:40px; width:40px; min-width:40px; max-width:40px; height:44px; padding:9px; }
  .cc-booking .cc-chat-dialog .cc-chat-form textarea { padding-left:10px; padding-right:10px; }
}
