.conversation-layout {
  height: calc(var(--viewport-height, 100dvh) - var(--chrome-height, 148px));
  min-height: min(480px, 70dvh);
  max-width: 800px;
  margin: auto;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  overflow: hidden;
}
.conversation-layout.is-revealed {
  max-width: 1120px;
}
.conversation-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: white;
  position: relative;
}
.conversation-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}
.back-button {
  display: grid;
  place-items: center;
  font-size: 32px;
  min-width: 44px;
  height: 44px;
}
.conversation-heading {
  flex: 1;
}
.conversation-heading strong, .room-person strong {
  font-size: 1rem;
}
.conversation-heading small, .room-person small {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 6px;
}
.chat-timer {
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 9px 13px;
  font-size: 14px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}
.conversation-notice {
  margin: 0;
  text-align: center;
  padding: 14px 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  background: var(--paper);
}
.conversation-pane .messages {
  flex: 1;
  min-height: 0;
  padding: 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  overflow-anchor: none;
}
.conversation-pane .message {
  margin: 0;
  max-width: 80%;
}
.message p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.65;
}
.conversation-composer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: white;
}
.composer {
  display: flex;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--control-line);
  border-radius: 24px;
  background: var(--paper);
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 110px;
  min-height: 44px;
  padding: 11px 0;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  font-size: 1rem;
  line-height: 1.5;
}
.composer button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 23px;
  cursor: pointer;
}
.composer button:disabled {
  background: var(--control-line);
}
.like-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.like-controls button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
}
.like-controls small {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.sharing-options {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.875rem;
}
.sharing-options summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
}
.sharing-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  line-height: 1.5;
}
.sharing-options input {
  width: 18px;
  height: 18px;
  min-height: 0;
}
.sharing-options p {
  font-size: 0.875rem;
}
.safety-menu {
  position: relative;
}
.safety-menu summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 16px;
  border-radius: 50%;
}
.safety-menu summary::-webkit-details-marker {
  display: none;
}
.safety-menu summary:hover {
  background: var(--accent-soft);
}
.safety-menu > div {
  position: absolute;
  top: 48px;
  right: 0;
  width: 180px;
  z-index: 10;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}
.safety-menu button {
  display: block;
  padding: 14px;
  width: 100%;
  text-align: left;
  border: 0;
  background: white;
  cursor: pointer;
}
.reveal-panel {
  width: 320px;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: var(--paper);
  overflow: auto;
}
.reveal-panel > h2 {
  line-height: 1.5;
  font-size: 18px;
}
.reveal-panel .profile-photo {
  height: auto;
  margin-top: 24px;
}
.reveal-explanation {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.profile-open {
  min-height: 44px;
  color: var(--accent-dark);
}
.inbox-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  height: calc(var(--viewport-height, 100dvh) - var(--chrome-height, 148px));
  min-height: min(480px, 70dvh);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: white;
}
.inbox-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.inbox-sidebar > header {
  padding: 22px 24px 12px;
}
.inbox-sidebar h1 {
  font-size: 1.5rem;
  margin: 0;
}
.inbox-sidebar > header > p:last-child, .inbox-list-empty {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.inbox-list {
  overflow: auto;
  padding: 0 12px 20px;
}
.inbox-list-empty {
  padding: 12px;
}
.inbox-room {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 12px;
  margin-bottom: 3px;
}
.inbox-room:hover {
  background: var(--panel);
}
.inbox-room.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 var(--accent);
}
.inbox-room.unread p {
  color: var(--ink);
  font-weight: 600;
}
.inbox-room > img, .room-person img, .closed-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-soft);
}
.inbox-room > div {
  min-width: 0;
  flex: 1;
}
.closed-avatar { display: grid; place-items: center; color: var(--muted); }
.closed-room { height: auto; min-height: 0; align-self: start; }
.older-messages, .more-rooms { display: block; margin: 8px auto 16px; min-height: 44px; }
.inbox-room strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
}
.inbox-room p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.room-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.room-meta time {
  font-size: 0.75rem;
  color: var(--muted);
}
.unread-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.inbox-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background: var(--paper);
}
.inbox-placeholder > span {
  color: var(--accent);
  font-size: 44px;
  margin-bottom: 24px;
}
.inbox-placeholder p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 26px;
}
.room-person {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  flex: 1;
}
.owner-status, .history-link {
  margin: 0;
  padding: 14px 20px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.history-link {
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--accent-dark);
  cursor: pointer;
}
.ended-rooms summary {
  font-size: 12px;
  padding: 14px;
  cursor: pointer;
  color: var(--muted);
}
@media (max-width: 960px) and (min-width: 761px) {
  .inbox-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .conversation-layout, .inbox-layout.has-selection {
    height: calc(var(--viewport-height, 100dvh) - var(--demo-height, 0px));
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
  .conversation-layout.is-revealed {
    flex-direction: column;
  }
  .reveal-panel {
    width: 100%;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 48%;
  }
  .reveal-panel .eyebrow, .desktop-profile {
    display: none;
  }
  .reveal-panel > h2 {
    margin-bottom: 0;
    font-size: 15px;
  }
  .reveal-explanation {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .conversation-header {
    min-height: 70px;
    padding: 10px 12px;
    gap: 8px;
  }
  .conversation-heading small {
    font-size: 0.8125rem;
  }
  .conversation-composer {
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .conversation-pane .messages {
    padding: 20px 16px;
  }
  .inbox-layout {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    height: auto;
    min-height: 60dvh;
    background: transparent;
  }
  .inbox-sidebar {
    border: 0;
  }
  .inbox-sidebar > header {
    padding: 10px 0 18px;
  }
  .inbox-list {
    padding: 0;
  }
  .inbox-layout.has-selection .inbox-sidebar {
    display: none;
  }
  .inbox-placeholder {
    background: transparent;
    padding: 30px 12px;
  }
  .inbox-layout.has-active-rooms .inbox-placeholder {
    display: none;
  }
}
