@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope_regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope_medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope_bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/cormorant_garamond_semibold_italic.ttf') format('truetype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Manrope, system-ui, sans-serif;
  --heading: 'Cormorant Garamond', Georgia, serif;
  --background: #100e12;
  --panel: #231c2a;
  --body: #f8f3f8;
  --muted: #a5a0aa;
  --line: #ffffff22;
  --accent: #ead9eb;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --viewport-height: 100vh;
  --app-max-width: 600px;
  --tab-space: calc(84px + var(--safe-bottom));
  color: var(--body);
  background: var(--background);
  -webkit-tap-highlight-color: transparent;
}

@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }
/* Each scroll container needs its own touch-action. */
:where(*) { touch-action: pan-x pan-y; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow: hidden; }
button, input, textarea { color: inherit; font: inherit; }
input, textarea { font-size: max(16px, 1rem); }
button { border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #f3ccdc; outline-offset: -3px; }

.app-frame {
  position: relative;
  isolation: isolate;
  width: min(100%, var(--app-max-width));
  height: var(--app-height, var(--viewport-height));
  margin-inline: auto;
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  overflow-x: clip;
  background: var(--background);
}

#pages, .page { height: 100%; }
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page:not(.with-tabs) { padding-bottom: var(--safe-bottom); }

.tab-bar {
  position: absolute;
  z-index: 2;
  right: calc(16px + var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  left: calc(16px + var(--safe-left));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 374px;
  margin-inline: auto;
  min-height: 62px;
  padding: 3px 7px;
  border: 1px solid #ffffff35;
  border-radius: 999px;
  background: #100e1240;
  box-shadow: 0 8px 40px #0002, inset 0 0 2px #0003;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.tab {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
}

.tab img { position: relative; display: block; }
.tab .selected-icon, .tab[aria-current] .tab-icon { display: none; }
.tab[aria-current]::before {
  position: absolute;
  inset-block: 0;
  left: 50%;
  width: min(95.5px, calc(100% + 8px));
  transform: translateX(-50%);
  border-radius: inherit;
  background: #fff3 url('/icons/tab_selection_overlay.svg') center / min(89px, 93.2%) auto no-repeat;
  content: '';
  pointer-events: none;
}
.tab[aria-current] .selected-icon { display: block; }

.discover-header {
  display: flex;
  flex: none;
  align-items: center;
  padding-bottom: 4px;
  background: var(--background);
}

.category-strip { position: relative; flex: 1; min-width: 0; }
.category-strip.can-scroll::after {
  position: absolute;
  inset-block: 50% auto;
  inset-inline-end: 0;
  width: 60px;
  height: 27px;
  transform: translateY(-50%);
  background: linear-gradient(to right, transparent, var(--background));
  content: '';
  pointer-events: none;
}
[dir='rtl'] .category-strip.can-scroll::after { background: linear-gradient(to left, transparent, var(--background)); }

.categories {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding-inline: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.category {
  min-width: 48px;
  min-height: 48px;
  flex: none;
  padding: 0;
  background: transparent;
  color: #5e6061;
  font: 400 1rem/1.25 Manrope, system-ui, sans-serif;
  white-space: nowrap;
}

.category > span { position: relative; }
.category[aria-pressed='true'] { color: white; font-weight: 500; }
.category[aria-pressed='true'] > span::after {
  position: absolute;
  inset-block-start: -4.5px;
  inset-inline-end: -5.5px;
  width: 11px;
  height: 11px;
  background: url('/icons/discovery-category-star.svg') center / contain no-repeat;
  content: '';
}

.discover-header .discover-search { width: 48px; height: 48px; }
.discover-search img { width: 15.5px; height: 15.5px; margin-inline-end: 4px; filter: brightness(0) invert(1); opacity: .7; }

.icon-button {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover, .text-button:hover { background: #ffffff0c; }

.category-panels { flex: 1; min-height: 0; }
.scroll-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}

.category-panels .scroll-panel { height: 100%; padding-bottom: var(--tab-space); }
.character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.character-card {
  position: relative;
  isolation: isolate;
  display: block;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 206 / 360;
  color: white;
  background: var(--background);
  text-decoration: none;
}

.character-card > .picture, .character-card > video, .swipe-character > .picture, .swipe-character > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-card::after, .swipe-character::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: var(--background);
  -webkit-mask-image: linear-gradient(0deg, #000, #0006 24.9%, transparent 33.2%);
  mask-image: linear-gradient(0deg, #000, #0006 24.9%, transparent 33.2%);
  content: '';
  pointer-events: none;
}

.character-card[data-effect]::after {
  background: linear-gradient(0deg, var(--background), #100e1266 24.9%, transparent 33.2%);
  -webkit-mask-image: none;
  mask-image: none;
}

.card-copy {
  position: absolute;
  z-index: 1;
  inset-inline: 12px;
  inset-block-end: 12px;
  display: grid;
  gap: 4px;
}

.swipe-copy h1 {
  margin: 2px 0 4px;
  font: 600 italic clamp(1.2rem, 6vw, 1.75rem)/1.2 var(--heading);
}

.card-copy h2 {
  margin: 0;
  overflow: hidden;
  font: 600 italic 1.25rem/1.2 var(--heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #999b9c;
  font-size: .75rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.round-count {
  position: absolute;
  z-index: 1;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  color: white;
  font: 400 .75rem/1.5 Manrope, system-ui, sans-serif;
  text-shadow: 0 1px 2px #0008;
}

.round-count img { display: block; flex: none; }

.discover-page .feed-empty .list-footer { min-height: 100%; align-content: center; }
.feed-end { margin: 0; padding: 24px; color: #999b9c; text-align: center; font-size: .875rem; }
.picture {
  position: relative;
  display: block;
  overflow: hidden;
}

.picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.picture:not([data-image='ready']) img { visibility: hidden; }


.button, .text-button, .choice {
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 22px;
  background: #ffffff19;
  font-weight: 700;
  font-size: .85rem;
}
.button.primary { color: #201722; background: linear-gradient(110deg, #f3ccdc, #fbeff4, #dedeeb); }
.text-button { background: transparent; }
.choice { min-height: 36px; font-weight: 400; }
.button:hover, .choice:hover { filter: brightness(1.16); }

.state {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100px;
  padding: 20px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  font-size: .875rem;
}
.list-footer { display: grid; justify-items: center; }

.search-form { display: flex; align-items: center; gap: 4px; padding: 12px 16px 16px 4px; }
.search-form > .icon-button { flex: none; }
.search-box { display: flex; flex: 1; min-width: 0; align-items: center; padding-inline-start: 12px; border-radius: 12px; background: var(--panel); }
.search-icon { flex: none; opacity: .6; }
.search-box input { order: 2; width: 100%; height: 44px; flex: 1; min-width: 0; border: 0; outline: none; padding: 0 12px; background: transparent; }
.search-box::before { content: ''; width: 1px; height: 20px; margin-inline-start: 12px; order: 1; background: var(--line); }
.search-box .icon-button { flex: none; order: 3; }
.search-box:focus-within { outline: 1px solid #ffffff46; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-choices { padding: 2px 16px 14px; }
.search-choices h2 { margin: 0 0 12px; font: 600 italic 1.4rem/1.2 var(--heading); }
.search-choices .choice-list { gap: 14px 12px; }
.search-choices .choice { min-height: 36px; padding-inline: 15px; border-radius: 12px; background: #211c25; color: #c5bdcb; }
.search-results.feed-empty .list-footer { min-height: 100%; grid-template-rows: .325fr auto .675fr; }
.search-empty { grid-row: 2; display: grid; justify-items: center; gap: 20px; padding-inline: 16px; text-align: center; }
.search-empty p { margin: 0; color: #999b9c; font: 600 italic 1.25rem/1 var(--heading); }
.choice-list, .legal-links { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group legend { margin-block-end: 8px; }
.choice-group .choice-list { gap: 12px; }
.choice-chip {
  display: inline-grid;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  font-size: .875rem;
  line-height: 19px;
}
.choice-chip-label {
  position: relative;
  padding: 10px 20px;
  border-radius: inherit;
  color: #999b9c;
  background: #ffffff0d;
}
.choice-chip[aria-pressed='true'] .choice-chip-label {
  color: #060606;
  background: linear-gradient(90deg, #f3ccdc, #fbeff4 53%, #dedeea);
}
.choice-chip[aria-pressed='true'] .choice-chip-label::before,
.choice-chip[aria-pressed='true'] .choice-chip-label::after {
  position: absolute;
  inset-block-start: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(180deg);
  background: url('/icons/choice-chip-star.svg') center / contain no-repeat;
  pointer-events: none;
  content: '';
}
.choice-chip-label::before { inset-inline-start: 6px; }
.choice-chip-label::after { inset-inline-end: 6px; }
.tag { padding: 4px 10px; border-radius: 20px; background: #ffffff1a; font-size: .75rem; }
.legal-links { justify-content: center; gap: 8px 20px; padding: 12px; color: #cab9d1; font-size: .72rem; }
.legal-links:empty { display: none; }

.swipe-content { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; }
.swipe-track { position: relative; flex: 1; min-width: 0; touch-action: pan-x; }
.swipe-track[data-moving] { will-change: transform; }
.swipe-track > .swipe-character {
  position: absolute;
  inset-inline: 0;
  height: 100%;
  background: var(--background);
}
.swipe-content > .state { margin: auto; }
.swipe-content > .state:not(:first-child) { position: absolute; z-index: 1; top: 8px; right: 8px; left: 8px; background: #100e12dd; }
.swipe-character { position: relative; isolation: isolate; flex: 1; overflow: hidden; }
.character-card > video, .swipe-character > video { transition: opacity 140ms ease-out; }
.character-card > video:not([data-playing]), .swipe-character > video:not([data-playing]) { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .character-card > video, .swipe-character > video { transition: none; }
}
.swipe-character::after {
  -webkit-mask-image: linear-gradient(0deg, #000 9%, #000b 23%, transparent 49%);
  mask-image: linear-gradient(0deg, #000 9%, #000b 23%, transparent 49%);
}
.swipe-copy { position: absolute; z-index: 1; inset-inline: 16px; bottom: calc(var(--tab-space) + 15px); display: grid; gap: 12px; }
.swipe-identity, .details-identity { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.swipe-identity { min-height: 40px; }
.swipe-identity h1 { flex: 1; min-width: 0; margin: 0; font-size: clamp(1.45rem, 7vw, 1.9rem); }
.swipe-profile { display: block; width: 100%; overflow: hidden; padding: 0; border-radius: 4px; background: transparent; text-align: start; text-overflow: ellipsis; white-space: nowrap; }
.swipe-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #b2a9b5; font-size: .875rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.swipe-copy .tag, .details-body .tag { border: 1px solid var(--line); background: #0005; color: #d4d0d7; }
.swipe-chat { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: #aeaeae66; }
.swipe-actions { position: absolute; z-index: 1; inset: 25% 12px auto auto; display: grid; gap: 6px; opacity: 0; }
.swipe-actions:focus-within { opacity: 1; }
@media (hover: hover) {
  .card-page:hover .swipe-actions { opacity: 1; }
}
.swipe-actions .icon-button { background: #100e1280; }
.signed-in .guest-only { display: none; }

.tab-heading, .secondary-header {
  min-height: 52px;
  flex: none;
  align-items: center;
  padding: 4px 8px;
  background: var(--background);
}

.tab-heading { padding-inline: 16px; }
.tab-heading h1, .secondary-header h1, .sheet h2 {
  margin: 0;
  font: 600 italic 1.5rem/1.2 var(--heading);
}

.secondary-header {
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr);
  gap: 4px;
}

.secondary-header h1 { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; justify-content: end; }
.chat-header { grid-template-columns: 44px minmax(0, 1fr) auto; min-height: 48px; gap: 0; padding: 0 6px; }
.chat-header .header-actions { align-items: center; gap: 12px; }
.chat-header .chat-settings-button { height: 48px; margin-inline-start: -10px; }
.chat-character { display: flex; min-width: 0; align-items: center; gap: 8px; text-decoration: none; }
.chat-character .picture, .thread-title .picture { flex: none; width: 30px; height: 30px; overflow: visible; }
.chat-character .picture img, .thread-title .picture img {
  position: absolute;
  inset: -.5px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
}
.chat-character h1 { font-size: 1.25rem; }
.chats-empty { display: grid; flex: 1; place-content: center; justify-items: center; padding: 16px; color: var(--muted); }

.character-page { isolation: isolate; }
.chat-page > .chat-header { background: transparent; }
.chat-page .chat-character h1 { font-size: 1rem; }
.chat-gallery { width: 46px; height: 48px; }
.chat-gallery:hover { background: transparent; }
.chat-gallery-visual, .chat-mode-visual {
  border: 1px solid #ffffff4d;
  border-radius: 18px;
  background: #0005;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.chat-gallery-visual { display: grid; place-items: center; width: 46px; height: 30px; }
.chat-mode-button {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  padding: 0;
  background: transparent;
}
.chat-mode-visual {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  line-height: 20px;
}
.chat-mode-visual span { overflow: hidden; max-width: 74px; text-overflow: ellipsis; white-space: nowrap; }
.chat-mode-visual img { flex: none; }
.chat-mode-button[data-hint]::after {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d50;
  content: '';
}
.chat-gallery:active .chat-gallery-visual, .chat-mode-button:active .chat-mode-visual { background: #ffffff1c; }
.transcript { padding: 0 16px 14px; }
.chat-page > .transcript, .thread-page > .thread-messages {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.chat-scroll-content { flex: none; }
.transcript > .chat-scroll-content { padding: 0 16px 14px; }
.page.character-page.chat-page, .page.thread-page { padding-block-end: 0; }
.chat-composer-dock {
  --composer-safe-bottom: var(--safe-bottom);
  --composer-shadow-spread: 64px;
  position: sticky;
  z-index: 2;
  inset-block-end: 0;
  flex: none;
  margin-block-start: auto;
  padding-block-end: max(48px, calc(12px + var(--composer-safe-bottom)));
  pointer-events: none;
}
.chat-composer-dock:has([data-expanded]) { padding-block-end: calc(12px + var(--composer-safe-bottom)); }
.chat-composer-dock:has([data-expanded], .chat-inspiration-panel:not([hidden])) { --composer-shadow-spread: 32px; }
:root[data-keyboard-open] .chat-composer-dock { --composer-safe-bottom: 0px; }
.chat-composer-dock::before {
  position: absolute;
  z-index: -1;
  inset: calc(-1 * var(--composer-shadow-spread)) 0 0;
  background: linear-gradient(180deg, transparent, #0009 16.85%, #0009 71.94%, #000c);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(transparent, #0006 18.94%, #000 37.78%);
  mask-image: linear-gradient(transparent, #0006 18.94%, #000 37.78%);
  content: '';
}
.chat-composer-dock:has([data-expanded], .chat-inspiration-panel:not([hidden]))::before {
  background: #000c;
  -webkit-mask-image: linear-gradient(transparent, #0003 18px, #0008 33px, #000c 47px, #000 84px);
  mask-image: linear-gradient(transparent, #0003 18px, #0008 33px, #000c 47px, #000 84px);
}
.chat-composer-dock > .composer, .chat-composer-dock button { pointer-events: auto; }
.chat-art, .media-backdrop { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.chat-art .picture, .media-backdrop .picture { width: 100%; height: 100%; }
.chat-art img, .media-backdrop img { object-position: top center; }
.media-backdrop::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(#100e1230 0%, #100e1225 45%, #100e12 100%);
  content: '';
}
.chat-notice { margin: clamp(120px, 29vh, 300px) auto 28px; color: #f7f3f4b0; font-size: .67rem; text-align: center; text-shadow: 0 1px 4px #100e12; }
.intro-card, .opening {
  position: relative;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #241b2be6;
  overflow-wrap: anywhere;
}

.intro-card { margin: 0 0 28px; padding: 18px; border: none; background: #514660f5; }
.intro-card summary { position: relative; padding-inline-end: 24px; cursor: pointer; list-style: none; font-size: .875rem; }
.intro-card summary::-webkit-details-marker { display: none; }
.intro-card summary::after { position: absolute; inset-inline-end: 0; inset-block-end: 0; content: '⌄'; }
.intro-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.intro-preview-text { color: #e5dce9; }
.intro-card[open] .intro-preview-text { display: none; }
.intro-card p, .opening p { margin-bottom: 0; font-size: .875rem; line-height: 1.6; white-space: pre-wrap; }
.character-page :is(.opening, .details-intro) em { color: #ada4b1; }
.opening > :first-child { margin-top: 0; }
.opening h2 { margin: 0; font: 600 italic 1.35rem/1.2 var(--heading); }
.opening > .picture { display: block; width: 100%; margin-top: 10px; border-radius: 12px; }
.opening-video { position: relative; display: grid; width: 104px; height: 176px; max-width: 100%; place-items: center; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--background); }
.opening-video:not(:first-child) { margin-block-start: 12px; }
.opening-video > .picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.opening-video-icon { position: relative; }

.composer {
  display: flex;
  flex: none;
  align-items: end;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--composer-fill, #231c2a);
}

.composer textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line); border-radius: 16px; padding: 9px 10px; background: transparent; }
.composer [aria-label='Send message'] { color: #2c2031; background: #f3ddec; }
.chat-composer-dock > .composer {
  position: relative;
  margin: 0 16px;
  padding: 0 6px 0 12px;
  align-items: center;
  gap: 0;
  border: 1px solid #57445f4d;
  border-radius: 16px;
}
.chat-composer-dock > .composer[data-expanded] { flex-wrap: wrap; border-radius: 12px; }
.chat-composer-field { position: relative; flex: 1; min-width: 0; }
[data-expanded] > .chat-composer-field { flex: 0 0 100%; }
.chat-composer-field textarea {
  display: block;
  width: 100%;
  font-size: 16px;
  line-height: 24px;
  overflow-wrap: anywhere;
}
.chat-composer-field textarea { height: 54px; padding: 15px 0; border: 0; border-radius: 0; }
.chat-composer-dock .composer[data-expanded] textarea { height: 86px; padding-block: 14px 0; }
.chat-composer-dock textarea:focus-visible { outline: none; }
.chat-composer-actions { display: flex; flex: none; margin-inline-start: auto; }
.chat-composer-actions .icon-button { width: 48px; height: 48px; }
.guest-composer:focus-within { border-color: #ddbed264; }
.guest-composer textarea::placeholder { color: transparent; }
.guest-placeholder { position: absolute; inset: 15px 0 auto; display: none; overflow: hidden; color: #999b9c; line-height: 24px; pointer-events: none; text-overflow: ellipsis; white-space: nowrap; }
.guest-composer textarea:placeholder-shown + .guest-placeholder { display: block; }
.chat-composer-actions .composer-send { position: relative; width: 56px; border-radius: 16px; background: transparent; }
.composer-send::before { position: absolute; inset: 10px 0; border-radius: 20px; background: #f0cedc; content: ''; }
.composer-send img { position: relative; }
.guest-composer:not([data-expanded]) .composer-send:disabled { display: none; }

.role-details-page > .secondary-header { position: absolute; z-index: 1; inset: 0 0 auto; background: linear-gradient(#100e1270, transparent); }
.role-details-page > .secondary-header h1 { padding: 5px 10px; border: 1px solid #ffffff29; border-radius: 999px; background: #100e1270; font: inherit; font-size: .75rem; }
.role-details-page > .scroll-panel > .state { margin-top: 52px; }
.details-art { position: relative; isolation: isolate; display: grid; padding-top: 98%; margin-bottom: 13px; }
.details-art > .picture { position: absolute; z-index: -1; inset: 0 0 auto; width: 100%; height: auto; aspect-ratio: 414 / 576; -webkit-mask-image: linear-gradient(#000 55%, #0008 71%, transparent 94%); mask-image: linear-gradient(#000 55%, #0008 71%, transparent 94%); }
.details-art img { object-position: top center; }
.details-copy { position: relative; padding-inline: 16px; }
.details-copy h2 { margin: 0; font: 600 italic 2rem/1.2 var(--heading); }
.details-copy p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.details-body { position: relative; display: grid; gap: 20px; padding: 0 16px 24px; }
.character-detail-tags {
  --tag-height: 26px;
  align-content: start;
  min-inline-size: 0;
  max-block-size: calc(2 * var(--tag-height) + 8px);
  overflow: hidden;
}
.character-detail-tags .tag {
  flex: none;
  block-size: var(--tag-height);
  max-inline-size: 100%;
  padding-inline: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.character-chat-footer { flex: none; padding: 0 16px 12px; }
.character-chat-footer .button { width: 100%; min-height: 52px; border-radius: 16px; font-size: .9375rem; }
.role-details-page[data-from-chat] .character-chat-footer { display: none; }
.details-intro summary, .details-body .opening h2 { margin: 0; font: 600 italic 1.5rem/1.2 var(--heading); }
.details-intro summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.details-intro summary::-webkit-details-marker { display: none; }
.details-intro summary::after { content: '⌄'; color: var(--muted); font-size: .8em; }
.details-intro p { margin: 10px 0 0; color: #a9a0ad; font-size: .9rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.details-body .opening { margin: 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.details-body .opening p { color: #c9c2ce; }

.page.media-page:not(.with-tabs) { padding-bottom: 0; }
.media-backdrop::after { background: #000b; }
.media-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; margin-top: clamp(42px, 16vh, 160px); padding-bottom: var(--safe-bottom); overflow: hidden; border-radius: 28px 28px 0 0; background: #211b29; }
.media-panel::before { align-self: center; width: 40px; height: 4px; margin: 11px 0 13px; border-radius: 4px; background: #8c8491; content: ''; }
.media-panel .secondary-header { display: flex; justify-content: start; min-height: 54px; gap: 4px; background: transparent; }
.media-panel .secondary-header h1 { text-align: start; }
.media-library { padding: 0 0 14px; }
.media-carousel { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.media-tile { position: relative; flex: 0 0 100%; padding: 0; overflow: hidden; aspect-ratio: 3 / 4; scroll-snap-align: start; background: var(--background); }
.media-tile .picture { width: 100%; height: 100%; }
.media-tile > span:last-child:not(.picture) { position: absolute; right: 6px; bottom: 6px; border-radius: 50%; padding: 2px 6px; background: #100e12bf; }

.sheet {
  --sheet-content-padding: 16px;
  --sheet-title-gap: 16px;
  position: fixed;
  inset: auto var(--safe-right) 0 var(--safe-left);
  width: min(calc(100% - var(--safe-left) - var(--safe-right)), var(--app-max-width));
  max-width: none;
  max-height: calc(var(--app-height, var(--viewport-height)) * .9 - var(--safe-top));
  margin: 0 auto;
  padding: 0;
  overflow-x: hidden;
  color: var(--body);
  border: 1px solid #ffffff20;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--panel);
}

.sheet::backdrop { background: #08040cbf; }
.sheet[open] { animation: sheet-in .18s ease-out; }
.sheet-body { display: grid; gap: 8px; padding: 8px var(--sheet-content-padding) calc(16px + var(--safe-bottom)); }
.sheet-header { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.sheet:not(.video-viewer) > .sheet-body > .sheet-header { margin-block-end: calc(var(--sheet-title-gap) - 8px); }
.sheet-header h2 { grid-column: 2; overflow-wrap: anywhere; text-align: center; }
.sheet > .sheet-body > .picture, .sheet > .sheet-body > video { width: 100%; }
.sheet > .sheet-body > .picture img, .sheet video { max-height: calc(var(--app-height, var(--viewport-height)) * .68); object-fit: contain; }

.image-crop-layout { overflow: auto; }
.image-crop-stage {
  position: relative;
  container-type: size;
  flex: 1 0 120px;
  min-height: 0;
  overflow: hidden;
  background: var(--background);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.image-crop-stage.is-dragging { cursor: grabbing; }
.image-crop-frame {
  --crop-size: min(calc(100cqw - 24px), calc((100cqh - 24px) * var(--crop-ratio)), 440px);
  position: absolute;
  inset: 0;
  width: var(--crop-size);
  height: calc(var(--crop-size) / var(--crop-ratio));
  margin: auto;
}
.image-crop-frame.is-circle {
  --crop-size: min(calc(100cqw - 24px), calc(100cqh - 24px), 340px);
  border-radius: 50%;
  overflow: hidden;
}
.image-crop-source { position: absolute; display: block; max-width: none; height: auto; pointer-events: none; }
.image-crop-frame::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #fff;
  pointer-events: none;
  content: '';
}
.image-crop-frame:not(.is-circle)::after {
  box-shadow: inset 0 0 0 1px #fff, 0 0 0 100vmax #000a;
  background:
    linear-gradient(90deg, #fff5 1px, transparent 1px) left top / 33.333% 100% repeat-x,
    linear-gradient(#fff5 1px, transparent 1px) left top / 100% 33.333% repeat-y;
}
.image-crop-frame:not(.is-circle)::before {
  --corner: linear-gradient(#fff, #fff);
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: '';
  background:
    var(--corner) left top / 12px 2px no-repeat,
    var(--corner) left top / 2px 12px no-repeat,
    var(--corner) right top / 12px 2px no-repeat,
    var(--corner) right top / 2px 12px no-repeat,
    var(--corner) left bottom / 12px 2px no-repeat,
    var(--corner) left bottom / 2px 12px no-repeat,
    var(--corner) right bottom / 12px 2px no-repeat,
    var(--corner) right bottom / 2px 12px no-repeat;
}
.image-crop-footer { padding-block-start: 8px; }
.image-crop-status:empty { display: none; }

.sheet.confirm-dialog {
  --sheet-content-padding: 20px;
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  width: min(312px, calc(100% - 48px - var(--safe-left) - var(--safe-right)));
  height: fit-content;
  max-height: calc(var(--app-height, var(--viewport-height)) - 48px - var(--safe-top) - var(--safe-bottom));
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #fff1;
  border-radius: 20px;
}
.sheet.confirm-dialog::backdrop { background: #0009; }
.sheet.confirm-dialog[open] { animation: confirm-dialog-in 150ms ease-out; }
.sheet.confirm-dialog[data-closing] { animation: confirm-dialog-out 150ms ease-in both; }
.sheet.confirm-dialog[data-closing]::backdrop { animation: confirm-dialog-out 150ms ease-in both; }
.confirm-dialog-content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 32px;
  padding: 32px var(--sheet-content-padding) 20px;
  text-align: center;
  outline: 0;
}
.confirm-dialog-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: .5px solid #ffffff4d;
  background: #ffffff1a;
}
.confirm-dialog-icon[data-icon='dialog-premium'] { border-color: #eecc9133; background: #eecc9114; }
.confirm-dialog-icon[data-icon='chat-overload-warning'] { border-color: #ff4d504d; background: #ff4d501a; }
.confirm-dialog-details { display: grid; width: 100%; gap: var(--sheet-title-gap); overflow-wrap: anywhere; }
.confirm-dialog-details h2 { color: #fff; }
.confirm-dialog-details p { margin: 0; color: #999b9c; font-size: .75rem; line-height: 1.4; }
.confirm-dialog-details .confirm-dialog-error { color: #fff; }
.confirm-dialog-error:empty { display: none; }
.confirm-dialog-actions { display: flex; width: 100%; gap: 12px; }
.confirm-dialog-actions .button {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  min-height: 52px;
  place-items: center;
  padding: 8px 12px;
  border-radius: 40px;
  font-size: .9375rem;
  overflow-wrap: anywhere;
}
.confirm-dialog-actions .confirm-dialog-cancel { color: #999b9c; }
.confirm-dialog-actions .confirm-dialog-submit {
  color: #060606;
  background: linear-gradient(90deg, #f3ccdc, #fbeff4 53%, #dedeea);
}
.confirm-dialog-submit[aria-busy='true'] { opacity: 1; }
.confirm-dialog-close { position: absolute; inset-block-start: 12px; inset-inline-end: var(--sheet-content-padding); }
.confirm-dialog-content:has(> .confirm-dialog-close):not(:has(> .confirm-dialog-icon)) { padding-block-start: 64px; }
.confirm-dialog-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #06060633;
  border-top-color: #060606;
  border-radius: 50%;
  animation: confirm-dialog-spin .7s linear infinite;
}
@keyframes confirm-dialog-in { from { opacity: 0; } }
@keyframes confirm-dialog-out { to { opacity: 0; } }
@keyframes confirm-dialog-spin { to { transform: rotate(360deg); } }

.sway-toast {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 32px - var(--safe-left) - var(--safe-right));
  height: fit-content;
  min-height: 32px;
  margin: auto;
  padding: 8px 16px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: rgb(102 102 102 / 50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: .75rem;
  line-height: 16px;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.sway-toast:empty { visibility: hidden; }
.sway-toast img { flex: none; }
@media (prefers-reduced-motion: reduce) {
  .sheet.confirm-dialog[open], .confirm-dialog-spinner { animation: none; }
}

.sheet:is(.video-viewer, .chat-photo-viewer) {
  inset: 0;
  width: min(100%, var(--app-max-width));
  height: var(--viewport-height);
  max-height: none;
  border: 0;
  border-radius: 0;
  background: var(--background);
}
.sheet:is(.video-viewer, .chat-photo-viewer)::backdrop { background: var(--background); }
.sheet.video-viewer { background: #000; }
.video-viewer .sheet-body { position: relative; height: 100%; padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); }
.video-viewer-player { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.video-viewer-stage { position: relative; min-height: 0; }
.video-viewer .video-viewer-stage > video { display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; pointer-events: none; }
.video-viewer-toggle { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; }
.video-viewer-progress {
  appearance: none;
  -webkit-appearance: none;
  width: calc(100% - 32px);
  height: 44px;
  margin: 0 auto;
  background: linear-gradient(to right, #fff var(--video-progress, 0%), #fff5 0) center / 100% 3px no-repeat;
}
.video-viewer-progress::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.video-viewer-progress::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; }
.video-viewer-progress:disabled { opacity: .5; }
.video-viewer .sheet-header { position: absolute; z-index: 1; inset: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 8px) auto auto; display: block; }
.video-viewer .sheet-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.video-viewer .sheet-header button { background: #0009; color: #fff; }

@keyframes sheet-in {
  from { opacity: .55; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.onboarding-body { padding: 24px 20px; }
.onboarding-body h1 { margin: 8px 0 24px; color: #f0d7ee; font: 600 italic 1.8rem/1.2 var(--heading); }
.onboarding-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.onboarding-fields { display: grid; gap: 12px; }
.onboarding-fields input { min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff13; }
.onboarding-status { margin: 0; color: #f5c8cf; font-size: .8rem; }
.onboarding-status:empty { display: none; }

.favorite-button.icon-button { flex: 0 0 48px; width: 48px; height: 48px; }
.favorite-button img {
  width: 42px;
  height: 39px;
  /* The SVG includes extra space below the heart for its shadow. */
  transform: translateY(3px);
}
.favorite-button .favorite-selected,
.favorite-button[aria-pressed='true'] .favorite-outline { display: none; }
.favorite-button[aria-pressed='true'] .favorite-selected { display: block; }
.swipe-identity .favorite-button { margin-block: -4px; }
.favorite-notice { position: fixed; z-index: 7; inset: auto 12px calc(var(--safe-bottom) + 92px); width: fit-content; margin-inline: auto; padding: 9px 16px; border-radius: 14px; background: #3a2e40; color: #fff; text-align: center; }
.thread-title { text-decoration: none; }
