.chat-v2-root {
  --chat-v2-surface: rgba(255, 252, 247, 0.88);
  --chat-v2-surface-strong: rgba(255, 254, 250, 0.97);
  --chat-v2-border: rgba(112, 88, 56, 0.14);
  --chat-v2-text: #241d16;
  --chat-v2-muted: #6c6051;
  --chat-v2-accent: #a17641;
  --chat-v2-accent-strong: #76552d;
  --chat-v2-shadow: 0 20px 48px rgba(44, 28, 8, 0.09);
  --chat-v2-font: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --chat-v2-font-display: "Prata", "Cormorant Garamond", "Georgia", serif;
  --chat-v2-feed-end-gap: calc(((var(--chat-v2-composer-height, 60px) + 18px) / 2) + 15px + var(--chat-v2-bottom-offset, 0px));
  --chat-v2-feed-end-gap-compact: calc(((var(--chat-v2-composer-height, 60px) + 18px) / 2) - 5px + var(--chat-v2-bottom-offset, 0px));
  min-height: var(--chat-v2-app-height, 100dvh);
  height: var(--chat-v2-app-height, 100dvh);
  background:
    radial-gradient(780px 320px at 100% 0%, rgba(161, 118, 65, 0.12), transparent 66%),
    linear-gradient(180deg, #f8f3eb 0%, #efe7db 100%);
  color: var(--chat-v2-text);
  font-family: var(--chat-v2-font);
  font-size: max(16px, 1rem);
  line-height: 1.45;
  font-variant-numeric: proportional-nums lining-nums;
  font-feature-settings: "tnum" 0, "lnum" 1;
  overflow: hidden;
  overscroll-behavior: none;
}

.page.app-shell.route-chat .chat-v2-root {
  min-height: 0;
  height: 100%;
  background: transparent;
}

.page.app-shell.route-admin-chat .chat-v2-root {
  min-height: 0;
  height: 100%;
  background: transparent;
}

.page.app-shell.route-chat .chat-v2-shell {
  width: 100%;
  padding-top: 0;
}

.page.app-shell.route-admin-chat .chat-v2-shell {
  width: 100%;
  padding-top: 0;
}

.page.app-shell.route-chat .chat-v2-header {
  display: none;
}

.page.app-shell.route-admin-chat .chat-v2-header {
  display: none;
}

.chat-v2-root,
.chat-v2-root *,
.chat-v2-root *::before,
.chat-v2-root *::after {
  box-sizing: border-box;
}

.chat-v2-root button,
.chat-v2-root input,
.chat-v2-root textarea {
  font: inherit;
}

.chat-v2-shell {
  position: relative;
  width: min(100% - 24px, 860px);
  min-height: 100%;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding:
    max(18px, env(safe-area-inset-top))
    0
    max(8px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.chat-v2-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
}

.chat-v2-header-copy {
  min-width: 0;
}

.chat-v2-title {
  margin: 0;
  font-size: clamp(1.95rem, 5vw, 2.45rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.chat-v2-subtitle {
  margin: 8px 0 0;
  color: var(--chat-v2-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.chat-v2-status {
  margin: 4px 0 0;
  color: rgba(101, 90, 77, 0.82);
  font-size: 0.8125rem;
  font-weight: 700;
}

.chat-v2-status[hidden],
.chat-v2-status:empty {
  display: none;
}

.chat-v2-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-v2-header-actions:empty {
  display: none;
}

.chat-v2-icon-button,
.chat-v2-jump,
.chat-v2-search-nav,
.chat-v2-search-close,
.chat-v2-context-cancel,
.chat-v2-file-clear,
.chat-v2-attach,
.chat-v2-reaction,
.chat-v2-menu-action,
.chat-v2-menu-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--chat-v2-border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--chat-v2-text);
  cursor: pointer;
}

.chat-v2-icon-button,
.chat-v2-jump,
.chat-v2-attach {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: var(--chat-v2-shadow);
}

.chat-v2-icon-button {
  width: 44px;
  padding: 0;
}

.chat-v2-search-toggle.is-active {
  border-color: rgba(47, 111, 237, 0.26);
  color: var(--chat-v2-accent-strong);
}

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

.chat-v2-jump {
  position: fixed;
  right: calc(max(12px, calc(50vw - 430px)) + 10px);
  bottom: calc(var(--chat-v2-composer-height, 60px) + var(--chat-v2-bottom-offset, 0px) + 6px);
  z-index: 25;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 18px;
  border-color: rgba(108, 84, 51, 0.08);
  background: rgba(255, 253, 249, 0.95);
  box-shadow: 0 8px 18px rgba(44, 28, 8, 0.05);
  color: rgba(78, 66, 53, 0.78);
  line-height: 1;
  transform: none;
  backdrop-filter: blur(10px);
}

.chat-v2-jump svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-v2-search {
  padding: 0 2px 2px;
}

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

.chat-v2-search-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-v2-search-input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--chat-v2-text);
  font-size: 1rem;
  outline: none;
}

.chat-v2-search-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
}

.chat-v2-search-count {
  margin-right: auto;
  color: var(--chat-v2-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.chat-v2-search-nav,
.chat-v2-search-close,
.chat-v2-context-cancel,
.chat-v2-file-clear {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
}

.chat-v2-search-nav {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: none;
}

.chat-v2-search-nav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-v2-search-nav:disabled {
  opacity: 0.38;
}

.chat-v2-pinned {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(108, 84, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--chat-v2-text);
  text-align: left;
  cursor: pointer;
}

.page.app-shell.route-chat .chat-v2-pinned {
  position: sticky;
  top: calc(var(--chat-header-offset, 64px) - 2px);
  z-index: 7;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  gap: 1px;
  margin-top: calc(var(--chat-header-offset, 64px) * -1 + 8px);
  margin-bottom: 6px;
  padding: 9px 14px 8px;
}

.page.app-shell.route-chat .chat-v2-pinned-label {
  display: none;
}

.page.app-shell.route-chat .chat-v2-pinned-copy {
  gap: 0;
}

.page.app-shell.route-chat .chat-v2-pinned-author {
  line-height: 1.04;
}

.page.app-shell.route-chat .chat-v2-pinned-text {
  line-height: 1.08;
}

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

.chat-v2-pinned-label {
  color: rgba(101, 90, 77, 0.72);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-v2-pinned-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.chat-v2-pinned-author {
  color: rgba(33, 26, 20, 0.94);
  font-size: 0.8125rem;
  font-weight: 800;
}

.chat-v2-pinned-text {
  display: block;
  color: rgba(78, 66, 53, 0.82);
  font-size: 0.8125rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-v2-feed {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-bottom: 0;
  scroll-padding-bottom: var(--chat-v2-feed-end-gap);
  touch-action: pan-y;
}

.chat-v2-feed-end-spacer {
  flex: 0 0 var(--chat-v2-feed-end-gap);
  width: 100%;
  pointer-events: none;
}

.chat-v2-root.chat-v2-ios-gap-compact .chat-v2-feed {
  scroll-padding-bottom: var(--chat-v2-feed-end-gap-compact);
}

.chat-v2-root.chat-v2-ios-gap-compact .chat-v2-feed-end-spacer {
  flex-basis: var(--chat-v2-feed-end-gap-compact);
}

.chat-v2-feed,
.chat-v2-feed *,
.chat-v2-pinned,
.chat-v2-pinned * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.chat-v2-header,
.chat-v2-header *,
.chat-v2-composer,
.chat-v2-composer *,
.chat-v2-menu-backdrop,
.chat-v2-menu-backdrop * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.chat-v2-composer input,
.chat-v2-composer textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.chat-v2-stream {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 100%;
  margin-top: 0;
  padding: 4px 2px 4px;
}

.chat-v2-day-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2px 0 4px;
}

.chat-v2-day-separator::before,
.chat-v2-day-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(108, 84, 51, 0.1);
}

.chat-v2-day-separator span {
  color: rgba(101, 90, 77, 0.72);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-v2-unread-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.chat-v2-unread-separator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(143, 103, 53, 0.1);
  color: #8f6735;
  font-size: 0.75rem;
  font-weight: 800;
}

.chat-v2-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

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

.chat-v2-empty > * {
  max-width: 360px;
}

.chat-v2-empty-title {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
  font-weight: 800;
}

.chat-v2-empty-copy {
  margin: 0;
  color: var(--chat-v2-muted);
}

.chat-v2-message-row {
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.chat-v2-message-row.is-mine {
  justify-content: flex-end;
}

.chat-v2-message {
  display: grid;
  gap: 2px;
  width: auto;
  min-width: min(206px, calc(100% - 64px));
  max-width: min(520px, calc(100% - 40px));
  padding: 6px 12px 4px;
  border: 1px solid rgba(108, 84, 51, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 10px rgba(44, 28, 8, 0.02);
}

.chat-v2-message-row.is-mine .chat-v2-message {
  background: rgba(220, 232, 245, 0.98);
  border-color: rgba(112, 141, 170, 0.18);
}

.chat-v2-message-row.is-pending .chat-v2-message {
  opacity: 0.72;
}

.chat-v2-message-row.is-search-current .chat-v2-message {
  box-shadow: 0 0 0 2px rgba(115, 145, 175, 0.22), 0 8px 18px rgba(44, 28, 8, 0.04);
}

.chat-v2-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1;
}

.chat-v2-message-author {
  min-width: 0;
  font-size: 0.81rem;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-v2-message-time {
  flex: 0 0 auto;
  color: rgba(101, 90, 77, 0.46);
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1;
}

.chat-v2-message-body {
  display: grid;
  gap: 2px;
}

.chat-v2-reply {
  display: grid;
  gap: 1px;
  padding: 3px 8px 3px 9px;
  border: 0;
  border-left: 3px solid rgba(138, 151, 165, 0.42);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(220, 228, 237, 0.28) 0%, rgba(245, 247, 250, 0.52) 100%);
  box-shadow: inset 0 0 0 1px rgba(138, 151, 165, 0.14);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-v2-reply[hidden],
.chat-v2-attachment[hidden],
.chat-v2-attachment-image[hidden],
.chat-v2-reactions[hidden] {
  display: none;
}

.chat-v2-reply-author {
  font-size: 0.69rem;
  font-weight: 800;
  color: rgba(46, 53, 62, 0.92);
}

.chat-v2-reply-text {
  display: block;
  color: rgba(90, 84, 76, 0.7);
  font-size: 0.67rem;
  line-height: 1.04;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.chat-v2-attachment {
  display: grid;
  gap: 8px;
  width: min(100%, 320px);
  padding: 10px 12px;
  border: 1px solid rgba(108, 84, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-decoration: none;
}

.chat-v2-attachment.is-image {
  width: min(100%, 360px);
}

.chat-v2-attachment-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(25, 36, 51, 0.06);
}

.chat-v2-attachment-name {
  font-size: 0.875rem;
  line-height: 1.3;
  word-break: break-word;
}

.chat-v2-message-text {
  color: rgba(33, 26, 20, 0.96);
  font-size: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.18;
}

.chat-v2-message-link {
  color: #2f6fb8;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  word-break: break-word;
}

.chat-v2-highlight {
  padding: 0;
  background: rgba(255, 224, 115, 0.56);
  color: inherit;
}

.chat-v2-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 0;
  padding-left: 1px;
}

.chat-v2-reaction {
  gap: 2px;
  min-height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(108, 84, 51, 0.025);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: none;
  font-size: 0.52rem;
  font-weight: 700;
}

.chat-v2-message-row.is-mine .chat-v2-reaction {
  border-color: rgba(112, 141, 170, 0.06);
  background: rgba(240, 247, 252, 0.88);
}

.chat-v2-reaction.is-active {
  border-color: rgba(112, 141, 170, 0.16);
  background: rgba(226, 237, 247, 0.66);
}

.chat-v2-reaction-emoji {
  font-size: 0.72rem;
  line-height: 1;
}

.chat-v2-reaction-count {
  line-height: 1;
}

.chat-v2-composer {
  display: grid;
  gap: 4px;
  position: fixed;
  left: max(12px, calc(50vw - 430px));
  right: max(12px, calc(50vw - 430px));
  bottom: calc(var(--chat-v2-bottom-offset, 0px) + 2px);
  z-index: 24;
  width: auto;
  margin: 0;
  padding: 4px 4px 4px 8px;
  border: 1px solid rgba(108, 84, 51, 0.12);
  border-radius: 20px;
  background: var(--chat-v2-surface-strong);
  box-shadow: 0 10px 24px rgba(44, 28, 8, 0.06);
}

.chat-v2-composer.is-search-mode {
  gap: 2px;
  padding: 6px 6px 6px 10px;
}

.chat-v2-context,
.chat-v2-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
}

.chat-v2-context[hidden],
.chat-v2-file-row[hidden] {
  display: none;
}

.chat-v2-context-copy,
.chat-v2-file-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.chat-v2-context-label {
  color: rgba(78, 66, 53, 0.9);
  font-size: 0.75rem;
  font-weight: 800;
}

.chat-v2-context-text,
.chat-v2-file-name {
  min-width: 0;
  color: rgba(101, 90, 77, 0.82);
  font-size: 0.75rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-v2-composer-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
}

.chat-v2-composer.is-search-mode .chat-v2-composer-body {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.page.app-shell.route-admin-chat .chat-v2-pinned {
  display: none;
}

.page.app-shell.route-admin-chat .chat-v2-composer-body {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.page.app-shell.route-admin-chat .chat-v2-attach,
.page.app-shell.route-admin-chat .chat-v2-file-input {
  display: none;
}

.chat-v2-composer-field {
  display: block;
  min-width: 0;
}

.chat-v2-composer-label {
  display: none;
}

.chat-v2-textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 180px;
  padding: 8px 2px 8px 0;
  border: 0;
  background: transparent;
  color: var(--chat-v2-text);
  font-size: max(16px, 1rem);
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-v2-composer.is-search-mode .chat-v2-textarea {
  min-height: 40px;
  padding: 6px 2px 6px 0;
}

.chat-v2-textarea::placeholder {
  color: rgba(101, 90, 77, 0.62);
}

.chat-v2-composer-actions {
  position: relative;
  align-self: end;
  width: 44px;
  height: 44px;
}

.chat-v2-composer.is-search-mode .chat-v2-composer-actions {
  width: 40px;
  height: 40px;
}

.chat-v2-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(249, 239, 225, 0.92);
  color: #8f6735;
  box-shadow: none;
}

.chat-v2-composer.is-search-mode .chat-v2-attach {
  display: none !important;
}

.chat-v2-attach svg,
.chat-v2-composer-utility svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-v2-send {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(197, 179, 153, 0.62);
  color: #fffaf1;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: none;
}

.chat-v2-send.is-busy {
  opacity: 0.7;
}

.chat-v2-send.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: scale(0.92);
}

.chat-v2-send:not(:disabled) {
  background: linear-gradient(180deg, #a67b43 0%, #8f6735 100%);
  box-shadow: 0 10px 24px rgba(109, 82, 48, 0.2);
}

.chat-v2-send svg {
  width: 20px;
  height: 20px;
  fill: #fffaf1;
}

.chat-v2-composer-utility {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(249, 239, 225, 0.92);
  color: #8f6735;
  box-shadow: none;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

.chat-v2-composer.is-search-mode .chat-v2-composer-utility {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 14px;
  background: rgba(244, 233, 214, 0.9);
}

.chat-v2-composer-utility.is-active {
  color: #8f6735;
}

.chat-v2-composer-utility.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: scale(0.92);
}

.chat-v2-send:disabled {
  opacity: 0.48;
  cursor: default;
  box-shadow: none;
}

.chat-v2-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  padding:
    14px
    14px
    calc(
      var(--chat-v2-composer-height, 60px)
      + var(--chat-v2-bottom-offset, 0px)
      + env(safe-area-inset-bottom)
      + 10px
    );
  background: rgba(16, 24, 36, 0.26);
}

.chat-v2-menu-backdrop[hidden] {
  display: none;
}

.chat-v2-menu {
  display: grid;
  gap: 4px;
  width: min(100%, 340px);
  margin: 0 auto;
  justify-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-v2-menu-title {
  display: none;
}

.chat-v2-menu-reactions {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 38px;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 38px rgba(44, 28, 8, 0.14);
}

.chat-v2-menu-reactions[hidden] {
  display: none;
}

.chat-v2-menu-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(33, 26, 20, 0.94);
  font-size: 1.35rem;
}

.chat-v2-menu-reaction-more {
  color: rgba(101, 90, 77, 0.88);
}

.chat-v2-menu-reaction-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.chat-v2-menu-reaction-more.is-open svg {
  transform: rotate(180deg);
}

.chat-v2-menu-reactions-extra {
  gap: 4px;
  padding: 5px 8px;
}

.chat-v2-menu-actions {
  display: inline-grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  justify-items: stretch;
  gap: 8px 10px;
  width: fit-content;
  max-width: 100%;
}

.chat-v2-menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 38px rgba(44, 28, 8, 0.14);
  color: rgba(33, 26, 20, 0.94);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-v2-menu-action + .chat-v2-menu-action {
  border-top: 0;
}

.chat-v2-menu-action.danger {
  background: rgba(255, 246, 242, 0.98);
  box-shadow:
    0 18px 38px rgba(44, 28, 8, 0.14),
    inset 0 0 0 1px rgba(154, 77, 52, 0.18);
  color: #9c4a35;
  font-weight: 800;
}

.chat-v2-send:not(:disabled):active,
.chat-v2-icon-button:active,
.chat-v2-search-nav:active,
.chat-v2-search-close:active,
.chat-v2-attach:active,
.chat-v2-reaction:active,
.chat-v2-context-cancel:active,
.chat-v2-file-clear:active,
.chat-v2-menu-action:active,
.chat-v2-menu-reaction:active {
  transform: translateY(1px);
}

.chat-v2-jump:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  .chat-v2-message {
    min-width: min(168px, calc(100% - 42px));
    max-width: calc(100% - 14px);
    padding: 6px 11px 4px;
    border-radius: 18px;
  }

  .chat-v2-shell {
    width: calc(100% - 24px);
  }

  .chat-v2-header {
    gap: 12px;
  }

  .chat-v2-search-meta {
    flex-wrap: nowrap;
  }

  .chat-v2-context,
  .chat-v2-file-row {
    gap: 8px;
  }

  .chat-v2-context-text,
  .chat-v2-file-name {
    line-height: 1.32;
  }

  .chat-v2-attachment,
  .chat-v2-attachment.is-image {
    width: min(100%, 100%);
  }

  .chat-v2-menu-backdrop {
    padding:
      10px
      10px
      calc(
        var(--chat-v2-composer-height, 60px)
        + var(--chat-v2-bottom-offset, 0px)
        + env(safe-area-inset-bottom)
        + 10px
      );
  }

  .chat-v2-menu {
    width: min(100%, 320px);
  }

  .chat-v2-reaction {
    min-height: 16px;
    padding: 0 4px;
    font-size: 0.52rem;
  }

  .chat-v2-reaction-emoji {
    font-size: 0.72rem;
  }

  .chat-v2-menu-reactions {
    grid-auto-columns: 36px;
    gap: 4px;
    padding: 6px 8px;
  }

  .chat-v2-menu-reaction {
    width: 36px;
    min-height: 38px;
    font-size: 1.25rem;
  }

  .chat-v2-menu-reactions-extra {
    gap: 4px;
  }

  .chat-v2-menu-action {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.84rem;
  }

}
