:root {
  --sentq-chat-burgundy:#8e1733;
  --sentq-chat-ink:#1a2026;
  --sentq-chat-bg:#f5f3f2;
  --sentq-chat-line:#e1ddda;
  --sentq-chat-muted:#737373;
}

.sentq-visually-hidden {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

.sentq-messages-page { min-height:100dvh;overflow-x:hidden; }
.sentq-chat-page {
  width:min(calc(100% - 40px),1080px);
  min-height:calc(100dvh - 64px);
  margin:0 auto;
  padding:24px 0 32px;
}
.sentq-chat-card {
  display:flex;
  min-height:calc(100dvh - 120px);
  overflow:hidden;
  flex-direction:column;
  border:1px solid var(--sentq-chat-line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 12px 38px rgba(26,32,38,.06);
}
.sentq-chat-topbar {
  display:flex;
  min-height:78px;
  padding:14px 18px;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  border-bottom:1px solid #ece8e5;
}
.sentq-chat-heading { display:flex;min-width:0;align-items:center;gap:12px; }
.sentq-chat-avatar {
  display:flex;
  width:44px;
  height:44px;
  flex:0 0 44px;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--sentq-chat-ink);
  color:#fff;
  font-size:14px;
  font-weight:800;
  letter-spacing:-.04em;
}
.sentq-chat-heading h1 { margin:0;color:#16191c;font-size:18px;line-height:1.25;font-weight:700; }
.sentq-chat-heading p { margin:4px 0 0;color:var(--sentq-chat-muted);font-size:12px;line-height:1.35; }
.sentq-chat-online { display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:#3f9c65;vertical-align:1px; }
.sentq-chat-refresh {
  display:inline-flex;
  min-height:38px;
  padding:0 12px;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid #d8d4d1;
  border-radius:9px;
  background:#fff;
  color:#262a2e;
  font:600 12px/1 TildaSans,Arial,sans-serif;
  cursor:pointer;
}
.sentq-chat-refresh:hover { border-color:var(--sentq-chat-burgundy);color:var(--sentq-chat-burgundy); }
.sentq-chat-refresh:focus-visible,
.sentq-chat-quick button:focus-visible,
.sentq-chat-composer button:focus-visible,
.sentq-chat-draft button:focus-visible { outline:2px solid rgba(142,23,51,.28);outline-offset:2px; }
.sentq-chat-refresh svg { display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.sentq-chat-refresh.is-loading svg { animation:sentq-chat-spin .8s linear infinite; }
.sentq-chat-refresh-mobile { display:none; }
@keyframes sentq-chat-spin { to { transform:rotate(360deg); } }

.sentq-chat-quick {
  display:flex;
  padding:12px 18px;
  overflow-x:auto;
  gap:8px;
  border-bottom:1px solid #ece8e5;
  scrollbar-width:none;
}
.sentq-chat-quick::-webkit-scrollbar { display:none; }
.sentq-chat-quick button {
  display:inline-flex;
  min-width:max-content;
  min-height:40px;
  padding:0 13px;
  align-items:center;
  gap:7px;
  border:1px solid #d8d4d1;
  border-radius:999px;
  background:#fff;
  color:#303338;
  font:600 12px/1 TildaSans,Arial,sans-serif;
  cursor:pointer;
}
.sentq-chat-quick button:hover { border-color:var(--sentq-chat-burgundy);color:var(--sentq-chat-burgundy);background:#fffafb; }
.sentq-chat-quick svg { width:17px;height:17px;fill:none;stroke:var(--sentq-chat-burgundy);stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round; }

.sentq-chat-messages {
  display:flex;
  min-height:340px;
  flex:1 1 auto;
  padding:20px 18px 26px;
  overflow:auto;
  flex-direction:column;
  gap:10px;
  overscroll-behavior:contain;
  background:
    radial-gradient(circle at 16% 8%,rgba(142,23,51,.035),transparent 25%),
    linear-gradient(180deg,#fbfaf9 0%,#f6f3f1 100%);
}
.sentq-chat-loading { margin:auto;text-align:center;color:var(--sentq-chat-muted);font-size:12px; }
.sentq-chat-loading span { display:inline-block;width:7px;height:7px;margin:0 2px;border-radius:50%;background:#aaa3a0;animation:sentq-chat-dot 1.1s infinite ease-in-out; }
.sentq-chat-loading span:nth-child(2) { animation-delay:.14s; }
.sentq-chat-loading span:nth-child(3) { animation-delay:.28s; }
.sentq-chat-loading p { margin:8px 0 0; }
@keyframes sentq-chat-dot { 0%,70%,100%{transform:translateY(0);opacity:.45}35%{transform:translateY(-4px);opacity:1} }

.sentq-chat-day { align-self:center;margin:5px 0;padding:5px 9px;border-radius:999px;background:rgba(26,32,38,.07);color:#77706c;font-size:10px;font-weight:600; }
.sentq-chat-message { display:flex;max-width:min(78%,680px);flex-direction:column;gap:5px; }
.sentq-chat-message.is-user { align-self:flex-end;align-items:flex-end; }
.sentq-chat-message.is-support { align-self:flex-start;align-items:flex-start; }
.sentq-chat-message.is-system { max-width:86%;align-self:center;align-items:center; }
.sentq-chat-bubble {
  min-width:62px;
  padding:10px 12px 8px;
  border:1px solid #e2deda;
  border-radius:14px 14px 14px 4px;
  background:#fff;
  color:#202326;
  box-shadow:0 2px 8px rgba(26,32,38,.035);
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:14px;
  line-height:1.45;
}
.is-user .sentq-chat-bubble { border-color:var(--sentq-chat-burgundy);border-radius:14px 14px 4px 14px;background:var(--sentq-chat-burgundy);color:#fff; }
.is-system .sentq-chat-bubble { padding:7px 10px;border:0;border-radius:999px;background:rgba(26,32,38,.07);color:#6d6864;font-size:11px;text-align:center;box-shadow:none; }
.sentq-chat-meta { padding:0 3px;color:#8b8581;font-size:10px;line-height:1.2; }
.is-user .sentq-chat-meta::after { margin-left:4px;color:var(--sentq-chat-burgundy);content:"✓✓";letter-spacing:-2px; }

.sentq-chat-product {
  display:grid;
  width:min(100%,520px);
  margin:0 0 8px;
  padding:9px;
  grid-template-columns:66px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  border:1px solid rgba(255,255,255,.34);
  border-radius:11px;
  background:rgba(255,255,255,.14);
  color:inherit;
  text-decoration:none;
}
.is-support .sentq-chat-product,
.sentq-chat-draft .sentq-chat-product { border-color:#e3dfdc;background:#f7f5f4;color:#202326; }
.sentq-chat-product:hover .sentq-chat-product-title { text-decoration:underline; }
.sentq-chat-product-image { width:66px;height:66px;border-radius:9px;background:#fff;object-fit:contain; }
.sentq-chat-product-copy { min-width:0; }
.sentq-chat-product-title { overflow:hidden;font-size:13px;line-height:1.25;font-weight:700;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical; }
.sentq-chat-product-meta { margin-top:5px;overflow:hidden;color:inherit;opacity:.72;font-size:11px;line-height:1.35;white-space:nowrap;text-overflow:ellipsis; }
.sentq-chat-product-arrow { font-size:21px;opacity:.55; }

.sentq-chat-alert { margin:0;padding:9px 18px;border-top:1px solid #ead9dd;background:#fff6f8;color:var(--sentq-chat-burgundy);font-size:12px;line-height:1.35; }
.sentq-chat-draft { position:relative;padding:10px 52px 9px 18px;border-top:1px solid #e8e4e1;background:#fff; }
.sentq-chat-draft-label { margin-bottom:6px;color:var(--sentq-chat-muted);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em; }
.sentq-chat-draft .sentq-chat-product { margin:0; }
.sentq-chat-draft > button { position:absolute;top:30px;right:16px;width:30px;height:30px;padding:0;border:1px solid #d8d4d1;border-radius:50%;background:#fff;color:#555;font:22px/28px Arial,sans-serif;cursor:pointer; }

.sentq-chat-composer { display:grid;padding:12px 18px 8px;grid-template-columns:minmax(0,1fr) 46px;gap:9px;border-top:1px solid #e8e4e1;background:#fff; }
.sentq-chat-composer textarea {
  width:100%;
  min-height:46px;
  max-height:132px;
  margin:0;
  padding:12px 14px;
  resize:none;
  border:1px solid #d8d4d1;
  border-radius:12px;
  background:#faf9f8;
  color:#202326;
  outline:0;
  font:14px/1.45 TildaSans,Arial,sans-serif;
}
.sentq-chat-composer textarea:focus { border-color:var(--sentq-chat-burgundy);box-shadow:0 0 0 2px rgba(142,23,51,.08); }
.sentq-chat-composer button { display:flex;width:46px;height:46px;padding:0;align-items:center;justify-content:center;border:1px solid var(--sentq-chat-burgundy);border-radius:12px;background:var(--sentq-chat-burgundy);color:#fff;cursor:pointer; }
.sentq-chat-composer button:disabled { border-color:#d5d1cf;background:#e2dfdd;color:#aaa5a2;cursor:default; }
.sentq-chat-composer button svg { width:22px;height:22px;fill:currentColor; }
@media (max-width:639px) {
  .sentq-chat-page { width:100%;min-height:calc(100dvh - 58px);padding:0; }
  .sentq-chat-card { min-height:calc(100dvh - 58px);border:0;border-radius:0;box-shadow:none; }
  .sentq-chat-message { max-width:86%; }
}

@media (max-width:639px) {
  body.sentq-messages-page { height:100dvh;padding-bottom:0;overflow:hidden; }
  .sentq-chat-page { height:calc(100dvh - 58px - var(--sentq-tilda-common-bar-height,clamp(38px,11.875vw,57px)));min-height:0; }
  .sentq-chat-card { height:100%;min-height:0; }
  .sentq-chat-messages { min-height:0; }
  .sentq-messages-header .sentq-shell-header-inner { justify-content:center; }
  .sentq-chat-refresh-mobile { position:absolute;right:9px;top:8px;display:flex;width:42px;height:42px;min-height:42px;padding:0;border:1px solid #dedad7;border-radius:50%;background:rgba(255,255,255,.96);color:#1a2026;box-shadow:0 4px 14px rgba(18,20,22,.08); }
  .sentq-chat-refresh-mobile svg { width:20px;height:20px;stroke-width:2; }
  .sentq-chat-refresh-mobile span { display:none; }
  .sentq-chat-topbar { min-height:64px;padding:10px 12px; }
  .sentq-chat-avatar { width:38px;height:38px;flex-basis:38px;font-size:12px; }
  .sentq-chat-heading h1 { font-size:15px; }
  .sentq-chat-heading p { font-size:10px; }
  .sentq-chat-topbar > .sentq-chat-refresh { display:none; }
  .sentq-chat-quick { padding:9px 8px 10px;gap:6px; }
  .sentq-chat-quick button { min-height:38px;padding:0 11px;font-size:11px; }
  .sentq-chat-quick svg { width:16px;height:16px; }
  .sentq-chat-messages { min-height:260px;padding:14px 10px 18px;gap:9px; }
  .sentq-chat-bubble { padding:9px 10px 7px;font-size:13px; }
  .sentq-chat-product { grid-template-columns:58px minmax(0,1fr) auto;padding:7px;gap:8px; }
  .sentq-chat-product-image { width:58px;height:58px; }
  .sentq-chat-product-title { font-size:12px; }
  .sentq-chat-product-meta { font-size:10px; }
  .sentq-chat-draft { padding:8px 48px 8px 10px; }
  .sentq-chat-draft > button { right:10px; }
  .sentq-chat-composer { padding:9px 9px 6px;grid-template-columns:minmax(0,1fr) 44px;gap:7px; }
  .sentq-chat-composer textarea { min-height:44px;padding:11px 12px;font-size:16px; }
  .sentq-chat-composer button { width:44px;height:44px; }
}

@media (prefers-reduced-motion:reduce) {
  .sentq-chat-refresh.is-loading svg,
  .sentq-chat-loading span { animation:none; }
}
