:root {
  --bg: #020714;
  --bg-soft: #051022;
  --surface: #071122;
  --surface-2: #0b1830;
  --surface-3: #102346;
  --line: rgba(96, 191, 255, 0.16);
  --line-strong: rgba(43, 202, 255, 0.5);
  --text: #f8f7ff;
  --muted: #b7c6da;
  --muted-2: #7f94ad;
  --violet: #2bcaff;
  --violet-soft: rgba(43, 202, 255, 0.18);
  --violet-quiet: rgba(43, 202, 255, 0.09);
  --cyan: #2bcaff;
  --cyan-soft: rgba(43, 202, 255, 0.16);
  --magenta: #4c7dff;
  --danger: #ff7070;
  --shadow: 0 26px 95px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="light"] {
  --bg: #f3f8ff;
  --bg-soft: #eaf3ff;
  --surface: #ffffff;
  --surface-2: #f0f7ff;
  --surface-3: #e2efff;
  --line: rgba(39, 79, 128, 0.14);
  --line-strong: rgba(11, 167, 232, 0.36);
  --text: #131525;
  --muted: #586a82;
  --muted-2: #74859d;
  --violet: #0ba7e8;
  --violet-soft: rgba(11, 167, 232, 0.12);
  --violet-quiet: rgba(11, 167, 232, 0.075);
  --cyan: #0ba7e8;
  --cyan-soft: rgba(11, 167, 232, 0.12);
  --magenta: #256dff;
  --shadow: 0 24px 80px rgba(34, 48, 90, 0.2);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(2, 7, 20, 0.72), rgba(2, 7, 20, 0.9)),
    radial-gradient(circle at 76% 20%, rgba(43, 202, 255, 0.16), transparent 34%),
    url("assets/bg.png?v=1") center top / cover fixed no-repeat,
    #020714;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: -8vh -8vw;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 7, 20, 0.12), rgba(2, 7, 20, 0.74)),
    url("assets/logo.png?v=5") right -8vw top 4vh / min(72vw, 760px) no-repeat;
  opacity: 0.14;
  filter: saturate(1.2) blur(0.3px);
}

.app-shell,
.age-panel {
  position: relative;
  z-index: 1;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 248, 255, 0.9)),
    url("assets/bg.png?v=1") center top / cover fixed no-repeat,
    linear-gradient(135deg, #f8fbff 0%, #eef3ff 54%, #ffffff 100%);
}

:root[data-theme="light"] body::before {
  opacity: 0.09;
}

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

button {
  cursor: pointer;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 72% 18%, rgba(43, 202, 255, 0.28), transparent 31%),
    radial-gradient(circle at 30% 70%, rgba(43, 202, 255, 0.2), transparent 28%),
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1.4px),
    radial-gradient(circle at 78% 62%, rgba(255, 255, 255, 0.09) 0 1px, transparent 1.4px),
    linear-gradient(rgba(5, 7, 19, 0.84), rgba(5, 7, 19, 0.97));
}

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

.age-panel {
  width: min(540px, 100%);
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.06), transparent 48%),
    rgba(10, 12, 27, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.age-panel h1,
.hero-copy h1 {
  margin: 8px 0 14px;
  line-height: 1.03;
  letter-spacing: 0;
}

.age-panel p,
.hero-copy p,
.profile-copy p,
.plans p,
.model-info p {
  color: var(--muted);
  line-height: 1.6;
}

.age-actions,
.top-actions,
.form-row,
.catalog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(43, 202, 255, 0.035), transparent 36%),
    rgba(7, 8, 20, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 4px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background:
    linear-gradient(rgba(5, 7, 19, 0.04), rgba(5, 7, 19, 0.04)),
    url("assets/logo.png?v=5") center / cover no-repeat;
  color: transparent;
  font-size: 0;
  box-shadow:
    inset 0 0 22px rgba(43, 202, 255, 0.16),
    0 0 18px rgba(43, 202, 255, 0.22),
    0 0 30px rgba(43, 202, 255, 0.2);
}

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

.brand strong {
  font-size: 15px;
}

.brand small {
  color: var(--muted-2);
  font-size: 12px;
}

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

.nav-item,
.safety-link,
.icon-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item {
  padding: 0 12px;
  font-weight: 700;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.admin-nav-item {
  color: #ffb4bd;
  border-color: rgba(255, 86, 111, 0.24);
}

.admin-nav-item.active,
.admin-nav-item:hover {
  color: #ffe9ed;
  border-color: rgba(255, 86, 111, 0.76);
  background: rgba(255, 40, 75, 0.12);
}

.safety-link {
  margin-top: auto;
  padding: 0 12px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.028);
}

.account-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.legal-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: auto;
  padding-top: 8px;
}

.legal-links button {
  width: fit-content;
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.legal-links button:hover,
.legal-links button:focus-visible {
  color: var(--violet);
  text-decoration: underline;
}

.site-version {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
}

.account-card.is-admin {
  border-color: rgba(255, 86, 111, 0.72);
  background: linear-gradient(145deg, rgba(93, 9, 22, 0.62), rgba(5, 16, 34, 0.9));
  box-shadow: inset 0 0 24px rgba(255, 60, 92, 0.12);
}

.account-card.is-moderator {
  border-color: rgba(74, 224, 139, 0.62);
  background: linear-gradient(145deg, rgba(18, 95, 53, 0.42), rgba(5, 16, 34, 0.9));
  box-shadow: inset 0 0 24px rgba(74, 224, 139, 0.1);
}

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

.account-card span {
  color: var(--text);
  font-weight: 850;
}

#accountStatusName,
#accountPanelName,
.admin-user-card span,
#adminDetailTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-badge {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid rgba(255, 86, 111, 0.86);
  border-radius: 999px;
  color: #ffb4bd;
  background: rgba(255, 40, 75, 0.13);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.admin-badge.role-moderator {
  color: #d9ffe7;
  border-color: rgba(74, 224, 139, 0.78);
  background: rgba(31, 164, 92, 0.2);
}

.account-card small {
  color: var(--muted-2);
  font-size: 12px;
}

.workspace {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.mobile-menu-btn,
.mobile-stats-btn,
.profile-close-btn,
.sidebar-backdrop {
  display: none;
}

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.top-actions {
  align-items: center;
  justify-content: flex-end;
}

.coin-top-btn,
.notification-top-btn {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.notification-top-btn {
  min-width: 42px;
  justify-content: center;
  padding: 0 11px;
}

.notification-top-btn[disabled] {
  cursor: default;
  opacity: 0.58;
}

.notification-top-btn span {
  color: #fff;
  filter: drop-shadow(0 0 9px rgba(43, 202, 255, 0.45));
}

.notification-top-btn strong {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: #ff3f65;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 0 18px rgba(255, 63, 101, 0.45);
}

.notification-top-btn strong[hidden] {
  display: none;
}

.coin-top-btn:hover,
.coin-top-btn:focus-visible,
.notification-top-btn:not([disabled]):hover,
.notification-top-btn:not([disabled]):focus-visible {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.icon-btn {
  position: relative;
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.mobile-menu-btn {
  display: none;
}

.icon-btn:hover,
.language-menu[open] .icon-btn {
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.language-menu {
  position: relative;
}

.language-menu summary {
  list-style: none;
  cursor: pointer;
}

.language-menu summary::-webkit-details-marker {
  display: none;
}

.language-trigger {
  display: inline-flex;
  gap: 6px;
  padding-inline: 10px;
  font-size: 11px;
  font-weight: 900;
}

.globe-mark {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow: inset 6px 0 0 -5px currentColor, inset -6px 0 0 -5px currentColor;
}

.globe-mark::before,
.globe-mark::after {
  content: "";
  position: absolute;
  left: 2px;
  width: 10px;
  height: 2px;
  background: currentColor;
  opacity: 0.85;
}

.globe-mark::before {
  top: 4px;
}

.globe-mark::after {
  top: 10px;
}

.language-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.language-popover button {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 0 16px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 750;
}

.language-popover button:hover,
.language-popover button.active {
  background: var(--violet-soft);
}

.theme-mark {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset -7px -3px 0 0 var(--surface-2);
}

:root[data-theme="light"] .theme-mark {
  background: #f4c542;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.18);
}

.topbar h2,
.catalog-toolbar h3,
.panel h3,
.profile-copy h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.primary-btn,
.ghost-btn,
.filter-chip,
.billing-toggle button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  color: #f9f7ff;
  background: linear-gradient(135deg, #0e4fd8 0%, #1678ff 48%, #2bcaff 100%);
  font-weight: 800;
  white-space: nowrap;
}

.primary-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 24px rgba(43, 202, 255, 0.18), 0 0 32px rgba(43, 202, 255, 0.18);
}

.danger-btn {
  border-color: rgba(255, 112, 112, 0.35);
  color: #fff7f7;
  background: linear-gradient(135deg, rgba(160, 38, 62, 0.95), rgba(255, 83, 104, 0.95));
  box-shadow: 0 0 0 1px rgba(255, 112, 112, 0.08), 0 10px 28px rgba(160, 38, 62, 0.22);
}

.danger-btn:hover {
  border-color: rgba(255, 112, 112, 0.7);
  background: linear-gradient(135deg, #b92d4f, #ff5e73);
}

.primary-btn.small,
.compact {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 13px;
}

.ghost-btn,
.filter-chip,
.billing-toggle button {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.ghost-btn:hover,
.filter-chip:hover,
.filter-chip.active,
.billing-toggle button.active {
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.18), rgba(43, 202, 255, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.ghost-btn.danger-btn,
.ghost-btn.danger-btn:hover {
  border-color: rgba(255, 112, 112, 0.52);
  color: #fff7f7;
  background: rgba(255, 83, 104, 0.17);
  box-shadow: none;
}

.ghost-btn.danger-btn:hover {
  background: rgba(255, 83, 104, 0.26);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-image {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 19%, rgba(255, 255, 255, 0.68) 0 1px, transparent 1.6px),
    radial-gradient(circle at 88% 24%, rgba(255, 255, 255, 0.52) 0 1px, transparent 1.6px),
    radial-gradient(circle at 62% 64%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 93% 70%, rgba(43, 202, 255, 0.78) 0 1px, transparent 1.8px),
    linear-gradient(90deg, rgba(5, 7, 19, 0.96) 0%, rgba(5, 7, 19, 0.82) 46%, rgba(5, 7, 19, 0.2) 100%),
    url("assets/logo.png?v=5") right 8% center / min(455px, 66%) no-repeat,
    linear-gradient(135deg, #050713 0%, #111633 55%, #061827 100%);
  filter: saturate(1.08) contrast(1.04);
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(43, 202, 255, 0.07) 100%),
    linear-gradient(115deg, transparent 56%, rgba(43, 202, 255, 0.18) 56.4%, transparent 62%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: 20px 24px;
}

.hero-copy h1 {
  max-width: 680px;
  font-size: clamp(28px, 3.2vw, 42px);
}

.hero-copy p {
  max-width: 610px;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hero-stats span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 16, 34, 0.72);
}

.hero-stats strong {
  color: var(--text);
}

.catalog-section,
.panel,
.chat-panel,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.035), transparent 48%),
    rgba(5, 16, 34, 0.82);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

:root[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .panel,
:root[data-theme="light"] .chat-panel,
:root[data-theme="light"] .profile-panel,
:root[data-theme="light"] .account-card,
:root[data-theme="light"] .chatbot-card,
:root[data-theme="light"] .public-chat-card,
:root[data-theme="light"] .character-card,
:root[data-theme="light"] .tag-editor,
:root[data-theme="light"] .premium-hero,
:root[data-theme="light"] .plans article {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .safety-dialog,
:root[data-theme="light"] .auth-dialog,
:root[data-theme="light"] .character-dialog,
:root[data-theme="light"] .chatbot-dialog,
:root[data-theme="light"] .avatar-dialog,
:root[data-theme="light"] .character-pick-dialog,
:root[data-theme="light"] .confirm-dialog,
:root[data-theme="light"] .language-popover,
:root[data-theme="light"] .filter-popover {
  background: var(--surface);
}

.chats-overview {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.chats-overview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.chat-list-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.chat-list-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.chat-list-tabs button.active {
  color: var(--text);
  background: var(--violet-soft);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

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

.chats-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.saved-chat-card {
  width: 100%;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
}

.saved-chat-card:hover,
.saved-chat-card.active {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.saved-chat-thumb {
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(2, 7, 20, 0.22) 100%),
    url("assets/hero-companions.png");
  background-size: 360%;
  background-repeat: no-repeat;
  filter: grayscale(0.12) saturate(0.82);
}

.saved-chat-main {
  min-width: 0;
}

.saved-chat-main strong,
.saved-chat-main small,
.saved-chat-main span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-chat-time {
  color: var(--muted-2);
  font-size: 12px;
}

.chat-thread-detail {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  overflow: hidden;
}

.chat-thread-empty {
  min-height: 360px;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.chat-thread-empty strong {
  color: var(--text);
  font-size: 18px;
}

.chat-thread-profile {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.chat-thread-art {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent 0%, rgba(2, 7, 20, 0.28) 100%),
    url("assets/hero-companions.png");
  background-size: cover;
  background-position: center;
}

.chat-thread-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.chat-thread-copy h3,
.chat-thread-copy p {
  margin: 0;
}

.chat-thread-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.chat-session-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.chat-session-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.chat-session-card.active {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.chat-session-open {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.chat-session-open > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-session-open small,
.chat-session-open em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-session-meta-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-message-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  vertical-align: middle;
  margin-left: 0;
  padding: 2px 7px;
  border: 1px solid rgba(43, 202, 255, 0.42);
  border-radius: 999px;
  color: var(--violet);
  background: rgba(43, 202, 255, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.saved-chat-main strong {
  font-size: 16px;
}

.saved-chat-main small {
  color: var(--muted-2);
  margin-top: 2px;
  font-size: 12px;
}

.saved-chat-main span {
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
}

.saved-chat-time {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--violet);
  background: var(--violet-quiet);
  font-size: 12px;
  white-space: nowrap;
}

.catalog-section {
  margin-top: 16px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.catalog-section.select-open,
.catalog-section:has(.filter-menu[open]),
.catalog-section:has(.custom-select.open) {
  z-index: 120;
}

.public-chats-section {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.catalog-toolbar,
.panel-heading,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

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

.catalog-actions {
  position: relative;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
}

.catalog-actions input[type="search"] {
  width: clamp(160px, 18vw, 220px);
  flex: 0 1 220px;
}

.catalog-actions .select-control {
  flex: 0 0 162px;
}

.catalog-actions .filter-menu {
  width: 100px;
  flex: 0 0 100px;
}

.catalog-actions input,
.composer input,
.composer textarea,
.creator-form input,
.creator-form textarea,
.creator-form select,
.select-control select,
.tag-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
}

:root[data-theme="light"] .catalog-actions input,
:root[data-theme="light"] .composer input,
:root[data-theme="light"] .composer textarea,
:root[data-theme="light"] .creator-form input,
:root[data-theme="light"] .creator-form textarea,
:root[data-theme="light"] .creator-form select,
:root[data-theme="light"] .select-control select,
:root[data-theme="light"] .tag-editor input,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .ghost-btn,
:root[data-theme="light"] .filter-chip,
:root[data-theme="light"] .billing-toggle button {
  background: rgba(255, 255, 255, 0.7);
}

.creator-form select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    #071122;
}

:root[data-theme="light"] .creator-form select {
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    #ffffff;
}

.creator-form select option,
.select-control select option {
  color: var(--text);
  background: #071122;
}

:root[data-theme="light"] .creator-form select option,
:root[data-theme="light"] .select-control select option {
  background: #ffffff;
}

.catalog-actions > input {
  width: min(240px, 100%);
  min-height: 38px;
  padding: 0 11px;
}

.nsfw-switch {
  min-height: 42px;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.nsfw-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nsfw-switch i {
  position: relative;
  width: 50px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: 0.18s ease;
}

.nsfw-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #8d8b98;
  transition: 0.18s ease;
}

.nsfw-switch input:checked + i {
  border-color: var(--line-strong);
  background: rgba(43, 202, 255, 0.2);
}

.nsfw-switch input:checked + i::after {
  left: 27px;
  background: var(--violet);
}

.select-control {
  position: relative;
  display: block;
  min-width: 0;
}

.select-control.has-custom-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.select-control select {
  min-width: 0;
  min-height: 36px;
  padding: 0 34px 0 12px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  position: relative;
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.custom-select-trigger::before,
.custom-select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  pointer-events: none;
}

.custom-select-trigger::before {
  right: 17px;
  transform: translateY(-30%) rotate(45deg);
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--focus);
  outline: none;
}

.custom-select-menu {
  position: absolute;
  z-index: 240;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 172px);
  max-height: 210px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(4, 13, 30, 0.98);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  display: none;
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 2px;
}

.custom-select-menu button {
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: rgba(43, 202, 255, 0.16);
  color: #ffffff;
}

.report-dialog .avatar-prompt-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.report-dialog textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
}

.toggle-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.toggle-card input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--violet);
}

.toggle-card strong,
.toggle-card small {
  display: block;
}

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

.toggle-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.toggle-card:has(input:checked) {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(43, 202, 255, 0.18), rgba(43, 202, 255, 0.055));
}

.required-mark {
  color: var(--danger);
  font-weight: 950;
}

.field-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.optional-mark {
  display: none;
}

.stat-enabled-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}

.stat-enabled-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--violet);
}

.public-fields-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.public-fields-card strong,
.public-fields-card small {
  display: block;
}

.public-fields-card small {
  color: var(--muted);
  font-size: 12px;
}

.public-field-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-field-options label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(43, 202, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.public-field-options input {
  width: 15px;
  height: 15px;
  accent-color: var(--violet);
}

.compact-toggle {
  min-height: 42px;
  grid-template-columns: auto auto;
  padding: 8px 10px;
}

.compact-toggle input {
  width: 18px;
  height: 18px;
}

.compact-toggle strong {
  font-size: 12px;
}

.compact-toggle small {
  font-size: 11px;
}

.catalog-nsfw-toggle {
  white-space: nowrap;
}

.catalog-actions input:focus,
.composer input:focus,
.composer textarea:focus,
.creator-form input:focus,
.creator-form textarea:focus,
.creator-form select:focus,
.select-control select:focus,
.tag-editor input:focus {
  border-color: var(--line-strong);
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary span {
  min-width: 18px;
  min-height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #03101f;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  font-size: 10px;
  box-shadow: 0 0 14px rgba(43, 202, 255, 0.26);
}

.filter-menu[open] summary {
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.filter-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  width: min(280px, calc(100vw - 48px));
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.06), rgba(76, 125, 255, 0.04)),
    rgba(3, 9, 22, 0.98);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.46);
}

.filter-popover fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
}

.filter-tag-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.filter-popover legend {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.filter-popover label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.filter-popover label:has(input:checked) {
  color: var(--text);
  background: rgba(43, 202, 255, 0.08);
}

.filter-popover input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-height: 0;
  flex: 0 0 13px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(43, 202, 255, 0.58);
  border-radius: 3px;
  appearance: none;
  background: rgba(7, 17, 34, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.filter-popover input[type="checkbox"]:checked {
  border-color: var(--cyan);
  background:
    linear-gradient(135deg, var(--cyan), var(--magenta));
  box-shadow:
    inset 0 0 0 2px rgba(3, 9, 22, 0.8),
    0 0 14px rgba(43, 202, 255, 0.3);
}

.filter-popover input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 3px;
  margin: 3px auto 0;
  border-left: 2px solid #03101f;
  border-bottom: 2px solid #03101f;
  transform: rotate(-45deg);
}

.filter-popover button {
  grid-column: 1 / -1;
  justify-self: start;
}

.chatbot-grid,
.public-chat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.own-chatbot-list {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.chatbot-card,
.public-chat-card {
  min-height: 380px;
  display: grid;
  grid-template-rows: 190px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.034);
  cursor: pointer;
}

.chatbot-card.has-card-gradient,
.public-chat-card.has-card-gradient {
  border-color: var(--card-gradient-border, var(--line-strong));
  background:
    radial-gradient(circle at 12% 10%, var(--card-gradient-strong, var(--card-gradient, rgba(43, 202, 255, 0.18))), transparent 38%),
    linear-gradient(135deg, var(--card-gradient, rgba(43, 202, 255, 0.14)), transparent 70%),
    rgba(255, 255, 255, 0.034);
  box-shadow: inset 0 0 0 1px var(--card-gradient-shadow, rgba(43, 202, 255, 0.08));
}

.gradient-violet {
  --card-gradient: rgba(43, 202, 255, 0.34);
  --card-gradient-strong: rgba(43, 202, 255, 0.5);
  --card-gradient-border: rgba(43, 202, 255, 0.66);
  --card-gradient-shadow: rgba(43, 202, 255, 0.17);
}

.gradient-rose {
  --card-gradient: rgba(255, 70, 151, 0.34);
  --card-gradient-strong: rgba(255, 70, 151, 0.46);
  --card-gradient-border: rgba(255, 98, 166, 0.6);
  --card-gradient-shadow: rgba(255, 98, 166, 0.15);
}

.gradient-blue {
  --card-gradient: rgba(43, 202, 255, 0.34);
  --card-gradient-strong: rgba(43, 202, 255, 0.46);
  --card-gradient-border: rgba(43, 202, 255, 0.6);
  --card-gradient-shadow: rgba(43, 202, 255, 0.15);
}

.gradient-gold {
  --card-gradient: rgba(255, 196, 87, 0.34);
  --card-gradient-strong: rgba(255, 196, 87, 0.48);
  --card-gradient-border: rgba(255, 207, 108, 0.62);
  --card-gradient-shadow: rgba(255, 207, 108, 0.14);
}

.gradient-green {
  --card-gradient: rgba(76, 211, 158, 0.32);
  --card-gradient-strong: rgba(76, 211, 158, 0.44);
  --card-gradient-border: rgba(76, 211, 158, 0.58);
  --card-gradient-shadow: rgba(76, 211, 158, 0.14);
}

.chatbot-card:hover,
.public-chat-card:hover {
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.09), rgba(43, 202, 255, 0.045)),
    rgba(255, 255, 255, 0.034);
}

.chatbot-card.has-card-gradient:hover,
.public-chat-card.has-card-gradient:hover {
  border-color: var(--card-gradient-border, var(--line-strong));
  background:
    radial-gradient(circle at 12% 10%, var(--card-gradient-strong, var(--card-gradient, rgba(43, 202, 255, 0.2))), transparent 40%),
    linear-gradient(135deg, var(--card-gradient, rgba(43, 202, 255, 0.16)), rgba(255, 255, 255, 0.035) 72%),
    rgba(255, 255, 255, 0.034);
}

.chatbot-art,
.mini-avatar,
.profile-art,
.avatar-preview,
.character-avatar,
.message-avatar {
  background-image:
    linear-gradient(180deg, rgba(43, 202, 255, 0.16) 0%, rgba(5, 7, 19, 0.36) 100%),
    url("assets/logo.png?v=5");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.04);
}

.chatbot-art {
  border-bottom: 1px solid var(--line);
}

.public-chat-art {
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(180deg, rgba(43, 202, 255, 0.16) 0%, rgba(5, 7, 19, 0.36) 100%),
    url("assets/logo.png?v=5");
  background-size: cover;
  background-position: center;
  filter: saturate(1.04);
}

.chatbot-body,
.public-chat-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.chatbot-kicker,
.public-chat-kicker,
.model-info .eyebrow {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chatbot-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.public-chat-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.chatbot-detail-panel {
  display: grid;
  gap: 16px;
}

.chatbot-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.chatbot-detail-art {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(43, 202, 255, 0.16), rgba(5, 7, 19, 0.36)),
    url("assets/logo.png?v=5") center / cover no-repeat;
  background-size: cover;
  background-position: center;
}

.chatbot-detail-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.chatbot-detail-copy > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.chatbot-detail-sections {
  display: grid;
  gap: 10px;
}

.chatbot-detail-sections article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.chatbot-detail-sections span {
  color: var(--violet);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chatbot-detail-sections p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

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

.detail-stat-list small {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(43, 202, 255, 0.06);
}

.detail-stat-list b {
  color: var(--text);
}

.chatbot-detail-actions {
  justify-content: start;
}

.public-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

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

.saved-chat-card.is-public {
  border-color: rgba(43, 202, 255, 0.52);
}

.saved-chat-card,
.chat-session-open,
.chatbot-title-row {
  position: relative;
}

.chatbot-title-row h4 {
  margin: 0;
  font-size: 18px;
}

.public-chat-title-row h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
}

.chatbot-subtitle {
  display: block;
  margin-top: -4px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
}

.public-badge,
.status-pill {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--violet);
  background: var(--violet-quiet);
  font-size: 11px;
  font-weight: 800;
}

.chat-update-badge {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 170, 75, 0.82);
  border-radius: 999px;
  padding: 0 7px;
  color: #ffd29b;
  background: rgba(255, 132, 31, 0.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(255, 132, 31, 0.16);
}

.chatbot-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
}

.metric-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.metric-icon {
  color: var(--violet);
  font-size: 13px;
  line-height: 1;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.chatbot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

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

.chatbot-like-btn {
  min-height: 34px;
  padding: 0 10px;
}

.chatbot-footer small {
  color: var(--muted-2);
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 340px;
  gap: 16px;
}

.chat-panel {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(360px, 1fr) auto;
}

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

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

.mini-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-strip {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(43, 202, 255, 0.035);
}

.locked-character {
  display: grid;
  gap: 6px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.locked-character span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.locked-character strong {
  color: var(--text);
  font-size: 14px;
}

.player-strip p {
  margin: 0;
  align-self: center;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.chat-tags-strip {
  display: grid;
  gap: 9px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-tags-strip > span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-options-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.reply-length-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.reply-length-control span {
  padding: 0 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.reply-length-control button {
  min-width: 68px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.reply-length-control button.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.reply-length-control.locked {
  border-color: rgba(127, 148, 173, 0.16);
  background: rgba(255, 255, 255, 0.018);
}

.reply-length-control.locked span,
.reply-length-control.locked button,
.reply-length-control.locked button.active {
  color: var(--muted-2);
}

.reply-length-control.locked button.active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.035);
}

.reply-length-control button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

#replyLengthHint,
#nsfwLevelHint {
  display: none;
  flex: 1 1 220px;
  color: var(--muted-2);
}

.roleplay-stats {
  display: grid;
  grid-template-columns: 150px repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.profile-panel .roleplay-stats {
  grid-template-columns: 1fr;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.relationship-mood {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--violet-quiet);
}

.relationship-mood span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.relationship-mood strong {
  color: var(--violet);
  font-size: 16px;
}

.roleplay-stat-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.045);
}

.roleplay-stat-card > strong {
  color: var(--text);
  font-size: 14px;
}

.roleplay-stat-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 32px auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.stat-edit-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--violet);
  background: rgba(43, 202, 255, 0.08);
  font-weight: 900;
  cursor: pointer;
}

.stat-edit-btn:hover {
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.roleplay-stat-row em {
  font-style: normal;
}

.roleplay-stat-row i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.roleplay-stat-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(43, 202, 255, 0.45), var(--violet));
}

.roleplay-stat-row i.negative b {
  background: linear-gradient(90deg, #ff7070, rgba(255, 112, 112, 0.48));
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: auto;
}

.load-more-messages {
  justify-self: center;
  margin: 10px 18px 0;
}

.message {
  width: min(78%, 580px);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
}

.message-content {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.message-name {
  color: var(--violet);
  font-size: 12px;
  font-weight: 850;
}

.message.user .message-name {
  color: var(--muted-2);
  text-align: right;
}

.message-bubble {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.046);
  line-height: 1.5;
}

.message-thought {
  display: inline;
  color: #8ee7ff;
  font-style: italic;
  font-weight: 750;
}

.message-thought::before {
  content: " ";
}

.message-thought::after {
  content: " ";
}

.message-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.message:hover .message-tools,
.message:focus-within .message-tools {
  opacity: 1;
}

.message-tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1;
}

.message-tool:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.message-tool.danger-tool:hover {
  color: #ffd6d6;
  border-color: rgba(255, 112, 112, 0.5);
  background: rgba(255, 112, 112, 0.1);
}

.message-alt-badge {
  min-width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 850;
}

.message.user .message-tools {
  justify-content: flex-end;
}

.ad-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #121218;
  box-shadow: var(--shadow);
  padding: 22px;
}

.ad-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.ad-dialog h3 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.ad-box {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(43, 202, 255, 0.16), rgba(255, 255, 255, 0.035));
}

.ad-box span {
  color: var(--muted);
  line-height: 1.45;
}

.photo-video-panel {
  max-width: 980px;
}

.photo-video-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.photo-video-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr);
  gap: 16px;
}

.upload-zone,
.photo-video-preview {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.upload-zone {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  cursor: pointer;
}

.upload-zone input {
  width: 100%;
  color: var(--muted);
}

.upload-zone span,
.upload-zone small {
  color: var(--muted-2);
}

.upload-zone strong {
  color: var(--text);
}

.photo-video-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted-2);
  background-size: cover;
  background-position: center;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-video-result {
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050506;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.user .message-bubble {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(43, 202, 255, 0.28), rgba(43, 202, 255, 0.14));
}

.message.system {
  width: 100%;
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(43, 202, 255, 0.07);
}

.message.thinking .message-bubble {
  border-color: rgba(43, 202, 255, 0.46);
  color: #d7f7ff;
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.16), rgba(22, 120, 255, 0.07)),
    rgba(4, 15, 32, 0.78);
}

.message.thinking .message-bubble::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 6px;
  margin-left: 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--cyan) 45%, transparent 48%) 0 50% / 6px 6px,
    radial-gradient(circle, var(--cyan) 45%, transparent 48%) 8px 50% / 6px 6px,
    radial-gradient(circle, var(--cyan) 45%, transparent 48%) 16px 50% / 6px 6px;
  background-repeat: no-repeat;
  opacity: 0.8;
}

.image-message .message-bubble {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.image-message img {
  width: min(420px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.image-message small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-size: 360%;
}

.chatbot-grid > .message.system,
.character-list > .message.system {
  grid-column: 1 / -1;
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(2, 7, 20, 0.96);
  backdrop-filter: blur(14px);
}

.composer input,
.composer textarea {
  min-height: 46px;
  padding: 12px 14px;
}

.composer textarea {
  max-height: 156px;
  min-width: 0;
  overflow-y: auto;
  resize: none;
  line-height: 1.42;
  white-space: pre-wrap;
}

.composer-action {
  min-width: 46px;
  min-height: 46px;
  font-size: 18px;
}

.profile-panel {
  overflow: hidden;
  align-self: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.profile-panel .profile-art,
.profile-panel .profile-copy,
.profile-panel .starter-box,
.profile-panel .stats-grid {
  display: none;
}

.profile-art {
  min-height: 270px;
  border-bottom: 1px solid var(--line);
  background-size: 255%;
}

.profile-copy {
  padding: 16px;
}

.starter-box {
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.055);
}

.starter-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.starter-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

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

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

.stats-grid div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.stats-grid span {
  display: block;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.stats-grid small {
  color: var(--muted);
}

.account-panel .stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}

.mini-stat-btn {
  width: fit-content;
  min-height: 28px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--text);
  background: rgba(43, 202, 255, 0.08);
  font-size: 12px;
  font-weight: 850;
}

.mini-stat-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.mini-stat-btn:disabled {
  cursor: default;
  opacity: 0.58;
}

.profile-panel > .like-btn {
  width: calc(100% - 28px);
  min-height: 42px;
  margin: 0 14px 14px;
}

.chat-header-actions .like-btn,
.profile-chat-actions .like-btn {
  width: auto;
  min-height: 36px;
  margin: 0;
}

.chat-message-metric {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 850;
}

.profile-reply-length {
  display: grid;
  gap: 5px;
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.055);
}

.profile-reply-length-control {
  width: 100%;
  justify-content: space-between;
}

.profile-reply-length-control button {
  flex: 1;
  min-width: 0;
}

.profile-reply-length span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-reply-length strong {
  color: var(--violet);
  font-size: 18px;
}

.profile-reply-length small {
  color: var(--muted);
  line-height: 1.35;
}

.like-btn[aria-pressed="true"],
.chatbot-like-btn[aria-pressed="true"] {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--violet-soft);
}

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

.admin-user-panel,
.admin-detail-panel {
  min-height: 420px;
  overflow: hidden;
}

.admin-global-logs-panel {
  margin-top: 16px;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-search input,
.admin-plan-select,
.admin-field-select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(4, 15, 32, 0.78);
}

.admin-search input {
  padding: 0 12px;
}

.admin-plan-select,
.admin-field-select {
  appearance: none;
  padding: 0 34px 0 12px;
  font-weight: 850;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 12px center / 7px 7px no-repeat,
    rgba(4, 15, 32, 0.78);
}

.admin-plan-select:focus,
.admin-field-select:focus,
.admin-search input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(43, 202, 255, 0.14);
}

.admin-plan-select option,
.admin-field-select option {
  color: var(--text);
  background: #041020;
}

.admin-user-list,
.admin-content {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 202, 255, 0.45) rgba(255, 255, 255, 0.08);
}

.admin-user-list {
  max-height: min(600px, calc(100vh - 300px));
}

.admin-content {
  max-height: min(650px, calc(100vh - 275px));
}

.admin-global-logs-panel .admin-content {
  max-height: min(720px, 68vh);
}

.admin-user-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
}

.admin-user-card.active,
.admin-user-card:hover {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.admin-user-card.is-admin {
  border-color: rgba(255, 86, 111, 0.58);
  background: rgba(255, 40, 75, 0.09);
}

.admin-user-card.is-moderator {
  border-color: rgba(74, 224, 139, 0.55);
  background: rgba(31, 164, 92, 0.1);
}

.admin-user-card.plan-creator {
  border-color: rgba(154, 119, 255, 0.58);
  background: rgba(112, 76, 255, 0.12);
}

.admin-user-card.plan-velvet {
  border-color: rgba(93, 126, 255, 0.52);
  background: rgba(93, 126, 255, 0.1);
}

.admin-user-card.plan-starter {
  border-color: rgba(43, 202, 255, 0.42);
  background: rgba(43, 202, 255, 0.08);
}

.admin-user-card.plan-free {
  border-color: rgba(96, 191, 255, 0.18);
  background: rgba(7, 17, 34, 0.72);
}

.admin-user-card small,
.admin-user-card i,
.admin-asset-card small,
.admin-asset-card em,
.admin-chat-card small,
.admin-log-row small,
.admin-log-row em {
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
}

.admin-user-card span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.role-badge,
.plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.role-admin,
.plan-admin {
  color: #ffd7e5;
  border-color: rgba(255, 86, 111, 0.86);
  background: rgba(255, 40, 75, 0.22);
}

.role-moderator {
  color: #d9ffe7;
  border-color: rgba(74, 224, 139, 0.78);
  background: rgba(31, 164, 92, 0.2);
}

.plan-creator {
  color: #ebe2ff;
  border-color: rgba(154, 119, 255, 0.78);
  background: rgba(112, 76, 255, 0.2);
}

.plan-velvet {
  color: #dce4ff;
  border-color: rgba(93, 126, 255, 0.72);
  background: rgba(93, 126, 255, 0.18);
}

.plan-starter {
  color: #d8f7ff;
  border-color: rgba(43, 202, 255, 0.62);
  background: rgba(43, 202, 255, 0.15);
}

.plan-free {
  color: var(--muted);
  border-color: rgba(96, 191, 255, 0.2);
  background: rgba(255, 255, 255, 0.045);
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-summary-grid div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.admin-summary-grid span {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.admin-summary-grid small {
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.032);
  font-weight: 800;
}

.admin-tabs button.active,
.admin-tabs button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.admin-asset-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.admin-asset-art {
  width: 74px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.admin-asset-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-asset-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-chat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.admin-chat-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.admin-chat-card summary span,
.admin-log-row,
.admin-message-list,
.admin-warning-list {
  display: grid;
  gap: 6px;
}

.admin-chat-card summary em {
  color: var(--violet);
  font-style: normal;
  font-weight: 850;
}

.admin-message-list {
  padding: 0 12px 12px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.admin-message-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-message-row.user {
  border-color: rgba(43, 202, 255, 0.55);
  background: rgba(43, 202, 255, 0.09);
}

.admin-message-row strong {
  color: var(--violet);
  font-size: 12px;
}

.admin-message-row span {
  color: var(--text);
  line-height: 1.45;
}

.admin-log-row,
.admin-warning-list {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.admin-report-row {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(43, 202, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.08), transparent 55%),
    rgba(4, 15, 32, 0.78);
}

.admin-report-row.resolved {
  border-color: rgba(73, 220, 160, 0.38);
  background:
    linear-gradient(135deg, rgba(73, 220, 160, 0.08), transparent 55%),
    rgba(4, 15, 32, 0.74);
}

.admin-report-row header,
.admin-report-row footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-report-row strong {
  color: var(--text);
}

.admin-report-row p,
.admin-report-row small,
.admin-report-row em {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-report-row em {
  padding: 8px 10px;
  border: 1px solid rgba(43, 202, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-style: normal;
}

.admin-pending-reports-panel {
  margin-top: 16px;
}

.admin-pending-reports-panel .admin-content {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 202, 255, 0.45) rgba(255, 255, 255, 0.08);
}

.notification-list,
.cookie-toggle-list {
  display: grid;
  gap: 10px;
  max-height: min(54vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 202, 255, 0.45) rgba(255, 255, 255, 0.08);
}

.notification-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.notification-item.unread {
  border-color: rgba(255, 63, 101, 0.55);
  box-shadow: inset 3px 0 0 #ff3f65;
}

.notification-item strong {
  color: var(--text);
}

.notification-item span,
.notification-item small {
  color: var(--muted);
  line-height: 1.45;
}

.cookie-banner {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.12), transparent 55%),
    rgba(3, 12, 26, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.cookie-banner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.toggle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

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

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  color: var(--muted);
  line-height: 1.4;
}

.toggle-row.disabled {
  opacity: 0.78;
}

.admin-warning-list {
  border-color: rgba(43, 202, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.11), rgba(35, 112, 255, 0.05)),
    rgba(4, 15, 32, 0.74);
}

.admin-warning-list summary {
  cursor: pointer;
  list-style-position: inside;
}

.admin-warning-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-ban-history {
  border-color: rgba(91, 159, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(91, 159, 255, 0.12), rgba(43, 202, 255, 0.04)),
    rgba(4, 15, 32, 0.74);
}

.creator-panel,
.billing-panel,
.character-layout {
  max-width: 1040px;
}

.character-layout {
  display: grid;
  grid-template-columns: minmax(320px, 760px);
  gap: 16px;
}

.form-row.single {
  grid-template-columns: 1fr;
}

.auth-layout {
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.auth-layout.is-connected {
  max-width: 760px;
  grid-template-columns: 1fr;
}

.auth-layout.is-connected .auth-panel {
  display: none;
}

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

.auth-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
}

.auth-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.auth-tabs button.active,
.auth-tabs button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--violet-soft);
}

.auth-form.is-hidden {
  display: none;
}

.oauth-actions {
  padding: 14px 18px 0;
}

.oauth-actions.compact {
  padding: 12px 0 0;
}

.oauth-btn {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    #071122;
  font-weight: 850;
}

.oauth-btn:hover,
.oauth-btn:focus-visible {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(43, 202, 255, 0.14), rgba(255, 255, 255, 0.035)),
    #071122;
}

.oauth-btn:disabled {
  cursor: wait;
  opacity: 0.68;
}

.google-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 900;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 18px 0;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider.compact {
  margin-inline: 0;
}

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

.form-status {
  margin: 12px 18px 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.45;
  font-size: 13px;
}

.form-status[hidden] {
  display: none;
}

.form-status[data-tone="success"] {
  border-color: rgba(43, 202, 255, 0.42);
  color: var(--text);
  background: rgba(43, 202, 255, 0.1);
}

.form-status[data-tone="error"] {
  border-color: rgba(255, 112, 112, 0.44);
  color: #ffd2d2;
  background: rgba(255, 112, 112, 0.09);
}

.account-details {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.account-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.account-username-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.account-username-form[hidden] {
  display: none;
}

.account-username-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.account-username-form input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(5, 16, 34, 0.86);
  outline: none;
}

.account-username-form input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(43, 202, 255, 0.12);
}

.account-member-since {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.055);
  font-size: 13px;
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  padding: 16px;
}

.character-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.034);
  text-align: left;
  cursor: pointer;
}

.character-card.chatbot-card {
  grid-template-rows: 210px minmax(0, 1fr);
  min-height: 390px;
  padding: 0;
}

.character-card .chatbot-body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.character-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.character-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-size: 360%;
}

.character-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.character-actions button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.character-card.active,
.character-card:hover {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.character-card strong {
  font-size: 16px;
}

.character-card small,
.character-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.creator-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.creator-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.file-field {
  align-items: start;
}

.file-control {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.file-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.avatar-preview {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-size: 360%;
}

.file-control input[type="file"] {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.file-control input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--violet-quiet);
  font-weight: 800;
  cursor: pointer;
}

.file-control input[type="file"]::file-selector-button:hover {
  background: var(--violet-soft);
}

.avatar-generator-btn {
  justify-self: start;
}

.avatar-style-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.avatar-style-toggle button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 850;
}

.avatar-style-toggle button.active,
.avatar-style-toggle button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--violet-soft);
}

.avatar-prompt-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.avatar-prompt-field input,
.avatar-prompt-field select,
.avatar-prompt-field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
}

.avatar-prompt-field input,
.avatar-prompt-field select {
  min-height: 44px;
}

.avatar-prompt-field textarea {
  min-height: 128px;
  resize: vertical;
}

.avatar-prompt-field input:focus,
.avatar-prompt-field select:focus,
.avatar-prompt-field textarea:focus {
  border-color: var(--line-strong);
}

.avatar-result {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--violet-quiet);
}

.avatar-result[hidden] {
  display: none;
}

.avatar-result-preview {
  width: 104px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.22), rgba(255, 255, 255, 0.035)),
    var(--surface-2);
  background-position: center;
  background-size: cover;
}

.avatar-result-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.avatar-result-copy strong {
  font-size: 15px;
}

.avatar-result-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.creator-form input,
.creator-form textarea,
.creator-form select {
  padding: 12px;
}

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

.check-line {
  display: flex !important;
  grid-template-columns: unset !important;
  align-items: center;
  gap: 10px !important;
}

.check-line input {
  width: auto;
  accent-color: var(--violet);
}

.tag-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.07), transparent 44%),
    rgba(255, 255, 255, 0.024);
}

.tag-editor > span {
  color: var(--violet);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-options,
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 750;
}

.tag-option.active {
  color: var(--text);
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.28), rgba(43, 202, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(43, 202, 255, 0.12);
}

.selected-tags span {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--violet);
  background: var(--violet-quiet);
  font-size: 12px;
}

.tag-editor input {
  min-height: 40px;
  padding: 0 12px;
}

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

.publish-options .public-fields-card {
  grid-column: 1 / -1;
}

.publish-toggle {
  border-color: rgba(43, 202, 255, 0.24);
}

.nsfw-toggle {
  border-color: rgba(255, 132, 31, 0.25);
}

.nsfw-toggle:has(input:checked) {
  border-color: rgba(255, 132, 31, 0.62);
  background: linear-gradient(135deg, rgba(255, 132, 31, 0.17), rgba(43, 202, 255, 0.06));
}

.creator-roleplay-setup {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
}

.creator-roleplay-setup p {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
}

.creator-stat-heading {
  color: var(--violet);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.creator-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 8px;
}

.creator-stat-grid label {
  gap: 6px;
}

.creator-stat-grid input {
  min-height: 40px;
  padding: 0 10px;
}

.stat-stepper {
  display: block;
}

.stat-stepper-btn {
  display: none;
}

.premium-hero {
  max-width: 1040px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(43, 202, 255, 0.13), transparent 48%),
    rgba(5, 16, 34, 0.78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.premium-hero h3 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.premium-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.billing-toggle {
  display: flex;
  gap: 8px;
}

.billing-toggle button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.plans {
  max-width: 1040px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plans article {
  min-height: 410px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.034);
}

.plans article.featured {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(43, 202, 255, 0.18), rgba(43, 202, 255, 0.055)),
    rgba(255, 255, 255, 0.034);
}

.plans article.elite {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.14), transparent 50%),
    rgba(255, 255, 255, 0.045);
}

.plans h4 {
  margin: 0;
  font-size: 22px;
}

.plans strong {
  color: var(--text);
  font-size: 34px;
}

.plan-kicker {
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plans ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.plans li {
  position: relative;
  padding-left: 21px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.plans li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--violet);
  box-shadow: 0 0 14px rgba(43, 202, 255, 0.45);
}

.coin-shop {
  max-width: none;
  margin: 16px 0;
}

.coin-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.coin-shop-grid article {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.055);
}

.coin-shop-grid strong {
  color: var(--text);
  font-size: 16px;
}

.coin-shop-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ghost-btn.is-locked,
.primary-btn.is-locked {
  border-color: rgba(127, 148, 173, 0.22);
  color: var(--muted-2);
  background: rgba(127, 148, 173, 0.08);
  box-shadow: none;
}

.ghost-btn.is-locked:hover,
.primary-btn.is-locked:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(43, 202, 255, 0.11);
}

.coin-spend-balance {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(43, 202, 255, 0.08);
}

.coin-spend-balance span {
  color: var(--muted);
}

.payment-method-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.payment-method-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(43, 202, 255, 0.07);
  font-size: 12px;
  font-weight: 850;
}

.ai-settings {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.ai-settings summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.ai-settings[open] summary {
  margin-bottom: 12px;
}

.gradient-picker {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.gradient-picker.has-card-gradient {
  border-color: var(--card-gradient-border, var(--line-strong));
  background:
    radial-gradient(circle at 10% 0%, var(--card-gradient-strong, rgba(43, 202, 255, 0.2)), transparent 45%),
    linear-gradient(135deg, var(--card-gradient, rgba(43, 202, 255, 0.12)), transparent 75%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--card-gradient-shadow, rgba(43, 202, 255, 0.1));
}

.gradient-picker > span {
  color: var(--muted);
  font-size: 13px;
}

.gradient-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.gradient-options button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 800;
  cursor: pointer;
}

.gradient-options button.active {
  border-color: var(--card-gradient-border, var(--line-strong));
  background:
    linear-gradient(135deg, var(--card-gradient, rgba(43, 202, 255, 0.2)), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--card-gradient-shadow, rgba(43, 202, 255, 0.12));
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.admin-check input {
  position: relative;
  width: 14px;
  height: 14px;
  min-height: 0;
  flex: 0 0 14px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(4, 15, 32, 0.72);
  cursor: pointer;
}

.admin-check input:checked {
  border-color: var(--cyan);
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
}

.admin-check input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #021022;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.admin-check input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.safety-dialog,
.auth-dialog,
.character-dialog,
.chatbot-dialog,
.avatar-dialog,
.message-edit-dialog,
.character-pick-dialog,
.confirm-dialog {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(43, 202, 255, 0.06), transparent 48%),
    rgba(5, 16, 34, 0.96);
  box-shadow: var(--shadow);
}

.auth-dialog,
.character-dialog,
.chatbot-dialog,
.avatar-dialog,
.message-edit-dialog,
.character-pick-dialog,
.confirm-dialog {
  padding: 22px;
}

.confirm-dialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.chatbot-dialog {
  width: min(860px, calc(100vw - 32px));
}

.avatar-dialog {
  width: min(620px, calc(100vw - 32px));
}

.safety-dialog::backdrop,
.auth-dialog::backdrop,
.character-dialog::backdrop,
.chatbot-dialog::backdrop,
.avatar-dialog::backdrop,
.message-edit-dialog::backdrop,
.character-pick-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.safety-dialog li {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-dialog h3,
.character-dialog h3,
.chatbot-dialog h3,
.avatar-dialog h3,
.message-edit-dialog h3,
.character-pick-dialog h3,
.confirm-dialog h3 {
  margin: 4px 40px 8px 0;
  font-size: 28px;
}

.dialog-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.auth-dialog .auth-tabs {
  padding: 0;
  margin-bottom: 4px;
}

.auth-dialog .form-status {
  margin: 12px 0 0;
}

.character-dialog .form-status,
.chatbot-dialog .form-status,
.avatar-dialog .form-status,
.sanction-dialog .form-status {
  margin: 12px 0 0;
}

.sanction-dialog .avatar-prompt-field {
  margin-top: 12px;
}

.sanction-dialog .muted-copy {
  margin: 10px 0 0;
}

.auth-dialog .creator-form {
  padding: 12px 0 0;
}

.character-dialog .creator-form,
.chatbot-dialog .creator-form {
  padding: 14px 0 0;
}

.character-pick-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.character-pick-card {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.036);
  text-align: left;
}

.character-pick-card:hover {
  border-color: var(--line-strong);
  background: var(--violet-quiet);
}

.character-pick-card strong {
  display: block;
  font-size: 15px;
}

.character-pick-copy {
  display: grid;
  gap: 4px;
}

.character-pick-card small,
.character-pick-card .character-pick-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 1280px) {
  .chatbot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    z-index: 20;
    height: auto;
    max-height: none;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    min-height: 44px;
  }

  .main-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 122px;
    text-align: center;
  }

  .safety-link {
    margin-top: 0;
  }

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

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

  .chatbot-detail-layout {
    grid-template-columns: 1fr;
  }

  .chatbot-detail-art {
    min-height: 420px;
  }

  .character-layout,
  .auth-layout,
  .admin-layout,
  .chats-workspace,
  .photo-video-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-panel {
    order: -1;
  }

  .chat-panel {
    min-height: calc(100vh - 220px);
  }

  .messages {
    max-height: 64vh;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 14px;
  }

  body {
    overflow-x: hidden;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .primary-btn,
  .ghost-btn,
  .filter-chip,
  .billing-toggle button,
  .nav-item,
  .safety-link {
    font-size: 13px;
  }

  .workspace {
    padding: 10px;
  }

  .main-nav {
    display: flex;
  }

  .nav-item {
    min-width: 96px;
    text-align: center;
  }

  .sidebar {
    padding: 10px;
    gap: 10px;
  }

  .brand {
    min-height: 40px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 11px;
  }

  .account-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px;
  }

  .account-card small {
    grid-column: 1 / -1;
  }

  .topbar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .topbar,
  .catalog-toolbar,
  .panel-heading,
  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy {
    padding: 18px;
  }

  .hero-copy h1 {
    font-size: clamp(26px, 9vw, 34px);
  }

  .topbar h2,
  .catalog-toolbar h3,
  .panel h3,
  .profile-copy h3 {
    font-size: 20px;
    line-height: 1.18;
  }

  .catalog-toolbar,
  .panel-heading,
  .chat-header {
    gap: 10px;
    padding: 12px;
  }

  .catalog-actions,
  .catalog-actions input,
  .top-actions {
    width: 100%;
  }

  .catalog-actions input[type="search"],
  .catalog-actions .select-control,
  .catalog-actions .filter-menu {
    width: 100%;
    flex: 1 1 100%;
  }

  .top-actions {
    justify-content: flex-start;
    gap: 8px;
  }

  .top-actions .primary-btn.small {
    width: 100%;
  }

  .cookie-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

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

  .filter-menu,
  .filter-menu summary,
  .catalog-nsfw-toggle {
    width: 100%;
  }

  .filter-popover {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .profile-chat-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #infoDeleteChatBtn {
    order: 1;
  }

  #infoLikeChatbotBtn {
    order: 2;
  }

  #infoPublishChatBtn {
    order: 3;
  }

  #infoFollowChatBtn {
    order: 4;
  }

  .player-strip,
  .publish-options,
  .premium-hero {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .chatbot-grid,
  .public-chat-grid,
  .plans,
  .coin-shop-grid,
  .stats-grid,
  .form-row,
  .saved-chat-card,
  .chat-thread-profile,
  .chat-session-card,
  .roleplay-stats,
  .admin-summary-grid,
  .admin-asset-card,
  .admin-search,
  .account-username-form,
  .file-control,
  .creator-stat-grid,
  .photo-video-grid {
    grid-template-columns: 1fr;
  }

  .chat-options-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-stepper {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 6px;
  }

  .stat-stepper input {
    min-width: 0;
    text-align: center;
  }

  .stat-stepper-btn {
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(43, 202, 255, 0.12);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }

  .stat-stepper-btn:active {
    border-color: var(--line-strong);
    background: rgba(43, 202, 255, 0.25);
  }

  .reply-length-control {
    width: 100%;
    justify-content: space-between;
  }

  .message {
    width: 100%;
  }

  .message.user {
    align-self: stretch;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 40px 40px minmax(72px, auto);
    gap: 6px;
    padding: 8px;
  }

  .composer input,
  .composer textarea {
    min-height: 42px;
    min-width: 0;
  }

  .send-btn {
    grid-column: auto;
    width: 100%;
  }

  .chat-panel {
    height: calc(100dvh - 112px);
    min-height: 0;
    max-height: calc(100dvh - 112px);
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .chat-panel .chat-header,
  .chat-panel .player-strip,
  .chat-panel .chat-tags-strip,
  .chat-panel .chat-options-strip {
    display: none;
  }

  .messages {
    padding: 12px;
    padding-bottom: 92px;
    min-height: 0;
    max-height: none;
  }

  .message-bubble {
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.52;
  }

  .chat-header,
  .player-strip,
  .chat-tags-strip,
  .chat-options-strip {
    padding-left: 12px;
    padding-right: 12px;
  }

  .roleplay-stat-row {
    grid-template-columns: 74px minmax(0, 1fr) 30px auto;
  }

  .app-shell {
    display: block;
  }

  .mobile-menu-btn {
    display: inline-grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(318px, 86vw);
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    padding: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(5, 16, 34, 0.97);
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.42);
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.58);
  }

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

  .sidebar .main-nav {
    display: grid;
    overflow: visible;
    padding: 0;
  }

  .sidebar .nav-item,
  .sidebar .safety-link {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: -10px -10px 12px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 7, 20, 0.94);
    backdrop-filter: blur(16px);
  }

  :root[data-theme="light"] .topbar {
    background: rgba(246, 244, 251, 0.94);
  }

  .topbar > div:first-of-type {
    min-width: 0;
  }

  .topbar .eyebrow {
    font-size: 10px;
  }

  .topbar h2 {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    font-size: 17px;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .topbar .top-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .top-actions .primary-btn.small {
    display: none;
  }

  .language-popover {
    right: 0;
    left: auto;
  }

  .chat-shell {
    display: block;
  }

  .profile-panel {
    position: fixed;
    inset: 118px 12px auto 12px;
    z-index: 95;
    display: none;
    max-height: min(70svh, 560px);
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .profile-chat-summary {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .profile-chat-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .profile-chat-actions .ghost-btn {
    width: 100%;
  }

  body.stats-panel-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 64;
    background: rgba(0, 0, 0, 0.34);
  }

  body.stats-panel-open .profile-panel {
    display: block;
  }

  .profile-close-btn {
    display: none;
    z-index: 2;
  }

  .profile-panel .roleplay-stats {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 0;
  }

  .profile-panel .relationship-mood,
  .profile-panel .roleplay-stat-card {
    padding: 10px;
  }

  .mobile-stats-btn {
    position: fixed;
    right: 14px;
    top: 72px;
    bottom: auto;
    z-index: 100;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0 16px;
    color: var(--text);
    background: linear-gradient(135deg, #0e4fd8 0%, #1678ff 50%, #2bcaff 100%);
    font-weight: 900;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), 0 0 22px rgba(43, 202, 255, 0.18);
  }

  .profile-reply-length {
    margin: 0 14px 14px;
  }

  body.stats-panel-open .mobile-stats-btn {
    border-color: rgba(255, 255, 255, 0.34);
    filter: brightness(1.08);
  }

  body.stats-panel-open .composer {
    z-index: 60;
    pointer-events: none;
  }

  .composer {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 66;
    grid-template-columns: minmax(0, 1fr) 40px 40px minmax(72px, auto);
    background: rgba(2, 7, 20, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
  }

  :root[data-theme="light"] .composer {
    background: rgba(246, 244, 251, 0.96);
  }

  .composer input,
  .composer textarea {
    grid-column: auto;
    padding: 0 10px;
  }

  .composer textarea {
    max-height: 132px;
    padding-block: 10px;
  }

  .composer-action {
    min-width: 40px;
    min-height: 42px;
  }

  .send-btn {
    grid-column: auto;
    min-height: 42px;
    padding: 0 12px;
    width: 100%;
  }

  dialog {
    width: min(100% - 18px, 620px);
    max-height: calc(100vh - 18px);
  }
}

@media (max-width: 420px) {
  html {
    font-size: 13px;
  }

  .workspace {
    padding: 8px;
  }

  .sidebar {
    padding: 8px;
  }

  .main-nav {
    gap: 6px;
  }

  .nav-item {
    min-width: 88px;
    min-height: 38px;
    padding: 0 10px;
  }

  .sidebar .nav-item,
  .sidebar .safety-link {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    margin: -8px -8px 10px;
    padding: 8px;
  }

  .mobile-menu-btn {
    width: 40px;
    height: 40px;
  }

  .top-actions,
  .catalog-actions {
    gap: 6px;
  }

  .hero-copy h1 {
    font-size: clamp(24px, 8.5vw, 30px);
  }

  .chatbot-grid,
  .character-list,
  .public-chat-grid {
    gap: 10px;
  }

  .chatbot-detail-art {
    min-height: 320px;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
  }

  .message-bubble {
    padding: 9px 10px;
    font-size: 15px;
    line-height: 1.5;
  }
}

/* UniversChat final UI adjustments */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 202, 255, 0.62) rgba(5, 16, 34, 0.78);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(5, 16, 34, 0.78);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(5, 16, 34, 0.92);
  border-radius: 999px;
  background: linear-gradient(180deg, #2bcaff, #7b3dff);
}

html,
body,
.workspace,
.view,
.panel {
  max-width: 100%;
}

body,
.workspace {
  overflow-x: hidden;
}

select,
.creator-form select,
.select-control select,
.admin-field-select,
.admin-plan-select {
  appearance: none;
  color: var(--text);
  border-color: var(--line);
  background:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%) calc(100% - 13px) 50% / 7px 7px no-repeat,
    rgba(6, 18, 37, 0.96);
}

select option {
  color: var(--text);
  background: #061225;
}

.gradient-violet {
  --card-gradient: rgba(126, 72, 255, 0.34);
  --card-gradient-strong: rgba(157, 99, 255, 0.5);
  --card-gradient-border: rgba(168, 116, 255, 0.68);
  --card-gradient-shadow: rgba(126, 72, 255, 0.18);
}

.chatbot-art,
.public-chat-art,
.chatbot-detail-art,
.profile-art,
.avatar-preview,
.character-avatar,
.message-avatar,
.mini-avatar {
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: rgba(3, 10, 24, 0.86);
}

.chatbot-body > p,
.public-chat-body > p {
  display: -webkit-box;
  min-height: 0;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

#publicChatbotGrid .chatbot-actions,
#publicChatGrid .public-chat-actions {
  display: none;
}

.chatbot-detail-copy {
  grid-auto-rows: max-content;
}

#chatbotDetailMeta {
  order: 1;
}

#chatbotDetailTitle {
  order: 2;
}

.chatbot-detail-actions {
  order: 3;
  justify-content: flex-end;
  margin: -6px 0 2px;
}

#chatbotDetailBio {
  order: 4;
}

#chatbotDetailTags {
  order: 5;
}

#chatbotDetailMetrics {
  order: 6;
}

#chatbotDetailSections {
  order: 7;
}

#chatbotCommentsPanel {
  order: 8;
}

.chatbot-detail-panel.has-card-gradient {
  border-color: var(--card-gradient-border, var(--line-strong));
  background:
    radial-gradient(circle at 88% 0%, var(--card-gradient-strong, rgba(43, 202, 255, 0.18)), transparent 36%),
    linear-gradient(135deg, var(--card-gradient, rgba(43, 202, 255, 0.1)), transparent 70%),
    rgba(5, 16, 34, 0.68);
}

.chatbot-detail-metrics,
.catalog-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-pagination {
  justify-content: center;
  padding: 0 16px 16px;
}

.catalog-pagination button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(6, 18, 37, 0.84);
  font-weight: 850;
}

.catalog-pagination button.active,
.catalog-pagination button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(43, 202, 255, 0.28), rgba(76, 125, 255, 0.16));
}

.detail-collapse {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.detail-collapse summary {
  padding: 11px 12px;
  color: var(--cyan);
  font-weight: 900;
  cursor: pointer;
}

.detail-collapse p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.chatbot-comments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.comments-heading,
.comment-card header,
.comment-card footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comments-heading,
.comment-card header {
  justify-content: space-between;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.comment-form textarea {
  min-height: 54px;
  max-height: 160px;
  resize: vertical;
}

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

.comment-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 18, 37, 0.72);
}

.comment-card.is-reply {
  margin-left: 22px;
  border-color: rgba(43, 202, 255, 0.28);
}

.comment-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.composer {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.composer-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 10px;
  align-items: end;
}

.composer-input-row .send-btn {
  width: 50px;
  min-width: 50px;
  padding: 0;
  font-size: 19px;
}

.composer-tools .composer-action {
  min-width: 42px;
}

.profile-reply-length.locked,
.reply-length-control.locked,
.nsfw-level-control.locked {
  opacity: 0.58;
}

.profile-reply-length.locked button,
.reply-length-control.locked button,
.nsfw-level-control.locked button {
  cursor: not-allowed;
}

#activeCharacterBio {
  display: none;
}

.profile-reply-length button:disabled,
.reply-length-control button:disabled,
.nsfw-level-control button:disabled {
  border-color: rgba(127, 148, 173, 0.18);
  color: var(--muted-2);
  background: rgba(127, 148, 173, 0.08);
}

.top-actions .primary-btn.small.has-avatar {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  background-size: cover !important;
  background-position: center !important;
  color: transparent;
  font-size: 0;
}

.account-avatar-form {
  display: grid;
  gap: 8px;
}

.account-avatar-preview {
  width: 54px;
  height: 54px;
  border-radius: 999px;
}

.admin-inline-select {
  width: 100%;
  min-width: 0;
}

.view[data-view-panel="billing"].active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.premium-hero {
  order: 1;
}

.plans {
  order: 2;
}

.coin-shop {
  order: 3;
}

.admin-report-row footer .ghost-btn,
.admin-report-row footer .primary-btn {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .catalog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.7fr) minmax(92px, 0.5fr);
    gap: 8px;
  }

  .catalog-actions input[type="search"],
  .catalog-actions .select-control,
  .catalog-actions .filter-menu {
    width: 100%;
    flex: 0 1 auto;
  }

  .filter-popover {
    position: absolute;
    right: 0;
    left: auto;
    width: min(92vw, 280px);
    grid-template-columns: 1fr;
  }

  #publicChatbotGrid.chatbot-grid,
  #publicChatGrid.public-chat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  #publicChatbotGrid .chatbot-card,
  #publicChatGrid .public-chat-card {
    min-height: 226px;
    grid-template-rows: 92px minmax(0, 1fr);
  }

  #publicChatbotGrid .chatbot-body,
  #publicChatGrid .public-chat-body {
    gap: 5px;
    padding: 8px;
  }

  #publicChatbotGrid .chatbot-kicker,
  #publicChatGrid .public-chat-kicker,
  #publicChatbotGrid .chatbot-subtitle,
  #publicChatGrid .chatbot-subtitle,
  #publicChatbotGrid .tag-row,
  #publicChatGrid .tag-row {
    display: none;
  }

  #publicChatbotGrid .chatbot-title-row h4,
  #publicChatGrid .chatbot-title-row h4 {
    font-size: 12px;
    line-height: 1.18;
  }

  #publicChatbotGrid .public-badge,
  #publicChatGrid .public-badge {
    padding: 3px 6px;
    font-size: 9px;
  }

  #publicChatbotGrid .chatbot-body > p,
  #publicChatGrid .public-chat-body > p {
    -webkit-line-clamp: 4;
    font-size: 11px;
    line-height: 1.25;
  }

  #publicChatbotGrid .metric-row,
  #publicChatGrid .metric-row {
    transform: scale(0.86);
    transform-origin: left center;
  }

  .composer {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .composer-input-row {
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 7px;
  }

  .composer-input-row .send-btn {
    width: 46px;
    min-width: 46px;
  }

  .composer textarea {
    min-height: 42px;
    max-height: 122px;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }

  .chatbot-detail-actions {
    justify-content: stretch;
  }

  .chatbot-detail-actions button {
    flex: 1 1 45%;
  }

  .admin-report-row footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions .primary-btn.small.has-avatar {
    display: inline-grid;
    width: 40px;
  }
}
