.mos-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99998;
  min-width: 3.25rem;
  min-height: 3.25rem;
  border: 0;
  border-radius: 999px;
  padding: .8rem 1rem;
  background: #0f5bd8;
  color: #fff;
  font: 700 15px/1.2 system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(15, 45, 90, .3);
  cursor: pointer;
}

.mos-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 99999;
  display: none;
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 7rem));
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 18px 60px rgba(15, 30, 60, .28);
  font: 15px/1.45 system-ui, sans-serif;
}

.mos-chat-panel[data-open="true"] { display: grid; grid-template-rows: auto auto minmax(8rem, 1fr) auto; }
.mos-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; background: #082f75; color: #fff; }
.mos-chat-header h2 { margin: 0; color: inherit; font-size: 1rem; }
.mos-chat-close { border: 0; background: transparent; color: inherit; font-size: 1.5rem; cursor: pointer; }
.mos-chat-status { margin: 0; padding: .5rem 1rem; background: #eff6ff; color: #334155; font-size: .8rem; }
.mos-chat-messages { overflow-y: auto; padding: 1rem; margin: 0; list-style: none; display: grid; gap: .65rem; }
.mos-chat-message { max-width: 86%; padding: .65rem .75rem; border-radius: .8rem; background: #f1f5f9; overflow-wrap: anywhere; }
.mos-chat-message[data-role="visitor"] { justify-self: end; background: #dbeafe; }
.mos-chat-message[data-role="operator"] { background: #dcfce7; }
.mos-chat-message small { display: block; margin-top: .35rem; color: #475569; }
.mos-chat-controls { display: grid; gap: .55rem; padding: .8rem; border-top: 1px solid #e2e8f0; }
.mos-chat-compose { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.mos-chat-compose input, .mos-chat-contact input { width: 100%; box-sizing: border-box; min-height: 2.6rem; padding: .55rem; border: 1px solid #94a3b8; border-radius: .5rem; }
.mos-chat-controls button { min-height: 2.6rem; border: 0; border-radius: .5rem; padding: .55rem .8rem; background: #0f5bd8; color: #fff; cursor: pointer; }
.mos-chat-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.mos-chat-actions button { background: #e2e8f0; color: #172033; }
.mos-chat-contact { display: none; gap: .5rem; padding-top: .5rem; border-top: 1px solid #e2e8f0; }
.mos-chat-contact[data-open="true"] { display: grid; }
.mos-chat-consent { display: grid; grid-template-columns: auto 1fr; gap: .45rem; align-items: start; font-size: .8rem; }
.mos-chat-consent input { width: auto; min-height: auto; margin-top: .2rem; }
.mos-chat-launcher:focus-visible, .mos-chat-panel button:focus-visible, .mos-chat-panel input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.mos-consent-prompt {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 100000;
  width: min(32rem, calc(100vw - 2rem));
  box-sizing: border-box;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: .85rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 16px 50px rgba(15, 30, 60, .25);
  font: 15px/1.45 system-ui, sans-serif;
}
.mos-consent-prompt p { margin: .45rem 0 .8rem; }
.mos-consent-prompt-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.mos-consent-prompt button { min-height: 2.5rem; border: 1px solid #0f5bd8; border-radius: .5rem; padding: .5rem .9rem; background: #fff; color: #0f5bd8; cursor: pointer; }
.mos-consent-prompt button:last-child { background: #0f5bd8; color: #fff; }
.mos-consent-prompt button:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

@media (max-width: 600px) {
  .mos-chat-launcher { right: .75rem; bottom: .75rem; }
  .mos-chat-panel {
    inset: .5rem;
    width: auto;
    max-height: none;
    border-radius: .75rem;
  }
  .mos-chat-panel[data-open="true"] { grid-template-rows: auto auto minmax(0, 1fr) auto; }
}
