:root {
  color-scheme: light;
  --ink: #4b2434;
  --muted: #9b6679;
  --paper: #fff7fa;
  --line: #f4c7d8;
  --mint: #ffb6cf;
  --coral: #ff6fa5;
  --sky: #ffc9dd;
  --gold: #ffd36e;
  --violet: #d884ff;
  --shadow: 0 18px 50px rgba(170, 63, 105, 0.18);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 182, 207, 0.55), transparent 28%),
    linear-gradient(145deg, #fff3f8, #ffe3ef 48%, #fff9fc);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-download-button {
  position: fixed;
  z-index: 100;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 10px 28px rgba(199, 47, 117, 0.3);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-download-button:hover,
.site-download-button:focus-visible {
  background: #e9508c;
  transform: translateY(-1px);
}

.native-app .site-download-button,
.auth-locked .site-download-button,
body[data-current-view]:not([data-current-view="home"]) .site-download-button {
  display: none !important;
}

@media (display-mode: standalone) {
  .site-download-button {
    display: none !important;
  }
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.auth-gate {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.82), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(255, 205, 224, 0.68), transparent 30%),
    linear-gradient(145deg, #fff6fa, #ffe6f0 50%, #ffdce9);
  padding: 20px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand img {
  width: 42px;
  height: 42px;
}

.auth-brand strong {
  font-size: 1.8rem;
  line-height: 1;
}

.auth-card h2,
.auth-card p {
  margin-bottom: 0;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}

.auth-email-fields,
.auth-register-fields,
.auth-reset-fields {
  display: grid;
  gap: 12px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-status {
  min-height: 20px;
  color: #c72f75 !important;
  font-size: 0.88rem;
}

.auth-field-hint {
  display: block;
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -4px;
}

.remember-password-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.remember-password-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--coral);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 800;
  cursor: pointer;
  padding: 4px 0;
}

.logout-button {
  margin: 0;
}

.update-app-button {
  background: linear-gradient(135deg, #ff6fa5, #ff9cc2);
  position: relative;
}

.update-app-button.update-available::after,
.profile-settings-button.update-available::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 7px;
  width: 9px;
  height: 9px;
  border: 2px solid white;
  border-radius: 50%;
  background: #f02d4f;
  box-shadow: 0 1px 5px rgba(240, 45, 79, 0.35);
}

.profile-account-actions {
  display: flex;
  gap: 10px;
  width: min(100%, 220px);
  margin: 8px auto 0;
}

.profile-account-actions > button {
  width: 100%;
}

.invite-friend-button {
  background: linear-gradient(135deg, #ff6fa5, #ff9cc2);
  color: white;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 108px minmax(320px, 430px);
  justify-content: center;
  gap: 22px;
  padding: 24px;
}

.side-rail {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
}

.rail-button {
  position: relative;
  width: 84px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.rail-button.active {
  background: var(--coral);
  color: white;
}

.nav-badge {
  position: absolute;
  top: 3px;
  right: 7px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ff2f4f;
  color: #fff;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 0 5px;
}

.phone-frame {
  min-height: calc(100vh - 48px);
  max-height: 920px;
  overflow: auto;
  border: 1px solid rgba(255, 143, 184, 0.24);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 20px;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.language-switch {
  margin-left: auto;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}

.language-switch select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
}

body:not([data-current-view="home"]) .home-only {
  display: none !important;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.icon-button,
.primary-button,
.mini-button,
.reply-form button,
.action-button,
.ghost-button,
.media-picker,
.chat-form button {
  border: 0;
  border-radius: 8px;
}

.icon-button {
  padding: 9px 12px;
  background: var(--coral);
  color: white;
}

.hero-band {
  position: relative;
  min-height: 164px;
  margin: 22px 0 18px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 211, 110, 0.48), transparent 31%),
    linear-gradient(135deg, #ff8fb8, #ffb6cf 55%, #fff0f6);
}

.hero-language-switch {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  margin: 0;
}

.hero-language-switch select {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(170, 63, 105, 0.16);
}

.orbit-visual {
  position: relative;
  min-height: 164px;
}

.note-shape {
  position: absolute;
  width: 58px;
  height: 42px;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.note-one {
  left: 28px;
  top: 36px;
  background: #ffffff;
  transform: rotate(-10deg);
}

.note-two {
  left: 102px;
  top: 70px;
  background: #ffd36e;
  transform: rotate(8deg);
}

.note-three {
  left: 72px;
  top: 116px;
  background: #ff6fa5;
  transform: rotate(-3deg);
}

.hero-copy {
  display: flex;
  align-items: end;
  padding: 18px;
  color: white;
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.25;
}

.quota-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 143, 184, 0.32);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.profile-quota {
  margin: 16px 0 0;
}

.profile-saved {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.quota-strip strong,
.quota-strip span {
  display: block;
}

.quota-strip span {
  color: var(--muted);
  font-size: 0.84rem;
}

.mini-button {
  min-height: 36px;
  padding: 0 12px;
  background: var(--coral);
  color: white;
  white-space: nowrap;
}

.mini-button:disabled {
  background: #f3e8ee;
  color: var(--muted);
  cursor: not-allowed;
}

.mood-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.mood-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 0 14px;
}

.mood-chip.active {
  border-color: var(--coral);
  color: var(--coral);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--muted);
}

.section-head h2 {
  color: var(--ink);
}

.note-feed {
  display: grid;
  gap: 12px;
}

.note-card,
.composer,
.billing-panel,
.support-panel,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
}

.note-meta,
.note-actions,
.composer-footer,
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mood-pill {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.mood-Hopeful {
  background: rgba(112, 199, 167, 0.22);
  color: #14634a;
}

.mood-期待 {
  background: rgba(255, 111, 165, 0.16);
  color: #c72f75;
}

.mood-Quiet,
.mood-安静 {
  background: rgba(122, 167, 255, 0.22);
  color: #244f9f;
}

.mood-Funny,
.mood-开心 {
  background: rgba(244, 184, 74, 0.25);
  color: #7a5200;
}

.mood-Question,
.mood-提问 {
  background: rgba(143, 126, 231, 0.22);
  color: #4c3cad;
}

.time-label,
.note-author,
.reply-list,
#charCount {
  color: var(--muted);
  font-size: 0.86rem;
}

.note-text {
  margin: 14px 0 10px;
  font-size: 1.03rem;
  line-height: 1.45;
}

.reply-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.reply-item {
  border-left: 3px solid var(--mint);
  padding-left: 9px;
}

.reply-form {
  display: none;
  grid-template-columns: 1fr 66px;
  gap: 8px;
  margin: 12px 0;
}

.reply-form.open {
  display: grid;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 138px;
  resize: vertical;
}

label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.composer {
  display: grid;
  gap: 14px;
}

.composer-footer {
  flex-wrap: wrap;
}

.composer-footer .media-picker {
  min-height: 42px;
}

.note-media-preview {
  align-items: center;
  background: #fff7fa;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: 82px 1fr auto;
  padding: 10px;
}

.note-media-preview[hidden] {
  display: none;
}

.note-media-preview img {
  aspect-ratio: 1;
  border-radius: 13px;
  display: block;
  height: 82px;
  object-fit: cover;
  width: 82px;
}

.note-media-preview img[hidden] {
  display: none;
}

.note-media-preview div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.note-media-preview strong {
  color: var(--ink);
}

.note-media-preview span {
  color: var(--muted);
  font-size: 0.78rem;
}

.note-media-preview button {
  background: transparent;
  color: var(--coral);
  min-height: 38px;
  padding: 0 10px;
}

.composer.is-submitting {
  opacity: 0.82;
}

.composer .primary-button:disabled,
.composer .media-picker.is-loading {
  cursor: wait;
  opacity: 0.6;
}

@media (max-width: 520px) {
  .note-media-preview {
    grid-template-columns: 68px 1fr auto;
  }

  .note-media-preview img {
    height: 68px;
    width: 68px;
  }
}

.note-attachment {
  margin: 10px 0 0;
}

.note-attachment:empty {
  display: none;
}

.note-attachment .chat-attachment {
  max-width: 100%;
}

.primary-button,
.reply-form button {
  background: var(--coral);
  color: white;
  min-height: 42px;
  padding: 0 16px;
}

.action-button {
  min-height: 38px;
  padding: 0 14px;
  background: #eef2f5;
  color: var(--ink);
}

.action-button.saved {
  background: var(--coral);
  color: white;
}

.profile-panel {
  position: relative;
  text-align: center;
}

.profile-settings {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 15;
}

.profile-settings-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff5f9;
  color: var(--coral);
  font-size: 1.35rem;
  cursor: pointer;
}

.profile-settings-button[aria-expanded="true"] {
  color: white;
  background: var(--coral);
}

.profile-settings-menu {
  position: absolute;
  top: 50px;
  right: 0;
  display: grid;
  gap: 8px;
  width: 190px;
  max-height: min(520px, 72vh);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 30px rgba(111, 38, 68, 0.18);
}

.profile-settings-menu[hidden] {
  display: none;
}

.profile-settings-menu .ghost-button {
  width: 100%;
  min-height: 42px;
}

.settings-link {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  text-decoration: none;
}

.billing-note:empty {
  display: none;
}

body.youth-mode .billing-panel,
body.youth-mode .profile-quota,
body.youth-mode .invite-friend-button,
body.youth-mode #remotePanelToggleButton,
body.youth-mode #bluetoothRemotePanel {
  display: none !important;
}

.billing-head {
  align-items: flex-start;
  margin-top: 0;
}

.billing-head p,
.billing-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6fa5, #ff9cc2);
  color: white;
  padding: 16px;
}

.balance-card span {
  color: rgba(255, 255, 255, 0.72);
}

.balance-card strong {
  font-size: 2rem;
}

.support-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.support-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.support-thread {
  display: grid;
  gap: 10px;
  max-height: 230px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7fb;
}

.support-message {
  display: grid;
  gap: 4px;
  max-width: 82%;
}

.support-message span {
  color: var(--muted);
  font-size: 0.78rem;
}

.support-message p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.45;
  background: white;
  border: 1px solid var(--line);
}

.support-user {
  justify-self: end;
}

.support-user span {
  text-align: right;
}

.support-user p {
  color: white;
  background: var(--pink);
  border-color: var(--pink);
}

.support-form {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 10px;
}

.support-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.support-form button {
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--pink);
  font-weight: 800;
}

.plan-grid {
  display: grid;
  gap: 10px;
}

.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  text-align: left;
}

.payment-provider-field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}

.payment-provider-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.plan-card:hover {
  border-color: var(--coral);
}

.plan-card[aria-disabled="true"] {
  border-style: dashed;
  opacity: .72;
}

.plan-card span {
  color: var(--coral);
  font-weight: 800;
}

.profile-form,
.chat-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.profile-form label,
.chat-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.profile-form input,
.profile-form select,
.chat-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
}

.profile-form select:disabled {
  color: var(--muted);
  background: #fff5f8;
}

.profile-form > .primary-button {
  justify-self: center;
  width: min(180px, 56%);
  min-height: 38px;
  padding: 0 18px;
}

.account-line,
.lock-note,
.policy-links {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
}

.policy-links a {
  color: var(--coral);
  font-weight: 700;
}

.profile-policy-bottom {
  margin: 18px 0 84px;
  text-align: center;
}

.profile-billing {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.chat-panel {
  min-height: 58vh;
}

.chat-inbox {
  display: block;
  height: fit-content;
  min-height: 0;
  max-height: calc(100vh - 132px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.chat-inbox-row {
  position: relative;
  overflow: hidden;
  height: 70px;
  border-bottom: 1px solid rgba(255, 143, 184, 0.24);
  background: transparent;
}

.chat-inbox-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 76px;
  height: 70px;
  border: 0;
  background: #ff3b30;
  color: #fff;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chat-inbox-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 70px;
  min-height: 70px;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  transition: transform 0.2s ease;
}

.chat-inbox-row.swiped .chat-inbox-item {
  transform: translateX(-76px);
}

.chat-inbox-row.swiped .chat-inbox-delete {
  opacity: 1;
  pointer-events: auto;
}

.chat-inbox-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-weight: 900;
}

.chat-avatar-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ff2f4f;
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1;
  padding: 0 4px;
}

.chat-inbox-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.chat-inbox-main strong,
.chat-inbox-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inbox-main small,
.chat-inbox-side time,
.chat-inbox-empty {
  color: var(--muted);
}

.chat-inbox-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  font-size: 0.76rem;
}

.chat-inbox-side em {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.chat-inbox-empty {
  padding: 28px 12px;
  text-align: center;
}

.chat-panel.expanded .chat-inbox {
  display: none;
}

.chat-panel:not(.expanded) .chat-window-section {
  display: none !important;
}

.chat-launch {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 143, 184, 0.42);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(255, 111, 165, 0.12);
}

.chat-launch strong {
  font-size: 1.08rem;
}

.chat-launch span {
  color: var(--muted);
  line-height: 1.45;
}

.chat-window-section {
  display: none;
}

.chat-panel.expanded .chat-launch {
  display: none;
}

.chat-panel.expanded .chat-window-section {
  display: flex;
}

.chat-panel.expanded .chat-peer-card,
.chat-panel.expanded .chat-plus-panel,
.chat-panel.expanded .chat-thread,
.chat-panel.expanded .chat-form {
  display: grid;
}

.chat-panel.expanded .media-status {
  display: block;
}

.chat-panel.expanded {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0;
  background: #f4f4f4;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}

.chat-panel.expanded .chat-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 4px 12px;
}

.chat-panel.expanded .chat-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.chat-peer-gender {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-peer-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.chat-plus-panel {
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 4px;
}

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

.chat-plus-action {
  width: 100%;
  min-height: 58px;
  gap: 5px;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
}

.plus-mark {
  display: none;
}

.chat-translate-bar {
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 8px 4px;
}

.chat-translate-bar select {
  min-height: 40px;
}

.bluetooth-remote-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 143, 184, 0.28);
  border-radius: 8px;
  background: #fff7fa;
  padding: 10px;
}

.remote-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.remote-panel-head strong,
.remote-panel-head span {
  display: block;
}

.remote-panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.remote-mode-row,
.remote-actions,
.remote-command-row,
.remote-control-pad,
.remote-slider-row {
  display: grid;
  gap: 8px;
}

.remote-mode-row {
  grid-template-columns: 1fr 1fr;
}

.remote-command-row {
  grid-template-columns: 82px 1fr auto;
}

.remote-actions {
  grid-template-columns: repeat(3, 1fr);
}

.remote-control-pad {
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255, 143, 184, 0.28);
  border-radius: 8px;
  background: #fff7fa;
  padding: 8px;
}

.remote-control-pad button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.remote-control-pad button:disabled,
.remote-slider-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.remote-slider-row {
  grid-template-columns: 44px 1fr auto;
  align-items: center;
}

.remote-slider-row input[type="range"] {
  padding: 0;
}

.remote-mode {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.remote-mode.active {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}

.remote-device-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.remote-auto-connect {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.remote-auto-connect input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.remote-device-fields[hidden] { display: none; }
.remote-device-fields label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.remote-device-fields input, .remote-device-fields select { width: 100%; box-sizing: border-box; }
.remote-device-fields small { color: var(--muted); line-height: 1.5; }
.remote-protocol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.chat-panel.expanded .chat-peer-card {
  border-radius: 0;
  border-width: 0 0 1px;
}

.chat-thread {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 420px;
  max-height: 58vh;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #f4f4f4;
  padding: 12px;
}

.chat-panel.expanded .chat-thread {
  min-height: 0;
  max-height: none;
}

.chat-message {
  max-width: 78%;
  border-radius: 6px;
  background: #fff;
  border: 0;
  padding: 8px 10px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.chat-message.mine {
  justify-self: end;
  background: #ff7fb2;
  color: white;
}

.chat-message.unread {
  box-shadow: 0 0 0 2px rgba(255, 111, 165, 0.18);
}

.chat-message span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.chat-message.mine span {
  color: rgba(255, 255, 255, 0.78);
}

.chat-message p {
  margin: 0;
  line-height: 1.45;
}

.message-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

.message-tools .message-read-state {
  display: inline-flex;
  align-items: center;
  margin: 0 auto 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.translate-message {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--coral);
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.recall-message {
  margin-left: 0;
}

.ephemeral-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.one-time-image-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}

.chat-message:not(.mine) .one-time-image-state {
  border-color: var(--line);
}

.one-time-image-icon {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 38px;
  flex: 0 0 46px;
  margin: 0;
}

.photo-half {
  position: absolute;
  inset-block: 0;
  width: 50%;
  border: 2px solid currentColor;
  background: linear-gradient(145deg, #fff8fb, #ffd1e2);
}

.photo-left {
  left: 0;
  border-right: 0;
  border-radius: 7px 0 0 7px;
  clip-path: polygon(0 0, 100% 0, 82% 18%, 100% 36%, 78% 54%, 100% 72%, 84% 100%, 0 100%);
}

.photo-right {
  right: 0;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  clip-path: polygon(16% 0, 100% 0, 100% 100%, 16% 100%, 0 72%, 22% 54%, 0 36%, 18% 18%);
}

.one-time-image-state.intact .photo-left,
.one-time-image-state.intact .photo-right {
  clip-path: none;
}

.one-time-image-state.intact .photo-left {
  border-right: 0;
}

.one-time-image-state.intact .photo-right {
  border-left: 0;
}

.one-time-image-state.destroyed .photo-left {
  transform: translate(-3px, 2px) rotate(-8deg);
}

.one-time-image-state.destroyed .photo-right {
  transform: translate(3px, -2px) rotate(8deg);
}

.photo-sun {
  position: absolute;
  top: 8px;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.72;
}

.one-time-image-label {
  margin: 0;
  font-weight: 800;
}

.chat-message.recalled {
  opacity: 0.82;
}

.chat-message.recalled p {
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-message.mine .translate-message {
  border-color: rgba(255, 255, 255, 0.56);
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.translated-message {
  margin-top: 7px;
  border-left: 3px solid var(--gold);
  padding-left: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-message.mine .translated-message {
  color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(255, 255, 255, 0.72);
}

.remote-message:empty {
  display: none;
}

.remote-message-card {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  border: 1px solid rgba(255, 211, 110, 0.82);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  padding: 10px;
}

.remote-message-card strong,
.remote-message-card span {
  display: block;
}

.remote-message-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}

.remote-message-card .ghost-button {
  min-height: 34px;
}

.chat-attachment {
  display: block;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
  border-radius: 8px;
}

.chat-attachment.image,
.chat-attachment.video {
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.chat-attachment.audio {
  width: min(260px, 100%);
  height: 42px;
}

.secure-media {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.zoomable-image {
  cursor: zoom-in;
}

.zoomable-image:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(18, 12, 16, 0.94);
  touch-action: none;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}

.image-viewer-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 76px 18px 96px;
  pointer-events: none;
}

.image-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform 160ms ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

.image-viewer-toolbar {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.image-viewer-toolbar button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #ffe1ec;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.image-viewer-toolbar output {
  min-width: 54px;
  color: var(--ink);
  text-align: center;
  font-weight: 800;
}

body.image-viewer-open {
  overflow: hidden;
}

.billing-status-attention {
  animation: billing-status-pulse 0.8s ease-in-out 2;
}

@keyframes billing-status-pulse {
  50% { color: #d91f6b; transform: scale(1.02); }
}

.ephemeral-attachment {
  margin-top: 8px;
}

.ephemeral-open {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--coral);
  padding: 0 12px;
  font-weight: 800;
}

.ephemeral-broken {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px;
  font-size: 0.86rem;
}

.chat-form {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: #f7f7f7;
  border-top: 1px solid var(--line);
  padding: 8px;
}

.chat-form input {
  height: 44px;
  min-height: 44px;
}

.chat-form button,
.media-picker,
.ghost-button {
  height: 44px;
  min-height: 44px;
  padding: 0 13px;
  display: inline-grid;
  place-items: center;
  background: var(--coral);
  color: white;
  font: inherit;
  font-weight: 800;
}

.chat-plus-button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.45rem;
  line-height: 1;
}

.ghost-button,
.media-picker {
  background: #fff0f5;
  color: var(--coral);
  border: 1px solid #ffc4d7;
}

.chat-panel.expanded {
  background: var(--paper);
  grid-template-rows: auto 1fr auto auto;
  padding: 0;
  top: 0 !important;
  align-content: stretch;
}

.chat-panel.expanded .chat-head {
  order: 1;
}

.chat-panel.expanded .chat-thread {
  order: 2;
}

.chat-panel.expanded .chat-form {
  order: 3;
}

.chat-panel.expanded .chat-head {
  min-height: 54px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  text-align: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.chat-title-wrap {
  grid-column: 2;
  min-width: 0;
}

.chat-panel.expanded .chat-head h2 {
  justify-content: center;
  width: 100%;
  font-size: 1rem;
}

.chat-back-button {
  grid-column: 1;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.chat-block-button {
  grid-column: 3;
  justify-self: end;
  width: auto;
  height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-block-label {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(75, 36, 52, 0.45);
}

.chat-block-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d8d8d8;
  padding: 3px;
  display: grid;
  align-items: center;
  transition: background 0.2s ease;
}

.chat-block-switch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 32, 0.18);
  transition: transform 0.2s ease;
}

.chat-block-button.active .chat-block-track {
  background: var(--coral);
}

.chat-block-button.active .chat-block-switch {
  transform: translateX(20px);
}

.chat-panel.expanded .chat-thread {
  gap: 14px;
  padding: 14px 12px 18px;
  background: var(--paper);
}

.chat-message {
  width: fit-content;
  max-width: min(78%, 340px);
  margin-left: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.chat-message::before {
  content: "";
  position: absolute;
  left: -42px;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d8ecff, #fff);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-message::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  border-width: 6px 7px 6px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}

.chat-message.mine {
  justify-self: end;
  margin-right: 42px;
  margin-left: 0;
  background: #ff8fbd;
  color: #111;
}

.chat-message.mine::before {
  right: -42px;
  left: auto;
  background: linear-gradient(135deg, #ffd4e4, #fff);
}

.chat-message.mine::after {
  right: -6px;
  left: auto;
  border-width: 6px 0 6px 7px;
  border-color: transparent transparent transparent #ff8fbd;
}

.chat-message-avatar {
  position: absolute;
  z-index: 2;
  left: -42px;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 143, 184, 0.35);
  background: #fff;
}

.chat-message.mine .chat-message-avatar {
  right: -42px;
  left: auto;
}

.chat-inbox-avatar {
  overflow: hidden;
}

.chat-inbox-avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-message span,
.chat-message.mine span {
  color: rgba(0, 0, 0, 0.42);
  text-align: center;
  font-size: 0.68rem;
  margin-bottom: 5px;
}

.chat-message p {
  font-size: 0.96rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message.mine .translate-message {
  border-color: rgba(0, 0, 0, 0.08);
  color: #9c2856;
  background: rgba(255, 255, 255, 0.5);
}

.chat-message.mine .translated-message {
  color: rgba(0, 0, 0, 0.62);
  border-left-color: rgba(0, 0, 0, 0.16);
}

.chat-panel.expanded .chat-plus-panel {
  order: 4;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--paper);
  padding: 10px 12px;
}

.chat-panel.expanded .chat-form {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 8px 10px;
}

.chat-form input {
  border-color: transparent;
  border-radius: 4px;
  background: #fff;
}

.chat-plus-button {
  border-radius: 50%;
  background: #fff;
  color: #555;
  border: 1px solid #d6d6d6;
}

.chat-form button[type="submit"] {
  border-radius: 4px;
  background: #fff;
  color: #666;
  border: 1px solid #d6d6d6;
}

.chat-form button[type="submit"]:active {
  background: #ececec;
}

.voice-mode-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50% !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: #727272 !important;
  padding: 0 !important;
  font-size: 1.12rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.voice-mode-icon {
  display: block;
  width: 27px;
  height: 27px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-keyboard-icon {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.voice-hold-button {
  width: 100%;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--ink) !important;
  padding: 0 14px !important;
  font-weight: 800;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.voice-hold-button.recording {
  border-color: var(--coral) !important;
  background: var(--coral) !important;
  color: #fff !important;
  transform: scale(0.98);
}

.chat-media-status {
  min-height: 0;
  margin: 0;
  padding: 4px 12px;
  text-align: center;
}

.media-status {
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 20px;
}

.avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff6fa5, #ffb6cf);
  color: white;
  font-weight: 800;
  overflow: hidden;
}

.avatar-button {
  border: 0;
  cursor: pointer;
}

.avatar-button:active {
  transform: scale(0.98);
}

.avatar.has-image {
  background: #fff;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.stats-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.earning-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(255, 143, 184, 0.32);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
}

.earning-panel span,
.earning-panel small {
  display: block;
  color: var(--muted);
}

.earning-panel strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 1.35rem;
}

.earning-panel small {
  font-size: 0.78rem;
  line-height: 1.45;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .phone-frame {
    min-height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-left: 20px;
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .side-rail {
    position: fixed;
    z-index: 70;
    inset: auto 12px calc(0px + env(safe-area-inset-bottom, 0px));
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    width: auto;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 32px rgba(16, 24, 32, 0.18);
  }

  .brand-mark {
    display: none;
  }

  .rail-button {
    width: 64px;
    min-height: 44px;
  }

  .chat-panel.expanded {
    inset: 0 0 calc(78px + env(safe-area-inset-bottom, 0px)) 0;
    padding-bottom: 12px;
  }

  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    align-items: start;
  }
}

/* Keep the conversation header and composer anchored while only messages scroll. */
.chat-panel.expanded {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "chat-header"
    "chat-thread"
    "chat-composer"
    "chat-tools";
  overflow: hidden;
}

.chat-panel.expanded .chat-head {
  grid-area: chat-header;
  order: initial;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
}

.chat-panel.expanded .chat-thread {
  grid-area: chat-thread;
  order: initial;
  min-height: 0;
  overflow-y: auto;
}

.chat-panel.expanded .chat-form {
  grid-area: chat-composer;
  order: initial;
  position: relative;
  z-index: 15;
}

.chat-panel.expanded .chat-plus-panel {
  grid-area: chat-tools;
  position: relative;
  z-index: 18;
  right: auto;
  bottom: auto;
  left: auto;
  max-height: min(58vh, 440px);
  overflow-y: auto;
}

.chat-panel.expanded .chat-media-status {
  position: absolute;
  z-index: 21;
  top: 58px;
  right: 12px;
  left: 12px;
  pointer-events: none;
}

.chat-message-avatar[role="button"] {
  cursor: pointer;
}

.chat-message-avatar[role="button"]:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

/* One-time image: only the image remains; after viewing it becomes a torn image. */
.ephemeral-attachment.ephemeral-image {
  width: 190px;
  height: 120px;
  overflow: hidden;
  border-radius: 10px;
}

.ephemeral-image .ephemeral-open,
.ephemeral-image .chat-attachment.image,
.ephemeral-image .one-time-image-state {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
}

.ephemeral-image .chat-attachment.image {
  object-fit: cover;
}

.ephemeral-image .one-time-image-state {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff4f8, #ffd9e8);
}

.ephemeral-image .one-time-image-icon {
  width: 104px;
  height: 78px;
  flex-basis: 104px;
}

.peer-profile-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.peer-profile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(58, 20, 36, 0.38);
}

.peer-profile-card {
  position: relative;
  z-index: 1;
  width: min(320px, 88vw);
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: 30px 24px 24px;
  box-shadow: 0 24px 60px rgba(70, 23, 43, 0.24);
}

.peer-profile-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
}

.peer-profile-avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background-color: #ffd5e5;
  background-position: center;
  background-size: cover;
  color: white;
  font-size: 1.5rem;
  font-weight: 900;
}

.peer-profile-card strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.peer-profile-card span,
.peer-profile-card p {
  margin: 0;
  color: var(--muted);
}
