.chat-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
  gap: 0 !important;
}
.chat-room-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.chat-room-heading > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.chat-room-heading b {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.chat-room-heading span,
.chat-room-heading small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.chat-room-heading small {
  max-width: 220px;
}
.chat-history {
  flex: 1;
  min-height: 45px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.chat-message {
  flex: none;
  align-self: flex-start;
  width: fit-content;
  max-width: min(80%, 780px);
  border: 1px solid var(--line);
  border-radius: 3px 14px 14px;
  padding: 12px 14px;
  background: var(--surface-soft, #f7f8fc);
  min-width: 0;
}
.chat-message-own {
  align-self: flex-end;
  border-radius: 14px 3px 14px 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.chat-message-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.chat-message-head b {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.chat-message-head time {
  font-size: 9px;
  color: var(--muted);
}
.chat-message-text {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.chat-message-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 7px;
}
.chat-message-actions .button {
  padding: 0;
  border: 0;
  background: transparent !important;
  color: var(--muted);
  font-size: 9px;
  min-height: 23px;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
.chat-message-actions .button:hover {
  color: var(--accent-ink);
}
.chat-files {
  display: flex;
  gap: 6px;
  flex-direction: column;
  margin-top: 10px;
}
.chat-files .button {
  justify-content: flex-start;
  display: flex;
  gap: 9px;
  max-width: 100%;
  text-align: left;
  white-space: normal !important;
  background: var(--surface, #fff);
  padding: 8px 11px;
}
.chat-files .button > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.chat-files small,
.chat-draft-file small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 9px;
  margin-top: 3px;
}
.chat-composer {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--surface, #fff);
  min-height: 0;
}
.chat-composer textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 108px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  padding: 0;
  overflow: auto;
  box-sizing: border-box;
}
.chat-composer textarea:focus {
  outline: 0;
}
.chat-composer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
  justify-content: flex-end;
  margin-top: 8px;
}
.chat-composer-actions .button,
.chat-attach {
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  font-size: 11px;
}
.chat-attach {
  margin-right: auto;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.chat-attach input {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.chat-attach:focus-within {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
.chat-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.chat-hint {
  font-size: 9px;
  color: var(--muted);
}
.chat-draft-files {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-height: 76px;
  overflow: auto;
}
.chat-draft-files:empty {
  display: none;
}
.chat-draft-file {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0;
  max-width: min(250px, 100%);
  font-size: 10px;
}
.chat-draft-file > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-draft-file .button {
  padding: 0;
  width: 22px;
  min-height: 24px;
  flex: none;
  border: 0;
  background: none;
  font-size: 17px;
}
.chat-message-focused {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}
.chat-room[data-compact="true"] .chat-room-heading {
  display: none;
}
.chat-room[data-compact="true"] .chat-history {
  min-height: 30px;
  padding: 8px 12px;
}
.chat-room[data-compact="true"] .chat-composer {
  padding: 6px 12px;
  max-height: 70%;
  overflow: auto;
}
.chat-room[data-compact="true"] .chat-composer textarea {
  min-height: 28px;
  height: 28px;
  max-height: 36px;
}
.chat-room[data-compact="true"] .chat-composer-actions {
  margin-top: 4px;
}
.chat-room[data-compact="true"] .chat-draft-files {
  max-height: 36px;
}
.chat-room[data-compact="true"] .chat-composer-actions .button {
  padding: 6px 9px;
  min-height: 28px;
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 12px;
}
.chat-empty b {
  color: var(--ink);
  font-size: 15px;
}
.chat-empty p {
  max-width: 300px;
  line-height: 1.6;
  margin: 10px auto 0;
}
.chat-readonly {
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.chat-unavailable {
  padding: 25px !important;
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 650px) {
  .chat-room-heading {
    padding: 10px 12px;
  }
  .chat-room-heading small {
    display: none;
  }
  .chat-history {
    padding: 12px;
    gap: 10px;
  }
  .chat-message {
    max-width: 94%;
    padding: 10px 11px;
  }
  .chat-composer {
    padding: 10px 12px;
  }
  .chat-hint {
    display: none;
  }
  .chat-composer-actions {
    gap: 6px;
  }
  .chat-composer-actions .button,
  .chat-attach {
    padding: 8px 10px;
    font-size: 10px;
  }
  .chat-message-head {
    gap: 6px;
  }
  .chat-room-heading span {
    font-size: 9px;
  }
}
@media (max-height: 650px) {
  .chat-room-heading {
    padding-block: 8px;
  }
  .chat-composer {
    padding-block: 8px;
  }
  .chat-composer textarea {
    min-height: 34px;
    height: 34px;
  }
  .chat-draft-files {
    max-height: 48px;
  }
  .chat-history {
    padding-block: 10px;
  }
}

.chat-message-text,
.chat-composer textarea {
  font-size: 15px;
}
.chat-message-head b,
.chat-files .button > span:last-child,
.chat-composer-actions .button,
.chat-attach {
  font-size: 14px;
}
.chat-room-heading span,
.chat-room-heading small,
.chat-message-head time,
.chat-message-actions .button,
.chat-files small,
.chat-draft-file small,
.chat-hint,
.chat-draft-file,
.chat-readonly {
  font-size: 12px;
}
@media (max-width: 320px) {
  .chat-composer-actions .button,
  .chat-attach {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}
