:root {
  --bg: #131313;
  --panel: #1a1a1a;
  --panel-soft: #1f1f1f;
  --line: #2a2a2e;
  --text: #ffffff;
  --muted: #a0a0a0;
  --accent: #f97187;
  --accent-2: #e65073;
  --accent-3: #ffc857;
  --accent-hover: #2d1a1f;
  --accent-semi: #f9718869;
  --glow: #ec4a7dab;
  --danger: #ff6b6b;
  --ok: #51d88a;
  --shadow: 0 24px 70px rgb(0 0 0 / 0.45);
  --radius-card: 16px;
  color-scheme: dark;
  font-family:
    Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.mobile-tabbar {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 196px minmax(320px, 1fr) auto;
  align-items: center;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: #131313;
}

.header-left,
.header-actions,
.gender-tabs {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 22px;
  padding: 0 30px;
}

.hamburger {
  display: grid;
  gap: 6px;
  width: 34px;
  border: 0;
  padding: 0;
  background: transparent;
}

.hamburger span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.site-brand strong {
  font-size: 25px;
  letter-spacing: 0.5px;
  font-weight: 900;
  white-space: nowrap;
}

.site-brand span {
  color: var(--accent);
}

.brand-logo {
  flex: 0 0 auto;
}

.gender-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0 15px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

.header-cta {
  min-height: 38px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
}

.header-login {
  min-height: 38px;
  padding: 8px 16px;
  color: #fff;
  font-weight: 700;
}

.profile-button .chevron {
  opacity: 0.7;
  font-size: 12px;
}

/* Auth-aware header: guests see CTA + Login, members see Premium + Profile. */
body.signed-in .header-cta,
body.signed-in .header-login {
  display: none;
}

body:not(.signed-in) .premium-pill,
body:not(.signed-in) .profile-button {
  display: none;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 500 !important;
}

.auth-check input {
  width: auto;
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.auth-links {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.nav-icon svg {
  display: block;
}

.gender-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.header-actions {
  justify-content: end;
  gap: 22px;
  padding-right: 20px;
}

.premium-pill {
  min-height: 40px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 6px 14px;
  background: var(--accent-hover);
  color: #fff;
  font-weight: 700;
}

.premium-pill strong {
  color: var(--accent);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 28%, #ffd5dd 0 24%, transparent 25%),
    linear-gradient(135deg, #ff7ba2, #ff4f85);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.sidebar {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px 12px;
  border-right: 1px solid rgb(255 255 255 / 0.05);
  background: #1a1a1a;
}

.sidebar .brand,
.account-panel {
  display: none;
}

.support-nav {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #242428;
}

.secondary-nav {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #242428;
}

.discount-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e20e3a;
  color: #fff;
  font-size: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.muted {
  color: var(--muted);
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.nav-link:hover {
  border-color: rgb(255 255 255 / 0.16);
  background: #232323;
  color: #fff;
}

.nav-link.active {
  border-color: rgb(255 255 255 / 0.1);
  background: #303030;
  color: #fff;
  font-weight: 500;
}

.secondary-nav {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #242428;
}

.secondary-nav .nav-link {
  margin-top: 0;
  border: 1px solid rgb(249 113 135 / 0.28);
  background: rgb(249 113 135 / 0.06);
  color: #ffd56a;
}

.secondary-nav .nav-link:hover,
.secondary-nav .nav-link.active {
  border-color: rgb(249 113 135 / 0.45);
  background: rgb(249 113 135 / 0.1);
}

.nav-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  font-weight: 600;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
}

.discount-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e20e3a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.support-nav {
  display: grid;
  gap: 5px;
  margin-top: auto;
}

.support-nav .nav-link {
  min-height: 34px;
  border: 1px solid #28282c;
  background: #131313;
  color: #b8b4bc;
  font-size: 12px;
  font-weight: 650;
}

.support-nav .nav-link:hover,
.support-nav .nav-link.active {
  border-color: #45454c;
  background: #2e2e34;
  color: #f0edf2;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: #8a868e;
  font-size: 11px;
}

.legal-links i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #666;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-links a:hover {
  color: var(--accent);
}

.account-panel {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid #2a2a2e;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgb(249 113 135 / 0.16), rgb(230 80 115 / 0.1)),
    var(--panel);
}

.account-panel .button.secondary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.account-panel > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}

.main {
  min-width: 0;
  padding: 50px min(5.6vw, 112px) 54px;
}

.topbar,
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar {
  display: none;
}

.topbar .eyebrow {
  display: none;
}

.topbar-actions {
  margin-left: auto;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.section-bar h2 {
  font-size: 28px;
}

.topbar h1,
.section-bar h2,
.hero h2,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions,
.hero-actions,
.segmented,
.ask-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #161616;
}

.segmented button {
  border-color: transparent;
  background: transparent;
}

.segmented button.active {
  background: #fff;
  color: #111;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.button,
.icon-button,
.segmented button,
.choice,
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 40px;
  padding: 9px 14px;
  background: var(--panel-soft);
  color: var(--text);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.button:hover,
.icon-button:hover,
.segmented button:hover,
.choice:hover,
.tag:hover {
  transform: translateY(-1px);
  border-color: #515b63;
}

.button:active,
.icon-button:active,
.segmented button:active {
  transform: scale(0.96);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(215deg, #ff7b91 5%, #e65073 67%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 24px -8px var(--accent-semi);
}

.button.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 30px -8px var(--accent-semi);
}

.button.premium {
  border-color: #543f16;
  background: #23180b;
  color: #ffd67a;
  font-weight: 900;
}

.button.secondary {
  border-color: var(--line);
  background: #242424;
  color: #fff;
}

.button.secondary:hover {
  background: var(--accent-hover);
  border-color: var(--accent);
}

.button.ghost {
  background: transparent;
}

.button.compact,
.icon-button {
  min-height: 34px;
  padding: 7px 10px;
}

.button.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-strip {
  display: none;
}

.home-strip h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 48px);
}

.promo-carousel {
  position: relative;
  margin-bottom: 44px;
}

.promo-slide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.1fr);
  min-height: 318px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgb(116 83 154 / 0.48), rgb(5 16 27 / 0.98) 64%),
    #12141c;
}

.promo-collage {
  position: relative;
  min-height: 318px;
}

.promo-person {
  position: absolute;
  bottom: 0;
  width: 39%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.person-1 {
  left: 4%;
  height: 78%;
  z-index: 2;
}

.person-2 {
  left: 22%;
  width: 48%;
  z-index: 3;
}

.person-3 {
  left: 57%;
  height: 83%;
  z-index: 2;
}

.promo-copy {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 30px;
  padding: 34px;
}

.promo-copy h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 70px);
  line-height: 1.04;
  font-weight: 900;
  text-align: center;
  text-wrap: balance;
}

.promo-copy h2 span {
  color: #f97187;
}

.create-now {
  min-width: 320px;
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ff83a9, #ff4d86);
  color: #fff;
  font-weight: 1000;
  font-size: 28px;
  box-shadow: 0 0 28px rgb(255 78 135 / 0.8);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 58px;
  transform: translateY(-50%);
}

.carousel-arrow.left {
  left: 18px;
}

.carousel-arrow.right {
  right: 18px;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.carousel-dots button {
  width: 24px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.34);
}

.carousel-dots button.active {
  background: #f97187;
}

.story-rail {
  display: flex;
  gap: 30px;
  margin-bottom: 36px;
  overflow-x: auto;
  padding: 0 0 10px;
}

.story-item {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 110px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
}

.story-avatar {
  position: relative;
  z-index: 0;
  display: block;
  width: 120px;
  height: 120px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.story-avatar::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: inherit;
  background: rgb(255 47 120 / 0.28);
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.story-avatar.muted-ring {
  background: linear-gradient(135deg, #555, var(--accent));
}

.story-avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 3px solid var(--bg);
  border-radius: 50%;
  object-fit: cover;
}

.live-section {
  margin-bottom: 48px;
}

.live-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.live-heading h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

.live-heading h2 strong {
  color: var(--accent);
  font-weight: 600;
}

.live-heading em {
  margin-left: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #333;
  color: #fff;
  font-size: 13px;
  font-style: normal;
}

.live-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 330px);
  gap: 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}

.live-card {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 18px;
  scroll-snap-align: start;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.94)),
    var(--cover) center/cover;
}

.live-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgb(15 19 28 / 0.72);
  font-weight: 900;
}

.live-badge i {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10d67c;
}

.live-badge i::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: rgb(16 214 124 / 0.4);
  opacity: 0;
  transform: scale(0.75);
  pointer-events: none;
}

.live-copy {
  position: absolute;
  inset: auto 0 0;
  padding: 20px;
}

.live-copy h3 {
  margin: 0 0 10px;
  font-size: 31px;
  line-height: 1;
}

.play-button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #6056f5;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.play-button:hover {
  background: #7268ff;
}

.circle-next {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 42px;
}

.discover-section {
  padding-top: 4px;
}

.character-grid,
.plan-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.character-card,
.detail-card,
.studio-controls,
.chat-panel,
.conversation-list,
.builder-preview,
.plan-card,
.ledger-panel,
.admin-card,
.media-card,
.job-card,
.collection-empty {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.character-card {
  overflow: hidden;
  position: relative;
  border-color: transparent;
  border-radius: var(--radius-card);
  background: #1a1a1a;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Candy-style bottom glow that intensifies on hover. */
.character-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(269% 50% at 50% 101%, var(--glow) 0%, #0000 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.character-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 50px -18px var(--accent-semi);
}

.character-card:hover::after {
  opacity: 1;
}

.character-art {
  position: relative;
  aspect-ratio: 3 / 4.4;
  background: var(--panel-soft);
}

/* Dark gradient over the lower image so name/badges stay legible. */
.character-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, #131313e6 0%, #13131300 46%);
}

/* "Create new AI" tile on the My AI page (candy.ai style). */
.create-ai-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  aspect-ratio: 3 / 4.4;
  border: 0;
  border-radius: var(--radius-card);
  background: linear-gradient(165deg, #ff8fb0 0%, var(--accent) 45%, var(--accent-2) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.create-ai-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 50px -18px var(--accent-semi);
}

.create-ai-plus {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.22);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.character-art img,
.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-row,
.card-actions,
.detail-actions,
.capability-list,
.media-actions,
.ledger-row,
.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge,
.capability,
.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.premium,
.job-status.completed {
  border-color: #6f5524;
  color: #ffe0a3;
  background: #2a2114;
}

.character-card .badge {
  border-color: rgb(255 255 255 / 0.16);
  background: rgb(0 0 0 / 0.36);
  color: #fff;
  backdrop-filter: blur(10px);
}

.character-card .badge.premium {
  border-color: #ffd67a;
  color: #ffd67a;
}

.card-body,
.plan-card,
.admin-card,
.job-card,
.media-card figcaption,
.collection-empty {
  padding: 14px;
}

.character-card .card-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 54px 14px 14px;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 0.84) 42%, rgb(0 0 0 / 0.96));
}

.character-card h3 {
  font-size: 20px;
}

.character-card .card-body p {
  display: none;
}

.character-card .badge-row {
  margin-bottom: 8px;
}

.character-card .card-actions {
  margin-top: 10px;
}

.character-card .button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.character-card .button.ghost,
.character-card .button.secondary {
  border-color: rgb(255 255 255 / 0.16);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

.card-body h3,
.detail-text h2,
.plan-card h3,
.admin-card h3,
.builder-preview h3 {
  margin: 0 0 8px;
}

.card-body p,
.detail-text p,
.plan-card p,
.admin-card p,
.builder-preview p {
  color: var(--muted);
  line-height: 1.5;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(260px, 460px) minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgb(255 63 134 / 0.14), transparent 36%),
    var(--panel);
}

.detail-card img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.detail-text {
  padding: 28px;
}

.private-box,
.memory-strip,
.ledger-panel,
.token-pack-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  min-height: 680px;
}

.conversation-list,
.chat-panel {
  min-height: 680px;
}

.conversation-list {
  padding: 12px;
}

.conversation-item {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  border-color: var(--line);
  background: var(--panel-soft);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
}

.message {
  max-width: min(720px, 86%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
  background: var(--panel-soft);
}

.message.user {
  align-self: flex-end;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.message-image {
  padding: 6px;
  overflow: hidden;
}

.message-image img {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
}

.chat-image-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 200px;
  color: var(--muted, #9aa);
}

.thread-actions button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.message-voice {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-voice audio {
  width: 240px;
  max-width: 100%;
}

.voice-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.voice-wave {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.voice-wave i {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  animation: voice-wave 1s infinite ease-in-out;
}

.voice-wave i:nth-child(2) { animation-delay: 0.15s; height: 18px; }
.voice-wave i:nth-child(3) { animation-delay: 0.3s; height: 10px; }
.voice-wave i:nth-child(4) { animation-delay: 0.45s; height: 16px; }

@keyframes voice-wave {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1.2); }
}

.voice-caption {
  opacity: 0.7;
}

.call-avatar {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.call-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  animation: call-pulse 2s infinite ease-in-out;
}

@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 80, 140, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(255, 80, 140, 0); }
}

.call-timer {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}

.call-status {
  text-align: center;
  opacity: 0.7;
}

.call-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.button.danger {
  background: #d83a5a;
  color: #fff;
}

.message:not(.user):not(.system) {
  background: #1a1a26;
}

.message.system {
  align-self: center;
  color: var(--muted);
  background: transparent;
}

.ask-row {
  padding: 12px 18px 0;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #0d0d14;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.builder,
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.builder-main {
  display: grid;
  gap: 16px;
}

fieldset,
.studio-controls {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

fieldset[hidden] {
  display: none;
}

legend {
  padding: 0 8px;
  color: var(--text);
  font-weight: 900;
}

.option-grid,
.tag-picker,
.prompt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice.selected,
.tag.selected,
.segmented button.active {
  border-color: var(--accent);
  background: #341d1a;
  color: #ffd2cb;
}

.builder-preview {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.preview-avatar {
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    radial-gradient(circle at 32% 25%, #f7d1a0 0 12%, transparent 13%),
    linear-gradient(135deg, #321a4f, #8e174c 58%, #161616);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  color: var(--muted);
}

.studio {
  grid-template-columns: 340px minmax(0, 1fr);
}

.job-board {
  min-width: 0;
}

.job-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.media-card {
  overflow: hidden;
  margin: 0;
}

.media-card img {
  aspect-ratio: 1;
}

.plan-card.featured {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgb(249 113 135 / 0.2), rgb(230 80 115 / 0.14)),
    var(--panel);
}

.price {
  font-size: 34px;
  font-weight: 900;
}

.ledger-row {
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.ledger-row:first-child {
  border-top: 0;
}

.token-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade 0.22s ease-out;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: modal-rise 0.26s ease-out;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

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

.nav-tooltip {
  position: fixed;
  z-index: 2147483000;
  min-width: 44px;
  max-width: min(220px, calc(100vw - 24px));
  padding: 9px 12px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 8px;
  background: #2b2b2f;
  color: #fff;
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.52);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.nav-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
}

.nav-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 9px;
  height: 9px;
  transform: translateY(-50%) rotate(45deg);
  border-bottom: 1px solid rgb(255 255 255 / 0.16);
  border-left: 1px solid rgb(255 255 255 / 0.16);
  background: #2b2b2f;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
    padding: 12px;
  }

  .header-left,
  .header-actions,
  .gender-tabs {
    justify-content: space-between;
    width: 100%;
    padding: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .support-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .promo-slide {
    grid-template-columns: 1fr;
  }

  .promo-copy {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(0 0 0 / 0.42), rgb(0 0 0 / 0.7));
  }

  .hero,
  .detail-card,
  .chat-layout,
  .builder,
  .studio {
    grid-template-columns: 1fr;
  }

  .builder-preview {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-brand strong {
    font-size: 23px;
  }

  .gender-tabs {
    gap: 2px;
    overflow-x: auto;
  }

  .gender-tabs button {
    min-width: 110px;
  }

  .profile-button {
    font-size: 0;
  }

  .main,
  .sidebar {
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-bar,
  .chat-header,
  .job-card {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-content {
    padding: 22px 0;
  }

  .hero-media {
    min-height: 300px;
  }

  .promo-slide,
  .promo-collage {
    min-height: 290px;
  }

  .promo-copy h2 {
    font-size: 34px;
  }

  .create-now {
    min-width: 220px;
    min-height: 52px;
    font-size: 21px;
  }

  .story-avatar {
    width: 88px;
    height: 88px;
  }

  .story-rail {
    gap: 14px;
  }

  .live-row {
    grid-auto-columns: minmax(245px, 78vw);
    gap: 16px;
  }

  .topbar-actions,
  .hero-actions {
    width: 100%;
  }

  .topbar-actions .button,
  .hero-actions .button {
    flex: 1 1 160px;
  }
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  overflow: hidden;
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: 0;
}

.profile-menu-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/* Narrow-sidebar cleanup for phone-width previews. */
@media (max-width: 560px) {
  html,
  body {
    height: 100%;
    overflow: auto;
  }

  .site-header {
    position: sticky;
    grid-template-columns: 1fr auto;
    height: 110px;
    padding: 0 48px 0 70px;
    border-bottom-color: #323235;
    background: #111;
  }

  .header-left {
    gap: 46px;
    padding: 0;
  }

  .hamburger {
    width: 48px;
    gap: 8px;
  }

  .hamburger span {
    height: 4px;
  }

  .site-brand strong {
    font-size: 48px;
    letter-spacing: 0;
    font-weight: 900;
  }

  .gender-tabs {
    grid-column: 2;
    justify-self: end;
    width: auto;
    align-self: stretch;
  }

  .gender-tabs button {
    display: none;
    min-width: 44px;
    padding: 0 10px;
    font-size: 0;
  }

  .gender-tabs button.active {
    display: block;
    border-bottom-width: 6px;
  }

  .header-actions {
    display: none;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 48px 47px 26px;
    border-right: 1px solid #343438;
    background: #111;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .nav {
    gap: 16px;
  }

  .secondary-nav {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid #2c2c30;
  }

  .nav-link {
    min-height: 80px;
    padding: 0 24px;
    border: 1px solid #2d2d30;
    border-radius: 18px;
    background: #111;
    color: #e7e4e8;
    font-size: 24px;
    font-weight: 850;
  }

  .nav-link.active {
    margin-left: 0;
    padding: 0 24px;
    border-color: #2d2d30;
    background: #111;
    color: #fff;
  }

  .secondary-nav .nav-link {
    margin: 0;
    padding: 0 24px;
    border: 1px solid #2d2d30;
    background: #111;
    color: #ffd56a;
  }

  .nav-icon {
    width: 42px;
    height: 42px;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
  }

  .discount-badge {
    margin-left: auto;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 18px;
  }

  .support-nav {
    gap: 14px;
    margin: 34px -47px 0;
    padding: 36px 47px 0;
    border-top: 1px solid #343438;
  }

  .support-nav .nav-link {
    min-height: 64px;
    margin: 0;
    padding: 0 24px;
    border: 1px solid #2b2b2f;
    border-radius: 16px;
    background: #131313;
    color: #e6e3e7;
    font-size: 20px;
    font-weight: 850;
  }

  .support-nav .nav-link:not(.active) {
    background: #111 !important;
  }

  .support-nav .nav-link.active {
    border-color: #5f5d6a;
    background: #44434d;
    color: #f0edf2;
  }

  .support-nav .nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: transparent;
    font-size: 20px;
  }

  .legal-links {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    color: #f0eef2;
    font-size: 16px;
  }

  .account-panel {
    display: none;
  }

  .legal-links i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
  }

  .main {
    display: none;
  }
}

/* Candy-style chat surface */
.chat-app {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr) minmax(0, 380px);
  min-height: calc(100vh - 64px);
  margin: -36px calc(min(4.6vw, 82px) * -1) -46px;
  border-top: 1px solid var(--line);
  background: #131313;
}

.chat-list-panel {
  padding: 28px 16px 18px;
  border-right: 1px solid var(--line);
  background: #1a1a1a;
}

.chat-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.chat-list-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.new-group-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: #2b2b2d;
  color: #fff;
  font-weight: 850;
  font-size: 14px;
}

.chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: #242426;
  color: #9ca0ad;
}

.chat-search span {
  padding-left: 12px;
  font-size: 22px;
}

.chat-search input {
  border: 0;
  min-height: 58px;
  background: transparent;
  font-size: 16px;
}

.chat-contact-list {
  display: grid;
  gap: 8px;
}

.chat-contact-list .conversation-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  margin: 0;
  border-radius: 10px;
  padding: 10px 12px;
}

.chat-contact-list .conversation-item.active,
.chat-contact-list .conversation-item:hover {
  border-color: transparent;
  background: #202024;
}

.chat-contact-list .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.conversation-copy {
  min-width: 0;
}

.chat-contact-list .conversation-item {
  position: relative;
}

.conversation-delete {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.conversation-item:hover .conversation-delete {
  opacity: 1;
}

.conversation-delete:hover {
  background: rgb(255 107 107 / 0.16);
  color: var(--danger);
}

.conversation-copy strong,
.conversation-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy strong {
  margin-bottom: 6px;
  font-size: 15px;
}

.conversation-copy small,
.conversation-item time {
  color: #b6b1bd;
  font-size: 13px;
}

.chat-thread-panel {
  display: grid;
  grid-template-rows: 104px minmax(0, 1fr) auto auto;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #131313;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.thread-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.thread-person .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.thread-person strong {
  font-size: 21px;
}

.thread-actions {
  display: flex;
  gap: 18px;
}

.thread-actions button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.chat-thread-panel .message-list {
  padding: 34px 26px;
  background: #131313;
}

.chat-thread-panel .message {
  max-width: min(620px, 78%);
  border: 0;
  border-radius: 10px 20px 20px 10px;
  padding: 11px 18px;
  background: #252525;
  color: #e7e2e7;
  font-size: 15px;
  line-height: 1.42;
}

.chat-thread-panel .message.user {
  align-self: flex-end;
  border-radius: 20px 10px 10px 20px;
}

.message-time {
  margin-top: -8px;
  color: #706d76;
  font-size: 12px;
}

.message-time.user {
  align-self: flex-end;
}

.chat-thread-panel .ask-row {
  display: none;
}

.candy-composer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 20px 28px 28px;
  border: 1px solid #303034;
  border-radius: 28px;
  padding: 20px 22px;
  background: #242426;
}

.candy-composer input,
.candy-composer textarea {
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 16px;
}

.candy-composer input:focus,
.candy-composer input:focus-visible,
.candy-composer textarea:focus,
.candy-composer textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.candy-composer textarea {
  max-height: 180px;
  overflow-y: auto;
  resize: none;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 4px;
}

.composer-attachments[hidden] {
  display: none;
}

.composer-attachment,
.message-attachment {
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: min(280px, 100%);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 12px;
  padding: 5px 7px;
  background: rgb(255 255 255 / 0.05);
}

.composer-attachment img,
.composer-attachment video,
.message-attachment img,
.message-attachment video {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #050505;
}

.composer-attachment b,
.message-attachment b {
  overflow: hidden;
  color: #f3eef3;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-attachment {
  grid-template-columns: 42px minmax(0, 1fr);
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa5ae;
  font-size: 13px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 35px;
  border: 1px solid #56545b;
  border-radius: 999px;
  padding: 0 13px;
  background: transparent;
  color: #fff;
  font-weight: 750;
}

.tool-chip.icon-only {
  width: 35px;
  padding: 0;
  justify-content: center;
}

.video-settings-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.video-settings-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 20;
  display: grid;
  gap: 8px;
  width: 230px;
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 0.15);
  border-radius: 16px;
  background: #2a2a2a;
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.42);
  transform: translateX(-50%);
}

.video-settings-popover[hidden] {
  display: none;
}

.video-settings-popover span {
  color: #a9a3ad;
  font-size: 16px;
  font-weight: 700;
}

.video-settings-popover strong {
  padding-bottom: 4px;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  font-size: 20px;
  line-height: 1.1;
}

.video-length-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #383838;
}

.video-length-options button {
  min-height: 54px;
  border: 0;
  background: transparent;
  color: #bbb5be;
  font-size: 20px;
  font-weight: 850;
}

.video-length-options button.active {
  background: #747474;
  color: #fff;
}

.send-fab {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(215deg, #ff7b91 5%, #e65073 67%);
  color: #fff;
  font-size: 21px;
}

.chat-profile-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  background: #2a2a2e;
}

.profile-media {
  position: relative;
  aspect-ratio: 402 / 594;
  overflow: hidden;
}

.profile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.version-badge {
  position: absolute;
  top: 30px;
  right: 28px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e65073, #df4b9a);
  color: #fff;
  font-weight: 900;
}

.profile-arrow {
  position: absolute;
  top: 48%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid rgb(255 255 255 / 0.78);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.24);
  color: #fff;
  font-size: 36px;
}

.profile-arrow.left {
  left: 24px;
}

.profile-arrow.right {
  right: 24px;
}

.profile-dots {
  position: absolute;
  left: 50%;
  bottom: 26px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.profile-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgb(255 255 255 / 0.32);
  cursor: pointer;
}

.profile-dots .active {
  background: #9aa2b2;
}

.profile-summary {
  padding: 28px 28px 26px;
  border-bottom: 1px solid #3a3a3d;
}

.profile-summary h2 {
  margin: 0 0 10px;
  font-size: 27px;
}

.profile-summary p {
  margin: 0;
  max-width: 320px;
  color: #e5dee4;
  font-size: 15px;
  line-height: 1.45;
}

.about-panel {
  padding: 28px;
}

.about-panel > strong {
  display: block;
  margin-bottom: 24px;
  color: #bdb8bf;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.about-grid span {
  display: grid;
  gap: 4px;
}

.about-grid i {
  color: #b6b1bd;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.about-grid b {
  font-size: 15px;
}

/* UI polish pass: reduce oversized hero typography and tighten product density. */
.site-header {
  height: 64px;
  grid-template-columns: 196px minmax(280px, 1fr) auto;
}

.header-left {
  gap: 18px;
  padding: 0 24px;
}

.hamburger {
  width: 30px;
  gap: 5px;
}

.hamburger span {
  height: 2px;
}

.site-brand strong {
  font-size: 25px;
}

.gender-tabs {
  gap: 20px;
}

.gender-tabs button {
  border-bottom-width: 4px;
  padding: 0 15px;
  font-size: 15px;
}

.header-actions {
  gap: 14px;
}

.premium-pill {
  min-height: 34px;
  border-radius: 12px;
  padding: 5px 12px;
  font-size: 14px;
}

.profile-button {
  gap: 10px;
  font-size: 14px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
}

.app-shell {
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  gap: 12px;
  padding: 24px 12px 14px;
}

.nav,
.support-nav {
  gap: 8px;
}

.nav-link {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 400;
}

.nav-icon {
  width: 18px;
  height: 18px;
  font-size: 12px;
}

.discount-badge {
  padding: 2px 6px;
  font-size: 10px;
}

.main {
  padding: 36px min(4.6vw, 82px) 46px;
}

.promo-carousel {
  margin-bottom: 30px;
}

.promo-slide {
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1fr);
  min-height: 252px;
  border-radius: 10px;
}

.promo-collage {
  min-height: 252px;
}

.promo-copy {
  gap: 22px;
  padding: 26px;
}

.promo-copy h2 {
  font-size: clamp(30px, 3.7vw, 48px);
  line-height: 1.08;
}

.create-now {
  min-width: 230px;
  min-height: 50px;
  border-radius: 14px;
  font-size: 20px;
  box-shadow: 0 0 18px rgb(255 78 135 / 0.55);
}

.carousel-arrow {
  width: 34px;
  height: 34px;
  font-size: 42px;
}

.carousel-arrow.left {
  left: 14px;
}

.carousel-arrow.right {
  right: 14px;
}

.carousel-dots {
  bottom: 14px;
}

.carousel-dots button {
  width: 18px;
  height: 5px;
}

.story-rail {
  gap: 20px;
  margin-bottom: 26px;
}

.story-item {
  min-width: 90px;
  gap: 9px;
  font-size: 13px;
}

.story-avatar {
  width: 88px;
  height: 88px;
  padding: 4px;
}

.story-avatar img {
  border-width: 3px;
}

.live-section {
  margin-bottom: 34px;
}

.live-heading {
  margin-bottom: 14px;
}

.live-heading h2 {
  font-size: 28px;
}

.live-heading em {
  padding: 6px 10px;
  font-size: 12px;
}

.circle-next {
  width: 48px;
  height: 48px;
  font-size: 34px;
}

.live-row {
  grid-auto-columns: minmax(230px, 276px);
  gap: 20px;
}

.live-card {
  min-height: 318px;
  border-radius: 14px;
}

.live-badge {
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  font-size: 12px;
}

.live-copy {
  padding: 16px;
}

.live-copy h3 {
  font-size: 24px;
}

.play-button {
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.section-bar {
  margin-bottom: 16px;
}

.section-bar h2 {
  font-size: 22px;
}

.eyebrow {
  font-size: 11px;
}

.segmented button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.character-grid,
.plan-grid,
.admin-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.character-art {
  aspect-ratio: 3 / 4.1;
}

.character-card {
  border-radius: 14px;
}

.character-card .card-body {
  padding: 42px 12px 12px;
}

.character-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.badge,
.capability,
.job-status {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
}

.character-card .badge-row {
  gap: 6px;
  margin-bottom: 6px;
}

.character-card .card-actions {
  gap: 6px;
  margin-top: 8px;
}

.character-card .button.compact {
  min-height: 29px;
  padding: 5px 8px;
  font-size: 11px;
}

.button,
.icon-button,
.choice,
.tag {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 14px;
}

.detail-text h2,
.plan-card h3,
.admin-card h3,
.builder-preview h3 {
  font-size: 22px;
}

.price {
  font-size: 28px;
}

.message,
.card-body p,
.detail-text p,
.plan-card p,
.admin-card p,
.builder-preview p {
  font-size: 14px;
}

@media (max-width: 680px) {
  .site-header {
    height: auto;
  }

  .main {
    padding: 22px 16px 32px;
  }

  .promo-slide,
  .promo-collage {
    min-height: 236px;
  }

  .promo-copy h2 {
    font-size: 28px;
  }

  .create-now {
    min-width: 190px;
    min-height: 46px;
    font-size: 18px;
  }

  .story-avatar {
    width: 72px;
    height: 72px;
  }

  .story-item {
    min-width: 76px;
  }

  .live-heading h2 {
    font-size: 24px;
  }

  .live-card {
    min-height: 286px;
  }
}

@media (max-width: 1280px) {
  .chat-app {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }

  .chat-profile-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .chat-app {
    grid-template-columns: 1fr;
    margin: -22px -16px -32px;
  }

  .chat-list-panel {
    display: none;
  }

  .chat-thread-panel {
    min-height: calc(100vh - 64px);
    border-right: 0;
  }

  .thread-header {
    padding: 14px 16px;
  }

  .thread-person .avatar {
    width: 48px;
    height: 48px;
  }

  .thread-person strong {
    font-size: 18px;
  }

  .thread-actions button {
    font-size: 23px;
  }

  .candy-composer {
    margin: 14px 14px 18px;
    border-radius: 22px;
  }
}

/* Final desktop chat layout matching the provided reference. */
.characters-title {
  margin: 0 0 22px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: normal;
}

.characters-title span {
  color: var(--accent);
  font-weight: 600;
}

.discover-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.character-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 100%);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1a1a1a;
  color: var(--muted);
}

.character-search input {
  min-height: 46px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
}

.character-search input:focus {
  outline: none;
}

.filter-pills {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid #3a3a3e;
  border-radius: 999px;
  padding: 0 16px;
  background: #1a1a1a;
  color: #d8d5dc;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-pill.active {
  border-color: var(--accent);
  background: var(--accent-hover);
  color: #fff;
}

.filter-pill:hover {
  border-color: #555;
}

/* Candy-style character card: full-bleed portrait + bottom gradient overlay. */
.candy-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  background: #1c1c1f;
  cursor: pointer;
}

.candy-card .card-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.candy-card:hover .card-photo {
  transform: scale(1.04);
}

.candy-card .card-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 70px 14px 14px;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 0.62) 45%, rgb(0 0 0 / 0.9));
}

.candy-card .card-body p.card-bio {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: rgb(255 255 255 / 0.78);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.card-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.card-name-row h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.card-age {
  color: rgb(255 255 255 / 0.72);
  font-size: 18px;
  font-weight: 500;
}

.card-cta-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.card-play,
.card-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 16px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.card-play {
  background: #6056f5;
}

.card-play:hover {
  background: #7268ff;
}

.card-audio {
  background: #f5912b;
}

.card-audio:hover {
  background: #ffa33e;
}

.card-new-badge,
.card-premium-badge {
  position: absolute;
  top: 12px;
  z-index: 3;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.card-new-badge {
  right: 12px;
  background: var(--accent);
  color: #fff;
}

.card-premium-badge {
  left: 12px;
  background: rgb(0 0 0 / 0.6);
  border: 1px solid rgb(255 255 255 / 0.25);
  color: #ffd67a;
  backdrop-filter: blur(6px);
}

.live-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.live-name-row h3 {
  margin: 0;
}

.live-age {
  font-size: 18px;
  font-weight: 800;
  opacity: 0.9;
}

.inline-promo {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  min-height: 220px;
  margin: 48px 0;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgb(116 83 154 / 0.42), rgb(5 16 27 / 0.96) 62%),
    #12141c;
}

.inline-promo-collage {
  position: relative;
  min-height: 220px;
}

.inline-promo-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px 34px;
}

.inline-promo-copy h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  font-weight: 900;
}

.inline-promo-copy h2 span {
  color: var(--accent);
}

.inline-promo-copy p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.5;
}

.faq-section {
  margin: 48px 0 24px;
}

.faq-title {
  margin: 0 0 20px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 900;
}

.faq-title span {
  color: var(--accent);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1a1a1a;
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "›";
  color: var(--muted);
  font-size: 22px;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(-90deg);
}

.faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid #2f2f32;
  background: linear-gradient(180deg, #131313 0%, #1a1218 100%);
  padding: 42px min(4.6vw, 82px) 28px;
}

body.route-chat .site-footer {
  display: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}

.footer-brand strong {
  display: block;
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 900;
}

.footer-brand strong span {
  color: var(--accent);
}

.footer-brand p {
  margin: 0;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.footer-grid h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 900;
}

.footer-grid a,
.footer-grid button,
.footer-grid span {
  display: block;
  margin-bottom: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.footer-grid a:hover,
.footer-grid button:hover {
  color: #fff;
}

.footer-copy {
  margin: 0;
  color: #666;
  font-size: 12px;
}

@media (min-width: 1100px) {
  body.route-discover-home .character-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .inline-promo {
    grid-template-columns: 1fr;
  }

  .inline-promo-collage {
    min-height: 180px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .discover-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .character-search {
    min-width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1281px) {
  body {
    overflow: auto;
  }

  body.route-chat {
    overflow: hidden;
  }

  .site-header {
    height: 64px;
    grid-template-columns: 196px 1fr auto;
    border-bottom-color: #363636;
  }

  .header-left {
    gap: 20px;
    padding: 0 20px;
  }

  .hamburger {
    width: 26px;
    gap: 6px;
  }

  .hamburger span {
    height: 2px;
  }

  .site-brand strong {
    font-size: 24px;
    font-weight: 800;
  }

  .gender-tabs {
    display: none;
  }

  body.route-discover-home .gender-tabs {
    display: flex;
    align-self: stretch;
    gap: 20px;
  }

  body:not(.signed-in) .header-cta,
  body:not(.signed-in) .header-login {
    display: inline-flex;
  }

  body.signed-in .header-cta,
  body.signed-in .header-login {
    display: none;
  }

  body:not(.signed-in) .premium-pill,
  body:not(.signed-in) .profile-button {
    display: none;
  }

  .header-actions {
    gap: 12px;
    padding-right: 20px;
  }

  .premium-pill {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 14px;
  }

  .profile-button {
    gap: 10px;
    font-size: 15px;
  }

  .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
  }

  /* Sidebar matches candy.ai: #1a1a1a panel, 40px links, 16px regular text. */
  .sidebar {
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    gap: 12px;
    padding: 24px 12px 12px;
    border-right: 1px solid rgb(255 255 255 / 0.05);
    background: #1a1a1a;
  }

  .nav {
    gap: 8px;
  }

  .nav-link {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
  }

  .nav-link:hover {
    border-color: rgb(255 255 255 / 0.16);
    background: #232323;
    color: #fff;
  }

  .nav-link.active {
    border-color: rgb(255 255 255 / 0.1);
    background: #303030;
    color: #fff;
    font-weight: 500;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
  }

  .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  .secondary-nav {
    margin-top: 8px;
    padding-top: 8px;
  }

  .secondary-nav .nav-link {
    min-height: 40px;
    margin-top: 0;
    border-color: rgb(255 255 255 / 0.1);
    background: transparent;
    color: #ffd56a;
  }

  .secondary-nav .nav-link.active,
  .secondary-nav .nav-link:hover {
    border-color: rgb(249 113 135 / 0.38);
    background: rgb(249 113 135 / 0.1);
  }

  .discount-badge {
    margin-left: auto;
    padding: 2px 7px;
    font-size: 11px;
  }

  .support-nav {
    gap: 8px;
    margin: auto -12px 0;
    padding: 16px 12px 0;
    border-top: 1px solid rgb(255 255 255 / 0.08);
  }

  .support-nav .nav-link {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
  }

  .support-nav .nav-link:hover {
    border-color: rgb(255 255 255 / 0.16);
    background: #232323;
    color: #fff;
  }

  .support-nav .nav-link.active {
    background: #303030;
    color: #fff;
  }

  .support-nav .nav-icon {
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
  }

  .legal-links {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    color: #f0eef2;
    font-size: 11px;
  }

  .legal-links i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
  }

  .main {
    padding: 0;
    overflow: auto;
    min-height: calc(100vh - 64px);
  }

  body.route-chat .main {
    overflow: hidden;
  }

  .chat-app {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(300px, 400px);
    height: calc(100vh - 64px);
    min-height: 0;
    margin: 0;
    border-top: 0;
  }

  .chat-list-panel {
    padding: 34px 16px 0;
    border-right-color: #2f2f32;
    background: #1a1a1a;
  }

  .chat-list-head {
    margin-bottom: 18px;
  }

  .chat-list-head h2 {
    font-size: 29px;
    font-weight: 900;
  }

  .new-group-button {
    min-height: 48px;
    padding: 0 19px;
    background: #2e2e31;
    font-size: 15px;
  }

  .chat-search {
    margin-bottom: 26px;
    border-radius: 7px;
  }

  .chat-search input {
    min-height: 59px;
    font-size: 17px;
  }

  .chat-contact-list .conversation-item {
    grid-template-columns: 58px minmax(0, 1fr) 56px;
    min-height: 94px;
    padding: 12px 14px;
  }

  .conversation-copy strong {
    font-size: 16px;
  }

  .conversation-copy small,
  .conversation-item time {
    font-size: 14px;
  }

  .chat-thread-panel {
    grid-template-rows: 108px minmax(0, 1fr) auto auto;
    border-right-color: #2f2f32;
  }

  .thread-header {
    padding: 18px 30px;
    border-bottom-color: #2f2f32;
  }

  .thread-person .avatar {
    width: 69px;
    height: 69px;
  }

  .thread-person strong {
    font-size: 26px;
    font-weight: 900;
  }

  .thread-actions {
    gap: 21px;
  }

  .thread-actions button {
    font-size: 31px;
  }

  .chat-thread-panel .message-list {
    padding: 36px 16px;
  }

  .chat-thread-panel .message {
    max-width: 570px;
    padding: 12px 18px;
    border-radius: 8px 20px 20px 8px;
    font-size: 16px;
  }

  .message-time {
    margin-left: 42px;
    font-size: 13px;
  }

  .candy-composer {
    margin: 20px 10px 17px;
    border-radius: 28px;
    padding: 20px 24px;
  }

  .candy-composer input,
  .candy-composer textarea {
    font-size: 17px;
  }

  .composer-tools {
    font-size: 13px;
  }

  .tool-chip {
    min-height: 38px;
    padding: 0 15px;
    font-size: 15px;
  }

  .send-fab {
    width: 50px;
    height: 50px;
  }

  .chat-profile-panel {
    background: #1a1a1a;
  }

  .profile-media {
    height: min(594px, 52vh);
    aspect-ratio: auto;
  }

  .version-badge {
    top: 29px;
    right: 28px;
    font-size: 16px;
  }

  .profile-arrow {
    width: 48px;
    height: 48px;
  }

  .profile-summary {
    padding: 31px 29px 26px;
  }

  .profile-summary h2 {
    font-size: 29px;
  }

  .profile-summary p {
    font-size: 17px;
    line-height: 1.42;
  }

  .about-panel {
    padding: 29px;
  }

  body:not(.route-chat) .main {
    padding: 28px 34px 42px;
  }

  body:not(.route-chat) .promo-carousel {
    margin-bottom: 24px;
  }

  body:not(.route-chat) .promo-slide {
    min-height: 236px;
    grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.18fr);
  }

  body:not(.route-chat) .promo-collage {
    min-height: 236px;
  }

  body:not(.route-chat) .promo-copy h2 {
    font-size: clamp(30px, 3.2vw, 46px);
  }

  body:not(.route-chat) .create-now {
    min-width: 220px;
    min-height: 48px;
    font-size: 20px;
  }

  body:not(.route-chat) .story-rail {
    gap: 18px;
    margin-bottom: 24px;
  }

  body:not(.route-chat) .story-item {
    min-width: 92px;
    font-size: 13px;
  }

  body:not(.route-chat) .story-avatar {
    width: 82px;
    height: 82px;
  }

  body:not(.route-chat) .live-heading h2 {
    font-size: clamp(26px, 3vw, 38px);
  }

  body:not(.route-chat) .live-row {
    grid-auto-columns: minmax(225px, 280px);
    gap: 18px;
  }

  body:not(.route-chat) .live-card {
    min-height: 300px;
  }

  body:not(.route-chat) .live-copy h3 {
    font-size: 24px;
  }
}

/* ============================================================
   年龄门 + Cookie 同意横幅（阶段 0.4）
   ============================================================ */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(14px);
}

.age-gate[hidden] {
  display: none;
}

.age-gate-card {
  width: min(460px, 100%);
  padding: 36px 30px 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  text-align: center;
}

.age-gate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 8px 24px -8px var(--accent-semi);
}

.age-gate-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.age-gate-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.age-gate-card a {
  color: var(--accent);
}

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.age-gate-confirm {
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.age-gate-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -10px var(--accent-semi);
}

.age-gate-leave {
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.age-gate-leave:hover {
  color: var(--text);
  border-color: var(--accent);
}

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(880px, calc(100% - 32px));
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.cookie-banner a {
  color: var(--accent);
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-actions button {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.cookie-reject {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.cookie-reject:hover {
  border-color: var(--accent);
}

.cookie-accept {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.cookie-accept:hover {
  box-shadow: 0 8px 22px -10px var(--accent-semi);
}

@media (max-width: 680px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    bottom: 12px;
  }

  .cookie-actions {
    justify-content: stretch;
  }

  .cookie-actions button {
    flex: 1;
  }
}

/* ---- 账号设置 / 2FA / OAuth（阶段 1）---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  margin: 14px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.settings-sections {
  display: grid;
  gap: 22px;
  max-height: 64vh;
  overflow-y: auto;
  padding-right: 6px;
}

.settings-sections section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.settings-sections section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-sections h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.settings-ok {
  color: #34d399;
  font-weight: 600;
}

.settings-warn {
  color: #fbbf24;
  font-weight: 600;
}

.settings-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button.danger {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.button.danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.recovery-codes {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  user-select: all;
}

.twofa-setup {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.twofa-setup img {
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.twofa-setup code {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12.5px;
  word-break: break-all;
}

.cf-turnstile {
  margin: 4px 0;
}

/* ---- 关系递进（阶段 2.4）---- */
.relationship-chip {
  display: inline-block;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.relationship-panel {
  margin-top: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 9px;
}

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

.relationship-head strong {
  font-size: 14px;
  color: var(--accent);
}

.relationship-head small {
  color: var(--muted);
  font-size: 11.5px;
}

.relationship-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.relationship-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease;
}

.relationship-perks {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---- 角色创建向导（阶段 2.1）---- */
.wizard-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.wizard-dot {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.25s ease;
}

.wizard-dot.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.wizard-dot.done {
  background: var(--accent-semi);
}

.wizard-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.wizard-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.wizard-nav .button {
  min-width: 110px;
}

.wizard-nav [data-action="wizard-next"] {
  margin-left: auto;
}

.preview-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

/* ---- PWA 安装引导（阶段 3.2）---- */
.install-steps {
  margin: 12px 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.install-glyph {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  font-weight: 700;
}

/* ---- 价格体系（阶段 4.1）---- */
.interval-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 8px;
}

.interval-tab {
  position: relative;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.interval-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: linear-gradient(135deg, rgb(249 113 135 / 0.16), rgb(230 80 115 / 0.12));
}

.interval-save {
  position: absolute;
  top: -10px;
  right: -8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-3);
  color: #1a1208;
  font-size: 11px;
  font-weight: 700;
}

.price-detail {
  font-size: 13px;
  color: var(--muted);
}

.price-original {
  text-decoration: line-through;
  opacity: 0.7;
}

.price-discount {
  color: var(--accent-3);
  font-weight: 700;
}

.trial-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgb(249 113 135 / 0.12), rgb(230 80 115 / 0.06));
}

.trial-banner .button {
  margin-left: auto;
}

.trial-banner.active {
  border-color: var(--ok);
}

/* ---- Affiliate（阶段 4.2）---- */
.affiliate-link-row {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.affiliate-link {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

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

.affiliate-stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
}

.affiliate-stat strong {
  font-size: 20px;
}

.affiliate-subtitle {
  margin: 14px 0 8px;
  font-size: 15px;
}

.affiliate-commissions {
  max-height: 180px;
  overflow-y: auto;
}

.affiliate-note {
  margin-top: 14px;
  font-size: 12px;
}

.crypto-pay {
  margin-top: 6px;
  font-size: 13px;
}

/* 语言切换弹窗（阶段 4.4 i18n） */
.language-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* ============================================================
   Discover 发现页（独立 feed：照片瀑布流浏览）
   ============================================================ */
.feed-header {
  margin-bottom: 18px;
}

.feed-subtitle {
  color: var(--muted);
  margin: 6px 0 14px;
  font-size: 14px;
}

.feed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.feed-chip:hover {
  border-color: var(--accent);
}

.feed-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.feed-masonry {
  columns: 4 240px;
  column-gap: 14px;
}

.feed-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 14px;
  border-radius: var(--radius-card);
  overflow: hidden;
  break-inside: avoid;
  cursor: pointer;
  background: var(--panel);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feed-card:hover,
.feed-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feed-card img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.feed-card.size-0 img { aspect-ratio: 4 / 5; }
.feed-card.size-1 img { aspect-ratio: 3 / 4; }
.feed-card.size-2 img { aspect-ratio: 2 / 3; }

.feed-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-3);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.feed-badge.new {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.feed-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.feed-overlay h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.feed-overlay h3 span {
  color: var(--muted);
  font-weight: 400;
}

.feed-overlay p {
  margin: 4px 0 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-cta {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.feed-card:hover .feed-cta,
.feed-card:focus-visible .feed-cta {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 680px) {
  .feed-masonry { columns: 2 150px; column-gap: 10px; }
  .feed-card { margin-bottom: 10px; }
  .feed-cta { opacity: 1; transform: none; }
}

/* ============================================================
   iOS PWA 安全区适配（阶段 3.3：viewport-fit=cover + safe-area）
   ============================================================ */
@supports (padding: env(safe-area-inset-top)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .sidebar {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .composer,
  .site-footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ============================================================
   UI 精致化设计层 v2 — 对标 candy.ai 的排版密度
   原则：基准 14px；标题 20–24px；字重 600/700 为主；
   收紧间距与控件高度，去掉"傻大粗"观感。
   置于文件末尾，按层叠顺序覆盖前面的旧比例。
   ============================================================ */

body {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4 {
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* ---- 顶栏 ---- */
.site-header {
  height: 58px;
}

.sidebar {
  top: 58px;
  height: calc(100vh - 58px);
}

.site-brand strong {
  font-size: 19px;
  letter-spacing: 0.2px;
  font-weight: 800;
}

.brand-logo {
  width: 24px;
  height: 24px;
}

.gender-tabs button {
  gap: 7px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-bottom-width: 2px;
}

.gender-tabs button svg {
  width: 15px;
  height: 15px;
}

.header-cta,
.header-login {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

.premium-pill {
  font-size: 12.5px;
}

.profile-button {
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.profile-avatar {
  width: 32px;
  height: 32px;
}

.hamburger {
  width: 26px;
  gap: 5px;
}

.hamburger span {
  height: 2px;
}

/* ---- 侧栏 ---- */
.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
}

.nav-link {
  min-height: 37px;
  gap: 9px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 9px;
}

.nav-link .nav-icon svg {
  width: 16px;
  height: 16px;
}

.support-nav .nav-link {
  min-height: 32px;
  font-size: 12.5px;
}

.discount-badge {
  font-size: 9.5px;
  font-weight: 700;
}

/* ---- 通用控件 ---- */
.button,
.icon-button,
.segmented button,
.choice,
.tag {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
}

.button.primary {
  font-weight: 600;
}

.button.premium {
  font-weight: 700;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.section-bar h2,
.topbar h1,
.modal h2 {
  font-size: 20px;
}

/* ---- 首页 Hero ---- */
.promo-copy h2 {
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.1;
}

.create-now {
  min-width: 180px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 18px rgb(255 78 135 / 0.45);
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  font-size: 30px;
}

/* ---- 故事栏 ---- */
.story-item {
  min-width: 92px;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.story-avatar {
  width: 92px;
  height: 92px;
  padding: 3px;
}

.story-avatar img {
  border-width: 2px;
}

/* ---- New Experiences ---- */
.live-section {
  margin-bottom: 36px;
}

.live-heading h2 {
  font-size: 21px;
  font-weight: 700;
}

.circle-next {
  width: 38px;
  height: 38px;
  border-width: 1px;
  font-size: 20px;
}

.live-row {
  grid-auto-columns: minmax(200px, 236px);
  gap: 14px;
}

.live-card {
  min-height: 272px;
}

.live-copy h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.live-badge {
  padding: 4px 9px;
  font-size: 11px;
}

.play-button {
  min-height: 32px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ---- 角色区 ---- */
.characters-title,
.faq-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.character-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.character-card .card-body {
  padding: 44px 12px 12px;
}

.character-card .button.compact {
  min-height: 30px;
  font-size: 11.5px;
}

/* ---- Inline promo / FAQ ---- */
.inline-promo-copy h2 {
  font-size: clamp(22px, 2.4vw, 30px);
}

.inline-promo-copy p {
  font-size: 14px;
}

/* ---- 聊天 ---- */
.chat-list-head h2 {
  font-size: 20px;
}

.new-group-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.chat-search input {
  min-height: 42px;
  font-size: 13.5px;
}

.chat-search span {
  font-size: 16px;
}

.thread-person strong {
  font-size: 15.5px;
}

.thread-actions {
  gap: 12px;
}

.thread-actions button {
  font-size: 19px;
  font-weight: 400;
}

.chat-thread-panel .message {
  font-size: 14px;
  padding: 10px 15px;
}

.profile-summary h2 {
  font-size: 19px;
}

.profile-summary p {
  font-size: 13.5px;
}

.profile-arrow {
  width: 36px;
  height: 36px;
  border-width: 1px;
  font-size: 22px;
}

/* ---- 计费 ---- */
.price {
  font-size: 26px;
  font-weight: 700;
}

.detail-text h2,
.plan-card h3,
.admin-card h3,
.builder-preview h3 {
  font-size: 18px;
}

/* ---- Discover 发现页 ---- */
.feed-overlay h3 {
  font-size: 15px;
}

.feed-overlay p {
  font-size: 12px;
}

.feed-chip {
  padding: 7px 14px;
  font-size: 12.5px;
}

.feed-subtitle {
  font-size: 13px;
}

/* 覆盖旧宽屏放大规则（body:not(.route-chat) 特异性更高，需同级覆盖） */
body:not(.route-chat) .promo-copy h2 {
  font-size: clamp(26px, 3vw, 42px);
}

body:not(.route-chat) .create-now {
  min-width: 180px;
  min-height: 44px;
  font-size: 15px;
}

body:not(.route-chat) .story-item {
  min-width: 92px;
  font-size: 12.5px;
}

body:not(.route-chat) .story-avatar {
  width: 92px;
  height: 92px;
}

body:not(.route-chat) .live-heading h2 {
  font-size: 21px;
}

body:not(.route-chat) .live-row {
  grid-auto-columns: minmax(200px, 236px);
  gap: 14px;
}

body:not(.route-chat) .live-card {
  min-height: 272px;
}

body:not(.route-chat) .live-copy h3 {
  font-size: 18px;
}

/* Pink production polish + shop + calmer chat layout */
:root {
  --bg: #120d11;
  --panel: #1b1218;
  --panel-soft: #241820;
  --line: #3a2631;
  --text: #fff7fb;
  --muted: #bbaeb7;
  --accent: #ff5f93;
  --accent-2: #ff2f78;
  --accent-3: #ffd166;
  --accent-hover: #351924;
  --accent-semi: rgb(255 95 147 / 0.38);
  --glow: rgb(255 47 120 / 0.42);
}

body,
.site-header,
.main,
.sidebar,
.chat-app,
.chat-thread-panel,
.chat-thread-panel .message-list {
  background: var(--bg);
}

.site-header,
.sidebar,
.chat-list-panel,
.chat-thread-panel,
.chat-profile-panel {
  border-color: var(--line);
}

.button.primary,
.send-fab,
.premium-pill,
.create-now,
.thread-actions button.active,
.card-play {
  background: linear-gradient(135deg, #ff79a9, #ff2f78);
  color: #fff;
}

.profile-button,
.new-group-button,
.chat-search,
.candy-composer,
input,
select,
textarea,
.filter-pill,
.shop-card,
.shop-wallet,
.shop-hero {
  background: var(--panel-soft);
  border-color: var(--line);
}

.card-audio {
  background: #f0a33a;
}

.chat-app {
  grid-template-columns: minmax(260px, 300px) minmax(480px, 1fr) minmax(280px, 320px);
  min-height: calc(100vh - 64px);
  margin: -24px -42px -34px;
}

.chat-list-panel {
  padding: 22px 12px 14px;
  background: #150f14;
}

.chat-list-head h2 {
  font-size: 22px;
}

.chat-contact-list .conversation-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 68px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.chat-contact-list .conversation-item.active,
.chat-contact-list .conversation-item:hover {
  border-color: rgb(255 95 147 / 0.35);
  background: #241720;
}

.chat-contact-list .avatar,
.thread-person .avatar {
  border: 2px solid rgb(255 95 147 / 0.44);
}

.chat-thread-panel {
  grid-template-rows: 76px minmax(0, 1fr) auto;
  background: #100d10;
}

.thread-header {
  padding: 12px 22px;
}

.thread-person .avatar {
  width: 48px;
  height: 48px;
}

.thread-person strong {
  font-size: 18px;
}

.thread-actions {
  gap: 8px;
}

.thread-actions button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #191218;
  color: #f7d9e6;
  font-size: 18px;
}

.chat-thread-panel .message-list {
  gap: 10px;
  padding: 22px;
}

.chat-thread-panel .message {
  max-width: min(620px, 74%);
  border: 1px solid #342431;
  border-radius: 16px 18px 18px 8px;
  background: #201720;
  color: #f7edf2;
}

.chat-thread-panel .message.user {
  border-color: transparent;
  border-radius: 18px 16px 8px 18px;
  background: linear-gradient(135deg, #ff79a9, #ff2f78);
}

.candy-composer {
  margin: 14px 22px 20px;
  border-radius: 22px;
  padding: 14px 16px;
  background: #1b141a;
}

.composer-tools {
  flex-wrap: wrap;
}

.send-fab {
  width: 42px;
  height: 42px;
}

.chat-profile-panel {
  background: #1a1016;
}

.profile-media {
  aspect-ratio: 1 / 1.18;
}

.profile-summary,
.about-panel {
  padding: 20px;
}

.profile-summary h2 {
  font-size: 24px;
}

.about-grid {
  gap: 16px;
}

.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgb(255 95 147 / 0.32), transparent 34%),
    linear-gradient(135deg, #21131b, #150f14);
}

.shop-hero h3 {
  margin: 8px 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.shop-hero p,
.shop-card p {
  color: var(--muted);
}

.shop-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgb(255 95 147 / 0.18);
  color: #ffd8e7;
  font-size: 12px;
  font-weight: 800;
}

.shop-wallet {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.shop-wallet span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.shop-wallet strong {
  font-size: 22px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cart-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121216;
}

.cart-panel.empty {
  color: var(--muted);
}

.cart-head,
.cart-line,
.cart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head strong,
.cart-head b {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 18px;
}

.cart-lines {
  display: grid;
  gap: 10px;
}

.cart-line {
  justify-content: flex-start;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 12px;
  padding: 10px;
  background: rgb(255 255 255 / 0.035);
}

.cart-line img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.cart-line div {
  min-width: 0;
  flex: 1;
}

.cart-line strong,
.cart-line span {
  display: block;
}

.cart-line span {
  color: var(--muted);
  font-size: 12px;
}

.cart-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.shop-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.shop-card.owned {
  opacity: 0.72;
}

.shop-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.shop-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgb(18 13 17 / 0.84));
}

.shop-card-media span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  border-radius: 999px;
  padding: 5px 10px;
  background: linear-gradient(135deg, #ff79a9, #ff2f78);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.shop-card-body {
  padding: 16px;
}

.shop-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.shop-card ul {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.shop-card li {
  color: #f4dce7;
  font-size: 13px;
}

.shop-card li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: 900;
}

.shop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-card-footer strong {
  color: #ffd8e7;
}

.shop-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.shop-card-actions .button {
  min-height: 36px;
  padding: 8px 12px;
}

.mall-meta,
.order-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.mall-meta span,
.order-meta-grid span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.04);
}

.profile-video-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.profile-video-strip video {
  width: 100%;
  aspect-ratio: 9 / 12;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #050507;
  object-fit: cover;
}

.orders-stack {
  display: grid;
  gap: 14px;
}

.order-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121216;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.order-head h3 {
  margin: 8px 0 4px;
}

.order-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.order-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.order-flow span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 6px;
  background: rgb(255 255 255 / 0.04);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.order-flow span.active {
  border-color: rgb(255 95 147 / 0.55);
  background: rgb(255 95 147 / 0.18);
  color: #ffd8e7;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drama-limit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121216;
  color: var(--muted);
}

.drama-limit strong {
  color: #ffd8e7;
}

.drama-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 16px;
}

.drama-grid {
  display: grid;
  gap: 12px;
  align-content: start;
}

.drama-card {
  position: relative;
  display: grid;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #121216;
  color: #fff;
  text-align: left;
}

.drama-card.active {
  border-color: rgb(255 95 147 / 0.55);
}

.drama-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.44;
}

.drama-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.16), rgb(0 0 0 / 0.82));
}

.drama-card span,
.drama-card strong,
.drama-card small {
  position: relative;
  z-index: 1;
}

.drama-card span {
  width: fit-content;
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgb(255 95 147 / 0.22);
  color: #ffd8e7;
  font-size: 11px;
  font-weight: 900;
}

.drama-card strong {
  align-self: end;
  font-size: 22px;
}

.drama-card small {
  color: #d6c8d0;
}

.episode-panel {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #101014;
}

.episode-head h3 {
  margin: 8px 0 4px;
}

.episode-head p {
  margin: 0 0 14px;
  color: var(--muted);
}

.episode-list {
  display: grid;
  gap: 10px;
}

.episode-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
}

.episode-row.locked {
  opacity: 0.62;
}

.episode-row img {
  width: 82px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
}

.episode-row strong,
.episode-row span {
  display: block;
}

.episode-row span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1340px) {
  .chat-app {
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .chat-app {
    grid-template-columns: 1fr;
    margin: -18px -16px -28px;
  }

  .drama-layout {
    grid-template-columns: 1fr;
  }

  .episode-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .episode-row .button {
    grid-column: 1 / -1;
  }

  .chat-list-panel,
  .chat-profile-panel {
    display: none;
  }

  .shop-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 58px;
    height: auto;
    padding: 10px 14px;
  }

  .header-left {
    gap: 12px;
  }

  .hamburger {
    width: 26px;
    gap: 5px;
  }

  .hamburger span {
    height: 2px;
  }

  .site-brand strong {
    font-size: 20px;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 58px);
  }

  .sidebar {
    display: none;
  }

  .main {
    display: block;
    width: 100%;
    min-height: calc(100vh - 58px);
    padding: 16px;
  }

  .chat-app {
    margin: -16px;
    min-height: calc(100vh - 58px);
  }

  .site-footer {
    padding: 24px 16px;
  }
}

/* Black theme + chat alignment hotfix */
:root {
  --bg: #050505;
  --panel: #09090a;
  --panel-soft: #111113;
  --line: rgb(255 255 255 / 0.11);
  --text: #ffffff;
  --muted: #b9b3b8;
  --accent-hover: #171014;
}

html,
body,
.site-header,
.app-shell,
.main,
.sidebar,
.site-footer {
  background: #050505;
}

.site-header {
  grid-template-columns: minmax(270px, 300px) minmax(0, 1fr) auto;
  border-bottom-color: var(--line);
}

.header-left {
  min-width: 0;
  padding: 0 18px;
}

.site-brand {
  min-width: 0;
  gap: 9px;
}

.site-brand strong {
  overflow: hidden;
  max-width: 210px;
  color: #fff;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-brand strong span,
.footer-brand strong span {
  color: var(--accent);
}

.gender-tabs {
  min-width: 0;
  justify-content: center;
  gap: clamp(18px, 4vw, 56px);
}

.sidebar,
.chat-list-panel,
.chat-thread-panel,
.chat-profile-panel,
.chat-thread-panel .message-list {
  background: #050505;
}

.nav-link,
.support-nav .nav-link,
.chat-search,
.candy-composer,
.thread-actions button,
.profile-button,
input,
select,
textarea,
.shop-card,
.shop-wallet {
  background: #101012;
  border-color: var(--line);
}

.nav-link.active,
.nav-link:hover,
.chat-contact-list .conversation-item.active,
.chat-contact-list .conversation-item:hover {
  background: #242426;
}

body.route-chat {
  overflow: hidden;
}

body.route-chat .topbar {
  display: none;
}

body.route-chat .main {
  overflow: hidden;
  padding: 0;
}

body.route-chat #chatView {
  height: calc(100vh - 58px);
}

body.route-chat .chat-app {
  grid-template-columns: minmax(280px, 320px) minmax(520px, 1fr) clamp(360px, 24vw, 440px);
  height: calc(100vh - 58px);
  min-height: 0;
  margin: 0;
  border-top: 0;
  background: #050505;
}

body.route-chat .chat-list-panel {
  min-width: 0;
  padding: 22px 12px 14px;
  border-right-color: var(--line);
}

body.route-chat .chat-list-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

body.route-chat .chat-thread-panel {
  min-width: 0;
  grid-template-rows: 68px minmax(0, 1fr) auto;
  border-right-color: var(--line);
}

body.route-chat .thread-header {
  padding: 10px 22px;
}

body.route-chat .message-list {
  background: #050505;
}

body.route-chat .message {
  background: #151518;
  border-color: rgb(255 255 255 / 0.1);
}

body.route-chat .candy-composer {
  margin: 12px 22px 18px;
  background: #101012;
}

body.route-chat .chat-profile-panel {
  display: grid;
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #050505;
}

body.route-chat .profile-media {
  height: min(58vh, 620px);
  aspect-ratio: auto;
}

body.route-chat .profile-summary,
body.route-chat .about-panel {
  background: #050505;
}

body.route-chat .composer-tools {
  flex-wrap: nowrap;
  min-width: 0;
}

body.route-chat .composer-tools > span {
  flex: 0 0 auto;
}

body.route-chat .tool-chip {
  flex: 0 0 auto;
}

body.route-chat .tool-chip.icon-only {
  width: 42px;
  height: 42px;
  min-height: 42px;
  justify-content: center;
}

body.route-chat .send-fab {
  flex: 0 0 auto;
  margin-left: auto;
}

.shop-hero {
  background: linear-gradient(135deg, #101012, #050505);
}

.shop-card-media::after {
  background: linear-gradient(180deg, transparent 45%, rgb(5 5 5 / 0.88));
}

@media (max-width: 1340px) {
  body.route-chat .chat-app {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }

  body.route-chat .chat-profile-panel {
    display: none;
  }
}

@media (max-width: 1180px) {
  body.route-chat .composer-tools {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  body.route-chat .composer-tools::-webkit-scrollbar {
    display: none;
  }

  body.route-chat .composer-tools > span {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .gender-tabs {
    display: none;
  }

  body.route-chat .chat-app {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-brand strong {
    max-width: 190px;
    font-size: 18px;
  }

  body.route-chat #chatView,
  body.route-chat .chat-app {
    height: calc(100vh - 58px);
    min-height: calc(100vh - 58px);
  }
}

/* Live presence: breathing ring for active avatars and pulsing LIVE status dots. */
@keyframes live-ring-breathe {
  0%, 100% {
    opacity: 0;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes live-dot-breathe {
  0%, 100% {
    opacity: 0;
    transform: scale(0.72);
  }

  50% {
    opacity: 1;
    transform: scale(1.7);
  }
}

@keyframes live-ring-core-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgb(255 47 120 / 0.2), 0 0 18px rgb(255 47 120 / 0.18);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 8px rgb(255 47 120 / 0.22), 0 0 32px rgb(255 47 120 / 0.48);
    transform: scale(1.035);
  }
}

@keyframes live-dot-core-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 rgb(16 214 124 / 0.24), 0 0 10px rgb(16 214 124 / 0.34);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 8px rgb(16 214 124 / 0.24), 0 0 22px rgb(16 214 124 / 0.7);
    transform: scale(1.12);
  }
}

body:not(.route-chat) .story-avatar:not(.muted-ring) {
  animation: live-ring-core-breathe 1.8s ease-in-out infinite;
  will-change: transform, box-shadow;
}

body:not(.route-chat) .story-avatar:not(.muted-ring)::after {
  animation: live-ring-breathe 1.8s ease-in-out infinite;
  will-change: opacity, transform;
}

.live-badge i {
  animation: live-dot-core-breathe 1.35s ease-in-out infinite;
  will-change: transform, box-shadow;
}

.live-badge i::after {
  animation: live-dot-breathe 1.35s ease-in-out infinite;
  will-change: opacity, transform;
}

body.no-story-ring-effect .story-avatar,
body.no-story-ring-effect .story-avatar::after,
body.no-live-dot-effect .live-badge i,
body.no-live-dot-effect .live-badge i::after {
  animation: none !important;
}

body.no-story-ring-effect .story-avatar::after,
body.no-live-dot-effect .live-badge i::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  body:not(.route-chat) .story-avatar:not(.muted-ring),
  .live-badge i,
  body:not(.route-chat) .story-avatar:not(.muted-ring)::after,
  .live-badge i::after {
    animation: none;
  }

  body:not(.route-chat) .story-avatar:not(.muted-ring)::after,
  .live-badge i::after {
    opacity: 0.45;
    transform: scale(1);
  }
}

body:not(.route-chat) .story-rail {
  margin-top: -34px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 34px 18px 30px;
}

.live-section,
.discover-section,
.inline-promo,
.faq-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 520px;
}

body:not(.route-chat) .story-item {
  padding-top: 2px;
}

/* Billing page: consumer checkout style inspired by modern subscription paywalls. */
body.route-billing .main {
  padding-top: 56px;
}

body.route-billing #billingView {
  max-width: 1080px;
  margin: 0 auto;
}

body.route-billing #billingView > .section-bar,
body.route-billing .token-pack-panel,
body.route-billing .ledger-panel {
  display: none;
}

body.route-billing .plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

.billing-hero {
  text-align: center;
}

.billing-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.billing-hero p {
  margin: 12px 0 0;
  color: #77737a;
  font-size: 18px;
  font-weight: 750;
}

.billing-offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

.billing-offer-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 346px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 18px;
  padding: 28px;
  background: #111;
}

.billing-offer-card.featured {
  border-color: rgb(255 79 137 / 0.34);
  background:
    linear-gradient(180deg, rgb(255 79 137 / 0.02) 0%, rgb(255 79 137 / 0.36) 100%),
    #111;
}

.billing-offer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.billing-offer-head h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.billing-offer-head strong {
  display: block;
  margin-top: 12px;
  color: #ff4f89;
  font-size: 15px;
  font-weight: 900;
}

.billing-offer-head span {
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 8px 13px;
  background: linear-gradient(180deg, #ffe776, #f6bd36);
  color: #17120a;
  font-size: 13px;
  font-weight: 900;
}

.billing-price {
  margin-top: 52px;
  color: #fff;
  font-size: clamp(34px, 3vw, 44px);
  line-height: 1;
  font-weight: 950;
}

.billing-price small {
  margin-left: 4px;
  color: #7b777d;
  font-size: 19px;
  font-weight: 800;
}

.billing-original {
  margin: 12px 0 0;
  color: #8b878d;
  font-size: 19px;
  font-weight: 800;
  text-decoration: line-through;
}

.billing-start-button {
  width: 100%;
  min-height: 66px;
  margin-top: 34px;
  border: 0;
  border-radius: 14px;
  background: #1b1b1b;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
}

.billing-start-button.primary {
  background: linear-gradient(135deg, #f35b8a, #d53063);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.billing-benefits {
  display: grid;
  gap: 22px;
}

.billing-benefits h2 {
  margin: 0;
  color: #8b878d;
  font-size: 23px;
  font-weight: 900;
}

.billing-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.billing-benefit {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 14px;
  padding: 0 22px;
  background: #111;
}

.billing-benefit span {
  font-size: 25px;
}

.billing-benefit strong {
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.billing-trust-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
  color: #6f6c72;
  font-size: 18px;
  font-weight: 850;
}

.billing-trust-row span {
  display: flex;
  align-items: center;
  gap: 14px;
}

.billing-legal {
  margin: -8px 0 0;
  color: #39373b;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .billing-offers,
  .billing-benefit-grid,
  .billing-trust-row {
    grid-template-columns: 1fr;
  }

  .billing-offer-card {
    min-height: 300px;
  }
}

/* Collapsed app navigation: keep an icon rail instead of hiding the menu. */
body.sidebar-collapsed .app-shell {
  grid-template-columns: 86px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: auto;
  overflow-x: visible;
  overflow-y: auto;
  align-items: center;
  gap: 14px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
}

body.sidebar-collapsed .nav,
body.sidebar-collapsed .secondary-nav,
body.sidebar-collapsed .support-nav {
  width: 56px;
  justify-items: center;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .support-nav .nav-link,
body.sidebar-collapsed .secondary-nav .nav-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 10px;
  font-size: 0;
  line-height: 0;
}

body.sidebar-collapsed .nav-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  font-size: 18px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

body.sidebar-collapsed .nav-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
}

body.sidebar-collapsed .nav-link::after {
  content: none;
  position: absolute;
  top: 50%;
  left: 66px;
  z-index: 9999;
  display: block;
  width: max-content;
  min-width: 44px;
  max-width: 180px;
  padding: 9px 12px;
  transform: translate(10px, -50%);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 8px;
  background: #242426;
  color: #fff;
  box-shadow: 0 16px 34px rgb(0 0 0 / 0.42);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

body.sidebar-collapsed .nav-link::before {
  content: none;
  position: absolute;
  top: 50%;
  left: 61px;
  z-index: 9999;
  width: 9px;
  height: 9px;
  transform: translate(10px, -50%) rotate(45deg);
  background: #242426;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
  border-left: 1px solid rgb(255 255 255 / 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

body.sidebar-collapsed .nav-link:hover::after,
body.sidebar-collapsed .nav-link:focus-visible::after {
  transform: translate(0, -50%);
  opacity: 1;
}

body.sidebar-collapsed .nav-link:hover::before,
body.sidebar-collapsed .nav-link:focus-visible::before {
  transform: translate(0, -50%) rotate(45deg);
  opacity: 1;
}

body.sidebar-collapsed .discount-badge,
body.sidebar-collapsed .legal-links,
body.sidebar-collapsed .account-panel,
body.sidebar-collapsed .sidebar .brand {
  display: none;
}

body.sidebar-collapsed .support-nav {
  margin-top: auto;
  margin-right: 0;
  margin-left: 0;
  box-sizing: border-box;
  width: 56px;
  padding: 18px 0 0;
}

body.route-dramas {
  overflow: hidden;
}

body.route-dramas .topbar,
body.route-dramas #dramasView > .section-bar {
  display: none;
}

body.route-dramas .main {
  overflow: hidden;
  padding: 0;
}

body.route-dramas #dramasView {
  height: calc(100vh - 64px);
}

body.route-dramas .drama-limit {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  width: auto;
  max-width: min(520px, calc(100vw - 140px));
  transform: translateX(-50%);
  border-color: rgb(255 255 255 / 0.12);
  background: rgb(10 10 12 / 0.74);
  backdrop-filter: blur(18px);
}

body.route-dramas .drama-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  height: 100%;
  padding: 14px clamp(18px, 5vw, 70px);
}

body.route-dramas .episode-panel {
  display: none;
}

body.route-dramas .drama-grid {
  display: block;
  height: 100%;
  min-height: 0;
}

.short-video-feed {
  display: grid;
  height: 100%;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.short-video-feed::-webkit-scrollbar {
  display: none;
}

.short-video-card {
  position: relative;
  display: grid;
  place-items: center;
  width: min(520px, calc(100vw - 220px));
  height: calc(100vh - 92px);
  min-height: 580px;
  margin: 0 auto;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 18px;
  background: #0c0c0f;
}

.short-video-card video,
.short-video-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-video-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0.18), transparent 34%),
    linear-gradient(0deg, rgb(0 0 0 / 0.78), transparent 42%);
  pointer-events: none;
}

.short-video-copy {
  position: absolute;
  right: 18px;
  bottom: 22px;
  left: 18px;
  z-index: 2;
  display: grid;
  gap: 8px;
  justify-items: start;
}

.short-video-copy span {
  border-radius: 999px;
  padding: 5px 10px;
  background: rgb(255 95 147 / 0.28);
  color: #ffd8e7;
  font-size: 12px;
  font-weight: 900;
}

.short-video-copy h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
}

.short-video-copy p {
  margin: 0;
  color: rgb(255 255 255 / 0.76);
  font-size: 13px;
}

.short-video-actions {
  position: absolute;
  right: 18px;
  bottom: 26px;
  z-index: 3;
  display: grid;
  gap: 7px;
  justify-items: center;
  transform: translateX(78px);
}

.short-video-actions button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 50%;
  background: rgb(10 10 12 / 0.5);
  color: #fff;
  font-size: 24px;
  backdrop-filter: blur(10px);
}

.short-video-actions strong {
  color: #fff;
  font-size: 13px;
}

.short-drama-side {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 120px;
  color: var(--muted);
  text-align: center;
}

.short-drama-side strong {
  color: #fff;
  font-size: 28px;
}

.short-drama-side small {
  max-width: 110px;
  font-size: 12px;
}

@media (max-width: 900px) {
  body.sidebar-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sidebar-collapsed .sidebar {
    display: none;
  }

  body.route-dramas .drama-limit {
    top: 68px;
    max-width: calc(100vw - 24px);
  }

  body.route-dramas .drama-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

  body.route-dramas .episode-panel {
    display: none;
  }

  .short-video-feed {
    max-height: calc(100vh - 58px);
  }

  .short-video-card {
    width: min(100vw, 520px);
    height: calc(100vh - 58px);
    min-height: 0;
    border-radius: 0;
  }

  .short-video-actions {
    right: 12px;
    transform: none;
  }
}

/* Mobile adaptation pass: drawer navigation + route-level responsive layouts. */
@media (max-width: 900px) {
  :root {
    --mobile-tabbar-height: 74px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  body.mobile-nav-open::after {
    content: "";
    position: fixed;
    inset: 58px 0 var(--mobile-tabbar-height);
    z-index: 35;
    background: rgb(0 0 0 / 0.58);
    backdrop-filter: blur(8px);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    height: auto;
    padding: 8px 12px;
    background: rgb(5 5 5 / 0.96);
  }

  .header-left {
    gap: 12px;
    min-width: 0;
    padding: 0;
  }

  .hamburger {
    flex: 0 0 auto;
    width: 28px;
    gap: 5px;
  }

  .hamburger span {
    height: 2px;
  }

  .site-brand strong {
    max-width: 178px;
    font-size: 18px;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
  }

  .gender-tabs,
  .header-actions {
    display: none;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100dvh - 58px);
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    top: 58px;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    align-content: start;
    width: min(84vw, 340px);
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    gap: 14px;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-104%);
    border-right: 1px solid rgb(255 255 255 / 0.12);
    background: #080809;
    transition: transform 0.22s ease;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-nav-open .sidebar,
  body.mobile-nav-open.sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .sidebar .brand,
  body.sidebar-collapsed .sidebar .brand {
    display: flex;
    width: 100%;
  }

  .nav,
  .secondary-nav,
  .support-nav,
  body.sidebar-collapsed .nav,
  body.sidebar-collapsed .secondary-nav,
  body.sidebar-collapsed .support-nav {
    width: 100%;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .nav-link,
  .support-nav .nav-link,
  .secondary-nav .nav-link,
  body.sidebar-collapsed .nav-link,
  body.sidebar-collapsed .support-nav .nav-link,
  body.sidebar-collapsed .secondary-nav .nav-link {
    position: relative;
    display: flex;
    place-items: unset;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 46px;
    min-height: 46px;
    gap: 12px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
  }

  .nav-icon,
  body.sidebar-collapsed .nav-icon {
    position: static;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin: 0;
    font-size: 17px;
    transform: none;
  }

  body.sidebar-collapsed .nav-icon svg {
    width: 19px;
    height: 19px;
  }

  body.sidebar-collapsed .discount-badge,
  body.sidebar-collapsed .legal-links,
  body.sidebar-collapsed .account-panel {
    display: flex;
  }

  .account-panel,
  body.sidebar-collapsed .account-panel {
    display: grid;
    width: 100%;
  }

  .main,
  body.route-billing .main {
    width: 100%;
    min-height: calc(100dvh - 58px);
    overflow-x: hidden;
    padding: 14px 14px calc(14px + var(--mobile-tabbar-height) + env(safe-area-inset-bottom));
  }

  body.route-chat .main,
  body.route-dramas .main {
    padding: 0;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1,
  .characters-title,
  .section-bar h2 {
    font-size: 22px;
    line-height: 1.12;
  }

  .topbar-actions {
    display: none;
  }

  .promo-carousel {
    min-height: 0;
    border-radius: 12px;
  }

  .promo-slide,
  .promo-collage {
    min-height: 260px;
  }

  .promo-copy {
    padding: 22px 18px;
  }

  .promo-copy h2 {
    max-width: 320px;
    font-size: 32px;
    line-height: 1.02;
  }

  .create-now {
    min-width: 0;
    width: min(240px, 100%);
    min-height: 46px;
    font-size: 16px;
  }

  body:not(.route-chat) .story-rail {
    margin: -16px -14px 24px;
    padding: 24px 14px 16px;
    gap: 14px;
  }

  .story-item {
    min-width: 78px;
    gap: 8px;
    font-size: 11px;
  }

  .story-avatar {
    width: 70px;
    height: 70px;
  }

  .live-row {
    grid-auto-columns: minmax(210px, 78vw);
    gap: 12px;
    margin-right: -14px;
    padding-right: 14px;
  }

  .live-card {
    min-height: 278px;
  }

  .discover-toolbar,
  .section-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .filter-pills,
  .feed-chips {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar,
  .feed-chips::-webkit-scrollbar {
    display: none;
  }

  .character-grid,
  .shop-grid,
  .media-grid,
  .my-ai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .character-card,
  .shop-card {
    border-radius: 12px;
  }

  .card-body,
  .shop-card-body {
    padding: 12px;
  }

  .card-bio,
  .shop-card p,
  .shop-card ul {
    font-size: 12px;
  }

  .shop-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
  }

  .shop-hero h3 {
    font-size: 19px;
    line-height: 1.18;
  }

  .shop-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .shop-card-actions .button {
    width: 100%;
    min-height: 38px;
  }

  .orders-stack {
    gap: 12px;
  }

  .order-card {
    padding: 14px;
    border-radius: 12px;
  }

  .order-head,
  .order-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .order-flow {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .order-flow span {
    flex: 0 0 auto;
  }

  .order-meta-grid {
    grid-template-columns: 1fr;
  }

  .builder,
  .builder-main,
  .studio,
  .detail-card,
  .generator-layout,
  .collection-layout,
  .billing-offers,
  .billing-benefit-grid,
  .billing-trust-row {
    grid-template-columns: 1fr;
  }

  .builder-preview {
    position: static;
  }

  body.route-dramas #dramasView {
    height: calc(100dvh - 58px - var(--mobile-tabbar-height));
  }

  body.route-dramas .drama-limit {
    top: 66px;
    right: 10px;
    left: 10px;
    justify-content: center;
    width: auto;
    max-width: none;
    transform: none;
    font-size: 12px;
  }

  .short-video-feed {
    max-height: calc(100dvh - 58px - var(--mobile-tabbar-height));
  }

  .short-video-card {
    width: 100vw;
    height: calc(100dvh - 58px - var(--mobile-tabbar-height));
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .short-video-copy {
    right: 74px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    left: 14px;
  }

  .short-video-copy h3 {
    font-size: 22px;
  }

  .short-video-actions {
    right: 12px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: none;
  }

  body.route-chat #chatView,
  body.route-chat .chat-app {
    height: calc(100dvh - 58px - var(--mobile-tabbar-height));
    min-height: calc(100dvh - 58px - var(--mobile-tabbar-height));
  }

  body.route-chat .chat-app {
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
  }

  body.route-chat .chat-list-panel,
  body.route-chat .chat-profile-panel {
    display: none;
  }

  body.route-chat .chat-thread-panel {
    grid-template-rows: 58px minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    width: 100%;
    min-width: 0;
  }

  body.route-chat .thread-header {
    padding: 8px 12px;
  }

  body.route-chat .message-list {
    min-height: 0;
    padding: 12px;
  }

  body.route-chat .candy-composer {
    margin: 8px 10px 10px;
    padding: 9px;
  }

  body.route-chat #messageInput {
    min-height: 44px;
    max-height: 128px;
    font-size: 16px;
  }

  body.route-chat .composer-tools {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body.route-chat .tool-chip {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  body.route-chat .send-fab {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .modal {
    width: min(100% - 24px, 520px);
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom));
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgb(255 255 255 / 0.13);
    background: rgb(8 8 9 / 0.94);
    box-shadow: 0 -16px 34px rgb(0 0 0 / 0.42);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar-link {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    border-radius: 14px;
    color: #a9a5ad;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
  }

  .mobile-tabbar-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: currentColor;
  }

  .mobile-tabbar-icon svg {
    display: block;
    width: 25px;
    height: 25px;
  }

  .mobile-tabbar-link.active {
    color: var(--accent);
  }

  .mobile-tabbar-link.active .mobile-tabbar-icon {
    border-radius: 12px;
    background: rgb(249 113 135 / 0.16);
  }
}

@media (max-width: 520px) {
  .main,
  body.route-billing .main {
    padding: 12px 12px calc(12px + var(--mobile-tabbar-height) + env(safe-area-inset-bottom));
  }

  .site-brand strong {
    max-width: 146px;
  }

  .promo-slide,
  .promo-collage {
    min-height: 220px;
  }

  .promo-copy h2 {
    font-size: 28px;
  }

  .carousel-arrow {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .character-grid,
  .shop-grid,
  .media-grid,
  .my-ai-grid {
    grid-template-columns: 1fr;
  }

  .shop-card {
    display: block;
    min-height: 0;
  }

  .shop-card-media {
    width: 100%;
    height: 178px;
    min-height: 0;
    aspect-ratio: auto;
  }

  .shop-card-footer {
    display: grid;
    gap: 10px;
  }

  .billing-hero h1 {
    font-size: 31px;
  }

  .billing-offer-card {
    min-height: 0;
    padding: 20px;
  }
}
