/*
 * Furtiva rooms — the mobile-first chat UI (/c/{code}) plus the room pieces on
 * the landing page and the offline page.
 *
 * Designed at ~360 px first and enhanced upward. Reuses the tokens from
 * styles.css (warm porcelain, one muted plum, Fraunces/Inter/Caveat; the dark
 * tokens flip with prefers-color-scheme), 44 px+ touch targets, safe-area
 * insets (viewport-fit=cover), and no hover-only affordances: every action
 * is a tap.
 */

/* ── Shared building blocks ──────────────────────────────────────────────── */

/* Component display rules (.btn, .menu-item…) must not win over the hidden
   attribute — scoped to the room pieces so the sender app keeps its markup as is. */
.room-body [hidden],
dialog.sheet [hidden],
.install-hint [hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}
.icon-btn:active {
  background: var(--plum-soft);
}
.icon-btn:focus-visible,
.link-btn:focus-visible,
.menu-item:focus-visible,
.action:focus-visible,
.banner-btn:focus-visible,
.jump:focus-visible,
.bubble:focus-visible,
.play-tile:focus-visible,
.once-tile:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}
.icon-btn.small {
  width: 40px;
  height: 40px;
}
.icon-btn.small .icon {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .icon-btn:hover {
    background: var(--plum-softer);
  }
}

.link-btn {
  min-height: 32px;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--plum-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.btn.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: none;
  border-color: transparent;
}

.field-label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card-soft);
  color: var(--ink);
  font: inherit;
  /* 16 px keeps iOS from zooming the page when the field takes focus. */
  font-size: 16px;
  line-height: 1.4;
}
textarea.field {
  resize: vertical;
}
.field:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 1px;
}
.field-error {
  min-height: 1.2em;
  margin: 0.55rem 0 0.4rem;
  font-size: 0.86rem;
  color: var(--danger);
}
.field-ok {
  min-height: 1.2em;
  margin: 0.4rem 0;
  font-size: 0.86rem;
  color: var(--plum-deep);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 44px;
  margin: 0.8rem 0 0.2rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}
.check[hidden] {
  display: none;
}
.check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0.05rem 0 0;
  accent-color: var(--btn-bg);
}
.check-sub {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.idle-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* Bottom sheets (native <dialog>: focus trap, Esc and the backdrop come free). */
dialog.sheet {
  width: min(100%, 32rem);
  max-width: 100%;
  max-height: 90dvh;
  margin: auto auto 0;
  padding: 1rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  overscroll-behavior: contain;
}
dialog.sheet::backdrop {
  background: rgba(20, 10, 16, 0.55);
}
dialog.sheet[open] {
  animation: sheet-in 0.26s var(--ease-out);
}
@media (min-width: 640px) {
  dialog.sheet {
    margin: auto;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--line);
    border-radius: 26px;
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.sheet-head h2 {
  margin: 0;
  font-size: 1.35rem;
}
.sheet-text {
  margin: 0.4rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.sheet-text.small {
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.sheet-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.sheet-actions .btn {
  flex: 1;
}
.link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
}
.link-box .field {
  min-width: 0;
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(92vw, 26rem);
  padding: 0.7rem 1.1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-size: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow-2);
}
.toast[hidden] {
  display: none;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 0.35rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.tint-0 { background: #ecdfe4; color: #5e3546; }
.tint-1 { background: #e6d6c6; color: #5a4128; }
.tint-2 { background: #dbe6dc; color: #2f4d36; }
.tint-3 { background: #e0e1ee; color: #373b66; }
.tint-4 { background: #f1dcd5; color: #7a3f31; }
.tint-5 { background: #e8e0c9; color: #5d5223; }
@media (prefers-color-scheme: dark) {
  .tint-0 { background: rgba(213, 162, 177, 0.22); color: #f0cdd7; }
  .tint-1 { background: rgba(214, 190, 160, 0.2); color: #ead9c1; }
  .tint-2 { background: rgba(160, 205, 168, 0.2); color: #cfe7d3; }
  .tint-3 { background: rgba(160, 165, 225, 0.22); color: #d3d6f3; }
  .tint-4 { background: rgba(235, 160, 140, 0.2); color: #f4cfc4; }
  .tint-5 { background: rgba(222, 205, 140, 0.2); color: #ebe0b4; }
}

/* ── Room page frame ─────────────────────────────────────────────────────── */

.room-body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ground);
}
/* The app is as tall as the *visual* viewport (room-app.js keeps --vvh/--vvt in
   sync), so the composer rides on top of the on-screen keyboard. */
.app {
  position: fixed;
  top: var(--vvt, 0px);
  left: 0;
  right: 0;
  height: var(--vvh, 100dvh);
  display: flex;
  flex-direction: column;
}
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.screen[hidden],
.room-chat[hidden] {
  display: none;
}
.screen-center {
  justify-content: center;
  gap: 0.75rem;
  color: var(--ink-soft);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--plum-soft);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  width: min(100%, 28rem);
  margin: auto;
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow-2);
}
.card h1 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(1.6rem, 7vw, 2rem);
}
.card-center {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  text-align: center;
}
.card-center p {
  margin: 0;
  color: var(--ink-soft);
}
.card-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--plum-deep);
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
}
.card-brand .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}
.card .eyebrow {
  margin: 0.8rem 0 0;
}
.ended-mark {
  font-size: 2.6rem;
  line-height: 1;
}
.facts {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  padding: 0;
}
.facts li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.facts .icon {
  color: var(--plum);
}
.notice {
  margin: 0.6rem 0;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-size: 0.92rem;
}
.fine-print {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
  line-height: 1.5;
}
.legal-links {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.legal-links a {
  display: inline-block;
  min-height: 32px;
  line-height: 32px;
}

/* ── Chat ────────────────────────────────────────────────────────────────── */

.room-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ground);
}
.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: max(0.35rem, env(safe-area-inset-top)) max(0.4rem, env(safe-area-inset-right)) 0.35rem max(0.4rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.chat-title {
  flex: 1;
  min-width: 0;
  padding: 0 0.2rem;
}
.chat-title h1 {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-sub {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.banner {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  background: var(--plum-soft);
  color: var(--plum-deep);
  font-size: 0.85rem;
  text-align: center;
}
.banner[hidden] {
  display: none;
}
.banner-warn {
  background: color-mix(in srgb, var(--danger) 14%, var(--ground));
  color: var(--danger);
}
.banner-btn {
  min-height: 36px;
  padding: 0 0.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.log-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.log {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0.75rem max(0.7rem, env(safe-area-inset-right)) 0.5rem max(0.7rem, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.log > :first-child {
  margin-top: auto;
}
.row {
  display: flex;
}
.row.cont {
  margin-top: -0.3rem;
}
.row-me {
  justify-content: flex-end;
}
.row-sys {
  justify-content: center;
}
.sys-pill {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: var(--plum-softer);
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-align: center;
}
.col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: min(84%, 28rem);
}
.row-me .col {
  align-items: flex-end;
}
.who {
  display: flex;
  align-items: center;
  margin: 0 0 0.2rem 0.3rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
}
.bubble {
  position: relative;
  max-width: 100%;
  padding: 0.5rem 0.8rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.row-me .bubble {
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
  background: var(--btn-bg);
  color: var(--btn-ink);
}
.row.cont.row-them .bubble {
  border-top-left-radius: 6px;
}
.row.cont.row-me .bubble {
  border-top-right-radius: 6px;
}
.text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  line-height: 1.2;
  opacity: 0.72;
}
.ticks {
  display: inline-flex;
}
.row-more {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -14px 0 -14px -8px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.row-more .icon {
  width: 18px;
  height: 18px;
}
.ticks .icon {
  width: 15px;
  height: 15px;
}
.row-me[data-delivery="seen"] .ticks {
  opacity: 1;
  filter: drop-shadow(0 0 0.5px currentColor);
}
.row.is-pending .bubble {
  opacity: 0.8;
}
.row.is-failed .bubble {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}
.failed-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.25rem;
  color: var(--danger);
  font-size: 0.78rem;
}
.failed-line .link-btn {
  color: var(--danger);
}
.seen-line {
  margin-top: 0.15rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
}
.receipt {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  opacity: 0.85;
}
.row.is-selected .bubble {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.action .icon {
  width: 18px;
  height: 18px;
}
.action.danger {
  color: var(--danger);
}

/* Media bubbles */
.row-media .bubble {
  padding: 4px 4px 0.3rem;
}
.row-media .receipt,
.row-media .meta {
  padding: 0 0.45rem;
}
.media-frame {
  position: relative;
  width: min(68vw, 17rem);
  max-height: min(58dvh, 26rem);
  overflow: hidden;
  border-radius: 14px;
  background: var(--card-soft);
}
.row-me .media-frame {
  background: color-mix(in srgb, var(--btn-ink) 22%, transparent);
}
.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.media-frame video {
  cursor: auto;
  background: #000;
}
.skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--ink) 9%, transparent) 50%, transparent 80%) var(--card-soft);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}
.media-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
}
.play-tile,
.once-tile {
  font: inherit;
  cursor: pointer;
}
.play-tile {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: linear-gradient(160deg, #3a2a35, #1b1219);
  color: #fff;
}
.play-disc,
.once-disc {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.play-disc .icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}
.play-label {
  font-size: 0.8rem;
  opacity: 0.85;
}
.once-holder {
  width: min(68vw, 17rem);
}
.once-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 132px;
  padding: 0.8rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--card-soft);
  color: var(--ink);
}
.once-tile:disabled {
  opacity: 0.6;
}
.once-tile.is-spent {
  cursor: default;
  opacity: 0.65;
}
.once-disc {
  background: var(--plum-soft);
  color: var(--plum-deep);
}
.once-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.once-sub {
  color: var(--ink-soft);
  font-size: 0.76rem;
}
.once-open {
  max-height: min(58dvh, 26rem);
}
/* Someone else's photo/video that was deleted or viewed by everyone: a
   placeholder that keeps the report action. */
.removed-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
}
.removed-note svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.once-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.2rem 0;
  font-size: 0.78rem;
}
.upload-veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: rgba(20, 10, 16, 0.55);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}
.upload-veil progress {
  width: 70%;
  height: 6px;
  accent-color: #fff;
}
.veil-actions {
  display: flex;
  gap: 0.4rem;
}
.media-frame.is-uploading img,
.media-frame.is-uploading video {
  cursor: default;
}

.jump {
  position: absolute;
  right: 0.8rem;
  bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 1rem 0 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--plum-deep);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.jump[hidden] {
  display: none;
}
.typing {
  flex: none;
  min-height: 1.4rem;
  margin: 0;
  padding: 0 max(1rem, env(safe-area-inset-left));
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.4rem;
}

/* Composer: bottom-anchored, safe-area aware */
.room-composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  padding: 0.4rem max(0.5rem, env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--ground);
}
.kb-open .room-composer {
  padding-bottom: 0.5rem;
}
.composer-field {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--card);
}
.composer-field:focus-within {
  border-color: var(--plum);
}
.composer-field textarea {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 22px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
}
.composer-field textarea:focus {
  outline: none;
}
.composer-send {
  background: var(--btn-bg);
  color: var(--btn-ink);
}
.composer-send:active {
  background: var(--btn-bg-hover);
}
.composer-send:disabled {
  opacity: 0.4;
  cursor: default;
}
.composer-attach {
  color: var(--plum-deep);
}

/* Menu, members, media preview */
.menu-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 52px;
  padding: 0 0.4rem;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
.menu-item[hidden] {
  display: none;
}
.menu-item:active {
  background: var(--plum-softer);
}
.menu-item .icon {
  color: var(--plum-deep);
}
.ttl-list .menu-item {
  justify-content: space-between;
}
.ttl-list .menu-item .icon {
  visibility: hidden;
}
.ttl-list .menu-item[aria-pressed="true"] {
  font-weight: 600;
}
.ttl-list .menu-item[aria-pressed="true"] .icon {
  visibility: visible;
}
.menu-item.danger,
.menu-item.danger .icon {
  color: var(--danger);
}
.menu-foot {
  margin-top: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.menu-foot .lang-select {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--card);
}
.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.member {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}
.member:last-child {
  border-bottom: 0;
}
.member .avatar {
  width: 34px;
  height: 34px;
  margin: 0;
  font-size: 0.9rem;
}
.member-name {
  flex: 1;
  min-width: 0;
}
.member-nick {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-tags {
  display: block;
  color: var(--ink-faint);
  font-size: 0.78rem;
}
.presence {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.presence.is-online {
  background: #4aa66b;
}
.media-preview {
  display: grid;
  place-items: center;
  max-height: 46dvh;
  overflow: hidden;
  border-radius: 16px;
  background: var(--card-soft);
}
.media-preview img,
.media-preview video {
  display: block;
  max-width: 100%;
  max-height: 46dvh;
}

dialog.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 4, 8, 0.97);
}
dialog.lightbox::backdrop {
  background: rgba(8, 4, 8, 0.97);
}
dialog.lightbox img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: pinch-zoom;
}
.lightbox-close {
  position: absolute;
  z-index: 2;
  top: max(0.6rem, env(safe-area-inset-top));
  right: max(0.6rem, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ── Landing page pieces ─────────────────────────────────────────────────── */

.room-entry {
  margin-top: 1.1rem;
}
.room-entry-or {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 0.8rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-transform: lowercase;
}
.room-entry-or::before,
.room-entry-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.room-entry-hint {
  margin: 0.6rem 0 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-align: center;
}
.install-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 1.2rem 0 0;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--plum-softer);
  font-size: 0.92rem;
}
.install-hint[hidden],
.rooms-section[hidden] {
  display: none;
}
.install-hint-text {
  flex: 1 1 14rem;
}
.install-hint-actions {
  display: flex;
  gap: 0.3rem;
}
.shared-options {
  display: grid;
  gap: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open],
  .spinner,
  .skeleton {
    animation: none;
  }
}
