/* SomaTech AI chat — full modern chatbot UI */
.st-chat-root {
  --st-orange: #ff4d00;
  --st-orange-2: #ff7a33;
  --st-orange-soft: rgba(255, 77, 0, 0.12);
  --st-bg: #0c0c0e;
  --st-bg-2: #141418;
  --st-bg-3: #1c1c22;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-text: #f4f4f5;
  --st-muted: #a1a1aa;
  --st-radius: 18px;
  --st-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--st-text);
}
.st-chat-root *,
.st-chat-root *::before,
.st-chat-root *::after { box-sizing: border-box; }

/* ——— FAB ——— */
.st-chat-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 5.15rem;
  height: 5.15rem;
  border-radius: 999px;
  border: 3px solid #fff;
  background: linear-gradient(145deg, var(--st-orange-2) 0%, var(--st-orange) 50%, #d94000 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  box-shadow: 0 16px 40px rgba(255, 77, 0, 0.5);
  z-index: 2147483001;
  animation: none;
  transition: transform .22s ease, box-shadow .22s ease;
}
.st-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 20px 50px rgba(255, 77, 0, 0.65);
  animation: none;
}
.st-chat-fab:active { transform: scale(0.97); }
.st-chat-fab svg { width: 1.9rem; height: 1.9rem; fill: currentColor; }
.st-fab-label { display: none !important; }
.st-fab-badge {
  position: absolute;
  top: -.15rem;
  right: -.15rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .32rem;
  border-radius: 999px;
  background: #fff;
  color: var(--st-orange);
  font-size: .68rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--st-orange);
}
@keyframes st-fab-pulse {
  0% { box-shadow: 0 16px 40px rgba(255,77,0,.5), 0 0 0 0 rgba(255,77,0,.4); }
  70% { box-shadow: 0 16px 40px rgba(255,77,0,.5), 0 0 0 18px rgba(255,77,0,0); }
  100% { box-shadow: 0 16px 40px rgba(255,77,0,.5), 0 0 0 0 rgba(255,77,0,0); }
}

/* ——— Panel shell ——— */
.st-chat-panel {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  width: min(34rem, 96vw);
  height: min(52rem, 86vh);
  max-width: 96vw;
  max-height: 86vh;
  background: var(--st-bg);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  border-radius: 22px;
  box-shadow: var(--st-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483002;
  /* elegant motion */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.94);
  transform-origin: 100% 100%;
  transition:
    opacity .22s ease,
    transform .32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear .32s,
    width .36s cubic-bezier(0.22, 1, 0.36, 1),
    height .36s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius .36s cubic-bezier(0.22, 1, 0.36, 1),
    right .36s cubic-bezier(0.22, 1, 0.36, 1),
    bottom .36s cubic-bezier(0.22, 1, 0.36, 1),
    top .36s cubic-bezier(0.22, 1, 0.36, 1),
    left .36s cubic-bezier(0.22, 1, 0.36, 1);
}

.st-chat-panel.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition:
    opacity .24s ease,
    transform .34s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s,
    width .36s cubic-bezier(0.22, 1, 0.36, 1),
    height .36s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius .36s cubic-bezier(0.22, 1, 0.36, 1),
    right .36s cubic-bezier(0.22, 1, 0.36, 1),
    bottom .36s cubic-bezier(0.22, 1, 0.36, 1),
    top .36s cubic-bezier(0.22, 1, 0.36, 1),
    left .36s cubic-bezier(0.22, 1, 0.36, 1);
}

.st-chat-panel.fullscreen {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  transform: none !important;
}

/* idle progress */
.st-idle-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.st-idle-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--st-orange), var(--st-orange-2));
  transition: width .45s linear;
}

/* ——— Header ——— */
.st-chat-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .95rem 1.1rem;
  background: linear-gradient(180deg, #1a1a20 0%, var(--st-bg-2) 100%);
  border-bottom: 1px solid var(--st-border);
  flex-shrink: 0;
}
.st-chat-header .brand {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .78rem;
  letter-spacing: .06em;
  box-shadow: 0 6px 18px rgba(255, 77, 0, 0.35);
  flex-shrink: 0;
}
.st-chat-header .meta { flex: 1; min-width: 0; }
.st-chat-header .meta strong {
  display: block;
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.st-chat-header .meta span {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: var(--st-muted);
  margin-top: .12rem;
}
.st-status-dot {
  width: .48rem;
  height: .48rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  display: inline-block;
}
.st-icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 11px;
  border: 1px solid var(--st-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--st-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, transform .15s;
  flex-shrink: 0;
}
.st-icon-btn:hover {
  background: var(--st-orange-soft);
  border-color: rgba(255, 77, 0, 0.55);
  color: var(--st-orange-2);
}
.st-icon-btn:active { transform: scale(0.94); }
.st-icon-btn svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

/* ——— Mode tabs ——— */
.st-chat-modes {
  display: flex;
  gap: .45rem;
  padding: .65rem .95rem;
  background: var(--st-bg-2);
  border-bottom: 1px solid var(--st-border);
  flex-shrink: 0;
}
.st-chat-modes button {
  flex: 1;
  padding: .52rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: transparent;
  color: var(--st-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .18s ease;
}
.st-chat-modes button:hover {
  color: var(--st-text);
  border-color: rgba(255, 255, 255, 0.18);
}
.st-chat-modes button.active {
  background: var(--st-orange-soft);
  color: var(--st-orange-2);
  border-color: rgba(255, 77, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1);
}

/* ——— Messages ——— */
.st-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.15rem 1.1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(255, 77, 0, 0.07), transparent 55%),
    radial-gradient(700px 280px at 100% 100%, rgba(255, 122, 51, 0.05), transparent 50%),
    var(--st-bg);
  scroll-behavior: smooth;
}
.st-chat-messages::-webkit-scrollbar { width: 6px; }
.st-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

/* row with avatar + bubble */
.st-row {
  display: flex;
  align-items: flex-end;
  gap: .65rem;
  max-width: min(92%, 42rem);
  animation: st-msg-in .28s ease;
}
.st-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.st-row.bot { align-self: flex-start; }
.st-row.sys {
  align-self: center;
  max-width: 92%;
}
@keyframes st-msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.st-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .04em;
  flex-shrink: 0;
  user-select: none;
}
.st-row.bot .st-avatar {
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 77, 0, 0.4);
}
.st-row.user .st-avatar {
  background: linear-gradient(145deg, #3f3f46, #27272a);
  color: #e4e4e7;
  border: 1px solid var(--st-border);
}

.st-msg {
  padding: .95rem 1.15rem;
  border-radius: 20px;
  font-size: .94rem;
  line-height: 1.65;
  word-break: break-word;
  white-space: normal;
  letter-spacing: .005em;
}
.st-msg.pre {
  white-space: pre-wrap;
}
.st-row.bot .st-msg {
  background: linear-gradient(160deg, #22222a 0%, var(--st-bg-3) 100%);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  border-bottom-left-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.st-row.user .st-msg {
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 8px 22px rgba(255, 77, 0, 0.32);
}

/* Rich content inside bot/user bubbles */
.st-msg p {
  margin: 0 0 .65rem;
}
.st-msg p:last-child { margin-bottom: 0; }
.st-msg strong, .st-msg b {
  font-weight: 700;
  color: inherit;
}
.st-row.bot .st-msg strong {
  color: var(--st-orange-2);
  text-shadow: 0 0 24px rgba(255, 77, 0, 0.15);
}
.st-row.user .st-msg strong { color: #fff; }
.st-msg em { font-style: italic; opacity: .92; }
.st-msg h1, .st-msg h2, .st-msg h3, .st-msg h4 {
  margin: .75rem 0 .45rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.st-row.bot .st-msg h1,
.st-row.bot .st-msg h2,
.st-row.bot .st-msg h3,
.st-row.bot .st-msg h4 { color: var(--st-orange-2); }
.st-msg ul, .st-msg ol {
  margin: .45rem 0 .7rem;
  padding-left: 1.15rem;
}
.st-msg li {
  margin: .28rem 0;
  padding-left: .15rem;
  line-height: 1.55;
}
.st-msg li::marker {
  color: var(--st-orange);
  font-weight: 700;
}
.st-msg ul {
  list-style: none;
  padding-left: 1rem;
}
.st-msg ul > li {
  position: relative;
}
.st-msg ul > li::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: .55em;
  width: .38rem;
  height: .38rem;
  border-radius: 99px;
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
}
.st-msg ol {
  list-style: none;
  counter-reset: st-n;
  padding-left: 1.35rem;
}
.st-msg ol > li {
  position: relative;
  counter-increment: st-n;
}
.st-msg ol > li::before {
  content: counter(st-n);
  position: absolute;
  left: -1.35rem;
  top: .1em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 99px;
  background: rgba(255, 77, 0, 0.18);
  color: var(--st-orange-2);
  font-size: .68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-row.user .st-msg ul > li::before { background: rgba(255, 255, 255, 0.55); }
.st-row.user .st-msg ol > li::before {
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}
.st-msg code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82em;
  background: rgba(0, 0, 0, 0.3);
  padding: .14rem .4rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.st-row.user .st-msg code { background: rgba(0, 0, 0, 0.22); }
.st-msg pre {
  margin: .55rem 0;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  overflow-x: auto;
  border: 1px solid var(--st-border);
}
.st-msg pre code {
  background: none;
  border: none;
  padding: 0;
}
.st-msg a {
  color: var(--st-orange-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.st-row.user .st-msg a { color: #fff; }
.st-msg blockquote {
  margin: .55rem 0;
  padding: .35rem 0 .35rem .85rem;
  border-left: 3px solid var(--st-orange);
  color: var(--st-muted);
  font-style: italic;
}
.st-msg hr {
  border: none;
  border-top: 1px solid var(--st-border);
  margin: .75rem 0;
}
.st-msg table {
  width: 100%;
  border-collapse: collapse;
  margin: .55rem 0;
  font-size: .84rem;
}
.st-msg th, .st-msg td {
  border: 1px solid var(--st-border);
  padding: .4rem .55rem;
  text-align: left;
}
.st-msg th {
  background: rgba(255, 77, 0, 0.12);
  color: var(--st-orange-2);
  font-weight: 700;
}

.st-meta {
  display: block;
  margin-top: .35rem;
  font-size: .68rem;
  opacity: .7;
  font-weight: 500;
}

/* attachments */
.st-atts {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
}
.st-att-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-row.user .st-att-chip {
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.95);
}
.st-row.bot .st-att-chip {
  background: var(--st-orange-soft);
  color: var(--st-orange-2);
}
.st-att-chip .ico {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: inline-flex;
}

/* audio */
.st-msg audio {
  width: min(100%, 17rem);
  margin-top: .65rem;
  display: block;
  height: 2.45rem;
  border-radius: 999px;
  filter: none;
}

/* system / date dividers */
.st-sys {
  align-self: center;
  text-align: center;
  font-size: .72rem;
  color: var(--st-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--st-border);
  border-radius: 999px;
  padding: .35rem .85rem;
  max-width: 90%;
}

/* typing */
.st-typing-row { align-self: flex-start; }
.st-typing-card {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1rem .7rem .65rem;
  background: var(--st-bg-3);
  border: 1px solid var(--st-border);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.st-typing-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-dots {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  height: 1.15rem;
}
.st-dots i {
  width: .48rem;
  height: .48rem;
  border-radius: 999px;
  background: var(--st-orange);
  opacity: .4;
  display: inline-block;
  animation: st-bounce 1.15s ease-in-out infinite;
}
.st-dots i:nth-child(2) { animation-delay: .15s; }
.st-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes st-bounce {
  0%, 70%, 100% { transform: translateY(0); opacity: .4; }
  35% { transform: translateY(-6px); opacity: 1; }
}

/* entrance */
.st-enter {
  animation: st-msg-in .3s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes st-msg-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.st-row.user.st-enter { animation-name: st-msg-in-right; }
@keyframes st-msg-in-right {
  from { opacity: 0; transform: translate(14px, 10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ——— Composer ——— */
.st-chat-composer {
  border-top: 1px solid var(--st-border);
  background: var(--st-bg-2);
  padding: .85rem .95rem .95rem;
  flex-shrink: 0;
}
.st-previews {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .65rem;
}
.st-previews:empty { display: none; }
.st-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  background: var(--st-orange-soft);
  color: var(--st-orange-2);
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid rgba(255, 77, 0, 0.25);
  max-width: 13rem;
}
.st-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-chip button {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.st-chip button:hover { background: rgba(255, 77, 0, 0.35); color: #fff; }

.st-input-row {
  display: flex;
  align-items: flex-end;
  gap: .55rem;
  background: var(--st-bg-3);
  border: 1px solid var(--st-border);
  border-radius: 18px;
  padding: .45rem .45rem .45rem .85rem;
  transition: border-color .18s, box-shadow .18s;
}
.st-input-row:focus-within {
  border-color: rgba(255, 77, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.12);
}
.st-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 2.55rem;
  max-height: 8.5rem;
  padding: .55rem 0;
  border: none;
  background: transparent;
  color: var(--st-text);
  font: inherit;
  font-size: .95rem;
  line-height: 1.45;
  outline: none;
}
.st-input-row textarea::placeholder { color: var(--st-muted); }

.st-send {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 13px;
  border: none;
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 77, 0, 0.35);
  transition: transform .15s, opacity .15s, box-shadow .15s;
  flex-shrink: 0;
}
.st-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 77, 0, 0.45);
}
.st-send:active:not(:disabled) { transform: scale(0.95); }
.st-send:disabled { opacity: .55; cursor: not-allowed; }
.st-send svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.st-send.st-sending svg { display: none; }
.st-send.st-sending::after {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: st-spin .7s linear infinite;
  display: block;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

.st-toolbar {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .65rem;
}
.st-toolbar .hint {
  margin-left: auto;
  font-size: .68rem;
  color: var(--st-muted);
  font-weight: 500;
}
.st-rec {
  color: var(--st-orange-2) !important;
  border-color: rgba(255, 77, 0, 0.75) !important;
  background: var(--st-orange-soft) !important;
  animation: st-rec-pulse 1.15s ease infinite;
}
@keyframes st-rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 0, 0.35); }
  50% { box-shadow: 0 0 0 9px rgba(255, 77, 0, 0); }
}

/* ——— Voice bar (recording) + review ——— */
.st-voice-bar,
.st-voice-review {
  background: var(--st-bg-3);
  border: 1px solid var(--st-border);
  border-radius: 16px;
  padding: .85rem 1rem;
  margin-bottom: .65rem;
}
.st-voice-bar[hidden],
.st-voice-review[hidden] { display: none !important; }

.st-voice-bar-main {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.st-rec-dot {
  width: .85rem;
  height: .85rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  flex-shrink: 0;
  animation: st-rec-pulse 1.1s ease infinite;
}
.st-voice-bar-text {
  flex: 1;
  min-width: 8rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.st-voice-bar-text strong {
  font-size: .82rem;
  font-weight: 700;
}
.st-voice-bar-text span {
  font-size: .78rem;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.st-rec-done {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.st-rec-done svg,
.st-voice-actions .st-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}
.st-icon-danger {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}
.st-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fff !important;
}

.st-wave {
  display: flex;
  align-items: flex-end;
  gap: .22rem;
  height: 1.5rem;
  margin-top: .65rem;
}
.st-wave i {
  flex: 1;
  min-width: .22rem;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--st-orange-2), var(--st-orange));
  animation: st-wave 0.9s ease-in-out infinite;
  height: 35%;
}
.st-wave i:nth-child(2) { animation-delay: .1s; height: 70%; }
.st-wave i:nth-child(3) { animation-delay: .2s; height: 45%; }
.st-wave i:nth-child(4) { animation-delay: .3s; height: 90%; }
.st-wave i:nth-child(5) { animation-delay: .15s; height: 55%; }
.st-wave i:nth-child(6) { animation-delay: .25s; height: 80%; }
.st-wave i:nth-child(7) { animation-delay: .05s; height: 40%; }
.st-wave i:nth-child(8) { animation-delay: .35s; height: 65%; }
@keyframes st-wave {
  0%, 100% { transform: scaleY(0.55); opacity: .65; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

.st-voice-review-head {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-bottom: .65rem;
}
.st-voice-review-head strong { font-size: .88rem; }
.st-voice-hint {
  font-size: .72rem;
  color: var(--st-muted);
  line-height: 1.4;
}

/* Custom audio player (review + bot voice) */
.st-player {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--st-border);
  border-radius: 14px;
  padding: .7rem .85rem;
  margin-bottom: .75rem;
}
.st-player audio { display: none; }
.st-hidden { display: none !important; }
.st-player-btn {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.35);
  transition: transform .15s, filter .15s;
}
.st-player-btn:hover { filter: brightness(1.08); }
.st-player-btn:active { transform: scale(0.94); }
.st-player-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: #fff;
}
.st-player-btn-sm {
  width: 2.1rem;
  height: 2.1rem;
}
.st-player-btn-sm svg {
  width: .95rem;
  height: .95rem;
}
.st-player-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.st-player-track {
  height: .35rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  overflow: hidden;
}
.st-player-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--st-orange-2), var(--st-orange));
  transition: width .12s linear;
}
.st-player-times {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.st-playing .st-player-track {
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.12);
}
.st-bot-audio {
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--st-border);
}
.st-bot-audio .st-player {
  margin-bottom: 0;
  padding: .55rem .7rem;
}

.st-voice-actions {
  display: flex;
  gap: .55rem;
  justify-content: flex-end;
}
.st-voice-actions .st-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.st-btn {
  border-radius: 999px;
  padding: .55rem 1.05rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  white-space: nowrap;
}
.st-btn:active { transform: scale(0.97); }
.st-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.st-btn-primary {
  background: linear-gradient(145deg, var(--st-orange-2), var(--st-orange));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 77, 0, 0.3);
}
.st-btn-primary:hover { filter: brightness(1.06); }
.st-btn-ghost {
  background: transparent;
  color: var(--st-muted);
  border-color: var(--st-border);
}
.st-btn-ghost:hover {
  color: var(--st-text);
  border-color: rgba(255, 255, 255, 0.22);
}

/* mobile voice UI */
@media (max-width: 720px) {
  .st-voice-bar-main { gap: .5rem; }
  .st-voice-actions { flex-direction: column-reverse; }
  .st-voice-actions .st-btn { width: 100%; text-align: center; }
}

/* mobile: always full-screen overlay on top of the site (any phone size) */
@media (max-width: 720px), (max-height: 520px) {
  .st-chat-fab {
    right: 5.5rem;
    bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
    width: 4.45rem;
    height: 4.45rem;
  }
  .st-chat-fab svg { width: 1.55rem; height: 1.55rem; }
  .st-fab-label { display: none !important; }

  /* Force edge-to-edge overlay above the whole site */
  .st-chat-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    z-index: 2147483002 !important;
  }
  .st-chat-panel.open {
    animation: none;
  }
  @keyframes st-panel-full-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
  .st-chat-panel.fullscreen { border-radius: 0 !important; }

  .st-chat-header {
    padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  }
  .st-chat-composer {
    padding-bottom: calc(0.95rem + env(safe-area-inset-bottom, 0px));
  }
  .st-row { max-width: 96%; }
  .st-avatar { width: 1.75rem; height: 1.75rem; }
  .st-chat-modes button {
    font-size: .68rem;
    padding: .48rem .55rem;
  }
}

/* very small phones / landscape */
@media (max-width: 380px) {
  .st-chat-fab {
    width: 4.15rem;
    height: 4.15rem;
    right: 5.15rem;
    bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }
  .st-chat-header .meta strong { font-size: .9rem; }
  .st-msg { font-size: .88rem; }
}

/* tablets portrait — still prefer full overlay when height is limited */
@media (min-width: 721px) and (max-width: 1024px) and (max-height: 800px) {
  .st-chat-panel.open {
    width: min(100vw, 40rem);
    height: min(100dvh, 48rem);
  }
}

/* ——— Yachaq branding (logo) ——— */
.st-fab-logo {
  width: 2.55rem;
  height: 2.55rem;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: .28rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  pointer-events: none;
}
.st-chat-fab {
  width: 5.35rem;
  height: 5.35rem;
  padding: .35rem .35rem .55rem;
  background: #fff;
  border: none;
  box-shadow: 0 14px 36px rgba(255, 77, 0, 0.28), 0 2px 10px rgba(0,0,0,.08);
  gap: .18rem;
}
.st-chat-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 18px 42px rgba(255, 77, 0, 0.38);
}
.st-fab-label { display: none !important; }
.st-fab-badge { display: none; }

.st-chat-header .brand {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  background: #fff;
  padding: .22rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.st-chat-header .brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
}

.st-avatar.bot {
  background: #fff;
  padding: .12rem;
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.2);
}
.st-avatar.bot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.st-avatar {
  overflow: hidden;
}

/* ——— Yachaq FAB (big bubble) ——— */
.st-fab-wrap {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .75rem;
}

.st-chat-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.75rem;
  height: 5.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  animation: none;
  box-shadow:
    0 0 0 3px rgba(255, 77, 0, 0.22),
    0 18px 40px rgba(15, 15, 15, 0.18);
  transition: transform .18s ease, box-shadow .18s ease;
}

.st-chat-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 0 0 4px rgba(255, 77, 0, 0.35),
    0 22px 48px rgba(255, 77, 0, 0.3);
  animation: none;
}

.st-chat-fab:active { transform: scale(0.97); }

.st-fab-logo {
  width: 3.35rem;
  height: 3.35rem;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  border-radius: 50%;
}

.st-chat-fab.st-fab-fallback::before {
  content: "Y";
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background: #ff4d00;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.65rem;
}

.st-fab-tip {
  background: rgba(20, 20, 24, 0.94);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}

.st-fab-wrap:hover .st-fab-tip { opacity: 1; }

.st-fab-label { display: none !important; }
.st-fab-badge { display: none !important; }

@media (max-width: 720px) {
  .st-fab-wrap { right: 1.15rem; bottom: 1.15rem; }
  .st-chat-fab { width: 5.15rem; height: 5.15rem; }
  .st-fab-logo { width: 3rem; height: 3rem; }
}

/* ——— Motion polish (elegant) ——— */
.st-chat-fab {
  animation: none !important;
  transition:
    transform .28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow .28s ease,
    opacity .22s ease;
  transform-origin: center;
}

.st-chat-fab:hover {
  transform: translateY(-2px) scale(1.03);
  transition-duration: .22s;
}

.st-chat-fab:active {
  transform: scale(0.97);
  transition-duration: .08s;
}

/* hide FAB with fade when panel opens */
.st-chat-root.is-open .st-chat-fab,
.st-chat-root.is-open .st-fab-tip {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.st-icon-btn {
  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .22s cubic-bezier(0.22, 1, 0.36, 1);
}

.st-icon-btn:hover {
  transform: translateY(-1px);
}

.st-icon-btn:active {
  transform: scale(0.94);
}

/* expand icon: soft rotate */
.st-chat-header [data-act="expand"] svg {
  transition: transform .32s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.st-chat-panel.fullscreen .st-chat-header [data-act="expand"] svg {
  transform: rotate(180deg);
}

/* messages */
.st-row {
  animation: st-msg-in .32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes st-msg-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.st-row.user {
  animation-name: st-msg-in-right;
}

@keyframes st-msg-in-right {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* mode pills */
.st-chat-modes button {
  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    transform .2s cubic-bezier(0.22, 1, 0.36, 1);
}

.st-chat-modes button:hover {
  transform: translateY(-1px);
}

.st-chat-modes button.active {
  transition-duration: .18s;
}

/* composer / send */
.st-send {
  transition:
    transform .22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity .2s ease,
    background .2s ease;
}

.st-send:hover {
  transform: translateY(-1px) scale(1.03);
}

.st-send:active {
  transform: scale(0.96);
}

/* status dot: quiet pulse */
.st-status-dot {
  animation: st-status-breathe 2.4s ease-in-out infinite;
}

@keyframes st-status-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* typing dots: subtle */
.st-dots i,
.st-typing-dots i {
  animation: st-bounce 1.2s ease-in-out infinite;
}

@keyframes st-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: .45;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-chat-root *,
  .st-chat-root *::before,
  .st-chat-root *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   CHAT UI FINAL — origin from bubble, clean
   ============================================ */

.st-chat-panel {
  /* sit on the FAB corner */
  right: 1.75rem;
  bottom: 1.75rem;
  left: auto;
  top: auto;
  width: min(36rem, calc(100vw - 2.5rem));
  height: min(54rem, calc(100dvh - 2.5rem));
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  transform-origin: 100% 100%;
  will-change: transform, opacity;
}

.st-chat-panel.open {
  transform: scale(1) translateY(0);
}

.st-chat-panel:not(.open) {
  transform: scale(0.42) translate(12%, 12%);
  opacity: 0;
}

.st-chat-panel.fullscreen {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  border-radius: 0;
  border: none;
  /* keep morph coming from bubble corner */
  transform: scale(1) translate(0, 0);
}

/* Header */
.st-chat-header {
  gap: .85rem;
  padding: 1rem 1.15rem;
  background: rgba(18, 18, 22, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.st-chat-header .brand {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 14px;
  background: #fff;
  padding: .28rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.st-chat-header .brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.st-chat-header .meta strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.st-chat-header .meta span {
  font-size: .78rem;
  color: rgba(255, 255, 255, 0.62);
}

.st-icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
}

.st-icon-btn:hover {
  background: rgba(255, 77, 0, 0.16);
  border-color: rgba(255, 77, 0, 0.4);
  color: #ff8a4c;
  transform: none;
}

/* Messages */
.st-chat-messages {
  padding: 1.25rem 1.2rem 1.5rem;
  gap: .95rem;
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(255, 77, 0, 0.08), transparent 55%),
    #0e0e12;
}

.st-row {
  max-width: min(88%, 36rem);
  animation: st-msg-in .32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.st-msg {
  padding: .95rem 1.15rem;
  border-radius: 18px;
  font-size: .95rem;
  line-height: 1.65;
}

.st-row.bot .st-msg {
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.st-row.user .st-msg {
  background: linear-gradient(145deg, #ff6a2c, #ff4d00);
  border: none;
  border-bottom-right-radius: 8px;
  box-shadow: 0 12px 28px rgba(255, 77, 0, 0.28);
}

.st-avatar {
  width: 2.05rem;
  height: 2.05rem;
}

.st-avatar.bot {
  background: #fff;
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.18);
}

/* Modes */
.st-chat-modes {
  padding: .7rem 1rem;
  background: rgba(14, 14, 18, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: .5rem;
}

.st-chat-modes button {
  font-size: .74rem;
  letter-spacing: .05em;
  border-radius: 999px;
  padding: .55rem .85rem;
}

.st-chat-modes button.active {
  background: rgba(255, 77, 0, 0.18);
  color: #ff8a4c;
  border-color: rgba(255, 77, 0, 0.45);
  box-shadow: none;
}

/* Composer */
.st-chat-composer {
  padding: .95rem 1rem 1.05rem;
  background: rgba(16, 16, 20, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.st-input-row {
  border-radius: 18px;
  background: #1c1c24;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: .45rem .45rem .45rem 1rem;
}

.st-input-row:focus-within {
  border-color: rgba(255, 77, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.12);
}

.st-send {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff6a2c, #ff4d00);
  box-shadow: 0 8px 18px rgba(255, 77, 0, 0.28);
}

/* Fullscreen morph from bubble */
.st-chat-panel.fullscreen {
  transition:
    opacity .24s ease,
    transform .38s cubic-bezier(0.22, 1, 0.36, 1),
    width .38s cubic-bezier(0.22, 1, 0.36, 1),
    height .38s cubic-bezier(0.22, 1, 0.36, 1),
    right .38s cubic-bezier(0.22, 1, 0.36, 1),
    bottom .38s cubic-bezier(0.22, 1, 0.36, 1),
    top .38s cubic-bezier(0.22, 1, 0.36, 1),
    left .38s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius .38s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 720px) {
  .st-chat-panel {
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    transform-origin: 50% 100% !important;
  }
}

/* ============================================
   LIGHT / DARK — follows site theme (html.dark)
   ============================================ */

.st-chat-root {
  --st-surface: #ffffff;
  --st-surface-2: #f6f5f3;
  --st-surface-3: #eceae6;
  --st-text: #171614;
  --st-muted: #6d6860;
  --st-border: rgba(24, 22, 18, 0.10);
  --st-shadow: 0 24px 64px rgba(28, 24, 18, 0.18);
  --st-header-bg: linear-gradient(180deg, #fffaf6 0%, var(--st-surface) 100%);
  --st-bot-bubble: #fff7f2;
  --st-bot-border: rgba(255, 77, 0, 0.12);
  --st-tip-bg: rgba(24, 22, 18, 0.92);
  color: var(--st-text);
  transition: color .25s ease;
}

html.dark .st-chat-root,
.dark .st-chat-root {
  --st-surface: #121216;
  --st-surface-2: #1a1a22;
  --st-surface-3: #22222c;
  --st-text: #f4f1ec;
  --st-muted: #a39e96;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  --st-header-bg: linear-gradient(180deg, #1c1c24 0%, var(--st-surface) 100%);
  --st-bot-bubble: #1c1c24;
  --st-bot-border: rgba(255, 255, 255, 0.06);
  --st-tip-bg: rgba(20, 20, 24, 0.94);
}

/* FAB */
.st-chat-fab {
  background: var(--st-surface);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.18), 0 16px 40px rgba(15, 15, 15, 0.14);
}

html.dark .st-chat-fab,
.dark .st-chat-fab {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.28), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.st-fab-tip {
  background: var(--st-tip-bg);
  color: #fff;
}

/* Panel shell */
.st-chat-panel {
  background: var(--st-surface);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  box-shadow: var(--st-shadow);
  transition:
    opacity .22s ease,
    transform .32s cubic-bezier(0.22, 1, 0.36, 1),
    background .25s ease,
    border-color .25s ease,
    color .25s ease;
}

/* Header */
.st-chat-header {
  background: var(--st-header-bg);
  border-bottom: 1px solid var(--st-border);
  backdrop-filter: blur(12px);
}

.st-chat-header .meta strong { color: var(--st-text); }
.st-chat-header .meta span { color: var(--st-muted); }

.st-icon-btn {
  border: 1px solid var(--st-border);
  background: var(--st-surface-2);
  color: var(--st-text);
}

.st-icon-btn:hover {
  background: rgba(255, 77, 0, 0.12);
  border-color: rgba(255, 77, 0, 0.35);
  color: #e85d2a;
}

/* Modes */
.st-chat-modes {
  background: var(--st-surface-2);
  border-bottom: 1px solid var(--st-border);
}

.st-chat-modes button {
  color: var(--st-muted);
  border-color: var(--st-border);
  background: transparent;
}

.st-chat-modes button:hover {
  color: var(--st-text);
  border-color: rgba(255, 77, 0, 0.35);
}

.st-chat-modes button.active {
  background: rgba(255, 77, 0, 0.12);
  color: #e85d2a;
  border-color: rgba(255, 77, 0, 0.4);
  box-shadow: none;
}

/* Messages */
.st-chat-messages {
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(255, 77, 0, 0.07), transparent 55%),
    var(--st-surface);
}

.st-row.bot .st-msg {
  background: var(--st-bot-bubble);
  color: var(--st-text);
  border: 1px solid var(--st-bot-border);
  box-shadow: 0 8px 22px rgba(28, 24, 18, 0.06);
}

.st-row.user .st-msg {
  background: linear-gradient(145deg, #ff6a2c, #ff4d00);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(255, 77, 0, 0.22);
}

.st-avatar.bot {
  background: #fff;
  border: 1px solid rgba(255, 77, 0, 0.15);
}

.st-row.user .st-avatar {
  background: var(--st-surface-3);
  color: var(--st-text);
  border: 1px solid var(--st-border);
}

.st-row.sys {
  color: var(--st-muted);
}

.st-sys {
  background: var(--st-surface-2);
  color: var(--st-muted);
  border: 1px dashed var(--st-border);
}

/* Composer */
.st-chat-composer {
  background: var(--st-surface-2);
  border-top: 1px solid var(--st-border);
}

.st-input-row {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
}

.st-input-row textarea {
  color: var(--st-text);
}

.st-input-row textarea::placeholder {
  color: var(--st-muted);
}

.st-input-row:focus-within {
  border-color: rgba(255, 77, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.12);
}

.st-chip {
  background: rgba(255, 77, 0, 0.1);
  color: #e85d2a;
  border-color: rgba(255, 77, 0, 0.22);
}

.st-send {
  background: linear-gradient(145deg, #ff6a2c, #ff4d00);
  color: #fff;
}

/* brand chip in header */
.st-chat-header .brand {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  color: #ff4d00;
}

html.dark .st-chat-header .brand,
.dark .st-chat-header .brand {
  background: #fff;
  border: none;
}

/* smooth theme switch of the whole widget */
.st-chat-root,
.st-chat-root .st-chat-panel,
.st-chat-root .st-chat-header,
.st-chat-root .st-chat-modes,
.st-chat-root .st-chat-messages,
.st-chat-root .st-chat-composer,
.st-chat-root .st-msg,
.st-chat-root .st-icon-btn,
.st-chat-root .st-input-row {
  transition-property: background-color, background, border-color, color, box-shadow, opacity, transform;
  transition-duration: .25s;
  transition-timing-function: ease;
}

/* explicit dark class on chat root (mirrors html.dark) */
.st-chat-root.st-theme-dark {
  --st-surface: #121216;
  --st-surface-2: #1a1a22;
  --st-surface-3: #22222c;
  --st-text: #f4f1ec;
  --st-muted: #a39e96;
  --st-border: rgba(255, 255, 255, 0.08);
  --st-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  --st-header-bg: linear-gradient(180deg, #1c1c24 0%, var(--st-surface) 100%);
  --st-bot-bubble: #1c1c24;
  --st-bot-border: rgba(255, 255, 255, 0.06);
  --st-tip-bg: rgba(20, 20, 24, 0.94);
}
