﻿:root {
  --bg: #08080a;
  --panel: #151217;
  --panel-2: #1e171e;
  --ink: #fff5f7;
  --muted: rgba(255, 245, 247, 0.68);
  --accent: #a855f7;
  --accent-rgb: 168, 85, 247;
  --accent-dark-rgb: 67, 20, 92;
  --accent-2: #d8b4fe;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    url("assets/chat-background.png") center / cover fixed no-repeat,
    var(--bg) !important;
  background-blend-mode: normal !important;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body.creator-mode {
  overflow: auto;
}

body.setup-active {
  overflow: hidden;
}

body.setup-active .mode-bar {
  display: none;
}

body.setup-tab-preferences [data-admin-entry],
body.setup-tab-preferences [data-chat-home],
body.setup-tab-preferences [data-creator-toggle] {
  display: none;
}

body.preferences-page-active .topbar,
body.preferences-page-active .quick-persona-head,
body.preferences-page-active .setup-logo-stage,
body.preferences-page-active .setup-tabs,
body.preferences-page-active [data-setup-panel],
body.preferences-page-active [data-help-panel],
body.preferences-page-active [data-contact-panel],
body.preferences-page-active [data-member-account-panel],
body.preferences-page-active [data-session-images-panel],
body.preferences-page-active .quick-persona-grid,
body.preferences-page-active .setup-start-row,
body.preferences-page-active .setup-card:not(.settings-panel) {
  display: none !important;
}

body.auth-page-active .setup-tabs,
body.auth-page-active [data-setup-panel],
body.auth-page-active [data-help-panel],
body.auth-page-active [data-contact-panel],
body.auth-page-active [data-auth-entry],
body.auth-page-active .panel-head,
body.auth-page-active .scene-status,
body.auth-page-active .player-voice-bar,
body.auth-page-active .presence-strip,
body.auth-page-active .hypnosis-stage,
body.auth-page-active .messages,
body.auth-page-active .chat-input-hint,
body.auth-page-active .composer,
body.auth-page-active .setup-start-row,
body.auth-page-active .main-lower-logo {
  display: none !important;
}

body.auth-page-active .chat-panel {
  overflow: hidden;
}

body.auth-page-active [data-member-account-panel] {
  display: block !important;
  position: relative;
  max-width: min(1180px, calc(100vw - 40px));
  min-height: calc(100dvh - 92px);
  margin: 4px auto 0;
  padding: 18px 22px 20px;
}

body.preferences-page-active .chat-panel {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

body.preferences-page-active .quick-persona-panel {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.preferences-page-active .app-shell {
  width: min(1480px, calc(100% - 28px));
  height: 100dvh;
  min-height: 0;
  padding: 10px 0;
  overflow: hidden;
}

body.preferences-page-active.setup-active .app-shell {
  height: 100dvh;
  min-height: 0;
}

body.age-gate-active {
  overflow: hidden;
}

body.age-gate-active .app-shell {
  display: none;
}

body,
body.creator-mode,
body.setup-active,
body.preferences-page-active,
body.auth-page-active,
body.age-gate-active {
  background:
    url("assets/chat-background.png") center / cover fixed no-repeat,
    var(--bg) !important;
  background-blend-mode: normal !important;
}

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

button,
a {
  cursor: pointer;
}

.hypnosis-start-main {
  border-color: rgba(var(--accent-rgb), 0.9);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-dark-rgb), 0.95));
  color: #fff;
  font-weight: 900;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 0 18px rgba(var(--accent-rgb), 0.42);
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.creator-mode .app-shell {
  height: auto;
  min-height: 100dvh;
}

.setup-active .app-shell {
  height: auto;
  min-height: 100dvh;
}

.chat-active .app-shell {
  width: min(1600px, calc(100% - 24px));
  height: 100dvh;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

body.setup-active .topbar,
body.auth-page-active .topbar,
body.preferences-page-active .topbar {
  display: none !important;
}

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
}

.mode-bar strong,
.mode-bar span {
  display: block;
}

.mode-bar strong {
  margin-bottom: 2px;
}

.mode-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.api-pill {
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.api-pill.is-ok {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: #b8fff3;
}

.api-pill.is-error {
  border-color: rgba(225, 29, 72, 0.7);
  color: #ffd0dc;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

.creator-mode .layout {
  display: none;
}

.creator-mode.profile-open .layout {
  display: block;
}

.creator-page {
  display: block;
}

.creator-page.is-hidden {
  display: none !important;
}

.creator-page-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 180px),
    var(--panel);
  box-shadow: var(--shadow);
}

.creator-page-head h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.creator-page-head p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.creator-tool-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.creator-tool-tabs button,
.creator-tool-overview button {
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 8px;
  background: rgba(8, 6, 10, 0.78);
  color: var(--ink);
  font-weight: 900;
  min-height: 44px;
}

.creator-tool-tabs button.is-active,
.creator-tool-overview button:hover {
  border-color: rgba(var(--accent-rgb), 0.95);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.86), rgba(var(--accent-dark-rgb), 0.92));
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.28);
}

.creator-tool-intro,
.creator-tool-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  margin-bottom: 14px;
}

.creator-tool-intro {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.creator-tool-intro strong {
  font-size: 18px;
}

.creator-tool-intro span {
  color: var(--muted);
  font-weight: 800;
}

.creator-tool-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  padding: 12px;
}

.creator-tool-overview button {
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 14px;
  min-height: 96px;
  text-align: left;
}

.creator-tool-overview span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.creator-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.8fr);
  gap: 14px;
  align-items: start;
}

body.creator-tool-image-generator .creator-page-grid,
body.creator-tool-image-bank .creator-page-grid,
body.creator-tool-comfy .creator-page-grid,
body.creator-tool-hypno-images .creator-page-grid,
body.creator-tool-overview .creator-page-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.creator-tool-overview .creator-page-grid {
  display: none;
}

.creator-images,
.creator-settings {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 220px),
    var(--panel);
  box-shadow: var(--shadow);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.settings-panel,
.chat-panel,
.image-panel {
  padding: 14px;
}

.settings-panel {
  display: none;
  gap: 16px;
  position: fixed;
  z-index: 45;
  top: 14px;
  left: 14px;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 29, 72, 0.7) rgba(0, 0, 0, 0.2);
}

.profile-open .settings-panel {
  display: grid;
}

.preferences-page-active .settings-panel {
  position: static;
  display: grid;
  width: 100%;
  max-height: none;
  overflow: visible;
}

.preferences-page-active .profile-logo-stage {
  display: none;
}

.preferences-page-active .profile-head [data-profile-close],
.preferences-page-active .profile-bottom-actions [data-profile-close] {
  display: none;
}

.profile-return-auth.preferences-page-active .profile-head [data-profile-close],
.profile-return-auth.preferences-page-active .profile-bottom-actions [data-profile-close] {
  display: inline-flex;
}

.preferences-page-active .settings-panel {
  border-color: rgba(var(--accent-rgb), 0.34);
}

.preferences-page-active .profile-head {
  align-items: start;
  margin-bottom: 8px;
}

.profile-language-picker,
.age-language-picker {
  margin-left: auto;
  justify-self: end;
}

.age-language-picker {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-language-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: fit-content;
}

.language-picker select {
  max-width: 150px;
}

.preferences-page-active .profile-intro {
  margin: 4px 0 8px;
}

.preferences-page-active .profile-bottom-actions {
  position: sticky;
  bottom: 8px;
  z-index: 8;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 0 0;
  background: linear-gradient(180deg, transparent, rgba(8, 8, 10, 0.94) 24%);
}

.profile-enter-chat {
  min-width: min(360px, 100%);
  border-color: rgba(var(--accent-rgb), 0.82);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-dark-rgb), 0.95));
  color: #fff;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.26);
}

.profile-enter-chat:disabled,
.profile-enter-chat.is-disabled {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(90, 90, 96, 0.72), rgba(46, 46, 52, 0.72));
  color: rgba(255, 255, 255, 0.62);
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(0.75);
}

.preference-lexicon {
  margin: 0 0 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.26);
}

.preference-lexicon summary {
  cursor: pointer;
  color: rgb(var(--accent-rgb));
  font-weight: 800;
}

.preference-lexicon p {
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.45;
}

.preference-lexicon-row {
  justify-content: flex-start;
  margin: 0 0 10px;
}

.preference-lexicon-page {
  position: fixed;
  inset: clamp(12px, 2vh, 24px) clamp(12px, 3vw, 48px);
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  max-width: min(1280px, calc(100vw - 24px));
  margin: 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  border-radius: 10px;
  padding: clamp(14px, 2vw, 24px);
  background:
    linear-gradient(180deg, rgba(22, 8, 30, 0.96), rgba(7, 5, 10, 0.98)),
    rgba(0, 0, 0, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 0 42px rgba(var(--accent-rgb), 0.14);
}

.preference-lexicon-page.is-hidden {
  display: none !important;
}

.preference-lexicon-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.preference-lexicon-page-head h2 {
  margin: 0;
  color: #fff;
}

.preference-lexicon-content {
  min-height: 0;
  overflow: auto;
  padding: 8px 10px 18px 0;
  color: var(--ink);
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
}

.profile-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, 0.62);
}

.profile-head,
.quick-persona-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.profile-head h2,
.quick-persona-head h2 {
  margin-bottom: 4px;
}

.quick-persona-panel {
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  background:
    linear-gradient(90deg, rgba(225, 29, 72, 0.13), transparent 52%),
    rgba(0, 0, 0, 0.22);
}

.home-logo-stage {
  display: flex;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 2px 0 8px;
}

.home-logo-stage img {
  display: block;
  width: min(760px, 96%);
  max-height: clamp(260px, 50vh, 640px);
  object-fit: contain;
  filter:
    drop-shadow(0 0 26px rgba(180, 55, 255, 0.32))
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.48));
}

.quick-persona-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.setup-account-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.setup-left-actions {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.setup-page-title {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.setup-left-actions button,
.setup-account-actions > button,
.auth-page-head button {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-dark-rgb), 0.88));
  color: #fff;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.24);
}

.setup-account-actions button.is-active,
.setup-tabs button.is-active {
  border-color: rgba(var(--accent-rgb), 0.9);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-dark-rgb), 0.95));
  color: #fff;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.32);
}

.member-avatar {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.member-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: min(220px, 78vw);
  padding: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 8px;
  background: rgba(8, 6, 12, 0.96);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
}

.member-avatar-menu button {
  width: 100%;
}

.login-confirmation {
  margin: 8px 0 10px auto;
  width: fit-content;
  max-width: min(520px, 100%);
  padding: 8px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 8px;
  background: rgba(15, 9, 24, 0.92);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}

.setup-logo-stage {
  display: grid;
  place-items: center;
  margin: 10px auto 14px;
  pointer-events: none;
}

.setup-logo-stage img {
  display: block;
  width: min(430px, 62vw);
  max-height: clamp(170px, 27vh, 310px);
  object-fit: contain;
  filter:
    drop-shadow(0 0 22px rgba(186, 70, 255, 0.28))
    drop-shadow(0 12px 26px rgba(0, 0, 0, 0.42));
}

.main-lower-logo {
  display: grid;
  place-items: center;
  min-height: clamp(150px, 30vh, 380px);
  margin: 8px auto;
  overflow: hidden;
  pointer-events: none;
}

.main-lower-logo img {
  display: block;
  width: min(960px, 98%);
  height: min(36vh, 430px);
  object-fit: contain;
  filter:
    drop-shadow(0 0 24px rgba(186, 70, 255, 0.32))
    drop-shadow(0 14px 28px rgba(0, 0, 0, 0.46));
}

body.preferences-page-active .main-lower-logo,
body.chat-active .main-lower-logo,
body.hypnosis-active .main-lower-logo,
body.creator-mode .main-lower-logo {
  display: none;
}

.setup-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.setup-tabs [data-setup-tab="chat"] {
  order: 1;
}

.setup-tabs [data-setup-tab="hypnosis"] {
  order: 2;
}

.setup-tabs [data-setup-tab="sessionImages"] {
  order: 3;
}

.setup-tabs [data-setup-tab="preferences"] {
  order: 4;
}

.setup-tabs button,
.setup-start-button {
  min-height: 44px;
  font-weight: 900;
}

.setup-tab-panel {
  display: none;
}

.setup-tab-panel.is-active {
  display: block;
}

.setup-tab-panel[data-setup-panel="preferences"] [data-profile-toggle-inline] {
  margin-top: 16px;
}

body:not(.chat-subview-create) [data-member-persona-live],
body:not(.chat-subview-own) [data-member-persona-own-panel],
body:not(.chat-subview-community) [data-member-persona-public-panel] {
  display: none !important;
}

body.chat-subview-own .quick-persona-head,
body.chat-subview-create .quick-persona-head,
body.chat-subview-own .setup-tabs,
body.chat-subview-create .setup-tabs,
body.chat-subview-own .login-confirmation,
body.chat-subview-create .login-confirmation,
body.chat-subview-own [data-help-panel],
body.chat-subview-create [data-help-panel],
body.chat-subview-own [data-contact-panel],
body.chat-subview-create [data-contact-panel],
body.chat-subview-own [data-member-account-panel],
body.chat-subview-create [data-member-account-panel],
body.chat-subview-own [data-session-images-panel],
body.chat-subview-create [data-session-images-panel],
body.chat-subview-own [data-chat-section-title],
body.chat-subview-create [data-chat-section-title],
body.chat-subview-own [data-official-persona-grid],
body.chat-subview-create [data-official-persona-grid],
body.chat-subview-own [data-chat-main-buttons],
body.chat-subview-create [data-chat-main-buttons],
body.chat-subview-own [data-quick-ensemble-picker],
body.chat-subview-create [data-quick-ensemble-picker],
body.chat-subview-community .quick-persona-head,
body.chat-subview-community .setup-tabs,
body.chat-subview-community .login-confirmation,
body.chat-subview-community [data-help-panel],
body.chat-subview-community [data-contact-panel],
body.chat-subview-community [data-member-account-panel],
body.chat-subview-community [data-session-images-panel],
body.chat-subview-community [data-chat-section-title],
body.chat-subview-community [data-official-persona-grid],
body.chat-subview-community [data-chat-main-buttons],
body.chat-subview-community [data-quick-ensemble-picker],
body.chat-subview-community [data-member-persona-live] {
  display: none !important;
}

body.chat-subview-own .app-shell,
body.chat-subview-create .app-shell,
body.chat-subview-community .app-shell {
  width: min(1280px, calc(100% - 28px));
  height: 100dvh;
  padding: 14px 0;
}

body.chat-subview-own .quick-persona-panel,
body.chat-subview-create .quick-persona-panel,
body.chat-subview-community .quick-persona-panel {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.chat-subview-own [data-setup-panel="chat"],
body.chat-subview-create [data-setup-panel="chat"],
body.chat-subview-community [data-setup-panel="chat"] {
  height: 100%;
}

body.chat-subview-create [data-member-persona-live],
body.chat-subview-own [data-member-persona-own-panel],
body.chat-subview-community [data-member-persona-public-panel],
body.chat-subview-create [data-member-persona-live].is-active,
body.chat-subview-own [data-member-persona-own-panel].is-active,
body.chat-subview-community [data-member-persona-public-panel].is-active {
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100dvh - 28px);
  margin: 0;
  padding: 20px;
}

body.chat-subview-create [data-member-persona-live] > summary {
  display: none;
}

body.chat-subview-create .member-create-back {
  justify-content: center;
  order: 3;
  margin-top: 14px;
}

body.chat-subview-create .member-create-back button {
  min-width: 180px;
  border-color: rgba(var(--accent-rgb), 0.78);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-dark-rgb), 0.92));
  color: #fff;
  font-weight: 900;
}

.site-help-panel {
  margin: 10px 0 12px;
}

.site-help-panel p {
  margin: 8px 0;
  line-height: 1.45;
}

.session-images-panel {
  display: none;
  margin: 10px 0 12px;
}

.setup-tab-chat .session-images-panel {
  display: none;
}

.setup-tab-session-images .session-images-panel.is-active {
  display: block;
}

.session-images-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.session-images-head h3,
.session-images-head p {
  margin: 0;
}

.session-images-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.session-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.session-image-card {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  text-align: left;
}

.session-image-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #050405;
}

.session-image-card span {
  overflow: hidden;
  color: rgba(255, 235, 244, 0.84);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-mode-panel {
  margin-top: 12px;
}

.setup-start-button {
  width: min(280px, 100%);
}

.chat-main-buttons {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  justify-content: center;
  gap: 18px;
  margin: 28px auto 34px;
  width: 100%;
}

.chat-main-buttons .setup-start-button {
  width: 100%;
}

.chat-main-buttons [data-chat-start-official] {
  margin-bottom: 26px;
}

.setup-start-button.is-hidden {
  display: none !important;
}

.quick-persona-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-top: 10px;
}

.persona-grid.quick-persona-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.quick-persona-grid .persona-card img {
  height: clamp(150px, 22vh, 240px);
  aspect-ratio: auto;
  object-fit: contain;
}

.quick-ensemble-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.quick-ensemble-picker h3,
.quick-ensemble-picker p {
  grid-column: 1 / -1;
}

[data-creator-tool] {
  display: none !important;
}

.creator-mode [data-creator-tool] {
  display: revert !important;
}

.creator-mode section[data-creator-tool],
.creator-mode .panel[data-creator-tool] {
  display: block !important;
}

.creator-mode .api-pill[data-creator-tool] {
  display: block !important;
}

.creator-mode button[data-creator-tool] {
  display: inline-flex !important;
}

.is-hidden {
  display: none !important;
}

.creator-mode [data-creator-tool].is-hidden {
  display: none !important;
}

.creator-mode [data-creator-image-section][hidden] {
  display: none !important;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.persona-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  text-align: left;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.persona-card.is-active {
  border-color: rgba(var(--accent-rgb), 0.86);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}

.persona-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.56);
  background: rgba(255, 255, 255, 0.055);
}

.persona-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.persona-card span,
.persona-card small,
.field span {
  color: rgba(255, 245, 247, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.persona-card small {
  color: rgba(117, 255, 240, 0.86);
  font-size: 11px;
  line-height: 1.2;
}

.ensemble-picker {
  display: none;
  margin-top: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.24);
}

.ensemble-picker.is-open {
  display: grid;
  gap: 8px;
}

.ensemble-picker h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.ensemble-picker p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-persona-panel {
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.setup-card {
  margin-top: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.1), transparent 82%),
    rgba(0, 0, 0, 0.2);
}

.setup-section-title {
  margin: 14px 0 10px;
  color: var(--ink);
  font-size: 15px;
}

.member-account-panel summary,
.member-persona-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

body.auth-page-active .member-account-panel > summary {
  display: none;
}

.member-account-form h3,
.liberty-pack-info h3 {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  margin: 0 0 9px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 7px;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.36);
}

.member-account-form,
.member-verify-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.member-account-form + .member-account-form {
  margin-top: 28px;
}

.member-subscription {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.payment-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-choice-row button {
  width: 100%;
}

.payment-option-button {
  display: grid;
  gap: 6px;
  min-height: 128px;
  padding: 14px;
  text-align: left;
}

.payment-option-button span,
.payment-option-button small {
  color: var(--muted);
  line-height: 1.3;
}

.payment-option-button small {
  font-size: 12px;
}

.auth-page-head {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 0;
}

.auth-page-head h2,
.auth-page-head p,
.liberty-pack-info p {
  margin: 0;
}

.auth-page-head p,
.liberty-pack-info p {
  color: var(--muted);
  line-height: 1.55;
}

.liberty-pack-info {
  display: grid;
  gap: 14px;
  margin: 20px 0 10px;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
}

.liberty-pack-info [data-plan-description] {
  display: grid;
  gap: 12px;
}

.plan-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-choice {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 8px;
  background: rgba(11, 5, 16, 0.92);
  color: var(--ink);
  text-align: left;
}

.plan-choice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.plan-choice.is-active {
  border-color: rgba(var(--accent-rgb), 0.95);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.5), rgba(49, 8, 70, 0.58));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.34);
}

@media (max-width: 720px) {
  .plan-choice-row,
  .payment-choice-row {
    grid-template-columns: 1fr;
  }
}

.setup-mode-panel {
  display: grid;
  gap: 10px;
}

.setup-mode-panel h3 {
  margin: 0;
  font-size: 15px;
}

.setup-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.setup-mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.32);
  font-weight: 900;
}

.register-preferences-callout {
  margin: 12px 0 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  border-radius: 8px;
  padding: 12px;
  background: rgba(var(--accent-rgb), 0.08);
}

.register-preferences-callout h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
}

.register-preferences-callout p {
  margin: 0 0 10px;
}

.setup-mode-option:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.78);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}

.setup-hypnosis-choice {
  justify-content: start;
}

.hypnosis-scenario-choice {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hypnosis-scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 12px 0 16px;
}

.hypnosis-scenario-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px 16px;
  text-align: left;
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(14, 9, 18, 0.88);
}

.hypnosis-scenario-card.is-active {
  border-color: rgba(var(--accent-rgb), 0.95);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.82), rgba(var(--accent-dark-rgb), 0.86));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.24);
}

.hypnosis-scenario-card strong {
  color: #fff;
  font-size: 15px;
}

.hypnosis-scenario-card span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.setup-start-button {
  justify-self: start;
  min-height: 44px;
  border-color: rgba(var(--accent-rgb), 0.78);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-dark-rgb), 0.92));
  color: #fff;
  font-weight: 900;
}

.member-persona-choice-panel {
  display: block;
}

.member-persona-choice-panel h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.member-persona-choice-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-content: start;
  gap: 14px;
  margin-bottom: 16px;
}

.member-gallery-actions {
  justify-content: center;
  gap: 14px;
}

.member-gallery-actions button {
  min-width: 180px;
  border-color: rgba(var(--accent-rgb), 0.78);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-dark-rgb), 0.92));
  color: #fff;
  font-weight: 900;
}

.chat-member-persona-panel {
  margin-top: 12px;
}

.member-persona-create-details {
  border-color: rgba(var(--accent-rgb), 0.3);
}

.chat-member-persona-panel:not([open]) {
  padding-bottom: 10px;
}

.member-persona-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.member-persona-preview,
.member-persona-gallery {
  display: grid;
  gap: 9px;
}

.member-persona-card-description {
  display: block;
  max-height: 4.5em;
  overflow: hidden;
  color: rgba(255, 235, 247, 0.76);
  font-size: 12px;
  line-height: 1.25;
}

.member-persona-preview {
  min-height: 120px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.member-persona-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.member-persona-gallery {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-content: start;
}

.member-persona-gallery .persona-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-auto-rows: auto;
  align-items: start;
  gap: 10px 14px;
  min-height: 0;
  padding: 12px;
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(0, 0, 0, 0.44);
}

.member-persona-gallery .persona-card img {
  grid-row: 1 / span 5;
  width: 150px;
  height: 210px;
  object-fit: cover;
  object-position: center top;
  border-radius: 7px;
  background: #050405;
}

.member-persona-gallery .persona-card span,
.member-persona-gallery .persona-card small,
.member-persona-gallery .persona-card .member-persona-card-description {
  grid-column: 2;
  margin: 0;
}

.member-persona-gallery .persona-card span {
  align-self: end;
  font-size: 18px;
  line-height: 1.15;
}

.member-persona-gallery .persona-card small {
  color: rgba(224, 255, 248, 0.86);
  font-size: 13px;
  line-height: 1.25;
}

.member-persona-gallery .persona-card .member-persona-card-description {
  max-height: none;
  color: rgba(255, 235, 247, 0.82);
  font-size: 13px;
  line-height: 1.35;
}

.member-persona-gallery .persona-card .mini-edit-button {
  grid-column: 2;
  justify-self: start;
  min-width: 120px;
  min-height: 36px;
  padding: 8px 14px;
}

.ensemble-combo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ensemble-combo-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 84px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  text-align: left;
}

.ensemble-combo-card.is-active {
  border-color: rgba(var(--accent-rgb), 0.86);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.ensemble-combo-card img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: #050405;
}

.ensemble-combo-card span {
  color: rgba(255, 245, 247, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.identity-picker,
.scenario-picker {
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.preferences-page-active .identity-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px 12px;
}

.preferences-page-active .identity-picker h3,
.preferences-page-active .identity-picker .identity-title-current {
  grid-column: 1 / -1;
}

.preferences-page-active .scenario-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 10px;
}

.preferences-page-active .scenario-picker h3,
.preferences-page-active .scenario-picker .scenario-help,
.preferences-page-active .scenario-picker .scenario-head {
  grid-column: 1 / -1;
}

.preferences-page-active .scenario-picker .scenario-head {
  display: none;
}

.preferences-page-active .scenario-row {
  min-height: 46px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.18);
  grid-template-columns: minmax(110px, 1fr) repeat(3, 30px);
}

.preferences-page-active .scenario-row > span {
  line-height: 1.15;
}

.identity-picker h3,
.scenario-picker h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.scenario-head,
.scenario-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 46px 70px 46px;
  gap: 8px;
  align-items: center;
}

.scenario-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scenario-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.scenario-legend > span {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.2;
}

.legend-dots {
  display: inline-grid;
  grid-template-columns: repeat(3, 14px);
  gap: 4px;
  align-items: center;
  vertical-align: middle;
}

.legend-dots b {
  width: 13px;
  height: 13px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.72);
}

.legend-yes b:nth-child(1),
.legend-maybe b:nth-child(2),
.legend-no b:nth-child(3) {
  border-color: rgba(var(--accent-rgb), 0.96);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 16%, rgba(var(--accent-rgb), 0.95) 18% 50%, rgba(var(--accent-dark-rgb), 0.98) 52% 100%);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.22),
    0 0 12px rgba(var(--accent-rgb), 0.48);
}

.scenario-head {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-row {
  min-height: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 245, 247, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.scenario-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  justify-self: center;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), transparent 45%),
    rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.scenario-row input:hover {
  border-color: rgba(var(--accent-rgb), 0.72);
  transform: scale(1.08);
}

.scenario-row input:checked {
  border-color: rgba(var(--accent-rgb), 0.96);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 18%, rgba(var(--accent-rgb), 0.95) 20% 48%, rgba(var(--accent-dark-rgb), 0.98) 50% 100%);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.28),
    0 0 14px rgba(var(--accent-rgb), 0.58);
}

.scenario-row input:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.85);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .preferences-page-active .scenario-picker {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .preferences-page-active .identity-picker,
  .preferences-page-active .scenario-picker {
    grid-template-columns: 1fr;
  }

  .preferences-page-active .profile-logo-stage img {
    width: min(190px, 52vw);
    max-height: 115px;
  }
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-row span {
  color: rgba(255, 245, 247, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.field textarea {
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap;
}

.preferences-page-active .field textarea {
  min-height: 72px;
  max-height: 150px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.composer textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.62);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
  background: rgba(0, 0, 0, 0.46);
}

.limit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.limit-list span {
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 999px;
  padding: 6px 8px;
  background: rgba(var(--accent-rgb), 0.08);
  color: rgba(235, 255, 252, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.chat-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 26vw, 620px);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  min-height: 0;
  align-items: start;
  min-width: 0;
  overflow: hidden;
}

.setup-active .chat-panel {
  display: block;
  height: auto;
  overflow: visible;
}

.setup-active .chat-panel > .panel-head,
.setup-active .scene-status,
.setup-active .player-voice-bar,
.setup-active .presence-strip,
.setup-active .hypnosis-stage,
.setup-active .messages,
.setup-active .voice-audio,
.setup-active .composer {
  display: none !important;
}

.chat-active .chat-panel > .panel-head {
  grid-row: 1;
}

.chat-active .scene-status {
  grid-row: 2;
}

.chat-active .messages {
  grid-row: 3 / 5;
}

.chat-active .composer {
  grid-row: 5;
}

.chat-active .presence-strip {
  grid-row: 1 / 6;
}

.chat-active {
  overflow: hidden;
}

.chat-active .mode-bar {
  display: none;
}

.chat-active .topbar {
  margin-bottom: 8px;
}

.chat-active .chat-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 34vw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100dvh - 84px);
  min-height: 0;
  overflow: hidden;
}

.chat-active .chat-panel > .panel-head {
  grid-column: 1;
  grid-row: 1;
}

.chat-active .scene-status,
.chat-active .player-hypnosis-picker,
.chat-active [data-start-scene-player],
.chat-active [data-start-hypnosis-player],
.chat-active [data-pause-hypnosis-player],
.chat-active [data-stop-hypnosis-player],
.chat-active [data-stop-voice] {
  display: none !important;
}

.chat-active .messages {
  grid-column: 1;
  grid-row: 2;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.chat-active .composer {
  grid-column: 1;
  grid-row: 3;
}

.chat-active .presence-strip {
  grid-column: 2;
  grid-row: 1 / 4;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.chat-active .presence-card {
  min-height: 100%;
  align-content: center;
}

.chat-active .presence-card img {
  width: 100%;
  height: calc(100dvh - 132px);
  max-height: none;
  object-fit: contain;
}

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

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-persona-panel {
  grid-column: 1 / -1;
}

.scene-started:not(.profile-open) .quick-persona-panel {
  display: none;
}

.chat-panel > .panel-head {
  grid-column: 1;
  grid-row: 2;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 0;
}

.scene-status {
  grid-column: 1;
  grid-row: 3;
  margin: -2px 0 0;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.presence-strip {
  display: grid;
  grid-column: 2;
  grid-row: 2 / 6;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
  max-height: calc(100vh - 176px);
  margin-bottom: 0;
  overflow: hidden;
  padding-right: 0;
}

.presence-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
  border-color: rgba(var(--accent-rgb), 0.24);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.11), transparent 62%),
    rgba(0, 0, 0, 0.3);
  text-align: left;
}

.presence-card img {
  width: 100%;
  height: min(68vh, calc(100vh - 248px));
  max-height: calc(100vh - 248px);
  aspect-ratio: auto;
  object-fit: contain;
  object-position: top center;
  border-radius: 6px;
  background: #050405;
}

.presence-card > span {
  padding: 0 8px 8px;
}

.presence-card-wide img {
  aspect-ratio: 1 / 1;
}

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

.presence-card strong {
  font-size: 13px;
}

.presence-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

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

.chat-actions [data-start-hypnosis-player] {
  margin-top: 10px;
}

.session-audio-controls {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 240px;
}

.session-audio-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.session-audio-controls input[type="range"] {
  width: clamp(140px, 18vw, 230px);
  accent-color: var(--accent);
}

.session-audio-controls button {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
}

.session-audio-controls button.is-active {
  border-color: rgba(var(--accent-rgb), 0.95);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-dark-rgb), 0.94));
  color: #fff;
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.28);
}

.player-hypnosis-picker {
  min-width: 170px;
}

.player-hypnosis-audio-status {
  flex-basis: 100%;
  margin: -4px 0 0;
  text-align: right;
}

.player-voice-bar {
  grid-column: 1;
  grid-row: 6;
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.26);
}

.player-voice-bar label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.player-voice-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.player-voice-bar select,
.player-voice-bar input[type="text"] {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
}

.player-voice-bar input[type="text"] {
  width: min(330px, 52vw);
  padding: 0 9px;
}

.player-voice-bar input[type="range"] {
  width: min(180px, 30vw);
  accent-color: var(--accent);
}

.voice-speed-control {
  min-width: min(280px, 100%);
}

.player-voice-bar button {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 10px;
}

[data-local-chat-status].is-ok {
  color: #75fff0;
}

[data-local-chat-status].is-error {
  color: #ffd0dc;
}

.compact-check {
  min-height: 0;
}

.messages {
  grid-column: 1;
  grid-row: 4;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.message {
  box-sizing: border-box;
  max-width: 96%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.05);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  animation: messageIn 0.2s ease both;
}

.message.user {
  justify-self: end;
  max-width: 88%;
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.14);
}

.message.assistant {
  justify-self: start;
}

.message.system {
  justify-self: center;
  max-width: 92%;
  border-color: rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.1);
  color: #ffe7a3;
}

.message-speaker {
  display: inline-block;
  color: #c084fc;
  font-weight: 900;
}

.message-speech {
  color: #d8b4fe;
}

.message-action {
  display: block;
  margin-bottom: 0.72rem;
  color: #f7f2ff;
  font-style: italic;
  font-weight: 800;
}

.message-user-speaker {
  color: #ff5fb7;
  font-weight: 900;
}

.message-user-text {
  color: #ffc1e4;
  font-weight: 800;
}

.message-guest-speaker {
  color: #d8b4fe;
}

.message-guest-speech {
  color: #f6eaff;
}

.message-guest-action {
  color: #ffd166;
}

.message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.message-photo-offer {
  display: block;
  width: fit-content;
  margin-top: 9px;
  min-height: 30px;
  padding: 5px 9px;
  border-color: rgba(255, 72, 176, 0.36);
  background: rgba(255, 72, 176, 0.14);
  color: #ffe6f4;
  font-size: 11px;
  font-weight: 900;
}

.message-session-image {
  display: block;
  width: min(100%, 280px);
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(184, 74, 255, 0.42);
  border-radius: 8px;
  background: rgba(8, 3, 14, 0.92);
  color: #f7e9ff;
  text-align: left;
  box-shadow: 0 0 18px rgba(184, 74, 255, 0.2);
}

.message-session-image img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.message-session-image span {
  display: block;
  padding: 7px 9px;
  color: #f2d8ff;
  font-size: 11px;
  font-weight: 900;
}

.locked-trial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.locked-trial-actions .message-photo-offer {
  margin-top: 0;
}

.composer {
  grid-column: 1;
  grid-row: 5;
  margin-top: 0;
}

.stop-rule {
  margin: 0 0 8px;
  border: 1px solid rgba(255, 72, 176, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 235, 244, 0.88);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.chat-input-hint {
  margin: 0 0 8px;
  color: rgba(255, 220, 238, 0.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.composer textarea {
  width: 100%;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  resize: vertical;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.composer.is-sending textarea {
  border-color: rgba(225, 29, 72, 0.38);
}

.composer textarea:disabled {
  cursor: wait;
  opacity: 0.78;
}

.form-row,
.button-row,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-mode-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.inline-mode-picker span {
  color: rgba(255, 245, 247, 0.86);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inline-mode-picker select {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--ink);
  font-weight: 900;
}

.inline-mode-picker input[type="file"] {
  max-width: 210px;
  min-height: 30px;
  padding: 4px;
  font-size: 11px;
}

.inline-mode-picker input[type="search"] {
  width: 150px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--ink);
}

.inline-audio-select {
  max-width: 260px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
  font-weight: 800;
}

.inline-status {
  width: 100%;
  text-align: right;
}

.form-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.voice-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.interactive-panel {
  display: grid;
  gap: 10px;
}

.toy-help {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.35;
}

.toy-connect-guide {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(178, 77, 255, 0.28);
  border-radius: 8px;
  background: rgba(5, 4, 8, 0.46);
}

.toy-download-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(210, 158, 255, 0.55);
  background: linear-gradient(180deg, rgba(154, 67, 255, 0.92), rgba(96, 26, 166, 0.92));
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.toy-connect-guide ol {
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.35;
}

.toy-connect-guide li + li {
  margin-top: 4px;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toy-actions button {
  width: 100%;
  min-height: 34px;
  padding: 8px 9px;
}

[data-toy-stop] {
  border-color: rgba(255, 69, 115, 0.78);
  background: linear-gradient(180deg, rgba(128, 16, 45, 0.9), rgba(70, 7, 25, 0.94));
}

.voice-audio {
  grid-column: 1;
  width: 100%;
  margin-top: 10px;
  display: none;
}

[data-hypnosis-audio-player] {
  display: none;
}

.hypnosis-file-list {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 8px 9px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

[data-hypnosis-audio-library] {
  min-height: 130px;
}

[data-hypnosis-video-library] {
  min-height: 130px;
}

.range-field strong {
  float: right;
  color: var(--accent-2);
  font-size: 12px;
}

.range-field input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
  background: transparent;
}

.hypnosis-stage {
  --swing-duration: 3s;
  --flash-opacity: 0.65;
  position: relative;
  height: 230px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(225, 29, 72, 0.08), rgba(var(--accent-rgb), 0.04)),
    #050507;
}

.hypnosis-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 80px);
  pointer-events: none;
}

.hypnosis-spiral {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(92%, 420px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--spiral-image, url("assets/pendulum/neon-spiral-static.png")) center / contain no-repeat;
  opacity: var(--spiral-opacity, 0.62);
  filter:
    drop-shadow(0 0 12px rgba(255, 20, 190, 0.72))
    drop-shadow(0 0 36px rgba(255, 20, 190, 0.36));
  mix-blend-mode: screen;
  pointer-events: none;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
  animation: hypnosisSpiralSpin 12s linear infinite;
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.hypnosis-stage.is-persona-flash .hypnosis-spiral {
  opacity: calc(var(--spiral-opacity, 0.62) * 0.86);
  filter:
    drop-shadow(0 0 16px rgba(255, 20, 190, 0.8))
    drop-shadow(0 0 46px rgba(255, 20, 190, 0.42));
}

.hypnosis-stage.is-media-flash .hypnosis-spiral {
  opacity: var(--spiral-media-opacity, 0.04);
  filter:
    blur(1px)
    drop-shadow(0 0 10px rgba(255, 20, 190, 0.36));
}

.hypnosis-pendulum {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 2;
  width: 132px;
  height: 190px;
  margin-left: -66px;
  transform-origin: 50% 0;
  animation: pendulumSwing var(--swing-duration) linear infinite;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.hypnosis-pendulum.has-real-sprite {
  top: -8px;
  width: 340px;
  height: 278px;
  margin-left: -170px;
}

.pendulum-real-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 20px 16px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 16px rgba(255, 229, 165, 0.15));
}

.hypnosis-pendulum.has-real-sprite .pendulum-real-image {
  display: block;
}

.hypnosis-pendulum.has-real-sprite .pendulum-hinge,
.hypnosis-pendulum.has-real-sprite .pendulum-line,
.hypnosis-pendulum.has-real-sprite .pendulum-disc,
.hypnosis-pendulum.has-real-sprite .pendulum-shadow {
  display: none;
}

.hypnosis-stage.is-flashing .hypnosis-pendulum {
  opacity: 0;
  filter: blur(10px);
}

.hypnosis-stage.is-phase-intro .hypnosis-spiral,
.hypnosis-stage.is-phase-intro .hypnosis-pendulum {
  opacity: 0;
  animation-play-state: paused;
}

.hypnosis-stage.is-phase-countdown .hypnosis-flash-image,
.hypnosis-stage.is-phase-countdown .hypnosis-flash-video,
.hypnosis-stage.is-phase-intro .hypnosis-flash-image,
.hypnosis-stage.is-phase-intro .hypnosis-flash-video {
  display: none !important;
}

.hypnosis-stage.is-hypnosis-paused .hypnosis-spiral,
.hypnosis-stage.is-hypnosis-paused .hypnosis-pendulum {
  animation-play-state: paused;
}

.hypnosis-mistress-image {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.94;
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 26px rgba(255, 0, 150, 0.35));
}

.hypnosis-stage.is-phase-intro .hypnosis-mistress-image {
  display: block;
}

.pendulum-hinge {
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 235, 180, 0.55);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 38%),
    linear-gradient(90deg, #5b4b30, #f5d57c, #6d5934);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.65);
}

.pendulum-line {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 96px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, #4d3a1e, #ffe39a 42%, #6c4f28 70%, #2b2115);
  box-shadow: 0 0 10px rgba(255, 209, 116, 0.28);
}

.pendulum-disc {
  position: absolute;
  left: 50%;
  top: 88px;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  transform: translateX(-50%);
  overflow: hidden;
  border: 2px solid rgba(255, 232, 163, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 18%, transparent 34%),
    radial-gradient(circle at 50% 52%, rgba(var(--accent-rgb), 0.22), transparent 48%),
    linear-gradient(135deg, #131014, #342017 42%, #020203 100%);
  background-position: center;
  background-size: cover;
  box-shadow:
    inset 0 0 18px rgba(255, 235, 184, 0.18),
    inset 0 -12px 20px rgba(0, 0, 0, 0.65),
    0 22px 26px rgba(0, 0, 0, 0.54),
    0 0 24px rgba(225, 29, 72, 0.22);
}

.pendulum-disc::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 224, 151, 0.44);
  border-radius: 50%;
}

.pendulum-disc.has-custom-sprite .pendulum-pentacle,
.pendulum-disc.has-custom-sprite::before {
  display: none;
}

.pendulum-pentacle {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  fill: none;
  stroke: rgba(255, 230, 158, 0.9);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(255, 221, 137, 0.45));
}

.pendulum-shadow {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 86px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  filter: blur(7px);
}

.hypnosis-flash-image,
.hypnosis-flash-video {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: var(--flash-opacity);
}

.hypnosis-flash-image.is-visible,
.hypnosis-flash-video.is-visible {
  display: block;
  animation: flashPulse 0.22s ease both;
}

.hypnosis-stage.is-persona-flash .hypnosis-flash-image.is-visible {
  opacity: 0.82;
}

.hypnosis-stage.is-media-flash .hypnosis-flash-image.is-visible,
.hypnosis-stage.is-media-flash .hypnosis-flash-video.is-visible {
  animation-duration: 0.13s;
}

.hypnosis-active {
  overflow: hidden;
}

.hypnosis-active .topbar,
.hypnosis-active .mode-bar,
.hypnosis-active .quick-persona-panel,
.hypnosis-active .presence-strip,
.hypnosis-active .player-voice-bar {
  display: none !important;
}

.hypnosis-active [data-start-scene-player],
.hypnosis-active [data-start-hypnosis-player],
.hypnosis-active .player-hypnosis-picker,
.hypnosis-active [data-stop-voice],
.hypnosis-active [data-clear-chat] {
  display: none !important;
}

.hypnosis-active .app-shell {
  width: 100%;
  padding: 0;
}

.hypnosis-active .chat-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(230px, 1fr) minmax(190px, 31vh) auto;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  align-items: stretch;
  border-radius: 0;
  background: #050507;
}

.hypnosis-active .panel-head {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

.hypnosis-active .scene-status {
  grid-column: 1;
  grid-row: 3;
  display: grid;
  place-items: center;
  justify-self: center;
  box-sizing: border-box;
  width: min(920px, calc(100dvw - 32px));
  max-width: 100%;
  min-height: clamp(190px, 31vh, 330px);
  max-height: 34vh;
  padding: 16px 24px;
  overflow: auto;
  border-color: rgba(255, 0, 200, 0.34);
  background: rgba(0, 0, 0, 0.18);
  color: #fff0f8;
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 950;
  line-height: 1.34;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow:
    0 0 10px rgba(255, 0, 200, 0.85),
    0 0 28px rgba(255, 0, 200, 0.46),
    0 2px 6px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.hypnosis-active .scene-status.is-subtitle-visible {
  opacity: 1;
  transform: translateY(0);
}

.hypnosis-active .hypnosis-stage {
  grid-column: 1;
  grid-row: 2;
  height: auto;
  min-height: 260px;
  align-self: stretch;
  margin-bottom: 0;
}

.hypnosis-active .hypnosis-spiral {
  width: min(82vmin, 760px);
}

.hypnosis-active .hypnosis-pendulum.has-real-sprite {
  top: -18px;
  width: min(56vw, 680px);
  height: min(46vh, 500px);
  margin-left: calc(min(56vw, 680px) / -2);
}

.hypnosis-active .messages {
  grid-column: 1;
  display: none;
}

.hypnosis-active .composer {
  grid-column: 1;
  grid-row: 4;
  margin-top: 0;
  display: none;
}

.hypnosis-active .composer textarea {
  min-height: 46px;
}

@keyframes pendulumSwing {
  0% {
    transform: rotate(21deg);
  }

  25% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-21deg);
  }

  75% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(21deg);
  }
}

@keyframes hypnosisSpiralSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.98);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg) scale(0.98);
  }
}

@keyframes flashPulse {
  from {
    opacity: 0;
    transform: scale(1.02);
  }

  to {
    opacity: var(--flash-opacity);
    transform: scale(1);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button,
.result-actions a,
.batch-form a {
  min-height: 38px;
  border: 1px solid rgba(225, 29, 72, 0.46);
  border-radius: 7px;
  padding: 0 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 48%),
    rgba(225, 29, 72, 0.18);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    opacity 0.14s ease;
}

button:hover,
.result-actions a:hover,
.batch-form a:hover {
  border-color: rgba(255, 158, 182, 0.78);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.image-panel {
  grid-column: 1 / -1;
}

.creator-mode .image-panel[data-creator-tool] {
  display: grid !important;
  gap: 14px;
}

.image-panel > .panel-head {
  order: 0;
}

.batch-tool {
  order: 1;
}

.image-grid {
  order: 2;
}

.image-toggle-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.image-toggle-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-panel.is-hidden {
  display: none;
}

.image-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 14px;
}

.source-preview,
.result-frame {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
}

.source-preview {
  min-height: 190px;
  margin-bottom: 10px;
  overflow: hidden;
}

.source-preview img {
  display: none;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.source-preview.has-image img {
  display: block;
}

.source-preview.has-image span {
  display: none;
}

.result-frame {
  min-height: 540px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.result-frame img {
  display: none;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
}

.result-frame.has-image img {
  display: block;
}

.result-frame.has-image span {
  display: none;
}

.result-actions {
  justify-content: flex-end;
  margin: 10px 0;
}

.result-actions a.is-disabled {
  pointer-events: none;
  opacity: 0.42;
}

.batch-tool {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.creator-mode .image-panel .batch-tool {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 16px;
  border-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.compact-head {
  margin-bottom: 8px;
}

.batch-form {
  display: grid;
  gap: 10px;
}

.scenario-progress-wrap {
  display: grid;
  gap: 6px;
  min-width: min(520px, 100%);
}

.scenario-progress-wrap progress {
  width: 100%;
  height: 12px;
  accent-color: var(--violet);
}

.scenario-preview-player {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(190, 80, 255, 0.28);
  border-radius: 8px;
  background: rgba(6, 4, 10, 0.72);
}

.scenario-preview-player audio {
  width: 100%;
}

.scenario-admin-list-wrap {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(190, 80, 255, 0.28);
  border-radius: 8px;
  background: rgba(6, 4, 10, 0.72);
}

.scenario-admin-list-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.scenario-admin-list-head span:first-child {
  color: #fff;
  font-size: 15px;
}

.scenario-admin-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.scenario-admin-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(14, 9, 18, 0.86);
}

.scenario-admin-row.is-active {
  border-color: rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.2);
}

.scenario-admin-check {
  width: 22px;
  height: 22px;
  align-self: center;
  justify-self: center;
  accent-color: var(--violet);
}

.scenario-admin-main {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.scenario-admin-main strong {
  font-size: 15px;
}

.scenario-admin-main span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.slider-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.slider-row span {
  min-width: 96px;
  text-align: right;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.session-bank-preview {
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.session-prompt-admin-tool textarea[readonly] {
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
}

.session-prompt-row-tools,
.session-prompt-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-prompt-row-tools p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.session-prompt-rows {
  display: grid;
  gap: 12px;
}

.session-prompt-row {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(180, 76, 255, 0.32);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.session-prompt-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.session-prompt-field-grid .field.is-wide {
  grid-column: 1 / -1;
}

.comfy-reference-tool,
.lora-admin-tool,
.workflow-admin-tool {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

.tool-list-item {
  display: grid;
  gap: 4px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
}

.tool-list-item strong {
  overflow-wrap: anywhere;
}

.tool-list-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tool-list-item-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.batch-preview {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.batch-preview.has-items {
  display: grid;
}

.batch-thumb {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.26);
}

.batch-thumb-image {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 2 / 3;
  background: rgba(0, 0, 0, 0.5);
}

.batch-thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.batch-thumb span {
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: rgba(255, 245, 247, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.batch-form a.is-disabled,
.batch-form button.is-disabled {
  pointer-events: none;
  opacity: 0.42;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
}

details p {
  white-space: pre-wrap;
}

.age-gate,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    url("assets/chat-background.png") center / cover fixed no-repeat,
    var(--bg);
  background-blend-mode: normal !important;
  overflow-y: auto;
}

.age-gate.is-hidden,
.lightbox:not(.is-open) {
  display: none;
}

.age-box {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid rgba(225, 29, 72, 0.34);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.age-gate[data-age-gate] .age-box {
  width: min(780px, 100%);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(10, 8, 12, 0.9), rgba(5, 4, 7, 0.92));
}

.age-logo-stage {
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.age-logo-stage img {
  width: min(620px, 94vw);
  max-height: 54vh;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 42, 145, 0.36));
}

.age-box:has(.age-warning:not(.is-hidden)) .age-logo-stage img {
  max-height: min(28vh, 220px);
}

.age-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.age-actions button {
  min-width: 120px;
  min-height: 46px;
  font-weight: 900;
}

.age-warning {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 42, 145, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  text-align: left;
}

.age-warning.is-hidden {
  display: none;
}

.age-warning h3 {
  margin: 0 0 10px;
  text-align: center;
}

.age-warning p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.age-warning .age-actions {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  padding: 10px 0 2px;
  background:
    linear-gradient(180deg, transparent, rgba(7, 5, 8, 0.96) 24%),
    rgba(7, 5, 8, 0.96);
}

.age-message {
  min-height: 22px;
  margin-top: 12px;
  color: #ffb5c5;
  font-weight: 900;
}

.lightbox {
  z-index: 60;
}

.lightbox img {
  width: auto;
  max-width: min(94vw, 940px);
  max-height: 92vh;
  object-fit: contain;
  border: 1px solid rgba(225, 29, 72, 0.36);
  background: #050405;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 58px;
  min-height: 78px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.58);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-dark-rgb), 0.92));
  color: #fff;
  font-size: 54px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.28);
}

.lightbox-nav:hover {
  box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.48);
}

.lightbox-prev {
  left: 22px;
}

.lightbox-next {
  right: 22px;
}

.lightbox-nav.is-hidden {
  display: none;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 48px;
  min-height: 48px;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .layout,
  .creator-page-grid,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    order: 2;
    position: fixed;
    max-height: calc(100vh - 20px);
    overflow: auto;
  }

  .batch-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .chat-panel {
    order: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .chat-active {
    overflow: auto;
  }

  .chat-active .app-shell {
    height: auto;
    min-height: 100dvh;
  }

  .chat-active .chat-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(320px, 46vh) auto;
    height: auto;
    min-height: calc(100dvh - 80px);
    overflow: visible;
  }

  .chat-active .presence-strip {
    grid-column: 1;
    grid-row: 2;
    height: auto;
  }

  .chat-active .presence-card img {
    height: min(44vh, 360px);
  }

  .chat-active .messages {
    grid-column: 1;
    grid-row: 3;
    min-height: 320px;
  }

  .chat-active .composer {
    grid-column: 1;
    grid-row: 4;
  }

  .chat-panel > .panel-head,
  .scene-status,
  .player-voice-bar,
  .messages,
  .composer,
  .presence-strip,
  .voice-audio {
    grid-column: 1;
    grid-row: auto;
  }

  .presence-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    max-height: none;
    overflow: visible;
  }

  .presence-card img {
    max-height: 240px;
  }

  .chat-actions {
    justify-content: flex-start;
  }

  .quick-persona-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .persona-grid.quick-persona-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .quick-ensemble-picker {
    grid-template-columns: 1fr;
  }

  .ensemble-combo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 16px, 1480px);
  }

  .topbar,
  .creator-page-head,
  .panel-head {
    display: grid;
    align-items: start;
  }

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

  .persona-grid.quick-persona-grid {
    grid-template-columns: 1fr;
  }

  .presence-strip {
    grid-template-columns: 1fr;
  }

  .messages {
    height: 360px;
    min-height: 360px;
  }

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

  .message {
    max-width: 100%;
  }
}

