:root {
  color-scheme: light;
  --page: #f2efe7;
  --ink: #171716;
  --muted: #706a63;
  --line: rgba(23, 23, 22, 0.12);
  --panel: #ffffff;
  --panel-soft: #ebe6dc;
  --inverse: #20283d;
  --accent: #d9734e;
  --admin-bubble: #20283d;
  --visitor-bubble: #ffffff;
  --danger-bg: #fff0ec;
  --danger: #8a2715;
  --shadow: rgba(33, 27, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.chat-route {
  min-height: 100svh;
  background:
    radial-gradient(circle at 14% 8%, rgba(217, 115, 78, 0.12), transparent 28%),
    linear-gradient(135deg, #f5f0e6 0%, #ece7dc 42%, #f7f4ee 100%);
}

.auth-screen {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.08)),
    url("public/dark.png") center / cover;
}

.auth-panel {
  width: min(720px, 100%);
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(248, 248, 245, 0.96);
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.32);
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading span,
.chat-sidebar header span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.auth-heading h1,
.chat-sidebar h1 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

.chat-status {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: #37322f;
  line-height: 1.4;
}

.chat-status[data-tone="error"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.auth-tabs {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(34, 29, 24, 0.08);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.is-active {
  display: flex;
}

.auth-form label,
.composer {
  display: grid;
  gap: 7px;
}

.auth-form span {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-form input,
.auth-form textarea,
.composer textarea {
  width: 100%;
  border: 1px solid rgba(23, 23, 22, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: 0;
}

.auth-form input {
  min-height: 50px;
  padding: 0 15px;
}

.auth-form textarea,
.composer textarea {
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.45;
}

.auth-form input:focus,
.auth-form textarea:focus,
.composer textarea:focus {
  border-color: var(--inverse);
  box-shadow: 0 0 0 3px rgba(31, 26, 24, 0.1);
}

.primary-button,
.secondary-button,
.text-button,
.file-button span {
  min-height: 50px;
  border-radius: 8px;
  font-weight: 850;
  letter-spacing: 0;
}

.primary-button {
  border: 0;
  background: var(--inverse);
  color: #ffffff;
}

.secondary-button,
.file-button span {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.chat-sidebar .secondary-button {
  min-height: 42px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}

.chat-screen {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(10px, 2vw, 22px);
  background:
    radial-gradient(circle at 82% 4%, rgba(32, 40, 61, 0.08), transparent 30%),
    radial-gradient(circle at 8% 92%, rgba(217, 115, 78, 0.12), transparent 34%),
    var(--page);
}

.chat-sidebar {
  display: flex;
  min-height: calc(100svh - 32px);
  max-height: calc(100svh - 32px);
  flex-direction: column;
  gap: 14px;
  margin: 16px 0 16px 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 70px rgba(40, 32, 23, 0.12);
  backdrop-filter: blur(18px);
}

.chat-sidebar h1 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.chat-profile {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.chat-profile strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.05;
}

.chat-profile span,
.chat-profile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.profile-fields {
  display: grid;
  gap: 7px;
  margin: 4px 0 0;
  max-height: 220px;
  overflow-y: auto;
}

.profile-fields div {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-fields dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-fields dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
}

.chat-inbox {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.inbox-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
}

.inbox-item.is-active {
  border-color: var(--inverse);
  box-shadow: 0 16px 42px var(--shadow);
}

.inbox-item strong,
.inbox-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item small {
  color: var(--muted);
}

.conversation-shell {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.2vw, 24px) 16px;
}

.messages {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 8px 6px 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 40, 61, 0.25) transparent;
}

.message {
  max-width: min(68%, 560px);
  padding: 10px 12px 7px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: var(--visitor-bubble);
  box-shadow: 0 10px 28px rgba(43, 34, 24, 0.08);
  animation: message-in 160ms ease-out;
}

.messages[data-motion="still"] .message {
  animation: none;
}

.message.is-admin {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--admin-bubble);
  color: #ffffff;
}

.message.is-visitor {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
  line-height: 1.42;
}

.message time {
  display: block;
  margin-top: 4px;
  color: currentColor;
  font-size: 0.68rem;
  line-height: 1;
  text-align: right;
  opacity: 0.46;
}

.date-separator {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  margin: 10px 0;
  pointer-events: none;
}

.date-separator span {
  padding: 6px 10px;
  border: 1px solid rgba(32, 40, 61, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #67605a;
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(42, 34, 24, 0.08);
  backdrop-filter: blur(12px);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-files,
.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attachment-tray {
  margin-top: 0;
}

.pending-file {
  display: inline-flex;
  max-width: min(320px, 100%);
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(32, 40, 61, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.pending-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.86rem;
}

.pending-file button {
  border: 0;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.file-card {
  display: grid;
  width: min(260px, 100%);
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(32, 40, 61, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.file-card button {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.file-card button span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.file-card button strong,
.file-card button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card button strong {
  font-size: 0.9rem;
}

.file-card button small {
  color: var(--muted);
  font-size: 0.72rem;
}

.file-card a {
  display: grid;
  min-width: 72px;
  place-items: center;
  padding: 0 10px;
  border-left: 1px solid rgba(32, 40, 61, 0.1);
  color: var(--inverse);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.message.is-admin .file-card {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.message.is-admin .file-card button,
.message.is-admin .file-card a,
.message.is-admin .file-card button small {
  color: #ffffff;
}

.message.is-admin .file-card button span {
  color: #ffc4a7;
}

.message.is-admin .file-card a {
  border-left-color: rgba(255, 255, 255, 0.18);
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 58px rgba(38, 30, 22, 0.14);
  backdrop-filter: blur(18px);
}

.composer textarea {
  min-height: 54px;
  max-height: 150px;
  border-color: rgba(32, 40, 61, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-button span {
  min-width: 104px;
  min-height: 44px;
  padding: 0 16px;
}

.composer-actions .primary-button {
  min-width: 104px;
  min-height: 44px;
  padding: 0 18px;
}

.empty {
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.sidebar-toggle,
.icon-button {
  display: none;
}

.sidebar-scrim {
  display: none;
}

.chat-screen {
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(14px, 2vw, 26px);
}

.chat-sidebar {
  min-height: calc(100svh - clamp(28px, 4vw, 52px));
  max-height: calc(100svh - clamp(28px, 4vw, 52px));
  margin: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
}

.chat-sidebar header h1 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.inbox-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(32, 40, 61, 0.06);
}

.inbox-filters[hidden] {
  display: none;
}

.inbox-filters button {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.inbox-filters button.is-active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(32, 40, 61, 0.1);
}

.inbox-item {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

.inbox-item.is-active,
.inbox-item:hover {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(32, 40, 61, 0.08);
}

.inbox-item.is-unread .inbox-preview,
.inbox-item.is-unread .inbox-row strong {
  color: var(--ink);
  font-weight: 900;
}

.inbox-avatar,
.conversation-avatar {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(217, 115, 78, 0.95), rgba(32, 40, 61, 0.95));
  color: #ffffff;
  font-weight: 900;
}

.inbox-avatar {
  width: 42px;
  height: 42px;
}

.inbox-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.inbox-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inbox-row strong,
.inbox-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-row time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
}

.inbox-preview {
  color: var(--muted);
  font-size: 0.78rem;
}

.unread-badge {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #ef4d43;
  color: #ffffff;
  font-size: 0.72rem;
}

.conversation-shell {
  width: min(760px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(252, 250, 245, 0.82);
  box-shadow: 0 32px 110px rgba(32, 40, 61, 0.16);
  backdrop-filter: blur(18px);
}

.conversation-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(32, 40, 61, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.conversation-avatar {
  width: 42px;
  height: 42px;
}

.conversation-header strong,
.conversation-header p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 900;
}

.conversation-header p {
  color: var(--muted);
  font-size: 0.78rem;
}

.typing-indicator,
.message-typing {
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.typing-indicator {
  display: inline-flex;
}

.typing-indicator[hidden] {
  display: none;
}

.typing-indicator i,
.message-typing i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  animation: typing-dot 1s infinite ease-in-out;
}

.typing-indicator i:nth-child(2),
.message-typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-indicator i:nth-child(3),
.message-typing i:nth-child(3) {
  animation-delay: 0.32s;
}

.messages {
  padding: 18px 16px 12px;
}

.message {
  max-width: min(70%, 470px);
  padding: 9px 11px 6px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(32, 40, 61, 0.08);
}

.message.is-admin {
  border-bottom-right-radius: 5px;
  background: #171716;
}

.message.is-visitor {
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
}

.message time {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.message time span {
  font-weight: 800;
}

.message-typing {
  display: inline-flex;
  align-self: flex-start;
  margin: 6px 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.image-preview {
  display: block;
  max-width: min(320px, 100%);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.quick-replies {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 10px;
}

.quick-replies button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(32, 40, 61, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #79533e;
  font-size: 0.78rem;
  font-weight: 850;
}

.composer {
  position: static;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin: 0 12px 12px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(23, 23, 22, 0.92);
}

.attachment-tray {
  grid-column: 1 / -1;
}

.composer textarea {
  min-height: 42px;
  max-height: 120px;
  padding: 11px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.composer-actions {
  align-items: end;
  gap: 8px;
}

.file-button span,
.send-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
}

.file-button span {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.4rem;
}

.send-button {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  color: #171716;
  text-indent: -999px;
}

.send-button::after {
  content: ">";
  display: grid;
  place-items: center;
  text-indent: 0;
  font-size: 1rem;
  font-weight: 950;
}

@keyframes typing-dot {
  0%, 80%, 100% {
    opacity: 0.32;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.waitlist-auth {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 10, 0.58);
}

.viewer-panel {
  position: absolute;
  inset: clamp(12px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.34);
}

.waitlist-auth-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100svh - 28px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 8px;
  background: rgba(248, 248, 245, 0.98);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.waitlist-auth-panel header {
  margin-bottom: 18px;
}

.waitlist-auth-panel header span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.waitlist-auth-panel h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 500;
  line-height: 0.98;
}

.waitlist-summary {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.waitlist-summary strong {
  display: block;
  font-size: 1.05rem;
}

.waitlist-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.handoff-denied {
  position: relative;
  display: block;
  min-height: 100svh;
  background: #fff8ef url("public/404.png") center / contain no-repeat;
}

.handoff-denied[hidden] {
  display: none;
}

.handoff-denied a {
  position: absolute;
  top: clamp(16px, 3vw, 34px);
  right: clamp(16px, 3vw, 34px);
  display: grid;
  min-height: 46px;
  place-items: center;
  padding: 0 20px;
  border: 1px solid rgba(24, 33, 58, 0.16);
  border-radius: 8px;
  background: #18213a;
  color: #fffaf2;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 12px 34px rgba(24, 33, 58, 0.18);
}

.viewer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.viewer-panel header button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 900;
}

.viewer-body {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: auto;
  padding: 18px;
}

.viewer-body img,
.viewer-body video,
.viewer-body iframe,
.viewer-body pre {
  max-width: 100%;
  max-height: 100%;
}

.viewer-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.viewer-body pre {
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 780px) {
  .sidebar-toggle,
  .icon-button {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 900;
  }

  .sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 30;
    min-height: 38px;
    padding: 0 12px;
    box-shadow: 0 12px 32px rgba(32, 40, 61, 0.16);
  }

  .icon-button {
    width: 34px;
    height: 34px;
    font-size: 0;
  }

  .icon-button::before {
    content: "<";
    font-size: 1rem;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: none;
    background: rgba(10, 12, 16, 0.42);
  }

  .chat-screen.sidebar-is-open .sidebar-scrim {
    display: block;
  }

  .chat-screen {
    display: block;
    min-height: 100svh;
    padding: 10px;
  }

  .chat-sidebar {
    position: fixed;
    inset: 10px auto 10px 10px;
    z-index: 25;
    width: min(330px, calc(100vw - 28px));
    min-height: auto;
    max-height: calc(100svh - 20px);
    margin: 0;
    transform: translateX(calc(-100% - 18px));
    transition: transform 180ms ease;
  }

  .chat-screen.sidebar-is-open .chat-sidebar {
    transform: translateX(0);
  }

  .chat-sidebar header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
  }

  .chat-sidebar h1 {
    font-size: 1.35rem;
  }

  .chat-profile {
    display: grid;
  }

  .chat-inbox {
    max-height: none;
  }

  .conversation-shell {
    width: 100%;
    min-height: calc(100svh - 20px);
    border-radius: 26px;
  }

  .conversation-header {
    grid-template-columns: 34px 40px minmax(0, 1fr);
  }

  .typing-indicator {
    display: none;
  }

  .message {
    max-width: 84%;
  }

  .composer-actions {
    display: flex;
  }

  .file-card {
    width: 100%;
  }
}
