*,
*::before,
*::after {
  box-sizing: border-box;
}

.coming-soon {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fff;
  color: #333;
  overflow: hidden;
}

.widget {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  background: #f0f2f8;
}

.view {
  display: none;
  flex-direction: column;
  flex: 1;
  position: relative;
  min-height: 0;
}

.view.is-active {
  display: flex;
}

/* ══════════════════════════════════════════
       LANDING VIEW  (first-time visitors)
    ══════════════════════════════════════════ */
#landing-view {
  overflow-y: auto;
  background: #eef0f8;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.5rem 2.5rem;
  background: #e8ecf8 url(../images/vtiger-bot-background.png) right bottom / 55% auto no-repeat;
  min-height: 175px;
  display: flex;
  align-items: flex-start;
}

.landing-hero__text {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 58%;
}

.landing-hero__greeting {
  margin: 0 0 .35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -.01em;
}

.landing-hero__sub {
  margin: 0;
  font-size: .9rem;
  color: #4a4a72;
  line-height: 1.45;
}

.landing-content {
  padding: 1rem 1rem 1.25rem;
  flex: 1;
}

.landing-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(60, 60, 120, .10);
  padding: 1.4rem 1.25rem 1.1rem;
}

.landing-card__title {
  margin: 0 0 .2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.landing-card__sub {
  margin: 0 0 1.1rem;
  font-size: .8rem;
  color: #777;
}

.landing-field {
  position: relative;
  margin-bottom: .75rem;
}

.landing-field__icon {
  position: absolute;
  left: .85rem;
  /* anchor to the input top + half its line-height, ignoring the error span below */
  top: calc(.7rem + .6em);
  transform: translateY(-50%);
  font-size: 1rem;
  color: #aaa;
  pointer-events: none;
  line-height: 1;
}

.landing-field--textarea .landing-field__icon {
  top: .85rem;
  transform: none;
}

.landing-input {
  display: block;
  width: 100%;
  padding: .7rem .85rem .7rem 2.5rem;
  border: 1.5px solid #e4e6f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  color: #222;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.landing-input:focus {
  border-color: #5b5fcf;
  box-shadow: 0 0 0 3px rgba(91, 95, 207, .1);
}

.landing-input::placeholder {
  color: #bbb;
}

.landing-input.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
  animation: field-shake .3s ease;
}

.landing-field__error {
  display: none;
  font-size: .72rem;
  color: #ef4444;
  margin-top: .3rem;
  padding-left: .25rem;
}

.landing-field.has-error .landing-field__error { display: block; }

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

.landing-textarea {
  resize: vertical;
  min-height: 6rem;
  padding-top: .7rem;
}

.landing-privacy {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: .85rem 0 1rem;
}

.landing-privacy__icon {
  flex-shrink: 0;
  font-size: 1rem;
  color: #5b5fcf;
  margin-top: .05rem;
}

.landing-privacy__text {
  font-size: .72rem;
  color: #888;
  line-height: 1.45;
}

.landing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #4f52c8 0%, #6366f1 100%);
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.landing-btn:hover {
  opacity: .92;
}

.landing-btn:active {
  transform: scale(.98);
}

.landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1rem 1rem;
  font-size: .75rem;
  color: #888;
}

.landing-footer i {
  font-size: 1.1rem;
  color: #5b5fcf;
}

/* ══════════════════════════════════════════
       HOME VIEW  (returning visitors — visitor_id in localStorage)
    ══════════════════════════════════════════ */
#home-view {
  overflow-y: auto;
}

/* ── Hero ── */
.home-hero {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding: 1.5rem 1.25rem 3.5rem;
  background: #e8ecf8 url(../images/vtiger-bot-background.png) right bottom / 55% auto no-repeat;
}

.home-hero__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .6rem;
}

.home-hero__text {
  flex: 1;
  max-width: 58%;
  position: relative;
  top: 1.2rem;
}

.home-hero__title {
  margin: 0 0 .15rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a2e;
}

.home-hero__greeting {
  margin: 0 0 .3rem;
  font-size: .9rem;
  color: #4a4a72;
  font-weight: 500;
}

.home-hero__sub {
  margin: 0;
  font-size: .8rem;
  color: #5c5c85;
  line-height: 1.45;
}

.home-hero__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin-left: .5rem;
  margin-top: -.1rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  color: #444;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.home-hero__close:hover {
  background: rgba(255, 255, 255, .85);
}

/* ── Input card floating over hero ── */
.home-input-card {
  position: relative;
  z-index: 2;
  margin: 0rem 0.5rem 0.5rem 0.5rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(60, 60, 120, .14);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .6rem .6rem .9rem;
  border: 0.1px solid #e4eaf5;
}

.home-input-card input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: .85rem;
  color: #333;
  background: transparent;
}

.home-input-card input::placeholder {
  color: #bbb;
}

.home-input-card input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.home-input-card__send {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f52c8, #6366f1);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .4);
}

.home-input-card__send:hover:not(:disabled) {
  opacity: .88;
}

.home-input-card__send:disabled {
  opacity: .45;
  cursor: default;
}

/* ── Body ── */
.home-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
}

/* empty state */
.home-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem 1.5rem;
  text-align: center;
}

/* decorative chat bubble illustration */
.home-illus {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 1.1rem;
}

.home-illus__bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #eef0ff, #dde0ff);
}

.home-illus__main {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-56%, -56%);
  width: 60px;
  height: 52px;
  background: #6366f1;
  border-radius: 12px 12px 12px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.home-illus__secondary {
  position: absolute;
  right: 8px;
  bottom: 14px;
  width: 44px;
  height: 38px;
  background: #fff;
  border-radius: 10px 10px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0a3e8;
  font-size: 1rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .09);
}

/* sparkles */
.home-illus__spark {
  position: absolute;
  color: #f59e0b;
  font-size: .85rem;
}

.home-illus__spark--tl {
  top: 8px;
  left: 10px;
  transform: rotate(-15deg);
}

.home-illus__spark--tr {
  top: 14px;
  right: 5px;
  transform: rotate(20deg);
  font-size: .65rem;
}

.home-illus__spark--br {
  bottom: 10px;
  right: 2px;
  color: #a5b4fc;
  font-size: .7rem;
}

.home-empty__title {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
}

.home-empty__sub {
  margin: 0 0 1.35rem;
  font-size: .82rem;
  color: #777;
  line-height: 1.45;
}

/* feature pills */
.home-features {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .6rem;
  width: 100%;
}

.home-feature {
  background: #f5f6ff;
  border-radius: 12px;
  padding: .7rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}

.home-feature__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}

.home-feature__icon--green {
  background: #d1fae5;
  color: #059669;
}

.home-feature__icon--yellow {
  background: #fef3c7;
  color: #d97706;
}

.home-feature__icon--blue {
  background: #dbeafe;
  color: #2563eb;
}

.home-feature__label {
  font-size: .7rem;
  font-weight: 700;
  color: #333;
  text-align: center;
}

.home-feature__desc {
  font-size: .65rem;
  color: #888;
  text-align: center;
  line-height: 1.3;
}

/* active conversations */
.conv-section {
  padding: 1rem;
}

.conv-section--active {
  background: #f5f6ff;
  border-bottom: 1px solid #e8eaed;
}

.conv-section__heading {
  margin: 0 0 .75rem;
  font-size: .95rem;
  font-weight: 600;
  color: #333;
}

.conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.conv-list__item {
  display: flex;
  gap: .75rem;
  padding: .85rem 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.conv-list__item:hover {
  background: rgba(0, 0, 0, .02);
}

.conv-list__avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.conv-list__content {
  flex: 1;
  min-width: 0;
}

.conv-list__row {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .2rem;
}

.conv-list__name {
  font-size: .875rem;
  font-weight: 700;
}

.conv-list__time {
  font-size: .75rem;
  color: #999;
  white-space: nowrap;
}

.conv-list__preview {
  margin: 0;
  font-size: .8rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-list__empty {
  padding: 1.5rem 0;
  text-align: center;
  font-size: .8rem;
  color: #aaa;
  list-style: none;
}

/* previous toggle */
.previous-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  margin: .5rem 1rem 0;
}

.previous-toggle__chevron {
  display: inline-block;
  font-size: .75rem;
  transition: transform .15s ease;
}

.previous-toggle.is-open .previous-toggle__chevron {
  transform: rotate(180deg);
}

.previous-panel {
  margin: .5rem 1rem 0;
  padding-top: .65rem;
  border-top: 1px solid rgba(0, 0, 0, .06);
  max-height: 10rem;
  overflow-y: auto;
}

/* home footer */
.home-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  font-size: .75rem;
  color: #888;
}

.home-footer i {
  font-size: 1.1rem;
  color: #6366f1;
}

/* ══════════════════════════════════════════
       CHAT VIEW
    ══════════════════════════════════════════ */
.header-pattern {
  background-color: #f8f9fe;
  background-image: url(images/chat_background.png);
  background-size: cover;
  background-position: center top;
}

/* ── Chat header ── */
/* ── Chat view transition overlay ── */
.chat-loading {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-loading[hidden] { display: none; }

.chat-loading__spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e8eaff;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .85rem;
  background: #fff;
  border-bottom: 1px solid #eef0f8;
  position: relative;
}

.chat-header__back {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #555;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.chat-header__back:hover {
  background: #f0f2f8;
}

.chat-header__info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.chat-header__avatar {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header__meta {
  min-width: 0;
}

.chat-header__name {
  font-size: .9rem;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header__status {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  color: #666;
}

.chat-header__status-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.chat-header__end-btn {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .75rem;
  border: 1.5px solid #f87171;
  border-radius: 8px;
  background: transparent;
  color: #ef4444;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.chat-header__end-btn:hover {
  background: #fff1f2;
}

.chat-header__end-btn:disabled {
  opacity: .5;
  cursor: default;
}

.chat-header__menu-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.chat-header__menu-btn:hover {
  background: #f0f2f8;
}

.chat-menu {
  position: absolute;
  top: 100%;
  right: .5rem;
  z-index: 10;
  min-width: 9rem;
  background: #fff;
  border: 1px solid #e2e6ed;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
  padding: .3rem 0;
}

.chat-menu__item {
  display: block;
  width: 100%;
  padding: .6rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  font-size: .875rem;
  color: #333;
  cursor: pointer;
  font-family: inherit;
}

.chat-menu__item:hover {
  background: #f5f6f8;
}

/* ── Messages ── */
.msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  -webkit-overflow-scrolling: touch;
  background: #f8f9fe;
}

/* spacing between different senders */
.msg-row+.msg-row--user,
.msg-row--user+.msg-row {
  margin-top: .6rem;
}

.msg-row--system+.msg-row,
.msg-row+.msg-row--system {
  margin-top: .6rem;
}

/* user bubble */
.msg-row--user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
}

.msg-bubble {
  max-width: 75%;
  background: #e8eaff;
  color: #1a1a2e;
  border-radius: 16px 16px 4px 16px;
  padding: .65rem .9rem;
  font-size: .875rem;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(99, 102, 241, .1);
}

.msg-bubble__meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .68rem;
  color: #888;
  padding-right: .1rem;
}

.msg-bubble__meta i {
  font-size: .7rem;
  color: #818cf8;
}

/* agent card */
.msg-row--agent {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-top: .5rem;
}

.msg-agent-avatar {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #eef0ff;
  border: 1.5px solid #e0e2f8;
  color: #6366f1;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-agent-body {
  flex: 1;
  min-width: 0;
  max-width: 82%;
}

.msg-agent-name {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  font-weight: 700;
  color: #333;
  margin-bottom: .3rem;
}

.msg-agent-name i {
  font-size: .75rem;
  color: #aaa;
  cursor: pointer;
}

.msg-agent-card {
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  padding: .7rem .85rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  font-size: .875rem;
  line-height: 1.55;
  color: #333;
  word-break: break-word;
}

.msg-agent-time {
  font-size: .68rem;
  color: #aaa;
  margin-top: .35rem;
  padding-left: .1rem;
}

/* system message */
.msg-row--system {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .6rem 0;
}

.msg-system-line {
  flex: 1;
  height: 1px;
  background: #e4e6f0;
}

.msg-system-text {
  font-size: .72rem;
  color: #aaa;
  white-space: nowrap;
}

/* ── Compose ── */
.chat-compose-wrap {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #eef0f8;
  padding: 0 0.85rem 0.8rem;
}

.compose-tabs {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #eaedf2;
}

.compose-tab {
  display: inline-block;
  padding: 0.45rem 0.1rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.compose-tab--active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.compose-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border: 1px solid #d8dbe8;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.compose-box:focus-within {
  border-color: #6366f1;
}

.compose-textarea-field {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1;
  color: #1f2937;
  min-height: 2.5rem;
  max-height: 6rem;
  overflow-y: hidden;
  box-sizing: border-box;
}

.compose-textarea-field::placeholder {
  color: #9ca3af;
}

.compose-textarea-field:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compose-textarea-field:focus {
  outline: none;
  box-shadow: none;
}

.compose-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.15rem;
}

.compose-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.compose-tool-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.compose-tool-btn:hover {
  background: #f0f2f8;
  color: #6366f1;
}

.compose-mic-btn:disabled { opacity: .4; cursor: not-allowed; }

.compose-mic-btn.is-recording {
  background: #ef4444;
  color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

.compose-mic-btn.is-recording:hover {
  background: #ef4444;
  color: #fff;
}

@keyframes mic-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .45);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, .0);
  }
}

.compose-mic-label {
  position: absolute;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.compose-mic-btn.is-recording .compose-mic-label {
  opacity: 1;
}

.compose-send-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f52c8, #6366f1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(99, 102, 241, .35);
  transition: opacity 0.15s;
}

.compose-send-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.compose-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.compose-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compose-preview-box {
  position: relative;
  flex-shrink: 0;
}

.compose-preview-box__img {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e4e6f0;
}

.compose-preview-box__file {
  max-width: 160px;
  padding: .45rem .6rem;
  background: #f1f3f8;
  border-radius: 8px;
  font-size: .75rem;
  color: #444;
  border: 1px solid #e4e6f0;
  word-break: break-all;
}

.compose-preview-box__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: none;
  background: #1a1a2e;
  color: #fff;
  font-size: .65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.compose-preview-box__remove:hover {
  background: #ef4444;
}

.msg-row--user .msg-attachments {
  max-width: 75%;
  background: #e8eaff;
  border-radius: 16px 16px 4px 16px;
  padding: .4rem;
  box-shadow: 0 1px 4px rgba(99, 102, 241, .1);
}

.msg-row--agent .msg-attachments {
  margin-top: .35rem;
}

.msg-attachment__img-link {
  display: block;
  line-height: 0;
  cursor: pointer;
}

.msg-attachment img {
  display: block;
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid #e4e6f0;
}

.msg-attachment__link {
  font-size: .8rem;
  color: #6366f1;
  text-decoration: none;
  cursor: pointer;
}

.msg-attachment__link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════
       SHELL
    ══════════════════════════════════════════ */
body:not(.is-embed) {
  background: white;
}

body:not(.is-embed) .widget {
  width: 420px;
  max-width: 420px;
  height: 680px;
  max-height: 680px;
  margin: 1rem auto;
  border-radius: 20px;
  background: white;
  box-shadow: 0 12px 48px rgba(60, 60, 120, .18);
  overflow: hidden;
}

body.is-embed .widget {
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 680px;
}

@media (max-width: 420px) {
  body:not(.is-embed) .widget {
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}