:root {
  color-scheme: light;
  --acc: #7d5fd3;
  --accs: #efebfb;
  --fg1: #16191f;
  --fg: #424955;
  --mut: #868d9b;
  --bd: #e7e9ee;
  --bdf: #f0f1f4;
  --s2: #f6f7f8;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --disp: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-family: var(--sans);
  background: #eceef2;
  color: var(--fg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eceef2;
}

button,
textarea {
  font: inherit;
}

.mobile-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 56px 44px 72px;
  background: #eceef2;
  font-family: var(--sans);
  color: var(--fg);
}

.mobile-phone {
  width: 390px;
  height: 844px;
  border-radius: 44px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(18, 24, 40, 0.08), 0 26px 60px -18px rgba(18, 24, 40, 0.28);
  border: 1px solid #dcdee5;
}

.mobile-status-bar {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 30px 8px;
  color: var(--fg1);
}

.mobile-status-bar > span:first-child {
  font: 600 14px var(--sans);
  letter-spacing: -0.01em;
}

.mobile-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mobile-signal {
  width: 16px;
  height: 10px;
  border-radius: 2px;
  background: var(--fg1);
}

.mobile-battery {
  width: 22px;
  height: 11px;
  border-radius: 3px;
  border: 1.5px solid var(--fg1);
}

.mobile-chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 12px;
  border-bottom: 1px solid var(--bdf);
}

.mobile-icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  color: var(--fg1);
  background: transparent;
  cursor: pointer;
}

.mobile-icon-button.is-muted {
  color: var(--fg);
}

.mobile-title {
  flex: 1;
  min-width: 0;
}

.mobile-title h1 {
  margin: 0;
  font: 600 16.5px var(--disp);
  letter-spacing: -0.018em;
  color: var(--fg1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-title p {
  margin: 1px 0 0;
  min-height: 1.2em;
  font: 400 13px var(--sans);
  color: var(--mut);
}

.mscroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.thread-surface {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 10px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message-row {
  flex-shrink: 0;
  display: flex;
  gap: 11px;
}

.message-row[data-author="you"] {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 82%;
  background: #eceff3;
  border-radius: 18px 18px 6px 18px;
  padding: 11px 14px;
  font: 400 15.5px var(--sans);
  line-height: 1.45;
  color: var(--fg1);
}

.message-row[data-author="agent"] .message-bubble {
  max-width: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  color: var(--fg);
  line-height: 1.5;
}

.message-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--accs);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px var(--disp);
  color: var(--acc);
}

.message-copy {
  flex: 1;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.message-handle {
  font: 600 13px var(--mono);
  color: var(--fg1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time,
.message-status {
  font: 400 12px var(--sans);
  color: var(--mut);
  flex-shrink: 0;
}

.message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer {
  flex-shrink: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--bdf);
  display: flex;
  align-items: center;
  gap: 9px;
}

.composer-input-wrap {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 23px;
  background: var(--s2);
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 16px;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  height: 44px;
  resize: none;
  border: 0;
  padding: 12px 0 0;
  background: transparent;
  color: var(--fg1);
  outline: none;
  font: 400 15.5px var(--sans);
}

.composer textarea::placeholder {
  color: var(--mut);
  opacity: 1;
}

.composer-input-wrap > span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 15px var(--mono);
  color: var(--mut);
}

.composer button {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fg1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.composer button:disabled {
  background: var(--mut);
}

@media (max-width: 430px) {
  .mobile-stage {
    padding: 0;
    align-items: stretch;
  }

  .mobile-phone {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
