/* final layout fixes and small components */

.hidden {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.7px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn-danger {
  --btn-bg: #b6513c;
  --btn-color: #fffaf3;
  box-shadow: 0 12px 24px -16px rgba(151, 60, 42, 0.5);
}

.btn-danger:hover {
  --btn-bg: #a44531;
}

/* the lightbox body is a two-column layout; the arrows sit over the image */
.lb-body {
  grid-template-columns: minmax(0, 1fr) 342px;
}

.lightbox-layer {
  opacity: 1;
  animation: none;
}

.lightbox-scrim {
  background: rgba(22, 24, 18, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(118%);
  backdrop-filter: blur(24px) saturate(118%);
  animation: fade-in 0.28s ease both;
}

.lightbox-shell {
  animation: lb-rise 0.4s var(--ease-out) both;
}

.lightbox-layer .lb-panel {
  align-self: center;
  height: auto;
  max-height: 100%;
  background: rgba(250, 247, 239, 0.95);
  box-shadow: 0 34px 80px -38px rgba(15, 17, 12, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.lightbox-layer .lb-actions {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.lightbox-layer .lb-panel-hint {
  margin-top: 12px;
}

/* make the sheet readable over photography */
.modal-scrim {
  background: rgba(27, 29, 22, 0.48);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
}

.modal {
  background: linear-gradient(158deg, rgba(253, 251, 245, 0.985), rgba(248, 244, 236, 0.975));
  box-shadow: 0 46px 100px -34px rgba(24, 25, 18, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.lightbox-layer .lb-top-label,
.lightbox-layer .lb-counter,
.lightbox-layer .lb-close {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

@keyframes lb-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* hide secondary invite on narrow screens: the dock has its own */
@media (max-width: 760px) {
  .invite-btn {
    display: none !important;
  }

  .room-tools .segmented {
    width: 100%;
  }
}

.lb-image-wrap {
  position: relative;
}

.lb-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
}

.lb-nav.prev {
  left: 14px;
}

.lb-nav.next {
  right: 14px;
}

.lb-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-layer {
  transition: opacity 0.18s ease;
}

/* join modal feels more intentional without an accidental X */
.modal-close[hidden] {
  display: none;
}

/* summary mode switch */
.summary-mode {
  display: inline-flex;
  gap: 2px;
  margin: 1px 0 17px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.summary-mode button {
  height: 31px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
}

.summary-mode button.active {
  color: var(--cream);
  background: var(--olive);
}

/* preview: the room is visible but intentionally behind glass */
.room-page.is-preview .room-main {
  filter: blur(5px) saturate(0.9);
  opacity: 0.62;
  pointer-events: none;
  user-select: none;
}

.room-page.is-preview .mobile-dock,
.room-page.is-preview .upload-fab {
  display: none !important;
}

.room-page.is-preview .room-topbar {
  opacity: 0.8;
}

/* upload status while a batch is compressed */
.upload-preview-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(37, 42, 32, 0.42);
  font-size: 9px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* a more compact dropzone on small screens */
@media (max-width: 760px) {
  .lb-body {
    display: flex;
  }

  .lb-nav {
    position: absolute;
  }

  .summary-mode {
    margin-bottom: 13px;
  }

  .summary-mode button {
    flex: 1;
  }
}

/* video cards and player */
.video-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(100% 100% at 30% 25%, rgba(233, 111, 79, 0.7), transparent 60%),
    linear-gradient(135deg, #314236, #1f2923);
}

.video-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease-out);
}

.photo-card:hover .video-frame img {
  transform: scale(1.025);
}

.video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 23, 18, 0.45), transparent 55%);
}

.video-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #fffdf7;
  background: rgba(27, 30, 23, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.55);
}

.video-play .ico {
  width: 19px;
  height: 19px;
  margin-left: 2px;
}

.photo-hit .video-frame {
  border-radius: 16px;
}

.lb-image-wrap.is-video {
  background: rgba(12, 14, 10, 0.45);
}

.lb-video {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 28px);
  border-radius: 14px;
  background: #111;
  box-shadow: 0 38px 80px -35px rgba(0, 0, 0, 0.75);
}

.lb-original-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.lb-original {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
  font-size: 9.5px;
  transition: background 0.2s ease, color 0.2s ease;
}

.lb-original:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.lb-original .ico {
  width: 13px;
  height: 13px;
}

.lb-original.is-pending,
.lb-original.is-video {
  color: var(--faint);
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  pointer-events: none;
}

.lb-thumb.is-video {
  background: #2c382f;
}

.lb-thumb-type {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  color: rgba(255, 253, 247, 0.82);
  background: linear-gradient(135deg, #3b4a3c, #252e26);
}

.lb-thumb-type .ico {
  width: 15px;
  height: 15px;
}

.lb-thumb.is-video.is-picked::after {
  background: var(--accent);
}

@media (max-width: 760px) {
  .video-play {
    width: 42px;
    height: 42px;
  }

  .lb-video {
    width: 100%;
    max-height: 100%;
  }
}

/* upload picker */
.upload-pick-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  position: relative;
  z-index: 2;
}

.upload-pick-row .btn {
  height: 39px;
  font-size: 11px;
}

.dropzone .btn {
  pointer-events: auto;
}

.upload-preview-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 253, 247, 0.82);
  background: linear-gradient(135deg, #3a4b3c, #1f2922);
}

.upload-preview-fallback .ico {
  width: 20px;
  height: 20px;
}

.upload-preview-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
  padding: 16px 5px 5px;
  color: #fffdf7;
  background: linear-gradient(0deg, rgba(22, 25, 19, 0.7), transparent);
  font-size: 8px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.upload-preview-kind {
  position: absolute;
  z-index: 3;
  left: 4px;
  top: 4px;
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  color: #fffdf7;
  background: rgba(23, 27, 20, 0.48);
  font-size: 7px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.upload-preview.is-video .upload-preview-status {
  background: rgba(28, 32, 24, 0.62);
}

.upload-more {
  margin-top: 8px;
  color: var(--faint);
  font-size: 9px;
  text-align: center;
}

@media (max-width: 760px) {
  .upload-pick-row .btn {
    flex: 1;
    height: 38px;
    padding: 0 10px;
  }

  .upload-preview-name {
    font-size: 7px;
  }
}
.gallery[hidden] {
  display: none !important;
}


/* keep gallery content hidden without leaving a gap */
.gallery[hidden] { display: none !important; }


/* fast preview mode */
.upload-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: -4px 0 13px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.3);
}

.upload-mode-switch button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.upload-mode-switch button strong {
  font-size: 11px;
  font-weight: 560;
}

.upload-mode-switch button span {
  font-size: 8px;
  color: var(--faint);
}

.upload-mode-switch button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px -10px rgba(40, 40, 30, 0.35);
}

.upload-mode-switch button.active span {
  color: var(--muted);
}

@media (max-width: 760px) {
  .upload-mode-switch button {
    padding: 7px 8px;
  }
}

/* update changelog */
.changelog {
  display: grid;
  gap: 7px;
  margin: 4px 0 2px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  line-height: 1.6;
}

.changelog-item .ico {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--accent);
  flex: 0 0 auto;
}

/* =========================================================
   Room chat / music
   ========================================================= */
.chat-trigger {
  position: relative;
}

.chat-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1.5px solid rgba(251, 248, 241, 0.95);
  border-radius: 99px;
  color: #fff;
  background: var(--accent);
  font-size: 8px;
  line-height: 1;
  pointer-events: none;
}

.dock-icon {
  position: relative;
}

.chat-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.chat-layer.is-open {
  opacity: 1;
}

.chat-scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 31, 24, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chat-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(390px, 100%);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: rgba(250, 247, 240, 0.94);
  -webkit-backdrop-filter: blur(34px) saturate(140%);
  backdrop-filter: blur(34px) saturate(140%);
  box-shadow: 0 36px 90px -36px rgba(23, 25, 18, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateX(20px) scale(0.985);
  transition: transform 0.35s var(--ease-out);
}

.chat-layer.is-open .chat-panel {
  transform: translateX(0) scale(1);
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.chat-head h2 {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 590;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.chat-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.chat-close {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.chat-close .ico {
  width: 14px;
  height: 14px;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 96, 80, 0.16) transparent;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
}

.chat-empty .ico {
  width: 27px;
  height: 27px;
  margin-bottom: 12px;
  color: var(--faint);
}

.chat-empty strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
}

.chat-empty span {
  max-width: 230px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 13px;
}

.chat-message .avatar {
  width: 25px;
  height: 25px;
  font-size: 8px;
}

.chat-message.is-mine {
  flex-direction: row-reverse;
}

.chat-bubble-wrap {
  max-width: 82%;
}

.chat-message.is-mine .chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 8px;
}

.chat-meta strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 550;
}

.chat-bubble {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  border-top-left-radius: 4px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
  line-height: 1.65;
  word-break: break-word;
}

.chat-message.is-mine .chat-bubble {
  border-top-left-radius: 13px;
  border-top-right-radius: 4px;
  color: #fffaf2;
  background: var(--olive);
}

.chat-bubble.is-voice {
  padding: 6px 8px;
}

.voice-message {
  display: flex;
  align-items: center;
  gap: 7px;
}

.voice-message .ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  opacity: 0.7;
}

.voice-message audio {
  width: 160px;
  height: 31px;
}

.voice-message span {
  font-size: 8.5px;
  opacity: 0.55;
}

.music-slot {
  flex: 0 0 auto;
  margin: 0 14px 8px;
}

.music-dock {
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.36);
}

.music-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.music-title,
.music-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 540;
}

.music-title .ico {
  width: 14px;
  height: 14px;
  color: #8a7b5e;
}

.music-live {
  color: #7c9875;
}

.music-note {
  color: var(--faint);
  font-size: 8px;
}

.music-dock p {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
}

.music-dock .btn {
  height: 30px;
  padding: 0 10px;
  font-size: 9px;
}

.room-music-audio {
  width: 100%;
  height: 32px;
  margin-top: 8px;
}

.chat-compose {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
}

.voice-btn,
.send-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.voice-btn:hover,
.send-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.voice-btn.is-recording {
  color: #fff;
  background: var(--accent);
  animation: record-pulse 1.4s ease-in-out infinite;
}

.voice-btn .ico,
.send-btn .ico {
  width: 16px;
  height: 16px;
}

.voice-btn span {
  position: absolute;
  bottom: -16px;
  color: var(--accent);
  font-size: 8px;
}

.send-btn {
  color: #fffaf2;
  background: var(--olive);
  border-color: transparent;
}

.send-btn:hover {
  background: var(--olive-soft);
}

.chat-input {
  min-width: 0;
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(64, 70, 58, 0.1);
  border-radius: 99px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  outline: 0;
}

.chat-input:focus {
  border-color: rgba(233, 111, 79, 0.4);
  background: rgba(255, 255, 255, 0.85);
}

.chat-hint {
  flex: 0 0 auto;
  padding: 0 16px calc(10px + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 8px;
  text-align: center;
}

@keyframes record-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 111, 79, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(233, 111, 79, 0); }
}

.lb-processing {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 99px;
  color: #fffdf7;
  background: rgba(20, 23, 18, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 9px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .chat-layer {
    padding: 0;
    align-items: flex-end;
  }

  .chat-panel {
    width: 100%;
    height: 92dvh;
    border-radius: 26px 26px 0 0;
    transform: translateY(30px);
  }

  .chat-head {
    padding: 17px 17px 12px;
  }

  .chat-messages {
    padding: 13px 14px;
  }

  .voice-message audio {
    width: 138px;
  }

  .chat-compose {
    padding: 8px 11px;
  }

  .chat-hint {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .music-slot {
    margin: 0 10px 7px;
  }
}

@media (max-width: 380px) {
  .mobile-dock .dock-icon:nth-of-type(2) {
    display: none;
  }
}

.sort-select {
  height: 30px;
  flex: 0 0 auto;
  padding: 0 27px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  color: var(--ink-soft);
  background-color: rgba(255, 255, 255, 0.42);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c9085' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  font-size: 9.5px;
  appearance: none;
  -webkit-appearance: none;
}

.category-row {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .gallery-note {
    display: none;
  }

  .sort-select {
    margin-left: auto;
    height: 28px;
    font-size: 9px;
  }
}

/* row-major contact-sheet grid: 1 2 3 / 4 5 6 */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-count: initial;
  column-gap: 0;
  gap: 16px;
  align-items: start;
}

.photo-card {
  margin: 0;
  break-inside: auto;
}

.photo-visual,
.video-frame {
  aspect-ratio: 4 / 5 !important;
}

.photo-hit {
  height: 100%;
}

.photo-hit img {
  width: 100%;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover;
}

.video-frame img {
  height: 100% !important;
  object-fit: cover;
}

@media (max-width: 1219px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* device sync small popup */
.device-sync-notice {
  position: fixed;
  z-index: 125;
  right: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(460px, calc(100% - 24px));
  padding: 12px 12px 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(251, 248, 241, 0.94);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 24px 60px -28px rgba(25, 27, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  animation: toast-in 0.4s var(--ease-spring) both;
}

.device-sync-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(158, 172, 152, 0.18);
}

.device-sync-icon .ico {
  width: 15px;
  height: 15px;
}

.device-sync-notice > div:not(.device-sync-actions) {
  min-width: 0;
  flex: 1;
}

.device-sync-notice strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 570;
}

.device-sync-notice p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.device-sync-notice > button[data-dismiss-device-sync] {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--faint);
  background: transparent;
}

.device-sync-notice > button[data-dismiss-device-sync] .ico {
  width: 11px;
  height: 11px;
}

.device-sync-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.device-sync-actions .btn {
  height: 31px;
  padding: 0 10px;
  font-size: 9px;
}

@media (max-width: 760px) {
  .device-sync-notice {
    right: 8px;
    left: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: auto;
    border-radius: 16px;
  }

  .device-sync-actions {
    flex-direction: column;
  }

  .device-sync-actions .btn {
    height: 27px;
    padding: 0 8px;
    font-size: 8px;
  }
}

.transfer-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 6px;
}

.transfer-person {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.34);
  text-align: left;
  transition: background 0.2s ease;
}

.transfer-person:hover {
  background: rgba(255, 255, 255, 0.7);
}

.transfer-person .avatar {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.transfer-person span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.transfer-person strong {
  font-size: 11px;
  font-weight: 550;
}

.transfer-person small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.transfer-person > .ico {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

/* small non-blocking update pill */
.update-notice {
  position: fixed;
  z-index: 124;
  right: 18px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 7px 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(251, 248, 241, 0.92);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
  box-shadow: 0 18px 40px -24px rgba(25, 27, 20, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-size: 9.5px;
  animation: toast-in 0.35s var(--ease-spring) both;
}

.update-notice-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 111, 79, 0.12);
}

.update-notice button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 27px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: #fffaf2;
  background: var(--olive);
  font-size: 9px;
}

.update-notice button .ico {
  width: 11px;
  height: 11px;
}

@media (max-width: 760px) {
  .update-notice {
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

.live-mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
  font-size: 8.5px;
}

.live-mic-btn .ico {
  width: 12px;
  height: 12px;
}

.live-mic-btn.is-on {
  color: #fffaf2;
  border-color: transparent;
  background: #789071;
  box-shadow: 0 0 0 3px rgba(120, 144, 113, 0.13);
}

.live-voice-audio {
  display: none;
}

/* low-end performance */
.photo-card {
  content-visibility: auto;
  contain-intrinsic-size: 360px 440px;
}

.gallery-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 8px;
}

.gallery-more .btn {
  height: 42px;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .photo-card {
    content-visibility: visible;
  }
}

/* =========================================================
   Selection tray / focus mode / forced mobile
   ========================================================= */
.selection-tray {
  position: fixed;
  z-index: 44;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(860px, calc(100% - 48px));
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: rgba(250, 247, 240, 0.83);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  box-shadow: 0 24px 55px -28px rgba(28, 29, 21, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease-out), padding 0.3s var(--ease-out);
}

.tray-handle {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 28px;
  padding: 0 7px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 9px;
  text-align: left;
}

.tray-grab {
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: rgba(62, 68, 55, 0.18);
}

.tray-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 540;
}

.tray-title .ico {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.tray-title strong {
  color: var(--ink);
  font-weight: 600;
}

.tray-hint {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
}

.tray-chevron {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--faint);
  transition: transform 0.3s ease;
}

.tray-chevron .ico {
  width: 12px;
  height: 12px;
}

.selection-tray.is-collapsed .tray-chevron {
  transform: rotate(180deg);
}

.selection-tray.is-collapsed .tray-items {
  display: none;
}

.tray-items {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px 4px 4px;
  scrollbar-width: none;
}

.tray-items::-webkit-scrollbar {
  display: none;
}

.tray-item {
  position: relative;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 11px;
  background: #d9d4c8;
  animation: tray-in 0.4s var(--ease-spring) both;
}

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

.tray-item.is-mine {
  box-shadow: 0 0 0 2px var(--accent);
}

.tray-adder {
  position: absolute;
  z-index: 2;
  right: 3px;
  top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: calc(100% - 6px);
  height: 16px;
  padding: 0 5px;
  overflow: hidden;
  border-radius: 99px;
  color: #fffdf7;
  background: rgba(26, 29, 22, 0.56);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 6.5px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray-adder i {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--adder);
}

.tray-video {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  background: rgba(26, 29, 22, 0.5);
}

.tray-video .ico {
  width: 9px;
  height: 9px;
}

@keyframes tray-in {
  from { opacity: 0; transform: translateY(7px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.focus-reveal {
  position: fixed;
  z-index: 60;
  top: 8px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(250, 247, 240, 0.7);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  font-size: 8px;
}

.focus-reveal span {
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: rgba(60, 65, 52, 0.22);
}

.room-page.is-focus .room-topbar,
.room-page.is-focus .room-intro,
.room-page.is-focus .category-row,
.room-page.is-focus .side-rail,
.room-page.is-focus .mobile-dock,
.room-page.is-focus .upload-fab {
  display: none !important;
}

.room-page.is-focus .room-main {
  width: min(1520px, calc(100% - 32px));
  padding-top: 34px;
  padding-bottom: 130px;
}

.room-page.is-focus .room-grid {
  grid-template-columns: minmax(0, 1fr);
}

.room-page.is-focus .selection-tray {
  bottom: calc(12px + env(safe-area-inset-bottom));
}

/* forced phone-style view on wider screens */
.room-page.is-mobile-forced .room-topbar,
.room-page.is-mobile-forced .room-main {
  width: min(430px, calc(100% - 18px));
  margin-left: auto;
  margin-right: auto;
}

.room-page.is-mobile-forced .room-topbar {
  padding: 7px 9px 7px 12px;
  border-radius: 19px;
}

.room-page.is-mobile-forced .topbar-center,
.room-page.is-mobile-forced .presence-cluster,
.room-page.is-mobile-forced .room-crumb-label {
  display: none;
}

.room-page.is-mobile-forced .room-grid {
  grid-template-columns: minmax(0, 1fr);
}

.room-page.is-mobile-forced .side-rail {
  display: none;
}

.room-page.is-mobile-forced .gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.room-page.is-mobile-forced .invite-btn {
  display: none;
}

.room-page.is-mobile-forced .room-intro {
  align-items: flex-start;
  flex-direction: column;
  gap: 15px;
}

.room-page.is-mobile-forced .room-title {
  font-size: 30px;
}

.room-page.is-mobile-forced .room-tools {
  width: 100%;
}

.room-page.is-mobile-forced .mobile-dock {
  display: flex;
  left: 50%;
  right: auto;
  width: min(410px, calc(100% - 18px));
  transform: translateX(-50%);
}

.room-page.is-mobile-forced .selection-tray {
  width: min(410px, calc(100% - 18px));
  bottom: calc(82px + env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .selection-tray {
    width: calc(100% - 18px);
    bottom: calc(81px + env(safe-area-inset-bottom));
    border-radius: 17px;
  }

  .tray-hint {
    display: none;
  }

  .tray-item {
    width: 58px;
    height: 58px;
  }

  .tray-title {
    font-size: 8.5px;
  }

  .room-page.is-focus .room-main {
    width: calc(100% - 16px);
    padding-top: 30px;
    padding-bottom: 150px;
  }

  .room-page.is-focus .selection-tray {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .focus-toggle {
    display: none;
  }
}

@media (max-width: 760px) {
  .room-topbar [data-open-share],
  .room-topbar .chat-trigger {
    display: none;
  }
}

@media (max-width: 760px) {
  .room-crumbs {
    display: none;
  }

  .focus-toggle {
    display: inline-flex;
  }
}

/* fill the lightbox stage instead of rendering the preview at natural size */
.lightbox-layer .lb-image {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-layer .lb-image-wrap.portrait .lb-image {
  max-width: none;
}

@media (max-width: 760px) {
  .lightbox-layer .lb-image {
    width: calc(100% - 10px);
    height: calc(100% - 10px);
  }
}

.repair-progress {
  position: fixed;
  z-index: 126;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(251, 248, 241, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 40px -24px rgba(28, 29, 21, 0.4);
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
}

.repair-progress .spinner {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.js-gallery-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.music-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.music-actions .btn {
  white-space: nowrap;
}

.music-player {
  display: grid;
  gap: 8px;
}

.music-now {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.music-now strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-now span {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 8px;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.music-control {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
}

.music-control:hover {
  background: rgba(255, 255, 255, 0.85);
}

.music-control.is-main {
  width: 38px;
  height: 38px;
  color: #fffaf2;
  border-color: transparent;
  background: var(--olive);
}

.music-control .ico {
  width: 14px;
  height: 14px;
}

.music-control.is-main .ico {
  width: 17px;
  height: 17px;
}

.music-time {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.music-volume-row {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
}

.music-volume-row > .ico {
  width: 12px;
  height: 12px;
}

.music-volume-row > span:last-child {
  width: 27px;
  font-size: 7.5px;
  text-align: right;
}

.music-volume {
  flex: 1;
  height: 3px;
  accent-color: var(--olive);
}

.music-lyrics {
  display: grid;
  gap: 2px;
  min-height: 54px;
  max-height: 62px;
  overflow: hidden;
  align-content: center;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.35);
}

.music-lyric-line {
  overflow: hidden;
  padding: 1px 0;
  border: 0;
  color: var(--faint);
  background: transparent;
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-lyric-line.is-active {
  color: var(--ink);
  font-size: 10px;
  font-weight: 580;
}

.music-lyrics-empty {
  color: var(--faint);
  font-size: 8px;
  text-align: center;
}

.music-player-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.music-player-actions button {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
  font-size: 7.5px;
}

.music-playlist {
  border-top: 1px solid rgba(110, 117, 99, 0.1);
  padding-top: 5px;
}

.music-playlist summary {
  color: var(--faint);
  font-size: 8px;
  cursor: pointer;
}

.music-playlist > div {
  display: grid;
  gap: 2px;
  max-height: 110px;
  margin-top: 4px;
  overflow-y: auto;
}

.music-track {
  display: flex;
  gap: 6px;
  padding: 3px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 8px;
  text-align: left;
  white-space: nowrap;
}

.music-track span {
  color: var(--faint);
}

.music-track.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.upload-dock {
  position: fixed;
  z-index: 80;
  left: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: min(330px, calc(100% - 24px));
  padding: 9px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  color: var(--ink-soft);
  background: rgba(251, 248, 241, 0.94);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 20px 45px -26px rgba(28, 29, 21, 0.42);
  animation: toast-in 0.35s var(--ease-spring) both;
}

.upload-dock-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.upload-dock-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  color: var(--ink);
  font-size: 9px;
  font-weight: 560;
}

.upload-dock-title .ico {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.upload-dock-head button,
.upload-dock-close {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--faint);
  background: transparent;
}

.upload-dock-head button .ico,
.upload-dock-close .ico {
  width: 10px;
  height: 10px;
}

.upload-dock-body p {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-dock-progress {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(80, 86, 68, 0.12);
}

.upload-dock-progress span {
  display: block;
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.upload-dock-close {
  position: absolute;
  top: 7px;
  right: 7px;
}

.upload-dock.is-minimized {
  width: 175px;
}

.upload-dock.is-minimized .upload-dock-body,
.upload-dock.is-minimized .upload-dock-close {
  display: none;
}

.upload-dock.is-done .upload-dock-progress span {
  background: var(--olive);
}

.upload-dock.is-error .upload-dock-progress span {
  background: var(--accent);
}

@media (max-width: 760px) {
  .upload-dock {
    left: 8px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: min(300px, calc(100% - 16px));
  }
}

.upload-dock-head {
  padding-right: 16px;
}
