/* Visual language matched to chat-relay's conversation view: light grey chrome, a
   white message surface, and the #5b5fc7 brand purple for anything "yours". */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  color: #242424;
  background: #f5f5f5;
}

.split {
  display: flex;
  height: 100%;
  min-height: 0;
}

.pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

.head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  flex: 0 0 auto;
}

.head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.logo {
  display: block;
  height: 26px;
  width: auto;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  padding: 0.5rem 1rem 40px;
}

.messages {
  font-size: 14px;
  line-height: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 62rem;
}

.day {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.75rem;
  color: #616161;
  font-size: 0.8rem;
}

.day::before,
.day::after {
  content: '';
  flex: 1;
  border-top: 1px solid #e0e0e0;
}

.event {
  text-align: center;
  color: #757575;
  font-style: italic;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.message {
  position: relative;
  display: flex;
  gap: 0.6rem;
  margin-top: 20px;
  padding: 0 0 0 12px;
}

.message:first-child {
  margin-top: 0;
}

.message.continuation {
  margin-top: 4px;
}

.message:hover {
  background: #f5f5f5;
  border-radius: 4px;
}

.message.own::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 28px;
  border-radius: 2px;
  background: #5b5fc7;
}

.message.own.continuation::before {
  content: none;
}

.avatar-spacer {
  flex: 0 0 auto;
  width: 28px;
}

.avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.7rem;
  background: #e8ebfa;
  color: #4f52b2;
  user-select: none;
}

.body {
  min-width: 0;
  flex: 1;
}

.who {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.who .name {
  font-weight: 600;
  color: #242424;
}

.who time {
  color: #757575;
}

.text {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ---- Compose box, matching chat-relay's live-client measurements ---- */

.composer {
  background: #fff;
  padding: 0 1rem 1rem;
  flex: 0 0 auto;
}

.compose-box {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
}

.compose-box:focus-within {
  border-color: #5b5fc7;
}

.compose-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  border: none;
  background: none;
  resize: none;
  padding: 12px 8px 10px 12px;
  font: inherit;
  color: inherit;
  outline: none;
}

.compose-send {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 6px 6px 0;
  border: none;
  border-radius: 4px;
  background: none;
  color: #5b5fc7;
  cursor: pointer;
}

.compose-send svg {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

.compose-send:hover:not(:disabled) {
  background: #f0f0f5;
}

.compose-send:disabled {
  color: #c8c6c4;
  cursor: default;
}

/* ---- Name prompt, matching chat-relay's onboarding card ---- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 245, 0.92);
}

.overlay[hidden] {
  display: none;
}

.onboard {
  max-width: 22rem;
  width: 90vw;
  padding: 2rem;
  text-align: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 14%);
}

.onboard .hint {
  color: #757575;
  margin: 0 0 1rem;
}

.name-input {
  width: 100%;
  height: 32px;
  padding: 0 0.6rem;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font: inherit;
}

.onboard .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-top: 1rem;
  padding: 0 0.9rem;
  border: none;
  border-radius: 4px;
  background: #5b5fc7;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.onboard .primary:hover {
  background: #4f52b2;
}
