@font-face {
  font-family: Sora;
  src: url("assets/brand/fonts/sora-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  font-family: Sora, system-ui, sans-serif;
  color: var(--ink);
  font-synthesis: none;
  /* Match the neutral embedding iframe so Chromium keeps its canvas transparent. */
  color-scheme: normal;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
summary,
input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
textarea:focus-visible,
.chat-log:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button {
  border: 0;
}
a {
  color: inherit;
}
button,
summary {
  min-height: 32px;
}
[hidden] {
  display: none !important;
}
.embedded {
  background: transparent;
  overflow: hidden;
  min-height: 100dvh;
}
/* Keep the dock anchored while the parent iframe processes its resize message. */
.embedded #app {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
}
.embedded #app:not(.is-expanded) {
  width: min(312px, 100vw);
}
#app {
  height: min(84px, 100dvh);
}
#app.is-expanded {
  height: min(680px, 100dvh);
}
.watchparty {
  color: var(--ink);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px 4px 6px;
  position: relative;
}
.party-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  box-shadow: 0 -6px 24px #24103c12;
}
.party-header {
  padding: 10px 14px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.brand {
  width: 126px;
  height: 32px;
  object-fit: contain;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pin[aria-pressed="true"] {
  background: var(--selected);
  color: var(--accent-ink);
  border-radius: 8px;
}
.pin svg {
  transform: rotate(35deg);
}
.quiet {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  padding: 8px;
}
.room-context {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  font-size: 11px;
  padding: 0 14px 8px;
  gap: 2px;
}
.room-presence {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  min-width: 0;
}
.room-presence .connection {
  margin-right: auto;
  padding-left: 3px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.room-presence .quiet {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.room-presence .quiet:hover,
.room-presence .demo-toggle[aria-pressed="true"] {
  background: var(--chip);
  color: var(--accent-ink);
}
@media (pointer: coarse) {
  .room-presence .quiet {
    min-height: 44px;
  }
}
.connection {
  color: var(--muted);
}
.connection.connected::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--live);
  border-radius: 50%;
  margin-right: 5px;
}
.room {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.chat-timeline {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 44px;
}
.chat-log {
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.empty-chat {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  text-align: center;
  margin: 16px 0;
  white-space: pre-line;
}
.message {
  display: flex;
  gap: 8px;
  margin: 0 0 13px;
}
.message > .avatar {
  width: 34px;
  height: 34px;
  flex: none;
}
.message.is-own {
  flex-direction: row-reverse;
}
.message-body {
  flex: 0 1 auto;
  width: calc(100% - 46px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.message.is-own .message-body {
  align-items: flex-end;
}
.byline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
}
.byline strong {
  min-width: 0;
}
.byline strong {
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.message-text {
  font:
    13px/1.65 Sora,
    system-ui,
    sans-serif;
  margin: 4px 0 0;
  width: fit-content;
  max-width: 100%;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-actions {
  font-size: 11px;
  color: var(--muted);
}
.message-actions summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  list-style: none;
  min-height: 32px;
}
.message-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.message-actions button {
  font-size: 11px;
  padding: 5px;
  background: var(--chip);
  border-radius: 6px;
  color: var(--accent-ink);
}
.retry-room {
  margin: 0 16px 12px;
  flex-shrink: 0;
}
.verify {
  padding: 0 16px 10px;
  text-align: center;
}
.verify p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 5px 0 9px;
}
.primary {
  background: var(--cta);
  color: var(--cta-text);
  border: 1px solid var(--cta);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 13px;
  transition: background 0.18s;
}
.primary:hover {
  background: var(--cta-hover);
}
.verify .primary {
  width: 100%;
  padding: 11px;
}
.composer {
  margin: 0 15px 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--input);
  padding: 9px 10px 6px;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #a78bfa33;
}
textarea {
  resize: none;
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  min-height: 38px;
}
textarea:focus-visible {
  outline: none;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.count {
  font-size: 11px;
  color: var(--muted);
}
.send {
  background: var(--selected);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--accent-ink);
}
.party-tools {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 2px 12px 7px;
  flex-wrap: wrap;
}
.party-tools button {
  font-size: 11px;
  padding: 4px 0;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}
.notice {
  font-size: 11px;
  line-height: 1.5;
  color: var(--accent-ink);
  padding: 8px 16px;
  margin: 0;
  background: var(--chip);
  flex-shrink: 0;
  max-height: 60px;
  overflow: auto;
}
.dock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 62px;
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  position: relative;
  box-shadow: 0 6px 20px #24103c12;
}
.dock:active {
  background: var(--selected);
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 2px 8px 2px 0;
  background: transparent;
  color: var(--ink);
  border-radius: 14px;
  text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .profile-button:hover {
    background: var(--chip);
  }
}
.profile-face {
  position: relative;
  flex: none;
  width: 44px;
  height: 36px;
  overflow: hidden;
  border-radius: 14px;
}
.profile-face .avatar {
  position: absolute;
  width: 48px;
  height: 48px;
  max-width: none;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  object-fit: contain;
}
.profile-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-tools {
  flex-shrink: 0;
}
.dock .brand {
  width: 168px;
  max-width: 100%;
  height: 40px;
  object-position: left center;
}
.dock-words {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}
.dock-words strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dock-preview {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dock-count {
  font-size: 11px;
  background: var(--selected);
  border-radius: 50%;
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
}
.dock-count:empty {
  display: none;
}
.dock-count {
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border-radius: 14px;
  background: var(--cta);
  color: var(--cta-text);
  font-weight: 600;
}
.picker {
  text-align: center;
  padding: 8px 16px 12px;
  flex: 1;
  overflow: auto;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin: 12px 0;
}
.picker h1 {
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.06em;
  margin: 8px 0;
}
.picker-sub {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px;
}
.choices {
  border: 0;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.choice {
  position: relative;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  left: 0;
  top: 0;
  z-index: 1;
  cursor: pointer;
}
.choice-card {
  height: 114px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--chip);
  padding: 5px 3px 12px;
  display: flex;
  align-items: center;
  flex-direction: column;
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.choice-card .avatar {
  width: 92px;
  height: 78px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 2px #40305410);
}
.choice-card strong {
  font-size: 11px;
}
.choice-card > span {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 7px;
  max-width: 83px;
  color: var(--muted);
}
.choice input:checked + .choice-card {
  background: var(--selected);
  border: 2px solid var(--accent);
  padding: 4px 2px 11px;
  transform: translateY(-3px);
}
.choice input:focus-visible + .choice-card {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.seat-button {
  width: 100%;
}
.picker-foot {
  font-size: 11px;
  color: var(--muted);
  margin: 13px 0 0;
  line-height: 1.6;
}
.new-messages {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 3px 12px #140b222b;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.94);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 0s linear 160ms;
}
.new-messages.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}
.new-messages:hover {
  background: var(--selected);
  color: var(--accent-ink);
}
.new-messages:active {
  transform: scale(0.94);
}
.new-messages svg {
  width: 22px;
  height: 22px;
}
.jump-count {
  position: absolute;
  top: -7px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--selected);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes pop {
  from {
    transform: translateX(-50%) scale(0.8);
  }
  to {
    transform: translateX(-50%) scale(1);
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 340px) {
  .party-header {
    padding-inline: 12px;
  }
  .brand {
    width: 105px;
  }
  .choices {
    gap: 4px;
  }
  .choice-card strong {
    font-size: 11px;
  }
  .choice-card {
    height: 110px;
  }
  .picker {
    padding-inline: 10px;
  }
  .picker h1 {
    font-size: 25px;
  }
  .dock {
    gap: 4px;
  }
  .dock-preview {
    max-width: 100%;
  }
  .party-tools {
    gap: 8px;
  }
}
@media (max-height: 440px) {
  .audience {
    display: none;
  }
  .picker {
    padding-block: 4px;
  }
  .eyebrow,
  .picker-sub,
  .picker-foot {
    display: none;
  }
  .picker h1 {
    font-size: 20px;
    margin: 4px;
  }
  .choice-card {
    height: 125px;
  }
  .choice-card .avatar {
    height: 72px;
  }
  .choices {
    margin-bottom: 8px;
  }
  .verify p {
    display: none;
  }
  .room-context {
    padding-bottom: 5px;
  }
}

:root {
  --ink: #2c2440;
  --muted: #695c79;
  --timestamp: #625570;
  --surface: #fcfaf5;
  --input: #fffefb;
  --stage: #ece6f7;
  --border: #c2b4d6;
  --line: #dfd5e9;
  --chip: #eee7f6;
  --selected: #e4d6fa;
  --accent: #7750be;
  --accent-ink: #503578;
  --live: #34743f;
  --cta: #39234f;
  --cta-hover: #533570;
  --cta-text: #ffffff;
  --shadow: #24103c18;
}
.watchparty {
  /* Theme native controls inside the UI, without painting the document canvas. */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #f3effc;
  --muted: #b7aecb;
  --timestamp: #b7aecb;
  --surface: #111425;
  --input: #191d33;
  --stage: #191b33;
  --border: #42465f;
  --line: #2e304c;
  --chip: #24263f;
  --selected: #343052;
  --accent: #bc9cf6;
  --accent-ink: #d6bffa;
  --live: #91e8bd;
  --cta: #c9b0ff;
  --cta-hover: #dac8ff;
  --cta-text: #20152e;
  --shadow: #02051250;
}
:root[data-theme="dark"] .watchparty {
  color-scheme: dark;
}
.party-content,
.dock {
  background: var(--surface);
  box-shadow: 0 10px 36px var(--shadow);
}
.party-content {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}
.party-content.is-visible {
  opacity: 1;
  transform: none;
}
.party-content.fading-out {
  transition-duration: 160ms;
  pointer-events: none;
}
.party-header {
  padding: 10px 12px 6px;
  position: relative;
}
.party-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.header-tools .quiet {
  padding-inline: 6px;
}
.theme-toggle {
  color: var(--accent-ink);
}
.header-tools .icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
}
.header-tools .icon-button:hover {
  background: var(--chip);
}
.icon-button svg {
  display: block;
  pointer-events: none;
}
@media (pointer: coarse) {
  .header-tools .icon-button {
    width: 44px;
    height: 44px;
  }
  .header-tools .pin {
    min-width: 44px;
    min-height: 44px;
  }
}
.audience {
  background:
    radial-gradient(ellipse at 50% 120%, var(--selected), transparent 75%),
    var(--stage);
  padding-top: 4px;
}
.seats {
  border-bottom: 1px solid var(--border);
  margin: 0 14px 6px;
}
.message.just-arrived {
  animation: arrive 230ms ease both;
}
.message-actions {
  margin-top: 0;
}
.message-actions summary {
  min-height: 24px;
}
.chat-log {
  padding: 12px 14px 8px;
}
.composer {
  flex-shrink: 0;
}
.composer textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.send {
  background: var(--cta);
  color: var(--cta-text);
  min-width: 56px;
}
.party-tools {
  border-top: 1px solid var(--line);
  margin: 4px 15px 0;
  padding: 3px 0;
  gap: 12px;
  flex-shrink: 0;
}
.party-tools button:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-toggle[aria-pressed="true"] {
  color: var(--accent-ink);
}
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 8px;
  flex-shrink: 0;
  background: var(--selected);
  color: var(--accent-ink);
  padding: 4px 12px;
  text-align: left;
  font-size: 10px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
}
.demo-arrival-status {
  flex-basis: 100%;
  padding: 0 0 6px;
  font-size: 11px;
}
.is-demo .connection.connected::before {
  background: var(--accent);
}
.profile-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 auto 0 0;
  border-radius: 10px;
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .profile-back:hover {
    background: var(--chip);
  }
}
.picker h1 {
  font-size: 27px;
}
.profile-field {
  text-align: left;
  margin-bottom: 13px;
}
.profile-field label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}
.name-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  min-height: 40px;
}
.name-input::placeholder {
  color: var(--muted);
}
.name-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 6px;
}
.choice-card > span {
  display: none;
}
.picker-foot {
  margin-top: 10px;
  font-size: 10px;
}
.dock {
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}
.watchparty:not(.open) .dock {
  opacity: 0.88;
  transition: opacity 200ms ease;
}
.watchparty:not(.open) .dock:hover,
.watchparty:not(.open) .dock:focus-visible {
  opacity: 1;
}
@media (max-width: 340px) {
  .header-tools {
    gap: 0;
  }
  .header-tools .quiet {
    padding-inline: 5px;
  }
  .picker h1 {
    font-size: 24px;
  }
  .party-tools {
    gap: 10px;
  }
}

/* Compact conversation spacing with readable type and stable media slots. */
#app.is-expanded {
  height: min(680px, 100dvh);
}
.chat-log {
  padding: 12px 16px 8px;
  scrollbar-gutter: stable;
}
.message {
  gap: 8px;
  margin-bottom: 10px;
}
.message:last-child {
  margin-bottom: 0;
}
.message > .avatar {
  width: 36px;
  height: 36px;
}
.byline {
  gap: 8px;
  margin-bottom: 2px;
}
.byline strong {
  font-size: 12px;
  line-height: 1.5;
}
.message-bubble {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  min-width: 92px;
  padding: 8px 11px 5px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
}
.message.is-own .message-bubble {
  background: var(--selected);
  border-radius: 16px 16px 4px 16px;
}
.message-text {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  width: auto;
}
.message-time {
  display: block;
  align-self: flex-end;
  margin-top: 2px;
  color: var(--timestamp);
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.message-bubble.has-photo {
  width: 280px;
  padding: 5px;
}
.message-bubble.has-photo .chat-photo {
  margin: 0;
  border: 0;
  border-radius: 11px;
}
.message-bubble.has-photo .message-text {
  padding: 6px 8px 0;
}
.message-bubble.has-photo .message-time {
  margin: 5px 8px 2px;
}
.message .message-bubble.has-sticker {
  padding: 0;
  border: 0;
  background: transparent;
  width: 136px;
}
.message-bubble.has-sticker .chat-sticker {
  margin: 0;
  width: 100%;
  height: auto;
}
.message-bubble.has-sticker .message-time {
  background: var(--surface);
  border-radius: 8px;
  padding: 2px 6px;
}
.chat-day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
}
.chat-day-divider:first-child {
  margin-top: 0;
}
.chat-day-divider::before,
.chat-day-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.chat-day-divider time {
  flex-shrink: 0;
}
.message-text a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chat-sticker {
  display: block;
  width: 136px;
  height: 136px;
  object-fit: contain;
  margin: 4px 0 8px;
}
.chat-photo {
  width: 100%;
  max-width: 280px;
  max-height: 240px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin: 8px 0;
  background: var(--chip);
  border: 1px solid var(--line);
}
.chat-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain;
}
.chat-photo-retry {
  position: absolute;
  inset: 0;
  background: var(--chip);
  color: var(--ink);
  font-size: 12px;
}
.chat-photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}
.chat-photo-open:disabled {
  opacity: 1;
}
.chat-photo-open:focus-visible {
  outline-offset: -4px;
}
/* The top-layer viewer fills the window while keeping photos inside our frame. */
.photo-viewing {
  overflow: hidden;
}
.photo-viewing .party-content,
.photo-viewing .dock,
.photo-viewing .preview-audience {
  visibility: hidden;
}
.photo-viewer {
  padding: 0;
  margin: auto;
  width: min(1080px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 90px #08051455;
}
.photo-viewer[open] {
  display: flex;
  flex-direction: column;
  animation: photo-appear 160ms ease-out;
}
.photo-viewer::backdrop {
  background: #100d1bd9;
}
.photo-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 24px;
  gap: 12px;
  flex: 0 0 auto;
}
.photo-viewer h2 {
  font-size: 15px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.03em;
}
.photo-viewer-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  border-radius: 50%;
  flex: 0 0 auto;
}
.photo-viewer-control:hover:not(:disabled) {
  background: var(--chip);
}
.photo-viewer-control svg {
  width: 22px;
  height: 22px;
}
.photo-viewer-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--input);
  border-block: 1px solid var(--line);
  scrollbar-color: var(--border) var(--input);
}
.photo-viewer-stage:focus-visible,
.photo-viewer-caption:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
.photo-viewer-canvas {
  display: grid;
  place-items: center;
}
.photo-viewer-canvas img {
  display: block;
  max-width: none;
  object-fit: contain;
  user-select: none;
}
.photo-viewer-stage.zoomed {
  cursor: grab;
}
.photo-viewer-stage.dragging {
  cursor: grabbing;
}
.photo-viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  flex: 0 0 auto;
}
.photo-viewer-controls output {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.photo-viewer-fit {
  width: auto;
  min-width: 52px;
  border-radius: 14px;
  background: var(--chip);
  margin-left: 8px;
  font-size: 12px;
}
.photo-viewer-caption {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 24px 2px;
  max-height: 84px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}
.photo-viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  margin: 0;
  font-size: 14px;
  text-align: center;
}
@keyframes photo-appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 480px), (max-height: 480px) {
  .photo-viewer {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 18px;
  }
  .photo-viewer-header {
    padding: 6px 8px 6px 16px;
  }
  .photo-viewer-caption {
    padding-inline: 16px;
  }
  .photo-viewer-controls {
    padding-block: 4px;
  }
}
/* One composer surface, with quiet icon tools and room for a complete draft. */
.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 8px 13px 8px;
  padding: 10px;
  gap: 5px;
  border-radius: 21px;
  border: 1px solid var(--border);
  background: var(--input);
}
.composer textarea {
  min-width: 0;
  min-height: 36px;
  max-height: 104px;
  padding: 6px 4px;
  font-size: 14px;
  line-height: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.composer:has(.count[data-near-limit="true"]) textarea {
  padding-inline-end: 76px;
}
.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.composer .count {
  position: absolute;
  top: 16px;
  right: 14px;
  margin: 0;
  padding: 0;
  font-size: 10px;
  line-height: 14px;
  background: transparent;
}
.composer .count:not([data-near-limit="true"]) {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.composer-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
}
.composer-icon svg {
  display: block;
  pointer-events: none;
}
.send.composer-icon {
  background: var(--cta);
  color: var(--cta-text);
  margin-left: auto;
}
.send.composer-icon:hover:not(:disabled) {
  background: var(--cta-hover);
}
.send.composer-icon:disabled {
  background: var(--chip);
  color: var(--muted);
  opacity: 1;
}
.composer-extras {
  display: contents;
}
.media-toolbar {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 0;
}
.media-toolbar .composer-icon {
  background: transparent;
  color: var(--accent-ink);
  padding: 0;
}
.media-toolbar button:hover,
.media-toolbar button[aria-expanded="true"] {
  background: var(--selected);
}
.media-tray {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 5;
  max-height: min(330px, 55dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (pointer: coarse) {
  .composer-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}
.tray-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tray-heading > button {
  margin-inline-start: auto;
}
.tray-heading strong {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.sticker-choice {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 12px;
  background: var(--chip);
  padding: 5px;
}
.sticker-choice img {
  width: 76px;
  height: 76px;
  max-width: 100%;
  object-fit: contain;
}
.sticker-choice:hover {
  background: var(--selected);
}
.emoji-tray .media-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}
.emoji-choice {
  background: var(--chip);
  font-size: 21px;
  min-height: 38px;
  padding: 4px 0;
  border-radius: 8px;
}
.media-status {
  font-size: 11px;
  line-height: 1.5;
  margin: 0 4px 2px;
  color: var(--accent-ink);
  max-height: 50px;
  overflow: auto;
}
.photo-draft {
  grid-column: 1/-1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.photo-draft img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}
.photo-draft span {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.party-tools {
  margin-top: 0;
  gap: 12px;
  justify-content: flex-start;
}
.party-tools button {
  min-height: 32px;
  font-size: 11px;
}
.room-context {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.connection {
  flex-shrink: 0;
}
@media (max-width: 340px) {
  .chat-log {
    padding-inline: 12px;
  }
  .message {
    gap: 8px;
  }
  .byline strong {
    font-size: 11px;
  }
  .party-tools {
    gap: 9px;
  }
  .media-toolbar {
    gap: 0;
  }
  .media-toolbar button {
    padding-inline: 9px;
  }
}
@media (max-height: 440px) {
  .party-tools {
    padding: 0;
  }
  .party-tools button {
    min-height: 28px;
  }
  .media-toolbar {
    padding-block: 0;
  }
  .composer {
    margin-top: 3px;
    padding: 7px 10px;
  }
  .room-context {
    padding-bottom: 6px;
  }
  .party-header {
    padding-top: 4px;
    padding-bottom: 0;
  }
  .message {
    margin-bottom: 8px;
  }
  .chat-log {
    padding-block: 10px;
  }
  .media-tray {
    max-height: 160px;
  }
}

.history-controls {
  flex-shrink: 0;
  padding: 3px 14px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.history-load {
  font-size: 11px;
  min-height: 32px;
}
.history-status {
  display: block;
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px 4px;
}

/* Local effect previews live with the saved profile, away from conversation controls. */
.profile-effects {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.profile-effects h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.effects-note,
.effects-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 6px 0 12px;
}
.effects-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.effect-preview {
  flex: 1 1 120px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--selected);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.effect-preview:disabled {
  opacity: 0.55;
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  .effect-preview:not(:disabled):hover {
    border-color: var(--accent);
    background: var(--chip);
  }
}
.effects-hint {
  margin-bottom: 0;
  font-size: 10px;
}

.notice-countdown {
  font-variant-numeric: tabular-nums;
}

.standalone-launcher {
  display: grid;
  gap: 12px;
  margin: 24px;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
}

.close-confirmation {
  width: min(350px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 16px 48px #100d1b33;
}
.close-confirmation[open] {
  animation: arrive 140ms ease-out;
}
.close-confirmation::backdrop {
  background: #100d1b88;
}
.close-confirmation h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.4px;
}
.close-confirmation p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.close-confirmation .close-confirmation-error {
  margin-top: 12px;
  color: var(--ink);
}
.close-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.close-confirmation-actions button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
}
.close-confirmation-cancel {
  color: var(--ink);
  background: var(--chip);
  border: 1px solid var(--border);
}
.close-confirmation-cancel:hover {
  background: var(--selected);
}
