:root {
  color-scheme: light;
  --ink: #241524;
  --muted: #7b687b;
  --line: #ead8e6;
  --panel: #ffffff;
  --soft: #fff4f8;
  --brand: #742f63;
  --teal: #2db9a3;
  --coral: #ff6b9a;
  --gold: #ffd166;
  --success: #138f78;
  --danger: #c94232;
  --shadow: 0 18px 48px rgba(25, 43, 65, 0.12);
  --shadow-soft: 0 10px 28px rgba(25, 43, 65, 0.1);
}

[hidden] { display: none !important; }
body.signed-out { background: #fff9fc; }
.signed-out .app-shell { display: none; }
.auth-screen { min-height: 100dvh; padding: 40px 24px; display: grid; place-items: center; }
.auth-content { width: min(100%, 390px); }
.auth-content .brand { padding: 0; margin: 0 0 28px; }
.auth-content h1 { font-size: 2rem; margin: 0; }
.auth-content h2 { font-size: 1.35rem; margin: 24px 0; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 8px; }
.auth-tabs button { flex: 1; padding: 12px 8px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.auth-tabs button[aria-pressed="true"] { color: var(--brand); border-bottom-color: var(--brand); }
#authForm label, #accountDialog form label { display: block; margin: 16px 0 6px; font-size: .9rem; font-weight: 600; }
#authForm input, #accountDialog form input, #accountDialog textarea { display: block; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: white; color: var(--ink); }
.account-primary { width: 100%; padding: 12px; margin-top: 20px; border: 0; border-radius: 6px; background: var(--brand); color: white; font-weight: 700; }
.form-error { color: var(--danger); }
.field-note { color: var(--muted); font-size: .85rem; }
#accountDialog { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); overflow-y: auto; }
#accountDialog::backdrop { background: rgba(23, 20, 30, .5); }
.account-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-dialog-header h2 { font-size: 1.3rem; margin: 0 0 14px; }
#closeAccount, #logoutButton, #removePhoto { border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--brand); padding: 10px 12px; }
.photo-editor { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.photo-upload { display: inline-block; cursor: pointer; color: var(--brand); text-decoration: underline; font-weight: 600; padding: 10px 0; }
#removePhoto { display: block; font-size: .8rem; }
#passwordForm { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
#passwordForm h3 { font-size: 1.05rem; }
.my-profile { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 160px; border: 0; padding: 4px; background: transparent; color: var(--ink); }
#myDisplayName { overflow-wrap: anywhere; font-size: .85rem; text-align: left; }
.my-profile .avatar { width: 36px; height: 36px; flex-shrink: 0; font-size: 1rem; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.friend-avatar, .avatar.member-avatar, .avatar.message-avatar { width: 30px; height: 30px; flex-shrink: 0; font-size: .8rem; }
.message-avatar { float: left; margin: 0 8px 4px 0; }
.member-avatar { grid-row: span 2; }
.room-member { grid-template-columns: 30px minmax(0, 1fr); align-items: center; }
.room-member button { grid-column: 2; }
@media (max-width: 760px) {
  .auth-screen { padding: 24px; }
  #myDisplayName { display: none; }
  .my-profile { margin-left: auto; }
  .chat-header .active-person { min-width: 0; }
  #accountDialog { padding: 18px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 154, 0.18), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(45, 185, 163, 0.12), transparent 28rem),
    linear-gradient(135deg, #fff3f8 0%, #fffafd 46%, #f4fbfa 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(45, 185, 163, 0.35);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(360px, 1fr) minmax(270px, 330px);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar,
.chat-panel,
.profile-panel {
  min-width: 0;
}

.sidebar,
.profile-card,
.live-card,
.chat-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 225, 232, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: 8px;
  padding: 18px;
  overflow: hidden;
}

.brand,
.active-person,
.profile-topline,
.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--coral));
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.search-wrap label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 185, 163, 0.14);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: var(--soft);
}

.mode-nav {
  display: grid;
  gap: 8px;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.mode-button.active {
  border-color: rgba(255, 107, 154, 0.45);
  background: #fff0f7;
  color: #8f285f;
}

.mode-button strong {
  min-width: 28px;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.mode-button.active strong {
  background: #fff;
  color: #8f285f;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 6px 20px rgba(18, 60, 105, 0.08);
}

.people-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.person-card {
  width: 100%;
  min-height: 76px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  text-align: left;
}

.person-card:hover,
.person-card.active {
  border-color: rgba(255, 107, 154, 0.42);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.avatar.large {
  width: 50px;
  height: 50px;
}

.avatar.xl {
  width: 70px;
  height: 70px;
  font-size: 1.6rem;
}

.person-main {
  min-width: 0;
  flex: 1;
}

.person-main strong,
.active-person h2,
.profile-card h2 {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-main span,
.active-person p,
.profile-card p,
.live-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a3adb8;
}

.status-dot.online {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 185, 163, 0.14);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 8px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 84px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.header-actions,
.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credit-pill {
  border-radius: 999px;
  padding: 9px 12px;
  background: #fff0c8;
  color: #6f4a00;
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.primary-action,
.send-button,
.live-card button,
.credits-hero button,
.live-stage button,
.profile-actions button,
.package-card button,
.match-card button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.primary-action:hover,
.send-button:hover,
.live-stage button:hover,
.credits-hero button:hover,
.package-card button:hover,
.match-card button:hover {
  box-shadow: 0 10px 22px rgba(18, 60, 105, 0.2);
}

.workspace-view {
  display: none;
  min-height: 0;
  overflow: auto;
}

.workspace-view.active {
  display: block;
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 20px;
}

.message {
  max-width: min(72%, 520px);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--soft);
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(23, 33, 47, 0.04);
}

.message.me {
  align-self: flex-end;
  background: #ffe1ec;
}

.message .time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.composer {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(243, 247, 250, 0.7);
}

.composer.hidden {
  display: none;
}

.tool-button,
.icon-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-card,
.live-card {
  border-radius: 8px;
  padding: 18px;
}

.profile-card {
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal));
}

.bio {
  margin: 16px 0;
  line-height: 1.55;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.stats div {
  padding: 12px 8px;
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
}

.stats strong,
.stats span {
  display: block;
}

.stats span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-list span {
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff0f7;
  color: #8f285f;
  font-size: 0.86rem;
  font-weight: 800;
}

.live-card {
  background: var(--brand);
  color: #fff;
}

.room-focused .profile-panel,
.room-focused .header-actions,
.room-focused #showPeople {
  display: none;
}

.app-shell.room-focused {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(210px, 250px);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.room-focused .sidebar { overflow-y: auto; overflow-x: hidden; }
.room-focused .sidebar > .search-wrap, .room-focused .sidebar > .tabs,
.room-focused #peopleList { display: none; }
#roomFriends { padding: 16px; }
#roomFriends h2 { font-size: 1.15rem; margin: 0 0 14px; }
#friendSearch { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
#inviteAllFriends { width: 100%; margin-top: 10px; padding: 10px; border: 0; border-radius: 6px; background: var(--brand); color: white; }
#friendsStatus { color: var(--muted); font-size: .85rem; }
#roomInvitationInbox { padding: 0 20px; }
@media (max-width: 760px) {
  .room-focused.show-room-friends .sidebar { display: block; position: absolute; z-index: 5; top: 222px; left: 8px; width: 260px; max-height: 55vh; background: white; border: 1px solid var(--line); }
  .room-focused .sidebar .brand, .room-focused .sidebar .mode-nav { display: none; }
}
.room-focused .chat-panel { grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; padding-bottom: 0; backdrop-filter: none; }
.room-focused .active-person { min-width: 0; }
.room-members { padding: 20px 16px; border-left: 1px solid var(--line); background: white; overflow-y: auto; min-width: 0; }
.room-members[hidden] { display: none; }
.room-members h2 { margin: 0 0 16px; font-size: 1.1rem; }
.room-member { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.room-member span { font-size: .8rem; color: var(--muted); }
.room-member button, .camera-request button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--brand); }
.camera-request { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.camera-request button { margin-right: 6px; }
.room-media-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.room-media-controls button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--brand); }
.room-media-controls button[aria-pressed="true"] { background: #d9f4eb; color: #17634f; }
.room-media-controls svg, .room-toolbar svg { width: 20px; height: 20px; }
.room-media-controls span { color: var(--muted); font-size: .8rem; }
.room-device-settings { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; padding: 10px 20px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.room-device-settings[hidden] { display: none; }
.room-device-settings label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; }
.room-device-settings select { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.room-device-settings button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--brand); }
.room-videos { display: flex; gap: 12px; overflow: auto; flex-shrink: 0; max-height: 230px; }
.room-videos figure { margin: 12px; flex: 0 0 240px; min-width: 0; }
.room-videos video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #111; }
.room-videos figcaption { font-size: .8rem; padding: 4px; }
@media (min-width: 761px) { .room-toolbar button[aria-label="Show friends"] { display: none; } }
@media (min-width: 1081px) { .room-toolbar button[aria-label="Show room members"] { display: none; } }
@media (max-width: 1080px) {
  .app-shell.room-focused { grid-template-columns: 220px minmax(0, 1fr); }
  .room-focused .room-members { display: none; }
  .room-focused.show-room-members .room-members:not([hidden]) { display: block; position: absolute; z-index: 6; right: 8px; top: 150px; width: 260px; max-height: 55vh; border: 1px solid var(--line); box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .room-focused.show-room-members .room-members:not([hidden]) { top: 222px; }
  .room-device-settings { grid-template-columns: 1fr; }
  .room-device-settings button { width: 100%; }
}
.room-focused #viewTitle { overflow-wrap: anywhere; }

#privateView.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.room-toolbar, .room-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.room-toolbar { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.room-toolbar button, .room-dialog-actions button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}
.room-dialog-actions #confirmStartRoom { background: var(--brand); color: white; }
.room-status { margin: 16px 20px 0; color: var(--muted); }
#roomMessages { flex: 1; min-height: 0; }
#roomMessages .message { overflow-wrap: anywhere; white-space: pre-wrap; }
.room-sender { display: block; font-size: 0.8rem; margin-bottom: 5px; }
.room-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.room-composer input { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.open-private-room { margin-top: 10px; width: 100%; }
#startRoomDialog, #joinRoomDialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
#startRoomDialog::backdrop, #joinRoomDialog::backdrop { background: rgba(23, 33, 47, 0.5); }
#guestName { display: block; width: 100%; margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
#joinRoomError { color: var(--danger); }
.room-requests { padding: 12px 20px; border-bottom: 1px solid var(--line); max-height: 32vh; overflow: auto; flex-shrink: 0; }
.room-requests[hidden] { display: none; }
.room-requests h3 { margin: 0; font-size: 1rem; }
.room-requests p { color: var(--muted); font-size: .85rem; }
.room-request { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.room-request strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.room-request button { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: white; color: var(--brand); }
#startRoomHeading { font-size: 1.35rem; margin-top: 0; }
#startRoomDescription { font-weight: 700; }
#startRoomError { color: var(--danger); }
button:disabled { opacity: 0.55; cursor: wait; }
@media (max-width: 760px) {
  .room-focused .chat-panel { height: calc(100dvh - 64px); }
  .room-focused .active-person { min-width: 0; }
  .room-focused #viewTitle { overflow-wrap: anywhere; font-size: 1.1rem; }
}

.private-room-card {
  border: 1px solid rgba(116, 47, 99, 0.18);
  border-radius: 8px;
  padding: 18px;
  background: #fff7fb;
}

.private-room-mobile {
  display: none;
  margin: 0 20px 20px;
}

.private-room-card .eyebrow {
  color: var(--coral);
}

.private-room-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.private-room-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.private-room-form input,
.private-invite input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.private-room-form button,
.private-invite button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.private-invite {
  margin-top: 14px;
}

.private-invite label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.private-invite div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.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;
}

.live-card .eyebrow,
.live-card p {
  color: rgba(255, 255, 255, 0.78);
}

.live-card button {
  width: 100%;
  margin-top: 12px;
  background: var(--gold);
  color: #17212f;
}

.mobile-only,
.mobile-drawer,
.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(18, 60, 105, 0.12);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(201, 66, 50, 0.28);
  color: var(--danger);
}

.light-card {
  background: #fff;
  color: var(--ink);
}

.light-card .eyebrow {
  color: var(--coral);
}

.light-card p {
  color: var(--muted);
}

.light-card button {
  background: var(--brand);
  color: #fff;
}

.live-stage,
.credits-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px;
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, #123c69, #176d82);
  color: #fff;
}

.live-stage p,
.credits-hero p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.live-grid,
.package-grid,
.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px 20px;
}

.live-room,
.package-card,
.match-card,
.activity-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.package-card,
.match-card,
.activity-item {
  box-shadow: 0 8px 22px rgba(25, 43, 65, 0.06);
}

.live-room {
  min-height: 170px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(150deg, rgba(116, 47, 99, 0.92), rgba(255, 107, 154, 0.76)),
    var(--brand);
  color: #fff;
}

.live-room p,
.match-card p,
.package-card p,
.activity-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-room p {
  color: rgba(255, 255, 255, 0.78);
}

.gift-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 20px;
}

.gift-bar button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}
#flirtGiftDialog { width: min(760px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; overflow: hidden; }
.gift-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px 10px; }
.gift-dialog-header h2, .gift-dialog-header p { margin: 0; }
.gift-dialog-header button { border: 0; background: transparent; color: var(--brand); font-weight: 800; }
#flirtGiftBalance { margin: 0; padding: 0 20px 14px; color: var(--muted); }
.flirt-gift-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 20px 20px; max-height: min(620px, calc(100vh - 150px)); overflow-y: auto; }
.flirt-gift-grid button { display: grid; gap: 5px; min-height: 70px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: white; text-align: left; color: var(--ink); }
.flirt-gift-grid button:hover:not(:disabled) { border-color: var(--brand); background: #fff7fb; }
.flirt-gift-grid button:disabled { opacity: .48; }
.flirt-gift-grid span { color: var(--muted); font-size: .78rem; }
@media (max-width: 620px) { .flirt-gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.package-card strong,
.match-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.package-card button,
.match-card button {
  width: 100%;
  margin-top: 12px;
}

.activity-list {
  display: grid;
  gap: 10px;
  padding: 0 20px 20px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.activity-item strong {
  color: var(--success);
  font-size: 0.86rem;
  white-space: nowrap;
}

.profile-actions {
  margin-top: 16px;
}

.profile-actions button {
  flex: 1;
  padding: 0 10px;
  background: #fff0f7;
  color: #8f285f;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 300px minmax(340px, 1fr);
  }

  .profile-panel {
    display: none;
  }

  .private-room-mobile {
    display: block;
  }
}

@media (max-width: 920px) {
  .live-grid,
  .package-grid,
  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background: #f5f8fa;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .sidebar {
    display: none;
  }

  .chat-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 64px;
  }

  .chat-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.94);
  }

  .mobile-only {
    display: inline-grid;
    place-items: center;
  }

  .icon-button span {
    display: block;
    width: 17px;
    height: 2px;
    margin: 2px 0;
    background: var(--brand);
  }

  .primary-action {
    display: none;
  }

  .header-actions {
    display: none;
  }

  .message {
    max-width: 86%;
  }

  .composer {
    grid-template-columns: 40px 1fr 70px;
    position: sticky;
    bottom: 58px;
    z-index: 2;
  }

  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .bottom-button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
  }

  .bottom-button.active {
    background: #fff0f7;
    color: #8f285f;
  }

  .mobile-drawer.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10;
  }

  .drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 33, 47, 0.42);
  }

  .drawer-sheet {
    position: absolute;
    inset: 0 15% 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .drawer-head h2 {
    margin: 0;
    font-size: 1.15rem;
  }

  .drawer-head button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1;
  }

  .toast {
    right: 12px;
    bottom: 76px;
  }

  .live-stage,
  .credits-hero {
    align-items: stretch;
    flex-direction: column;
    margin: 14px;
  }

  .live-grid,
  .package-grid,
  .match-grid,
  .activity-list,
  .gift-bar {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }
}
