:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --psk-blue: #005afe;
  --psk-text: #172033;
  --psk-border: #dce4ef;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  color: var(--psk-text);
}

button,
input,
textarea {
  font: inherit;
}

.chat-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #fff;
}

vue-advanced-chat {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-room-header-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  color: #172033;
}

.chat-room-header-info strong,
.chat-room-header-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-header-info strong {
  font-size: 16px;
  font-weight: 500;
}

.chat-room-header-info span {
  color: #526071;
  font-size: 13px;
}

.chat-sticker-icon,
.chat-sticker-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.chat-sticker-icon svg {
  fill: none;
  stroke: #526071;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.chat-status {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
  color: #526071;
  text-align: center;
}

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

.chat-error {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid #f0b9b9;
  border-radius: 0;
  background: #fff7f7;
  text-align: center;
}

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

.chat-error button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--psk-blue);
  color: #fff;
  cursor: pointer;
}

.chat-start {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  background: #fff;
  text-align: center;
}

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

.chat-start span {
  max-width: 320px;
  color: #526071;
  line-height: 1.5;
}

.chat-start button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--psk-blue);
  color: #fff;
  cursor: pointer;
}

.chat-start button:disabled {
  background: #6f8fc4;
  cursor: wait;
}

.chat-start__feedback {
  min-height: 0;
  margin: 0;
  color: #526071;
  line-height: 1.5;
}

.chat-start__feedback--error {
  color: #9b1c1c;
}

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

.chat-error button:hover {
  background: #0046c7;
}

.chat-error button:focus-visible,
.sticker-tray button:focus-visible {
  outline: 3px solid #b45309;
  outline-offset: 2px;
}

.sticker-tray {
  position: absolute;
  right: 12px;
  bottom: 76px;
  z-index: 40;
  width: min(340px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid var(--psk-border);
  border-radius: 14px;
  background: #fff;
}

.sticker-tray__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sticker-tray__head button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #556274;
  font-size: 28px;
  cursor: pointer;
}

.sticker-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sticker-button {
  min-height: 92px;
  padding: 6px;
  border: 1px solid var(--psk-border);
  border-radius: 12px;
  background: #f8faff;
  cursor: pointer;
}

.sticker-button:hover,
.sticker-button:focus-visible {
  border-color: var(--psk-blue);
  outline: none;
}

.sticker-button img {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 4px;
}

.sticker-button span {
  display: block;
  color: #344258;
  font-size: 12px;
}

.chat-message-sticker {
  display: flex;
  justify-content: center;
  padding: 4px;
}

.chat-message-sticker img {
  display: block;
  width: min(144px, 42vw);
  height: auto;
  max-height: 144px;
}

@media (max-width: 520px) {
  .chat-shell {
    min-height: 100%;
  }

  .sticker-tray {
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: calc(100% - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
