.page--chat {
  height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
}

.chat {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  margin: 0 auto;
}

.chat__header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 30px;
  background: linear-gradient(to bottom, var(--bg) 82%, transparent);
  pointer-events: none;
}

.chat__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}

.chat__name {
  margin: 6px 0 0;
  padding: 3px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chat__location {
  margin: 4px 0 0;
  color: var(--ink-dim);
  font-size: 10px;
}

.chat__thread {
  flex: 1;
  margin: 0;
  padding: 150px 16px 88px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.chat__date {
  margin: 20px 0 10px;
  color: var(--ink-dim);
  font-size: 10px;
  text-align: center;
}

.chat__item {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.chat__item--tail-gap {
  margin-top: 2px;
}

.chat__bubble {
  --bubble-bg: var(--accent);
  position: relative;
  max-width: 75%;
  padding: 8px 14px;
  background: var(--bubble-bg);
  border-radius: 18px;
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat__bubble--tail::before,
.chat__bubble--tail::after {
  content: "";
  position: absolute;
  bottom: 0;
}

.chat__bubble--tail::before {
  left: -7px;
  width: 20px;
  height: 18px;
  background: var(--bubble-bg);
  border-bottom-right-radius: 16px;
}

.chat__bubble--tail::after {
  bottom: -1px;
  left: -26px;
  width: 26px;
  height: 20px;
  background: var(--bg);
  border-bottom-right-radius: 10px;
}

.chat__bubble--playing {
  --bubble-bg: color-mix(in srgb, var(--accent) 82%, #fff);
}

.chat__bubble--track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 8px 14px 8px 8px;
}

.chat__play {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
}

.chat__play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.chat__wave {
  display: flex;
  flex: 1;
  gap: 2px;
  align-items: center;
  height: 28px;
  padding: 6px 0;
  box-sizing: content-box;
  cursor: pointer;
  touch-action: pan-y;
}

.chat__wave:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.chat__icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chat__bar {
  flex: 1;
  min-width: 2px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
}

.chat__bar--played {
  background: #fff;
}

.chat__time {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chat__composer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 24px 12px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  pointer-events: none;
  user-select: none;
}

.chat__plus {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #0f0f0f;
  border: 1px solid #161616;
  border-radius: 50%;
  color: #2e2e2e;
  font-size: 22px;
  line-height: 1;
}

.chat__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 14px;
  background: #0f0f0f;
  border: 1px solid #161616;
  border-radius: 999px;
  color: #2e2e2e;
  font: inherit;
  font-size: 14px;
  cursor: default;
}

.chat__input::placeholder {
  color: #2e2e2e;
}
