studio-sales-chat {
  --studio-chat-ink: #302920;
  --studio-chat-muted: #64574b;
  --studio-chat-accent: #584638;
  --studio-chat-strong: #413228;
  --studio-chat-paper: #fbf8f3;
  --studio-chat-tint: #eee4d8;
  --studio-chat-border: #ddcfc0;
  --studio-chat-font: Raleway, system-ui, sans-serif;
  color-scheme: light;
  font-family: var(--studio-chat-font);
}

studio-sales-chat[data-brand="events"] {
  --studio-chat-ink: #3b2825;
  --studio-chat-muted: #69504a;
  --studio-chat-accent: #923e36;
  --studio-chat-strong: #733129;
  --studio-chat-paper: #fff8f5;
  --studio-chat-tint: #f8e3dc;
  --studio-chat-border: #efd2c9;
}

studio-sales-chat :where(button, input, a) {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}

studio-sales-chat :where(button, input, a):focus-visible {
  outline: 2px solid var(--studio-chat-accent);
  outline-offset: 3px;
}

studio-sales-chat svg { width: 21px; height: 21px; flex: none; vertical-align: middle; }

.studio-chat__launcher {
  position: fixed;
  z-index: 1030;
  inset-inline-end: max(1rem, calc(env(safe-area-inset-right) + .5rem));
  bottom: max(1rem, calc(env(safe-area-inset-bottom) + .5rem));
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 48px;
  padding: .45rem .95rem;
  border: 1px solid #ffffff73;
  border-radius: 2rem;
  background: var(--studio-chat-accent);
  box-shadow: 0 5px 23px #26181240;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

.studio-chat__launcher:hover, .studio-chat__send:hover:not(:disabled) { background: var(--studio-chat-strong); }

.studio-chat__dialog {
  box-sizing: border-box;
  position: fixed;
  inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto;
  width: min(25rem, calc(100% - 2rem));
  height: min(33rem, calc(100% - 2rem));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--studio-chat-border);
  border-radius: 1.15rem;
  background: var(--studio-chat-paper);
  box-shadow: 0 12px 50px #21171048;
  color: var(--studio-chat-ink);
  text-align: start;
  font: 500 .94rem/1.5 var(--studio-chat-font);
}

.studio-chat__dialog::backdrop { background: #241b183e; }
.studio-chat__dialog p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.studio-chat__panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }

.studio-chat__header {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  align-items: center;
  gap: .65rem;
  padding: .68rem .85rem;
  border-bottom: 1px solid var(--studio-chat-border);
  background: #fff;
}

.studio-chat__title {
  margin: 0;
  color: var(--studio-chat-ink);
  letter-spacing: -.022em;
  font: 700 1.14rem/1.2 var(--studio-chat-font);
}

.studio-chat__mark, .studio-chat__close, .studio-chat__send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
}

.studio-chat__mark { width: 42px; height: 42px; background: var(--studio-chat-tint); color: var(--studio-chat-accent); }
.studio-chat__close { background: transparent; color: var(--studio-chat-muted); cursor: pointer; }
.studio-chat__close:hover { background: var(--studio-chat-tint); }

.studio-chat__transcript {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7rem;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  padding: 1rem;
  background: radial-gradient(ellipse at 0 0, var(--studio-chat-tint), transparent 76%), var(--studio-chat-paper);
}

.studio-chat__welcome { width: 100%; }
.studio-chat__prompts { display: grid; gap: .46rem; margin-top: .85rem; }
.studio-chat__prompt, .studio-chat__action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .46rem .7rem;
  border: 1px solid var(--studio-chat-border);
  border-radius: .68rem;
  background: #fff;
  color: var(--studio-chat-strong);
  font-size: .87rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.studio-chat__prompt:hover, .studio-chat__action:hover { background: var(--studio-chat-tint); color: var(--studio-chat-strong); }
.studio-chat__question, .studio-chat__reply { max-width: 92%; padding: .65rem .8rem; border-radius: .85rem; }
.studio-chat__dialog .studio-chat__question { align-self: end; background: var(--studio-chat-accent); color: #fff; border-end-end-radius: .25rem; }
.studio-chat__reply { border: 1px solid var(--studio-chat-border); background: #fff; border-end-start-radius: .25rem; }
.studio-chat__actions { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .62rem; }
.studio-chat__dialog .studio-chat__status { font-size: .86rem; color: var(--studio-chat-muted); }

.studio-chat__composer {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .65rem .85rem;
  border-top: 1px solid var(--studio-chat-border);
  background: #fff;
}

.studio-chat__input {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: .5rem .7rem;
  border: 1px solid #b7a99c;
  border-radius: .68rem;
  background: #fff;
  color: var(--studio-chat-ink);
  font-size: 1rem;
}

.studio-chat__input::placeholder { color: var(--studio-chat-muted); }
.studio-chat__send { background: var(--studio-chat-accent); color: #fff; cursor: pointer; }
.studio-chat__send:disabled { background: var(--studio-chat-tint); color: var(--studio-chat-muted); cursor: default; }

.studio-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 575px) {
  .studio-chat__dialog {
    inset: auto 0 0;
    width: 100%;
    height: min(31rem, 100%);
    height: min(31rem, 100dvh);
    border-width: 1px 0 0;
    border-radius: 1.15rem 1.15rem 0 0;
  }
  .studio-chat__composer { padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
}
