/* The shell owns the MAX visual viewport. The history is the only scrolling pane. */
#profile-view [data-profile-banner="chat"] .profile-banner-title { display:flex; align-items:center; flex-wrap:wrap; gap:4px 7px; }
#profile-view .profile-chat-count { display:inline-grid; place-items:center; min-width:21px; height:21px; padding:0 6px; border-radius:12px; background:#b51c40; color:white; font:700 12px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing:0; font-variant-numeric:tabular-nums; }
#profile-view .profile-chat-count[hidden] { display:none; }
html[data-max-miniapp="true"] #app[data-view="chat"],
html[data-max-miniapp="true"] #app[data-view="chat"] > .content,
html[data-max-miniapp="true"] #app[data-view="chat"] #chat-view { overflow: clip; }
#chat-view {
  --chat-ink: #282a36;
  --chat-muted: #626775;
  --chat-red: #b51c40;
  --chat-line: #dce0e8;
  --chat-sides: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #f0f2f7;
  color: var(--chat-ink);
  font-family: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}
#chat-view *, #chat-view *::before, #chat-view *::after { box-sizing: border-box; }
#chat-view [hidden] { display: none !important; }
#chat-view button, #chat-view textarea { font-family: inherit; }
#chat-view button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#chat-view button:focus-visible { outline: 2px solid var(--chat-red); outline-offset: -2px; }
#chat-view button:disabled { cursor: default; }
.sx-chat-head {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 46px;
  padding: 0 var(--chat-sides); border-bottom: 1px solid var(--chat-line);
  background: #fafbfd;
}
.sx-chat-back, .sx-chat-sheet-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  color: var(--chat-ink); background: #edf0f5; border: 0; border-radius: 50%; font-size: 24px;
}
.sx-chat-back { background: radial-gradient(circle, #edf0f5 15px, transparent 16px); }
.sx-chat-back svg { width: 18px; height: 18px; }
.sx-chat-heading { flex: 1; min-width: 0; }
.sx-chat-heading h1 { margin: 0; font-size: 18px; line-height: 22px; letter-spacing: -.4px; font-weight: 720; color: var(--chat-ink); }
.sx-chat-heading p { display: flex; align-items: center; gap: 5px; height: 15px; margin: 0; font-size: 12px; line-height: 15px; color: var(--chat-muted); }
.sx-chat-heading p span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sx-chat-dots { flex: none; align-items: center; gap: 2px; display: inline-flex; height: 12px; color: var(--chat-red); }
.sx-chat-dots i { display: block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; animation: sx-chat-type 1.1s ease-in-out infinite; }
.sx-chat-dots i:nth-child(2) { animation-delay: .13s; }
.sx-chat-dots i:nth-child(3) { animation-delay: .26s; }
@keyframes sx-chat-type { 0%, 62%, 100% { transform: translateY(0); } 32% { transform: translateY(-2.5px); } }
.sx-chat-emblem { width: 32px; height: 32px; flex: none; display: grid; place-items: center; color: var(--chat-red); }
.sx-chat-emblem svg { width: 26px; height: 26px; overflow: visible; }
.sx-chat-body { position: relative; display: flex; flex: 1; min-height: 0; }
.sx-chat-history {
  position: relative; flex: 1; min-height: 0; width: 100%; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; overflow-anchor: none; scrollbar-width: thin; scrollbar-color: #b9beca transparent;
  background: radial-gradient(ellipse at 92% 8%, #e5e9f360, transparent 56%), linear-gradient(154deg,#f5f5f8,#edeff5 74%,#f1f0f3);
}
.sx-chat-stack { display: flex; flex-direction: column; min-height: 100%; padding: 14px var(--chat-sides) 15px; }
.sx-chat-stack::before { content: ''; flex: 1 0 0; }
.sx-chat-stack > * { flex: none; }
.sx-chat-day { margin: 13px auto 15px; width: fit-content; padding: 4px 11px; border-radius: 99px; background: #e2e5ed; color: #565d6b; font-size: 11px; line-height: 14px; font-weight: 600; }
.sx-chat-msg { display: flow-root; }
.sx-chat-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) 31px; align-items: start; column-gap: 8px; margin-top: 6px; }
.sx-chat-row.is-first { margin-top: 14px; }
.sx-chat-msg:first-child .sx-chat-row, .sx-chat-day:not([hidden]) + .sx-chat-row { margin-top: 0; }
.sx-chat-avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 31px; height: 31px; border-radius: 50%; padding: 0; isolation: isolate; background: #d4ddeb; color: #48566b;
  font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: -.3px;
}
.sx-chat-avatar[data-tint='1'] { background: #ead9de; color: #854963; }
.sx-chat-avatar[data-tint='2'] { background: #d9e3dd; color: #49675a; }
.sx-chat-avatar[data-tint='3'] { background: #e3dff1; color: #61577e; }
.sx-chat-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; color: transparent; }
.sx-chat-row > .sx-chat-avatar { grid-column: 1; grid-row: 1; margin-top: 1px; }
.sx-chat-bubble {
  grid-column: 2; grid-row: 1; justify-self: start; position: relative; max-width: 100%; min-width: 0; width: fit-content;
  padding: 9px 12px; background: #fff; border: 1px solid #dfe2e9; border-radius: 7px 17px 17px 7px;
  box-shadow: 0 1px 2px #252d3b06; color: var(--chat-ink); overflow-wrap: anywhere;
}
.sx-chat-row.is-first .sx-chat-bubble { border-top-left-radius: 17px; }
.sx-chat-row.is-last .sx-chat-bubble { border-bottom-left-radius: 3px; }
.sx-chat-author { display: block; max-width: 100%; margin: 0 0 3px; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 3px; background: none; color: #535c75; text-align: inherit; font-size: 12px; line-height: 16px; font-weight: 700; }
.sx-chat-row.is-moderatable { cursor: pointer; }
.sx-chat-text { white-space: pre-wrap; font-size: 15px; line-height: 20px; letter-spacing: -.12px; }
.sx-chat-time { float: right; padding: 0; margin: 7px 0 -2px 9px; color: var(--chat-muted); font: 10px/13px Arial,sans-serif; font-variant-numeric: tabular-nums; }
.sx-chat-copy::after { content: ''; display: table; clear: both; }
.sx-chat-row.is-own > .sx-chat-avatar { grid-column: 3; }
.sx-chat-row.is-own .sx-chat-bubble { justify-self: end; border-color: #edcdd7; background: #fae3ea; border-radius: 17px 7px 7px 17px; }
.sx-chat-row.is-own.is-first .sx-chat-bubble { border-top-right-radius: 17px; }
.sx-chat-row.is-own.is-last .sx-chat-bubble { border-bottom-right-radius: 3px; }
.sx-chat-row.is-own .sx-chat-author { color: #90304c; }
.sx-chat-row.is-own .sx-chat-time { color: #7d5263; }
.sx-chat-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%;
  padding: 20px; text-align: center; color: var(--chat-muted);
}
.sx-chat-state img { display: block; width: 116px; height: 116px; object-fit: contain; margin: 0 0 7px; }
.sx-chat-state .sx-chat-state-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; margin-bottom: 12px; background: #e4e6ed; color: #636a7c; }
.sx-chat-state-icon svg { width: 24px; height: 24px; }
.sx-chat-state h2 { margin: 0; color: var(--chat-ink); font-size: 20px; line-height: 24px; letter-spacing: -.45px; }
.sx-chat-state p { margin: 6px 0 0; font-size: 14px; line-height: 20px; }
.sx-chat-retry, .sx-chat-earlier { display: block; width: fit-content; min-height: 40px; margin: 6px auto; padding: 6px 13px; background: transparent; border: 0; border-radius: 12px; font-size: 13px; font-weight: 650; color: var(--chat-red); }
.sx-chat-earlier { margin: 0 auto; color: #596173; }
.sx-chat-jump { position: absolute; bottom: 11px; right: var(--chat-sides); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--chat-line); border-radius: 50%; color: var(--chat-red); background: #fff; box-shadow: 0 3px 12px #292d3d1a; }
.sx-chat-jump svg { width: 20px; height: 20px; }
.sx-chat-foot { flex: none; margin: 0; padding: 9px var(--chat-sides) max(9px, env(safe-area-inset-bottom, 0px)); background: #fafbfd; border-top: 1px solid var(--chat-line); }
html[data-max-keyboard='true'] .sx-chat-foot { padding-bottom: 7px; }
#chat-view[data-web-soft-keyboard] .sx-chat-foot { padding-bottom: 8px; }
.sx-chat-field { display: flex; align-items: flex-end; gap: 6px; min-height: 48px; padding: 3px; border: 1px solid #d1d6e0; border-radius: 24px; background: #fff; }
.sx-chat-field:focus-within { border-color: #8490a2; }
.sx-chat-preparing, .sx-chat-field textarea {
  display: block; flex: 1; min-width: 0; width: 100%; height: 40px; min-height: 40px; max-height: 104px; margin: 0;
  resize: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 17px; background: transparent;
  color: var(--chat-ink); padding: 10px 0 10px 11px; font-size: 16px; line-height: 20px; appearance: none; -webkit-appearance: none;
}
.sx-chat-field textarea::placeholder, .sx-chat-preparing { color: #737886; opacity: 1; }
.sx-chat-field textarea:disabled { color: #646a79; -webkit-text-fill-color: #646a79; opacity: 1; }
.sx-chat-field textarea:focus { outline: none; }
.sx-chat-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; padding: 0; background: var(--chat-red); color: #fff; }
.sx-chat-send:disabled { background: #e9ebf1; color: #88909e; }
.sx-chat-send svg { width: 21px; height: 21px; }
.sx-chat-hint { margin: 0 0 7px 6px; color: #8d3454; font-size: 13px; line-height: 18px; }
.sx-chat-skeleton { display: flex; flex-direction: column; gap: 13px; padding-bottom: 2px; }
.sx-chat-skeleton::before { content: ''; align-self: center; width: 64px; height: 22px; background: #e0e3eb; border-radius: 12px; }
.sx-chat-sk-row { display: flex; align-items: flex-start; gap: 7px; }
.sx-chat-sk-row i { width: 31px; height: 31px; border-radius: 50%; background: #e0e3eb; }
.sx-chat-sk-row b { position: relative; height: 66px; width: 58%; border-radius: 17px 17px 17px 3px; background: #fbfbfd; border: 1px solid #e1e4eb; }
.sx-chat-sk-row b::before, .sx-chat-sk-row b::after { content: ''; position: absolute; top: 12px; left: 12px; width: 27%; height: 7px; background: #e0e3eb; border-radius: 4px; }
.sx-chat-sk-row b::after { top: 33px; width: 67%; background: #eaecf2; }
.sx-chat-sk-row:nth-child(even) { flex-direction: row-reverse; }
.sx-chat-sk-row:nth-child(even) b { width: 45%; height: 54px; border-radius: 17px 17px 3px 17px; background: #f6e8ed; border-color: #eedce3; }
.sx-chat-sk-row:nth-child(3) b { width: 61%; height: 78px; }
.sx-chat-scrim { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-end; background: transparent; opacity: 0; transition: opacity .16s ease; }
.sx-chat-sheet { width: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fcfcfe; border-radius: 24px 24px 0 0; padding: 8px var(--chat-sides) max(18px,env(safe-area-inset-bottom,0px)); transform: translateY(18px); transition: transform .19s ease; box-shadow: 0 -6px 30px #222a4212; }
.sx-chat-scrim.is-open { opacity: 1; }
.sx-chat-scrim.is-open .sx-chat-sheet { transform: none; }
.sx-chat-grip { margin: 0 auto 15px; width: 34px; height: 4px; border-radius: 20px; background: #d2d6e0; }
.sx-chat-sheet-head { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; }
.sx-chat-sheet-head > .sx-chat-avatar { width: 44px; height: 44px; font-size: 16px; }
.sx-chat-sheet-label { flex: 1; min-width: 0; }
.sx-chat-sheet-label h2 { margin: 0; color: var(--chat-ink); font-size: 19px; line-height: 23px; letter-spacing: -.35px; overflow-wrap: anywhere; }
.sx-chat-sheet-label p { margin: 3px 0 0; color: var(--chat-muted); font-size: 12px; line-height: 16px; }
.sx-chat-sheet-close { width: 40px; height: 40px; }
.sx-chat-sheet-close svg { width: 18px; height: 18px; }
.sx-chat-commands { overflow: hidden; border: 1px solid var(--chat-line); border-radius: 15px; }
.sx-chat-command { width: 100%; min-height: 51px; display: flex; align-items: center; gap: 11px; padding: 8px 14px; border: 0; color: var(--chat-ink); background: #fff; font-size: 15px; font-weight: 600; text-align: left; }
.sx-chat-command + .sx-chat-command { border-top: 1px solid var(--chat-line); }
.sx-chat-command svg { width: 19px; height: 19px; flex: none; }
.sx-chat-command[data-action='ban'] { color: var(--chat-red); }
.sx-chat-command:disabled { opacity: .6; }
.sx-chat-sheet-status { margin: 8px 0 0; font-size: 13px; line-height: 18px; color: var(--chat-red); }
@media (max-height: 530px) { .sx-chat-state img { width: 70px; height: 70px; } }
@media (prefers-reduced-motion: reduce) { .sx-chat-dots i { animation: none; } .sx-chat-scrim, .sx-chat-sheet { transition: none; } }

.sx-chat-bubble { transform-origin: left bottom; }
.sx-chat-row.is-own .sx-chat-bubble { transform-origin: right bottom; }
.sx-chat-row.is-own .sx-chat-time::after { content: ''; display: inline-block; vertical-align: -1px; margin-left: 4px; width: 10px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m1.5 6 3 3 6-7' fill='none' stroke='%237d5263' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.sx-chat-row.is-own.is-pending .sx-chat-time::after { content: ''; display: inline-block; vertical-align: -1px; margin-left: 4px; width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor,currentColor) center 1px/1px 3px no-repeat, linear-gradient(currentColor,currentColor) 4px 4px/3px 1px no-repeat; }
.sx-chat-row.is-failed .sx-chat-time::after { visibility: hidden; }
.sx-chat-unsent { display: block; min-height: 36px; margin: 3px 0 -3px; padding: 4px 2px; color: var(--chat-red); border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 650; }
.sx-chat-field { transition: border-color .17s ease; }
.sx-chat-send { transition: background-color .18s ease, color .18s ease; }
.sx-chat-send svg { transform: translateY(1px) scale(.9); transition: transform .18s cubic-bezier(.2,.8,.25,1); }
.sx-chat-field.has-draft .sx-chat-send svg { transform: none; }
.sx-chat-send:enabled:active svg { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .sx-chat-field, .sx-chat-send, .sx-chat-send svg { transition: none; } .sx-chat-send svg, .sx-chat-send:enabled:active svg { transform: none; } }

.sx-chat-quote, .sx-chat-reply-caption { min-width: 0; border-left: 3px solid #878fa9; }
.sx-chat-quote { display: grid; gap: 2px; padding: 5px 8px; margin: 0 0 7px; border-radius: 3px 8px 8px 3px; background: #f0f2f7; }
.sx-chat-quote b, .sx-chat-reply-caption b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 16px; font-weight: 700; color: #48516a; }
.sx-chat-quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #525a68; font-size: 13px; line-height: 17px; overflow-wrap: anywhere; }
.sx-chat-bubble.is-deleted { background: #f5f6f9; border-color: #d7dbe3; color: #515967; box-shadow: none; }
.sx-chat-row.is-own .sx-chat-bubble.is-deleted { background: #f3edf1; border-color: #e0d7df; }
.sx-chat-deleted-label { display: inline-block; margin-left: 7px; color: #696473; font-size: 11px; line-height: 15px; font-weight: 500; }
.sx-chat-quote .sx-chat-deleted-label { font-size: 10px; }
.sx-chat-row.is-own .sx-chat-quote { background: #f3d9e2; border-color: #b74f6e; }
.sx-chat-row.is-own .sx-chat-quote b { color: #832d4c; }
.sx-chat-reply-draft { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; padding: 0 3px; }
.sx-chat-reply-mark, .sx-chat-reply-cancel { flex: none; display: grid; place-items: center; width: 36px; height: 36px; }
.sx-chat-reply-mark { color: var(--chat-red); }
.sx-chat-reply-mark svg, .sx-chat-reply-cancel svg { width: 19px; height: 19px; }
.sx-chat-reply-caption { flex: 1; padding-left: 8px; border-color: #b74f6e; }
.sx-chat-reply-caption b { color: #87304d; }
.sx-chat-reply-caption span, .sx-chat-sheet-label p { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sx-chat-reply-caption span { color: var(--chat-muted); font-size: 13px; line-height: 17px; }
.sx-chat-reply-cancel { border: 0; border-radius: 50%; padding: 0; background: transparent; color: var(--chat-muted); }
.sx-chat-command:is([data-action='delete'],[data-action='confirm-delete']) { color: var(--chat-red); }
.sx-chat-bubble[aria-haspopup] { cursor: pointer; touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; transform: translateX(var(--chat-swipe,0px)); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.sx-chat-row.is-tracking .sx-chat-bubble { transition: none; }
.sx-chat-row { touch-action: pan-y pinch-zoom; }
.sx-chat-swipe-hint { position: absolute; top: 50%; right: -33px; display: grid; place-items: center; width: 27px; height: 27px; transform: translateY(-50%) scale(.85); border-radius: 50%; color: #555d70; background: #dce0ea; pointer-events: none; }
.sx-chat-swipe-hint svg { width: 16px; height: 16px; }
.sx-chat-swipe-hint.is-left { right: auto; left: -33px; }
.sx-chat-row.is-armed .sx-chat-swipe-hint { transform: translateY(-50%); color: #fff; background: var(--chat-red); }
@media (pointer: coarse) { .sx-chat-bubble[aria-haspopup] { -webkit-user-select: none; user-select: none; } }
@media (prefers-reduced-motion: reduce) { .sx-chat-bubble[aria-haspopup] { transition: none; } }

.sx-chat-bubble[role='button']:focus-visible { outline: 2px solid var(--chat-red); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .sx-chat-bubble[role='button']:hover { border-color: #b7bccb; } .sx-chat-row.is-own .sx-chat-bubble[role='button']:hover { border-color: #c891a2; } }

.sx-chat-author, .sx-chat-profile-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}
.sx-chat-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sx-chat-official {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  color: #fff;
  background: #2568bf;
}
.sx-chat-official svg { width: 11px; height: 11px; stroke-width: 3; }
.sx-chat-identity {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.sx-chat-identity .sx-chat-avatar { width: 30px; height: 30px; }
.sx-chat-identity:not([hidden]) + textarea { padding-left: 2px; }
.sx-chat-profile-scrim { z-index: 5; }
.sx-chat-profiles {
  overflow: hidden;
  border: 1px solid var(--chat-line);
  border-radius: 15px;
}
.sx-chat-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 47px;
  padding: 6px 12px;
  border: 0;
  background: #fff;
  color: var(--chat-ink);
  text-align: left;
  font-size: 15px;
  font-weight: 650;
}
.sx-chat-profile + .sx-chat-profile { border-top: 1px solid var(--chat-line); }
.sx-chat-profile[aria-pressed='true'] { background: #f9ecf0; }
.sx-chat-profile-name { flex: 1; overflow-wrap: anywhere; }
.sx-chat-profile-check { display: grid; width: 18px; color: var(--chat-red); }
.sx-chat-profile-check svg { width: 100%; }
