:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-dark: #0060c0;
  --text-soft: #55555a;
  --field-bg: #f2f2f4;
  --field-bg-focus: #ffffff;
  --bubble: #ffffff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- shared ---------- */

.wordmark {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.14);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn-outline {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  flex: 1;
}

.btn-outline:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.btn-plain {
  background: transparent;
  color: var(--muted);
  padding: 10px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid transparent;
  background: var(--field-bg);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field select:focus {
  background: var(--field-bg-focus);
  border-color: rgba(0, 113, 227, 0.45);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.form-error {
  background: #fff2f2;
  color: #c0392b;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0;
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #b9c6d4, #8f9db1);
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.big {
  width: 68px;
  height: 68px;
  font-size: 24px;
  border: none;
  padding: 0;
}

/* ---------- landing ---------- */

.landing {
  min-height: 100dvh;
  background:
    radial-gradient(120% 70% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(80% 50% at 80% 10%, #eaf2ff 0%, rgba(234, 242, 255, 0) 70%),
    var(--bg);
  padding: 0 24px 60px;
}

.landing-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-link {
  color: var(--ink);
  font-size: 14px;
  opacity: 0.7;
}

.nav-link:hover {
  opacity: 1;
}

.hero {
  max-width: 780px;
  margin: 60px auto 0;
  text-align: center;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}

.hero h1 {
  font-size: clamp(44px, 7.4vw, 86px);
  line-height: 1.02;
  letter-spacing: -0.038em;
  font-weight: 700;
  margin: 0;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 560px;
  margin: 26px auto 0;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-actions .btn {
  min-width: 172px;
  padding: 15px 28px;
  font-size: 16px;
}

.hero-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.hero-stage {
  display: flex;
  justify-content: center;
  margin: 74px auto 0;
}

.phone {
  width: 330px;
  background: #fff;
  border-radius: 42px;
  padding: 16px 16px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.phone-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d5b8a8, #b08f7d);
}

.phone-name {
  font-size: 14px;
  font-weight: 600;
}

.phone-tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}

.phone-body {
  padding: 18px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  position: relative;
}

.row.mine {
  justify-content: flex-end;
}

.bubble {
  padding: 9px 14px;
  border-radius: 18px 18px 18px 6px;
  background: #f1f1f4;
  font-size: 14px;
  line-height: 1.4;
  max-width: 76%;
}

.row.mine .bubble {
  background: var(--blue);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}

.shot {
  margin: 0;
  width: 62%;
  border-radius: 18px;
  overflow: hidden;
  background: #eee;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.reactions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  margin-top: -10px;
  margin-right: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.features {
  max-width: 1000px;
  margin: 96px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.feature {
  padding: 32px 26px;
  border-right: 1px solid var(--line);
}

.feature:last-child {
  border-right: none;
}

.feature h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.landing-footer {
  max-width: 1000px;
  margin: 80px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

/* ---------- auth ---------- */

.auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  background:
    radial-gradient(80% 50% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    var(--bg);
}

.auth-wordmark {
  margin-bottom: 28px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 34px 32px 30px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.auth-card h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  font-weight: 600;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .btn {
  margin-top: 6px;
  padding: 14px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-row {
  display: flex;
  gap: 10px;
}

.oauth-row .btn {
  padding: 12px;
  font-size: 14px;
}

.auth-switch {
  margin: 24px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---------- app shell ---------- */

.app {
  display: grid;
  grid-template-columns: 344px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
}

.unread-total {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  padding: 0 6px;
}

.avatar-btn {
  border: none;
  background: none;
  padding: 0;
  border-radius: 50%;
}

.search {
  margin: 4px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(118, 118, 128, 0.1);
  border-radius: 11px;
  padding: 9px 12px;
  color: var(--muted);
}

.search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 18px;
}

.list-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 6px;
  margin: 0;
}

.empty-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  padding: 6px 12px 14px;
  margin: 0;
}

.chat-row,
.person-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  transition: background 0.15s ease;
}

.chat-row:hover,
.person-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.chat-row.active {
  background: rgba(0, 113, 227, 0.1);
}

.chat-text,
.person-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chat-name,
.person-name {
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  flex: none;
}

.chat-preview,
.person-handle {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0 6px;
  flex: none;
}

.start-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 999px;
  padding: 5px 11px;
  flex: none;
}

/* ---------- chat ---------- */

.chatpane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
}

.chat-head-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chat-head-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chat-head-text span {
  font-size: 11.5px;
  color: var(--muted);
}

.back-btn {
  display: none;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--blue);
  padding: 0 4px;
}

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 10px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.thread-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
}

.thread-empty p {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 6px;
}

.thread-empty span {
  font-size: 13px;
}

.day {
  display: flex;
  justify-content: center;
  margin: 16px 0 14px;
}

.day span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.1);
  padding: 4px 11px;
  border-radius: 999px;
}

.thread .row {
  margin: 1px 0;
}

.thread .row.mine {
  justify-content: flex-end;
}

.bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: min(520px, 74%);
  position: relative;
}

.thread .bubble {
  background: var(--bubble);
  color: var(--ink);
  border-radius: 19px 19px 19px 5px;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.42;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.03);
  align-self: flex-start;
}

.thread .row.mine .bubble {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  border-radius: 19px 19px 5px 19px;
  align-self: flex-end;
}

.shot-btn {
  border: none;
  padding: 0;
  background: none;
  border-radius: 20px;
  overflow: hidden;
  max-width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  position: relative;
  display: block;
}

.shot-btn img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.shot-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 10px;
  font-size: 13px;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.quoted {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 2.5px solid rgba(255, 255, 255, 0.5);
  padding: 3px 0 3px 9px;
  margin-bottom: 5px;
  font-size: 12px;
  opacity: 0.85;
  min-width: 0;
}

.thread .row:not(.mine) .quoted {
  border-left-color: rgba(0, 0, 0, 0.2);
}

.quoted strong {
  font-weight: 600;
  font-size: 11.5px;
}

.quoted span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.thread .row.mine .quoted {
  color: rgba(255, 255, 255, 0.92);
}

.meta {
  font-size: 10.5px;
  color: var(--muted);
  padding: 4px 6px 0;
  align-self: flex-start;
}

.thread .row.mine .meta {
  align-self: flex-end;
}

.reaction-pill {
  display: inline-flex;
  gap: 2px;
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  margin-top: -8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.thread .row.mine .reaction-pill {
  align-self: flex-end;
}

.reaction-pill button {
  border: none;
  background: none;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--ink);
}

.reaction-pill button.mine {
  background: rgba(0, 113, 227, 0.12);
}

.row-actions {
  position: absolute;
  top: -10px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  z-index: 3;
}

.thread .row:not(.mine) .row-actions {
  left: 34px;
}

.thread .row.mine .row-actions {
  right: 0;
}

.row:hover .row-actions {
  opacity: 1;
}

.row-actions button {
  border: none;
  background: none;
  font-size: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--muted);
}

.row-actions button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

.react-pop {
  position: absolute;
  bottom: 100%;
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 4;
  margin-bottom: 4px;
}

.thread .row.mine .react-pop {
  right: 0;
}

.thread .row:not(.mine) .react-pop {
  left: 34px;
}

.react-pop button {
  border: none;
  background: none;
  font-size: 19px;
  padding: 3px 5px;
  border-radius: 50%;
  transition: transform 0.12s ease;
}

.react-pop button:hover {
  transform: scale(1.25);
}

/* composer */

.composer {
  padding: 8px 20px 18px;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 7px 8px 7px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.composer-row textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  padding: 9px 2px;
  max-height: 132px;
  color: var(--ink);
}

.composer-row textarea::placeholder {
  color: #a1a1a6;
}

.round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: none;
}

.round:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

.send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.send:disabled {
  opacity: 0.3;
}

.send:not(:disabled):active {
  transform: scale(0.94);
}

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  background: rgba(0, 113, 227, 0.07);
  border-radius: 14px;
  font-size: 12.5px;
}

.reply-bar div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.reply-bar strong {
  font-weight: 600;
  font-size: 12px;
}

.reply-bar span {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-bar button,
.pending-photo button {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}

.pending-photo {
  position: relative;
  width: 108px;
  margin-bottom: 10px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.pending-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.pending-photo button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.emoji-panel {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.emoji-panel button {
  border: none;
  background: none;
  font-size: 19px;
  padding: 4px 0;
  border-radius: 8px;
}

.emoji-panel button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.chat-empty {
  margin: auto;
  text-align: center;
  max-width: 320px;
  color: var(--muted);
}

.chat-empty-mark {
  font-size: 30px;
  color: var(--muted);
  margin-bottom: 14px;
}

.chat-empty h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.chat-empty p {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

/* lightbox + sheet */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 30px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}

.sheet {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head h2 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.02em;
}

.sheet-head button {
  border: none;
  background: none;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
}

.sheet .avatar-picker {
  flex-direction: row;
}

/* responsive */

@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
  }

  .chatpane {
    display: none;
  }

  .app.show-chat .sidebar {
    display: none;
  }

  .app.show-chat .chatpane {
    display: flex;
  }

  .back-btn {
    display: block;
  }

  .features {
    grid-template-columns: 1fr;
    margin-top: 64px;
  }

  .feature {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 22px 4px;
  }

  .feature:last-child {
    border-bottom: none;
  }

  .hero {
    margin-top: 34px;
  }

  .hero-stage {
    margin-top: 48px;
  }

  .landing-footer {
    flex-direction: column;
    gap: 6px;
  }

  .thread {
    padding: 16px 14px 8px;
  }

  .composer {
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .emoji-panel {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --surface: #161618;
    --ink: #f5f5f7;
    --muted: #98989d;
    --line: rgba(255, 255, 255, 0.1);
    --bubble: #1f1f22;
    --blue: #0a84ff;
    --blue-dark: #409cff;
    --text-soft: #c9c9ce;
    --field-bg: #232326;
    --field-bg-focus: #2f2f34;
    --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  body {
    background: var(--bg);
  }

  .landing {
    background:
      radial-gradient(120% 70% at 50% -10%, #1c1c20 0%, rgba(28, 28, 32, 0) 60%),
      var(--bg);
  }

  .sidebar,
  .chat-head {
    background: rgba(22, 22, 24, 0.8);
  }

  .phone {
    background: #161618;
  }

  .bubble {
    background: #232327;
  }

  .row.mine .bubble,
  .thread .row.mine .bubble {
    background: var(--blue);
  }

  .search {
    background: rgba(118, 118, 128, 0.24);
  }

  .btn-outline,
  .composer-row,
  .reaction-pill,
  .row-actions,
  .react-pop,
  .emoji-panel,
  .sheet {
    background: #1b1b1e;
  }

  .shot-btn,
  .pending-photo {
    box-shadow: none;
  }

  .form-error {
    background: rgba(255, 69, 58, 0.14);
    color: #ff8b82;
  }
}

.boot {
  min-height: 100dvh;
  background: var(--bg, #f5f5f7);
}
