.chat-page {
  position: relative;
  max-width: 780px;
  height: calc(100dvh - 94px);
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-head {
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.chat-head > a {
  font-size: 30px;
  color: var(--muted);
}
.chat-head > div {
  display: flex;
  gap: 11px;
  align-items: center;
}
.chat-head strong,
.chat-head small {
  display: block;
}
.chat-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.chat-head time {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.anonymous-dot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-weight: 700;
}
.matched-pill {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  font-weight: 700;
}
.chat-head.profile img {
  width: 43px;
  height: 43px;
  border-radius: 16px;
  object-fit: cover;
}
.chat-head.profile {
  grid-template-columns: 32px 44px 1fr auto;
}
.chat-head.profile > div {
  display: block;
}
.privacy-note,
.owner-status {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  font-size: 11px;
}
.owner-status {
  color: var(--ink);
  background: var(--accent-soft);
}
.messages {
  min-height: 0;
  padding: 24px 2px;
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
}
.message {
  max-width: 72%;
  margin: 10px 0;
  display: flex;
  gap: 7px;
  align-items: end;
}
.message.mine {
  margin-left: auto;
  flex-direction: row-reverse;
}
.message p {
  margin: 0;
  padding: 13px 16px;
  border-radius: 20px 20px 20px 6px;
  background: var(--panel);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.mine p {
  color: white;
  background: var(--accent);
  border-radius: 20px 20px 6px;
}
.message time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}
.chat-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}
.chat-empty span {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 700;
}
.chat-empty p {
  font-size: 13px;
}
.chat-actions {
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
  background: white;
}
.chat-actions form {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  align-items: end;
}
.chat-actions textarea {
  min-height: 48px;
  max-height: 110px;
  padding: 13px 15px;
  resize: none;
}
.chat-actions form button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--accent);
  font-size: 22px;
  cursor: pointer;
}
.share-check {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}
.share-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}
.like-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.like-row .button {
  min-height: 42px;
  flex: 1;
}
.text-button,
.test-jump {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  min-height: 44px;
  cursor: pointer;
}
.danger {
  color: var(--danger) !important;
}
.test-jump {
  padding: 5px;
  color: var(--muted);
  border: 1px dashed var(--control-line);
  border-radius: 8px;
}
.reveal-card {
  margin: 14px 0 0;
  padding: 14px;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 15px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--warm));
}
.reveal-card img {
  width: 82px;
  height: 92px;
  border-radius: 17px;
  object-fit: cover;
}
.reveal-card span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.reveal-card h2 {
  margin: 4px 0;
}
.reveal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.reveal-card .reveal-action {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 15px;
  font-size: 12px;
}
.ending-card {
  margin: 14px 0 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
}
.ending-card span {
  font-weight: 700;
}
.ending-card p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.room-menu {
  position: absolute;
  z-index: 5;
  right: 24px;
  top: 68px;
  width: 170px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}
.room-menu.hidden {
  display: none;
}
.room-menu button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.room-menu button:hover {
  background: var(--panel);
}
.more {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.excerpt {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--paper);
  font-size: 12px;
}
.excerpt summary {
  color: var(--accent-dark);
  cursor: pointer;
}
.excerpt .message {
  max-width: 90%;
}
.list-page {
  max-width: 760px;
  padding-top: 50px;
}
.list-page > h1 {
  font-size: clamp(36px, 5vw, 54px);
}
.room-list {
  margin-top: 30px;
  padding: 10px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow);
}
.list-page details {
  margin-top: 26px;
}
.list-page details > summary {
  color: var(--muted);
  cursor: pointer;
}
.switch-row {
  min-height: 74px;
  padding: 14px 16px;
  grid-template-columns: 1fr auto !important;
  align-items: center !important;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
}
.switch-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}
.switch-row input {
  width: 46px;
  height: 25px;
  min-height: 0;
  accent-color: var(--accent);
}
.settings-list {
  margin-top: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}
.settings-list a,
.settings-list button {
  width: 100%;
  min-height: 60px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.settings-list > :last-child {
  border-bottom: 0;
}
.settings-list b {
  color: var(--muted);
  font-size: 22px;
}
.policy-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}
.error-face {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 28px;
  font-weight: 700;
}
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  width: max-content;
  max-width: min(440px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  font-size: 0.9375rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.toast.danger {
  background: var(--surface, white);
  color: var(--ink);
  border: 1px solid var(--danger);
  padding: 8px 8px 8px 16px;
}
.toast-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
