*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html,
button,
a,
[role="button"],
.bot-card,
.recent-chat-card,
.recent-item,
.your-character-card,
.detail-full-image-link {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:       #0d0d10;
  --surface:  #14141a;
  --card:     #1a1a22;
  --card-h:   #202029;
  --border:   #26262f;
  --border2:  #32323e;
  --text:     #e2e2ee;
  --muted:    #7070888;
  --sub:      #70708a;
  --accent:   #8b7cf6;
  --accent-d: #6b5cd6;
  --danger:   #e05555;
  --bot-bubble-bg: #28272f;
  --bot-bubble-text: #ffffff;
  --bot-bubble-border: rgba(255,255,255,0.12);
  --chat-bubble-bg: #28272f;
  --chat-bubble-text: #ffffff;
  --chat-bubble-border: rgba(255,255,255,0.12);
  --rp-action-color: #b9b8c2;
  --rp-action-alpha: 1;
  --rp-speech-color: #ffffff;
  --rp-speech-alpha: 1;
  --rp-whisper-color: #c0bec8;
  --rp-whisper-alpha: 0.92;
  --rp-emphasis-color: #ffffff;
  --rp-emphasis-alpha: 1;
  --rp-loud-color: #ff6b6b;
  --rp-loud-alpha: 1;
  --rp-ooc-color: #9ca3af;
  --rp-ooc-alpha: 0.88;
  --rp-quote-color: #b7c4ff;
  --rp-quote-alpha: 0.92;
  --rp-scene-color: #a78bfa;
  --rp-scene-alpha: 0.9;
  --rp-transition-color: #f5d48f;
  --rp-transition-alpha: 0.92;
  --rp-divider-color: #ffffff;
  --rp-divider-alpha: 0.32;
  --rp-divider-thickness-px: 1px;
  --font-ui: 'Sora', sans-serif;
  --font-chat: 'Sora', sans-serif;
  --font-display: 'Sora', sans-serif;
  --chat-text-size: 14px;
  --app-height: 100vh;
  --keyboard-inset: 0px;
  --native-ad-banner-height: 0px;
  --r:        12px;
  --r-sm:     8px;
}

#createView .media-icon-actions,
#settingsView .media-icon-actions,
#createView .appearance-toolbar.media-icon-actions,
#createView .first-message-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
}

#createView .media-icon-actions > .icon-tool-btn,
#settingsView .media-icon-actions > .icon-tool-btn,
#createView .appearance-toolbar.media-icon-actions > .icon-tool-btn,
#createView .first-message-actions > .icon-tool-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  flex: 0 0 42px;
  justify-content: center;
}

#createView .first-message-actions #addFirstMessageVariantBtn {
  min-height: 42px;
  width: auto;
  flex: 0 1 auto;
}

@media (max-width: 960px) {
  #createView .media-icon-actions,
  #settingsView .media-icon-actions,
  #createView .appearance-toolbar.media-icon-actions,
  #createView .first-message-actions {
    display: flex;
    grid-template-columns: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    width: auto;
  }

  #createView .media-icon-actions > .icon-tool-btn,
  #settingsView .media-icon-actions > .icon-tool-btn,
  #createView .appearance-toolbar.media-icon-actions > .icon-tool-btn,
  #createView .first-message-actions > .icon-tool-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  #createView .first-message-actions #addFirstMessageVariantBtn {
    width: auto;
    min-width: min(220px, 100%);
    flex: 1 1 220px;
  }

#createView .create-publish-row .visibility-trigger,
#createView .create-publish-row .rating-trigger {
    min-height: 54px;
  }
}

/* Desktop content width pass: keep utility pages and chat identity readable. */
@media (min-width: 961px) {
  #recentChatsView .create-topbar,
  #yourCharactersView .create-topbar,
  #aimodelratingView .create-topbar {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  #recentChatsView .recent-chats-page,
  #yourCharactersView .your-characters-page,
  #aimodelratingView .create-body.ai-model-rating-page {
    width: min(100%, calc(100% - 56px)) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box !important;
  }

  #recentChatsView .recent-chats-page {
    max-width: 1080px !important;
  }

  #aimodelratingView .ai-model-rating-shell,
  #aimodelratingView .ai-model-rating-toolbar,
  #aimodelratingView .ai-model-rating-grid,
  #aimodelratingView #aiModelRatingListPage,
  #aimodelratingView #aiModelRatingDetailPage {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #chatView .chat-topbar {
    display: grid !important;
    grid-template-columns: minmax(44px, 1fr) minmax(0, 700px) minmax(44px, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 28px !important;
  }

  #chatView .chat-topbar #backBtn {
    grid-column: 1 !important;
    justify-self: start !important;
  }

  #chatView .chat-bot-info {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: 700px !important;
    justify-self: center !important;
    min-width: 0 !important;
  }

  #chatView .chat-actions {
    grid-column: 3 !important;
    justify-self: end !important;
  }
}

.discovery-tag-tutorial {
  position: fixed;
  inset: 0;
  z-index: 6200;
  pointer-events: none;
}

.discovery-tag-tutorial.hidden {
  display: none;
}

.discovery-tag-tutorial-dim {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 12, 0.38);
  pointer-events: auto;
}

.discovery-tag-tutorial-outline {
  position: fixed;
  z-index: 1;
  border: 3px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.08), 0 0 28px rgba(139,124,246,0.72);
  pointer-events: none;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}

.discovery-tag-tutorial-card {
  position: fixed;
  width: min(700px, calc(100vw - 40px));
  min-height: 218px;
  display: grid;
  gap: 0;
  padding: 22px 24px 18px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: rgba(16, 16, 24, 0.97);
  box-shadow: 0 26px 80px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.08);
  color: var(--text);
  pointer-events: auto;
  z-index: 3;
  overflow: hidden;
}

.discovery-tag-tutorial-copy {
  min-width: 0;
  color: #f7f5ff;
}

.discovery-tag-tutorial-kicker {
  color: #c9bfff;
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.discovery-tag-tutorial-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.discovery-tag-tutorial-copy p,
.discovery-tag-tutorial-confirm p {
  margin: 12px 0 0;
  color: #d8d5e8;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.48;
  min-height: 78px;
}

.discovery-tag-tutorial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}

.discovery-tag-tutorial-actions .mini-btn {
  min-height: 42px;
  min-width: 132px;
  border-radius: 8px;
}

.discovery-tag-tutorial-actions .mini-btn.ghost {
  color: #d8d5e8;
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.18);
}

.discovery-tag-tutorial-actions .mini-btn:not(.ghost) {
  color: #ffffff;
  background: linear-gradient(135deg, #7c66ff, #2dd4bf);
  border-color: rgba(255,255,255,0.22);
}

.discovery-tag-tutorial-confirm {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(360px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  background: rgba(18, 18, 26, 0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  color: var(--text);
  pointer-events: auto;
  z-index: 4;
}

.discovery-tag-tutorial-confirm.hidden {
  display: none;
}

body.discovery-tag-tutorial-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .discovery-tag-tutorial-card {
    width: calc(100vw - 22px);
    min-height: 210px;
    padding: 18px 16px 14px;
    border-radius: 12px;
  }

  .discovery-tag-tutorial-title {
    font-size: 20px;
  }

  .discovery-tag-tutorial-copy p {
    font-size: 14px;
    min-height: 76px;
  }

  .discovery-tag-tutorial-actions {
    justify-content: stretch;
    padding-top: 14px;
  }

  .discovery-tag-tutorial-actions > * {
    flex: 1 1 0;
  }

  #uDesktopChatLayoutGroup {
    display: none !important;
  }
}

@media (max-width: 960px) {
  #uDesktopChatLayoutGroup {
    display: none !important;
  }
}

/* White + Pink final contrast polish: runtime-injected component styles. */
html[data-theme="white"] body #createView .premium-portrait-create-panel,
html[data-theme="white"] body #yourCharactersView .premium-portrait-create-panel,
html[data-theme="white"] body .premium-portrait-create-panel {
  background: linear-gradient(145deg, #fff5fa 0%, #fcecf5 100%) !important;
  border: 1px solid #e8bfd4 !important;
  color: #321a2c !important;
  box-shadow: 0 10px 26px rgba(201, 46, 128, 0.08) !important;
}

html[data-theme="white"] body #createView .premium-portrait-toggle,
html[data-theme="white"] body #yourCharactersView .premium-portrait-toggle,
html[data-theme="white"] body .premium-portrait-toggle {
  background: #fff !important;
  border: 1px solid #e6bfd3 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .premium-portrait-create-panel .create-premium-head,
html[data-theme="white"] body .premium-portrait-create-panel label,
html[data-theme="white"] body .premium-portrait-create-panel strong,
html[data-theme="white"] body .premium-portrait-create-panel small,
html[data-theme="white"] body .premium-portrait-create-panel .setting-help,
html[data-theme="white"] body .premium-portrait-create-panel .visibility-trigger-main strong {
  color: #4a2940 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .premium-portrait-create-panel .create-premium-head span,
html[data-theme="white"] body .premium-portrait-create-panel .setting-help {
  color: #805d73 !important;
}

html[data-theme="white"] body #createView #fChatColor,
html[data-theme="white"] body #yourCharactersView input[type="color"],
html[data-theme="white"] body #createView input[type="color"] {
  background: #fff1f8 !important;
  border: 1px solid #dcaac4 !important;
  border-radius: 12px !important;
  padding: 5px !important;
  color-scheme: light !important;
}

html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-note,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-energy-note,
html[data-theme="white"] body #chatStyleView .chat-style-section-note,
html[data-theme="white"] body #chatStyleView .chat-style-energy-note {
  color: #76566b !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot strong,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot span,
html[data-theme="white"] body #chatStyleView .chat-style-model-foot strong,
html[data-theme="white"] body #chatStyleView .chat-style-model-foot span {
  color: #4d2d43 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #botDetailView .detail-review-stat-chip,
html[data-theme="white"] body #botDetailView .detail-review-stat-chip strong,
html[data-theme="white"] body #botDetailView .detail-review-stat-chip em,
html[data-theme="white"] body #botDetailView .detail-panel-subtitle {
  color: #59384f !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #botDetailView .detail-review-stat-chip {
  background: #fff2f8 !important;
  border: 1px solid #e5bad1 !important;
}

html[data-theme="white"] body #botDetailView .detail-review-stat-chip svg,
html[data-theme="white"] body #botDetailView .detail-review-stat-chip svg * {
  color: #d82283 !important;
  stroke: currentColor !important;
}

html[data-theme="white"] body #botDetailView .review-item,
html[data-theme="white"] body #botDetailView .review-reply,
html[data-theme="white"] body #botDetailView .review-reply-form {
  background: #fff5fa !important;
  border-color: #e5bfd2 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #botDetailView .review-user-copy strong,
html[data-theme="white"] body #botDetailView .review-user-copy span,
html[data-theme="white"] body #botDetailView .review-comment,
html[data-theme="white"] body #botDetailView .review-copy,
html[data-theme="white"] body #botDetailView .review-reply-head,
html[data-theme="white"] body #botDetailView .review-reply-copy,
html[data-theme="white"] body #botDetailView .review-empty,
html[data-theme="white"] body #botDetailView .empty-state {
  color: #5f4356 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #homeView .bot-chip,
html[data-theme="white"] body #botDetailView .bot-chip,
html[data-theme="white"] body .public-marketplace-card .bot-chip {
  background: #fff0f7 !important;
  border: 1px solid #e7b7d0 !important;
  color: #7a315c !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #homeView .bot-chip-sfw,
html[data-theme="white"] body #botDetailView .bot-chip-sfw,
html[data-theme="white"] body .public-marketplace-card .bot-chip-sfw {
  background: #e7fbf0 !important;
  border-color: #83dbaf !important;
  color: #187247 !important;
}

html[data-theme="white"] body #homeView .bot-chip-nsfw,
html[data-theme="white"] body #botDetailView .bot-chip-nsfw,
html[data-theme="white"] body .public-marketplace-card .bot-chip-nsfw {
  background: #ffe9ec !important;
  border-color: #f39aa7 !important;
  color: #a6243b !important;
}

html[data-theme="white"] body #homeView .bot-chip-gender,
html[data-theme="white"] body #botDetailView .bot-chip-gender {
  background: #edf5ff !important;
  border-color: #a9cff5 !important;
  color: #315f91 !important;
}

html[data-theme="white"] body #homeView .bot-card-chat-count {
  background: linear-gradient(135deg, rgba(234, 35, 139, 0.92), rgba(165, 62, 213, 0.92)) !important;
  border-color: rgba(255, 255, 255, 0.78) !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(185, 36, 127, 0.2) !important;
}

html[data-theme="white"] body #homeView .bot-card-stat-chip,
html[data-theme="white"] body #homeView .bot-card-stat-chip strong {
  background: #fff0f7 !important;
  border-color: #e6bad0 !important;
  color: #633b54 !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-panel,
html[data-theme="white"] body #settingsView #blockedBotsPanel {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #recentChatsView .recent-chat-card,
html[data-theme="white"] body #recentChatsView .recent-chats-empty,
html[data-theme="white"] body #settingsView .blocked-bots-empty,
html[data-theme="white"] body #settingsView .blocked-bot-row {
  background: #fff2f8 !important;
  border: 1px solid #e8bfd4 !important;
  color: #3b2234 !important;
  border-radius: 14px !important;
}

html[data-theme="white"] body #creditsView .credits-energy-guide-list > div {
  background: #fff5fa !important;
  border: 1px solid #e5bfd2 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #creditsView .credits-energy-guide-list strong,
html[data-theme="white"] body #creditsView .credits-energy-guide-list small,
html[data-theme="white"] body #creditsView .credits-energy-guide-list span,
html[data-theme="white"] body #creditsView .credits-panel .section-subtitle,
html[data-theme="white"] body #creditsView .credits-inline-note {
  color: #5f4055 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #creditsView .credits-energy-guide-list > div > span {
  background: #ffe2ef !important;
  color: #b31566 !important;
  border-color: #e3aac6 !important;
}

html[data-theme="white"] body #creditsChaytPlusDetailsBtn {
  background: linear-gradient(135deg, #f52d90, #b544d9) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-proof,
html[data-theme="white"] body #chaytPlusView .chayt-plus-proof .review-user-copy,
html[data-theme="white"] body #chaytPlusView .chayt-plus-proof .review-user-copy strong,
html[data-theme="white"] body #chaytPlusView .chayt-plus-proof .review-user-copy span,
html[data-theme="white"] body #chaytPlusView .chayt-plus-proof .review-vote,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-row,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-row.header,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-name,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-state {
  color: #4b2940 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-proof {
  background: linear-gradient(135deg, #fff1f7, #f4edff) !important;
  border: 1px solid #e5bad1 !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-compare-icon.included {
  background: #ffe2ef !important;
  border-color: #df87b4 !important;
  color: #d71f7e !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-compare-icon.missing {
  background: #f4edf2 !important;
  border-color: #cdb8c5 !important;
  color: #8d7483 !important;
}

html[data-theme="white"] body .premium-verify-badge {
  color: #e62788 !important;
  filter: drop-shadow(0 0 5px rgba(230, 39, 136, 0.28)) !important;
}

html[data-theme="white"] body .premium-verify-badge svg stop:nth-child(1) { stop-color: #ffb4d7 !important; }
html[data-theme="white"] body .premium-verify-badge svg stop:nth-child(2) { stop-color: #f42c91 !important; }
html[data-theme="white"] body .premium-verify-badge svg stop:nth-child(3) { stop-color: #a846d5 !important; }
html[data-theme="white"] body .premium-verify-badge svg path:last-child { stroke: #f15b9f !important; }

html[data-theme="white"] body .floating-tooltip {
  background: linear-gradient(135deg, #f52d90, #b544d9) !important;
  border-color: rgba(255,255,255,.72) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(180, 40, 130, .24) !important;
}

html[data-theme="white"] body .auth-gate {
  background: rgba(98, 28, 74, 0.28) !important;
  backdrop-filter: blur(8px) !important;
}

html[data-theme="white"] body .auth-gate-card,
html[data-theme="white"] body .profile-setup-card {
  background: linear-gradient(160deg, #fff 0%, #fff2f8 100%) !important;
  border: 1px solid #e4b8cf !important;
  color: #321a2c !important;
  box-shadow: 0 24px 70px rgba(111, 29, 79, .2) !important;
}

html[data-theme="white"] body .auth-gate-title,
html[data-theme="white"] body .auth-gate-subtitle,
html[data-theme="white"] body .auth-gate-card label,
html[data-theme="white"] body .auth-gate-card .auth-divider,
html[data-theme="white"] body .auth-gate-card .auth-switch-copy,
html[data-theme="white"] body .auth-gate-card .auth-legal,
html[data-theme="white"] body .auth-gate-card .auth-helpful-pages,
html[data-theme="white"] body .auth-gate-card a {
  color: #56354c !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .auth-mode-tabs,
html[data-theme="white"] body .auth-fields input,
html[data-theme="white"] body .auth-gate-card input {
  background: #fff !important;
  border-color: #dfb5ca !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .auth-mode-tab {
  background: transparent !important;
  color: #76566b !important;
}

html[data-theme="white"] body .auth-mode-tab.active,
html[data-theme="white"] body .auth-submit-btn {
  background: linear-gradient(135deg, #f52d90, #b544d9) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body .auth-gate-close,
html[data-theme="white"] body .auth-helpful-pages a,
html[data-theme="white"] body .auth-links a {
  background: #fff1f7 !important;
  border-color: #e1b7cc !important;
  color: #7d315d !important;
}

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

.search-field .search-submit-btn,
.model-picker-topbar .model-picker-search-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  min-height: 34px;
  padding: 0 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04)),
    linear-gradient(135deg, #1f2937, #060606);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.search-field .search-submit-btn:hover,
.model-picker-topbar .model-picker-search-btn:hover {
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}

.bot-appearance-grid {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.appearance-panel {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.appearance-panel-wide {
  grid-column: 1 / -1;
}

.appearance-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.appearance-subtitle {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

.bot-media-preview-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}

.bot-media-preview {
  position: relative;
  width: 100%;
  min-height: 180px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}

.bot-media-preview::before {
  content: var(--i18n-no-image-yet, 'No image yet');
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232,233,241,0.45);
}

.bot-media-preview.has-image::before {
  content: none;
}

.bot-media-preview img,
.bot-card-image-preview img,
.bot-card-media img,
.detail-full-image-preview,
.detail-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-full-preview {
  aspect-ratio: 4 / 5;
}

.bot-full-preview img {
  object-fit: contain;
  background: rgba(0,0,0,0.18);
}

.bot-card-image-crop-target {
  cursor: grab;
}

.bot-card-image-crop-target:active {
  cursor: grabbing;
}

.appearance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-guide-card {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.settings-guide-title,
.form-section-heading,
.profile-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-guide-card p {
  margin: 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.55;
}

.media-combined-panel {
  display: grid;
  gap: 16px;
  padding: 16px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

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

.media-workspace-split {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.media-sidebar {
  display: grid;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.media-nav-btn {
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(255,255,255,0.72);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.media-nav-btn:last-child {
  border-bottom: 0;
}

.media-nav-btn.active {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.media-content-panel {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  padding: 16px;
}

.media-pane {
  display: grid;
  gap: 12px;
}

.media-pane-body {
  display: grid;
  gap: 14px;
}

.media-pane-body-avatar {
  justify-items: start;
}

.profile-avatar-row-flat {
  align-items: center;
  gap: 16px;
  padding: 0 0 8px;
}

.profile-avatar-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
  width: 100%;
}

.appearance-slider-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.appearance-slider {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--sub);
}

.appearance-slider input[type="range"] {
  width: 100%;
}

.bot-card-image-list {
  display: grid;
  gap: 12px;
}

.bot-card-image-item {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,12,20,0.48);
}

.bot-card-image-preview {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.bot-card-image-preview::before {
  content: var(--i18n-no-image, 'No image');
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232,233,241,0.4);
}

.bot-card-image-preview.has-image::before {
  content: none;
}

.bot-card-image-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.your-characters-page {
  display: grid;
  gap: 18px;
}

.your-characters-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.10), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.your-characters-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.your-characters-hero p {
  margin: 0;
  color: var(--sub);
  max-width: 680px;
}

.your-characters-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.your-characters-toolbar .search-field {
  flex: 1 1 260px;
}

.your-characters-toolbar-actions,
.your-characters-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.your-characters-mobile-create-cta,
.your-characters-mobile-create-btn {
  display: none;
}

.your-characters-tool-btn {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.your-characters-tool-btn svg {
  width: 18px;
  height: 18px;
}

.your-characters-tool-btn.danger {
  color: #ffb5b5;
  border-color: rgba(255,107,107,0.26);
}

.your-characters-tool-btn.danger:hover:not(:disabled) {
  background: rgba(255,107,107,0.12);
  border-color: rgba(255,107,107,0.46);
}

.your-characters-bulk-panel {
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139,124,246,0.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(12,13,19,0.94);
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  overflow: visible;
}

.your-characters-bulk-panel:not(.hidden) {
  position: fixed;
  left: var(--bulk-panel-left, 24px);
  top: var(--bulk-panel-top, 120px);
  z-index: 950;
  display: grid;
  width: var(--bulk-panel-width, min(720px, calc(100vw - 48px)));
  max-height: var(--bulk-panel-max-height, calc(100dvh - 140px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.your-characters-bulk-panel.hidden {
  display: none;
}

.your-characters-bulk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.your-characters-bulk-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.your-characters-bulk-head .section-title,
.your-characters-bulk-head .section-subtitle {
  margin-top: 0;
}

.your-characters-bulk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  overflow: visible;
}

.your-characters-bulk-grid .full {
  grid-column: auto;
}

.bulk-control-row {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  overflow: visible;
}

.bulk-control-row:focus-within,
.bulk-control-row:has(.model-picker.open),
.bulk-control-row:has(.visibility-picker.open) {
  z-index: 35;
  border-color: rgba(139,124,246,0.30);
  background: rgba(255,255,255,0.04);
}

.bulk-control-row.model-row,
.bulk-control-row.effect-row {
  grid-column: 1 / -1;
}

.bulk-control-row.compact-row {
  grid-template-columns: minmax(0, 1fr) minmax(104px, 148px);
  align-items: center;
}

.bulk-setting-card {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.bulk-setting-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.bulk-setting-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.bulk-setting-card small {
  display: block;
  margin-top: 3px;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.3;
}

.your-characters-bulk-grid .form-group {
  margin: 0;
  min-width: 0;
}

.your-characters-bulk-grid .form-group.compact input,
.bulk-effect-row .visibility-trigger {
  min-height: 46px;
  border-radius: 10px;
}

.bulk-effect-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.72fr);
  gap: 10px;
  align-items: stretch;
  overflow: visible;
}

#yourCharactersView .model-picker {
  position: relative;
  z-index: 1;
}

#yourCharactersView .model-picker.open {
  z-index: 80;
}

#yourCharactersView .model-picker-popover {
  z-index: 90;
}

#yourCharactersView .premium-effect-picker {
  min-width: 0;
}

#yourCharactersView .premium-effect-picker .visibility-menu {
  width: min(320px, calc(100vw - 40px));
}

#yourCharactersView .premium-effect-picker .visibility-trigger-main {
  min-width: 0;
  align-items: center;
}

#yourCharactersView .premium-effect-picker .visibility-trigger-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-portrait-toggle.compact {
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
}

.premium-portrait-toggle.compact small {
  display: block;
  margin-top: 2px;
}

.your-character-card.is-selected {
  border-color: rgba(139,124,246,0.55);
  box-shadow: 0 0 0 1px rgba(139,124,246,0.22), 0 14px 32px rgba(0,0,0,0.22);
}

.your-character-card {
  position: relative;
}

.your-character-card,
.your-character-header,
.your-character-copy,
.your-character-chips,
.your-character-stats,
.your-character-actions {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.your-character-card input,
.your-character-card textarea,
.your-character-card select {
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

.your-character-select {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.your-character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.mini-btn.danger {
  border-color: rgba(255,107,107,0.35);
  color: #ffb3b3;
}

.bot-card-image-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bot-card-image-title {
  font-weight: 700;
}

.bot-card-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-tool-btn {
  appearance: none;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

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

.icon-tool-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.icon-tool-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

.icon-tool-btn:disabled:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.14);
}

.icon-tool-btn.danger {
  color: #ffb5b5;
  border-color: rgba(255,107,107,0.24);
}

.media-icon-actions {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px;
}

.media-icon-actions .icon-tool-btn,
.first-message-actions .icon-tool-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
}

.bot-card-image-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--sub);
}

.bot-card {
  overflow: hidden;
  padding: 0;
}

.bot-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #101014;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (min-width: 961px) {
  #settingsView #dangerZonePanel {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
    border: 1px solid rgba(224,85,85,0.28) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.12), transparent 42%),
      linear-gradient(180deg, rgba(224,85,85,0.055), rgba(255,255,255,0.015)),
      rgba(20,18,23,0.94) !important;
  }

  #settingsView #dangerZonePanel::before {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .panel-title {
    color: #ffe7e7 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .setting-help {
    display: block !important;
    margin-top: 6px !important;
    color: rgba(255,210,210,0.72) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-badge {
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(224,85,85,0.34) !important;
    background: rgba(224,85,85,0.11) !important;
    color: #ffcaca !important;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #settingsView #dangerZonePanel > .danger-zone-card {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(224,85,85,0.2) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(135deg, rgba(224,85,85,0.095), rgba(255,255,255,0.018)),
      rgba(0,0,0,0.16) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    grid-column: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-details-link,
  #settingsView #dangerZonePanel .btn-delete {
    min-height: 40px !important;
    white-space: nowrap !important;
  }
}

/* Last-mile fixes for settings overlay and compact creator cards. */
.settings-overview-card,
.settings-overview-card:visited {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 961px) {
  body[data-current-view="settings"] #settingsView.active {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(8,8,12,0.74);
    backdrop-filter: blur(16px);
    overflow: hidden;
  }

  body[data-current-view="settings"] #settingsView .create-topbar,
  body[data-current-view="settings"] #settingsView .create-body {
    width: min(960px, calc(100vw - 56px));
    max-width: 960px;
    align-self: auto;
    box-sizing: border-box;
  }

  body[data-current-view="settings"] #settingsView .create-topbar {
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
  }

  body[data-current-view="settings"] #settingsView .create-body {
    max-height: min(820px, calc(100dvh - 112px));
    flex: 0 1 auto;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 0;
    border-radius: 0 0 22px 22px;
  }
}

@media (min-width: 961px) {
  #yourCharactersView .your-characters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  #yourCharactersView .your-character-card {
    display: grid;
    grid-template-columns: minmax(360px, 1.15fr) minmax(230px, .75fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 118px;
    padding: 18px 56px 18px 18px;
    border-radius: 18px;
    align-content: center;
  }

  #yourCharactersView .your-character-copy p {
    max-width: 640px;
    -webkit-line-clamp: 2;
  }

  #yourCharactersView .your-character-chips {
    justify-content: flex-start;
    max-height: 56px;
    overflow: hidden;
  }

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

  #yourCharactersView .your-character-action-btn {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 13px;
    font-size: 0;
    gap: 0;
  }

  #yourCharactersView .your-character-action-btn svg {
    width: 17px;
    height: 17px;
  }

  #yourCharactersView .your-character-action-btn span {
    display: none;
  }

  #yourCharactersView .your-character-select {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 760px) {
  .your-characters-toolbar {
    align-items: stretch;
  }

  .your-characters-toolbar .search-field {
    flex-basis: 100%;
  }

  .your-characters-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .your-characters-bulk-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .your-characters-bulk-head {
    align-items: center;
  }

  .your-characters-bulk-grid,
  .bulk-effect-row,
  .bulk-control-row.compact-row {
    grid-template-columns: 1fr;
  }

  .bulk-setting-card {
    min-height: 54px;
  }

  .bulk-control-row {
    padding: 11px;
  }
}

@media (min-width: 961px) {
  #settingsView #dangerZonePanel .danger-zone-mobile-card {
    display: none !important;
  }

  #settingsView #dangerZonePanel > .danger-zone-card {
    display: grid !important;
  }
}

.developer-bulk-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}

.bulk-image-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  align-items: start;
  gap: 12px;
  max-height: 420px;
  padding: 4px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.bulk-image-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 118px auto;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  overflow: hidden;
}

.bulk-image-card img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  color: transparent;
  overflow: hidden;
}

.bulk-image-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--sub);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-image-card.is-broken img {
  object-fit: contain;
  padding: 18px;
  opacity: 0.55;
}

.bot-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(5,6,10,0.14) 42%, rgba(7,8,12,0.78) 100%);
  pointer-events: none;
}

.bot-card-media.is-explicit-blurred img.bot-card-current-img,
.bot-card-media.is-explicit-blurred img.bot-card-transition-img {
  filter: blur(22px) saturate(0.92) brightness(0.82);
  transform: scale(1.06);
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.nsfw-blur-wrap,
.recent-avatar-blur-wrap,
.nsfw-image-blurred {
  position: relative;
  overflow: hidden;
}

.recent-avatar-blur-wrap {
  display: inline-grid;
  place-items: center;
  border-radius: inherit;
  flex: 0 0 auto;
}

.nsfw-image-blurred img,
img.nsfw-image-blurred {
  filter: blur(20px) saturate(0.88) brightness(0.82);
  transform: scale(1.04);
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.detail-full-image-preview.nsfw-image-blurred,
.detail-image-modal-img.nsfw-image-blurred {
  filter: blur(26px) saturate(0.88) brightness(0.78);
  transform: scale(1.02);
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.nsfw-blur-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.42);
  background: rgba(8,10,18,0.76);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,0.38);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.nsfw-image-blurred::after {
  display: none;
  content: "";
}

.nsfw-image-blurred:has(.nsfw-blur-badge)::after,
.bot-card-media.is-explicit-blurred::after {
  display: none;
}

.nsfw-blur-badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bot-card-moderation-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-items: center;
  color: #f6f7fb;
  pointer-events: none;
}

.bot-card-media.is-explicit-blurred .bot-card-moderation-overlay {
  display: grid;
}

.bot-card-moderation-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bot-card-moderation-copy {
  font-size: 12px;
  color: rgba(246,247,251,0.82);
}

.bot-card-top,
.bot-card-meta,
.bot-card-footer,
.bot-actions-row {
  padding-inline: 16px;
}

.bot-card-top {
  margin-top: -38px;
  position: relative;
  z-index: 1;
}

.bot-card-meta,
.bot-card-footer,
.bot-actions-row {
  padding-bottom: 14px;
}

.bot-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding-bottom: 18px;
}

.bot-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.detail-avatar-wrap.hidden {
  display: none;
}

.detail-full-image-block {
  display: grid;
  gap: 12px;
}

.detail-full-image-link {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.detail-full-image-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.detail-gallery-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.detail-gallery-thumb {
  position: relative;
  width: 72px;
  height: 96px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}

.detail-gallery-thumb.active {
  border-color: rgba(139,124,246,0.65);
  box-shadow: 0 0 0 1px rgba(139,124,246,0.35);
}

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

  .bot-card-image-item {
    grid-template-columns: 1fr;
  }
}

html, body { height: var(--app-height); min-height: var(--app-height); overflow: hidden; background: var(--bg); }
body { min-height: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  display: flex;
  font-size: 14px;
}

/* ── SIDEBAR ── */
#sidebar {
  width: 220px;
  min-width: 230px;
  height: var(--app-height);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 8px;
  position: relative;
  overflow: visible;
  transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}
.sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  right: 14px;
  left: auto;
  z-index: 1900;
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sidebar-collapse-btn:hover {
  background: rgba(32,32,38,0.98);
  border-color: rgba(255,255,255,0.18);
}
.sidebar-collapse-btn:focus {
  outline: none;
}
.sidebar-collapse-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(139,124,246,0.42);
}
body.sidebar-collapsed #sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
}
body.sidebar-collapsed #sidebar > :not(.sidebar-collapse-btn) {
  opacity: 0;
  pointer-events: none;
  width: 0;
  min-width: 0;
  overflow: hidden;
}
body.sidebar-collapsed .sidebar-collapse-btn {
  position: fixed;
  left: 0;
  right: auto;
  border-radius: 0 10px 10px 0;
}

body.sidebar-collapsed:has(#chatView.active) .sidebar-collapse-btn {
  top: 72px;
}
.sidebar-top { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }
.logo { font-size: 16px; font-weight: 600; color: var(--text); padding: 4px 8px; letter-spacing: -0.3px; }
.brand-text,
.logo,
.home-header h1,
.create-title,
.panel-title,
.bot-card-name,
.chat-name,
.detail-name,
.splash-title {
  font-family: var(--font-display);
}

.bot-card-name,
.chat-name,
.detail-name,
.recent-chat-card-title,
.history-card-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.create-btn:hover { background: var(--accent-d); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  user-select: none;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
  display: block;
  opacity: 0.9;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--card); color: var(--text); }

.recents-section { margin-top: 16px; flex: 1; overflow-y: auto; }
.recents-label { font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.8px; padding: 0 10px 8px; }
.sidebar-socials {
  display: none;
  margin-top: 14px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.sidebar-socials-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sidebar-socials-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sidebar-social-link {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.sidebar-social-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
.sidebar-social-link img,
.sidebar-social-link > svg {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.sidebar-social-link > svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-legal { margin-top: 16px; padding: 16px 10px 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.sidebar-legal-label { font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.8px; }
.sidebar-legal-links { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.sidebar-legal-links a { color: var(--sub); text-decoration: none; font-size: 13px; transition: color 0.12s ease; }
.sidebar-legal-links a:hover { color: var(--text); }

.recent-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--sub); font-size: 13px;
  transition: background 0.12s, color 0.12s;
  overflow: hidden; white-space: nowrap;
}
.recent-item:hover { background: var(--card); color: var(--text); }
.recent-item.active { background: var(--card); color: var(--text); }
.recent-emoji { font-size: 16px; flex-shrink: 0; }
.recent-name { overflow: hidden; text-overflow: ellipsis; }

.recent-sidebar-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 6px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}

.recent-sidebar-status.saving {
  color: #c9c2ff;
  border-color: rgba(139,124,246,0.18);
  background: rgba(139,124,246,0.07);
}

.recent-sidebar-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.14);
  border-top-color: currentColor;
  animation: spin 0.9s linear infinite;
}

.recent-sidebar-skeleton {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
}

.recent-sidebar-skeleton span,
.recent-sidebar-skeleton i {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.12), rgba(255,255,255,0.055));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.recent-sidebar-skeleton span {
  width: 26px;
  height: 26px;
}

.recent-sidebar-skeleton div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.recent-sidebar-skeleton i {
  height: 8px;
}

.recent-sidebar-skeleton i:first-child {
  width: 74%;
}

.recent-sidebar-skeleton i:last-child {
  width: 48%;
  opacity: 0.7;
}

.mobile-bottom-nav { display: none; }
.mobile-profile-logout-btn { display: none; }
.mobile-floating-create-btn,
.mobile-recent-your-characters-btn { display: none; }

/* ── MAIN ── */
#main { flex: 1; height: var(--app-height); overflow: hidden; position: relative; background: var(--bg); }
.view { position: absolute; inset: 0; height: 100%; overflow-y: auto; display: none; flex-direction: column; min-height: 0; background: var(--bg); }
.view.active { display: flex; }

/* ── HOME ── */
#homeView { padding: 40px 40px 60px; gap: 32px; }
.home-header h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; }
.home-header p { color: var(--sub); font-size: 14px; margin-top: 4px; }
.bot-section { display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.8px; }
.bots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.hidden { display: none !important; }

.marketplace-empty-state {
  grid-column: 1 / -1;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--sub);
  background: rgba(255,255,255,0.025);
  font-size: 13px;
  text-align: center;
  padding: 18px;
}

.bot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.bot-card:hover { background: var(--card-h); border-color: var(--border2); transform: translateY(-1px); }
.bot-card-emoji { font-size: 32px; line-height: 1; }
.bot-card-name { font-size: 15px; font-weight: 600; color: var(--text); }
.bot-card-desc { font-size: 12px; color: var(--sub); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bot-card-meta { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* ── CHAT ── */
#chatView { display: none; flex-direction: column; overflow: hidden; min-height: 0; }
#chatView.active { display: flex; }

.chat-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  z-index: 25;
  overflow: visible;
}
.chat-bot-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.chat-name {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}
.chat-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-owner-attribution {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  max-width: min(170px, 46vw);
  min-width: 0;
  gap: 3px;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid rgba(139, 124, 246, .30);
  border-radius: 999px;
  background: rgba(139, 124, 246, .18);
  color: rgba(238, 236, 255, .94);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  animation: none;
  transition: none;
}
.chat-owner-attribution-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-owner-attribution .chat-owner-premium-badge.premium-verify-badge,
.chat-owner-attribution .chat-owner-premium-badge.premium-verify-badge:hover {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin-left: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f6c947;
  line-height: 1;
  vertical-align: -3px;
  animation: none;
  transform: none;
  filter: drop-shadow(0 0 4px rgba(255, 212, 71, .28));
  transition: none;
}
.chat-owner-attribution .chat-owner-premium-badge.premium-verify-badge svg {
  width: 16px;
  height: 16px;
  display: block;
}
.chat-desc { font-size: 12px; color: var(--sub); }

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 24px 20px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.messages::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: rgba(50, 50, 62, 0.92); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }

.msg { display: flex; gap: 12px; max-width: 75%; min-width: 0; overflow: visible; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }

.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 2px; }

.bubble {
  padding: 12px 16px; border-radius: 16px;
  font-family: var(--font-chat);
  font-size: var(--chat-text-size); line-height: 1.68; color: var(--text);
  font-weight: 560;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg.user .bubble { background: var(--chat-bubble-bg); color: var(--chat-bubble-text); border: 1px solid var(--chat-bubble-border); border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: var(--bot-bubble-bg); color: var(--bot-bubble-text); border: 1px solid var(--bot-bubble-border); border-bottom-left-radius: 4px; }
.msg.assistant .bubble.sfw-block-bubble {
  width: min(560px, 100%);
  padding: 0;
  background: #23242a;
  border: 0;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}
.sfw-block-card {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 24px 24px;
  text-align: center;
  border: 2px solid #e14545;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}
.sfw-block-card.ai-refusal-card {
  border-color: #6b8cff;
  background: linear-gradient(180deg, rgba(107,140,255,0.12), rgba(255,255,255,0.018));
}
.sfw-block-icon {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f4f4f5;
  flex: 0 0 auto;
}
.sfw-block-icon span {
  position: absolute;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #202126;
}
.sfw-block-icon span:first-child { left: 15px; }
.sfw-block-icon span:nth-child(2) { right: 15px; }
.sfw-block-icon i {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 15px;
  height: 4px;
  border-radius: 999px;
  background: #202126;
  transform: rotate(-4deg);
}
.sfw-block-icon.sad i {
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 10px;
  background: transparent;
  border-top: 4px solid #202126;
  border-radius: 999px 999px 0 0;
  transform: none;
}
.sfw-block-title {
  color: #fff;
  font: 700 18px/1.25 var(--font-ui);
}
.sfw-block-copy {
  max-width: 420px;
  color: rgba(255,255,255,0.82);
  font: 560 14px/1.55 var(--font-ui);
}
.sfw-block-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2px;
}
.sfw-block-btn {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  background: #fff;
  color: #16171c;
  padding: 0 16px;
  font: 700 13px/1 var(--font-ui);
  cursor: pointer;
}
.sfw-block-btn.ghost {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.msg .bubble .message-image-link,
.message-image-link {
  display: block;
  margin: 8px 0 2px;
  line-height: 0;
  width: min(58vw, 460px);
  max-width: 100%;
}

.msg .bubble .message-inline-image,
.message-inline-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
}

.typing-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sub);
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.input-bar {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.composer-shell {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  background: rgba(255,255,255,0.035);
  box-shadow: none;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.composer-shell:focus-within {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.052);
  box-shadow: none;
}
#msgInput {
  width: 100%;
  flex: 0 0 auto; background: transparent; border: 0;
  border-radius: 22px; color: var(--text); font-family: inherit;
  font-size: 14px; padding: 11px 12px 11px 14px; resize: none; outline: none;
  min-height: 44px; max-height: 220px; line-height: 1.55; transition: color 0.15s;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-y: hidden;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  caret-color: #fff;
}
#msgInput:focus { border-color: transparent; }
#msgInput::placeholder { color: var(--sub); }
#msgInput::selection {
  background: rgba(139,124,246,0.38);
  color: #fff;
}
#sendBtn {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--accent); border: 1px solid rgba(207,200,255,0.45); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
}
#sendBtn:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: none; }
#sendBtn:active { transform: translateY(0) scale(0.96); }
#sendBtn:disabled { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45); cursor: not-allowed; box-shadow: none; }
#sendBtn.is-pending,
#sendBtn.is-pending:disabled,
#sendBtn.is-pending:hover {
  background: rgba(139,124,246,0.42);
  border-color: rgba(207,200,255,0.18);
  color: rgba(255,255,255,0.62);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#sendBtn.is-empty,
#sendBtn.is-empty:disabled,
#sendBtn.is-empty:hover {
  background: rgba(139,124,246,0.22);
  border-color: rgba(207,200,255,0.14);
  color: rgba(255,255,255,0.46);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#sendBtn.is-stop { background: #ff4d4f; border-color: rgba(255,255,255,0.16); color: #fff; }
#sendBtn.is-stop:hover { background: #ff6768; color: #fff; }
#sendBtn svg { display: block; pointer-events: none; }

/* ── CREATE / EDIT ── */
#createView { display: none; flex-direction: column; }
#createView.active { display: flex; }

.create-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.create-title { font-size: 16px; font-weight: 600; }

.create-body {
  flex: 1; overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 40px 60px;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 760px; width: 100%;
  box-sizing: border-box;
}

#createView .create-body {
  width: min(100%, 620px);
  max-width: 620px;
  margin: 0 auto;
  align-items: stretch;
}

#createView .create-body > .panel:first-child {
  order: 1;
}

#createView .create-body > .create-character-panel {
  order: 2;
}

#createView .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  gap: 18px;
}

#createView .create-body > .panel:first-child {
  gap: 10px;
}

#createView .create-body > .panel:first-child > .panel-title,
#createView .media-combined-panel > .appearance-title,
#createView .media-combined-panel > .setting-help,
#createView .media-pane[data-media-pane-content="profile"] > .appearance-subtitle,
#createView .media-pane[data-media-pane-content="profile"] > .setting-help {
  display: none;
}

#createView .panel-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

#createView .form-grid.two-col {
  grid-template-columns: 1fr;
}

#createView .form-group label,
#createView .form-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

#createView .form-group input,
#createView .form-group textarea,
#createView .form-group select {
  background: #15161b;
  border-color: rgba(255,255,255,0.18);
  border-radius: 10px;
  font-size: 14px;
  min-height: 42px;
}

#createView .form-group textarea {
  min-height: 96px;
}

#createView .form-group input:focus,
#createView .form-group textarea:focus,
#createView .form-group select:focus {
  border-color: rgba(255,255,255,0.42);
}

#createView .setting-help {
  color: #a2abc8;
  font-size: 11px;
}

#createView .char-counter {
  align-self: flex-end;
  color: #7f89aa;
  font-size: 11px;
  line-height: 1;
}

#settingsView .char-counter {
  align-self: flex-end;
  color: #7f89aa;
  font-size: 11px;
  line-height: 1;
}

#createView .create-advanced-options {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
}

#createView .create-advanced-options summary {
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style-position: outside;
  padding: 8px 0;
}

#createView .create-advanced-options[open] {
  display: grid;
  gap: 16px;
}

#createView .appearance-panel,
#createView .media-content-panel,
#createView .media-sidebar,
#createView .premium-portrait-toggle {
  background: transparent;
}

#createView .bot-appearance-grid > .appearance-panel:not(.media-combined-panel) {
  display: none;
}

#createView .bot-appearance-grid {
  gap: 18px;
}

#createView .appearance-title {
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

#createView .media-workspace-split {
  grid-template-columns: 1fr;
  gap: 12px;
}

#createView .media-sidebar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 0;
  padding: 0 24px 4px 0;
  max-width: 100%;
  scrollbar-width: none;
}

#createView .media-sidebar::-webkit-scrollbar {
  display: none;
}

#createView .media-nav-btn {
  border-radius: 999px;
  flex: 0 0 auto;
  padding: 9px 12px;
}

#createView .media-content-panel {
  border: 0;
  padding: 0;
}

#createView .media-pane-body-avatar {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 14px;
}

#createView .big-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.32);
}

#createView .big-avatar img,
#createView .big-avatar .avatar-image {
  border-radius: 50%;
}

#createView .bot-media-preview-frame,
#createView .bot-card-image-preview {
  border-color: rgba(255,255,255,0.2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.28);
}

#createView .bot-card-image-item {
  border-color: rgba(255,255,255,0.14);
}

#createView .avatar-controls {
  align-items: center;
  flex-wrap: wrap;
}

#createView .form-actions {
  align-items: center;
  justify-content: flex-end;
}

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

#createView .native-visibility-select {
  display: none;
}

#createView .native-rating-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#createView .native-premium-effect-select {
  display: none;
}

.visibility-picker,
.rating-picker {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.rating-picker {
  max-width: none;
}

.visibility-trigger,
.visibility-option,
.rating-trigger {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  font: inherit;
}

.visibility-trigger,
.rating-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border-radius: 10px;
  background: #15161b;
  cursor: pointer;
}

#createView .create-publish-row .visibility-picker,
#createView .create-publish-row .rating-picker {
  height: 100%;
}

#createView .create-gender-picker {
  min-width: 0;
  width: 100%;
}

#createView .create-publish-row .visibility-trigger,
#createView .create-publish-row .rating-trigger {
  min-height: 52px;
  height: auto;
}

.visibility-trigger-main,
.visibility-option,
.rating-trigger {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.rating-trigger {
  align-items: center;
  justify-content: flex-start;
}

.visibility-trigger svg,
.visibility-option svg,
.rating-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}

.rating-trigger svg {
  align-self: center;
  margin-top: 0;
}

.rating-trigger span {
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
}

.rating-trigger small {
  color: #a2abc8;
  font-size: 11px;
  line-height: 1.25;
}

.rating-trigger.mature {
  border-color: rgba(255,181,115,0.32);
  background: rgba(255,181,115,0.08);
}

.rating-trigger.safe {
  border-color: rgba(80, 220, 140, 0.26);
  background: rgba(80, 220, 140, 0.08);
}

.visibility-trigger > svg:last-child {
  transition: transform 160ms ease;
}

.visibility-picker.open .visibility-trigger > svg:last-child {
  transform: rotate(180deg);
}

.visibility-picker {
  position: relative;
  z-index: 1;
}

.visibility-picker.open {
  z-index: 1200;
}

.visibility-menu {
  position: absolute;
  z-index: 1201;
  left: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 40px));
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: #202127;
  box-shadow: 0 18px 44px rgba(0,0,0,0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 150ms ease, transform 150ms ease;
}

.visibility-picker.open .visibility-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.visibility-picker.closing .visibility-menu {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.visibility-option {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.visibility-option.active,
.visibility-option:hover {
  background: rgba(255,255,255,0.07);
}

.visibility-option span {
  display: grid;
  gap: 3px;
}

.visibility-option small {
  color: #a2abc8;
  font-size: 12px;
  line-height: 1.35;
}

.custom-picker-native {
  display: none !important;
}

.custom-select-picker {
  min-width: 180px;
}

.custom-select-trigger {
  min-width: 0;
}

.custom-select-trigger .visibility-trigger-main {
  min-width: 0;
  align-items: center;
}

.custom-select-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-menu {
  width: min(300px, calc(100vw - 40px));
}

.custom-select-menu.fixed-custom-select-menu {
  position: fixed;
  z-index: 20000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.custom-select-picker.align-right .custom-select-menu {
  left: auto;
  right: 0;
  transform-origin: top right;
}

.custom-select-menu .visibility-option {
  align-items: center;
}

#createView .premium-portrait-create-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: #15161b;
}

.create-premium-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.create-premium-head span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

#createView .premium-portrait-toggle {
  align-items: center;
  border-color: rgba(255,255,255,0.14);
  border-radius: 10px;
  background: #15161b;
}

#createView .premium-portrait-toggle strong {
  color: var(--text);
}

#createView .premium-portrait-effect-field {
  gap: 7px;
}

#createView .premium-effect-picker {
  max-width: 100%;
}

#createView .premium-effect-trigger {
  justify-content: space-between;
}

#createView .premium-effect-trigger .visibility-trigger-main {
  align-items: center;
}

#createView .premium-effect-picker .visibility-menu {
  width: min(320px, calc(100vw - 40px));
}

.create-persona-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
}

.persona-action-card {
  appearance: none;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.persona-action-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.24);
  transform: translateY(-1px);
}

.persona-action-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  font-size: 18px;
  font-weight: 900;
}

.persona-action-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.persona-action-card span:last-child {
  display: grid;
  gap: 4px;
}

.persona-action-card small {
  color: #a2abc8;
  font-size: 11px;
  line-height: 1.3;
}

.create-save-actions {
  border-top: 0;
  padding-top: 0;
}

.settings-body {
  max-width: 760px;
  scroll-behavior: smooth;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-overview-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(139,124,246,0.12), rgba(26,195,189,0.06)),
    rgba(255,255,255,0.025);
  box-shadow: 0 16px 38px rgba(0,0,0,0.18);
  animation: settingsPanelEnter 0.44s ease both;
}

.settings-overview-card:nth-child(2) { animation-delay: 0.04s; }
.settings-overview-card:nth-child(3) { animation-delay: 0.08s; }

.settings-overview-kicker {
  color: #72e0dc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-overview-card strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.settings-overview-card p {
  margin: 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
}

#settingsView .panel {
  animation: settingsPanelEnter 0.42s ease both;
  transform-origin: top center;
}

#settingsView .panel:nth-of-type(2) { animation-delay: 0.05s; }
#settingsView .panel:nth-of-type(3) { animation-delay: 0.08s; }
#settingsView .panel:nth-of-type(4) { animation-delay: 0.11s; }
#settingsView .panel:nth-of-type(5) { animation-delay: 0.14s; }
#settingsView .panel:nth-of-type(6) { animation-delay: 0.17s; }
#settingsView .panel:nth-of-type(7) { animation-delay: 0.2s; }
#settingsView .panel:nth-of-type(8) { animation-delay: 0.23s; }

@media (hover: hover) and (pointer: fine) {
  #settingsView .panel {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }

  #settingsView .panel:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 18px 44px rgba(0,0,0,0.18);
  }

  #settingsView .account-danger-panel:hover {
    border-color: rgba(224,85,85,0.48);
  }
}

@keyframes settingsPanelEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.avatar-row { display: flex; align-items: center; gap: 20px; }
.big-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--border);
  font-size: 36px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.avatar-edit-target {
  position: relative;
  cursor: pointer;
}
.avatar-edit-target::after {
  content: var(--i18n-crop, 'Crop');
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.emoji-opt:hover { background: var(--card-h); border-color: var(--border2); }
.emoji-opt.selected { border-color: var(--accent); background: rgba(139,124,246,0.15); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.6px; }
.form-group input, .form-group textarea, .form-group select {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-family: inherit; font-size: 14px;
  padding: 10px 12px; outline: none; resize: vertical;
  transition: border-color 0.15s;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 132, 168, 0.82) transparent;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--border2); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--sub); }
.form-group select { appearance: none; }
.birthdate-select-picker {
  display: grid;
  grid-template-columns: 1.15fr .75fr .85fr;
  gap: 8px;
}
.birthdate-select-picker select {
  min-width: 0;
}
.custom-birthdate-picker {
  display: grid;
  grid-template-columns: 1.2fr .8fr .9fr;
  gap: 8px;
  width: 100%;
}
.custom-picker-field {
  position: relative;
  min-width: 0;
}
.custom-picker-trigger {
  width: 100%;
  min-width: 0;
  padding: 12px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #171821;
  color: #f4f5ff;
  outline: none;
  font: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.custom-picker-trigger:hover,
.custom-picker-trigger[aria-expanded="true"] {
  border-color: var(--border2);
}
.custom-picker-trigger:focus-visible {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgba(139,124,246,.16);
}
.custom-picker-chevron {
  opacity: .7;
  font-weight: 900;
}
.custom-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.18);
  background: #171821;
  box-shadow: 0 18px 42px rgba(0,0,0,0.52);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.custom-picker-menu::-webkit-scrollbar { display: none; }
.custom-picker-menu.hidden { display: none; }
.custom-picker-option {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.035);
  color: #f4f5ff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

select,
select option,
.form-group select option {
  background: #171821;
  color: #f4f5ff;
}
.custom-picker-option:hover,
.custom-picker-option.selected {
  background: linear-gradient(135deg, rgba(123,104,238,.92), rgba(168,85,247,.78));
  color: #fff;
}
@media (max-width: 520px) {
  .birthdate-select-picker,
  .custom-birthdate-picker {
    grid-template-columns: 1fr;
  }
}
.form-group textarea::-webkit-scrollbar,
.form-group select::-webkit-scrollbar,
#conversationSummaryInput::-webkit-scrollbar,
#msgInput::-webkit-scrollbar,
#detailReviewComment::-webkit-scrollbar,
#messageEditorInput::-webkit-scrollbar {
  width: 10px;
}
.form-group textarea::-webkit-scrollbar-track,
.form-group select::-webkit-scrollbar-track,
#conversationSummaryInput::-webkit-scrollbar-track,
#msgInput::-webkit-scrollbar-track,
#detailReviewComment::-webkit-scrollbar-track,
#messageEditorInput::-webkit-scrollbar-track {
  background: transparent;
}
.form-group textarea::-webkit-scrollbar-thumb,
.form-group select::-webkit-scrollbar-thumb,
#conversationSummaryInput::-webkit-scrollbar-thumb,
#msgInput::-webkit-scrollbar-thumb,
#detailReviewComment::-webkit-scrollbar-thumb,
#messageEditorInput::-webkit-scrollbar-thumb {
  background: rgba(50, 50, 62, 0.92);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.form-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.form-label { font-size: 14px; font-weight: 500; }

.toggle { cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  display: block; width: 42px; height: 24px;
  background: var(--border2); border-radius: 12px;
  position: relative; transition: background 0.2s;
}
.toggle-track::after {
  content: ''; position: absolute;
  top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { left: 21px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.btn-save {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 10px 22px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.btn-save:hover { background: var(--accent-d); }
.btn-delete {
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--r-sm);
  padding: 10px 18px; font-family: inherit; font-size: 14px;
  cursor: pointer; transition: background 0.15s;
}
.btn-delete:hover { background: rgba(224,85,85,0.1); }
.account-danger-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(224,85,85,0.36);
  background:
    linear-gradient(135deg, rgba(224,85,85,0.1), rgba(255,255,255,0.018) 48%, rgba(26,195,189,0.035)),
    rgba(224,85,85,0.035);
}
.account-danger-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(224,85,85,0.16);
  opacity: 0.8;
  animation: dangerZonePulse 3.4s ease-in-out infinite;
}
.danger-zone-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.danger-zone-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(224,85,85,0.45);
  border-radius: 999px;
  background: rgba(224,85,85,0.1);
  color: #ffb1b1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.danger-zone-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(224,85,85,0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(224,85,85,0.12), transparent 52%),
    rgba(0,0,0,0.18);
}
.danger-zone-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  border: 1px solid rgba(224,85,85,0.42);
  background: rgba(224,85,85,0.14);
  color: #ffd0d0;
  font-weight: 950;
  font-size: 22px;
  box-shadow: 0 0 34px rgba(224,85,85,0.16);
}
.danger-zone-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}
.danger-zone-card p {
  margin: 0;
  color: rgba(255,205,205,0.78);
  font-size: 13px;
  line-height: 1.5;
}
.danger-zone-actions {
  padding-top: 0;
  align-items: center;
}
.danger-zone-details-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  color: rgba(255,225,225,0.86);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.danger-zone-details-link:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.075);
  transform: translateY(-1px);
}
.danger-zone-mobile-card {
  display: none;
}
@keyframes dangerZonePulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #settingsView .panel,
  .settings-overview-card,
  .account-danger-panel::before,
  .delete-account-warning-card,
  .delete-account-warning-mark {
    animation: none !important;
  }

  #settingsView .panel {
    transition: none !important;
  }
}

/* ── SHARED BUTTONS ── */
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: transparent; border: none; color: var(--sub);
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--card); color: var(--text); }
.text-btn { width: auto; padding: 0 10px; font-family: inherit; font-size: 13px; font-weight: 500; }

/* ── NEW IMAGE / ROLEPLAY FEATURES ── */
.avatar-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.avatar-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 7200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(10px);
}
.avatar-crop-modal.hidden { display: none; }
.avatar-crop-card {
  width: min(92vw, 760px);
  max-height: min(92vh, 860px);
  overflow: auto;
  background: #0c1730;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.48);
  padding: 22px;
}
.avatar-crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.avatar-crop-title {
  font-size: 20px;
  font-weight: 700;
}
.avatar-crop-subtitle {
  margin-top: 6px;
  color: rgba(255,255,255,0.74);
  line-height: 1.5;
}
.avatar-crop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 22px;
  margin-top: 18px;
}
.avatar-crop-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 280px;
  background:
    linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px),
    #050505;
  background-size: 33.333% 33.333%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  touch-action: none;
  user-select: none;
}
.avatar-crop-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  max-width: none;
  max-height: none;
  will-change: transform;
  pointer-events: none;
}
.avatar-crop-frame {
  position: absolute;
  border-radius: 0;
  border: 2px solid rgba(255,255,255,0.74);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.22);
  pointer-events: none;
  z-index: 2;
}
.avatar-crop-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  padding: 18px;
  text-align: center;
  background: rgba(5,5,5,0.74);
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 700;
}
.avatar-crop-modal.is-loading .avatar-crop-loading {
  display: grid;
}
.avatar-crop-modal.is-loading .avatar-crop-image,
.avatar-crop-modal.is-loading .avatar-crop-frame,
.avatar-crop-modal.is-loading .avatar-crop-preview-box img {
  opacity: 0;
}
.avatar-crop-preview {
  display: grid;
  gap: 12px;
  align-content: start;
}
.avatar-crop-preview-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}
.avatar-crop-preview-box {
  width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px),
    #050505;
  background-size: 33.333% 33.333%;
}
.avatar-crop-preview-box img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  max-width: none;
  max-height: none;
}
.avatar-crop-controls {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.avatar-crop-slider-row {
  display: grid;
  gap: 8px;
}
.avatar-crop-slider-row label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
}
.avatar-crop-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.mini-btn:hover {
  background: var(--card-h);
  border-color: var(--border2);
}

.mini-btn.ghost {
  background: transparent;
  color: var(--sub);
}

.mini-btn.tiny {
  padding: 6px 10px;
  font-size: 11px;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.big-avatar,
.chat-avatar,
.bot-card-avatar,
.msg-avatar {
  overflow: hidden;
}

.bot-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.bot-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emoji-picker-wrap {
  flex: 1;
  min-width: 230px;
}

.input-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  align-self: stretch;
}

.composer-shell .input-stack {
  min-width: 0;
}

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(8,8,12,0.34);
  max-width: 100%;
}

.attachment-preview img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.attachment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

#attachmentName {
  font-size: 12px;
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin-left: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
  color: rgba(226,226,238,0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}

.attach-btn:hover,
.attach-btn:focus-visible {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

.composer-tools-btn svg {
  stroke-linecap: round;
  pointer-events: none;
}

.composer-tools-modal {
  position: fixed;
  inset: 0;
  z-index: 2650;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4,5,8,0.46);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 180ms ease;
}

.composer-tools-modal.hidden {
  display: none;
}

.composer-tools-modal.is-opening,
.composer-tools-modal.is-closing {
  opacity: 0;
}

.composer-tools-modal.is-closing {
  pointer-events: none;
}

.composer-tools-card {
  width: min(390px, 100%);
  max-height: min(680px, calc(100vh - 34px));
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: #17171f;
  box-shadow: 0 18px 52px rgba(0,0,0,0.44);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 180ms ease,
    transform 180ms cubic-bezier(.22,.7,.18,1);
  will-change: opacity, transform;
}

.composer-tools-card::-webkit-scrollbar {
  display: none;
}

.composer-tools-card:focus {
  outline: none;
}

.composer-tools-modal.is-opening .composer-tools-card,
.composer-tools-modal.is-closing .composer-tools-card {
  opacity: 0;
  transform: translateY(14px) scale(0.97);
}

.composer-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 8px 16px;
}

.composer-tools-title {
  color: rgba(226,226,238,0.94);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
}

.composer-tools-close {
  width: 30px;
  height: 30px;
  color: rgba(226,226,238,0.62);
  background: transparent;
  border-color: transparent;
  font-size: 18px;
}

.composer-tools-body {
  display: grid;
  gap: 2px;
  padding: 4px 8px 10px;
}

.composer-tool-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.composer-tool-option:hover,
.composer-tool-option:focus-visible {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.055);
  outline: none;
}

.composer-tool-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  color: rgba(226,226,238,0.78);
}

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

.composer-tool-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-tool-copy strong {
  color: rgba(245,245,250,0.94);
  font-size: 13px;
  font-weight: 700;
}

.composer-tool-copy small {
  color: var(--sub);
  font-size: 11px;
  line-height: 1.3;
}

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

.composer-suggestion-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

.composer-suggestion-card span {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.composer-suggestion-card textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.16);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
  outline: none;
}

.composer-suggestion-card textarea:focus {
  border-color: rgba(139,124,246,0.55);
}

.composer-suggestion-card .mini-btn {
  justify-self: end;
}

.composer-suggestion-status,
.composer-suggestion-note {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}

.composer-suggestion-note {
  color: var(--text);
}

.composer-suggestion-loading-card {
  position: relative;
  overflow: hidden;
  pointer-events: none;
  cursor: progress;
}

.composer-suggestion-loading-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.045), transparent),
    linear-gradient(90deg, rgba(255,255,255,0.025), transparent 48%);
  transform: translateX(-100%);
  animation: discoverySkeletonSweep 1.45s ease-in-out infinite;
}

.composer-suggestion-message-preview {
  position: relative;
  justify-self: end;
  width: min(100%, 88%);
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--chat-bubble-border);
  border-radius: 16px 16px 4px 16px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035), rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
    var(--chat-bubble-bg);
  background-size: 220% 100%, auto;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  color: var(--chat-bubble-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.composer-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.28), rgba(255,255,255,0.10));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.composer-skeleton-line.wide {
  width: 100%;
}

.composer-skeleton-line.medium {
  width: 76%;
}

.composer-skeleton-line.short {
  width: 46%;
}

.composer-skeleton-button {
  position: relative;
  justify-self: end;
  width: 78px;
  height: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.20), rgba(255,255,255,0.08));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.composer-tools-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.msg {
  overflow: visible;
}

.bubble {
  overflow-wrap: anywhere;
}

.msg-image {
  display: block;
  width: 100%;
  max-width: 360px;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 10px;
  border: 1px solid var(--border2);
}

.rich-strong {
  color: #355b9f;
  font-weight: 700;
}

.rich-speech {
  color: var(--rp-speech-color);
  font-weight: 600;
  opacity: var(--rp-speech-alpha);
}

.rich-whisper {
  color: var(--rp-whisper-color);
  font-style: italic;
  opacity: var(--rp-whisper-alpha);
}

.rich-action {
  color: var(--rp-action-color);
  font-style: italic;
  font-weight: 500;
  opacity: var(--rp-action-alpha);
}

.rich-divider {
  display: block;
  width: 100%;
  height: var(--rp-divider-thickness-px);
  margin: 14px 0;
  border: 0;
  background: var(--rp-divider-color);
  opacity: var(--rp-divider-alpha);
}

.rich-emphasis {
  color: var(--rp-emphasis-color);
  font-weight: 700;
  opacity: var(--rp-emphasis-alpha);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 0.08em;
}

.rich-loud {
  color: var(--rp-loud-color);
  opacity: var(--rp-loud-alpha);
  font-weight: 800;
  text-transform: uppercase;
}

.rich-ooc {
  display: inline-block;
  color: var(--rp-ooc-color);
  opacity: var(--rp-ooc-alpha);
  font-size: 0.92em;
  font-style: italic;
}

.rich-quote {
  display: block;
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid var(--rp-quote-color);
  color: var(--rp-quote-color);
  opacity: var(--rp-quote-alpha);
  font-style: italic;
}

.rich-scene-command {
  display: inline-block;
  max-width: 100%;
  margin: 4px 0;
  padding: 3px 8px;
  border: 1px solid var(--rp-scene-color);
  color: var(--rp-scene-color);
  opacity: var(--rp-scene-alpha);
  border-radius: 999px;
  font-size: 0.82em;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.rich-scene-heading {
  display: inline-block;
  width: 100%;
  margin: 4px 0 3px;
  color: var(--rp-scene-color);
  opacity: var(--rp-scene-alpha);
  font-size: 1.05em;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.rich-text-heading {
  display: inline-block;
  width: 100%;
  margin: 2px 0;
  color: var(--text);
  font-weight: 900;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.rich-text-heading-large {
  font-size: 1.28em;
}

.rich-text-heading-medium {
  font-size: 1.12em;
}

.rich-text-heading-small {
  font-size: 1em;
  color: var(--muted);
}

.rich-phone-text {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  border: 1px solid var(--rp-quote-color);
  border-radius: 12px;
  color: var(--rp-quote-color);
  opacity: var(--rp-quote-alpha);
  font-family: var(--font-chat);
  font-size: 0.94em;
}

.rich-transition {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--rp-transition-color);
  opacity: var(--rp-transition-alpha);
  font-size: 0.78em;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rich-transition::before,
.rich-transition::after {
  content: '';
  height: var(--rp-divider-thickness-px);
  background: currentColor;
  opacity: 0.55;
}


/* ── UPDATED PROFILE + SETTINGS ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow-x: clip;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.panel-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.first-message-variants {
  display: grid;
  gap: 10px;
}

.first-message-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.first-message-variant-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.first-message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 0;
}

.first-message-actions #addFirstMessageVariantBtn {
  flex: 0 1 auto;
  width: auto;
}

.create-rich-text-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 0;
}

.create-rich-text-actions .icon-tool-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.create-text-preview {
  min-height: 72px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  font-size: var(--chat-text-size);
  line-height: 1.55;
}

.create-text-preview.hidden {
  display: none;
}

.create-text-preview:empty::before {
  content: var(--i18n-nothing-to-preview-yet, 'Nothing to preview yet.');
  color: var(--sub);
}

.create-preview-empty {
  color: var(--sub);
}

.detail-first-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-greeting-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}

.detail-greeting-controls .icon-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.detail-greeting-controls.hidden {
  display: none;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.ai-provider-fields {
  display: grid;
  gap: 10px;
}

.ai-provider-inner-grid {
  width: 100%;
}

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

.roleplay-style-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
}

.roleplay-style-panel.hidden {
  display: none;
}

.roleplay-style-nav {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.14);
  border-radius: 12px;
}

.roleplay-style-nav-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--sub);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.roleplay-style-nav-btn.active,
.roleplay-style-nav-btn:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.roleplay-style-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  gap: 14px;
  min-width: 0;
}

.roleplay-style-grid {
  display: grid;
  gap: 8px;
}

.roleplay-style-row {
  display: none;
  grid-template-columns: minmax(0, 1fr) 42px minmax(90px, 150px) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.025);
  border-radius: 12px;
}

.roleplay-style-row.active {
  display: grid;
}

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

.roleplay-style-row strong {
  font-size: 12px;
}

.roleplay-style-row small {
  margin-top: 2px;
  color: var(--sub);
  font-size: 11px;
}

.roleplay-style-row input[type="color"] {
  width: 38px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: transparent;
}

.roleplay-style-row input[type="range"] {
  width: 100%;
}

.roleplay-divider-thickness {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr);
}

.roleplay-divider-thickness input {
  grid-column: 2;
}

.roleplay-preview-wrap {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
}

.roleplay-style-note {
  grid-column: 2 / 4;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}

.roleplay-format-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: rgba(232,233,241,0.78);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.roleplay-format-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.roleplay-format-toggle:has(input:not(:checked)) {
  color: rgba(255,165,165,0.9);
  border-color: rgba(255,120,120,0.28);
  background: rgba(255,80,80,0.08);
}

.roleplay-preview-label {
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.roleplay-preview-bubble {
  background: var(--bot-bubble-bg);
  border: 1px solid var(--bot-bubble-border);
  color: var(--bot-bubble-text);
}

.developer-tools-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.developer-tools-bar .search-field {
  flex: 1;
  min-width: 0;
}

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

.developer-bot-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: 8px;
}

.developer-bot-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.developer-bot-meta {
  margin-top: 4px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}

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

.profile-actions {
  justify-content: flex-end;
  padding-top: 0;
}

.btn-save.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-save.secondary:hover {
  background: var(--card-h);
  border-color: var(--border2);
}

#chatView, #createView, #homeView {
  min-height: 0;
}

#homeView,
#createView,
.create-body,
.credits-page,
#historyView,
#chatStyleView,
#userPersonaView,
#conversationMemoryView,
.history-body {
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

#homeView::-webkit-scrollbar,
#createView::-webkit-scrollbar,
.create-body::-webkit-scrollbar,
.credits-page::-webkit-scrollbar,
#historyView::-webkit-scrollbar,
#chatStyleView::-webkit-scrollbar,
#userPersonaView::-webkit-scrollbar,
#conversationMemoryView::-webkit-scrollbar,
.history-body::-webkit-scrollbar {
  width: 10px;
}

#homeView {
  scrollbar-width: none;
}

#homeView::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#homeView::-webkit-scrollbar-track,
#createView::-webkit-scrollbar-track,
.create-body::-webkit-scrollbar-track,
.credits-page::-webkit-scrollbar-track,
#historyView::-webkit-scrollbar-track,
#userPersonaView::-webkit-scrollbar-track,
.history-body::-webkit-scrollbar-track {
  background: transparent;
}

#homeView::-webkit-scrollbar-thumb,
#createView::-webkit-scrollbar-thumb,
.create-body::-webkit-scrollbar-thumb,
.credits-page::-webkit-scrollbar-thumb,
#historyView::-webkit-scrollbar-thumb,
#userPersonaView::-webkit-scrollbar-thumb,
.history-body::-webkit-scrollbar-thumb {
  background: rgba(50, 50, 62, 0.92);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#chatView {
  overflow: hidden;
}

#chatView .messages,
#chatView .msg,
#chatView .bubble,
#chatView .msg-meta,
#chatView .msg-reaction-summary {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#chatView #msgInput {
  -webkit-user-select: text;
  user-select: text;
}

@media (hover: none), (pointer: coarse) {
  #chatView #messages,
  #chatView #messages *,
  #chatView .messages,
  #chatView .messages *,
  #chatView .msg,
  #chatView .msg *,
  #chatView .bubble,
  #chatView .bubble * {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
  }

  #chatView #msgInput {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: none !important;
  }
}

body.native-app-shell #chatView #messages,
body.native-app-shell #chatView #messages *,
body.native-app-shell #chatView .messages,
body.native-app-shell #chatView .messages *,
body.capacitor-app #chatView #messages,
body.capacitor-app #chatView #messages *,
body.capacitor-app #chatView .messages,
body.capacitor-app #chatView .messages * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

body.native-app-shell #chatView #msgInput,
body.capacitor-app #chatView #msgInput {
  -webkit-user-select: text !important;
  user-select: text !important;
}

#chatView .messages {
  overscroll-behavior: contain;
  padding-right: 14px;
}

.chat-desc {
  font-size: 12px;
  color: var(--sub);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble {
  word-break: break-word;
}

.rich-strong {
  color: #5d7fbf;
  font-weight: 700;
}

.rich-speech {
  color: var(--rp-speech-color);
  font-weight: 600;
  opacity: var(--rp-speech-alpha);
}

.rich-whisper {
  color: var(--rp-whisper-color);
  font-style: italic;
  opacity: var(--rp-whisper-alpha);
}

.rich-action {
  color: var(--rp-action-color);
  font-style: italic;
  font-weight: 500;
  opacity: var(--rp-action-alpha);
}


/* ── Updated layout and message controls ───────────────── */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.settings-guide-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  background: rgba(255,255,255,0.015);
}

.form-section-heading {
  margin-top: 4px;
  color: rgba(255,255,255,0.86);
}

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

.chat-action-btn {
  padding: 0 10px;
  height: 30px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.stop-generating-btn {
  border-color: var(--danger);
  color: var(--danger);
}

.stop-generating-btn:hover {
  background: rgba(224, 85, 85, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
  position: relative;
  isolation: isolate;
  max-width: 100%;
}

.msg-meta {
  font-size: 11px;
  line-height: 1.2;
  color: var(--sub);
  opacity: 0.92;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.msg-controls {
  position: static;
  z-index: 35;
  left: auto;
  top: auto;
  display: flex;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  flex-wrap: nowrap;
  align-self: flex-start;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(46,46,54,0);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  max-height: 0;
  min-height: 0;
  transition: opacity 0.12s ease, visibility 0.12s ease, max-height 0.14s ease, padding 0.14s ease, border-color 0.12s ease, background 0.12s ease, transform 0.16s cubic-bezier(.2,.8,.2,1);
  transform: none;
}

.msg.user .msg-controls {
  left: auto;
  right: 2px;
  align-self: flex-end;
}

.msg-controls.is-anchored {
  position: fixed;
  left: var(--msg-actions-x, 50vw);
  top: var(--msg-actions-y, 50vh);
  right: auto;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 5000;
}

.msg.actions-visible .msg-controls,
.msg:focus-within .msg-controls,
.msg-controls:focus-within {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  max-height: 48px;
  min-height: 44px;
  padding: 4px;
  border-color: rgba(255,255,255,0.14);
  background: rgba(46,46,54,0.88);
  box-shadow: 0 12px 26px rgba(0,0,0,0.24);
}

.msg .msg-controls.is-hiding {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translateY(6px);
  max-height: 48px;
  min-height: 44px;
  padding: 4px;
  border-color: rgba(255,255,255,0.12);
  background: rgba(46,46,54,0.42);
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body.message-editor-open #messages .msg-controls,
body.message-actions-suppressed #messages .msg-controls {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: none !important;
  max-height: 0 !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-color: transparent !important;
  background: rgba(21,21,27,0) !important;
  box-shadow: none !important;
}

body.message-editor-open #messages .msg-body::before,
body.message-actions-suppressed #messages .msg-body::before {
  display: none !important;
}

body.message-actions-suppressed #messages {
  scroll-behavior: auto;
}

@media (hover: hover) and (pointer: fine) {
  .msg:hover .msg-controls {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    max-height: 48px;
    min-height: 44px;
    padding: 4px;
    border-color: rgba(255,255,255,0.14);
    background: rgba(46,46,54,0.88);
    box-shadow: 0 12px 26px rgba(0,0,0,0.24);
  }
}

.msg-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.88);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
  box-shadow: none;
}

.msg-action-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msg-action-label {
  display: none;
}

.msg-controls .msg-action-copy-btn {
  width: auto;
  min-width: 74px;
  flex-basis: auto;
  gap: 7px;
  padding: 0 13px;
}

.msg-controls .msg-action-copy-btn .msg-action-label {
  display: inline;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

body.native-app-shell #messages .bubble {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.msg.actions-visible .msg-controls.is-anchored,
.msg:focus-within .msg-controls.is-anchored,
.msg-controls.is-anchored:focus-within {
  transform: translate(-50%, calc(-100% - 12px));
}

.msg .msg-controls.is-hiding.is-anchored {
  transform: translate(-50%, calc(-100% + 6px));
}

@media (hover: hover) and (pointer: fine) {
  .msg:hover .msg-controls.is-anchored {
    transform: translate(-50%, calc(-100% - 12px));
  }
}

.msg-action-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.msg-action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.msg-action-btn.danger {
  color: rgba(255,255,255,0.82);
}

.msg-action-btn.danger:hover {
  color: #fff;
  border-color: rgba(224,85,85,0.48);
  background: rgba(224,85,85,0.18);
}

.msg-reaction-btn.selected {
  color: #f6d66f;
  border-color: rgba(246,214,111,0.42);
  background: rgba(246,214,111,0.12);
}

.msg-reaction-summary {
  display: inline-flex;
  align-self: flex-start;
  margin-top: -2px;
  padding: 3px 8px;
  border: 1px solid rgba(246,214,111,0.32);
  border-radius: 999px;
  background: rgba(18,18,24,0.92);
  color: #f6d66f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.msg.user .msg-reaction-summary {
  align-self: flex-end;
}

body.chat-subview-open #chatView .chat-menu,
body.chat-subview-open #chatView .chat-menu-btn {
  pointer-events: auto;
}

body.chat-subview-open #chatView .chat-menu button {
  pointer-events: none;
  opacity: 0.54;
}

.msg-highlighted .bubble {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 0 0 6px rgba(139,124,246,0.14);
}

.pinned-messages-panel {
  align-self: stretch;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

.pinned-messages-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
}

.pinned-messages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pinned-message-chip {
  display: grid;
  gap: 4px;
  min-width: min(280px, 100%);
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.pinned-message-chip:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}

.pinned-message-speaker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sub);
}

.pinned-message-copy {
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-memory-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(139,124,246,0.22);
  border-radius: 12px;
  background: rgba(139,124,246,0.07);
}

.pinned-memory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pinned-memory-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.pinned-memory-toggle svg {
  transition: transform 0.16s ease;
}

.pinned-memory-panel.is-collapsed .pinned-memory-toggle svg {
  transform: rotate(-90deg);
}

.pinned-memory-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.pinned-memory-subtitle {
  color: var(--sub);
  font-size: 11px;
  line-height: 1.35;
}

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

.pinned-memory-panel.is-collapsed .pinned-memory-list {
  display: none;
}

.pinned-memory-chip {
  appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.pinned-memory-chip:hover {
  border-color: rgba(139,124,246,0.36);
  background: rgba(255,255,255,0.07);
}

.msg-variant-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 2px 4px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.msg-variant-btn {
  border: none;
  background: transparent;
  color: var(--sub);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.msg-variant-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.msg-variant-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.msg-variant-count {
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  color: var(--sub);
}

.bubble {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.message-blank-line {
  display: block;
  height: 0.9em;
  line-height: 0;
  pointer-events: none;
}

.scene-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0;
  padding: 6px 10px;
  color: var(--sub);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.scene-divider span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}

.roleplay-break-message {
  width: min(100%, 680px);
  align-self: center;
  margin: 8px auto;
  padding: 0 10px;
}

.roleplay-break-message .rich-divider {
  margin: 10px 0;
}

.roleplay-break-message .rich-transition {
  margin: 10px 0;
}

.form-group input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
}

.messages {
  scroll-behavior: smooth;
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.message-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.message-modal.hidden {
  display: none;
}

.message-modal-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-modal-title {
  font-size: 16px;
  font-weight: 600;
}

#messageEditorInput {
  width: 100%;
  min-height: 160px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 12px;
  resize: vertical;
}

.message-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.credit-modal-copy {
  color: var(--sub);
  line-height: 1.55;
}

.install-reward-card {
  border: 1px solid rgba(255, 200, 88, 0.28);
  background:
    radial-gradient(circle at top left, rgba(255,197,77,0.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    var(--surface);
}

.install-reward-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.install-reward-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
}

.install-reward-kicker {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,210,120,0.34);
  background: rgba(255,210,120,0.12);
  color: #ffe39a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.update-reward-modal {
  z-index: 12600;
  background: rgba(5, 6, 12, .78);
  backdrop-filter: blur(12px);
}

.update-reward-card {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  padding: 0 22px 22px;
  align-items: center;
  text-align: center;
  border-radius: 24px;
  border: 1px solid rgba(255, 213, 96, .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)),
    #111117;
  box-shadow: 0 28px 88px rgba(0, 0, 0, .48);
}

.update-reward-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--sub);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.update-reward-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .1);
}

.update-reward-hero {
  width: calc(100% + 44px);
  height: 190px;
  margin: 0 -22px 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 14%, rgba(255, 210, 120, .24), transparent 34%),
    radial-gradient(circle at 20% 24%, rgba(236, 72, 153, .24), transparent 42%),
    radial-gradient(circle at 82% 20%, rgba(58, 211, 255, .2), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, 0));
}

.update-reward-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  opacity: .96;
  filter: saturate(.98) contrast(.98);
  mask-image: linear-gradient(180deg, #000 64%, transparent 100%);
}

.update-reward-icon {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px solid rgba(255, 222, 120, .32);
  background: rgba(255, 210, 94, .1);
  box-shadow: 0 18px 40px rgba(255, 197, 77, .14);
}

.update-reward-icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(255, 204, 77, .28));
}

.update-reward-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 120, .34);
  background: rgba(255, 210, 120, .14);
  color: #fff0b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.update-reward-title {
  font-size: 31px;
  line-height: 1.05;
  font-weight: 900;
}

.update-reward-copy {
  max-width: 38ch;
  color: rgba(238, 238, 248, .78);
}

.update-reward-share-copy {
  max-width: 39ch;
  color: rgba(238, 238, 248, .7);
  font-size: 13px;
  line-height: 1.48;
}

.update-reward-fixes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.update-reward-fixes span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .055);
  color: rgba(238, 238, 248, .78);
  font-size: 12px;
  font-weight: 700;
}

.update-reward-actions {
  width: 100%;
  justify-content: center;
}

.update-reward-actions .mini-btn {
  min-width: 190px;
  min-height: 46px;
}

.msg.user .msg-meta {
  justify-content: flex-end;
  text-align: right;
}

.chayt-plus-upsell-modal {
  z-index: 12500;
  background:
    linear-gradient(180deg, rgba(4,6,12,.78), rgba(4,6,12,.86));
  backdrop-filter: blur(10px);
}

.chayt-plus-upsell-card {
  width: min(520px, 100%);
  position: relative;
  padding: 24px;
  border-radius: 22px;
  border-color: rgba(255,212,91,.28);
  background:
    linear-gradient(145deg, rgba(255,212,91,.14), rgba(120,198,255,.08) 46%, rgba(255,255,255,.035)),
    var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,.52);
  overflow: hidden;
  animation: chaytPlusModalIn .26s ease both;
}

.chayt-plus-upsell-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.13) 44%, transparent 58%);
  transform: translateX(-130%);
  animation: generatorLightSweep 5.8s ease-in-out infinite;
}

.chayt-plus-upsell-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.72);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.chayt-plus-upsell-close svg {
  width: 20px;
  height: 20px;
}

.chayt-plus-upsell-close:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  transform: rotate(90deg);
}

.chayt-plus-upsell-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,212,91,.34);
  background: rgba(255,212,91,.12);
  color: #ffe79c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chayt-plus-upsell-title {
  margin-top: 4px;
  padding-right: 36px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.chayt-plus-upsell-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chayt-plus-upsell-balance div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.04);
}

.chayt-plus-upsell-balance span {
  color: rgba(235,235,248,.62);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.chayt-plus-upsell-balance strong {
  color: #ffd447;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.chayt-plus-upsell-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chayt-plus-upsell-benefits span {
  min-height: 74px;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.04);
  color: rgba(244,244,251,.88);
  line-height: 1.25;
  animation: chaytPlusBenefitIn .34s ease both;
}

.chayt-plus-upsell-benefits strong {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.chayt-plus-upsell-benefits small {
  color: rgba(235,235,248,.64);
  font-size: 11px;
  line-height: 1.3;
}

.chayt-plus-upsell-benefits span:nth-child(2) {
  animation-delay: .05s;
}

.chayt-plus-upsell-benefits span:nth-child(3) {
  animation-delay: .1s;
}

.chayt-plus-upsell-card .credit-modal-actions .mini-btn {
  min-height: 40px;
}

.chayt-plus-upsell-actions {
  display: grid;
  grid-template-columns: auto auto minmax(170px, 1fr) minmax(130px, auto);
  align-items: center;
}

.chayt-plus-upsell-modal.is-apk-reward-ready:not(.is-out-of-energy) .chayt-plus-upsell-actions {
  grid-template-columns: auto minmax(190px, 1fr) minmax(130px, auto);
}

.chayt-plus-upsell-ad-btn {
  border-color: rgba(255,255,255,.78) !important;
  background: #fff !important;
  color: #111119 !important;
  font-weight: 950;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .chayt-plus-upsell-card {
    width: min(430px, 100%);
    padding: 20px 14px 14px;
    border-radius: 18px;
  }

  .chayt-plus-upsell-title {
    font-size: 26px;
  }

  .chayt-plus-upsell-balance,
  .chayt-plus-upsell-benefits {
    grid-template-columns: 1fr;
  }

  .chayt-plus-upsell-benefits span {
    min-height: 0;
  }

  .chayt-plus-upsell-actions {
    grid-template-columns: 1fr;
  }

  .chayt-plus-upsell-actions .mini-btn {
    width: 100%;
  }
}

body.chayt-plus-launch-open {
  overflow: hidden;
}

.chayt-plus-launch-modal {
  position: fixed;
  inset: 0;
  z-index: 13080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(2, 3, 8, .92);
  backdrop-filter: blur(12px);
}

.chayt-plus-launch-modal.hidden {
  display: none;
}

.chayt-plus-launch-card {
  width: min(450px, 100%);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: auto;
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px 18px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: rgba(17, 17, 24, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .62);
  animation: chaytPlusModalIn .24s ease both;
}

.chayt-plus-launch-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.chayt-plus-launch-close svg {
  width: 21px;
  height: 21px;
}

.chayt-plus-launch-close:hover,
.chayt-plus-launch-close:focus-visible {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  outline: none;
}

.chayt-plus-launch-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 4px 46px 0;
  text-align: center;
}

.chayt-plus-launch-logo {
  color: #ffe698;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.chayt-plus-launch-logo span {
  color: #ffd447;
}

.chayt-plus-launch-card h2 {
  margin: 0;
  color: #fff;
  font-size: 27px;
  line-height: 1.08;
  letter-spacing: 0;
}

.chayt-plus-launch-brand p {
  margin: 0;
  color: rgba(235, 235, 248, .78);
  font-size: 13px;
  line-height: 1.45;
}

.chayt-plus-launch-plan-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chayt-plus-launch-plan {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.chayt-plus-launch-plan.selected {
  border-color: #ff454f;
  background: rgba(255, 69, 79, .07);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 79, .34);
}

.chayt-plus-launch-plan-name {
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.chayt-plus-launch-plan-subtitle {
  color: rgba(235, 235, 248, .68);
  font-size: 12px;
  font-weight: 800;
}

.chayt-plus-launch-plan-price {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 5px;
  color: #fff;
  font-size: 0;
}

.chayt-plus-launch-plan-price strong {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 950;
}

.chayt-plus-launch-old-price {
  color: rgba(235, 235, 248, .48);
  font-size: 14px;
  font-weight: 800;
  text-decoration: line-through;
}

.chayt-plus-launch-plan-price small {
  color: rgba(235, 235, 248, .68);
  font-size: 12px;
  font-weight: 800;
}

.chayt-plus-launch-energy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.chayt-plus-launch-energy-note span {
  grid-row: span 2;
  color: #ffd447;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.chayt-plus-launch-energy-note strong {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
}

.chayt-plus-launch-energy-note small {
  min-width: 0;
  color: rgba(235, 235, 248, .66);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.chayt-plus-launch-benefits {
  margin: 0;
  display: grid;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .035);
}

.chayt-plus-launch-benefit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 72px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(244, 244, 251, .9);
  font-size: 12px;
  line-height: 1.2;
}

.chayt-plus-launch-benefit-row:first-child {
  border-top: 0;
}

.chayt-plus-launch-benefit-row.header {
  min-height: 34px;
  background: rgba(255, 255, 255, .045);
  color: rgba(235, 235, 248, .7);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chayt-plus-launch-benefit-row > span {
  padding: 8px 10px;
}

.chayt-plus-launch-benefit-row > span:not(:first-child) {
  justify-self: center;
  padding-left: 0;
  padding-right: 0;
}

.chayt-plus-launch-benefit-name {
  min-width: 0;
  font-weight: 800;
}

.chayt-plus-launch-compare-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.chayt-plus-launch-compare-icon svg {
  width: 17px;
  height: 17px;
}

.chayt-plus-launch-compare-icon.included {
  background: rgba(255, 212, 71, .14);
  color: #ffd447;
}

.chayt-plus-launch-compare-icon.missing {
  background: rgba(255, 255, 255, .06);
  color: rgba(235, 235, 248, .42);
}

.chayt-plus-launch-benefit-empty {
  padding: 16px;
  color: rgba(235, 235, 248, .7);
  text-align: center;
}

.chayt-plus-launch-checkout {
  display: grid;
  gap: 10px;
}

.chayt-plus-launch-checkout .google-play-button-slot,
.chayt-plus-launch-checkout .paypal-button-slot {
  min-height: 0;
}

.chayt-plus-launch-checkout .google-play-billing-btn {
  width: 100%;
  min-height: 72px;
}

.chayt-plus-launch-fineprint {
  color: rgba(235, 235, 248, .62);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 560px) {
  .chayt-plus-launch-modal {
    align-items: center;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .chayt-plus-launch-card {
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    gap: 12px;
    padding: 20px 14px 14px;
    border-radius: 18px;
  }

  .chayt-plus-launch-card h2 {
    font-size: 24px;
  }

  .chayt-plus-launch-brand {
    padding-left: 38px;
    padding-right: 38px;
  }

  .chayt-plus-launch-plan {
    padding: 11px 9px;
  }

  .chayt-plus-launch-plan-price strong {
    font-size: 22px;
  }

  .chayt-plus-launch-benefit-row {
    grid-template-columns: minmax(0, 1fr) 48px 62px;
  }
}

.generator-loading-modal {
  z-index: 12600;
  background:
    radial-gradient(circle at 50% 18%, rgba(120,198,255,.18), transparent 34%),
    rgba(4,6,12,.84);
  backdrop-filter: blur(12px);
}

.generator-loading-card {
  width: min(500px, 100%);
  position: relative;
  padding: 26px;
  overflow: hidden;
  border-radius: 24px;
  border-color: rgba(120,198,255,.28);
  background:
    linear-gradient(145deg, rgba(120,198,255,.12), rgba(139,111,246,.12) 48%, rgba(255,255,255,.035)),
    var(--surface);
  box-shadow: 0 30px 90px rgba(0,0,0,.56);
  animation: generatorModalIn .28s ease both;
}

.generator-loading-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.14) 44%, transparent 58%);
  transform: translateX(-130%);
  animation: generatorLightSweep 4.8s ease-in-out infinite;
}

.generator-loading-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.72);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.generator-loading-close:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  transform: rotate(90deg);
}

.generator-loading-orbit {
  width: 86px;
  height: 86px;
  margin: 0 auto 16px;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(120,198,255,.2);
  background:
    radial-gradient(circle at center, rgba(120,198,255,.22), transparent 36%),
    rgba(255,255,255,.035);
  animation: generatorOrbitPulse 1.8s ease-in-out infinite;
}

.generator-loading-orbit span {
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  border: 2px solid transparent;
  border-top-color: rgba(120,198,255,.96);
  animation: spin 1.05s linear infinite;
}

.generator-loading-orbit span:nth-child(2) {
  inset: 22px;
  border-top-color: rgba(255,212,91,.92);
  animation-duration: 1.45s;
  animation-direction: reverse;
}

.generator-loading-orbit span:nth-child(3) {
  inset: 32px;
  border-top-color: rgba(174,143,255,.92);
  animation-duration: .86s;
}

.generator-loading-kicker {
  display: block;
  text-align: center;
  color: rgba(120,198,255,.95);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.generator-loading-title {
  margin-top: 6px;
  text-align: center;
  font-size: 25px;
  line-height: 1.12;
}

.generator-loading-copy {
  margin: 10px auto 0;
  max-width: 36ch;
  text-align: center;
}

.generator-loading-progress {
  height: 9px;
  margin-top: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.generator-loading-progress span {
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #78c6ff, #8b6ff6, #ffd45b);
  box-shadow: 0 0 24px rgba(120,198,255,.42);
  transition: width .36s ease;
}

.generator-loading-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.generator-loading-steps span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(232,233,241,.58);
  font-size: 12px;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.generator-loading-steps span.active,
.generator-loading-steps span.complete {
  border-color: rgba(120,198,255,.32);
  background: rgba(120,198,255,.11);
  color: #fff;
}

.generator-loading-steps span.active {
  transform: translateY(-1px);
}

.generator-loading-card.is-done {
  border-color: rgba(74,222,128,.34);
}

.generator-loading-card.is-done .generator-loading-progress span {
  background: linear-gradient(90deg, #78c6ff, #4ade80);
}

.generator-loading-card.is-error {
  border-color: rgba(255,107,107,.42);
}

.generator-loading-card.is-error .generator-loading-progress span {
  background: linear-gradient(90deg, #ff6b6b, #ffd45b);
}

.generator-loading-actions {
  margin-top: 18px;
}

@keyframes chaytPlusModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chaytPlusBenefitIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes generatorModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes generatorOrbitPulse {
  0%, 100% { transform: scale(.98); box-shadow: 0 0 0 rgba(120,198,255,0); }
  50% { transform: scale(1.02); box-shadow: 0 0 34px rgba(120,198,255,.2); }
}

@media (max-width: 960px) {
  .chat-actions {
    display: flex;
  }
  .msg-controls {
    position: absolute;
    top: 20px;
    left: 0;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(-100% + 8px));
    flex-wrap: nowrap;
    max-height: 48px;
    min-height: 44px;
    padding: 4px;
    max-width: min(calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), 300px);
    justify-content: center;
    background: rgba(46,46,54,0.88);
    border-color: rgba(255,255,255,0.14);
    border-radius: 999px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.16s ease, border-color 0.14s ease, background 0.14s ease;
  }

  .msg-controls.is-anchored {
    position: fixed;
    left: var(--msg-actions-x, 50vw);
    top: var(--msg-actions-y, 50vh);
    right: auto;
    z-index: 5000;
    width: max-content;
    max-width: min(calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)), 360px);
    transform: translate(-50%, calc(-100% - 10px));
  }

  .msg.actions-visible .msg-body::before {
    display: none;
  }

  .msg .msg-meta,
  .msg .bubble,
  .msg .msg-reaction-summary {
    position: relative;
    z-index: 1;
  }

  .msg.actions-visible .bubble {
    outline: 1px solid rgba(159,140,255,0.42);
    outline-offset: 3px;
    box-shadow: none;
  }

  .msg.actions-visible .msg-controls,
  .msg:focus-within .msg-controls,
  .msg-controls:focus-within {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-100%);
    max-height: 48px;
    min-height: 44px;
    padding: 4px;
    background: rgba(46,46,54,0.88);
    border-color: rgba(255,255,255,0.14);
  }

  .msg.actions-visible .msg-controls.is-anchored,
  .msg:focus-within .msg-controls.is-anchored,
  .msg-controls.is-anchored:focus-within {
    transform: translate(-50%, calc(-100% - 10px));
  }

  .msg .msg-controls.is-hiding {
    opacity: 0;
    visibility: visible;
    pointer-events: none;
    transform: translateY(calc(-100% + 8px));
    max-height: 48px;
    min-height: 44px;
    padding: 4px;
    border-color: rgba(255,255,255,0.12);
    background: rgba(46,46,54,0.42);
  }

  .msg .msg-controls.is-hiding.is-anchored {
    transform: translate(-50%, calc(-100% + 8px));
  }

  .msg.user .msg-controls {
    left: auto;
    right: 0;
  }

  .msg:hover .msg-controls {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(-100% + 8px));
  }

  .msg.actions-visible:hover .msg-controls,
  .msg:focus-within:hover .msg-controls {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-100%);
  }

  .msg.actions-visible:hover .msg-controls.is-anchored,
  .msg:focus-within:hover .msg-controls.is-anchored {
    transform: translate(-50%, calc(-100% - 10px));
  }

  .msg:hover .msg-controls.is-hiding,
  .msg.actions-visible:hover .msg-controls.is-hiding,
  .msg:focus-within:hover .msg-controls.is-hiding {
    opacity: 0;
    visibility: visible;
    pointer-events: none;
    transform: translateY(calc(-100% + 8px));
  }

  .msg:hover .msg-controls.is-hiding.is-anchored,
  .msg.actions-visible:hover .msg-controls.is-hiding.is-anchored,
  .msg:focus-within:hover .msg-controls.is-hiding.is-anchored {
    transform: translate(-50%, calc(-100% + 8px));
  }

  .msg-controls .msg-action-btn {
    width: 38px;
    height: 36px;
    flex-basis: 38px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,0.9);
  }

  .msg-controls .msg-action-copy-btn {
    width: auto;
    min-width: 74px;
    flex-basis: auto;
    gap: 7px;
    padding: 0 13px;
    background: rgba(255,255,255,0.1);
  }

  .msg-controls .msg-action-copy-btn .msg-action-label {
    display: inline;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
  }

  .msg-controls .msg-action-btn svg {
    width: 17px;
    height: 17px;
  }

  .msg .bubble {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }

  .profile-avatar-row,
  .avatar-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .media-explainer,
  .media-workspace,
  .profile-settings-guide,
  .roleplay-style-panel,
  .premium-portrait-modal-grid {
    grid-template-columns: 1fr;
  }
  .roleplay-style-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  .roleplay-style-nav-btn {
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
  }
  .roleplay-style-main {
    grid-template-columns: 1fr;
  }
  .roleplay-style-row {
    grid-template-columns: minmax(0, 1fr) 38px minmax(84px, 1fr);
  }
  .roleplay-format-toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .media-workspace-split {
    grid-template-columns: 1fr;
  }
  .media-sidebar {
    grid-template-columns: 1fr;
  }
  .form-grid.two-col,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .create-body,
  .settings-body {
    max-width: 100%;
    padding: 20px 18px 36px;
  }
  .panel {
    width: 100%;
    box-sizing: border-box;
  }
  .bot-card-image-item {
    grid-template-columns: 1fr;
  }
  .bot-card-image-actions {
    flex-wrap: wrap;
  }
  .bot-card-image-actions .mini-btn {
    flex: 1 1 130px;
  }
  .media-content-panel,
  .media-combined-panel {
    padding: 14px;
  }
  .premium-portrait-modal-card {
    padding: 18px;
    border-radius: 24px;
  }
  .premium-portrait-modal-title {
    font-size: 21px;
  }
}

.delete-account-warning-modal {
  position: fixed;
  inset: 0;
  z-index: 7600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 4, 10, 0.76);
  backdrop-filter: blur(14px);
}
.delete-account-warning-modal.hidden { display: none; }
.delete-account-warning-card {
  position: relative;
  width: min(94vw, 520px);
  max-height: min(92vh, 760px);
  overflow: auto;
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid rgba(224,85,85,0.36);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(224,85,85,0.2), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(26,195,189,0.12), transparent 32%),
    rgba(18,18,24,0.98);
  box-shadow: 0 30px 90px rgba(0,0,0,0.48);
  animation: deleteWarningEnter 0.24s ease both;
}
.delete-account-warning-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.delete-account-warning-mark {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(224,85,85,0.4);
  background: rgba(224,85,85,0.14);
  color: #ffb1b1;
  font-size: 28px;
  font-weight: 900;
  animation: deleteWarningBeat 1.8s ease-in-out infinite;
}
.delete-account-warning-kicker {
  color: #ffb1b1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.delete-account-warning-card h2 {
  margin: 8px 0 8px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.1;
}
.delete-account-warning-card p {
  margin: 0;
  color: var(--sub);
  line-height: 1.55;
}
.delete-account-warning-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 14px 14px 14px 32px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}
.delete-account-confirm-field {
  display: grid;
  gap: 8px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.delete-account-confirm-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(224,85,85,0.36);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
  color: var(--text);
  font: inherit;
  outline: none;
  text-transform: uppercase;
}
.delete-account-confirm-field input:focus {
  border-color: rgba(224,85,85,0.72);
  box-shadow: 0 0 0 3px rgba(224,85,85,0.12);
}
.delete-account-warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.delete-account-warning-actions .btn-delete:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@keyframes deleteWarningEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes deleteWarningBeat {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

.memory-panel {
  margin: 12px 0 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  display: grid;
  gap: 10px;
}

.memory-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  overflow: visible;
}

.memory-title {
  font-size: 0.98rem;
  font-weight: 600;
}

.memory-subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  opacity: 0.72;
}

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

.memory-actions .mini-btn {
  min-width: 0;
}

.memory-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  background: rgba(159,140,255,0.20);
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.memory-icon-btn::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: max-content;
  max-width: min(220px, calc(100vw - 32px));
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(14,14,20,0.96);
  color: rgba(255,255,255,0.92);
  box-shadow: 0 12px 26px rgba(0,0,0,0.34);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.memory-icon-btn:hover::after,
.memory-icon-btn:focus-visible::after,
.memory-icon-btn:active::after {
  opacity: 1;
  transform: translateY(0);
}

.memory-icon-btn.ghost {
  background: rgba(255,255,255,0.055);
}

.memory-icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(159,140,255,0.55);
  background: rgba(159,140,255,0.26);
}

.memory-icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.memory-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.memory-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}

.memory-model-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.78);
}

.memory-model-field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(8,10,18,0.68);
  color: inherit;
  padding: 11px 12px;
  outline: none;
}

.memory-model-field input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(8,10,18,0.68);
  color: inherit;
  padding: 10px 12px;
  outline: none;
}

.memory-model-field select:focus {
  border-color: rgba(255,255,255,0.22);
}

.memory-model-field input:focus {
  border-color: rgba(255,255,255,0.22);
}

.memory-model-help {
  min-height: 2.4em;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.62);
}

.model-help-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.model-help-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
}

.model-help-badge.badge-recommended {
  background: rgba(70, 192, 140, 0.18);
  border-color: rgba(70, 192, 140, 0.36);
  color: #aef3cf;
}

.model-help-badge.badge-fast {
  background: rgba(255, 184, 77, 0.16);
  border-color: rgba(255, 184, 77, 0.34);
  color: #ffd89a;
}

.model-help-badge.badge-disabled {
  background: rgba(180, 185, 195, 0.14);
  border-color: rgba(180, 185, 195, 0.28);
  color: #d7dbe3;
}

.model-help-badge.badge-provider-groq {
  background: rgba(58, 163, 255, 0.16);
  border-color: rgba(58, 163, 255, 0.34);
  color: #a8d5ff;
}

.model-help-badge.badge-provider-ollama {
  background: rgba(196, 156, 255, 0.14);
  border-color: rgba(196, 156, 255, 0.28);
  color: #dec4ff;
}

.model-help-badge.badge-provider-openai {
  background: rgba(102, 226, 195, 0.14);
  border-color: rgba(102, 226, 195, 0.28);
  color: #bff9ea;
}

.model-help-badge.badge-provider-gemini {
  background: rgba(255, 202, 110, 0.14);
  border-color: rgba(255, 202, 110, 0.28);
  color: #ffe3aa;
}

.model-help-badge.badge-provider-deepseek {
  background: rgba(94, 177, 255, 0.14);
  border-color: rgba(94, 177, 255, 0.28);
  color: #c1e2ff;
}

.model-help-badge.badge-provider-openrouter {
  background: rgba(255, 133, 196, 0.14);
  border-color: rgba(255, 133, 196, 0.28);
  color: #ffc3e2;
}

.model-help-badge.badge-provider-claude {
  background: rgba(255, 160, 112, 0.14);
  border-color: rgba(255, 160, 112, 0.28);
  color: #ffd3b4;
}

.model-help-badge.badge-provider-custom {
  background: rgba(166, 174, 255, 0.14);
  border-color: rgba(166, 174, 255, 0.28);
  color: #d5d9ff;
}

.model-help-badge.badge-sfw {
  background: rgba(97, 214, 140, 0.14);
  border-color: rgba(97, 214, 140, 0.28);
  color: #b6f4c7;
}

.model-help-badge.badge-nsfw {
  background: rgba(255, 99, 132, 0.14);
  border-color: rgba(255, 99, 132, 0.28);
  color: #ffb7c8;
}

.model-help-copy {
  color: inherit;
}

.model-picker {
  position: relative;
}

.model-picker-trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(8,10,18,0.72);
  color: inherit;
  padding: 12px 14px;
}

.model-picker-trigger-copy {
  min-width: 0;
  flex: 1;
}

.model-picker-trigger-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
}

.model-picker-trigger-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.62);
}

.model-picker-trigger-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.model-picker-trigger-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.model-picker-trigger-caret {
  font-size: 16px;
  color: rgba(255,255,255,0.72);
}

.model-picker-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 80;
  display: none;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at top right, rgba(58,163,255,0.10), transparent 34%),
    linear-gradient(180deg, rgba(19,22,35,0.98), rgba(10,12,20,0.98));
  box-shadow: 0 18px 40px rgba(0,0,0,0.36);
  padding: 12px;
}

.model-picker.open .model-picker-popover {
  display: block;
}

.model-picker-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.model-picker-search {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: inherit;
  padding: 10px 12px;
  outline: none;
}

.model-picker-search-btn,
.search-submit-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(218,229,255,0.92));
  color: #111827;
  font-weight: 800;
  padding: 9px 15px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  transition: transform .18s ease, box-shadow .18s ease;
}

.model-picker-search-btn:hover,
.search-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.24);
}

.model-picker-rating-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
}

.model-picker-current-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 10px;
}

.model-picker-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.model-picker-list::-webkit-scrollbar,
.ai-model-rating-list::-webkit-scrollbar,
#aiModelRatingComments::-webkit-scrollbar {
  width: 8px;
}

.model-picker-list::-webkit-scrollbar-thumb,
.ai-model-rating-list::-webkit-scrollbar-thumb,
#aiModelRatingComments::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.model-picker-option {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: inherit;
  padding: 12px;
  margin-bottom: 8px;
}

.model-picker-option.selected {
  border-color: rgba(58,163,255,0.44);
  background: rgba(58,163,255,0.10);
}

.model-picker-option.disabled {
  opacity: 0.48;
  filter: grayscale(1);
  cursor: not-allowed;
  border-color: rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.018);
}

.model-picker-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-picker-option-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
}

.model-picker-selected-mark {
  font-size: 11px;
  font-weight: 700;
  color: #a8d5ff;
}

.model-picker-option-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.model-picker-option-desc {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.66);
}

.model-picker-rating {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ffd46b;
}

.model-picker-empty {
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.12);
  padding: 18px 14px;
  text-align: center;
  color: rgba(255,255,255,0.62);
  font-size: 13px;
}

.ai-model-rating-page {
  max-width: 1200px;
}

.ai-model-rating-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 28px;
}

.ai-model-rating-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255,212,107,0.14), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(74,153,255,0.1), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.ai-model-rating-toolbar-copy h2 {
  margin: 6px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.ai-model-rating-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd46b;
}

.ai-model-rating-actions {
  width: min(360px, 100%);
}

.ai-model-rating-actions input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(13,16,27,0.78);
  color: var(--text);
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

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

.ai-model-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at 100% 0%, rgba(255,212,107,0.08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(11,13,21,0.92);
  box-shadow: 0 20px 44px rgba(0,0,0,0.22);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ai-model-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,107,0.28);
  box-shadow: 0 26px 52px rgba(0,0,0,0.28);
}

.ai-model-card.featured {
  border-color: rgba(255,212,107,0.28);
}

.ai-model-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 18px;
}

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

.ai-model-card-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ai-model-card-id {
  margin-top: 4px;
  font-size: 12px;
  color: var(--sub);
  word-break: break-word;
}

.ai-model-card-score {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 13px;
  color: rgba(255,255,255,0.52);
}

.ai-model-card-score strong {
  font-size: 30px;
  font-weight: 800;
  color: #ffd46b;
  line-height: 1;
}

.ai-model-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.ai-model-card-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #ffd46b;
}

.ai-model-card-desc {
  margin-top: 10px;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  font-size: 13px;
}

.ai-model-rating-detail-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(58,163,255,0.14), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(255,212,107,0.08), transparent 28%),
    rgba(255,255,255,0.025);
}

.ai-model-rating-detail-head-top {
  display: flex;
  justify-content: flex-start;
}

.ai-model-rating-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.ai-model-rating-detail-meta h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
}

.ai-model-rating-hero-score {
  display: grid;
  gap: 6px;
  min-width: 150px;
  justify-items: end;
  text-align: right;
}

.ai-model-rating-hero-score span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

.ai-model-rating-hero-score strong {
  font-size: clamp(42px, 5vw, 58px);
  line-height: 0.95;
  color: #ffd46b;
}

.ai-model-rating-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.ai-model-rating-summary-card,
.ai-model-rating-form-card,
.ai-model-comments-card {
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.048), rgba(255,255,255,0.018)),
    rgba(12,14,22,0.92);
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.ai-model-rating-score-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-model-rating-stars-display,
.ai-model-star-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ai-model-star {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.24);
  font-size: 28px;
  line-height: 1;
  padding: 0;
}

.ai-model-star.active {
  color: #ffd46b;
}

.ai-model-rating-form-card textarea {
  width: 100%;
  margin-top: 14px;
  margin-bottom: 14px;
  min-height: 112px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8,10,18,0.82);
  color: inherit;
  padding: 12px 14px;
  resize: vertical;
}

.ai-model-comments-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

#aiModelRatingComments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 460px;
  overflow: auto;
}

.ai-model-comment {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.02)),
    rgba(8,10,17,0.78);
  padding: 16px;
}

.ai-model-comment-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.ai-model-comment-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ai-model-comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  flex: 0 0 auto;
}

.ai-model-comment-user strong {
  display: block;
  line-height: 1.2;
}

.ai-model-comment-user span {
  display: block;
  margin-top: 3px;
  color: rgba(168,173,203,0.72);
  font-size: 12px;
}

.ai-model-comment-stars {
  color: #ffd46b;
  white-space: nowrap;
}

.ai-model-comment-copy {
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
}

.ai-model-comment-date {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.52);
}

.ai-model-comments-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.ai-model-comments-pagination-left,
.ai-model-comments-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-model-comments-pagination-label,
.ai-model-comments-page-info {
  color: rgba(241,239,255,.76);
  font-size: 12px;
}

.ai-model-comments-page-size,
.ai-model-comments-page-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.ai-model-comments-page-btn {
  cursor: pointer;
}

.ai-model-comments-page-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

@media (max-width: 780px) {
  .memory-model-grid {
    grid-template-columns: 1fr;
  }

  .model-picker-topbar,
  .ai-model-rating-score-line {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-model-rating-toolbar,
  .ai-model-rating-detail-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-model-rating-detail-grid {
    grid-template-columns: 1fr;
  }

  .model-picker-trigger {
    flex-direction: column;
  }

  .model-picker-trigger-meta {
    align-items: flex-start;
  }

  .model-picker-popover {
    padding: 10px;
  }

  .ai-model-rating-grid {
    grid-template-columns: 1fr;
  }

  .ai-model-card-link,
  .ai-model-rating-summary-card,
  .ai-model-rating-form-card,
  .ai-model-comments-card {
    padding: 14px;
  }

  .ai-model-rating-detail-head,
  .ai-model-rating-toolbar {
    padding: 18px;
  }

  .ai-model-rating-hero-score {
    justify-items: start;
    text-align: left;
  }
}

#conversationSummaryInput {
  width: 100%;
  min-height: 110px;
  max-height: 190px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(8,10,18,0.60);
  color: inherit;
  padding: 12px 14px;
  line-height: 1.45;
  outline: none;
}

#conversationSummaryInput:focus {
  border-color: rgba(255,255,255,0.22);
}

#conversationSummaryInput:disabled {
  opacity: 0.7;
}


/* ── CLEANER REDESIGN OVERRIDES ───────────────────────── */
#sidebar {
  width: 260px;
  min-width: 260px;
  padding: 18px 14px 20px;
  background: linear-gradient(180deg, #121218 0%, #0f0f14 100%);
  border-right-color: rgba(255,255,255,0.08);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.sidebar-top {
  gap: 14px;
}

#sidebar .brand {
  padding-right: 42px;
}

.create-btn {
  min-height: 38px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(139,124,246,0.15) inset;
}

#sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

#sidebar .nav-item {
  background: transparent;
}

#sidebar .nav-item:hover {
  background: rgba(255,255,255,0.055);
}

#sidebar .nav-item.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.recents-section,
.recent-chats-page {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(68, 72, 88, 0.92) transparent;
}

.recents-section::-webkit-scrollbar,
.recent-chats-page::-webkit-scrollbar {
  width: 10px;
}

.recents-section::-webkit-scrollbar-track,
.recent-chats-page::-webkit-scrollbar-track {
  background: transparent;
}

.recents-section::-webkit-scrollbar-thumb,
.recent-chats-page::-webkit-scrollbar-thumb {
  background: rgba(50, 50, 62, 0.92);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#main {
  background:
    radial-gradient(1200px 700px at 50% 0%, rgba(139,124,246,0.08), transparent 40%),
    var(--bg);
}

.view {
  scrollbar-gutter: stable;
}

#homeView {
  padding: 28px 28px 56px;
  gap: 14px;
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 2px;
}

.home-hero h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.home-hero p {
  margin-top: 6px;
  color: var(--sub);
}

.discovery-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.discovery-search-open-btn,
.discovery-socials {
  display: inline-flex;
}

.discovery-search-open-btn {
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.discovery-search-open-label {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-discovery-search-clear-btn {
  display: none;
}

.discovery-search-open-btn:hover {
  background: rgba(255,255,255,0.085);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.discovery-socials {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.discovery-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.discovery-social-link:hover {
  background: rgba(255,255,255,0.085);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.discovery-social-link img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  display: block;
}

.discovery-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;
  min-width: 0;
  overflow-x: auto;
  min-height: 42px;
  padding: 4px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
  position: relative;
  --discovery-tab-indicator-x: 0px;
  --discovery-tab-indicator-width: 0px;
}

.discovery-tabs::-webkit-scrollbar {
  display: none;
}

.discovery-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--sub);
  height: 38px;
  padding: 0 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color .18s ease, border-color .18s ease;
}

.discovery-tab-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .86;
  transform: translateY(-.5px);
  transition: opacity .18s ease;
}

.discovery-tab-label {
  display: block;
  min-width: 0;
}

.discovery-tab.active {
  color: var(--text);
  border-bottom-color: rgba(255,255,255,0.94);
  animation: none;
}

.discovery-tab.active .discovery-tab-icon {
  opacity: 1;
}

.discovery-tabs.indicator-ready .discovery-tab.active {
  border-bottom-color: transparent;
}

.discovery-tab.active::after {
  content: none;
}

.discovery-tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--discovery-tab-indicator-width);
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--discovery-tab-indicator-x));
  transition: none;
  z-index: 0;
}

.discovery-tabs.indicator-ready .discovery-tab-indicator {
  transition:
    transform .32s cubic-bezier(.2,.8,.2,1),
    width .32s cubic-bezier(.2,.8,.2,1),
    opacity .14s ease;
}

.discovery-tab:hover {
  color: var(--text);
}

.discovery-tab:focus:not(:focus-visible) {
  outline: none;
}

.discovery-tab:focus-visible {
  outline: 2px solid rgba(139,124,246,0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

.ollama-discovery-notice {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.44);
  border-radius: 8px;
  background: #1d180d;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
}

.ollama-notice-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.38);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.ollama-notice-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.ollama-notice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ollama-notice-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.ollama-notice-copy p {
  margin: 0;
  color: rgba(232, 233, 241, 0.76);
  font-size: 12px;
  line-height: 1.45;
}

.ollama-notice-action {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.ollama-notice-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.ollama-notice-action:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.65);
  outline-offset: 2px;
}

.ollama-notice-close {
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: rgba(7, 7, 11, 0.32);
  color: rgba(255, 244, 210, 0.86);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.ollama-notice-close:hover {
  border-color: rgba(245, 158, 11, 0.52);
  background: rgba(245, 158, 11, 0.14);
  color: #fff7d7;
}

.ollama-notice-close:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.72);
  outline-offset: 2px;
}

body.whats-new-modal-open {
  overflow: hidden;
}

.whats-new-modal {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.whats-new-modal.hidden {
  display: none !important;
}

.whats-new-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(8px);
  cursor: default;
}

.whats-new-panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #17171c;
  color: #f7f4f8;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.whats-new-head,
.whats-new-footer,
.whats-new-model-heading {
  display: flex;
  align-items: center;
}

.whats-new-head {
  justify-content: space-between;
  gap: 18px;
}

.whats-new-kicker {
  margin-bottom: 5px;
  color: #f58bc3;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.whats-new-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.whats-new-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #24242b;
  color: #f7f4f8;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.whats-new-intro,
.whats-new-model-row p,
.whats-new-footer span {
  margin: 0;
  color: rgba(247, 244, 248, 0.72);
  line-height: 1.55;
}

.whats-new-intro {
  font-size: 14px;
}

.whats-new-model-list {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.whats-new-model-row {
  padding: 18px 0;
}

.whats-new-model-row + .whats-new-model-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.whats-new-model-heading {
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.whats-new-model-heading h3 {
  margin: 0 3px 0 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.whats-new-model-pill,
.whats-new-model-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.whats-new-model-pill {
  border: 1px solid rgba(75, 222, 176, 0.48);
  background: rgba(75, 222, 176, 0.12);
  color: #8cf2d2;
}

.whats-new-model-type {
  border: 1px solid rgba(245, 139, 195, 0.38);
  background: rgba(245, 139, 195, 0.1);
  color: #f7a8d1;
}

.whats-new-model-row p {
  font-size: 13px;
}

.whats-new-footer {
  justify-content: space-between;
  gap: 18px;
}

.whats-new-footer span {
  font-size: 12px;
}

.whats-new-done {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid #e23b94;
  border-radius: 8px;
  background: #e23b94;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.whats-new-close:focus-visible,
.whats-new-done:focus-visible {
  outline: 2px solid #f58bc3;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .whats-new-modal {
    place-items: end stretch;
    padding: 0;
  }

  .whats-new-panel {
    width: 100%;
    max-height: min(88dvh, 760px);
    gap: 14px;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
  }

  .whats-new-head h2 {
    font-size: 24px;
  }

  .whats-new-model-row {
    padding: 15px 0;
  }

  .whats-new-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .whats-new-done {
    width: 100%;
  }
}

.today-with-chayt {
  display: grid;
  gap: 8px;
  margin: 0 0 -12px;
}

#homeView .today-with-chayt,
#homeView .today-with-chayt *,
#homeView #featuredGrid,
#homeView #featuredGrid *,
#homeView #userGrid,
#homeView #userGrid * {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

#homeView .today-with-chayt img,
#homeView #featuredGrid img,
#homeView #userGrid img {
  -webkit-user-drag: none;
  user-select: none;
}

.today-chayt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.today-chayt-title {
  color: rgba(246,246,255,0.94);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.today-chayt-subtitle {
  color: rgba(154,158,192,0.9);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.today-chayt-shuffle {
  appearance: none;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  color: rgba(154,158,192,0.94);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.today-chayt-shuffle:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.today-chayt-shuffle:focus:not(:focus-visible) {
  outline: none;
}

.today-chayt-shuffle:focus-visible {
  outline: 2px solid rgba(139,124,246,0.75);
  outline-offset: 3px;
}

.today-chayt-shuffle svg {
  width: 17px;
  height: 17px;
}

.today-chayt-rail {
  display: flex;
  gap: 12px;
  margin: 0 -6px;
  padding: 0 6px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 6px;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.today-chayt-rail::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.today-chayt-card {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  flex: 0 0 clamp(380px, 38vw, 520px);
  min-width: 0;
  min-height: 124px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  touch-action: pan-x;
  user-select: none;
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease;
}

.today-chayt-card:hover {
  border-color: rgba(255,255,255,0.14);
  background: #15151c;
}

.today-chayt-rail.is-dragging .today-chayt-card {
  cursor: grabbing;
}

.today-chayt-card:focus:not(:focus-visible) {
  outline: none;
}

.today-chayt-card:focus-visible {
  outline: 2px solid rgba(139,124,246,0.75);
  outline-offset: 3px;
}

.today-chayt-card::after {
  content: none;
}

.today-chayt-card-media,
.today-chayt-card-blur-wrap {
  position: relative;
  z-index: 2;
  display: block;
  width: 116px;
  height: 104px;
  overflow: hidden;
  border-radius: 8px;
  background: #101018;
}

.today-chayt-card-media img,
.today-chayt-card-blur-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.today-chayt-card.energy .today-chayt-card-media {
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.035);
}

.today-chayt-card.energy .today-chayt-card-media img {
  width: 44%;
  height: 44%;
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,0.42));
}

.today-chayt-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 104px;
  padding: 0 8px 0 0;
}

.today-chayt-kicker {
  display: none;
}

.today-chayt-card-title {
  display: block;
  color: rgba(246,246,255,0.96);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.today-chayt-card-copy {
  display: -webkit-box;
  color: rgba(154,158,192,0.92);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.today-chayt-card-cta {
  color: rgba(180,170,255,0.94);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.today-chayt-skeleton-shuffle {
  opacity: .58;
  cursor: progress;
}

.today-chayt-skeleton-card {
  pointer-events: none;
  cursor: progress;
}

.today-chayt-skeleton-card::after {
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.045), transparent),
    linear-gradient(90deg, rgba(255,255,255,0.025), transparent 48%);
  transform: translateX(-100%);
  animation: discoverySkeletonSweep 1.45s ease-in-out infinite;
}

.today-chayt-card-media.today-chayt-skeleton-media,
.today-chayt-skeleton-card.energy .today-chayt-card-media.today-chayt-skeleton-media {
  background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.12), rgba(255,255,255,0.055));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.today-chayt-skeleton-body {
  gap: 8px;
}

.today-chayt-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.055), rgba(255,255,255,0.12), rgba(255,255,255,0.055));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.today-chayt-skeleton-line.title {
  width: 58%;
  height: 16px;
}

.today-chayt-skeleton-line.copy.wide {
  width: 86%;
}

.today-chayt-skeleton-line.copy {
  width: 66%;
}

.today-chayt-skeleton-line.cta {
  width: 38%;
  height: 11px;
}

@media (min-width: 961px) {
  #homeView .today-with-chayt {
    margin-bottom: 2px;
  }

  #homeView .today-chayt-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0 0 8px;
    overflow: visible;
  }

  #homeView .today-chayt-card {
    grid-template-columns: 92px minmax(0, 1fr);
    width: 100%;
    min-height: 108px;
    flex: initial;
  }

  #homeView .today-chayt-card-media,
  #homeView .today-chayt-card-blur-wrap {
    width: 92px;
    height: 96px;
  }

  #homeView .today-chayt-card-body {
    min-height: 96px;
  }
}

.memory-moment-modal {
  position: fixed;
  inset: 0;
  z-index: 6200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4,5,9,0.76);
  backdrop-filter: blur(16px);
}

.memory-moment-modal.hidden {
  display: none;
}

.memory-moment-card {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    #101018;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0,0,0,0.5);
}

.memory-moment-media {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  background: #15151c;
}

.memory-moment-media img,
.memory-moment-media .today-chayt-card-blur-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-moment-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.86));
}

.memory-moment-media-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 154px;
  padding: 16px;
}

.memory-moment-kicker {
  align-self: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.memory-moment-title {
  margin-top: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.memory-moment-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.memory-moment-label {
  display: grid;
  gap: 7px;
  color: rgba(235,238,255,0.9);
  font-size: 12px;
  font-weight: 850;
}

.memory-moment-text {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.28);
  color: #fff;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.memory-moment-text:focus {
  outline: 2px solid rgba(139,124,246,0.68);
  outline-offset: 2px;
}

.memory-moment-note {
  color: rgba(232,233,241,0.62);
  font-size: 12px;
  line-height: 1.4;
}

.memory-moment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.memory-moment-actions .mini-btn,
.memory-moment-actions .btn-save {
  min-height: 40px;
  border-radius: 10px;
}

.discovery-quick-tags {
  display: none !important;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0 8px;
  scroll-padding-inline: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.discovery-quick-tags::-webkit-scrollbar {
  height: 4px;
}

.discovery-quick-tags::-webkit-scrollbar-track {
  background: transparent;
}

.discovery-quick-tags::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.discovery-quick-tag {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--sub);
  height: 34px;
  min-width: max-content;
  padding: 0 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 34px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  animation: discoveryQuickTagIn .42s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--tag-index, 0) * 34ms);
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.discovery-quick-tag svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-right: 6px;
}

.discovery-quick-tag.safety-safe {
  color: #83f1aa;
  border-color: rgba(74, 222, 128, .32);
  background: rgba(34, 197, 94, .11);
}

.discovery-quick-tag.safety-mature {
  color: #ff9cac;
  border-color: rgba(248, 113, 113, .34);
  background: rgba(239, 68, 68, .11);
}

.discovery-quick-tag:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.075);
}

.discovery-quick-tag.active {
  color: #fff;
  border-color: rgba(139,124,246,0.65);
  background: linear-gradient(135deg, rgba(139,124,246,0.98), rgba(236,72,153,0.9));
  box-shadow: 0 10px 28px rgba(139,124,246,0.2);
  animation-name: discoveryQuickTagIn, discoveryActiveTagGlow;
  animation-duration: .42s, 2.2s;
  animation-timing-function: cubic-bezier(.2,.8,.2,1), ease-in-out;
  animation-delay: calc(var(--tag-index, 0) * 34ms), .45s;
  animation-fill-mode: forwards, none;
  animation-iteration-count: 1, infinite;
}

.discovery-quick-tag.safety-safe.active {
  color: #062314;
  border-color: rgba(134, 239, 172, .9);
  background: linear-gradient(135deg, #72e89d, #2fbb71);
  box-shadow: 0 10px 28px rgba(34, 197, 94, .2);
}

.discovery-quick-tag.safety-mature.active {
  color: #fff;
  border-color: rgba(255, 145, 161, .88);
  background: linear-gradient(135deg, #ef4444, #c81e4d);
  box-shadow: 0 10px 28px rgba(239, 68, 68, .22);
}

.discovery-filter-loader {
  position: relative;
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: height .18s ease, opacity .18s ease, transform .18s ease, margin .18s ease;
}

.discovery-filter-loader-bar {
  position: relative;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.discovery-filter-loader-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.92), transparent);
  transform: translateX(-120%);
}

body.is-discovery-filtering .discovery-filter-loader {
  display: grid;
  height: 26px;
  margin: 0 0 4px;
  opacity: 1;
  transform: translateY(0);
}

body.is-discovery-filtering .discovery-filter-loader-bar::before {
  animation: discoveryWhiteBarSweep .72s cubic-bezier(.4,0,.2,1) infinite;
}

body.is-discovery-filtering #featuredGrid {
  opacity: .58;
  filter: saturate(.86);
  transition: opacity .18s ease, filter .18s ease;
}

body.is-discovery-filtering .discovery-tab.active::after {
  content: none;
}

@keyframes discoveryTabLift {
  0% { transform: translateY(4px); opacity: .72; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes discoveryTabPulse {
  0%, 100% { opacity: .38; transform: translateX(-50%) scaleX(.72); }
  50% { opacity: .9; transform: translateX(-50%) scaleX(1.1); }
}

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

@keyframes discoveryActiveTagGlow {
  0%, 100% { box-shadow: 0 10px 28px rgba(139,124,246,0.2); }
  50% { box-shadow: 0 12px 34px rgba(236,72,153,0.28); }
}

@keyframes discoveryWhiteBarSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

@keyframes discoveryTabWhiteBar {
  0% { transform: translateX(-50%) scaleX(.45); opacity: .35; }
  50% { transform: translateX(-50%) scaleX(1.25); opacity: 1; }
  100% { transform: translateX(-50%) scaleX(.45); opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .discovery-tab,
  .discovery-tab.active,
  .discovery-tab.active::after,
  .discovery-quick-tag,
  .discovery-quick-tag.active,
  .discovery-filter-loader,
  .discovery-filter-loader-bar::before {
    animation: none !important;
    transition: none !important;
  }

  .discovery-quick-tag {
    opacity: 1;
    transform: none;
  }
}

.discovery-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: rgba(8,8,12,0.72);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 190ms ease, transform 190ms ease;
}

.discovery-search-overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#homeView #userSection.hidden + .bot-section .section-title,
#homeView #userSection.hidden + .bot-section .section-subtitle {
  display: none;
}

#homeView .public-marketplace-title,
#homeView .public-marketplace-subtitle {
  display: none !important;
}

.discovery-search-overlay.hidden {
  display: none;
}

.discovery-search-overlay.is-open {
  opacity: 1;
  transform: scale(1);
}

.discovery-search-overlay.is-closing {
  opacity: 0;
  transform: scale(0.985);
}

.discovery-search-page {
  width: min(920px, 100%);
  margin-top: 44px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: rgba(18,18,24,0.98);
  box-shadow: none;
  filter: none;
  overflow: hidden;
  min-height: min(760px, calc(100dvh - 88px));
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition: transform 210ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
}

.discovery-search-overlay.is-open .discovery-search-page {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.discovery-search-overlay.is-closing .discovery-search-page {
  transform: translateY(10px) scale(0.985);
  opacity: 0;
}

.discovery-search-page::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.discovery-search-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.discovery-search-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.discovery-search-field {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  border-radius: 999px;
  min-height: 50px;
}

.discovery-search-cancel-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(232,233,241,0.72);
  font: inherit;
  font-size: 17px;
  padding: 0;
  cursor: pointer;
}

.discovery-search-cancel-btn:hover {
  color: var(--text);
}

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

.discovery-search-filters select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(135deg, rgba(139,124,246,0.14), rgba(255,255,255,0.035)),
    linear-gradient(180deg, #181821, #101016);
  color: var(--text);
  padding: 0 38px 0 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(232,233,241,0.82) 50%),
    linear-gradient(135deg, rgba(232,233,241,0.82) 50%, transparent 50%),
    linear-gradient(135deg, rgba(139,124,246,0.14), rgba(255,255,255,0.035)),
    linear-gradient(180deg, #181821, #101016);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%,
    0 0,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%,
    100% 100%;
  background-repeat: no-repeat;
}

.discovery-search-filters select:hover,
.discovery-search-filters select:focus {
  border-color: rgba(139,124,246,0.52);
  box-shadow: none;
}

.discovery-search-filters select option,
.home-toolbar select option {
  background: #111119;
  color: #e8e9f1;
}

.discovery-search-filters select option:checked,
.home-toolbar select option:checked {
  background: #27213f;
  color: #ffffff;
}

.discovery-search-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.discovery-search-results {
  display: grid;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 0;
  min-height: 0;
}

.discovery-search-empty {
  padding: 24px 4px;
  color: var(--sub);
  font-size: 14px;
  text-align: center;
}

.discovery-search-loading-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(139,124,246,0.2);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(139,124,246,0.16), rgba(34,211,238,0.06)),
    rgba(255,255,255,0.035);
  box-shadow: none;
  filter: none;
}

.discovery-search-loading-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  animation: discoverySearchLogoPulse 1.25s ease-in-out infinite;
}

.discovery-search-loading-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.discovery-search-loading-copy strong {
  color: var(--text);
  font-size: 14px;
}

.discovery-search-loading-copy span {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}

.discovery-search-loading-bars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.discovery-search-loading-bars span {
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a78bfa, #22d3ee);
  animation: discoverySearchBarPulse .72s ease-in-out infinite;
}

.discovery-search-loading-bars span:nth-child(2) { animation-delay: .1s; }
.discovery-search-loading-bars span:nth-child(3) { animation-delay: .2s; }

@keyframes discoverySearchLogoPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.22); }
}

@keyframes discoverySearchBarPulse {
  0%, 100% { transform: scaleY(.55); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}

.discovery-search-skeleton-list {
  display: grid;
  gap: 12px;
}

.discovery-search-skeleton-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  overflow: hidden;
}

.discovery-search-skeleton-avatar,
.discovery-search-skeleton-copy i,
.discovery-search-skeleton-copy b,
.discovery-search-skeleton-copy em,
.discovery-search-skeleton-stat {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.15), rgba(255,255,255,0.06));
  background-size: 220% 100%;
  animation: discoverySearchSkeletonSweep 1.05s ease-in-out infinite;
}

.discovery-search-skeleton-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.discovery-search-skeleton-copy {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.discovery-search-skeleton-copy i {
  width: min(190px, 78%);
  height: 14px;
}

.discovery-search-skeleton-copy b {
  width: min(260px, 94%);
  height: 10px;
  opacity: .8;
}

.discovery-search-skeleton-copy em {
  width: min(150px, 54%);
  height: 9px;
  opacity: .68;
}

.discovery-search-skeleton-stat {
  width: 48px;
  height: 18px;
  justify-self: end;
  opacity: .72;
}

@keyframes discoverySearchSkeletonSweep {
  0% { background-position: 110% 0; }
  100% { background-position: -110% 0; }
}

@media (max-width: 760px) {
  .discovery-search-skeleton-card {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 76px;
  }

  .discovery-search-skeleton-avatar {
    width: 52px;
    height: 52px;
  }

  .discovery-search-skeleton-stat {
    display: none;
  }
}

.discovery-search-result-card {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  box-shadow: none;
  padding: 14px 0;
}

.discovery-search-result-card .bot-card-media {
  width: 112px;
  min-width: 112px;
  height: 148px;
  aspect-ratio: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.discovery-search-result-card .bot-card-body {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 0;
  padding: 0;
}

.discovery-search-result-card:hover {
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.08);
  transform: none;
}

.discovery-search-result-card .bot-card-top {
  display: block;
  margin-top: 0;
  min-height: 0;
  padding-inline: 0;
}

.discovery-search-result-card .bot-card-copy {
  gap: 5px;
}

.discovery-search-result-card .bot-card-name {
  font-size: 18px;
  line-height: 1.25;
}

.discovery-search-result-card .bot-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

.discovery-search-result-card .bot-card-badges {
  margin-top: 7px;
}

.discovery-search-result-card .bot-card-footer {
  display: flex;
  max-height: 56px;
  overflow: hidden;
  padding: 0;
}

.discovery-search-result-card .bot-card-meta {
  display: none;
}

.discovery-search-result-card .bot-actions-row,
.discovery-search-result-card .bot-card-meta::after,
.discovery-search-result-card .bot-card-created {
  display: none;
}

.discovery-search-simple-card {
  cursor: pointer;
}

.discovery-search-simple-image {
  width: 112px;
  min-width: 112px;
  height: 100%;
  min-height: 148px;
  align-self: stretch;
  border-radius: 12px;
  overflow: hidden;
  background: #101014;
  border: 1px solid rgba(255,255,255,0.08);
}

.discovery-search-simple-copy {
  min-width: 0;
  align-self: start;
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.discovery-search-simple-name {
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.22;
}

.discovery-search-simple-desc {
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discovery-search-simple-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 26px;
  overflow: hidden;
}

.discovery-search-simple-count {
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.discovery-search-simple-count svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.profile-interest-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.025);
}

.profile-interest-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.profile-interest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-interest-search {
  width: min(220px, 44vw);
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  outline: none;
}

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

.profile-interest-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.profile-interest-chip span::before {
  content: "#";
  color: var(--sub);
}

.profile-interest-chip strong {
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
}

.profile-interest-chip.active {
  border-color: rgba(139,124,246,0.58);
  background: rgba(139,124,246,0.18);
  color: #fff;
}

.profile-interest-chip.active::after {
  content: "selected";
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.install-promo {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255,200,88,0.32);
  background:
    radial-gradient(circle at top left, rgba(255,197,77,0.3), transparent 44%),
    radial-gradient(circle at bottom right, rgba(120,198,255,0.18), transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: 0 18px 42px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,200,88,0.08) inset;
}

.install-promo-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 16px 32px rgba(0,0,0,0.26);
}

.install-promo-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 36%;
}

.install-promo-copy {
  min-width: 0;
}

.install-promo-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd36f;
}

.install-promo-bonus {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,210,120,0.42);
  background: linear-gradient(135deg, rgba(255,210,120,0.24), rgba(255,164,86,0.14));
  color: #fff4c7;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 24px rgba(255,164,86,0.16);
}

.install-promo h2 {
  margin-top: 8px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.install-promo p {
  margin-top: 8px;
  max-width: 52ch;
  line-height: 1.6;
  color: rgba(226,226,238,0.82);
}

.install-promo p a {
  color: #73e0a9;
  font-weight: 700;
  text-decoration: none;
}

.install-promo p a:hover {
  text-decoration: underline;
}

.install-promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.install-promo-actions .btn-save,
.install-promo-actions .mini-btn {
  min-height: 44px;
}

.install-promo-actions .btn-save {
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(255,176,64,0.18);
}

.mobile-hero-create-btn {
  display: none;
  margin-top: 14px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(139,124,246,.28);
  cursor: pointer;
}

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

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 54vw);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.search-field svg { color: var(--sub); flex-shrink: 0; }

.search-field #homeSearch::-webkit-search-cancel-button,
.search-field #homeSearch::-webkit-search-decoration,
.search-field #discoverySearchInput::-webkit-search-cancel-button,
.search-field #discoverySearchInput::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.search-field input::placeholder {
  color: var(--sub);
}

.search-clear-btn {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(96,165,250,0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
  background: rgba(96,165,250,0.13);
  color: #7db8ff;
  outline: none;
}

.search-field.has-search-value .search-clear-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-toolbar select {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.support-ad-slot {
  display: none;
  width: 100%;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  box-sizing: border-box;
}

body.support-ads-ready .support-ad-slot.is-ad-active {
  display: block;
}

body.web-support-ads-disabled .support-ad-slot,
body:not(.support-ads-ready) .support-ad-slot {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

body.native-app-shell .support-ad-slot,
body.native-app-shell .support-ad-slot.is-ad-active {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.support-ad-label {
  padding: 7px 10px 0;
  color: rgba(226, 223, 235, 0.46);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.support-ad-slot .adsbygoogle {
  display: block;
  min-height: 64px;
}

.discovery-top-ad-slot {
  margin: -6px 0 10px;
}

.discovery-ad-slot {
  margin: 4px 0 8px;
}

.discovery-ad-slot .adsbygoogle {
  min-height: 90px;
}

.recent-top-ad-slot {
  margin: 0 0 14px;
  min-height: 74px;
}

.chat-open-ad-slot {
  flex: 0 0 auto;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(18,18,24,0.92);
}

.chat-open-ad-slot .support-ad-label {
  padding-left: 18px;
}

.discovery-support-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding: 14px 16px;
  border: 1px solid rgba(139, 124, 246, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 124, 246, 0.16), rgba(34, 197, 94, 0.08));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

#uBirthdateField {
  display: flex;
}

.discovery-support-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.discovery-support-kicker {
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.discovery-support-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.discovery-support-copy p {
  margin: 0;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}

.support-goal-inline {
  margin-top: 7px;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,212,107,.24);
  background: rgba(255,212,107,.1);
  color: #ffe7a3;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.discovery-support-mobile-copy {
  display: none;
}

.discovery-support-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.discovery-support-btn {
  min-width: 108px;
  justify-content: center;
}

@media (max-width: 700px) {
  .discovery-support-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 13px;
    min-height: auto;
    overflow: visible;
  }

  .discovery-support-title {
    font-size: 14px;
  }

  .discovery-support-copy p {
    font-size: 12px;
  }

  .discovery-support-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .discovery-support-btn {
    min-width: 0;
    width: 100%;
  }
}

.bot-section {
  gap: 12px;
}

#createView .panel-subtitle + .settings-grid {
  margin-top: 12px;
}

#createView .settings-grid + .panel-subtitle,
#createView .form-grid + .panel-subtitle {
  margin-top: 18px;
}

.bots-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.bot-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}

.bot-card-top {
  align-items: flex-start;
}

.bot-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 22px;
  background: rgba(255,255,255,0.04);
}

.bot-card-name {
  font-size: 16px;
}

.bot-card-desc {
  margin-top: 2px;
}

.bot-card-meta {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (min-width: 961px) {
  #homeView {
    padding: 30px 34px 64px;
    gap: 14px;
  }

  #homeView .home-hero {
    display: grid;
    grid-template-columns: minmax(320px, 0.78fr) minmax(620px, 1.22fr);
    align-items: start;
    gap: 28px;
    padding: 0 6px;
  }

  #homeView .mobile-home-topbar {
    display: block;
  }

  #homeView .discovery-title-row {
    gap: 10px;
    align-items: center;
  }

  #homeView .discovery-search-open-btn {
    display: none;
  }

  #homeView .discovery-socials {
    display: inline-flex;
    gap: 8px;
    flex-wrap: nowrap;
  }

  #homeView .discovery-social-link {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  #homeView .home-toolbar {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) repeat(4, max-content);
    align-items: start;
    gap: 10px;
    justify-content: end;
    justify-self: stretch;
    padding-top: 18px;
  }

  #homeView .search-field {
    min-width: 0;
    width: 100%;
    max-width: 560px;
    justify-self: end;
  }

  #homeView .home-toolbar select {
    min-width: 136px;
    max-width: 220px;
  }

  #homeView #homeSort {
    min-width: 220px;
  }

  #homeView .bot-section {
    gap: 14px;
    padding-inline: 6px;
  }

  #homeView .bots-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
  }

  #homeView .bot-card {
    border-radius: 8px;
  }
}

@media (min-width: 961px) and (max-width: 1499px) {
  #homeView .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #homeView .home-toolbar {
    display: flex;
    justify-content: flex-start;
    padding-top: 0;
  }

  #homeView .search-field {
    flex: 1 1 420px;
    max-width: none;
  }

  #homeView .bots-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (min-width: 1500px) and (max-width: 1720px) {
  #homeView .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #homeView .home-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 0;
  }

  #homeView .search-field {
    flex: 1 1 420px;
    max-width: none;
  }
}

.discovery-skeleton-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.discovery-skeleton-card {
  min-height: clamp(360px, 48vh, 520px);
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #1b1b1c;
  border: 1px solid rgba(255,255,255,0.025);
}
.discovery-skeleton-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.035), transparent),
    radial-gradient(circle at 28% 16%, rgba(255,255,255,0.03), transparent 34%);
  transform: translateX(-100%);
  animation: discoverySkeletonSweep 1.45s ease-in-out infinite;
}
.discovery-skeleton-lines {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  display: grid;
  gap: 8px;
}
.discovery-skeleton-lines span {
  width: 100%;
  height: 12px;
  border-radius: 4px;
  background: #2a2a2c;
}
.discovery-skeleton-lines span.wide {
  width: 66%;
}
@keyframes discoverySkeletonSweep {
  0% { transform: translateX(-100%); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

#chatView {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 26%), var(--bg);
}

.chat-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 12px 18px;
  background: rgba(18,18,24,0.86);
  backdrop-filter: blur(16px);
}

.chat-bot-info {
  justify-self: center;
  width: min(560px, 100%);
  min-width: 0;
}

.chat-meta {
  min-width: 0;
  text-align: left;
}

.chat-name {
  font-size: 16px;
}

.chat-desc {
  max-width: 60ch;
}

.chat-actions {
  gap: 8px;
}

.chat-action-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.messages {
  padding: 26px 22px 30px;
  gap: 18px;
}

.chat-character-intro {
  align-self: center;
  width: min(680px, 100%);
  margin: 2px auto 2px;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.chat-character-intro-media {
  width: min(420px, 78vw);
  min-height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chat-character-intro-blur-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.chat-character-intro-image {
  width: min(420px, 78vw);
  max-height: min(52vh, 520px);
  object-fit: contain;
  display: block;
}

.chat-character-intro-name {
  max-width: 100%;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.chat-character-intro-message {
  max-width: 620px;
  color: rgba(238, 241, 255, .88);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 560;
}

.chat-character-intro-message .message-image-link {
  margin-left: auto;
  margin-right: auto;
}

.chat-fiction-disclaimer {
  align-self: center;
  max-width: 680px;
  margin: 0 auto 8px;
  padding: 0 12px;
  color: rgba(226, 226, 238, .72);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.55;
  text-align: center;
}

.msg {
  max-width: 74%;
  gap: 10px;
}

.msg.user {
  margin-left: auto;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.bubble {
  border-radius: 18px;
  padding: 15px 17px;
}

.msg.user .bubble {
  border-bottom-right-radius: 6px;
  background: var(--chat-bubble-bg);
  color: var(--chat-bubble-text);
  border: 1px solid var(--chat-bubble-border);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.msg.assistant .bubble {
  border-bottom-left-radius: 6px;
  background: var(--bot-bubble-bg);
  color: var(--bot-bubble-text);
  border: 1px solid var(--bot-bubble-border);
}

.input-bar {
  padding: 14px 18px 18px;
  background: rgba(18,18,24,0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.composer-shell {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.09);
}

#msgInput {
  min-height: 44px;
  max-height: 220px;
  border-radius: 22px;
  background: transparent;
}

#sendBtn {
  border-radius: 999px;
}

.create-topbar {
  background: rgba(18,18,24,0.86);
  backdrop-filter: blur(16px);
}

.create-body {
  max-width: 1080px;
}

.panel {
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.big-avatar {
  width: 84px;
  height: 84px;
  border-radius: 22px;
}

.avatar-row,
.profile-avatar-row {
  align-items: flex-start;
}

.emoji-grid {
  max-width: 520px;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0a0d;
}

.splash-screen.hidden {
  display: none;
}

.splash-card {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 44vh;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.splash-logo {
  width: clamp(68px, 18vw, 92px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.34));
  animation: splashLogoSettle 1.7s ease-out both;
}

.splash-title {
  color: #fff;
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: none;
  animation: splashTextSettle 1.7s ease-out both;
}

.splash-trace {
  position: relative;
  width: min(96px, 28vw);
  height: 2px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.075);
  animation: splashTraceFade 1.7s ease-out both;
}

.splash-trace span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  border-radius: inherit;
  background: rgba(255,255,255,0.72);
  animation: splashTrace 1.18s ease-in-out infinite;
}

@keyframes splashLogoSettle {
  0% { opacity: 0; transform: translateY(8px) scale(.97); }
  55% { opacity: 1; transform: translateY(0) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes splashTextSettle {
  0% { opacity: 0; transform: translateY(6px); }
  45% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splashTraceFade {
  0%, 38% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes splashTrace {
  0% { transform: translateX(-120%); opacity: .25; }
  45% { opacity: 1; }
  100% { transform: translateX(300%); opacity: .25; }
}

@media (max-width: 1100px) {
  #sidebar {
    width: 230px;
    min-width: 230px;
  }

  .search-field {
    min-width: min(380px, 52vw);
  }
}

@media (max-width: 960px) {
  body {
    flex-direction: column;
  }

  #sidebar {
    display: none;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  #main {
    width: 100%;
    height: var(--app-height);
  }

  #userSection {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1800;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(66px + env(safe-area-inset-bottom, 0px));
    padding: 8px max(8px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(13,13,16,0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -14px 38px rgba(0,0,0,0.42);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .mobile-bottom-nav-item {
    min-width: 0;
    min-height: 50px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(226,226,238,0.64);
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .mobile-bottom-nav-item *,
  .mobile-bottom-nav-item::before,
  .mobile-bottom-nav-item::after {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .mobile-bottom-nav-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
  }

  .mobile-bottom-nav-item .mobile-energy-icon {
    width: 23px;
    height: 23px;
    filter: drop-shadow(0 0 8px rgba(69, 223, 255, .24));
  }

  .mobile-bottom-nav-item.active {
    color: #f4f4fb;
  }

  .mobile-bottom-nav-item.active::after {
    content: "";
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
  }

  .view {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  #chatView.active {
    padding-bottom: 0;
  }

  #homeView .bots-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  #homeView .bots-grid.discovery-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #homeView .discovery-skeleton-card {
    min-height: min(400px, 48vh);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.025);
    background: #1b1b1c;
  }

  #homeView .bot-card {
    min-height: 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    box-shadow: none;
    padding: 16px 0;
  }

  #homeView .bot-card:hover {
    background: transparent;
    border-color: rgba(255,255,255,0.06);
    transform: none;
  }

  #homeView .bot-card:last-child {
    border-bottom: 0;
  }

  #homeView .bot-card-top,
  #homeView .bot-card-meta,
  #homeView .bot-card-footer,
  #homeView .bot-actions-row {
    padding-inline: 0;
  }

  #homeView .bot-card-top {
    margin-top: 0;
    gap: 12px;
  }

  #homeView .bot-card-name {
    font-size: 18px;
  }

  #homeView .bot-card-desc,
  #homeView .bot-card-badges,
  #homeView .bot-card-meta-text {
    display: block;
  }

  #homeView .bot-card-desc {
    margin-top: 2px;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.5;
  }

  #homeView .bot-card-badges {
    margin-top: 4px;
    padding-bottom: 4px;
    overflow: visible;
  }

  #homeView .bot-card-meta {
    margin-top: 10px;
    align-items: flex-start;
  }

  #homeView .bot-card-meta::after {
    display: none;
  }

  #homeView .bot-card-actions {
    gap: 6px;
  }

  #homeView .bot-card-share-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
  }

  .mobile-profile-logout-btn {
    display: inline-flex;
  }

  #homeView {
    padding: 20px 16px calc(92px + env(safe-area-inset-bottom, 0px));
    gap: 24px;
  }

  .home-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .install-promo {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .install-promo-art {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .install-promo-actions {
    justify-content: flex-start;
  }

  .bot-card-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 22px;
  }

  .mobile-hero-create-btn {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .home-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  #homeSort {
    flex: 1 1 48%;
    min-width: 0;
  }

  .mobile-create-btn {
    display: none !important;
    align-items: center;
    justify-content: center;
    order: -1;
    flex: 1 1 100%;
    min-width: 0;
    height: 46px;
    border: 1px solid var(--border2);
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(139,124,246,.28);
  }

  .mobile-floating-create-btn {
    position: fixed;
    left: 50%;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1810;
    display: none;
    width: min(260px, calc(100vw - 104px));
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(185,175,255,0.45);
    border-radius: 12px;
    background: linear-gradient(135deg, #9b8cff, #7f6df1);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 0 22px rgba(139,124,246,0.5), 0 14px 34px rgba(0,0,0,0.42);
    cursor: pointer;
  }

  body:has(#homeView.active) .mobile-floating-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.is-chat-open .mobile-bottom-nav,
  body.is-chat-open .mobile-floating-create-btn,
  body.is-chat-open #profileDock,
  body:has(#chatView.active) .mobile-bottom-nav,
  body:has(#chatView.active) .mobile-floating-create-btn,
  body:has(#chatView.active) #profileDock,
  body:has(#historyView.active) .mobile-bottom-nav,
  body:has(#chatStyleView.active) .mobile-bottom-nav,
  body:has(#userPersonaView.active) .mobile-bottom-nav,
  body:has(#conversationMemoryView.active) .mobile-bottom-nav,
  body:has(#historyView.active) .mobile-floating-create-btn,
  body:has(#chatStyleView.active) .mobile-floating-create-btn,
  body:has(#userPersonaView.active) .mobile-floating-create-btn,
  body:has(#conversationMemoryView.active) .mobile-floating-create-btn,
  body.is-bot-detail-open .mobile-bottom-nav,
  body.is-bot-detail-open .mobile-floating-create-btn,
  body:has(#botDetailView.active) .mobile-bottom-nav,
  body:has(#botDetailView.active) .mobile-floating-create-btn {
    display: none;
  }

  #botDetailView {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .chat-actions {
    flex-wrap: wrap;
  }

  .messages {
    padding-left: max(16px, calc(16px + env(safe-area-inset-left, 0px)));
    padding-right: max(16px, calc(16px + env(safe-area-inset-right, 0px)));
    overflow-x: hidden;
  }

  .msg {
    max-width: min(88%, calc(100vw - 48px));
    min-width: 0;
  }

  .msg .bubble .message-inline-image,
  .message-inline-image {
    max-height: 460px;
  }

  .msg .bubble .message-image-link,
  .message-image-link {
    width: min(82vw, 320px);
  }

  .chat-character-intro {
    width: min(92vw, 520px);
    gap: 10px;
    padding-top: 2px;
  }

  .chat-character-intro-media,
  .chat-character-intro-image {
    width: min(82vw, 360px);
  }

  .chat-character-intro-image {
    max-height: min(46vh, 390px);
  }

  .chat-character-intro-name {
    font-size: 19px;
  }

  .chat-character-intro-message {
    max-width: 90vw;
    font-size: 13px;
  }

  .bubble {
    font-size: var(--chat-text-size);
    line-height: 1.68;
    font-weight: 560;
    max-width: 100%;
  }

  .chat-fiction-disclaimer {
    max-width: 92%;
    margin-top: 4px;
    font-size: 13px;
  }
}

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


.chat-actions {
  position: relative;
  margin-left: auto;
  z-index: 30;
  isolation: isolate;
}

.chat-menu-btn {
  position: relative;
  z-index: 2;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.chat-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 230px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(13,13,18,0.98);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
  z-index: 220;
  display: grid;
  gap: 4px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.1s ease, transform 0.1s ease;
  will-change: opacity, transform;
}

body.keyboard-open {
  background: var(--bg);
}

body.keyboard-open[data-current-view="chat"] #main,
body.keyboard-open[data-current-view="chat"] .view,
body.keyboard-open[data-current-view="chat"] #chatView {
  height: var(--app-height);
  max-height: var(--app-height);
}

body.keyboard-open[data-current-view="chat"] #chatView .messages {
  scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

body.keyboard-open .chat-topbar,
body.keyboard-open .input-bar,
body.native-app-shell.keyboard-open .create-topbar,
body.native-app-shell.keyboard-open .mobile-bottom-nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@keyframes chatMenuBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mobileSlideFromLeft {
  from { opacity: 0.92; transform: translateX(-18%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes mobileSlideFromRight {
  from { opacity: 0.96; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes mobileSlideToRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0.96; transform: translateX(100%); }
}

.chat-menu.hidden { display: none; }
.chat-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chat-menu.is-closing {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.chat-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.chat-menu button:hover {
  background: rgba(255,255,255,0.06);
}

.mobile-home-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-home-copy {
  min-width: 0;
}

.discovery-value-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.discovery-value-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: rgba(238,238,248,0.86);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-discovery-links {
  display: none;
}

.mobile-discovery-links-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub);
}

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

.mobile-discovery-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.mobile-discovery-social-link {
  gap: 0;
  padding: 0;
}
.mobile-discovery-social-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

#sidebarPatchNotesLink,
#mobilePatchNotesLink {
  position: relative;
}

#sidebarPatchNotesLink.has-update-dot::after,
#mobilePatchNotesLink.has-update-dot::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff4d5f;
  box-shadow: 0 0 0 2px rgba(13, 13, 16, 0.92);
}

.patch-notes-page {
  max-width: 980px;
}

.patch-notes-hero {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(139,124,246,0.16), transparent 34%),
    radial-gradient(circle at right center, rgba(120,198,255,0.10), transparent 36%),
    rgba(255,255,255,0.025);
}

.patch-notes-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7cdfd;
}

.patch-notes-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 0.96;
}

.patch-notes-hero p,
.patch-notes-note {
  color: rgba(232,233,241,.8);
  line-height: 1.6;
}

.patch-notes-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.patch-notes-list {
  display: grid;
  gap: 12px;
}

.patch-note-item {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.patch-note-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.patch-note-item h2 {
  margin: 0;
  font-size: 18px;
}

.patch-note-item p {
  margin: 0;
  color: rgba(232,233,241,.8);
  line-height: 1.6;
}

.patch-syntax-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.14);
  border-radius: 14px;
}

.patch-syntax-grid code {
  align-self: start;
  color: #d7cdfd;
  white-space: nowrap;
}

.patch-syntax-grid span {
  color: rgba(232,233,241,.78);
  font-size: 13px;
  line-height: 1.45;
}

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

.patch-syntax-item {
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.14);
  border-radius: 14px;
  overflow: hidden;
}

.patch-syntax-item summary {
  display: grid;
  grid-template-columns: minmax(108px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

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

.patch-syntax-item summary::after {
  content: '+';
  grid-column: 2;
  justify-self: end;
  color: var(--sub);
  font-weight: 900;
}

.patch-syntax-item[open] summary::after {
  content: '-';
}

.patch-syntax-item summary code {
  color: #d7cdfd;
  white-space: nowrap;
}

.patch-syntax-item summary span {
  padding-right: 22px;
  color: rgba(232,233,241,.78);
  font-size: 13px;
  line-height: 1.45;
}

.patch-syntax-example {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.patch-syntax-example > code {
  display: block;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.035);
  border-radius: 10px;
  color: #d7cdfd;
  white-space: normal;
}

.patch-chat-example {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
}

.patch-chat-label {
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.patch-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.patch-showcase-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.14);
}

.patch-showcase-label {
  color: #d7cdfd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patch-showcase-card p {
  margin: 0;
  color: rgba(232,233,241,.78);
  line-height: 1.5;
  font-size: 13px;
}

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

.patch-plus-mini div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
}

.patch-plus-mini div.featured {
  border-color: rgba(248,178,93,.34);
  background: rgba(248,178,93,.10);
}

.patch-plus-mini strong {
  font-size: 13px;
}

.patch-plus-mini span {
  font-size: 20px;
  font-weight: 900;
}

.patch-plus-mini small,
.patch-review-demo small {
  color: rgba(168,173,203,.82);
}

.patch-review-demo {
  display: grid;
  gap: 12px;
}

.patch-review-row,
.patch-reply-demo {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.patch-reply-demo {
  margin-left: 24px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.1);
}

.patch-avatar-dot {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, #42d392, #8b7cf6 55%, #f05aa6);
}

.patch-avatar-dot.small {
  width: 24px;
  height: 24px;
}

.patch-review-demo p {
  margin: 4px 0 0;
  color: rgba(232,233,241,.92);
  font-size: 13px;
  line-height: 1.4;
}

.patch-review-actions,
.patch-reply-like {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  color: rgba(232,233,241,.72);
  font-size: 12px;
}

.patch-discovery-demo {
  display: grid;
  gap: 10px;
}

.patch-tabs,
.patch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.patch-tabs span {
  padding-bottom: 5px;
  color: rgba(232,233,241,.62);
  font-weight: 800;
}

.patch-tabs span.active {
  color: #fff;
  border-bottom: 2px solid #fff;
}

.patch-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(232,233,241,.82);
  font-size: 12px;
  font-weight: 700;
}

.mobile-home-shortcuts {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.mobile-home-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 40px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.mobile-home-shortcut:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
}

.mobile-home-shortcut.ghost {
  background: transparent;
  color: var(--sub);
}

.recent-item {
  gap: 8px;
}

.recent-avatar-image {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.history-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(18,18,24,0.86);
  backdrop-filter: blur(16px);
}

.history-title {
  font-size: 16px;
  font-weight: 700;
}

.history-subtitle {
  margin-top: 3px;
  color: var(--sub);
  font-size: 12px;
}

.history-body {
  padding: 20px 22px 28px;
  display: grid;
  gap: 16px;
}

#historyView,
#chatStyleView,
#conversationMemoryView,
.credit-history-list,
.archive-modal-body {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

#historyView::-webkit-scrollbar,
#chatStyleView::-webkit-scrollbar,
#conversationMemoryView::-webkit-scrollbar,
.credit-history-list::-webkit-scrollbar,
.archive-modal-body::-webkit-scrollbar {
  width: 10px;
}

#historyView::-webkit-scrollbar-track,
#chatStyleView::-webkit-scrollbar-track,
#conversationMemoryView::-webkit-scrollbar-track,
.credit-history-list::-webkit-scrollbar-track,
.archive-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

#historyView::-webkit-scrollbar-thumb,
#chatStyleView::-webkit-scrollbar-thumb,
#conversationMemoryView::-webkit-scrollbar-thumb,
.credit-history-list::-webkit-scrollbar-thumb,
.archive-modal-body::-webkit-scrollbar-thumb {
  background: rgba(50, 50, 62, 0.92);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.history-card {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.history-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.history-card-avatar .recent-emoji {
  font-size: 22px;
}

.history-card-avatar .recent-avatar-image {
  width: 100%;
  height: 100%;
}

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

.history-card-title {
  font-size: 15px;
  font-weight: 700;
}

.history-card-subtitle {
  margin-top: 3px;
  color: var(--sub);
  font-size: 12px;
}

.history-card-sessions {
  display: grid;
  gap: 8px;
}

.history-session {
  text-align: left;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 8px;
}

.history-session:hover {
  background: rgba(255,255,255,0.05);
}

.history-session-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-session-select input {
  width: 16px;
  height: 16px;
}

.history-open-btn {
  white-space: nowrap;
}

.history-session-title {
  font-weight: 600;
  font-size: 13px;
}

.history-session-meta,
.history-session-preview {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}

.history-empty {
  color: var(--sub);
  padding: 22px 4px;
}

.chat-history-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

#yourCharactersView {
  padding: 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 83, 98, 0.9) rgba(255,255,255,0.02);
}

#yourCharactersView::-webkit-scrollbar {
  width: 10px;
}

#yourCharactersView::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 999px;
}

#yourCharactersView::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(110,113,132,0.95), rgba(47,49,61,0.95));
  border: 2px solid rgba(10,10,15,0.98);
  border-radius: 999px;
  background-clip: padding-box;
}

#yourCharactersView .create-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0;
  padding: 14px 20px;
  background: rgba(18,18,24,0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

#yourCharactersView .your-characters-page {
  gap: 16px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
}

#yourCharactersView .your-characters-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
}

#yourCharactersView .your-characters-hero::after {
  content: none;
}

#yourCharactersView .your-characters-hero h1 {
  font-size: clamp(28px, 4.6vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

#yourCharactersView .your-characters-hero p {
  margin-top: 10px;
  max-width: 560px;
  line-height: 1.55;
}

#yourCharactersView .your-characters-hero .btn-save {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(139,124,246,0.24);
}

#yourCharactersView .your-characters-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 22px;
  background: rgba(255,255,255,0.035);
}

#yourCharactersView .search-field {
  min-width: 0;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border-color: rgba(255,255,255,0.08);
  background: rgba(3,4,8,0.42);
}

#yourCharactersView .search-field input {
  height: 46px;
  font-size: 14px;
}

#yourCharactersView .mini-btn {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.08);
}

#yourCharactersView .mini-btn.danger {
  color: #ffd0d0;
  background: rgba(255,87,87,0.09);
  border-color: rgba(255,107,107,0.28);
}

#yourCharactersView .mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#yourCharactersStatus {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
}

.your-characters-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.your-characters-grid .history-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 22px;
  background: rgba(255,255,255,0.025);
  text-align: center;
}

.your-character-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    #111118;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 36px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.your-character-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.16);
}

.your-character-header {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-right: 28px;
}

.your-character-avatar {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 28px rgba(0,0,0,0.24);
}

.your-character-avatar .avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.your-character-copy {
  min-width: 0;
}

.your-character-copy h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.your-character-copy p {
  margin: 7px 0 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.your-character-stats {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.your-character-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: rgba(221,226,255,0.86);
  font-size: 11px;
  font-weight: 800;
}

.your-character-stat svg {
  width: 13px;
  height: 13px;
  color: rgba(154,170,255,0.95);
}

.your-character-stat-up svg {
  color: #ffd36b;
}

.your-character-stat-down svg {
  color: #ff9f9f;
}

.your-character-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 6px;
}

.your-character-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  max-width: 100%;
  min-height: 22px;
  height: auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.055);
  color: rgba(235,238,255,0.84);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.your-character-chip.danger {
  border-color: rgba(255,107,107,0.36);
  background: rgba(255,82,82,0.14);
  color: #ffc2c2;
}

.your-character-select {
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.32);
}

.your-character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}

.your-character-action-btn {
  flex: 1 1 42px;
  min-width: 42px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  color: rgba(235,238,255,0.88);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.your-character-action-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: block;
}

.your-character-action-btn.danger {
  color: #ffd0d0;
  background: rgba(255,87,87,0.09);
  border-color: rgba(255,107,107,0.28);
}

.brand-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(139,124,246,0.16), transparent 34%),
    rgba(4,5,8,0.76);
  backdrop-filter: blur(14px);
}

.brand-confirm-modal.hidden {
  display: none;
}

.brand-confirm-card {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.03)),
    #101018;
  box-shadow: 0 28px 90px rgba(0,0,0,0.48);
}

.brand-confirm-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 14px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.34);
}

#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card,
#aimodelratingView .ai-model-card,
#aimodelratingView .ai-model-comment,
#settingsView .profile-avatar-row-flat,
#settingsView .profile-settings-guide .settings-guide-card {
  border-radius: 0;
  box-shadow: none;
}

#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card,
#aimodelratingView .ai-model-card,
#aimodelratingView .ai-model-comment {
  background: rgba(255,255,255,0.02);
}

.brand-confirm-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-confirm-copy {
  margin-top: 8px;
  color: var(--sub);
  line-height: 1.55;
}

.brand-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.brand-confirm-actions .mini-btn {
  min-height: 42px;
  border-radius: 14px;
}

.brand-confirm-actions .danger {
  background: linear-gradient(135deg, #ffeded, #ff7777);
  border-color: rgba(255,255,255,0.16);
  color: #220506;
  font-weight: 800;
}

.report-modal-card {
  width: min(500px, 100%);
}

.report-modal-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.report-reason-option {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: rgba(244,244,251,0.9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.report-reason-option:has(input:checked) {
  border-color: rgba(139,124,246,0.55);
  background: rgba(139,124,246,0.16);
  color: #fff;
}

.report-reason-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.report-modal-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 800;
}

.report-modal-textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(8,9,14,0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  padding: 12px;
  outline: none;
}

.report-modal-textarea:focus {
  border-color: rgba(139,124,246,0.62);
  box-shadow: 0 0 0 3px rgba(139,124,246,0.16);
}

.report-modal-status {
  min-height: 18px;
  margin-top: 10px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.4;
}

.report-modal-status[data-type="error"] {
  color: #ffb4b4;
}

@media (max-width: 700px), (max-height: 760px) {
  .brand-confirm-modal.report-modal {
    place-items: stretch center;
    align-items: stretch;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      12px
      calc(14px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .brand-confirm-modal.report-modal .report-modal-card {
    align-self: start;
    width: min(500px, 100%);
    max-height: calc(100vh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100svh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    border-radius: 18px;
    -webkit-overflow-scrolling: touch;
  }

  .brand-confirm-modal.report-modal .brand-confirm-logo {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
  }

  .brand-confirm-modal.report-modal .brand-confirm-title {
    font-size: 19px;
    letter-spacing: 0;
  }

  .brand-confirm-modal.report-modal .brand-confirm-copy {
    margin-top: 6px;
    line-height: 1.4;
  }

  .brand-confirm-modal.report-modal .report-modal-reasons {
    gap: 7px;
    margin-top: 14px;
  }

  .brand-confirm-modal.report-modal .report-reason-option {
    min-height: 40px;
    padding: 9px 11px;
  }

  .brand-confirm-modal.report-modal .report-modal-textarea {
    min-height: 104px;
  }

  .brand-confirm-modal.report-modal .brand-confirm-actions {
    position: sticky;
    bottom: -18px;
    z-index: 2;
    margin: 14px -18px -18px;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    background:
      linear-gradient(180deg, rgba(16,16,24,0), #101018 28%),
      #101018;
  }
}

.bot-card-report-icon-btn,
.bot-card-block-icon-btn,
.detail-block-icon-btn,
.detail-report-icon-btn {
  color: #ffd7a8;
}

.bot-card-block-icon-btn,
.detail-block-icon-btn {
  color: #ff9ca8;
}

.block-modal-card {
  width: min(420px, calc(100vw - 32px));
}

.block-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.block-modal-actions #botBlockCancel {
  grid-column: 1 / -1;
}

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

.blocked-bots-empty {
  color: var(--muted, #9b99b5);
  font-size: 0.9rem;
  padding: 12px 2px;
}

.blocked-bot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

.blocked-bot-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.blocked-bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blocked-bot-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.blocked-bot-copy strong,
.blocked-bot-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-bot-copy small {
  color: var(--muted, #9b99b5);
  font-size: 0.78rem;
}

.premium-portrait-modal {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,211,110,0.18), transparent 36%),
    rgba(4,5,8,0.8);
  backdrop-filter: blur(16px);
}

.premium-portrait-modal.hidden {
  display: none;
}

.premium-portrait-modal-card {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255,215,126,0.2);
  background:
    radial-gradient(circle at top left, rgba(255,217,120,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025)),
    #0d1019;
  box-shadow: 0 34px 90px rgba(0,0,0,0.52);
}

.premium-portrait-modal-kicker {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,215,126,0.24);
  background: rgba(255,215,126,0.12);
  color: #ffe4a2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.premium-portrait-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.premium-portrait-modal-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.premium-portrait-modal-copy {
  color: var(--sub);
  line-height: 1.6;
}

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

.premium-portrait-modal-note {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.premium-portrait-modal-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.premium-portrait-modal-note span {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.55;
}

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

.premium-portrait-modal-actions .mini-btn {
  min-height: 44px;
  border-radius: 14px;
}

.premium-portrait-modal-actions .premium-portrait-confirm {
  background: linear-gradient(135deg, #ffe4a3, #ffb84d);
  color: #221200;
  border-color: rgba(255,255,255,0.18);
  font-weight: 800;
}

.premium-portrait-create-panel {
  border-color: rgba(255, 215, 126, .22);
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 218, 130, .14), transparent 30%),
    rgba(255,255,255,.035);
}

.premium-portrait-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.14);
  cursor: pointer;
}

.premium-portrait-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #ffd36e;
}

.premium-portrait-toggle span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.premium-portrait-toggle strong {
  color: #ffe3a3;
  font-size: 13px;
}

.premium-portrait-toggle small {
  color: rgba(255,255,255,.68);
  line-height: 1.35;
}

.premium-portrait-create-panel select:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.floating-tooltip {
  position: fixed;
  z-index: 2147483000;
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(12,14,22,0.97);
  color: rgba(246,248,255,0.94);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 14px 34px rgba(0,0,0,0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
}

.floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.detail-icon-only {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.detail-icon-only svg {
  width: 18px;
  height: 18px;
}

.persona-modal-form {
  gap: 16px;
}

.persona-tutorial-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

.persona-tutorial-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
}

.persona-tutorial-icon,
.persona-export-card-icon {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.055);
  color: rgba(176,190,255,0.95);
}

.persona-tutorial-icon {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.persona-tutorial-icon svg,
.persona-export-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.persona-tutorial-step strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.15;
}

.persona-tutorial-step small {
  grid-column: 2;
  min-width: 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.35;
}

.persona-export-card {
  align-content: start;
}

.persona-export-card-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 14px;
}

.persona-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.persona-icon-btn svg,
.persona-export-card .mini-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

[data-tooltip]::before,
[data-tooltip]::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 760px) {
  #yourCharactersView {
    padding: 0;
  }

  #yourCharactersView .create-topbar {
    padding: 12px 14px;
  }

  #yourCharactersView .your-characters-page {
    gap: 12px;
    padding: 14px;
  }

  #yourCharactersView .your-characters-hero {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
  }

  #yourCharactersView .your-characters-hero h1 {
    font-size: 34px;
  }

  #yourCharactersView .your-characters-hero p {
    font-size: 13px;
  }

  #yourCharactersView .your-characters-hero .btn-save {
    width: 100%;
  }

  #yourCharactersView .your-characters-toolbar {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 18px;
  }

  #yourCharactersView .search-field {
    flex: none;
    height: 46px;
  }

  #yourCharactersView .search-field input {
    height: 44px;
    font-size: 13px;
  }

  #yourCharactersView .your-characters-toolbar > .mini-btn {
    width: 100%;
  }

  .your-characters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .your-character-card {
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
  }

  .your-character-header {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .your-character-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .your-character-actions {
    gap: 6px;
  }

  .your-character-action-btn {
    flex: 1 1 40px;
    min-height: 36px;
    padding: 7px;
    font-size: 0;
    gap: 0;
  }

  .your-character-action-btn svg {
    width: 17px;
    height: 17px;
  }

  .your-character-action-btn span {
    display: none;
  }

  .brand-confirm-card {
    padding: 18px;
    border-radius: 22px;
  }

  .brand-confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-modal-reasons {
    grid-template-columns: 1fr;
  }

  .persona-tutorial-strip {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .persona-tutorial-step {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .persona-tutorial-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }
}

.recent-chats-page {
  max-width: 980px;
}

.recent-chats-panel {
  display: grid;
  gap: 16px;
}

#recentChatsView .mobile-recent-your-characters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(260px, 100%);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
  cursor: pointer;
}

#recentChatsView .mobile-recent-your-characters-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}

#recentChatsView .mobile-recent-your-characters-btn:active {
  transform: scale(.99);
  background: rgba(255,255,255,0.07);
}

.recent-chats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.recent-chats-search {
  min-width: min(320px, 100%);
  flex: 1 1 280px;
}

.recent-chats-list {
  display: grid;
  gap: 2px;
}

.recent-chats-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 34px 16px;
  color: var(--sub);
  text-align: center;
}

.recent-chats-empty-icon {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: rgba(226,226,238,0.86);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.recent-chats-empty-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.recent-chats-empty strong {
  color: rgba(245,245,250,0.94);
  font-size: 18px;
  line-height: 1.2;
}

.recent-chats-empty small {
  max-width: 280px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}

.recent-chats-selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.recent-chats-selection-bar:not(.is-active) .recent-clear-selection-btn,
.recent-chats-selection-bar:not(.is-active) .recent-delete-selected-btn {
  display: none;
}

.recent-chats-selection-bar .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  transition: none;
}

.recent-chats-selection-bar .icon-btn svg,
.recent-chat-select-indicator svg,
.pinned-memory-head .icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recent-selection-count {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}

.recent-chats-loading {
  min-height: 140px;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--sub);
  font-size: 14px;
  text-align: center;
}

.recent-chats-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.82);
  animation: spin 0.9s linear infinite;
}

.recent-chat-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  padding: 12px 4px;
  cursor: pointer;
  touch-action: pan-y;
  transition: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.recent-chat-card *,
.recent-chats-selection-bar,
.recent-chats-selection-bar * {
  transition: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.recent-chats-list.selection-mode .recent-chat-card {
  grid-template-columns: auto auto minmax(0, 1fr);
}

.recent-chat-card:hover {
  background: rgba(255,255,255,0.04);
}

.recent-chat-card.selected {
  background: rgba(139,124,246,0.12);
}

.recent-chat-card.selected:active,
.recent-chat-card.selected:focus:not(:focus-visible) {
  background: rgba(139,124,246,0.12);
}

.recent-chat-card.is-opening {
  background: rgba(255,255,255,0.055);
}

.recent-chat-card.is-opening .recent-chat-card-avatar,
.recent-chat-card.is-opening .recent-chat-card-copy {
  opacity: 1;
}

.recent-chat-select-indicator {
  width: 24px;
  height: 24px;
  display: none;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: transparent;
  background: rgba(255,255,255,0.035);
  transition: none;
}

.recent-chats-list.selection-mode .recent-chat-select-indicator {
  display: inline-grid;
}

.recent-chat-card.selected .recent-chat-select-indicator {
  color: #fff;
  border-color: rgba(139,124,246,0.78);
  background: rgba(139,124,246,0.78);
}

.recent-chat-card:active,
.recent-chat-card:focus:not(:focus-visible),
.bot-card:active,
.bot-card:focus:not(:focus-visible),
.recent-item:active,
.recent-item:focus:not(:focus-visible),
.your-character-card:active,
.your-character-card:focus:not(:focus-visible),
.detail-full-image-link:active,
.detail-full-image-link:focus:not(:focus-visible) {
  outline: none;
  background-color: transparent;
}

.recent-chat-card:focus-visible,
.bot-card:focus-visible,
.recent-item:focus-visible,
.your-character-card:focus-visible,
.detail-full-image-link:focus-visible {
  outline: 2px solid rgba(139,124,246,0.72);
  outline-offset: 3px;
}

.recent-chat-card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.recent-chat-card-avatar .recent-avatar-image {
  width: 100%;
  height: 100%;
}

.recent-chat-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.recent-chat-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.recent-chat-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  color: rgba(246,246,255,0.96);
}

.recent-chat-card-date,
.recent-chat-card-subtitle,
.recent-chat-card-preview {
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}

.recent-chat-card-date {
  white-space: nowrap;
  font-size: 12px;
  opacity: 0.82;
  min-width: max-content;
  justify-self: end;
}

.recent-chat-card-preview {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.recent-chat-card-subtitle {
  color: rgba(232,232,238,0.82);
  font-weight: 700;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 7100;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(12px);
}

.loading-overlay.hidden {
  display: none;
}

.loading-card {
  min-width: 260px;
  padding: 26px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,15,20,0.92);
  display: grid;
  justify-items: center;
  gap: 12px;
}

.loading-logo {
  width: 64px;
  height: 64px;
}

.loading-title {
  font-size: 20px;
  font-weight: 700;
}

.loading-subtitle {
  color: var(--sub);
  font-size: 13px;
  text-align: center;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.14);
  border-top-color: rgba(255,255,255,0.8);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes skeleton-shimmer {
  0% { background-position: 180% 0; }
  100% { background-position: -40% 0; }
}

.mobile-pull-refresh {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 7200;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -18px) scale(0.96);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mobile-pull-refresh.is-visible {
  opacity: 1;
}

.mobile-pull-refresh.is-ready {
  transform: translate(-50%, 8px) scale(1);
}

.mobile-pull-refresh.is-loading {
  opacity: 1;
  transform: translate(-50%, 8px) scale(1);
}

.mobile-pull-refresh-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(18,18,24,0.92);
  color: rgba(248,248,255,0.94);
  box-shadow: 0 16px 42px rgba(0,0,0,0.36);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 800;
}

.mobile-pull-refresh-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.16);
  border-top-color: rgba(255,255,255,0.9);
  transform: rotate(var(--pull-rotation, 0deg));
}

.mobile-pull-refresh.is-loading .mobile-pull-refresh-spinner,
.app-loading-dots span {
  animation: spin 0.78s linear infinite;
}

.app-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 7300;
  display: grid;
  place-items: center;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(22px, env(safe-area-inset-top, 0px))
    max(18px, env(safe-area-inset-right, 0px))
    max(22px, env(safe-area-inset-bottom, 0px))
    max(18px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.app-loading-modal.hidden {
  display: none;
}

.app-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6,6,10,0.68);
  backdrop-filter: blur(14px);
}

.app-loading-card {
  position: relative;
  width: min(340px, 100%);
  max-width: calc(100vw - 36px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 22px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(139,124,246,0.2), transparent 48%),
    rgba(16,16,22,0.94);
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
  text-align: center;
  animation: appLoadingCardIn 220ms ease-out both;
}

.app-loading-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.app-loading-title {
  font-size: 18px;
  font-weight: 900;
}

.app-loading-copy {
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}

.app-loading-dots {
  display: inline-flex;
  gap: 7px;
  margin-top: 4px;
}

.app-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  animation-name: appLoadingDot;
  animation-duration: 0.9s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.app-loading-dots span:nth-child(2) { animation-delay: 0.12s; }
.app-loading-dots span:nth-child(3) { animation-delay: 0.24s; }

@keyframes appLoadingCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appLoadingDot {
  0%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.archive-modal {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 10, 0.72);
  padding: 20px;
}

.archive-modal.hidden { display: none; }

.archive-modal-card {
  width: min(780px, 100%);
  max-height: min(84vh, 900px);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14,14,18,0.98);
  display: grid;
  grid-template-rows: auto 1fr;
}

.archive-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.archive-modal-title {
  font-size: 16px;
  font-weight: 700;
}

.archive-modal-subtitle {
  margin-top: 3px;
  color: var(--sub);
  font-size: 12px;
}

.archive-modal-body {
  overflow-y: auto;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.archive-msg {
  display: grid;
  gap: 6px;
}

.archive-msg.user .archive-msg-bubble {
  justify-self: end;
}

.archive-msg.assistant .archive-msg-bubble {
  justify-self: start;
}

.archive-msg-meta {
  color: var(--sub);
  font-size: 11px;
}

.archive-msg-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
}

.memory-panel.hidden { display: none; }

#historyView,
#chatStyleView,
#userPersonaView,
#conversationMemoryView {
  display: none;
}

#historyView.active,
#chatStyleView.active,
#userPersonaView.active,
#conversationMemoryView.active {
  display: flex;
  flex-direction: column;
}

.chat-style-body,
.user-persona-body {
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

.chat-style-panel,
.user-persona-page-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 12px;
}

.chat-style-model-field {
  display: grid;
  gap: 10px;
}

.chat-style-model-browser {
  display: grid;
  gap: 28px;
}

.chat-style-model-section {
  display: grid;
  gap: 14px;
}

.chat-style-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.chat-style-section-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0;
  border-radius: 0;
  color: #f4f1ff;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.chat-style-section-pill::before {
  content: "";
  width: 8px;
  height: 24px;
  margin-right: 10px;
  border-radius: 999px;
  background: #75f0a0;
  box-shadow: none;
}

.chat-style-section-pill.custom::before {
  background: #9f8cff;
  box-shadow: none;
}

.chat-style-section-pill.advanced::before {
  background: #66d9ef;
  box-shadow: none;
}

.chat-style-section-note {
  min-width: 0;
  color: rgba(235,235,246,0.58);
  font-size: 12px;
  line-height: 1.35;
}

.user-persona-page-panel {
  align-content: start;
}

.user-persona-page-list {
  display: grid;
  gap: 10px;
}

#userPersonaView .chat-style-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

#userPersonaView .chat-style-section-pill {
  min-width: 0;
  justify-content: flex-start;
  font-size: 16px;
}

.user-persona-page-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: #1b1b20;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.user-persona-page-card.is-active {
  border-color: rgba(117,240,160,0.34);
  background: #202127;
}

.user-persona-item-avatar {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
}

.user-persona-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-persona-item-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.user-persona-item-title {
  color: #f7f5ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.user-persona-item-meta {
  color: rgba(235,235,246,0.58);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.user-persona-item-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.user-persona-item-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: rgba(245,245,250,0.78);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.user-persona-create-btn {
  justify-self: stretch;
  min-height: 46px;
}

.user-persona-edit-pane.hidden {
  display: none;
}

.user-persona-edit-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.user-persona-avatar-editor {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 2px 0 6px;
}

.user-persona-avatar-editor .big-avatar {
  width: 96px;
  height: 96px;
  border-width: 1px;
  background: rgba(255,255,255,0.045);
}

.user-persona-avatar-editor .avatar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
}

.user-persona-avatar-editor .avatar-controls > .icon-tool-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  flex: 0 0 42px;
  justify-content: center;
}

.user-persona-edit-grid .form-section-heading {
  margin-top: 6px;
}

.user-persona-edit-grid input:not([type="checkbox"]),
.user-persona-edit-grid textarea,
.user-persona-edit-grid select {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #15161b;
  color: var(--text);
}

.user-persona-edit-grid textarea {
  min-height: 116px;
}

.user-persona-default-toggle {
  margin-top: 4px;
}

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

.user-persona-actions .btn-save,
.user-persona-actions .mini-btn {
  min-height: 42px;
}

.user-persona-actions .btn-save.is-saving {
  cursor: wait;
  opacity: 0.82;
}

.persona-danger-btn,
.persona-confirm-delete-btn {
  border-color: rgba(255,93,93,0.48) !important;
  background: rgba(255,75,75,0.1) !important;
  color: #ffb7b7 !important;
  font-weight: 850;
}

.persona-danger-btn:not(:disabled):hover,
.persona-confirm-delete-btn:not(:disabled):hover {
  border-color: rgba(255,108,108,0.72) !important;
  background: rgba(255,75,75,0.18) !important;
  color: #fff !important;
}

.user-persona-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 380px);
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 260px;
  padding: 24px 0 24px 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 10%, rgba(32,214,216,0.18), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(255,71,161,0.18), transparent 42%),
    rgba(20,20,28,0.96);
  box-shadow: 0 18px 46px rgba(0,0,0,0.24);
  overflow: hidden;
}

.user-persona-hero-logo {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.045);
  overflow: hidden;
}

.user-persona-hero-logo img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.user-persona-hero-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.user-persona-hero-kicker {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(117,240,160,0.32);
  border-radius: 999px;
  background: rgba(117,240,160,0.09);
  color: #97f6b7;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-persona-hero h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.user-persona-hero p {
  margin: 0;
  max-width: 62ch;
  color: rgba(235,235,248,0.72);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.user-persona-hero-art {
  width: 100%;
  height: 100%;
  min-height: 260px;
  align-self: stretch;
  object-fit: cover;
  object-position: center top;
  display: block;
  opacity: 0.9;
  filter: saturate(0.95) contrast(0.96);
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 100%);
}

@media (min-width: 761px) {
  #userPersonaView .history-topbar {
    padding-inline: max(32px, calc((100% - 1120px) / 2 + 24px));
  }

  #userPersonaView .user-persona-body {
    width: 100%;
    max-width: none;
    padding: 30px max(32px, calc((100% - 1120px) / 2 + 24px)) 110px;
    box-sizing: border-box;
    align-items: start;
    justify-content: flex-start;
    align-content: start;
  }

  #userPersonaView .user-persona-page-panel {
    width: min(980px, 100%);
    max-width: 980px;
    margin-inline: auto;
    gap: 16px;
  }

  #userPersonaView .user-persona-edit-pane {
    width: min(1120px, 100%);
    max-width: 1120px;
  }

  #userPersonaView .user-persona-page-card {
    min-height: 78px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(27,27,34,0.96);
  }

  #userPersonaView .user-persona-page-card:hover {
    border-color: rgba(255,255,255,0.18);
    background: rgba(31,31,40,0.98);
  }

  #userPersonaView .user-persona-item-title {
    font-size: 15px;
  }

  #userPersonaView .user-persona-item-meta {
    font-size: 12.5px;
  }

  #userPersonaView .user-persona-edit-grid {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px 24px;
    align-items: start;
  }

  #userPersonaView .user-persona-edit-hero.full {
    grid-column: 1 / -1;
  }

  #userPersonaView .user-persona-avatar-editor.full {
    grid-column: 1;
    grid-row: 2 / span 10;
    position: sticky;
    top: 18px;
    align-self: start;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    background: rgba(21,22,28,0.96);
  }

  #userPersonaView .user-persona-avatar-editor .big-avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
  }

  #userPersonaView .user-persona-avatar-editor .avatar-controls {
    max-width: 180px;
  }

  #userPersonaView .user-persona-edit-grid .form-section-heading.full,
  #userPersonaView .user-persona-edit-grid .form-group.full,
  #userPersonaView .user-persona-edit-grid .setting-toggle.full,
  #userPersonaView .user-persona-edit-grid .form-actions.full {
    grid-column: 2;
  }

  #userPersonaView .user-persona-edit-grid textarea {
    min-height: 132px;
  }
}

@media (max-width: 760px) {
  #userPersonaView .user-persona-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 14px;
    border-radius: 14px;
    box-shadow: none;
  }

  #userPersonaView .user-persona-hero-logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }

  #userPersonaView .user-persona-hero h2 {
    font-size: 20px;
    line-height: 1.08;
  }

  #userPersonaView .user-persona-hero p {
    font-size: 12px;
    line-height: 1.35;
  }

  #userPersonaView .user-persona-hero-art {
    grid-column: 1 / -1;
    width: calc(100% + 28px);
    height: 126px;
    min-height: 126px;
    margin: 2px -14px -14px;
    object-fit: cover;
    object-position: center top;
    mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
  }

  #userPersonaView .user-persona-hero-kicker {
    display: none;
  }

  #userPersonaView .user-persona-avatar-editor {
    width: 100%;
    justify-items: center;
  }

  #userPersonaView .user-persona-avatar-editor .big-avatar {
    border-radius: 50%;
  }
}

.persona-danger-btn:disabled {
  border-color: rgba(255,255,255,0.09) !important;
  background: rgba(255,255,255,0.025) !important;
  color: rgba(235,235,246,0.36) !important;
  opacity: 1;
}

.chat-memory-setting label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-memory-setting label span {
  flex: 0 0 auto;
  color: rgba(235,235,246,0.72);
  font-size: 12px;
  font-weight: 800;
}

.chat-memory-setting input[type="range"] {
  width: 100%;
}

.chat-style-model-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 280px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 1px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(159,140,255,0.42) rgba(255,255,255,0.06);
}

.chat-style-model-row::-webkit-scrollbar {
  height: 7px;
}

.chat-style-model-row::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.chat-style-model-row::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(159,140,255,0.48);
}

.chat-style-model-card {
  position: relative;
  min-height: 210px;
  display: grid;
  grid-template-rows: auto minmax(78px, 1fr) auto;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 12px;
  background: #242427;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.chat-style-model-card.selected {
  border-color: rgba(137,112,255,0.72);
  box-shadow: none;
}

.chat-style-model-card.disabled {
  opacity: 0.46;
  filter: grayscale(1);
  cursor: not-allowed;
  border-color: rgba(255,255,255,0.045);
  background: #202023;
  box-shadow: none;
}

.chat-style-model-card.chayt-mode-card {
  min-height: 280px;
  grid-template-rows: auto minmax(58px, auto) minmax(58px, 1fr) auto;
  align-content: stretch;
  background: linear-gradient(180deg, rgba(48,46,58,0.98), rgba(35,35,39,0.98));
  border-color: rgba(117,240,160,0.12);
}

.chat-style-model-card.chayt-mode-card.selected {
  border-color: rgba(117,240,160,0.62);
  box-shadow: none;
}

.chat-style-model-title {
  display: block;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0;
}

.chat-style-model-desc {
  display: block;
  color: rgba(245,245,250,0.66);
  font-size: 14px;
  line-height: 1.45;
}

.chat-style-model-includes {
  display: grid;
  align-self: start;
  gap: 5px;
  color: rgba(245,245,250,0.54);
  font-size: 11px;
  line-height: 1.35;
}

.chat-style-model-includes span {
  color: rgba(245,245,250,0.78);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-style-model-foot {
  display: flex;
  align-self: end;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  color: rgba(245,245,250,0.5);
  font-size: 11px;
  line-height: 1.2;
}

.chat-style-safety-pill {
  flex: 0 0 auto;
  color: rgba(255,255,255,0.74);
  font-size: 12px;
  font-weight: 800;
}

.chat-style-energy-note {
  max-width: 118px;
  text-align: right;
}

.setting-help { margin-top: 6px; font-size: 11px; line-height: 1.45; color: var(--sub); }
.setting-help.full-line { margin-top: 10px; }

body.maintenance-lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

.maintenance-lock-page {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  text-align: center;
  justify-items: center;
}

.maintenance-lock-art {
  width: min(230px, 72vw);
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 2px;
}

.maintenance-lock-page h1 {
  margin: 0;
  max-width: 520px;
  color: #ffffff;
  font-size: clamp(32px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
}

.maintenance-lock-page p {
  margin: 0;
  max-width: 440px;
  color: #a4a4ba;
  font-size: 15px;
  line-height: 1.6;
}

.maintenance-lock-link {
  margin-top: 10px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

#chatView.menu-open .chat-topbar { z-index: 40; }
body.is-chat-open #profileDock,
body[data-current-view="chat"] #profileDock,
body:has(#chatView.active) #profileDock {
  display: none !important;
  pointer-events: none !important;
}


/* ── Added discovery / auth styles ─────────────────── */
.sidebar-top { gap: 12px; }
.auth-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
}
.auth-title { font-size: 12px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .8px; }
.auth-status { font-size: 12px; line-height: 1.4; color: var(--text); }
.auth-box input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
  outline: none;
}
.auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-actions .mini-btn { padding-inline: 10px; }
.section-subtitle { color: var(--sub); font-size: 12px; margin-top: -10px; }
.home-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.home-toolbar select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 10px;
  font: inherit;
}
.bot-card-top { align-items: flex-start; }
.bot-card-avatar { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; background: var(--surface); flex-shrink: 0; border: 1px solid var(--border); }
.bot-card-copy { display: grid; gap: 6px; }
.bot-card-created { font-size: 11px; color: var(--sub); line-height: 1.35; }
.bot-card-badges { font-size: 11px; color: var(--sub); line-height: 1.4; }
.bot-card-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bot-card-meta-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.45;
}
.bot-card-review-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.bot-card-review-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 850;
}
.bot-card-review-stat svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.bot-card-review-stat.is-up {
  color: #ffd36b;
}
.bot-card-review-stat.is-down {
  color: #ff9f9f;
}
.bot-card-stat-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.bot-card-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: rgba(221,226,255,0.86);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}
.bot-card-stat-chip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}
.bot-card-stat-chip.is-chat svg,
.bot-card-stat-chip.is-review svg,
.bot-card-stat-chip.is-messages svg {
  color: rgba(154,170,255,0.95);
}
.bot-card-stat-chip.is-up svg {
  color: #ffd36b;
}
.bot-card-stat-chip.is-down svg {
  color: #ff9f9f;
}
.bot-card-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bot-card-share-btn {
  appearance: none;
  border: 1px solid rgba(139,124,246,.35);
  background: rgba(139,124,246,.12);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bot-card-share-btn:hover {
  background: rgba(139,124,246,.2);
  border-color: rgba(139,124,246,.5);
  color: #fff;
}
.bot-card-share-btn.ghost {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: var(--text);
}
.bot-card-share-btn.ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
}
.developer-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}
.bot-card-share-btn.danger {
  border-color: rgba(255,91,91,.35);
  color: #ffb4b4;
}
.bot-card-share-btn.danger:hover {
  background: rgba(255,91,91,.12);
  border-color: rgba(255,91,91,.55);
}
.bot-card-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(232,233,241,.82);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.bot-card-icon-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: #fff;
}
.bot-card-icon-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  pointer-events: none;
}

#bigAvatar.avatar-edit-target,
#userBigAvatar.avatar-edit-target {
  cursor: default;
}

#bigAvatar.avatar-edit-target::after,
#userBigAvatar.avatar-edit-target::after {
  display: none;
}

.detail-share-icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
  color: rgba(244,244,251,.9);
  cursor: pointer;
}

.detail-share-icon-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}

.detail-share-icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bot-card-meta::after {
  content: var(--i18n-open, 'Open');
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(139,124,246,.35);
  padding: 4px 8px;
  border-radius: 999px;
}
.recent-avatar-image { width: 22px; height: 22px; border-radius: 999px; object-fit: cover; }
.nav-energy-icon,
.mobile-energy-icon,
.energy-inline-icon,
.energy-hero-icon {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}
.nav-energy-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 8px rgba(69, 223, 255, .24));
}
.energy-inline-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 7px rgba(236, 67, 255, .26));
}
.energy-amount,
.energy-balance-amount,
.profile-dock-energy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.energy-balance-amount {
  gap: 10px;
}
.energy-balance-amount .energy-inline-icon {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 0 16px rgba(69, 223, 255, .26)) drop-shadow(0 0 14px rgba(235, 65, 255, .22));
}
.energy-hero-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.energy-hero-icon {
  width: clamp(58px, 10vw, 88px);
  height: clamp(58px, 10vw, 88px);
  filter: drop-shadow(0 0 24px rgba(69, 223, 255, .26)) drop-shadow(0 0 18px rgba(235, 65, 255, .22));
}
.energy-orb {
  overflow: hidden;
  background: rgba(8, 12, 24, .72);
}
.energy-orb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
}
.msg-image { max-width: 100%; border-radius: 14px; margin-top: 10px; display: block; border: 1px solid var(--border); }
.chat-desc { max-width: 100%; line-height: 1.45; }
.chat-menu button[data-action="rate"] { color: var(--accent); }
.chat-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(76, 217, 255, .24);
  background:
    linear-gradient(135deg, rgba(69, 223, 255, .12), rgba(235, 65, 255, .10)),
    rgba(12, 15, 24, .42);
  color: rgba(245, 248, 255, .92);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
#chatView .chat-credit-pill {
  display: none !important;
}
.chat-topbar .chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: 0;
}

.chat-persona-switcher {
  display: inline-flex;
  align-items: center;
  max-width: 172px;
  min-width: 0;
}

.chat-persona-switcher.hidden {
  display: none !important;
}

.chat-persona-switcher select {
  width: 100%;
  max-width: 172px;
  min-width: 0;
  height: 34px;
  padding: 0 28px 0 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: #15161b;
  color: rgba(245,245,250,0.92);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-persona-switcher select:focus {
  border-color: rgba(255,255,255,0.36);
}

@media (min-width: 961px) {
  body.chat-layout-center #chatView .messages {
    width: min(700px, calc(100% - 96px));
    align-self: center;
    padding-left: 0;
    padding-right: 0;
  }

  body.chat-layout-center #chatView .chat-fiction-disclaimer {
    width: min(700px, 100%);
    max-width: 100%;
  }

  body.chat-layout-center #chatView .chat-character-intro {
    width: min(700px, 100%);
    max-width: 100%;
  }

  body.chat-layout-center #chatView .msg {
    width: fit-content;
    inline-size: fit-content;
    max-width: 100%;
  }

  body.chat-layout-center #chatView .msg.assistant {
    align-self: flex-start;
    max-width: min(92%, 640px);
  }

  body.chat-layout-center #chatView .msg-body {
    flex: 0 1 auto;
    width: fit-content;
    inline-size: fit-content;
    max-width: 100%;
  }

  body.chat-layout-center #chatView .msg.assistant .msg-body {
    align-items: flex-start;
  }

  body.chat-layout-center #chatView .msg.user .msg-body {
    align-items: flex-end;
  }

  body.chat-layout-center #chatView .bubble {
    display: inline-block;
    width: fit-content;
    inline-size: fit-content;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.chat-layout-center #chatView .scene-divider {
    align-self: center;
    width: 100%;
  }

  body.chat-layout-center #chatView .msg.user {
    align-self: flex-end;
    max-width: min(82%, 520px);
  }

  body.chat-layout-center #chatView .input-bar {
    width: min(700px, calc(100% - 96px));
    align-self: center;
    border-top: 0;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
  }
}
.credits-page {
  padding: 28px;
  display: grid;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}
.generator-page {
  padding: 28px;
  display: grid;
  gap: 20px;
  min-width: 0;
  width: min(1220px, 100%);
  margin: 0 auto;
  animation: generatorFadeUp .42s ease both;
}
.generator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  align-items: stretch;
}
.generator-hero > div:first-child,
.generator-quota-card,
.generator-panel {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.generator-hero > div:first-child {
  padding: 30px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(120,198,255,.12), rgba(255,255,255,.035) 42%, rgba(248,178,93,.08)),
    rgba(255,255,255,.018);
}
.generator-hero > div:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.12) 42%, transparent 58%);
  transform: translateX(-130%);
  animation: generatorLightSweep 6s ease-in-out infinite;
}
.generator-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(120,198,255,.24);
  background: rgba(120,198,255,.08);
  color: #a9dcff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.generator-hero h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1;
}
.generator-hero p {
  margin: 14px 0 0;
  max-width: 66ch;
  color: rgba(232,233,241,.8);
  line-height: 1.62;
}
.generator-quota-card {
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 12px;
}
.generator-quota-value {
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
}
.generator-quota-note {
  color: rgba(232,233,241,.68);
  line-height: 1.45;
  font-size: 13px;
}
.generator-layout {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}
.generator-panel {
  padding: 20px;
  animation: generatorFadeUp .46s ease both;
}
.generator-layout .generator-panel:nth-child(2) {
  animation-delay: .06s;
}
.generator-recents-panel {
  animation-delay: .1s;
}
.generator-panel .section-title,
.generator-panel .section-subtitle {
  display: block;
  overflow-wrap: anywhere;
  min-width: 0;
}
.generator-panel .section-title {
  line-height: 1.25;
}
.generator-panel .section-subtitle {
  margin-top: 8px;
  line-height: 1.5;
  color: var(--sub);
}
.generator-settings-panel {
  display: grid;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)),
    var(--card);
}
.generator-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(232,233,241,.86);
  font-size: 13px;
  font-weight: 800;
}
.generator-prompt {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: rgba(9,12,20,.52);
  color: var(--text);
  padding: 14px;
  line-height: 1.5;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.generator-prompt:focus {
  border-color: rgba(120,198,255,.55);
  box-shadow: 0 0 0 3px rgba(120,198,255,.12);
  background: rgba(9,12,20,.68);
}
.generator-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.generator-chip-list,
.generator-format-list,
.generator-model-list,
.generator-backend-list,
.generator-source-list {
  display: grid;
  gap: 10px;
}
.generator-chip-list {
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}
.generator-chip,
.generator-format-btn,
.generator-model-btn,
.generator-backend-btn {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.035);
  color: rgba(232,233,241,.86);
  min-height: 44px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.generator-chip:hover,
.generator-format-btn:hover,
.generator-model-btn:hover,
.generator-backend-btn:hover {
  border-color: rgba(120,198,255,.34);
  background: rgba(120,198,255,.08);
}
.generator-chip.active,
.generator-format-btn.active,
.generator-model-btn.active,
.generator-backend-btn.active {
  color: #eaf7ff;
  border-color: rgba(120,198,255,.6);
  background: rgba(25,126,184,.28);
  box-shadow: 0 12px 28px rgba(25,126,184,.18), inset 0 0 0 1px rgba(255,255,255,.05);
  animation: generatorActivePop .22s ease both;
}
.generator-format-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.generator-model-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.generator-backend-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.generator-source-list {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.generator-format-btn {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 10px 8px;
}
.generator-model-btn,
.generator-backend-btn {
  min-height: 68px;
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
  gap: 4px;
  padding: 10px 12px;
}
.generator-source-btn {
  min-height: 76px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: rgba(232,233,241,.88);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.generator-source-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(120,198,255,.28);
  background: rgba(120,198,255,.06);
}
.generator-source-btn span {
  font-weight: 900;
}
.generator-source-btn small {
  color: var(--sub);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
}
.generator-format-btn small,
.generator-model-btn small,
.generator-backend-btn small {
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
.generator-local-backend-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(120,198,255,.18);
  border-radius: 16px;
  background: rgba(120,198,255,.045);
}
.generator-local-backend-panel label {
  display: grid;
  gap: 6px;
}
.generator-local-backend-panel label > span {
  color: var(--sub);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.generator-backend-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(6,8,14,.56);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  outline: none;
}
.generator-backend-input:focus {
  border-color: rgba(120,198,255,.55);
  box-shadow: 0 0 0 3px rgba(120,198,255,.12);
}
.generator-negative-prompt {
  min-height: 82px;
}
.generator-backend-controls {
  display: grid;
  grid-template-columns: .72fr .72fr 1.3fr;
  gap: 10px;
}
.generator-backend-controls label {
  display: grid;
  gap: 6px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
@media (max-width: 720px) {
  .generator-backend-list,
  .generator-backend-controls {
    grid-template-columns: 1fr;
  }
}
.generator-adult-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}
.generator-adult-toggle {
  width: 82px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(120,198,255,.26);
  background: rgba(120,198,255,.1);
  color: #dff3ff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.generator-adult-toggle:hover {
  transform: translateY(-1px);
}
.generator-adult-toggle.active {
  border-color: rgba(255,107,107,.46);
  background: rgba(255,107,107,.16);
  color: #ffd2d2;
}
.generator-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.generator-actions .btn-save {
  min-width: 180px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.generator-actions .btn-save::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-140%);
}
.generator-actions .btn-save:not(:disabled):hover::after {
  animation: generatorButtonShine .7s ease;
}
.generator-output-panel {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.032), rgba(255,255,255,.012)),
    var(--card);
}
.generator-output {
  min-height: 560px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(120,198,255,.06), transparent 34%),
    rgba(9,12,20,.58);
  border: 1px solid rgba(255,255,255,.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.generator-output::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 18px;
  border: 1px solid rgba(120,198,255,.12);
  opacity: .8;
  pointer-events: none;
  animation: generatorOutputBreathe 3.6s ease-in-out infinite;
}
.generator-placeholder {
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--sub);
  text-align: center;
  padding: 20px;
  animation: generatorPlaceholderFloat 3.2s ease-in-out infinite;
}
.generator-placeholder svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  opacity: .72;
}
.generator-perchance-state {
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}
.generator-data-import-input {
  width: min(100%, 420px);
  min-height: 86px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(6,8,14,.62);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  outline: none;
}
.generator-data-import-input:focus {
  border-color: rgba(120,198,255,.5);
  box-shadow: 0 0 0 3px rgba(120,198,255,.11);
}
.generator-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.14);
  border-top-color: rgba(120,198,255,.95);
  animation: spin 0.8s linear infinite;
}
.generator-output-img {
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: rgba(0,0,0,.18);
  animation: generatorImageReveal .32s ease both;
}
.generator-output-frame {
  width: 100%;
  min-height: min(720px, 68vh);
  height: 68vh;
  border: 0;
  background: #fff;
  animation: generatorImageReveal .32s ease both;
}
.generator-output-actions {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(90deg, transparent, rgba(4,6,12,.74) 26%, rgba(4,6,12,.86));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
}
.generator-publish-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
}
.generator-publish-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(9,12,20,.52);
  color: var(--text);
  padding: 12px;
  line-height: 1.45;
  outline: none;
}
.generator-publish-textarea:focus {
  border-color: rgba(120,198,255,.5);
  box-shadow: 0 0 0 3px rgba(120,198,255,.11);
}
.generator-open-image-link {
  color: #04101c;
  background: linear-gradient(135deg, #78c6ff, #b8e4ff);
  border-color: rgba(120,198,255,.5);
  box-shadow: 0 10px 28px rgba(120,198,255,.24);
  text-decoration: none;
}
.generator-open-image-link:hover {
  color: #020811;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(120,198,255,.32);
}
.generator-recent-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.generator-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.generator-recents-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)),
    var(--card);
}
.generator-recent-card {
  display: grid;
  gap: 8px;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  min-width: 0;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.generator-recent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(120,198,255,.28);
  background: rgba(120,198,255,.06);
}

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

@keyframes generatorLightSweep {
  0%, 48% { transform: translateX(-130%); opacity: 0; }
  56% { opacity: .9; }
  68%, 100% { transform: translateX(130%); opacity: 0; }
}

@keyframes generatorActivePop {
  from { transform: scale(.98); }
  to { transform: scale(1); }
}

@keyframes generatorButtonShine {
  from { transform: translateX(-140%); }
  to { transform: translateX(140%); }
}

@keyframes generatorOutputBreathe {
  0%, 100% { opacity: .34; transform: scale(.99); }
  50% { opacity: .9; transform: scale(1); }
}

@keyframes generatorPlaceholderFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes generatorImageReveal {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}
.generator-recent-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
}
.generator-recent-frame-label {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(120,198,255,.16), rgba(246,179,122,.12));
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(238,243,255,.9);
  font-weight: 800;
  letter-spacing: 0;
}
.generator-recent-card.is-broken img {
  opacity: .18;
}
.generator-recent-card.is-broken::after {
  content: "Image failed";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 56px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,107,107,.28);
  background: rgba(255,107,107,.12);
  color: #ffd0d0;
  font-size: 12px;
  font-weight: 800;
}
.generator-recent-card span {
  color: rgba(232,233,241,.76);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.generator-recent-card small {
  color: #a9dcff;
  font-size: 11px;
  font-weight: 800;
}
.explore-image-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start;
}
.explore-image-card {
  display: grid;
  align-self: start;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
  box-shadow: var(--shadow);
}
.explore-image-media {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: rgba(0,0,0,.28);
}
.explore-image-media img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
}
.explore-image-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  min-width: 0;
}
.explore-image-top,
.explore-image-meta,
.explore-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.explore-image-top strong,
.explore-image-top span,
.explore-image-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-image-top span,
.explore-image-meta {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}
.explore-image-description,
.explore-image-review,
.explore-image-prompt {
  margin: 0;
  color: rgba(232,233,241,.78);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.explore-image-prompt {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(9,12,20,.42);
  max-height: 112px;
  overflow: auto;
}
.explore-image-prompt summary {
  color: #a9dcff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  list-style: none;
}
.explore-image-prompt summary::-webkit-details-marker {
  display: none;
}
.explore-image-prompt:not([open]) div {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.explore-image-prompt[open] {
  max-height: 260px;
}
.explore-image-review {
  padding-left: 10px;
  border-left: 2px solid rgba(120,198,255,.36);
}
.explore-image-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.generator-topbar {
  display: none;
}
.credits-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 420px);
  gap: 18px;
  align-items: stretch;
}
.credits-hero > div:first-child {
  min-width: 0;
  padding: 26px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(249,176,90,.18), transparent 38%),
    radial-gradient(circle at bottom right, rgba(79,162,255,.12), transparent 42%),
    rgba(255,255,255,.025);
  box-shadow: var(--shadow);
}
.credits-hero h1,
.credits-hero p {
  overflow-wrap: anywhere;
}
.credits-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 0.95;
}
.credits-hero p {
  margin-top: 14px;
  max-width: 50ch;
  color: rgba(232,233,241,.8);
  line-height: 1.65;
}
.credits-balance-card,
.credits-panel {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.credits-panel .section-title,
.credits-panel .section-subtitle {
  display: block;
  overflow-wrap: anywhere;
}
.credits-panel .section-title {
  line-height: 1.35;
}
.credits-panel .section-subtitle {
  margin-top: 8px;
  line-height: 1.5;
}
.credits-balance-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 22px;
  background:
    linear-gradient(165deg, rgba(248,178,93,.16), rgba(255,255,255,.04) 42%, rgba(120,198,255,.08)),
    var(--card);
}
.credits-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.credits-mini-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(12,15,24,.26);
  border: 1px solid rgba(255,255,255,.06);
}
.credits-mini-stat span {
  font-size: 11px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.credits-mini-stat strong {
  font-size: 18px;
  line-height: 1;
}
.credits-mini-stat-accent {
  background: rgba(248,178,93,.14);
  border-color: rgba(248,178,93,.24);
}
.credits-daily-card {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.credits-daily-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.mobile-menu-link {
  display: none !important;
}

.credits-topbar {
  display: none;
}
.credits-daily-copy {
  color: var(--sub);
  line-height: 1.5;
}
.credits-daily-card .btn-save {
  width: 100%;
  justify-content: center;
}
.credits-daily-card .btn-save[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.credits-icon-concepts-panel {
  display: grid;
  gap: 16px;
}

.credits-icon-concept-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.credits-icon-concept-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(9,12,20,0.22);
}

.credits-icon-concept-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    radial-gradient(circle at 32% 22%, rgba(255,255,255,0.20), transparent 32%),
    linear-gradient(135deg, rgba(248,178,93,0.18), rgba(139,124,246,0.14));
  color: rgba(255,235,192,0.98);
}

.credits-icon-concept-mark svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.credits-icon-concept-card strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.credits-icon-concept-card span {
  color: var(--sub);
  font-size: 11px;
  line-height: 1.35;
}

.credits-balance-label,
.credits-balance-sub,
.credits-inline-note,
.credit-history-meta {
  color: var(--sub);
}
.credits-balance-value {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}
.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.credits-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.credits-referral-panel {
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(248,178,93,.16), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}
.credits-referral-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(248,178,93,.28);
  background: rgba(248,178,93,.12);
  color: #ffd89e;
  font-size: 12px;
  font-weight: 700;
}
.credits-invite-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(120,198,255,.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 20%, rgba(120,198,255,.2), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(248,178,93,.18), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}
.credits-invite-orb {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #78c6ff, #f8b25d);
  color: #080912;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(120,198,255,.18);
}
.credits-invite-copy {
  min-width: 0;
}
.credits-invite-kicker {
  color: #8fd0ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.credits-invite-title {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.credits-invite-text {
  margin-top: 5px;
  color: rgba(232,233,241,.78);
  font-size: 13px;
  line-height: 1.45;
}
.credits-invite-code-wrap {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.credits-invite-code {
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(248,178,93,.26);
  background: rgba(8,9,18,.52);
  color: #ffe0a8;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .12em;
  text-align: center;
}
.credits-invite-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.credits-referral-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.credits-referral-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.credits-referral-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sub);
}
.credits-referral-code-row,
.credits-redeem-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.credits-referral-code {
  flex: 1 1 220px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid rgba(248,178,93,.22);
  background: rgba(12,15,24,.4);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.credits-referral-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.credits-icon-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.credits-icon-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}
#creditsView .credits-icon-btn,
#creditsView .credits-referral-actions .credits-icon-btn,
.credits-referral-actions .credits-icon-btn {
  border-color: rgba(255,255,255,.12);
  background: rgba(28,31,48,.78);
  color: rgba(238,241,255,.9);
}
.credits-referral-actions .credits-icon-btn:hover {
  background: rgba(43,47,70,.92);
  border-color: rgba(255,255,255,.18);
}
.credits-redeem-row input {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(12,15,24,.42);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.credits-referral-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.credits-referral-stat-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(12,15,24,.24);
}
.credits-referral-stat-card span {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
}
.credits-referral-stat-card strong {
  font-size: 28px;
  line-height: 1;
}
.credits-referral-history {
  max-height: min(36vh, 320px);
}
.credit-offers,
.credit-history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}
.credit-history-list {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}
.credit-offer-card,
.credit-history-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  min-width: 0;
}
.credit-offer-card.muted {
  opacity: .82;
}
.credit-offer-top,
.credit-history-item {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.credit-offer-top > div:first-child,
.credit-history-item > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
}
.credit-offer-title,
.credit-history-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.credit-offer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(100, 214, 154, .14);
  border: 1px solid rgba(100, 214, 154, .32);
  color: #8ff0b9;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.credit-offer-copy {
  color: var(--sub);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.credit-pack-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.credit-pack-energy-amount {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(105, 225, 255, .22);
  background: rgba(105, 225, 255, .08);
  color: #f6fbff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}
.credit-pack-energy-amount .energy-inline-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 9px rgba(69, 223, 255, .32));
}
.credit-pack-amount.is-estimate > span:not(.credit-pack-energy-amount) {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}
.credit-offer-amount,
.credit-offer-price,
.credit-history-delta {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.credit-offer-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.credit-offer-old-price {
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  text-decoration: line-through;
}
.credit-offer-card .btn-save,
.credit-offer-card .btn-save.secondary {
  width: 100%;
  margin-top: 14px;
  justify-content: center;
}
.custom-credit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.custom-credit-label {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--sub);
  background: rgba(255,255,255,.04);
}
.custom-credit-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  font: inherit;
}
.paypal-button-slot {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
}
.google-pay-button-slot {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
}
.google-pay-button-slot.hidden {
  display: none !important;
  min-height: 0;
  margin-top: 0;
}
.google-pay-button-slot > div,
.google-pay-button-slot button {
  width: 100%;
}
.google-play-button-slot {
  width: 100%;
  min-height: 0;
  margin-top: 12px;
}
.google-play-billing-btn {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 18%, rgba(128,221,255,.26), transparent 32%),
    linear-gradient(135deg, rgba(114,95,255,.96), rgba(46,39,121,.96));
  color: #fff;
  font: inherit;
  text-align: left;
  box-shadow: 0 14px 28px rgba(78,56,205,.24);
  cursor: pointer;
  touch-action: manipulation;
}
.google-play-billing-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity .18s ease, transform .28s ease;
}
.google-play-billing-btn:hover::after,
.google-play-billing-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(55%);
}
.google-play-billing-btn:focus-visible {
  outline: 2px solid rgba(143,220,255,.72);
  outline-offset: 2px;
}
.google-play-billing-btn:disabled {
  cursor: progress;
  opacity: .72;
}
.google-play-button-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 8px 18px rgba(0,0,0,.28);
}
.google-play-button-mark::before {
  content: none;
}
.google-play-button-mark img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.google-play-button-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.google-play-button-title {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.google-play-button-subtitle {
  min-width: 0;
  overflow: hidden;
  color: rgba(236,239,255,.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.google-play-button-chevron {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.72);
  font-size: 0;
  font-weight: 900;
}
.google-play-button-chevron::before {
  content: "\203A";
  font-size: 26px;
  line-height: 1;
}
.google-play-restore-row {
  display: grid;
  width: 100%;
}
.google-play-restore-btn {
  width: 100%;
}
.credit-history-meta {
  margin-top: 4px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.credit-history-delta.positive {
  color: #64d69a;
}
.credit-history-delta.negative {
  color: #ff8f8f;
}
.credit-history-empty {
  color: var(--sub);
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
}
.chayt-plus-credit-panel,
.chayt-plus-hero,
.chayt-plus-plan-card.featured {
  background:
    radial-gradient(circle at top right, rgba(120,198,255,.24), transparent 38%),
    radial-gradient(circle at 0% 0%, rgba(255,204,92,.18), transparent 34%),
    linear-gradient(135deg, rgba(248,178,93,.14), rgba(255,255,255,.04));
}
.chayt-plus-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chayt-plus-feature-row span,
.chayt-plus-kicker,
.chayt-plus-plan-kicker,
.premium-review-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(248,178,93,.28);
  background: rgba(248,178,93,.12);
  color: #ffe0a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(248,178,93,.16);
  border: 1px solid rgba(248,178,93,.34);
  color: #ffe0a8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.premium-verify-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: -3px;
  border-radius: 4px;
  color: #f6c947;
  cursor: help;
  filter: drop-shadow(0 0 5px rgba(255, 212, 71, .36));
  animation: chaytPlusMarkGlow 2.6s ease-in-out infinite;
}
.premium-verify-badge svg {
  width: 18px;
  height: 18px;
  display: block;
}
.premium-verify-badge::before,
.premium-verify-badge::after {
  content: none !important;
  display: none !important;
}
.premium-verify-badge:hover {
  animation-duration: 1.35s;
  filter: drop-shadow(0 0 9px rgba(255, 216, 77, .56));
}
@keyframes chaytPlusMarkGlow {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 4px rgba(255, 212, 71, .30)); }
  48% { transform: translateY(-.5px) scale(1.07); filter: drop-shadow(0 0 10px rgba(255, 216, 77, .56)); }
  62% { transform: translateY(0) scale(1); }
}
.review-social-btn.has-user-reaction svg .thumb-body,
.review-reply-reaction-btn.has-user-reaction svg .thumb-body,
.review-vote-choice.is-selected svg .thumb-body,
.review-vote-choice.is-touch-target svg .thumb-body {
  fill: currentColor;
  fill-opacity: .95;
}
.review-social-btn.has-user-reaction svg .thumb-cuff,
.review-reply-reaction-btn.has-user-reaction svg .thumb-cuff,
.review-vote-choice.is-selected svg .thumb-cuff,
.review-vote-choice.is-touch-target svg .thumb-cuff {
  fill: transparent;
}
.review-premium-badge.premium-verify-badge {
  padding: 0;
  border: 0;
  background: transparent;
  letter-spacing: 0;
}
.bot-owner-premium-badge {
  margin-left: 3px;
}
.bot-owner-premium-badge.premium-verify-badge,
.bot-owner-premium-badge.premium-verify-badge:hover {
  animation: none;
  transform: none;
  filter: drop-shadow(0 0 5px rgba(255, 212, 71, .32));
}
.detail-badges .bot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  line-height: 1;
  padding-top: 3px;
  padding-bottom: 3px;
}
.bot-chip.bot-chip-sfw {
  background: rgba(34, 197, 94, .13);
  border-color: rgba(74, 222, 128, .34);
  color: #88f0ad;
}
.bot-chip.bot-chip-nsfw {
  background: rgba(239, 68, 68, .13);
  border-color: rgba(248, 113, 113, .36);
  color: #ff9aa8;
}
.review-reply-head .premium-verify-badge,
.review-user-copy .premium-verify-badge,
.bot-card-badges .premium-verify-badge,
.detail-badges .premium-verify-badge {
  color: #f6c947;
}
.chayt-plus-feature-row span,
.premium-review-badge {
  min-height: 24px;
  padding: 3px 9px;
}
.chayt-plus-mini-plans,
.chayt-plus-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.chayt-plus-mini-plan,
.chayt-plus-plan-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(12,15,24,.34);
}
.chayt-plus-mini-plan {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    rgba(10,12,20,.54);
}
.chayt-plus-mini-plan:nth-child(2) {
  border-color: rgba(255,204,92,.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(255,204,92,.16), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028)),
    rgba(10,12,20,.58);
}
.chayt-plus-plan-title,
.chayt-plus-plan-card h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}
.chayt-plus-plan-copy,
.chayt-plus-status {
  color: var(--sub);
  line-height: 1.5;
}
.chayt-plus-plan-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 24px;
  font-weight: 900;
}
.chayt-plus-plan-price.large {
  font-size: 34px;
}
.chayt-plus-plan-price .chayt-plus-list-price {
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
  text-decoration: line-through;
}
.chayt-plus-plan-price .chayt-plus-current-price {
  color: inherit;
  font-size: inherit;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.chayt-plus-plan-price .chayt-plus-plan-period {
  color: var(--sub);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.chayt-plus-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 18px;
}
.chayt-plus-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 26px;
  padding: 28px;
}
.chayt-plus-hero h1 {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .98;
  letter-spacing: 0;
}
.chayt-plus-hero p {
  max-width: 650px;
  margin: 14px 0 0;
  color: rgba(232,233,241,.82);
  line-height: 1.55;
}
.chayt-plus-kicker,
.chayt-plus-plan-kicker {
  padding: 5px 10px;
}
.chayt-plus-status {
  margin-top: 18px;
}
.chayt-plus-proof {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(120,198,255,.24);
  background: rgba(120,198,255,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.24);
}
.chayt-plus-proof.review-item {
  width: 100%;
  justify-self: stretch;
}
.chayt-plus-review-avatar {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 225, 146, .36), transparent 34%),
    linear-gradient(135deg, rgba(248,178,93,.26), rgba(120,198,255,.18)),
    rgba(255,255,255,.06);
  border: 1px solid rgba(255, 224, 168, .28);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 10px 24px rgba(0,0,0,.22);
}
.chayt-plus-review-avatar svg {
  width: 20px;
  height: 20px;
  fill: #ffe8ad;
  filter: drop-shadow(0 0 7px rgba(255,212,71,.22));
}
.chayt-plus-proof-tag {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(248,178,93,.18);
  border: 1px solid rgba(248,178,93,.32);
  color: #ffe0a8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.chayt-plus-proof-name {
  font-size: 24px;
  font-weight: 900;
}
.chayt-plus-proof-copy {
  color: rgba(232,233,241,.78);
  line-height: 1.45;
}
.chayt-plus-benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.chayt-plus-benefits article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.chayt-plus-benefits strong {
  font-size: 16px;
}
.chayt-plus-benefits span,
.chayt-plus-benefit-list {
  color: var(--sub);
  line-height: 1.5;
}
.chayt-plus-benefits span {
  display: block;
}
.chayt-plus-benefit-energy-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -4px;
  position: relative;
  top: 0;
  margin: 0 2px;
  filter: drop-shadow(0 0 7px rgba(69, 223, 255, .28));
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}
.chayt-plus-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.chayt-plus-benefit-list {
  margin: 0;
  padding-left: 18px;
}
.chayt-plus-benefit-list li {
  margin: 6px 0;
}
.chayt-plus-benefit-energy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f6fbff;
  font-weight: 900;
  white-space: nowrap;
}
.chayt-plus-benefit-energy .energy-inline-icon {
  width: 18px;
  height: 18px;
  position: relative;
  top: 0;
  filter: drop-shadow(0 0 7px rgba(69, 223, 255, .28));
}

.chayt-plus-benefit-list .chayt-plus-benefit-energy {
  position: relative;
  top: 2px;
}

#creditsView img[src="/assets/images/Energy.webp"],
#chaytPlusView img[src="/assets/images/Energy.webp"] {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}
.review-item.is-premium-review {
  border-color: rgba(248,178,93,.3);
  background:
    linear-gradient(135deg, rgba(248,178,93,.12), rgba(120,198,255,.07)),
    rgba(255,255,255,.04);
}
.review-item.is-premium-review .review-user-copy strong {
  color: #ffe7b8;
}
.credits-warning {
  margin-top: 12px;
  border: 1px solid rgba(255, 184, 77, .35);
  background: rgba(255, 184, 77, .1);
  color: #ffd08a;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
}
.credit-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 120;
}
.credit-burst {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 18px 24px;
  border-radius: 22px;
  border: 1px solid rgba(248,178,93,.28);
  background: rgba(13,16,24,.86);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  opacity: 0;
  transform: translateY(24px) scale(.9);
}
.credit-burst.show {
  animation: creditBurstPop 1.7s ease forwards;
}
.credit-burst strong {
  font-size: clamp(34px, 7vw, 56px);
  line-height: .95;
  color: #ffd89e;
}
.credit-burst span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
@keyframes creditBurstPop {
  0% { opacity: 0; transform: translateY(28px) scale(.88); }
  14% { opacity: 1; transform: translateY(0) scale(1); }
  72% { opacity: 1; transform: translateY(-8px) scale(1.04); }
  100% { opacity: 0; transform: translateY(-30px) scale(.98); }
}

@media (max-width: 920px) {
  #sidebar { width: 260px; min-width: 260px; }
  #homeView { padding: 24px 18px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .home-toolbar { flex-direction: column; align-items: stretch; }
  .home-toolbar > * { width: 100%; }
  .mobile-create-btn {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .credits-page { padding: 20px 16px 32px; }
  .credits-topbar,
  .generator-topbar { display: flex; }
  .generator-page { padding: 20px 16px 32px; }
  .generator-hero,
  .generator-layout {
    grid-template-columns: 1fr;
  }
  .generator-hero > div:first-child {
    padding: 22px 18px;
  }
  .generator-format-list {
    grid-template-columns: 1fr;
  }
  .generator-output {
    min-height: min(520px, 68vh);
  }
  .generator-section-head {
    display: grid;
    gap: 10px;
  }
  .credits-grid { grid-template-columns: 1fr; }
  .credits-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
   .credits-hero > div:first-child {
    padding: 22px 18px;
   }
  .credits-balance-card {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .credits-mini-stats,
  .credits-icon-concept-grid,
  .credits-referral-grid,
  .credits-referral-stats {
    grid-template-columns: 1fr;
  }
  .credits-invite-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }
  .credits-invite-orb {
    width: 42px;
    height: 42px;
    border-radius: 15px;
  }
  .credits-invite-code-wrap {
    justify-items: stretch;
  }
  .credits-invite-code {
    min-width: 0;
    width: 100%;
  }
  .credits-invite-actions {
    justify-content: stretch;
  }
  .credits-invite-actions .mini-btn {
    flex: 1 1 120px;
  }
  .chat-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back info actions";
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
  }
  #backBtn { grid-area: back; }
  .chat-bot-info { grid-area: info; min-width: 0; }
  .chat-actions {
    grid-area: actions;
    margin-left: 0;
    justify-self: end;
    flex-wrap: nowrap;
  }
  .chat-meta { min-width: 0; }
  .chat-name,
  .chat-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-menu {
    right: 0;
    left: auto;
    top: calc(100% + 10px);
    max-width: min(86vw, 260px);
  }
  .avatar-crop-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .avatar-crop-preview {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .mobile-menu-link {
    display: flex !important;
  }
  .mobile-home-topbar {
    display: grid;
    gap: 14px;
    align-items: stretch;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(18,18,24,0.86);
    backdrop-filter: blur(16px);
    margin: -24px -18px 16px;
  }
  .mobile-home-shortcuts {
    display: flex;
    justify-content: flex-start;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .mobile-home-shortcuts::-webkit-scrollbar {
    display: none;
  }
  .mobile-home-shortcut {
    flex: 0 0 auto;
  }

  .install-promo {
    margin-top: 0;
    border-radius: 20px;
  }

  .mobile-discovery-links {
    display: grid;
    gap: 10px;
  }

  .discovery-socials {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  #main .view,
  #main .create-body,
  #main .settings-body,
  #main .credits-page,
  #main .recent-chats-page,
  #main .history-body,
  #main #yourCharactersView,
  #main #aimodelratingView {
    scrollbar-gutter: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  #main .view::-webkit-scrollbar,
  #main .create-body::-webkit-scrollbar,
  #main .settings-body::-webkit-scrollbar,
  #main .credits-page::-webkit-scrollbar,
  #main .recent-chats-page::-webkit-scrollbar,
  #main .history-body::-webkit-scrollbar,
  #main #yourCharactersView::-webkit-scrollbar,
  #main #aimodelratingView::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  #homeView {
    padding: 0 16px calc(140px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 8px;
  }

  #homeView .home-hero {
    display: contents;
    padding: 0;
    margin: 0;
  }

  #homeView .home-hero > div:first-child {
    display: contents;
  }

  .mobile-home-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    min-height: 68px;
    margin: 0 !important;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px !important;
    border-bottom: 0;
    background: rgba(18,18,24,0.97);
    backdrop-filter: blur(16px);
  }

  .discovery-title-row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 9px;
  }

  .mobile-home-copy {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .discovery-search-open-btn,
  .discovery-social-link {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    box-sizing: border-box;
  }

  .discovery-socials {
    flex-direction: row;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .discovery-social-link {
    padding: 0;
  }

  .mobile-home-copy h1 {
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .mobile-home-copy p {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: rgba(232,233,241,0.72);
  }

  .discovery-value-pills {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 6px;
    margin-top: 9px;
    padding: 0 2px 2px;
    overflow: visible;
    flex-wrap: wrap;
    scrollbar-width: none;
  }

  .discovery-value-pills::-webkit-scrollbar {
    display: none;
  }

  .discovery-value-pills span {
    flex: 0 1 auto;
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }

  #homeView .discovery-tabs {
    position: relative;
    top: auto;
    z-index: auto;
    min-height: 46px;
    gap: 16px;
    margin: calc(68px + env(safe-area-inset-top, 0px)) -16px 0 !important;
    padding: 8px 16px 0 !important;
    border-bottom: 0;
    background: #121218;
    backdrop-filter: blur(16px);
  }

  #homeView .discovery-tab {
    border-bottom: 0;
    height: 38px;
    gap: 6px;
    font-size: 17px;
    padding-bottom: 8px;
  }

  #homeView .discovery-tab-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  #homeView .discovery-tab.active::after {
    content: none;
  }

  #homeView .discovery-tabs:not(.indicator-ready) .discovery-tab.active {
    border-bottom: 2px solid rgba(255,255,255,0.94);
  }

  #homeView .discovery-tab-indicator {
    bottom: 0;
    background: rgba(255,255,255,0.94);
    box-shadow: none;
  }

  #homeView .ollama-discovery-notice {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 9px;
    flex: 0 0 auto;
    height: auto;
    min-height: max-content;
    margin: 8px 0 2px;
    padding: 10px 11px;
  }

  #homeView .ollama-notice-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  #homeView .ollama-notice-icon-img {
    width: 20px;
    height: 20px;
  }

  #homeView .ollama-notice-title {
    font-size: 13px;
  }

  #homeView .ollama-notice-copy p {
    font-size: 12px;
    line-height: 1.38;
  }

  #homeView .ollama-notice-action {
    grid-column: 2;
    justify-self: start;
    min-height: 32px;
    padding: 0 10px;
  }

  #homeView .ollama-notice-close {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  #homeView .today-with-chayt {
    margin: 8px 0 -8px;
    gap: 8px;
  }

  #homeView .today-chayt-head {
    align-items: flex-start;
  }

  #homeView .today-chayt-title {
    font-size: 13px;
  }

  #homeView .today-chayt-subtitle {
    font-size: 11px;
  }

  #homeView .today-chayt-rail {
    display: flex;
    gap: 10px;
    margin: 0 -16px;
    padding: 0 16px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  #homeView .today-chayt-rail::-webkit-scrollbar {
    display: none;
  }

  #homeView .today-chayt-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    flex: 0 0 min(340px, 88vw);
    min-height: 124px;
    padding: 10px;
  }

  #homeView .today-chayt-card-media,
  #homeView .today-chayt-card-blur-wrap {
    width: 104px;
    height: 104px;
  }

  #homeView .today-chayt-card-body {
    min-height: 104px;
    padding: 0 5px 0 0;
  }

  #homeView .today-chayt-card-title {
    font-size: 15px;
  }

  #homeView .today-chayt-card-copy {
    font-size: 12px;
  }

  #homeView #installPromoCard {
    display: none !important;
  }

  #homeView .discovery-quick-tags {
    position: static;
    top: auto;
    z-index: auto;
    margin: 0 -16px 12px;
    min-height: 50px;
    padding: 8px 16px 9px;
    background: rgba(18,18,24,0.94);
    backdrop-filter: blur(16px);
  }

  #homeView .discovery-quick-tag {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 32px;
  }

  #homeView .discovery-filter-loader {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px;
  }

  #homeView .discovery-support-banner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 150px) !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    margin: calc(116px + env(safe-area-inset-top, 0px)) 0 18px !important;
    padding: 12px !important;
    gap: 10px !important;
    height: max-content !important;
    min-height: max-content !important;
    max-height: none;
    overflow: visible !important;
    position: static !important;
    top: auto !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(139, 124, 246, 0.28) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(139, 124, 246, 0.18), rgba(34, 197, 94, 0.08)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18) !important;
  }

  #homeView .discovery-support-copy {
    display: grid !important;
    gap: 3px;
    visibility: visible !important;
  }

  #homeView .discovery-support-mobile-copy {
    display: none;
  }

  #homeView .discovery-support-kicker {
    font-size: 10px;
    display: block !important;
  }

  #homeView .discovery-support-title {
    font-size: 13px;
    line-height: 1.2;
    display: block !important;
  }

  #homeView .discovery-support-copy p {
    font-size: 12px;
    line-height: 1.35;
    display: block !important;
  }

  #homeView .support-goal-inline {
    display: flex !important;
    width: 100%;
    margin-top: 5px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.25;
    box-sizing: border-box;
  }

  #homeView .discovery-support-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-self: center;
  }

  #homeView .discovery-support-btn {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding-inline: 10px;
    font-size: 12px;
  }

  #homeView .home-toolbar {
    display: none !important;
  }

  .discovery-search-overlay {
    padding: 0;
    align-items: stretch;
    background: #050505;
    backdrop-filter: none;
  }

  .discovery-search-page {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: #050505;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: translateY(18px);
  }

  .discovery-search-page::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  .discovery-search-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: calc(76px + env(safe-area-inset-top, 0px));
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      12px
      max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 0;
    background: #050505;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    gap: 10px;
  }

  .discovery-search-field {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 54px;
    background: #171717;
    border-color: transparent;
    padding-inline: 12px;
  }

  .discovery-search-field input {
    font-size: 18px;
  }

  .discovery-search-cancel-btn {
    font-size: 18px;
    min-height: 44px;
  }

  .discovery-search-body {
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    padding: 4px 16px calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
    background: #050505;
  }

  .discovery-search-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .discovery-search-filters select {
    min-height: 42px;
    border-radius: 13px;
    font-size: 12px;
  }

  .discovery-search-actions {
    position: sticky;
    bottom: 0;
    padding-top: 4px;
    background: rgba(18,18,24,0.98);
  }

  .discovery-search-results {
    gap: 12px;
  }

  .discovery-search-result-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    min-height: 0;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    background: #111116;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
  }

  .discovery-search-simple-card {
    min-height: 0;
  }

  .discovery-search-simple-image {
    width: 118px;
    min-width: 118px;
    height: 100%;
    min-height: 158px;
    border: 0;
    border-right: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
  }

  .discovery-search-simple-copy {
    align-self: start;
    padding: 14px 0;
  }

  .discovery-search-simple-name {
    font-size: 18px;
  }

  .discovery-search-simple-desc {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .discovery-search-simple-tags {
    max-height: 26px;
  }

  .discovery-search-simple-count {
    position: absolute;
    left: 10px;
    top: 10px;
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
    background: rgba(9,10,16,0.72);
    backdrop-filter: blur(10px);
  }

  .discovery-search-simple-count svg {
    width: 13px;
    height: 13px;
  }

  .discovery-search-result-card .bot-card-media {
    width: 118px;
    min-width: 118px;
    height: 158px;
    aspect-ratio: auto;
    margin: 0;
    border: 0;
    border-right: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
  }

  .discovery-search-result-card .bot-card-body {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 0;
    padding: 10px 10px 10px 0;
  }

  .discovery-search-result-card:hover {
    background: #15151b;
    border-color: rgba(255,255,255,0.1);
    transform: none;
  }

  .discovery-search-result-card .bot-card-top,
  .discovery-search-result-card .bot-card-meta,
  .discovery-search-result-card .bot-card-footer,
  .discovery-search-result-card .bot-actions-row {
    padding-inline: 0;
  }

  .discovery-search-result-card .bot-card-top {
    margin-top: 0;
    min-height: 0;
    display: block;
  }

  .discovery-search-result-card .bot-card-name {
    font-size: 18px;
    line-height: 1.25;
    margin-top: 2px;
  }

  .discovery-search-result-card .bot-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.45;
  }

  .discovery-search-result-card .bot-card-badges {
    display: block;
    margin-top: 5px;
  }

  .discovery-search-result-card .bot-card-meta {
    display: none;
  }

  .discovery-search-result-card .bot-actions-row,
  .discovery-search-result-card .bot-card-created,
  .discovery-search-result-card .bot-card-meta::after {
    display: none;
  }

  .recent-chats-page {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .recent-chats-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-recent-your-characters-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    margin-bottom: 2px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    box-shadow: none;
    cursor: pointer;
  }

  .mobile-recent-your-characters-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
  }

  .mobile-recent-your-characters-btn:active {
    transform: scale(.99);
    background: rgba(255,255,255,0.07);
  }

  #patchNotesView .create-body {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  #patchNotesView .patch-notes-hero,
  #patchNotesView .patch-notes-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #patchNotesView .patch-notes-hero {
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #patchNotesView .patch-notes-card {
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #patchNotesView .patch-notes-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .patch-syntax-grid {
    grid-template-columns: 1fr;
  }

  .patch-showcase-grid {
    grid-template-columns: 1fr;
  }

  .patch-syntax-item summary {
    grid-template-columns: 1fr;
  }

  .patch-syntax-item summary::after {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .generator-page,
  .generator-panel,
  .generator-placeholder,
  .generator-output::before,
  .generator-chip.active,
  .generator-format-btn.active,
  .generator-output-img,
  .chayt-plus-upsell-card,
  .chayt-plus-upsell-benefits span,
  .generator-loading-card,
  .generator-loading-card::before,
  .generator-loading-orbit,
  .generator-loading-orbit span,
  .generator-hero > div:first-child::after,
  .chayt-plus-upsell-card::before {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .msg .rich-scene-command,
  .roleplay-preview-bubble .rich-scene-command {
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.22;
  }

  .msg .rich-scene-heading {
    font-size: 0.96em;
    line-height: 1.25;
  }

  .msg .rich-text-heading-large {
    font-size: 1.16em;
  }

  .msg .rich-text-heading-medium {
    font-size: 1.04em;
  }

  .msg .rich-text-heading-small {
    font-size: 0.96em;
  }

  .create-topbar {
    padding: 12px 14px;
  }
  .create-body,
  .settings-body {
    padding: 14px 12px 28px;
    gap: 14px;
    overflow-x: hidden;
  }
  .ai-provider-grid,
  .ai-provider-inner-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .ai-provider-flat,
  .ai-provider-grid .full,
  .ai-provider-inner-grid .full {
    grid-column: 1 / -1;
  }
  .ai-provider-fields {
    padding-top: 2px;
  }
  .recent-chat-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 0;
  }
  .mobile-home-topbar {
    margin-left: -14px;
    margin-right: -14px;
  }
  .install-promo {
    padding: 16px;
  }
  .install-promo-actions > * {
    flex: 1 1 160px;
    justify-content: center;
  }
  .recent-chat-card-avatar {
    width: 44px;
    height: 44px;
  }
  .recent-chat-card-top {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: baseline;
  }
  .panel {
    padding: 14px;
  }
  .avatar-column,
  .profile-avatar-row,
  .avatar-row,
  .form-grid,
  .settings-grid,
  .form-group {
    width: 100%;
    min-width: 0;
  }
  .big-avatar {
    margin-inline: auto;
  }
  .profile-avatar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-avatar-copy {
    width: 100%;
  }
  .avatar-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .avatar-controls > * {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }
  .media-slot-card,
  .media-gallery-panel,
  .profile-avatar-panel {
    padding: 14px;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions > * {
    width: 100%;
  }
  .create-persona-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .persona-action-card {
    min-height: 76px;
    gap: 10px;
    padding: 12px;
  }
  .persona-action-card span:last-child {
    min-width: 0;
  }
  .persona-action-card strong {
    font-size: 13px;
    line-height: 1.15;
  }
  .persona-action-card small {
    font-size: 11px;
    line-height: 1.25;
  }
  #createView .create-publish-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back info actions";
    padding: 12px 14px;
    column-gap: 8px;
  }
  #chatView.memory-open {
    overflow-y: auto;
  }
  #chatView.memory-open .messages {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }
  #chatView.memory-open .input-bar {
    margin-top: auto;
  }
  .chat-bot-info {
    gap: 10px;
  }
  .chat-avatar {
    width: 34px;
    height: 34px;
  }
  .input-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: end;
    gap: 8px;
    min-width: 0;
    padding:
      12px
      calc(12px + env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      calc(12px + env(safe-area-inset-left, 0px));
  }
  .composer-shell {
    min-width: 0;
    width: 100%;
    padding: 5px;
    border-radius: 25px;
  }
  .input-stack {
    flex: initial;
    min-width: 0;
    width: 100%;
  }
  #msgInput {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 10px 10px 13px;
  }
  .attach-btn,
  #sendBtn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    margin: 0;
    justify-self: stretch;
    align-self: end;
  }
  .composer-tools-modal {
    align-items: end;
    padding:
      12px
      calc(12px + env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      calc(12px + env(safe-area-inset-left, 0px));
  }
  .composer-tools-card {
    width: 100%;
    max-height: min(82vh, 680px);
    border-radius: 16px 16px 14px 14px;
  }
  .composer-tools-modal.is-opening .composer-tools-card,
  .composer-tools-modal.is-closing .composer-tools-card {
    transform: translateY(28px) scale(0.985);
  }
  .credits-page {
    padding: 16px 12px 28px;
    gap: 14px;
  }
  .generator-page {
    padding: 16px 12px 28px;
    gap: 14px;
  }
  .credits-balance-card,
  .credits-panel,
  .generator-panel,
  .generator-quota-card,
  .credit-offer-card,
  .credit-history-item {
    padding: 14px;
    border-radius: 18px;
  }
  .generator-hero h1 {
    font-size: 32px;
  }
  .generator-chip-list,
  .generator-recent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .generator-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .generator-actions .btn-save,
  .generator-actions .mini-btn {
    width: 100%;
  }
  .chayt-plus-upsell-card {
    padding: 20px;
  }
  .generator-loading-card {
    padding: 22px 18px;
  }
  .generator-loading-steps {
    grid-template-columns: 1fr;
  }
  .chayt-plus-upsell-benefits {
    grid-template-columns: 1fr;
  }
  .credits-balance-value {
    font-size: 36px;
  }

  .avatar-crop-card {
    width: min(96vw, 560px);
    padding: 16px;
    border-radius: 22px;
  }
  .avatar-crop-head {
    flex-direction: column;
  }
  .avatar-crop-preview {
    grid-template-columns: 1fr;
  }
  .avatar-crop-preview-box {
    width: min(140px, 100%);
  }
  .credit-offer-top,
  .credit-history-item {
    gap: 10px;
  }

  #patchNotesView .create-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-discovery-links-grid {
    grid-template-columns: 1fr;
  }
}

.mobile-app-update-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.mobile-app-update-modal.hidden {
  display: none;
}

body.mobile-app-update-required {
  overflow: hidden;
}

.mobile-app-update-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(236, 72, 153, .22), transparent 34%),
    rgba(6, 6, 10, .84);
  backdrop-filter: blur(14px);
}

.mobile-beta-access-modal .mobile-app-update-backdrop {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 210, 120, .22), transparent 34%),
    radial-gradient(circle at 50% 78%, rgba(139, 124, 246, .18), transparent 38%),
    rgba(6, 6, 10, .84);
}

.mobile-app-update-card {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 26px;
  background: rgba(18, 18, 25, .96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
  text-align: center;
  animation: mobileUpdateCardIn .38s cubic-bezier(.2, .8, .2, 1) both;
}

.mobile-app-update-art {
  width: min(180px, 52vw);
  aspect-ratio: 1;
  margin: -4px auto 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(139, 124, 246, .2), transparent 64%),
    radial-gradient(circle at 58% 44%, rgba(236, 72, 153, .2), transparent 58%);
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, .36));
  animation: mobileUpdateMascotFloat 4.6s ease-in-out .35s infinite;
}

.mobile-app-update-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mobile-beta-access-card .mobile-app-update-art {
  border-radius: 24px;
  aspect-ratio: 16 / 10;
  width: min(240px, 66vw);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
}

.mobile-beta-access-card .mobile-app-update-art img {
  object-fit: cover;
  object-position: center 36%;
}

.mobile-required-update-card {
  width: min(430px, 100%);
  overflow: hidden;
  padding: 0 22px 22px;
  background:
    linear-gradient(180deg, rgba(139, 124, 246, .13), transparent 42%),
    rgba(18, 18, 25, .96);
}

.mobile-required-update-card .mobile-app-update-art {
  width: calc(100% + 44px);
  height: 176px;
  aspect-ratio: auto;
  margin: 0 -22px 14px;
  border-radius: 0;
  overflow: visible;
  border: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 210, 120, .24), transparent 32%),
    radial-gradient(circle at 24% 20%, rgba(236, 72, 153, .22), transparent 42%),
    radial-gradient(circle at 82% 24%, rgba(58, 211, 255, .18), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0));
  filter: none;
  animation: none;
}

.mobile-required-update-card .mobile-app-update-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  opacity: .96;
  filter: saturate(.98) contrast(.98);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}

.mobile-required-update-card .mobile-app-update-kicker {
  color: #fff0b8;
  background: rgba(255, 210, 120, .14);
  border-color: rgba(255, 210, 120, .34);
}

.mobile-beta-access-card .mobile-app-update-kicker {
  border-color: rgba(255, 210, 120, .34);
  color: #fff0b8;
  background: rgba(255, 210, 120, .14);
}

.mobile-app-update-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  color: #d9d2ff;
  background: rgba(139, 124, 246, .14);
  font-size: 12px;
  font-weight: 800;
}

.mobile-app-update-card h2 {
  margin: 14px 0 0;
  color: #fff;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.mobile-app-update-card p {
  margin: 12px 0 0;
  color: rgba(247, 244, 255, .78);
  font-size: 14px;
  line-height: 1.55;
}

.mobile-app-update-meta {
  margin-top: 12px;
  color: rgba(247, 244, 255, .56);
  font-size: 12px;
  font-weight: 700;
}

.mobile-app-update-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mobile-app-update-actions .btn-save,
.mobile-app-update-actions .mini-btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.mobile-app-update-actions .mini-btn.ghost {
  border-color: rgba(255, 255, 255, .16);
  color: rgba(247, 244, 255, .86);
  background: rgba(255, 255, 255, .035);
}

.mobile-required-update-card .mobile-app-update-actions .btn-save {
  min-height: 50px;
  font-size: 15px;
}

.mobile-app-update-later {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: rgba(247, 244, 255, .62);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes mobileUpdateCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobileUpdateMascotFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@media (max-height: 680px) {
  .mobile-app-update-card {
    padding: 18px;
  }

  .mobile-app-update-art {
    width: min(132px, 42vw);
  }

  .mobile-app-update-card h2 {
    font-size: 22px;
  }
}

@media (max-width: 960px) {
  #creditsView .credits-page,
  .chayt-plus-page,
  #aimodelratingView .create-body,
  #settingsView .create-body,
  #historyView .history-body,
  #chatStyleView .history-body,
  #userPersonaView .history-body,
  #conversationMemoryView .history-body {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }

  .chayt-plus-hero,
  .chayt-plus-benefits,
  .chayt-plus-plans,
  .chayt-plus-mini-plans {
    grid-template-columns: 1fr;
  }

  .chayt-plus-hero {
    padding: 20px;
    border-radius: 20px;
  }

  .chayt-plus-hero h1 {
    font-size: 36px;
  }

  #creditsView .chayt-plus-credit-panel {
    height: auto;
    min-height: max-content;
    overflow: hidden;
  }

  #aimodelratingView .ai-model-rating-shell {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #aimodelratingView .ai-model-rating-toolbar {
    padding: 0 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #aimodelratingView .ai-model-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #aimodelratingView .ai-model-card:last-child {
    border-bottom: 0;
  }

  #aimodelratingView .ai-model-card-link {
    padding: 16px 0;
  }

  #aimodelratingView .ai-model-rating-detail-head,
  #aimodelratingView .ai-model-rating-summary-card,
  #aimodelratingView .ai-model-rating-form-card,
  #aimodelratingView .ai-model-comments-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #aimodelratingView .ai-model-rating-detail-head {
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #aimodelratingView .ai-model-rating-detail-grid {
    gap: 18px;
  }

  #aimodelratingView .ai-model-rating-summary-card,
  #aimodelratingView .ai-model-rating-form-card {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #aimodelratingView #aiModelRatingComments {
    max-height: none;
    overflow: visible;
  }

  #aimodelratingView .ai-model-comment {
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #aimodelratingView .ai-model-comment:last-of-type {
    border-bottom: 0;
  }

  #settingsView .panel {
    padding: 0 0 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #settingsView .settings-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #settingsView .settings-overview-card {
    border-radius: 12px;
    padding: 13px;
  }

  #settingsView .danger-zone-head,
  #settingsView .danger-zone-card {
    grid-template-columns: 1fr;
  }

  #settingsView .danger-zone-head {
    align-items: stretch;
  }

  #settingsView .danger-zone-badge {
    width: fit-content;
  }

  #settingsView .danger-zone-card {
    padding: 14px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  #settingsView .danger-zone-actions {
    justify-content: stretch;
  }

  #settingsView .danger-zone-actions > * {
    flex: 1 1 auto;
    text-align: center;
  }

  .delete-account-warning-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .delete-account-warning-card {
    width: 100%;
    max-height: min(88vh, 760px);
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .delete-account-warning-card h2 {
    font-size: 23px;
  }

  .delete-account-warning-actions {
    flex-direction: column-reverse;
  }

  .delete-account-warning-actions > * {
    width: 100%;
  }

  #settingsView .panel:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  #historyView .history-body {
    gap: 14px;
  }

  #historyView .history-list {
    gap: 0;
  }

  #historyView .history-card {
    padding: 16px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #historyView .history-card:last-child {
    border-bottom: 0;
  }

  #historyView .history-card-sessions {
    gap: 0;
  }

  #historyView .history-session {
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #historyView .history-session:last-child {
    border-bottom: 0;
  }

  #historyView .history-session:hover {
    background: transparent;
  }

  .mobile-slide-view.active {
    position: fixed;
    inset: 0;
    width: 100dvw;
    max-width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    box-sizing: border-box;
    z-index: 2400;
    background: var(--bg);
    overflow: hidden;
    animation: mobileSlideFromRight 0.26s cubic-bezier(.22,.7,.18,1) both;
  }

  .mobile-slide-view.is-leaving {
    position: fixed;
    inset: 0;
    width: 100dvw;
    max-width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    z-index: 2400;
    background: var(--bg);
    overflow: hidden;
    pointer-events: none;
    animation: mobileSlideToRight 0.24s cubic-bezier(.22,.7,.18,1) both;
  }

  #conversationMemoryView.active,
  #chatStyleView.active,
  #userPersonaView.active,
  #historyView.active {
    left: 0;
    right: 0;
    width: 100dvw;
    max-width: 100dvw;
  }

  #conversationMemoryView.active,
  #chatStyleView.active,
  #userPersonaView.active {
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
    height: 100dvh;
    min-height: 100dvh;
  }

  #conversationMemoryView .history-topbar,
  #chatStyleView .history-topbar,
  #userPersonaView .history-topbar,
  #historyView .history-topbar,
  #conversationMemoryView .history-body,
  #chatStyleView .history-body,
  #userPersonaView .history-body,
  #historyView .history-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #conversationMemoryView .conversation-memory-body,
  #chatStyleView .chat-style-body,
  #userPersonaView .user-persona-body {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    align-content: start;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }

  #conversationMemoryView .conversation-memory-body {
    flex: 1 0 auto;
    min-height: calc(100vh - 78px);
    min-height: calc(100svh - 78px);
    min-height: calc(100dvh - 78px);
    background: var(--bg);
  }

  #chatStyleView .chat-style-body,
  #userPersonaView .user-persona-body {
    flex: 1 1 auto;
    min-height: 0;
    background: var(--bg);
  }

  #chatStyleView .chat-style-panel,
  #userPersonaView .user-persona-page-panel {
    width: 100%;
  }

  #conversationMemoryView .memory-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    gap: 16px;
  }

  #conversationMemoryView .memory-panel-head {
    gap: 14px;
  }

  #conversationMemoryView .memory-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #conversationMemoryView .memory-actions .memory-icon-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  #conversationMemoryView .memory-model-grid {
    grid-template-columns: 1fr;
    margin: 0;
  }

  #chatStyleView .memory-model-field {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #chatStyleView .chat-style-model-browser,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-browser {
    gap: 18px;
  }

  #chatStyleView .chat-style-model-section,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-section {
    gap: 10px;
    min-width: 0;
  }

  #chatStyleView .chat-style-section-pill,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-pill {
    min-height: 34px;
    padding: 0;
    border-radius: 0;
    font-size: 18px;
  }

  #chatStyleView .chat-style-section-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-note {
    font-size: 11px;
  }

  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 224px);
    grid-template-columns: unset;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 1px 16px 14px 2px;
    scroll-padding-right: 16px;
    touch-action: pan-x;
  }

  #chatStyleView .chat-style-model-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card {
    min-height: 186px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(70px, 1fr) auto;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    border-radius: 12px;
    background: #242427;
  }

  #chatStyleView .chat-style-model-title,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-title {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.055);
    font-size: 18px;
    line-height: 1.18;
  }

  #chatStyleView .chat-style-model-desc,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-desc {
    grid-column: auto;
    font-size: 13px;
    line-height: 1.42;
  }

  #chatStyleView .chat-style-model-foot,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    align-self: end;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    font-size: 10.5px;
  }

  #chatStyleView .chat-style-energy-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-energy-note {
    max-width: 108px;
  }

  #yourCharactersView .your-characters-page {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
  }

  #yourCharactersView .your-characters-hero,
  #yourCharactersView .your-characters-toolbar {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #yourCharactersView .your-characters-hero::after {
    display: none;
  }

  #yourCharactersView .your-characters-hero {
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 18px;
  }

  #yourCharactersView .your-characters-toolbar {
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 16px;
  }

  #yourCharactersView .your-characters-grid {
    gap: 0;
  }

  #yourCharactersView .your-character-card {
    padding: 16px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  #yourCharactersView .your-character-card:hover {
    transform: none;
    border-color: rgba(255,255,255,0.06);
  }

  #yourCharactersView .your-character-card:last-child {
    border-bottom: 0;
  }

  #creditsView .credits-hero > div:first-child,
  #creditsView .credits-balance-card,
  #creditsView .credits-panel {
    padding-left: 0;
    padding-right: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #creditsView .credits-hero {
    gap: 14px;
  }

  #creditsView .credits-page > * {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 18px;
  }

  #creditsView .credits-page > *:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 560px) {
  #homeView .discovery-support-banner {
    grid-template-columns: minmax(0, 1fr) minmax(108px, 132px) !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  #homeView .discovery-support-copy {
    gap: 2px !important;
  }

  #homeView .discovery-support-title {
    font-size: 12px !important;
    line-height: 1.22 !important;
  }

  #homeView .discovery-support-copy p {
    font-size: 11px !important;
    line-height: 1.28 !important;
  }

  #homeView .support-goal-inline {
    font-size: 10px !important;
    line-height: 1.2 !important;
    padding: 5px 7px !important;
  }

  #homeView .discovery-support-btn {
    min-height: 31px !important;
    font-size: 11px !important;
  }

  #homeView .discovery-tabs {
    margin: calc(68px + env(safe-area-inset-top, 0px)) -12px 0 !important;
    gap: 8px;
    padding: 8px 12px 0 !important;
  }

  #homeView .discovery-tab {
    gap: 4px;
    font-size: 16px;
    padding-bottom: 8px;
  }

  #homeView .discovery-tab-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  @media (max-width: 380px) {
    #homeView .discovery-tabs {
      gap: 5px;
      padding-left: 10px !important;
      padding-right: 10px !important;
    }

    #homeView .discovery-tab {
      gap: 3px;
      font-size: 15px;
    }

    #homeView .discovery-tab-icon {
      width: 20px;
      height: 20px;
      flex-basis: 20px;
    }
  }

  .profile-interest-panel {
    padding: 10px;
  }

  .profile-interest-head {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-interest-search {
    width: 100%;
  }

  .profile-interest-chip {
    min-height: 32px;
    padding: 5px 9px;
  }

  #creditsView .credits-page,
  #aimodelratingView .create-body,
  #settingsView .create-body,
  #historyView .history-body,
  #conversationMemoryView .history-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    grid-auto-columns: minmax(176px, 212px);
  }

  #aimodelratingView .ai-model-card,
  #aimodelratingView .ai-model-rating-summary-card,
  #aimodelratingView .ai-model-rating-form-card,
  #aimodelratingView .ai-model-comments-card {
    border-radius: 20px;
  }

  #aimodelratingView .ai-model-card {
    border-radius: 0;
  }

  .ai-model-comments-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-model-comments-pagination-left,
  .ai-model-comments-pagination-actions {
    width: 100%;
    justify-content: space-between;
  }

  .ai-model-comments-page-info {
    flex: 1 1 auto;
    text-align: center;
  }

  #historyView .history-session {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }

  #historyView .history-session-preview {
    grid-column: 2 / -1;
  }

  #yourCharactersView .your-characters-page {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (min-width: 961px) {
  #creditsView .credits-topbar,
  #creditsView .credits-page,
  #aimodelratingView .create-topbar,
  #aimodelratingView .create-body {
    width: min(calc(100% - 32px), 1476px);
    max-width: 1476px;
    align-self: center;
    box-sizing: border-box;
  }

  #settingsView .create-topbar,
  #settingsView .create-body {
    width: min(100%, 960px);
    max-width: 960px;
    align-self: center;
    box-sizing: border-box;
  }

  #creditsView .credits-page,
  #aimodelratingView .create-body,
  #settingsView .create-body {
    flex: 0 1 auto;
    overflow-x: hidden;
  }

  #aimodelratingView .ai-model-rating-shell,
  #aimodelratingView .ai-model-rating-toolbar,
  #aimodelratingView .ai-model-rating-grid,
  #creditsView .credits-page > * {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  .discovery-search-page {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  }

  .discovery-search-head {
    z-index: 8;
  }

  .discovery-search-body {
    overflow: visible;
    padding-top: 10px;
  }

  .discovery-search-results {
    overflow: visible;
    gap: 12px;
    padding-bottom: calc(156px + env(safe-area-inset-bottom, 0px));
  }

  .discovery-search-result-card.discovery-search-simple-card {
    grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
    min-height: 174px;
    border-radius: 14px;
    overflow: hidden;
  }

  .discovery-search-simple-image,
  .discovery-search-result-card .bot-card-media {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 174px;
  }

  .discovery-search-simple-copy {
    min-width: 0;
    align-self: stretch;
    align-content: center;
    padding: 16px 12px 16px 0;
    overflow: hidden;
  }

  .discovery-search-simple-name,
  .discovery-search-simple-desc {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .discovery-search-simple-name {
    font-size: clamp(19px, 5vw, 24px);
    line-height: 1.16;
  }

  .discovery-search-simple-desc {
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.35;
    -webkit-line-clamp: 3;
  }

  .discovery-search-simple-tags {
    max-height: none;
    gap: 6px;
    overflow: visible;
  }

  .discovery-search-simple-tags .bot-chip {
    max-width: 100%;
  }

  .discovery-search-load-more-modal {
    position: sticky;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    z-index: 7;
    width: min(420px, calc(100% - 18px));
    margin: 10px auto calc(18px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 960px) {
  #settingsView .settings-body {
    gap: 16px !important;
    padding-top: 14px !important;
    padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #settingsView .settings-overview {
    position: relative;
    margin-bottom: 2px;
  }

  #settingsView .settings-overview-card {
    border-radius: 18px;
    border-color: rgba(255,255,255,0.09);
    background:
      radial-gradient(circle at 0% 0%, rgba(139,124,246,0.18), transparent 46%),
      linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
  }

  #settingsView .panel {
    padding: 16px !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 20px !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
      rgba(15,15,21,0.86) !important;
    box-shadow: 0 16px 44px rgba(0,0,0,0.16) !important;
  }

  #settingsView .panel-title {
    color: rgba(226,226,238,0.94);
    font-size: 15px;
    letter-spacing: 0.06em;
  }

  #settingsView .setting-help.full-line,
  #settingsView .setting-help {
    color: rgba(164,164,194,0.92);
    line-height: 1.5;
  }

  #settingsView .profile-settings-guide {
    gap: 10px;
  }

  #settingsView .profile-settings-guide .settings-guide-card {
    padding: 13px;
    border-radius: 16px;
    border-color: rgba(139,124,246,0.18);
    background: rgba(139,124,246,0.065);
  }

  #settingsView .profile-avatar-row-flat {
    align-items: center;
    text-align: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    background: rgba(0,0,0,0.16);
  }

  #settingsView .profile-avatar-row-flat .big-avatar {
    width: 86px;
    height: 86px;
  }

  #settingsView .profile-avatar-copy {
    width: 100%;
  }

  #settingsView .profile-avatar-copy .profile-section-title {
    justify-content: center;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #settingsView .avatar-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #settingsView .avatar-controls .mini-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  #settingsView .form-section-heading {
    margin: 6px 0 0;
    padding: 10px 0 2px;
    color: rgba(226,226,238,0.95);
    font-size: 12px;
    letter-spacing: 0.09em;
  }

  #settingsView .profile-grid > .form-group,
  #settingsView .settings-grid > .form-group {
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.065);
    border-radius: 16px;
    background: rgba(0,0,0,0.13);
  }

  #settingsView .profile-grid > .form-group.full {
    grid-column: 1 / -1;
  }

  #settingsView .form-group input,
  #settingsView .form-group textarea,
  #settingsView .form-group select {
    min-height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
  }

  #settingsView .form-row {
    gap: 12px;
    padding: 14px 0;
  }

  #settingsView .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #settingsView .profile-actions > * {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  #settingsView #dangerZonePanel {
    margin-top: 4px;
    margin-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    border-color: rgba(224,85,85,0.34) !important;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.2), transparent 48%),
      linear-gradient(180deg, rgba(224,85,85,0.085), rgba(255,255,255,0.018)),
      rgba(15,15,21,0.95) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-card {
    padding: 13px;
    border: 1px solid rgba(224,85,85,0.18);
    border-radius: 16px;
    background: rgba(0,0,0,0.18);
  }
}

/* Settings overlay + final mobile cleanup pass */
.settings-overview-card {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 961px) {
  body.chat-overlay-open #historyView.active,
  body.chat-overlay-open #chatStyleView.active,
  body.chat-overlay-open #userPersonaView.active,
  body.chat-overlay-open #conversationMemoryView.active {
    position: fixed;
    inset: 0;
    z-index: 2150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(8,8,12,0.74);
    backdrop-filter: blur(16px);
    overflow: hidden;
    animation: chatOverlayBackdropIn 260ms cubic-bezier(.22,.7,.18,1) both;
  }

  #historyView.active.is-overlay-closing,
  #chatStyleView.active.is-overlay-closing,
  #userPersonaView.active.is-overlay-closing,
  #conversationMemoryView.active.is-overlay-closing,
  body.chat-overlay-open #historyView.active.is-overlay-closing,
  body.chat-overlay-open #chatStyleView.active.is-overlay-closing,
  body.chat-overlay-open #userPersonaView.active.is-overlay-closing,
  body.chat-overlay-open #conversationMemoryView.active.is-overlay-closing {
    pointer-events: none;
    animation: chatOverlayBackdropOut 260ms cubic-bezier(.32,0,.2,1) both;
  }

  body.chat-overlay-open #historyView .history-topbar,
  body.chat-overlay-open #chatStyleView .history-topbar,
  body.chat-overlay-open #userPersonaView .history-topbar,
  body.chat-overlay-open #conversationMemoryView .history-topbar,
  body.chat-overlay-open #historyView .history-body,
  body.chat-overlay-open #chatStyleView .history-body,
  body.chat-overlay-open #userPersonaView .history-body,
  body.chat-overlay-open #conversationMemoryView .history-body {
    width: min(960px, calc(100vw - 56px));
    max-width: 960px;
    box-sizing: border-box;
    animation: chatOverlayPanelIn 300ms cubic-bezier(.18,.84,.24,1) both;
  }

  #historyView.active.is-overlay-closing .history-topbar,
  #historyView.active.is-overlay-closing .history-body,
  #chatStyleView.active.is-overlay-closing .history-topbar,
  #chatStyleView.active.is-overlay-closing .history-body,
  #userPersonaView.active.is-overlay-closing .history-topbar,
  #userPersonaView.active.is-overlay-closing .history-body,
  #conversationMemoryView.active.is-overlay-closing .history-topbar,
  #conversationMemoryView.active.is-overlay-closing .history-body {
    animation: chatOverlayPanelOut 230ms cubic-bezier(.32,0,.2,1) both;
  }

  body.chat-overlay-open #historyView .history-topbar,
  body.chat-overlay-open #chatStyleView .history-topbar,
  body.chat-overlay-open #userPersonaView .history-topbar,
  body.chat-overlay-open #conversationMemoryView .history-topbar {
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background:
      radial-gradient(circle at 12% 0%, rgba(139,124,246,0.16), transparent 42%),
      rgba(18,18,24,0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.34);
  }

  body.chat-overlay-open #historyView .history-body,
  body.chat-overlay-open #chatStyleView .history-body,
  body.chat-overlay-open #userPersonaView .history-body,
  body.chat-overlay-open #conversationMemoryView .history-body {
    max-height: min(820px, calc(100dvh - 112px));
    overflow-y: auto;
    padding: 24px 26px 32px;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 0;
    border-radius: 0 0 22px 22px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012)),
      rgba(13,13,18,0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  }

  body.chat-overlay-open #historyView .history-list {
    max-height: none;
  }

  body.chat-overlay-open #chatStyleView .chat-style-panel,
  body.chat-overlay-open #userPersonaView .user-persona-page-panel,
  body.chat-overlay-open #conversationMemoryView .memory-panel {
    width: 100%;
  }

  body.chat-overlay-open #conversationMemoryView .memory-panel {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
  }

  body.chat-overlay-open #conversationMemoryView .memory-model-grid {
    grid-template-columns: 1fr;
    margin: 8px 0 0;
  }

  body.chat-overlay-open #conversationMemoryView .memory-model-field {
    width: 100%;
    min-width: 0;
  }

  body.chat-overlay-open #conversationMemoryView #conversationSummaryModelPicker {
    width: 100%;
    min-width: 0;
  }

  body.chat-overlay-open #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-browser {
    gap: 16px;
  }

  body.chat-overlay-open #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    padding-bottom: 4px;
  }

  body.chat-overlay-open #conversationMemoryView #conversationSummaryModelHint {
    display: none;
  }

  body.chat-overlay-open #conversationMemoryView #conversationSummaryInput {
    min-height: 128px;
    max-height: 180px;
    order: 2;
  }

  body.chat-overlay-open #conversationMemoryView .memory-model-grid {
    order: 3;
  }

  #chatView .chat-menu .chat-menu-new-btn svg {
    display: none;
  }

  #chatView .chat-menu .chat-menu-new-btn {
    gap: 0;
  }
}

@keyframes chatOverlayBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes chatOverlayBackdropOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes chatOverlayPanelIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatOverlayPanelOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.975);
  }
}

@media (min-width: 961px) {
  body[data-current-view="history"] #chatView.active,
  body[data-current-view="chatStyle"] #chatView.active,
  body[data-current-view="userPersona"] #chatView.active,
  body[data-current-view="conversationMemory"] #chatView.active {
    display: flex;
  }

  body[data-current-view="history"] #historyView.active,
  body[data-current-view="chatStyle"] #chatStyleView.active,
  body[data-current-view="userPersona"] #userPersonaView.active,
  body[data-current-view="conversationMemory"] #conversationMemoryView.active {
    position: fixed;
    inset: 0;
    z-index: 2150;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body[data-current-view="history"] #chatView .chat-menu .chat-menu-new-btn svg,
  body[data-current-view="chatStyle"] #chatView .chat-menu .chat-menu-new-btn svg,
  body[data-current-view="userPersona"] #chatView .chat-menu .chat-menu-new-btn svg,
  body[data-current-view="conversationMemory"] #chatView .chat-menu .chat-menu-new-btn svg,
  #chatView .chat-menu .chat-menu-new-btn svg {
    display: none !important;
  }
}

@media (min-width: 961px) {
  body.settings-overlay-open #settingsView.active {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(8,8,12,0.74);
    backdrop-filter: blur(16px);
    overflow: hidden;
    animation: settingsOverlayFade 180ms ease both;
  }

  body.settings-overlay-open #settingsView .create-topbar,
  body.settings-overlay-open #settingsView .create-body {
    width: min(960px, calc(100vw - 56px));
    max-width: 960px;
    align-self: auto;
    box-sizing: border-box;
  }

  body.settings-overlay-open #settingsView .create-topbar {
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background:
      radial-gradient(circle at 12% 0%, rgba(139,124,246,0.16), transparent 42%),
      rgba(18,18,24,0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.34);
  }

  body.settings-overlay-open #settingsView .create-body {
    max-height: min(820px, calc(100dvh - 112px));
    flex: 0 1 auto;
    overflow-y: auto;
    padding: 24px 26px 32px;
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 0;
    border-radius: 0 0 22px 22px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012)),
      rgba(13,13,18,0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.42);
  }

  body.settings-overlay-open #settingsView .panel {
    border-color: rgba(255,255,255,0.09);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.018)),
      rgba(20,20,26,0.92);
  }
}

@media (min-width: 961px) {
  body[data-current-view="userPersona"] #userPersonaView.active {
    position: relative;
    inset: auto;
    z-index: auto;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100dvh;
    background: var(--bg);
  }

  body[data-current-view="userPersona"] #userPersonaView .history-topbar,
  body[data-current-view="userPersona"] #userPersonaView .history-body {
    width: 100%;
    max-width: 100%;
    animation: none;
    box-shadow: none;
  }

  body[data-current-view="userPersona"] #userPersonaView .history-body {
    align-items: center;
  }
}

@keyframes settingsOverlayFade {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 960px) {
  #settingsView.active {
    background:
      radial-gradient(circle at 50% -10%, rgba(139,124,246,0.18), transparent 32%),
      #0b0b10;
  }

  #settingsView .create-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 58px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(13,13,18,0.92);
    backdrop-filter: blur(18px);
  }

  #settingsView .create-title {
    font-size: 18px;
    font-weight: 800;
  }

  #settingsView .settings-body {
    max-width: 100% !important;
    padding: 14px 12px calc(260px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 14px !important;
    overflow-y: auto !important;
    scroll-padding-bottom: calc(260px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #settingsView .settings-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #settingsView .settings-overview-card {
    min-height: 88px;
    padding: 14px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background:
      radial-gradient(circle at 0% 0%, rgba(139,124,246,0.22), transparent 52%),
      linear-gradient(135deg, rgba(255,255,255,0.075), rgba(255,255,255,0.028));
    box-shadow: 0 16px 38px rgba(0,0,0,0.2);
  }

  #settingsView .panel {
    padding: 16px !important;
    border: 1px solid rgba(255,255,255,0.09) !important;
    border-radius: 22px !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
      rgba(15,15,21,0.94) !important;
    box-shadow: 0 14px 38px rgba(0,0,0,0.18) !important;
  }

  #settingsView .panel-title {
    color: rgba(244,244,252,0.96);
    font-size: 15px;
    font-weight: 850;
  }

  #settingsView .profile-settings-guide .settings-guide-card,
  #settingsView .profile-avatar-row-flat,
  #settingsView .profile-grid > .form-group,
  #settingsView .settings-grid > .form-group,
  #settingsView .profile-interest-panel {
    border: 1px solid rgba(255,255,255,0.075);
    border-radius: 18px;
    background: rgba(0,0,0,0.16);
  }

  #settingsView .profile-avatar-row-flat {
    align-items: center;
    text-align: center;
    padding: 16px;
  }

  #settingsView .profile-avatar-row-flat .big-avatar {
    width: 90px;
    height: 90px;
  }

  #settingsView .profile-avatar-copy,
  #settingsView .avatar-controls,
  #settingsView .profile-actions {
    width: 100%;
  }

  #settingsView .avatar-controls,
  #settingsView .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #settingsView .avatar-controls .mini-btn,
  #settingsView .profile-actions > * {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  #settingsView .form-section-heading {
    padding-top: 10px;
    color: rgba(244,244,252,0.96);
    font-size: 12px;
    letter-spacing: 0.09em;
  }

  #settingsView .form-group input,
  #settingsView .form-group textarea,
  #settingsView .form-group select {
    min-height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
  }

  #settingsView #dangerZonePanel {
    display: grid !important;
    gap: 14px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: calc(42px + env(safe-area-inset-bottom, 0px));
    border-color: rgba(224,85,85,0.42) !important;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.22), transparent 48%),
      linear-gradient(180deg, rgba(224,85,85,0.09), rgba(255,255,255,0.018)),
      rgba(16,12,16,0.98) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head {
    display: grid !important;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
  }

  #settingsView #dangerZonePanel .danger-zone-card {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 12px;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 14px;
    border: 1px solid rgba(224,85,85,0.2);
    border-radius: 18px;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.14), transparent 56%),
      rgba(0,0,0,0.18);
  }

  #settingsView #dangerZonePanel .danger-zone-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  #settingsView #dangerZonePanel .danger-zone-card p,
  #settingsView #dangerZonePanel .setting-help {
    display: block !important;
    color: rgba(255,205,205,0.82) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px;
    grid-column: 1 / -1;
  }

  #settingsView #dangerZonePanel .danger-zone-details-link {
    width: 100%;
    min-height: 42px;
    border-color: rgba(255,255,255,0.1);
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
  }
}

@media (max-width: 960px) {
  #settingsView #dangerZonePanel {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 18px !important;
    border: 1px solid rgba(224,85,85,0.34) !important;
    border-radius: 24px !important;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.18), transparent 42%),
      linear-gradient(180deg, rgba(224,85,85,0.08), rgba(255,255,255,0.018)),
      rgba(15,13,18,0.98) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,0.24) !important;
    overflow: hidden !important;
  }

  #settingsView #dangerZonePanel::before {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .panel-title {
    color: #fff0f0 !important;
    font-size: 16px !important;
    letter-spacing: 0.08em !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .setting-help {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-badge {
    align-self: flex-start;
    width: auto !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
    background: rgba(224,85,85,0.12) !important;
    border: 1px solid rgba(224,85,85,0.32) !important;
    color: #ffc4c4 !important;
    font-size: 10px !important;
    line-height: 1 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-card {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 14px !important;
    border: 1px solid rgba(224,85,85,0.22) !important;
    border-radius: 20px !important;
    background:
      linear-gradient(135deg, rgba(224,85,85,0.11), rgba(255,255,255,0.018)),
      rgba(0,0,0,0.18) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-icon {
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    border-radius: 15px !important;
    grid-column: 1;
    grid-row: 1;
  }

  #settingsView #dangerZonePanel .danger-zone-card > div:nth-child(2) {
    grid-column: 2;
    min-width: 0;
  }

  #settingsView #dangerZonePanel .danger-zone-card strong {
    color: #fff4f4 !important;
    font-size: 15px !important;
  }

  #settingsView #dangerZonePanel .danger-zone-card p {
    margin-top: 6px !important;
    color: rgba(255,220,220,0.82) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 4px !important;
  }

  #settingsView #dangerZonePanel .danger-zone-details-link,
  #settingsView #dangerZonePanel .btn-delete {
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 15px !important;
    font-weight: 800 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card .btn-delete {
    margin-top: 54px !important;
  }
}

@media (max-width: 960px) {
  #settingsView #dangerZonePanel,
  #settingsView #dangerZonePanel * {
    min-height: 0 !important;
  }

  #settingsView #dangerZonePanel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-head,
  #settingsView #dangerZonePanel .danger-zone-card {
    position: static !important;
    transform: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-card {
    margin-top: 12px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    padding: 16px !important;
  }

  #settingsView #dangerZonePanel .danger-zone-icon {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-card > div:nth-child(2) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #settingsView #dangerZonePanel .danger-zone-actions {
    grid-column: 1 !important;
    grid-row: auto !important;
    margin-top: 4px !important;
  }

  #settingsView #dangerZonePanel > .danger-zone-card {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 22px !important;
    padding: 16px !important;
    border: 1px solid rgba(224,85,85,0.22) !important;
    border-radius: 20px !important;
    background:
      linear-gradient(135deg, rgba(224,85,85,0.11), rgba(255,255,255,0.018)),
      rgba(0,0,0,0.18) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card > * {
    position: static !important;
    transform: none !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card .danger-zone-details-link {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card strong {
    color: #fff4f4 !important;
    font-size: 15px !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card p {
    margin: 0 !important;
    color: rgba(255,220,220,0.82) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
}

/* Final Danger Zone source of truth */
#settingsView #dangerZonePanel {
  gap: 14px !important;
}

#settingsView #dangerZonePanel .danger-zone-mobile-card {
  display: none !important;
}

#settingsView #dangerZonePanel > .danger-zone-card {
  display: grid !important;
}

#settingsView #dangerZonePanel .danger-zone-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

#settingsView #dangerZonePanel .danger-zone-head {
  min-height: 0 !important;
}

#settingsView #dangerZonePanel .danger-zone-badge {
  position: static !important;
  transform: none !important;
}

@media (max-width: 960px) {
  #settingsView #dangerZonePanel {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .panel-title {
    margin: 0 !important;
    line-height: 1.1 !important;
    color: #fff3f3 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-badge {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #settingsView #dangerZonePanel > .danger-zone-card {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card .btn-delete {
    margin-top: 0 !important;
  }
}

@media (min-width: 961px) {
  #settingsView #dangerZonePanel {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
    border: 1px solid rgba(224,85,85,0.28) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 0% 0%, rgba(224,85,85,0.12), transparent 42%),
      linear-gradient(180deg, rgba(224,85,85,0.055), rgba(255,255,255,0.015)),
      rgba(20,18,23,0.94) !important;
  }

  #settingsView #dangerZonePanel::before {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .panel-title {
    color: #ffe7e7 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-head .setting-help {
    display: block !important;
    margin-top: 6px !important;
    color: rgba(255,210,210,0.72) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-badge {
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(224,85,85,0.34) !important;
    background: rgba(224,85,85,0.11) !important;
    color: #ffcaca !important;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #settingsView #dangerZonePanel > .danger-zone-card {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(224,85,85,0.2) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(135deg, rgba(224,85,85,0.095), rgba(255,255,255,0.018)),
      rgba(0,0,0,0.16) !important;
  }

  #settingsView #dangerZonePanel .danger-zone-mobile-card {
    display: none !important;
  }

  #settingsView #dangerZonePanel .danger-zone-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    grid-column: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #settingsView #dangerZonePanel .danger-zone-details-link,
  #settingsView #dangerZonePanel .btn-delete {
    min-height: 40px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 960px) {
  #recentChatsBackBtn,
  #aiModelRatingBackBtn,
  #creditsBackBtn,
  #settingsBackBtn {
    display: none !important;
  }

  #recentChatsView > .create-topbar,
  #aimodelratingView > .create-topbar,
  #creditsView > .create-topbar,
  #settingsView > .create-topbar {
    justify-content: center;
  }

  #chatView.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: rgba(0,0,0,0.16);
    pointer-events: none;
    animation: chatMenuBackdropIn 0.18s ease both;
  }

  #chatView .chat-menu {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: min(74vw, 340px);
    max-width: none;
    height: 100dvh;
    min-width: 0;
    box-sizing: border-box;
    padding:
      calc(28px + env(safe-area-inset-top, 0px))
      max(22px, calc(18px + env(safe-area-inset-right, 0px)))
      calc(22px + env(safe-area-inset-bottom, 0px))
      22px;
    display: flex;
    flex-direction: column;
    align-content: start;
    gap: 18px;
    border-width: 0 0 0 1px;
    border-radius: 0;
    background: #111116;
    box-shadow: -10px 0 28px rgba(0,0,0,0.3);
    opacity: 1;
    transform: translateX(104%);
    transform-origin: center right;
    transition: transform 0.2s cubic-bezier(.22,.7,.18,1);
    will-change: transform;
    z-index: 2600;
    isolation: isolate;
    transform-style: preserve-3d;
  }

  #chatView .chat-menu.is-open {
    opacity: 1;
    transform: translateX(0);
  }

  #chatView .chat-menu.is-closing {
    opacity: 1;
    transform: translateX(104%);
  }

  #chatView .chat-menu button {
    min-height: 34px;
    padding: 0;
    border-radius: 0;
    color: rgba(245,245,250,0.86);
    font-size: 12.5px;
    font-weight: 540;
    letter-spacing: 0;
    justify-content: space-between;
    gap: 10px;
  }

  #chatView .chat-menu button::after {
    content: ">";
    color: rgba(245,245,250,0.62);
    font-size: 17px;
    font-weight: 300;
    line-height: 1;
  }

  #chatView .chat-menu .chat-menu-new-btn {
    order: 100;
    align-self: stretch;
    margin-top: auto;
    min-height: 48px;
    justify-content: center;
    gap: 12px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #f6f5ff;
    font-weight: 720;
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  }

  #chatView .chat-menu .chat-menu-new-btn svg {
    display: block;
    flex: 0 0 auto;
  }

  #chatView .chat-menu .chat-menu-new-btn::after {
    display: none;
  }

  #chatView .chat-menu button:hover {
    background: transparent;
    color: #fff;
  }

  #chatView .chat-menu button[data-action="rate"] {
    color: #9b8cff;
  }

  #chatView .chat-menu button[data-action="delete-chat"] {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  #chatView .chat-menu button[data-action="delete-chat"],
  #chatView .chat-menu button[data-action="delete-user"],
  #chatView .chat-menu button[data-action="delete-bot"] {
    color: rgba(255,158,166,0.94);
  }
}

/* Desktop create page overflow cleanup */
#main {
  min-width: 0;
}

.view {
  overflow-x: hidden;
}

#createView {
  min-width: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
}

#createView.active {
  display: flex;
}

#createView .create-topbar {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#createView .create-body {
  flex: 1 1 auto;
  min-height: 0;
  width: min(100%, 620px);
  max-width: 620px;
  overflow-y: auto;
  overflow-x: clip;
  scrollbar-gutter: stable;
}

#createView .panel,
#createView .form-grid,
#createView .form-group,
#createView .settings-grid,
#createView .create-persona-actions,
#createView .persona-action-card,
#createView .tag-editor,
#createView .tag-editor-row,
#createView .visibility-picker,
#createView .rating-picker,
#createView .custom-picker,
#createView .model-picker-card {
  min-width: 0;
  max-width: 100%;
}

#createView input,
#createView textarea,
#createView select,
#createView button {
  max-width: 100%;
}

#createView .tag-editor {
  display: grid;
  gap: 10px;
}

#createView .tag-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

#createView .tag-chip-list,
#createView .create-tag-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#createView .tag-chip-list:empty {
  display: none;
}

#createView .create-tag-chip,
#createView .create-tag-suggestion-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid rgba(139,124,246,0.42);
  border-radius: 999px;
  background: rgba(139,124,246,0.18);
  color: var(--text);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
}

#createView .create-tag-chip {
  padding-right: 8px;
}

#createView .create-tag-chip span::before,
#createView .create-tag-suggestion-chip span::before {
  content: "#";
  color: var(--sub);
}

#createView .create-tag-chip button {
  width: auto;
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

#createView .create-tag-chip button:hover {
  background: transparent;
  color: #fff;
}

#createView .create-tag-chip.locked {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

#createView .create-tag-suggestions {
  display: grid;
  gap: 8px;
}

#createView .create-tag-suggestions:empty {
  display: none;
}

#createView .create-tag-suggestion-title {
  color: #a2abc8;
  font-size: 11px;
  font-weight: 700;
}

#createView .create-tag-suggestion-chip {
  cursor: pointer;
}

#createView .create-tag-suggestion-chip strong {
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
}

#createView .create-tag-suggestion-chip:hover {
  border-color: rgba(139,124,246,0.52);
  background: rgba(139,124,246,0.16);
}

#installPromoCard {
  display: none !important;
}

/* Discovery picker polish */
.home-toolbar .discovery-filter-picker {
  flex: 0 1 220px;
  width: 220px;
}

.home-toolbar #homeSortPicker {
  flex-basis: 250px;
  width: 250px;
}

.home-toolbar .discovery-filter-picker .visibility-trigger,
.discovery-search-filters .discovery-filter-picker .visibility-trigger {
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  border-color: var(--border);
}

.discovery-search-filters .discovery-filter-picker {
  width: 100%;
  min-width: 0;
}

.discovery-search-filters .custom-select-menu {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  max-height: min(420px, 52vh);
  overflow-y: auto;
}

.home-toolbar .discovery-filter-picker .custom-select-menu {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}

@media (min-width: 761px) {
  .discovery-search-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
  }

  .discovery-search-page {
    width: min(920px, calc(100vw - 48px));
    height: auto;
    min-height: min(760px, calc(100dvh - 88px));
    margin-top: 44px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    overflow: hidden;
  }

  .discovery-search-head {
    position: static;
    min-height: 70px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  .discovery-search-body {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 16px;
    overflow: visible;
  }

  .discovery-search-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }

  .discovery-search-filters .discovery-filter-picker {
    width: 100%;
    max-width: none;
  }
}

#yourCharactersView .search-submit-btn {
  display: none !important;
}

/* Clean settings page pass */
#settingsView {
  min-width: 0;
  overflow: hidden;
}

#settingsView .create-body.settings-body {
  flex: 1 1 auto;
  min-height: 0;
  width: min(100%, 620px);
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 0 72px;
  gap: 18px;
  overflow-y: auto;
  overflow-x: clip;
  scrollbar-gutter: stable;
}

#settingsView .panel {
  display: grid;
  gap: 18px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#settingsView .panel-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

#settingsView .form-grid.two-col,
#settingsView .settings-grid,
#settingsView .ai-provider-inner-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

#settingsView .form-section-heading,
#settingsView .panel-subtitle {
  margin: 8px 0 -2px;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

#settingsView .form-group,
#settingsView .profile-interest-panel,
#settingsView .persona-manager,
#settingsView .ai-provider-fields,
#settingsView .profile-avatar-row-flat,
#settingsView .roleplay-style-panel {
  min-width: 0;
  max-width: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#settingsView .form-group label,
#settingsView .form-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

#settingsView input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
#settingsView textarea,
#settingsView select {
  min-height: 42px;
  border-radius: 10px;
  border-color: rgba(255,255,255,0.18);
  background: #15161b;
  color: var(--text);
}

#settingsView textarea {
  min-height: 88px;
}

#settingsView .persona-manager {
  display: grid;
  gap: 12px;
  padding-top: 2px !important;
}

#settingsView .persona-open-btn {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#settingsView .persona-open-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#settingsView .persona-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#settingsView .persona-manager-head > div:first-child {
  min-width: 0;
}

#settingsView .persona-count,
#settingsView .persona-status {
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

#settingsView .persona-count {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: rgba(245,245,250,0.84);
}

#settingsView .persona-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

#settingsView .persona-toolbar select {
  width: 100%;
  min-width: 0;
}

#settingsView .persona-toolbar .mini-btn {
  min-height: 42px;
  padding-inline: 13px;
  white-space: nowrap;
}

#settingsView .persona-label-field {
  display: grid;
  gap: 7px;
}

#settingsView input:focus,
#settingsView textarea:focus,
#settingsView select:focus {
  border-color: rgba(255,255,255,0.42);
}

#settingsView .settings-select-picker,
#settingsView .custom-select-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  position: relative;
}

#settingsView .form-group:has(.settings-select-picker.open),
#settingsView .form-group:has(.custom-select-picker.open) {
  position: relative;
  z-index: 3200;
}

#settingsView .settings-select-picker.open,
#settingsView .custom-select-picker.open {
  z-index: 3201;
}

#settingsView .settings-select-picker .visibility-trigger,
#settingsView .custom-select-trigger {
  min-height: 42px;
  border-radius: 10px;
  background: #15161b;
  border-color: rgba(255,255,255,0.18);
}

#settingsView .custom-select-menu {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  max-height: min(620px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  z-index: 9002;
}

#settingsView .custom-select-menu.fixed-custom-select-menu {
  min-width: 0;
  max-width: calc(100vw - 24px);
}

#settingsView .custom-select-menu .visibility-option {
  min-height: 54px;
  touch-action: manipulation;
}

#settingsView .panel.picker-panel-open {
  position: relative;
  z-index: 9000;
}

#settingsView .setting-help.full-line,
#settingsView .profile-avatar-copy > .setting-help,
#settingsView .ai-provider-fields > .setting-help {
  display: none !important;
}

#settingsView .setting-help {
  color: #a2abc8;
  font-size: 11px;
  line-height: 1.4;
}

body.complete-profile-open {
  overflow: hidden;
}

.complete-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 50000;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 18%, rgba(139,124,246,0.18), transparent 34%),
    rgba(3,4,9,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.complete-profile-modal.hidden {
  display: none !important;
}

.complete-profile-card {
  display: grid;
  width: min(100%, 468px);
  gap: 18px;
  padding: 28px 26px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 2%, rgba(139,124,246,0.20), transparent 36%),
    radial-gradient(circle at 94% 0%, rgba(45,212,191,0.13), transparent 38%),
    linear-gradient(145deg, rgba(25,25,36,0.98), rgba(13,16,22,0.98));
  box-shadow: 0 24px 80px rgba(0,0,0,0.58);
}

.complete-profile-logo {
  display: grid;
  place-items: center;
}

.complete-profile-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(45,212,191,0.22));
}

.complete-profile-title {
  margin: 0;
  color: var(--text);
  font-size: 34px;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
}

.complete-profile-copy {
  max-width: 360px;
  margin: -8px auto 0;
  color: #c8cbe0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.complete-profile-step {
  display: grid;
  gap: 14px;
}

.complete-profile-label {
  color: #a2abc8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.complete-profile-input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(20,21,28,0.94);
  color: var(--text);
  font: inherit;
  font-weight: 850;
  outline: none;
}

.complete-profile-input:focus {
  border-color: rgba(139,124,246,0.72);
  box-shadow: 0 0 0 4px rgba(139,124,246,0.16);
}

.complete-profile-primary {
  width: 100%;
  min-height: 48px;
}

.complete-profile-actions {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr;
  gap: 10px;
  align-items: center;
}

.complete-profile-actions .mini-btn {
  height: 48px;
  justify-content: center;
}

.complete-profile-status {
  min-height: 20px;
  color: #a2abc8;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.profile-setup-head {
  display: grid;
  gap: 4px;
  text-align: center;
}

.profile-setup-title {
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
}

.profile-setup-subtitle {
  color: #a2abc8;
  font-size: 13px;
  font-weight: 650;
}

.profile-birthdate-field {
  gap: 10px;
}

.birthdate-wheel-picker {
  position: relative;
  display: grid;
  grid-template-columns: 1.18fr 0.78fr 0.92fr;
  gap: 12px;
  width: 100%;
}

.birthdate-wheel-row {
  display: none;
}

.birthdate-wheel-column-wrap {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.birthdate-wheel-label {
  color: #8e96b6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
}

.birthdate-wheel-column {
  position: relative;
  height: 154px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(8,9,14,0.42);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 76%, transparent 100%);
}

.birthdate-wheel-column::-webkit-scrollbar {
  display: none;
}

.birthdate-wheel-column::before {
  content: "";
  position: sticky;
  top: 54px;
  z-index: 0;
  display: block;
  height: 44px;
  margin-bottom: -44px;
  border-radius: 9px;
  background: rgba(255,255,255,0.075);
  pointer-events: none;
}

.birthdate-wheel-option {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  scroll-snap-align: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #737b98;
  font: inherit;
  font-size: 17px;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
}

.birthdate-wheel-option:first-child {
  margin-top: 55px;
}

.birthdate-wheel-option:last-child {
  margin-bottom: 55px;
}

.birthdate-wheel-option.is-selected {
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  text-shadow: 0 1px 12px rgba(45,212,191,0.28);
}

.profile-gender-field {
  grid-column: 1 / -1;
}

#settingsView .profile-gender-native,
.complete-profile-modal .profile-gender-native {
  display: none !important;
}

.profile-gender-circles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 2px;
}

.profile-gender-circle {
  display: flex;
  min-width: 0;
  min-height: 106px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.profile-gender-circle:focus-visible {
  outline: 2px solid rgba(139,124,246,0.72);
  outline-offset: 3px;
}

.profile-gender-orb {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.025));
  color: #cbd2eb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 10px 24px rgba(0,0,0,0.14);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.profile-gender-symbol {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-gender-label {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 12px;
  line-height: 1.15;
}

.profile-gender-circle:hover .profile-gender-orb {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.32);
  color: #f4f6ff;
}

.profile-gender-circle.is-selected {
  color: var(--text);
}

.profile-gender-circle.is-selected .profile-gender-orb {
  border-color: rgba(154,143,255,0.82);
  background:
    linear-gradient(180deg, rgba(139,124,246,0.22), rgba(45,212,191,0.10)),
    rgba(20,21,30,0.96);
  color: #ffffff;
  box-shadow:
    0 0 0 4px rgba(139,124,246,0.14),
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 14px 30px rgba(0,0,0,0.24);
}

.profile-setup-actions {
  display: flex;
  justify-content: center;
}

.profile-setup-actions .btn-save {
  width: min(100%, 260px);
}

@media (max-width: 760px), (pointer: coarse) {
  .complete-profile-modal {
    align-items: start;
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }

  .complete-profile-card {
    gap: 15px;
    padding: 22px 14px;
    border-radius: 20px;
  }

  .complete-profile-title {
    font-size: 30px;
  }

  .complete-profile-copy {
    font-size: 14px;
  }

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

  .complete-profile-card .profile-setup-head {
    gap: 4px;
  }

  .profile-setup-title {
    font-size: 22px;
  }

  .birthdate-wheel-picker {
    gap: 7px;
  }

  .birthdate-wheel-column {
    height: 142px;
    border-radius: 9px;
  }

  .birthdate-wheel-column::before {
    top: 49px;
  }

  .birthdate-wheel-option {
    min-height: 42px;
    font-size: 15px;
  }

  .birthdate-wheel-option:first-child {
    margin-top: 50px;
  }

  .birthdate-wheel-option:last-child {
    margin-bottom: 50px;
  }

  .birthdate-wheel-option.is-selected {
    font-size: 18px;
  }

  .profile-gender-circles {
    gap: 8px;
  }

  .profile-gender-circle {
    min-height: 96px;
  }

  .profile-gender-orb {
    width: 58px;
    height: 58px;
  }

  #settingsView select.custom-picker-native {
    display: block !important;
    width: 100%;
    min-height: 42px;
    padding: 0 42px 0 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    background: #15161b;
    color: var(--text);
    font: inherit;
    font-weight: 800;
  }

  #settingsView .settings-select-picker.custom-select-picker,
  #settingsView .settings-select-picker.visibility-picker {
    display: none !important;
  }
}

#settingsView .profile-avatar-row-flat {
  display: flex;
  align-items: center;
  gap: 14px;
}

#settingsView .profile-avatar-row-flat .big-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
}

#settingsView .profile-avatar-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

#settingsView .profile-section-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

#settingsView .avatar-controls,
#settingsView .profile-actions,
#settingsView .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#settingsView .mini-btn,
#settingsView .btn-save,
#settingsView .btn-delete {
  border-radius: 10px;
}

#settingsView .profile-interest-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

#settingsView .profile-interest-panel {
  display: grid;
  gap: 10px;
}

#settingsView .profile-interest-chip,
#settingsView .profile-interest-chip:hover,
#settingsView .profile-interest-chip:active {
  transform: none !important;
  transition: none !important;
}

#settingsView .panel:hover,
#settingsView .profile-interest-panel:hover,
#settingsView .settings-resource-link:hover {
  transform: none !important;
}

#settingsView .visual-bubble-toggle {
  min-height: 40px;
}

#settingsView .visual-bubble-help {
  margin-top: -8px;
}

#settingsView .settings-resource-panel {
  gap: 12px;
}

#settingsView .settings-resource-panel::before,
#settingsView .settings-resource-panel::after {
  content: none !important;
}

#settingsView .settings-social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#settingsView .settings-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  text-decoration: none;
}

#settingsView .settings-social-link:hover {
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.22);
}

#settingsView .settings-social-link span:last-child,
#settingsView .settings-resource-link span:last-child {
  min-width: 0;
}

#settingsView .settings-social-link strong {
  display: block;
  font-size: 13px;
}

#settingsView .settings-social-link small {
  display: block;
  margin-top: 2px;
  color: var(--sub);
  font-size: 11px;
  overflow-wrap: anywhere;
}

#settingsView .settings-social-icon svg {
  width: 19px;
  height: 19px;
}

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

#settingsView .settings-resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  text-decoration: none;
}

#settingsView .settings-resource-link:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.2);
}

#settingsView .settings-resource-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: rgba(139,124,246,0.14);
  color: #d7d1ff;
}

#settingsView .settings-resource-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#settingsView .settings-resource-link span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#settingsView .settings-resource-link strong {
  font-size: 13px;
  line-height: 1.2;
}

#settingsView .settings-resource-link small {
  color: #a2abc8;
  font-size: 11px;
  line-height: 1.25;
}

#settingsView .settings-resource-panel img {
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
}

#homeView .bot-card-media.is-empty img {
  display: none !important;
}

#homeView .bot-card-media.is-empty .bot-card-media-skeleton {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  background:
    radial-gradient(circle at 35% 30%, rgba(139,124,246,0.18), transparent 32%),
    linear-gradient(180deg, rgba(86,86,96,0.58), rgba(26,26,32,0.92));
}

#settingsView .settings-resource-panel {
  display: grid !important;
  flex: 0 0 auto !important;
  min-height: max-content !important;
  height: auto !important;
  overflow: visible !important;
}

@media (max-width: 960px) {
  #homeView .mobile-home-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  #homeView .discovery-search-open-btn {
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  #settingsView #settingsResourcePanel.settings-resource-panel {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
}

@media (max-width: 960px) {
  body.native-app-shell #sidebar,
  body.native-app-shell .sidebar-collapse-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.native-app-shell #main {
    margin-left: 0 !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
  }

  body.native-app-shell.native-ad-banner-visible #main {
    padding-top: var(--native-ad-banner-height) !important;
    height: calc(var(--app-height) - var(--native-ad-banner-height)) !important;
  }

  body.native-app-shell .view {
    width: 100dvw !important;
    max-width: 100dvw !important;
  }

  body.native-app-shell #homeView {
    padding: 0 16px calc(140px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
  }

  body.native-app-shell #homeView .home-hero,
  body.native-app-shell #homeView .home-hero > div:first-child {
    display: contents !important;
  }

  body.native-app-shell #homeView .mobile-home-topbar {
    position: fixed !important;
    top: var(--native-ad-banner-height) !important;
    left: 0 !important;
    right: auto !important;
    width: 100dvw !important;
    min-width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: #121218 !important;
    backdrop-filter: blur(16px) !important;
    overflow: hidden !important;
    z-index: 34 !important;
  }

  body.native-app-shell #homeView .discovery-title-row,
  body.native-app-shell #homeView .mobile-home-copy {
    display: contents !important;
  }

  body.native-app-shell #homeView .mobile-home-copy h1,
  body.native-app-shell #homeView .mobile-home-copy p,
  body.native-app-shell #homeView .discovery-value-pills,
  body.native-app-shell #homeView .discovery-socials {
    display: none !important;
  }

  body.native-app-shell #homeView .discovery-search-open-btn {
    position: fixed !important;
    top: calc(var(--native-ad-banner-height) + 12px + env(safe-area-inset-top, 0px)) !important;
    left: 16px !important;
    right: auto !important;
    width: calc(100dvw - 32px) !important;
    max-width: calc(100dvw - 32px) !important;
    height: 40px !important;
    min-width: 0 !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    border-radius: 18px !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    background: #202026 !important;
    transform: none !important;
    z-index: 36 !important;
  }

  body.native-app-shell #homeView .discovery-search-open-btn::after {
    content: none !important;
  }

  body.native-app-shell #homeView .discovery-tabs {
    position: fixed !important;
    top: calc(var(--native-ad-banner-height) + 56px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: auto !important;
    width: 100dvw !important;
    min-width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 8px 14px 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    background: #121218 !important;
    backdrop-filter: blur(16px) !important;
    overflow-x: auto !important;
    z-index: 35 !important;
  }

  body.native-app-shell #homeView .discovery-support-banner {
    margin-top: calc(112px + env(safe-area-inset-top, 0px)) !important;
  }

  body.native-app-shell #homeView .mobile-discovery-search-clear-btn {
    top: calc(var(--native-ad-banner-height) + 17px + env(safe-area-inset-top, 0px)) !important;
  }
}

@media (max-width: 960px) {
  #homeView .discovery-search-open-btn::after {
    content: none !important;
    display: none !important;
  }

  #homeView .discovery-search-open-btn {
    gap: 10px !important;
    padding-right: 14px !important;
  }

  #homeView .discovery-search-open-btn.has-search-value {
    padding-right: 48px !important;
  }

  #homeView .discovery-search-open-label {
    display: inline-block;
    color: rgba(226,226,238,.58);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
  }

  #homeView .discovery-search-open-btn.has-search-value .discovery-search-open-label {
    color: #e8e9f1;
  }

  #homeView .mobile-discovery-search-clear-btn {
    position: fixed !important;
    top: calc(17px + env(safe-area-inset-top, 0px)) !important;
    right: 23px !important;
    z-index: 38 !important;
    width: 30px !important;
    height: 30px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(96,165,250,0.96);
    cursor: pointer;
  }

  #homeView .mobile-discovery-search-clear-btn.hidden {
    display: none !important;
  }
}

#settingsView.has-unsaved-settings #saveProfileBtn,
#settingsView #saveProfileBtn.needs-save {
  border-color: rgba(255,212,107,0.42);
  box-shadow: 0 0 0 1px rgba(255,212,107,0.16), 0 12px 28px rgba(0,0,0,0.24);
}

.settings-unsaved-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,5,9,0.62);
  backdrop-filter: blur(10px);
}

.settings-unsaved-modal.hidden {
  display: none;
}

.settings-unsaved-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    #16161f;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0,0,0,0.48);
}

.settings-unsaved-kicker {
  color: #ffd46b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-unsaved-title {
  margin-top: 6px;
  color: #fff;
  font-size: 20px;
  font-weight: 850;
}

.settings-unsaved-card p {
  margin-top: 8px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.45;
}

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

.settings-unsaved-actions .mini-btn,
.settings-unsaved-actions .btn-save {
  min-height: 40px;
  border-radius: 10px;
}

.profile-saving-modal {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5,5,9,0.46);
  backdrop-filter: blur(8px);
}

.profile-saving-modal.hidden {
  display: none;
}

.profile-saving-card {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
    #15151e;
  color: var(--text);
  box-shadow: 0 22px 60px rgba(0,0,0,0.44);
}

.profile-saving-spinner {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.14);
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}

.profile-saving-card span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-saving-card strong {
  color: #fff;
  font-size: 15px;
}

.profile-saving-card small {
  color: var(--sub);
  font-size: 12px;
  line-height: 1.35;
}

#settingsView #saveProfileBtn.is-saving {
  opacity: 0.78;
  cursor: wait;
}

.persona-delete-confirm-modal {
  z-index: 9200;
}

.persona-delete-confirm-card {
  border-color: rgba(255,93,93,0.24);
}

@media (max-width: 540px) {
  .settings-unsaved-modal,
  .profile-saving-modal {
    padding: 14px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .settings-unsaved-card {
    gap: 16px;
    padding: 18px;
  }

  .settings-unsaved-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .settings-unsaved-actions .btn-save,
  .settings-unsaved-actions .mini-btn {
    width: 100%;
  }
}

/* Friendlier Credits and Models pass */
#creditsView .credits-page {
  max-width: 980px;
  gap: 16px;
}

#creditsView .credits-hero {
  grid-template-columns: minmax(0, 1fr);
}

#creditsView .credits-hero > div:first-child,
#creditsView .credits-balance-card,
#creditsView .credits-panel {
  border-radius: 18px;
  box-shadow: none;
}

#creditsView .credits-hero > div:first-child {
  min-height: 0;
  padding: 22px;
}

#creditsView .credits-hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.2rem);
}

#creditsView .credits-balance-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

#creditsView .credits-mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#creditsView .credits-daily-card,
#creditsView .credits-referral-card,
#creditsView .credit-offer-card,
#creditsView .credit-history-item {
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}

#creditsView .credits-referral-panel,
#creditsView .credits-buy-panel,
#creditsView .chayt-plus-credit-panel,
#creditsView .credits-support-goal-panel {
  display: grid;
  gap: 14px;
}

#creditsView .credits-support-goal-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(255,212,107,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025)),
    var(--card);
}

.credits-support-goal-pill {
  flex-shrink: 0;
  min-width: 58px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,212,107,.24);
  background: rgba(255,212,107,.1);
  color: #ffe7a3;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.credits-support-goal-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
}

.credits-support-goal-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd46b, #7cc7ff);
  transition: width .25s ease;
}

.credits-support-goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.credits-support-goal-amount {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

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

#creditsView .credits-referral-grid {
  grid-template-columns: 1fr;
}

#creditsView .credits-referral-code-row,
#creditsView .credits-redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

#creditsView .credits-redeem-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

#creditsView .credit-offers {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

#creditsView .credit-offer-card {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 12px;
  min-height: 0;
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.026)),
    rgba(20,20,28,0.88);
}

#creditsView .credit-offer-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #f8f6ff;
}

#creditsView .credit-offer-badge {
  margin-left: 0;
}

#creditsView .credit-offer-price {
  color: #ffffff;
  font-size: 16px;
}

#creditsView .credit-offer-old-price {
  color: rgba(174,169,210,0.72);
}

#creditsView .chayt-plus-credit-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 420px;
  border-color: rgba(255,204,92,0.28);
  box-shadow: 0 18px 46px rgba(0,0,0,0.22);
}

#creditsView .chayt-plus-credit-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,204,92,0.10), transparent 42%, rgba(120,198,255,0.10));
}

#creditsView .chayt-plus-credit-panel > * {
  position: relative;
  z-index: 1;
}

#creditsView .chayt-plus-credit-panel .section-title {
  color: #fff4c8;
  font-size: 16px;
  letter-spacing: .08em;
}

#creditsView .chayt-plus-mini-plan .paypal-button-slot,
#chaytPlusView .chayt-plus-plan-card .paypal-button-slot {
  min-height: 128px;
}

#creditsView .chayt-plus-mini-plan .google-play-button-slot,
#chaytPlusView .chayt-plus-plan-card .google-play-button-slot {
  min-height: 0;
  margin-top: 6px;
}

#creditsView .chayt-plus-mini-plans {
  align-items: stretch;
}

#creditsView .chayt-plus-mini-plan {
  min-width: 0;
  align-content: start;
}

@media (max-width: 960px) {
  #creditsView .credits-page {
    display: flex;
    flex-direction: column;
  }

  #creditsView .chayt-plus-credit-panel {
    height: auto;
    min-height: max-content;
    overflow: hidden;
  }
}

#creditsView .credit-history-list {
  max-height: 320px;
}

#aimodelratingView .ai-model-rating-shell,
#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card {
  border-radius: 18px;
  box-shadow: none;
}

#aimodelratingView .ai-model-rating-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  gap: 16px;
}

#aimodelratingView .ai-model-rating-toolbar-copy h2 {
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

#aimodelratingView .ai-model-rating-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#aimodelratingView .ai-model-card {
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  box-shadow: none;
}

#aimodelratingView .ai-model-card:hover {
  transform: none;
}

#aimodelratingView .ai-model-card-link {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto;
  gap: 10px 16px;
  padding: 14px;
}

#aimodelratingView .ai-model-card-top,
#aimodelratingView .ai-model-card-badges,
#aimodelratingView .ai-model-card-stars,
#aimodelratingView .ai-model-card-desc {
  min-width: 0;
}

#aimodelratingView .ai-model-card-badges,
#aimodelratingView .ai-model-card-stars,
#aimodelratingView .ai-model-card-desc {
  grid-column: 1 / -1;
}

#aimodelratingView .ai-model-card-score {
  align-self: start;
  min-width: 66px;
  border-radius: 12px;
}

@media (max-width: 720px) {
  #creditsView .credits-mini-stats,
  #creditsView .credit-offers,
  #aimodelratingView .ai-model-rating-toolbar,
  #aimodelratingView .ai-model-card-link {
    grid-template-columns: 1fr;
  }

  #creditsView .credits-referral-code-row,
  #creditsView .credits-redeem-row,
  #creditsView .credits-support-goal-row {
    grid-template-columns: 1fr;
  }

  #creditsView .credits-referral-actions {
    justify-content: stretch;
    width: 100%;
  }

  #creditsView .credits-icon-btn,
  #creditsView .credits-support-goal-actions .mini-btn {
    flex: 1 1 0;
  }

  #creditsView .credits-support-goal-actions {
    justify-content: stretch;
  }

  #creditsView .credits-support-goal-panel {
    padding: 14px 12px;
    gap: 10px;
  }

  #creditsView .chayt-plus-credit-panel {
    height: auto;
    overflow: hidden;
    min-height: max-content;
    padding: 16px 12px;
    gap: 12px;
    border-radius: 18px;
  }

  #creditsView .chayt-plus-credit-panel::before {
    opacity: .72;
    background: linear-gradient(135deg, rgba(255,204,92,0.12), rgba(120,198,255,0.10));
  }

  #creditsView .chayt-plus-credit-panel .credits-panel-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  #creditsView .chayt-plus-credit-panel .mini-btn {
    width: fit-content;
  }

  #creditsView .chayt-plus-feature-row {
    gap: 7px;
  }

  #creditsView .chayt-plus-feature-row span {
    font-size: 10px;
    letter-spacing: .06em;
    padding-left: 8px;
    padding-right: 8px;
  }

  #creditsView .chayt-plus-mini-plans {
    gap: 12px;
    margin-top: 2px;
  }

  #creditsView .chayt-plus-mini-plan {
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)),
      rgba(9,12,20,.68);
  }

  #creditsView .chayt-plus-mini-plan:nth-child(2) {
    background:
      radial-gradient(circle at 100% 0%, rgba(255,204,92,.14), transparent 40%),
      linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028)),
      rgba(12,14,22,.72);
  }

  #creditsView .chayt-plus-mini-plan .chayt-plus-plan-price {
    flex-wrap: wrap;
    gap: 4px 7px;
    font-size: 24px;
  }

  #creditsView .chayt-plus-mini-plan .paypal-button-slot {
    min-height: 106px;
  }

  #creditsView .chayt-plus-mini-plan .google-play-button-slot {
    margin-top: 2px;
  }

  #creditsView .chayt-plus-mini-plan .google-play-billing-btn {
    min-height: 54px;
    border-radius: 14px;
  }

  #creditsView .credits-support-goal-panel .credits-panel-head {
    gap: 10px;
    align-items: start;
  }

  #creditsView .credits-support-goal-panel .section-title {
    font-size: 13px;
    letter-spacing: .08em;
  }

  #creditsView .credits-support-goal-panel .section-subtitle,
  #creditsView .credits-support-goal-panel .credits-inline-note {
    font-size: 12px;
    line-height: 1.45;
  }

  #creditsView .credits-support-goal-pill {
    min-width: 52px;
    padding: 7px 10px;
    font-size: 12px;
  }

  #creditsView .credits-support-goal-amount {
    font-size: clamp(20px, 7vw, 25px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }
}

#settingsView .profile-interest-head {
  align-items: center;
}

#settingsView .profile-interest-search {
  min-height: 38px;
  border-radius: 10px;
}

#settingsView .form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 16px;
  padding: 0;
  border: 0;
}

#settingsView .setting-toggle {
  border-radius: 10px;
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}

#settingsView #uAllowNsfwChatsRow .form-label {
  min-width: 0;
  line-height: 1.35;
}

#settingsView #uAllowNsfwChatsRow .toggle {
  flex: 0 0 auto;
}

#settingsView #uAllowNsfwChatsRow input:disabled + .toggle-track {
  opacity: 0.46;
  cursor: not-allowed;
}

#settingsView #uAllowNsfwChatsHelp {
  display: block !important;
  grid-column: 1 / -1;
  margin: -4px 0 8px;
  max-width: 680px;
  color: rgba(174, 174, 205, 0.94);
  font-size: 12px;
  line-height: 1.48;
}

#settingsView .roleplay-style-nav {
  border: 0;
  background: transparent;
}

#settingsView #dangerZonePanel {
  margin-top: 4px;
  padding-top: 18px !important;
  border-top: 1px solid rgba(255,107,107,0.24) !important;
}

@media (max-width: 960px) {
  #settingsView .create-body.settings-body {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px calc(150px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 18px !important;
    scroll-padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #settingsView .panel-title {
    font-size: 18px;
  }

  #settingsView .profile-avatar-row-flat {
    align-items: center;
    text-align: left;
  }

  #settingsView .avatar-controls,
  #settingsView .profile-actions,
  #settingsView .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #settingsView .avatar-controls > *,
  #settingsView .profile-actions > *,
  #settingsView .form-actions > * {
    width: 100%;
    justify-content: center;
  }

  #settingsView .settings-resource-grid {
    grid-template-columns: 1fr;
  }

  #settingsView .settings-social-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .discovery-tag-tutorial-card {
    max-height: min(260px, calc(100dvh - 112px));
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .discovery-tag-tutorial-card::-webkit-scrollbar {
    display: none;
  }

  .discovery-tag-tutorial-copy p {
    min-height: 0;
  }

  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    grid-auto-columns: minmax(178px, 204px);
    align-items: start;
    gap: 10px;
    padding: 1px 10px 8px 2px;
  }

  #chatStyleView .chat-style-body {
    gap: 10px;
    padding-top: 10px;
  }

  #chatStyleView .chat-style-model-browser {
    gap: 16px;
  }

  #chatStyleView .chat-style-model-section {
    gap: 8px;
  }

  #chatStyleView .chat-style-model-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card {
    height: auto;
    min-height: 186px;
    max-height: none;
    grid-template-rows: auto minmax(54px, 1fr) auto;
    align-content: stretch;
    gap: 8px;
    padding: 12px;
    overflow: visible;
  }

  #chatStyleView .chat-style-model-card.chayt-mode-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card.chayt-mode-card {
    min-height: 206px;
    grid-template-rows: auto minmax(42px, auto) minmax(50px, 1fr) auto;
    align-content: stretch;
  }

  #chatStyleView .chat-style-model-title,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-title {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: 0;
    padding-bottom: 8px;
    overflow: visible;
    font-size: 14px;
    line-height: 1.16;
  }

  #chatStyleView .chat-style-model-desc,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-desc {
    display: block;
    overflow: visible;
    font-size: 12px;
    line-height: 1.28;
  }

  #chatStyleView .chat-style-model-foot,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot {
    min-height: 26px;
    align-items: flex-end;
    gap: 6px;
    font-size: 10px;
  }

  #chatStyleView .chat-style-energy-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-energy-note {
    max-width: 72px;
    line-height: 1.08;
  }

  #chatStyleView .chat-style-section-head,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-head {
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 6px;
  }

  #chatStyleView .chat-style-section-pill,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-pill {
    min-height: 28px;
    font-size: 18px;
  }

  #chatStyleView .chat-style-section-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-note {
    padding-left: 18px;
    font-size: 11px;
    line-height: 1.3;
  }

  #conversationMemoryView .conversation-memory-body,
  #chatStyleView .chat-style-body {
    align-content: initial;
  }

  #conversationMemoryView .conversation-memory-body {
    flex: 1 1 auto;
    min-height: 0;
  }

  #conversationMemoryView #conversationSummaryInput {
    min-height: 132px;
    max-height: 210px;
  }

  #settingsView .ai-provider-inner-grid {
    align-items: start;
    gap: 12px;
  }

  #settingsView .ai-provider-flat,
  #settingsView .ai-provider-inner-grid .full {
    min-height: 0 !important;
  }

  #settingsView .ai-provider-flat input {
    min-height: 42px !important;
    height: 42px;
  }
}

@media (max-width: 960px) {
  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    grid-auto-columns: minmax(178px, 204px);
    align-items: start;
  }

  #chatStyleView .chat-style-model-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card {
    height: auto;
    min-height: 186px;
    max-height: none;
    grid-template-rows: auto minmax(54px, 1fr) auto;
    align-content: stretch;
    overflow: visible;
  }

  #chatStyleView .chat-style-model-title,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-title,
  #chatStyleView .chat-style-model-desc,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-desc {
    display: block;
    min-height: 0;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
  }
}

/* Mobile Chat Style keeps the horizontal picker, but vertical page scroll wins on touch. */
@media (max-width: 960px) {
  #chatStyleView.active {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    min-height: 100vh !important;
    height: 100svh !important;
    min-height: 100svh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  #chatStyleView .history-topbar {
    flex: 0 0 auto !important;
  }

  #chatStyleView .chat-style-body {
    flex: 1 1 auto !important;
    height: calc(100vh - 64px) !important;
    min-height: calc(100vh - 64px) !important;
    max-height: calc(100vh - 64px) !important;
    height: calc(100svh - 64px) !important;
    min-height: calc(100svh - 64px) !important;
    max-height: calc(100svh - 64px) !important;
    height: calc(100dvh - 64px) !important;
    min-height: calc(100dvh - 64px) !important;
    max-height: calc(100dvh - 64px) !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #chatStyleView .chat-style-model-section:last-child {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  #chatStyleView .chat-style-model-row {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(178px, 204px) !important;
    grid-template-columns: unset !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    scrollbar-width: thin !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #chatStyleView .chat-style-model-card {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Create media toolbars: keep icon controls compact on mobile. */
#createView .media-icon-actions,
#settingsView .media-icon-actions,
#createView .appearance-toolbar.media-icon-actions,
#createView .first-message-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  width: auto !important;
}

#createView .media-icon-actions > .icon-tool-btn,
#settingsView .media-icon-actions > .icon-tool-btn,
#createView .appearance-toolbar.media-icon-actions > .icon-tool-btn,
#createView .first-message-actions > .icon-tool-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  justify-content: center !important;
}

#createView .first-message-actions #addFirstMessageVariantBtn {
  min-height: 42px;
  width: auto !important;
  flex: 0 1 auto !important;
}

#createView .create-rich-text-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  width: auto !important;
}

#createView .create-rich-text-actions > .icon-tool-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}

#createView .create-publish-row .visibility-picker,
#createView .create-publish-row .rating-picker {
  height: 100%;
}

#createView .create-publish-row .visibility-trigger,
#createView .create-publish-row .rating-trigger {
  min-height: 52px;
  height: auto;
}

@media (max-width: 960px) {
  #createView .media-icon-actions > .icon-tool-btn,
  #settingsView .media-icon-actions > .icon-tool-btn,
  #createView .appearance-toolbar.media-icon-actions > .icon-tool-btn,
  #createView .first-message-actions > .icon-tool-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
  }

  #createView .first-message-actions #addFirstMessageVariantBtn {
    width: auto !important;
    min-width: min(220px, 100%);
    flex: 1 1 220px !important;
  }

  #createView .create-rich-text-actions > .icon-tool-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
  }

  #createView .create-publish-row .visibility-trigger,
  #createView .create-publish-row .rating-trigger {
    min-height: 54px;
  }
}

@media (max-width: 560px) {
  #createView .media-sidebar {
    padding-right: 0 !important;
    scroll-padding-inline: 12px;
  }

  #createView .media-pane-body-avatar {
    display: grid !important;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 14px;
    row-gap: 10px;
    width: 100%;
  }

  #createView .media-pane-body-avatar .media-icon-actions {
    display: grid !important;
    grid-template-columns: repeat(3, 44px);
    justify-content: center;
    gap: 8px !important;
  }

  #createView .media-pane-body-avatar .icon-tool-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
  }
}

@media (max-width: 350px) {
  #createView .media-pane-body-avatar {
    grid-template-columns: auto;
    justify-items: center;
  }

  #createView .media-pane-body-avatar .media-icon-actions {
    grid-template-columns: repeat(3, 40px);
  }

  #createView .media-pane-body-avatar .icon-tool-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }

  #createView .big-avatar {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
  }
}

@media (min-width: 961px) {
  #homeView .discovery-support-banner {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #homeView .home-hero,
  #homeView .discovery-tabs,
  #homeView .ollama-discovery-notice,
  #homeView .discovery-top-ad-slot,
  #homeView .today-with-chayt,
  #homeView .discovery-quick-tags,
  #homeView .discovery-filter-loader,
  #homeView .discovery-ad-slot,
  #homeView .bot-section {
    width: min(100%, 1476px);
    max-width: 1476px;
    align-self: center;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  #homeView .today-with-chayt {
    margin-top: 0;
    margin-bottom: -12px;
  }

  #homeView .ollama-discovery-notice {
    margin-top: 0;
    margin-bottom: -4px;
  }

  #homeView .today-chayt-rail {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    scroll-padding-inline: 0;
  }
}

/* Discovery mobile grid: keep card gutters tight under the visible support banner. */
@media (max-width: 960px) {
  #homeView .bot-section,
  #homeView #userSection.hidden + .bot-section {
    gap: 12px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  #homeView .bots-grid,
  #homeView #userGrid,
  #homeView #featuredGrid {
    gap: 10px !important;
    column-gap: 10px !important;
    row-gap: 10px !important;
    margin-top: 0 !important;
  }

  body.native-app-shell #homeView .today-with-chayt,
  #homeView .today-with-chayt {
    margin-top: 10px !important;
    margin-bottom: -8px !important;
  }

  body.native-app-shell #homeView .ollama-discovery-notice,
  body.capacitor-app #homeView .ollama-discovery-notice {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
  }

  body.native-app-shell #homeView .today-chayt-rail,
  #homeView .today-chayt-rail {
    touch-action: pan-x !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.native-app-shell #homeView .today-chayt-card,
  #homeView .today-chayt-card {
    touch-action: pan-x !important;
  }

  body.native-app-shell #homeView .discovery-support-banner,
  #homeView .discovery-support-banner {
    margin-top: 10px !important;
  }

  body.native-app-shell #homeView.today-chayt-hidden #userSection.hidden + .bot-section,
  #homeView.today-chayt-hidden #userSection.hidden + .bot-section {
    margin-top: calc(116px + env(safe-area-inset-top, 0px)) !important;
  }
}

@media (max-width: 560px) {
  #homeView .bot-section,
  #homeView #userSection.hidden + .bot-section {
    gap: 10px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  #homeView .bots-grid,
  #homeView #userGrid,
  #homeView #featuredGrid {
    gap: 8px !important;
    column-gap: 8px !important;
    row-gap: 8px !important;
    margin-top: 0 !important;
  }

  body.native-app-shell #homeView.today-chayt-hidden #userSection.hidden + .bot-section,
  #homeView.today-chayt-hidden #userSection.hidden + .bot-section {
    margin-top: calc(116px + env(safe-area-inset-top, 0px)) !important;
  }
}

/* Desktop sidebar refresh: collapsed state becomes a usable icon rail. */
@media (min-width: 961px) {
  #sidebar {
    width: 264px !important;
    min-width: 264px !important;
    padding: 18px 14px 18px !important;
    gap: 10px !important;
    overflow: visible !important;
    background:
      linear-gradient(180deg, rgba(18,18,24,0.98), rgba(12,12,16,0.98)),
      #101014 !important;
    border-right: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 14px 0 40px rgba(0,0,0,0.20);
  }

  #sidebar .brand {
    min-height: 42px;
    padding: 6px 48px 6px 8px !important;
    border-radius: 10px;
  }

  #sidebar .brand:hover,
  #sidebar .recent-item:hover {
    background: rgba(255,255,255,0.055);
  }

  #sidebar .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  #sidebar .create-btn {
    min-height: 42px;
    border-radius: 10px;
    text-align: left;
    font-weight: 800;
    background: linear-gradient(135deg, #8c7bff, #7d6af2);
    box-shadow: 0 12px 32px rgba(139,124,246,0.20), inset 0 1px 0 rgba(255,255,255,0.18);
  }

  #sidebar nav {
    gap: 7px;
    margin-top: 6px;
  }

  #sidebar .nav-item,
  #sidebar .recent-item,
  #sidebar .brand,
  #sidebar .create-btn,
  #sidebar .sidebar-social-link,
  #sidebar .sidebar-legal-links a {
    position: relative;
  }

  #sidebar .nav-item {
    min-height: 44px;
    border-radius: 9px;
    color: #8f8aa9;
  }

  #sidebar .nav-item:hover {
    color: #f5f3ff;
    background: rgba(255,255,255,0.065);
  }

  #sidebar .nav-item.active {
    background: rgba(255,255,255,0.095);
    color: #ffffff;
  }

  #sidebar .recents-section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  #sidebar .recent-item {
    min-height: 38px;
    border-radius: 9px;
  }

  #sidebar .sidebar-socials {
    display: grid;
  }

  #sidebar .sidebar-legal {
    margin-top: auto;
  }

  body.sidebar-collapsed #sidebar {
    width: 58px !important;
    min-width: 58px !important;
    padding: 12px 8px !important;
    align-items: center;
    border-right-color: rgba(255,255,255,0.10) !important;
  }

  body.sidebar-collapsed #sidebar > :not(.sidebar-collapse-btn) {
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 42px !important;
    min-width: 42px !important;
    overflow: visible !important;
  }

  body.sidebar-collapsed .sidebar-collapse-btn {
    position: absolute !important;
    top: 14px !important;
    left: auto !important;
    right: -17px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: #16161d !important;
    border-color: rgba(255,255,255,0.14) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  }

  body.sidebar-collapsed:has(#chatView.active) .sidebar-collapse-btn {
    top: 14px !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-top {
    width: 42px !important;
    min-width: 42px !important;
    gap: 10px !important;
    margin-bottom: 2px;
  }

  body.sidebar-collapsed #sidebar .brand,
  body.sidebar-collapsed #sidebar .create-btn,
  body.sidebar-collapsed #sidebar .nav-item,
  body.sidebar-collapsed #sidebar .recent-item,
  body.sidebar-collapsed #sidebar .sidebar-social-link {
    display: grid !important;
    place-items: center !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 9px !important;
    box-sizing: border-box;
  }

  body.sidebar-collapsed #sidebar .brand {
    display: flex !important;
  }

  body.sidebar-collapsed #sidebar .brand-text,
  body.sidebar-collapsed #sidebar .nav-item {
    font-size: 0 !important;
  }

  body.sidebar-collapsed #sidebar .create-btn {
    color: transparent !important;
    overflow: visible !important;
    position: relative !important;
    font-size: 0 !important;
    text-indent: -999px !important;
    text-align: center !important;
  }

  body.sidebar-collapsed #sidebar .create-btn::before {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 23px;
    line-height: 1;
    font-weight: 900;
    text-indent: 0;
  }

  body.sidebar-collapsed #sidebar .nav-item svg {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    margin: 0 !important;
  }

  body.sidebar-collapsed #sidebar .recents-section {
    width: 42px !important;
    min-width: 42px !important;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-gutter: auto !important;
    scrollbar-width: none !important;
    scrollbar-color: transparent transparent !important;
  }

  body.sidebar-collapsed #sidebar .recents-section::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  body.sidebar-collapsed #sidebar .recents-section::-webkit-scrollbar-track {
    background: transparent !important;
  }

  body.sidebar-collapsed #sidebar .recents-section::-webkit-scrollbar-thumb {
    background: rgba(86, 90, 108, 0.72) !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-clip: border-box !important;
  }

  body.sidebar-collapsed #sidebar .recents-section::-webkit-scrollbar-button {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  body.sidebar-collapsed #sidebar .recents-label,
  body.sidebar-collapsed #sidebar .recent-name,
  body.sidebar-collapsed #sidebar .sidebar-socials-label,
  body.sidebar-collapsed #sidebar .sidebar-legal-label,
  body.sidebar-collapsed #sidebar .sidebar-legal-links {
    display: none !important;
  }

  body.sidebar-collapsed #sidebar #recentsList {
    display: grid;
    gap: 8px;
  }

  body.sidebar-collapsed #sidebar .recent-avatar-image,
  body.sidebar-collapsed #sidebar .recent-avatar-blur-wrap {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border-radius: 7px !important;
  }

  body.sidebar-collapsed #sidebar .recent-sidebar-status,
  body.sidebar-collapsed #sidebar .recent-sidebar-skeleton {
    display: none !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-socials {
    width: 42px !important;
    min-width: 42px !important;
    margin-top: auto;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  body.sidebar-collapsed #sidebar .sidebar-socials-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.sidebar-collapsed #sidebar .sidebar-legal {
    display: none !important;
  }

  body.sidebar-collapsed [data-sidebar-tooltip]::after {
    content: attr(data-sidebar-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    z-index: 9999;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    background: rgba(8,8,12,0.98);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-indent: 0;
    text-align: left;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 16px 36px rgba(0,0,0,0.36);
    transition: opacity 120ms ease, transform 120ms ease;
  }

  body.sidebar-collapsed [data-sidebar-tooltip]:not(.create-btn)::before {
    content: "";
    position: absolute;
    left: calc(100% + 7px);
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    z-index: 9998;
    width: 8px;
    height: 8px;
    background: rgba(8,8,12,0.98);
    border-left: 1px solid rgba(255,255,255,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
  }

  body.sidebar-collapsed [data-sidebar-tooltip]:hover::after,
  body.sidebar-collapsed [data-sidebar-tooltip]:focus-visible::after,
  body.sidebar-collapsed [data-sidebar-tooltip]:not(.create-btn):hover::before,
  body.sidebar-collapsed [data-sidebar-tooltip]:not(.create-btn):focus-visible::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  body.sidebar-collapsed [data-sidebar-tooltip]:not(.create-btn):hover::before,
  body.sidebar-collapsed [data-sidebar-tooltip]:not(.create-btn):focus-visible::before {
    transform: translateY(-50%) rotate(45deg);
  }
}

/* Desktop sidebar menu control: use a clean hamburger instead of the protruding arrow tab. */
@media (min-width: 961px) {
  #sidebar .sidebar-collapse-btn,
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn {
    position: static !important;
    order: -2;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #f6f3ff !important;
    font-size: 0 !important;
    line-height: 0 !important;
    box-shadow: none !important;
  }

  #sidebar .sidebar-collapse-btn:hover,
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.075) !important;
  }

  #sidebar .sidebar-collapse-btn::before {
    content: "";
    width: 18px;
    height: 14px;
    display: block;
    background:
      linear-gradient(currentColor, currentColor) center 0 / 18px 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 6px / 18px 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 12px / 18px 2px no-repeat;
    border-radius: 2px;
  }

  #sidebar {
    align-items: stretch !important;
  }

  #sidebar .sidebar-top {
    order: -1;
    margin-top: -52px;
    padding-left: 44px;
    min-height: 92px;
    box-sizing: border-box;
  }

  #sidebar .brand {
    padding: 0 4px !important;
    min-height: 42px;
  }

  body:not(.sidebar-collapsed) #sidebar .create-btn {
    width: calc(100% + 44px) !important;
    margin-left: -44px !important;
  }

  body.sidebar-collapsed #sidebar {
    align-items: center !important;
    padding-top: 10px !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-top {
    order: 0;
    margin-top: 0;
    padding-left: 0;
    min-height: 0;
  }

  body.sidebar-collapsed #sidebar .brand {
    display: none !important;
  }

  body.sidebar-collapsed #sidebar .create-btn {
    margin-top: 4px;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn,
  body.sidebar-collapsed #sidebar .create-btn,
  body.sidebar-collapsed #sidebar .nav-item,
  body.sidebar-collapsed #sidebar .recent-item,
  body.sidebar-collapsed #sidebar .sidebar-social-link {
    position: relative !important;
    align-self: center !important;
    justify-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn::before,
  body.sidebar-collapsed #sidebar .create-btn::before,
  body.sidebar-collapsed #sidebar .nav-item svg,
  body.sidebar-collapsed #sidebar .nav-energy-icon,
  body.sidebar-collapsed #sidebar .sidebar-social-link img,
  body.sidebar-collapsed #sidebar .sidebar-social-link > svg {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
  }

  body.sidebar-collapsed #sidebar .create-btn::before {
    inset: auto !important;
    width: auto;
    height: auto;
  }

  body.sidebar-collapsed #sidebar .recent-avatar-blur-wrap,
  body.sidebar-collapsed #sidebar .recent-avatar-image {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
  }
}

/* Final desktop rail alignment and Recent Chats desktop layout. */
@media (min-width: 961px) {
  body.sidebar-collapsed #sidebar {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    box-sizing: border-box !important;
    padding: 10px 6px 12px !important;
    align-items: center !important;
    overflow: visible !important;
  }

  body.sidebar-collapsed #sidebar > :not(.sidebar-collapse-btn),
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn,
  body.sidebar-collapsed #sidebar .sidebar-top,
  body.sidebar-collapsed #sidebar nav,
  body.sidebar-collapsed #sidebar .recents-section,
  body.sidebar-collapsed #sidebar .sidebar-socials {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn,
  body.sidebar-collapsed #sidebar .create-btn,
  body.sidebar-collapsed #sidebar .nav-item,
  body.sidebar-collapsed #sidebar .recent-item,
  body.sidebar-collapsed #sidebar .sidebar-social-link {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0 !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn {
    background: transparent !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn:hover,
  body.sidebar-collapsed #sidebar .nav-item:hover,
  body.sidebar-collapsed #sidebar .nav-item.active,
  body.sidebar-collapsed #sidebar .recent-item:hover,
  body.sidebar-collapsed #sidebar .sidebar-social-link:hover {
    background: rgba(255,255,255,0.10) !important;
  }

  body.sidebar-collapsed #sidebar .create-btn {
    background: #8b72f6 !important;
    border-radius: 9px !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn::before,
  body.sidebar-collapsed #sidebar .create-btn::before,
  body.sidebar-collapsed #sidebar .nav-item svg,
  body.sidebar-collapsed #sidebar .nav-energy-icon,
  body.sidebar-collapsed #sidebar .sidebar-social-link img,
  body.sidebar-collapsed #sidebar .sidebar-social-link > svg,
  body.sidebar-collapsed #sidebar .recent-avatar-blur-wrap,
  body.sidebar-collapsed #sidebar .recent-avatar-image {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-collapse-btn::before {
    width: 18px !important;
    height: 2px !important;
    border-radius: 999px !important;
    background: currentColor !important;
    box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor !important;
    transform: translate(-50%, -50%) !important;
  }

  body.sidebar-collapsed #sidebar .nav-energy-icon {
    width: 22px !important;
    height: 22px !important;
    flex-basis: 22px !important;
  }

  body.sidebar-collapsed #main {
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  #recentChatsView {
    overflow-x: hidden !important;
  }

  #recentChatsView .recent-chats-page {
    width: min(760px, calc(100% - 48px));
    max-width: 760px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }

  #recentChatsView .recent-chats-panel {
    width: 100%;
    box-sizing: border-box;
  }
}

/* Keep the sidebar toggle glyph visually centered in both hide/show states. */
@media (min-width: 961px) {
  #sidebar .sidebar-collapse-btn,
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn {
    position: relative !important;
    inset: auto !important;
    overflow: hidden !important;
  }

  #sidebar .sidebar-collapse-btn::before,
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn::before {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
  }
}

/* Final override: the collapsed hamburger uses the exact rail button box and centerline. */
@media (min-width: 961px) {
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    align-self: center !important;
    justify-self: center !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  #sidebar .sidebar-collapse-btn::before,
  body.sidebar-collapsed #sidebar .sidebar-collapse-btn::before {
    width: 18px !important;
    height: 14px !important;
    border-radius: 2px !important;
    background:
      linear-gradient(currentColor, currentColor) center 0 / 18px 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 6px / 18px 2px no-repeat,
      linear-gradient(currentColor, currentColor) center 12px / 18px 2px no-repeat !important;
    box-shadow: none !important;
  }
}

/* Flush page headers to the full main viewport width on desktop. */
@media (min-width: 961px) {
  #recentChatsView,
  #yourCharactersView,
  #aimodelratingView,
  #chatView {
    scrollbar-gutter: auto !important;
  }

  #recentChatsView > .create-topbar,
  #yourCharactersView > .create-topbar,
  #aimodelratingView > .create-topbar,
  #chatView > .chat-topbar {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  #chatView > .chat-topbar {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 700px) auto 44px minmax(0, 1fr) !important;
  }

  #chatView > .chat-topbar #backBtn {
    grid-column: 2 !important;
    justify-self: center !important;
  }

  #chatView > .chat-topbar .chat-bot-info {
    grid-column: 3 !important;
  }

  #chatView > .chat-topbar .chat-actions {
    grid-column: 4 / 6 !important;
    justify-self: start !important;
    transform: none !important;
  }
}

/* Keep the collapsed sidebar's first controls equally tight on every view. */
@media (min-width: 961px) {
  body:not(.sidebar-collapsed) #sidebar #navGenerator {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    font-size: 14px !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    gap: 12px !important;
  }

  body.sidebar-collapsed #sidebar #navGenerator {
    display: grid !important;
  }

  body.sidebar-collapsed #sidebar {
    gap: 8px !important;
  }

  body.sidebar-collapsed #sidebar .sidebar-top {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    gap: 8px !important;
  }

  body.sidebar-collapsed #sidebar .create-btn {
    margin-top: 4px !important;
  }

  body.sidebar-collapsed:has(#chatView.active) #sidebar .sidebar-collapse-btn {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    transform: none !important;
  }

  #sidebar #navGenerator,
  body:not(.sidebar-collapsed) #sidebar #navGenerator,
  body.sidebar-collapsed #sidebar #navGenerator {
    display: none !important;
  }
}

/* Mobile route repaint revamp: Settings and Your Characters use the app shell as the
   single scroller so Android Chrome does not keep stale tiles from nested views. */
@media (max-width: 960px) {
  body[data-current-view="settings"] #main,
  body[data-current-view="yourCharacters"] #main {
    height: var(--app-height) !important;
    min-height: var(--app-height) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--bg) !important;
    scrollbar-gutter: auto !important;
  }

  body[data-current-view="settings"] #main > .view,
  body[data-current-view="yourCharacters"] #main > .view {
    display: none !important;
  }

  body[data-current-view="settings"] #settingsView.active,
  body[data-current-view="yourCharacters"] #yourCharactersView.active {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: var(--app-height) !important;
    overflow: visible !important;
    padding: 0 0 calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--bg) !important;
    transform: none !important;
    filter: none !important;
    contain: layout paint style;
    isolation: isolate;
    scrollbar-gutter: auto !important;
  }

  body[data-current-view="settings"] #settingsView.active *,
  body[data-current-view="settings"] #settingsView.active *::before,
  body[data-current-view="settings"] #settingsView.active *::after,
  body[data-current-view="yourCharacters"] #yourCharactersView.active *,
  body[data-current-view="yourCharacters"] #yourCharactersView.active *::before,
  body[data-current-view="yourCharacters"] #yourCharactersView.active *::after {
    animation: none !important;
    backface-visibility: visible !important;
  }

  body[data-current-view="settings"] #settingsView .create-topbar,
  body[data-current-view="yourCharacters"] #yourCharactersView .create-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    width: 100% !important;
    margin: 0 !important;
    background: #121218 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body[data-current-view="settings"] #settingsView .create-body.settings-body,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: var(--bg) !important;
    contain: layout paint style;
  }

  body[data-current-view="settings"] #settingsView .create-body.settings-body {
    padding: 18px 16px 0 !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page {
    padding: 18px 16px 0 !important;
    gap: 14px !important;
  }

  body[data-current-view="settings"] #settingsView .panel,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-hero,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-toolbar,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card {
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    will-change: auto !important;
  }

  body[data-current-view="settings"] #settingsView .settings-resource-panel,
  body[data-current-view="settings"] #settingsView #settingsResourcePanel.settings-resource-panel {
    display: grid !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    contain: layout paint style;
  }

  body[data-current-view="settings"] #settingsView .settings-social-grid,
  body[data-current-view="settings"] #settingsView .settings-resource-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-current-view="settings"] #settingsView .settings-social-link,
  body[data-current-view="settings"] #settingsView .settings-resource-link {
    min-height: 66px !important;
    background: #15161c !important;
    border-color: rgba(255,255,255,0.13) !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-hero {
    display: none !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-mobile-create-cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 0 2px !important;
    border-radius: 14px !important;
    font-weight: 850 !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-mobile-create-btn {
    display: none !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-toolbar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    padding: 0 0 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-grid {
    display: grid !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card {
    background: #101116 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    box-shadow: none !important;
  }
}

/* Hard mobile fallback: leave the clipped app viewport entirely for the two
   routes that Android Chrome is repainting with stale tiles. */
@media (max-width: 960px) {
  html:has(body[data-current-view="settings"]),
  html:has(body[data-current-view="yourCharacters"]) {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: var(--bg) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  body[data-current-view="settings"],
  body[data-current-view="yourCharacters"] {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: var(--bg) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  html:has(body[data-current-view="settings"])::-webkit-scrollbar,
  html:has(body[data-current-view="yourCharacters"])::-webkit-scrollbar,
  body[data-current-view="settings"]::-webkit-scrollbar,
  body[data-current-view="yourCharacters"]::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  body[data-current-view="settings"] #sidebar,
  body[data-current-view="settings"] .sidebar-collapse-btn,
  body[data-current-view="yourCharacters"] #sidebar,
  body[data-current-view="yourCharacters"] .sidebar-collapse-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body[data-current-view="settings"] #main,
  body[data-current-view="yourCharacters"] #main {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    background: var(--bg) !important;
    transform: none !important;
    contain: none !important;
    isolation: auto !important;
  }

  body[data-current-view="settings"] #settingsView.active,
  body[data-current-view="yourCharacters"] #yourCharactersView.active {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    contain: none !important;
    isolation: auto !important;
  }

  body[data-current-view="settings"] #settingsView .create-topbar,
  body[data-current-view="yourCharacters"] #yourCharactersView .create-topbar {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    background: #121218 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body[data-current-view="settings"] #settingsView .create-body.settings-body,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page,
  body[data-current-view="settings"] #settingsView .panel,
  body[data-current-view="settings"] #settingsView .settings-resource-panel,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card {
    contain: none !important;
    isolation: auto !important;
    transform: none !important;
    filter: none !important;
  }

  body[data-current-view="settings"] .mobile-bottom-nav,
  body[data-current-view="yourCharacters"] .mobile-bottom-nav {
    background: rgba(13,13,16,0.96) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    box-shadow: 0 -14px 38px rgba(0,0,0,0.42) !important;
  }

  body.native-app-shell #uHideNsfwRow,
  body.native-app-shell #uHideNsfwHelp,
  body.native-app-preview #uHideNsfwRow,
  body.native-app-preview #uHideNsfwHelp,
  body.native-app-shell #createTagSafetyHelp,
  body.native-app-preview #createTagSafetyHelp {
    display: none !important;
  }

  #createView .create-publish-row.create-publish-row-rating-hidden {
    grid-template-columns: 1fr !important;
  }
}

/* Polished Android-safe cards: keep the UI looking like Chayt, but avoid the
   translucent/shadowed/clipped card layers that were repainting as stale tiles. */
@media (max-width: 960px) {
  body[data-current-view="settings"] #settingsResourcePanel,
  body[data-current-view="settings"] #settingsResourcePanel *,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    will-change: auto !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel {
    display: grid !important;
    gap: 14px !important;
    padding: 0 !important;
    border: 0 !important;
    background: #0d0d10 !important;
    overflow: visible !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel .settings-social-grid,
  body[data-current-view="settings"] #settingsResourcePanel .settings-resource-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel .settings-social-link,
  body[data-current-view="settings"] #settingsResourcePanel .settings-resource-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 72px !important;
    padding: 12px !important;
    border: 1px solid #30303a !important;
    border-radius: 14px !important;
    background: #15161c !important;
    color: var(--text) !important;
    overflow: visible !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel .settings-social-link:active,
  body[data-current-view="settings"] #settingsResourcePanel .settings-resource-link:active {
    background: #191a21 !important;
    border-color: #3b3b48 !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel .settings-resource-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    border: 1px solid #363244 !important;
    border-radius: 13px !important;
    background: #25213a !important;
    color: #dcd6ff !important;
    overflow: visible !important;
  }

  body[data-current-view="settings"] #settingsResourcePanel .settings-resource-icon svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-hero {
    display: none !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 18px 12px 0 !important;
    background: #0d0d10 !important;
    overflow: visible !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-toolbar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    padding: 12px !important;
    border: 1px solid #30303a !important;
    border-radius: 16px !important;
    background: #121318 !important;
    overflow: visible !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .search-field {
    height: 46px !important;
    border: 1px solid #30303a !important;
    border-radius: 13px !important;
    background: #0f1015 !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    overflow: visible !important;
    background: transparent !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card {
    display: grid !important;
    gap: 12px !important;
    padding: 14px !important;
    border: 1px solid #30303a !important;
    border-radius: 16px !important;
    background: #121318 !important;
    overflow: visible !important;
    cursor: pointer !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card:active {
    background: #161720 !important;
    border-color: #3a3a47 !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-header {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    padding-right: 28px !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-avatar {
    display: block !important;
    width: 58px !important;
    height: 58px !important;
    border: 1px solid #363642 !important;
    border-radius: 14px !important;
    background: #1b1c22 !important;
    overflow: visible !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-avatar .avatar-image,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 13px !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-copy h3,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-copy p {
    overflow: hidden !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-stat,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-chip,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-action-btn,
  body[data-current-view="yourCharacters"] #yourCharactersView .memory-icon-btn {
    border: 1px solid #33333f !important;
    border-radius: 999px !important;
    background: #1a1b22 !important;
    color: rgba(235,238,255,0.9) !important;
    overflow: visible !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-chip.danger,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-action-btn.danger,
  body[data-current-view="yourCharacters"] #yourCharactersView .memory-icon-btn.danger {
    background: #2a1519 !important;
    border-color: #5a2a31 !important;
    color: #ffd0d0 !important;
  }

  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-stat svg,
  body[data-current-view="yourCharacters"] #yourCharactersView .your-character-action-btn svg {
    display: block !important;
  }
}

/* Desktop Your Characters viewport clamp: keep expanded-sidebar layouts inside the main pane. */
@media (min-width: 961px) {
  #yourCharactersView {
    overflow-x: hidden !important;
  }

  #yourCharactersView .your-characters-page {
    width: min(100%, calc(100% - 48px)) !important;
    max-width: 1120px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  #yourCharactersView .your-characters-hero,
  #yourCharactersView .your-characters-toolbar,
  #yourCharactersView .your-character-card {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #yourCharactersView .your-characters-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 154px !important;
    height: 154px !important;
    align-content: center !important;
  }

  #yourCharactersView .your-characters-hero > div {
    min-width: 0 !important;
  }

  #yourCharactersView .your-characters-hero .btn-save {
    max-width: min(260px, 36vw) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #yourCharactersView .your-characters-toolbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 74px !important;
  }

  #yourCharactersView .your-character-card {
    grid-template-columns: minmax(290px, 1fr) minmax(200px, .72fr) max-content !important;
    gap: 12px !important;
    height: 118px !important;
    min-height: 118px !important;
    max-height: 118px !important;
    padding: 18px 74px 18px 16px !important;
    overflow: hidden !important;
  }

  #yourCharactersView .your-character-header,
  #yourCharactersView .your-character-copy,
  #yourCharactersView .your-character-chips,
  #yourCharactersView .your-character-actions {
    min-width: 0 !important;
  }

  #yourCharactersView .your-character-actions {
    justify-self: end !important;
    max-width: 222px !important;
  }

  #yourCharactersView .your-character-chips {
    max-height: 54px !important;
    overflow: hidden !important;
  }

  #yourCharactersView .your-character-action-btn {
    flex-basis: 38px !important;
    width: 38px !important;
    min-width: 38px !important;
  }
}

@media (min-width: 961px) and (max-width: 1180px) {
  body:not(.sidebar-collapsed) #yourCharactersView .your-character-card {
    grid-template-columns: minmax(210px, 1fr) minmax(170px, .7fr) 114px !important;
    gap: 10px !important;
    padding-right: 58px !important;
  }

  body:not(.sidebar-collapsed) #yourCharactersView .your-character-actions {
    width: 114px !important;
    max-width: 114px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-content: center !important;
    gap: 6px !important;
  }

  body:not(.sidebar-collapsed) #yourCharactersView .your-character-action-btn {
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
  }

  body:not(.sidebar-collapsed) #yourCharactersView .your-character-action-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  body:not(.sidebar-collapsed) #creditsView .chayt-plus-mini-plans {
    grid-template-columns: 1fr !important;
  }

  body:not(.sidebar-collapsed) #creditsView .chayt-plus-credit-panel {
    height: auto !important;
    min-height: max-content !important;
    overflow: hidden !important;
  }

  body:not(.sidebar-collapsed) #creditsView .chayt-plus-mini-plan .paypal-button-slot {
    min-height: 106px !important;
  }
}

/* Mobile/tablet polish: model picker rows should feel like a row of equal tiles,
   and Settings needs enough scroll room above the fixed bottom nav. */
@media (max-width: 960px) {
  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    align-items: stretch !important;
    grid-auto-rows: 1fr !important;
  }

  #chatStyleView .chat-style-model-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card {
    height: 100% !important;
    align-self: stretch !important;
  }

  body[data-current-view="settings"] #settingsView.active {
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-current-view="settings"] #settingsView .create-body.settings-body {
    padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-current-view="settings"] #settingsView #dangerZonePanel {
    margin-bottom: calc(38px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #recentChatsView > .create-topbar,
  #aimodelratingView > .create-topbar,
  #creditsView > .credits-topbar,
  #settingsView > .create-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: #121218 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #settingsView > .create-topbar {
    position: relative !important;
    top: auto !important;
  }

  #recentChatsView > .create-topbar .create-title,
  #aimodelratingView > .create-topbar .create-title,
  #creditsView > .credits-topbar .create-title,
  #settingsView > .create-topbar .create-title {
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
  }
}

/* Keep create entry points flat. */
#sidebar .create-btn,
#sidebar .create-btn:hover,
#sidebar .create-btn:focus-visible,
body.sidebar-collapsed #sidebar .create-btn,
body.sidebar-collapsed #sidebar .create-btn:hover,
body.sidebar-collapsed #sidebar .create-btn:focus-visible,
#yourCharactersCreateBtn,
#yourCharactersCreateBtn:hover,
#yourCharactersCreateBtn:focus-visible,
.your-characters-mobile-create-cta,
.your-characters-mobile-create-cta:hover,
.your-characters-mobile-create-cta:focus-visible,
.your-characters-mobile-create-btn,
.your-characters-mobile-create-btn:hover,
.your-characters-mobile-create-btn:focus-visible,
.mobile-create-btn,
.mobile-create-btn:hover,
.mobile-create-btn:focus-visible,
.mobile-hero-create-btn,
.mobile-hero-create-btn:hover,
.mobile-hero-create-btn:focus-visible,
.mobile-floating-create-btn,
.mobile-floating-create-btn:hover,
.mobile-floating-create-btn:focus-visible {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

@media (max-width: 520px) {
  #createView .create-persona-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Lightweight loading states for low-end mobile devices. */
.recent-sidebar-skeleton span,
.recent-sidebar-skeleton i,
.composer-suggestion-message-preview.is-loading,
.composer-skeleton-line,
.composer-skeleton-button,
.today-chayt-card-media.today-chayt-skeleton-media,
.today-chayt-skeleton-line,
.discovery-search-skeleton-avatar,
.discovery-search-skeleton-copy i,
.discovery-search-skeleton-copy b,
.discovery-search-skeleton-copy em,
.discovery-search-skeleton-stat {
  background: rgba(255,255,255,0.085) !important;
  background-image: none !important;
  background-size: auto !important;
  animation: none !important;
}

.composer-suggestion-loading-card::after,
.today-chayt-skeleton-card::after,
.discovery-skeleton-card::before,
.discovery-skeleton-shine {
  content: none !important;
  display: none !important;
  animation: none !important;
  transform: none !important;
}

.discovery-skeleton-card {
  background: #1b1b20 !important;
  border-color: rgba(255,255,255,0.04) !important;
}

.discovery-filter-loader-bar::before {
  width: 100% !important;
  background: rgba(255,255,255,0.34) !important;
  transform: none !important;
  animation: none !important;
}

body.is-discovery-filtering #featuredGrid {
  opacity: .82 !important;
  filter: none !important;
}

/* Mobile stability fixes */
#detailChatBtn.is-loading {
  background: #24232a !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.9) !important;
  box-shadow: none !important;
  cursor: wait;
}

#detailChatBtn.is-loading,
#detailChatBtn.is-loading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.detail-chat-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.28);
  border-top-color: rgba(255,255,255,0.92);
  animation: detailChatSpinner .72s linear infinite;
}

@keyframes detailChatSpinner {
  to { transform: rotate(360deg); }
}

.discovery-search-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.discovery-search-page,
.discovery-search-overlay.is-open .discovery-search-page,
body.native-app-shell .discovery-search-page,
body.capacitor-app .discovery-search-page {
  box-shadow: none !important;
  filter: none !important;
}

.discovery-search-filters select,
.discovery-search-filters select:hover,
.discovery-search-filters select:focus,
.discovery-search-loading-card,
.discovery-search-load-more-modal {
  box-shadow: none !important;
  filter: none !important;
}

.auth-gate-card,
.auth-gate-logo,
.auth-mode-tabs,
.auth-mode-tab,
.auth-mode-tab.active,
.auth-submit-btn,
.google-signin .provider-btn.primary {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

.auth-mode-tab.active {
  background: var(--accent) !important;
  color: #fff !important;
}

.auth-submit-btn {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus-visible {
  background: var(--accent-d) !important;
  border-color: var(--accent-d) !important;
}

.discovery-search-overlay,
.discovery-search-page {
  transition: none !important;
}

body.native-app-shell #homeView .discovery-tabs.indicator-ready .discovery-tab-indicator,
body.capacitor-app #homeView .discovery-tabs.indicator-ready .discovery-tab-indicator,
body.native-app-shell #homeView .discovery-tab,
body.capacitor-app #homeView .discovery-tab {
  transition: none !important;
  animation: none !important;
}

body.native-app-shell .discovery-search-overlay,
body.native-app-shell .discovery-search-page,
body.capacitor-app .discovery-search-overlay,
body.capacitor-app .discovery-search-page {
  transition: none !important;
  transform: none !important;
}

@media (max-width: 640px) {
  #settingsView .persona-manager-head {
    align-items: center;
  }

  #settingsView .persona-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #settingsView .persona-toolbar select {
    grid-column: 1 / -1;
  }

  #settingsView .persona-toolbar .mini-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  .chat-persona-switcher {
    max-width: 118px;
  }

  .chat-persona-switcher select {
    max-width: 118px;
    height: 32px;
    padding-left: 9px;
    padding-right: 24px;
    font-size: 11px;
  }
}

@media (hover: none), (pointer: coarse) {
  .bot-card,
  .recent-chat-card,
  .discovery-search-result-card,
  .your-character-card {
    -webkit-tap-highlight-color: transparent;
  }

  .bot-card:active,
  .recent-chat-card:active,
  .discovery-search-result-card:active,
  .your-character-card:active {
    background-color: inherit !important;
    filter: none !important;
    transform: none !important;
    box-shadow: none !important;
  }
}

@media (max-width: 960px) {
  #settingsView #uPersonality,
  #settingsView #uStyle {
    min-height: 132px !important;
    line-height: 1.35 !important;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    overflow-y: auto;
  }
}

.chat-start-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 6200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5,5,8,0.72);
}

.chat-start-choice-modal.hidden {
  display: none;
}

.chat-start-choice-card {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background: #15151b;
  color: rgba(246,246,255,0.96);
  box-shadow: 0 20px 54px rgba(0,0,0,0.46);
}

.chat-start-choice-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: #20202a;
  color: rgba(255,255,255,0.78);
  font: 900 16px/1 var(--font-ui);
  cursor: pointer;
}

.chat-start-choice-kicker {
  margin-bottom: 8px;
  color: rgba(159,140,255,0.92);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-start-choice-card h2 {
  margin: 0;
  padding-right: 40px;
  font-size: 22px;
  line-height: 1.18;
}

.chat-start-choice-card p {
  margin: 8px 0 16px;
  color: rgba(214,212,229,0.74);
  font-size: 13px;
  line-height: 1.45;
}

.chat-start-choice-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: #1d1d25;
  color: rgba(232,230,246,0.86);
  font-size: 12px;
}

.chat-start-choice-preview span,
.chat-start-choice-preview strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-start-choice-preview span {
  flex: 0 0 auto;
  color: rgba(177,173,198,0.76);
}

.chat-start-choice-preview strong {
  flex: 1 1 auto;
  text-align: right;
}

.chat-start-choice-actions {
  display: grid;
  gap: 10px;
}

.chat-start-choice-btn {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: #20202a;
  color: rgba(250,250,255,0.94);
  text-align: left;
  cursor: pointer;
  transition: none;
}

.chat-start-choice-btn.primary {
  border-color: rgba(159,140,255,0.42);
  background: rgba(159,140,255,0.15);
}

.chat-start-choice-btn strong {
  font-size: 14px;
  line-height: 1.2;
}

.chat-start-choice-btn span {
  color: rgba(218,216,234,0.72);
  font-size: 12px;
  line-height: 1.3;
}

@media (max-width: 960px) {
  .chat-start-choice-modal {
    place-items: end stretch;
    padding: 0;
    background: rgba(5,5,8,0.82);
  }

  .chat-start-choice-card {
    width: 100%;
    max-height: 92dvh;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: none;
  }

  .chat-start-choice-card h2 {
    font-size: 19px;
  }

  .chat-start-choice-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .chat-start-choice-preview strong {
    text-align: left;
  }

  #chatStyleView .history-subtitle,
  #userPersonaView .history-subtitle,
  #conversationMemoryView .history-subtitle,
  #historyView .history-subtitle {
    display: none;
  }

  #chatStyleView .history-topbar,
  #userPersonaView .history-topbar,
  #conversationMemoryView .history-topbar,
  #historyView .history-topbar {
    min-height: 56px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    gap: 10px;
    background: #111116;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #chatStyleView .history-title,
  #userPersonaView .history-title,
  #conversationMemoryView .history-title,
  #historyView .history-title {
    font-size: 15px;
    line-height: 1.15;
  }

  #chatStyleView .history-body,
  #userPersonaView .history-body,
  #conversationMemoryView .history-body,
  #historyView .history-body {
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 12px;
    overflow-x: hidden !important;
  }

  #userPersonaView.active {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    padding-bottom: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    height: 100svh !important;
    min-height: 100svh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  #userPersonaView .history-topbar {
    grid-row: 1;
    flex: 0 0 auto;
  }

  #userPersonaView .user-persona-body {
    grid-row: 2;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #chatStyleView .chat-style-panel,
  #userPersonaView .user-persona-page-panel,
  #conversationMemoryView .memory-panel {
    width: 100%;
  }

  #userPersonaView .user-persona-page-panel {
    min-height: 100%;
  }

  #userPersonaView .user-persona-edit-pane {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  }

  #userPersonaView .user-persona-edit-grid {
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  }

  #userPersonaView .user-persona-page-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 10px;
    border-radius: 10px;
  }

  #userPersonaView .user-persona-item-avatar {
    width: 42px;
    height: 42px;
  }

  #userPersonaView .chat-style-section-pill {
    font-size: 15px;
  }

  #userPersonaView .user-persona-item-title {
    font-size: 13px;
  }

  #userPersonaView .user-persona-item-tags {
    gap: 4px;
  }

  #userPersonaView .user-persona-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #userPersonaView .user-persona-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #userPersonaView .user-persona-avatar-editor .avatar-controls {
    justify-content: center;
    width: 100%;
    max-width: 156px;
    margin-inline: auto;
  }

  #userPersonaView .user-persona-avatar-editor .avatar-controls > .icon-tool-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  #chatStyleView .memory-model-field {
    padding: 0;
    border-bottom: 0;
  }

  #chatStyleView .chat-style-model-browser,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-browser {
    gap: 18px;
  }

  #chatStyleView .chat-style-section-head,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-head {
    display: grid;
    gap: 4px;
    padding-bottom: 8px;
  }

  #chatStyleView .chat-style-section-pill,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-pill {
    justify-content: flex-start;
    min-height: 24px;
    font-size: 15px;
  }

  #chatStyleView .chat-style-section-pill::before,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-pill::before {
    width: 6px;
    height: 18px;
    margin-right: 8px;
    box-shadow: none;
  }

  #chatStyleView .chat-style-section-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-section-note {
    padding-left: 14px;
    font-size: 11px;
  }

  #chatStyleView .chat-style-model-row,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-row {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    touch-action: auto !important;
  }

  #chatStyleView .chat-style-model-card,
  #chatStyleView .chat-style-model-card.chayt-mode-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card.chayt-mode-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 6px 10px;
    padding: 12px 13px !important;
    border-radius: 10px !important;
    background: #1a1a20 !important;
    box-shadow: none !important;
  }

  #chatStyleView .chat-style-model-card.selected,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card.selected {
    border-color: rgba(139,124,246,0.72) !important;
    background: rgba(139,124,246,0.12) !important;
  }

  #chatStyleView .chat-style-model-title,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-title {
    grid-column: 1 / -1;
    padding: 0 !important;
    border-bottom: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  #chatStyleView .chat-style-model-desc,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-desc {
    grid-column: 1 / -1;
    font-size: 12px !important;
    line-height: 1.32 !important;
  }

  #chatStyleView .chat-style-model-includes,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-includes {
    display: none;
  }

  #chatStyleView .chat-style-model-foot,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot {
    grid-column: 1 / -1;
    min-height: 0;
    align-items: center;
    gap: 8px;
    font-size: 10px;
  }

  #chatStyleView .chat-style-energy-note,
  #conversationMemoryView #conversationSummaryModelPicker .chat-style-energy-note {
    max-width: none;
    text-align: right;
  }

  #conversationMemoryView .memory-title,
  #conversationMemoryView .memory-subtitle,
  #conversationMemoryView #conversationSummaryModelHint,
  #conversationMemoryView #closeMemoryBtn {
    display: none !important;
  }

  #conversationMemoryView .memory-panel {
    gap: 12px;
  }

  #conversationMemoryView .memory-panel-head {
    display: block;
  }

  #conversationMemoryView .memory-actions {
    display: grid;
    grid-template-columns: repeat(4, 42px);
    justify-content: start;
    gap: 8px;
  }

  #conversationMemoryView .memory-actions .memory-icon-btn {
    width: 42px;
    height: 42px;
    flex-basis: auto;
    border-radius: 10px;
  }

  #conversationMemoryView #conversationSummaryInput {
    min-height: 176px;
    max-height: 34dvh;
  }

  #conversationMemoryView .memory-model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
  }

  #conversationMemoryView .memory-model-field:not(:first-child) {
    display: none;
  }

  #historyView .history-search {
    margin: 0;
  }

  #historyView .history-list,
  #historyView .history-card,
  #historyView .history-card-sessions {
    min-width: 0;
    max-width: 100%;
  }

  #historyView .history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
  }

  #historyView #historyDeleteSelectedBtn {
    grid-column: 1 / -1;
  }

  #historyView .history-card-head > .mini-btn {
    display: none;
  }

  #historyView .history-card-head {
    gap: 10px;
  }

  #historyView .history-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  #historyView .history-session {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 11px 0;
  }

  #historyView .history-session-preview {
    grid-column: 2 / -1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #historyView .history-open-btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
  }
}

@media (max-width: 700px), (max-height: 760px) {
  .brand-confirm-modal.report-modal {
    place-items: end stretch;
    align-items: end;
    padding: 0;
    background: rgba(4,5,8,0.86);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .brand-confirm-modal.report-modal .report-modal-card {
    align-self: end;
    width: 100%;
    max-height: 100dvh;
    padding: 16px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: none;
  }

  .brand-confirm-modal.report-modal .brand-confirm-logo {
    display: none;
  }

  .brand-confirm-modal.report-modal .brand-confirm-copy {
    font-size: 13px;
  }

  .brand-confirm-modal.report-modal .report-modal-reasons {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 12px;
  }

  .brand-confirm-modal.report-modal .report-reason-option {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .brand-confirm-modal.report-modal .report-modal-textarea {
    min-height: 92px;
    resize: none;
  }

  .brand-confirm-modal.report-modal .report-modal-textarea:focus {
    box-shadow: none;
  }

  .brand-confirm-modal.report-modal .brand-confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin: 12px -16px -16px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* Performance trim: keep structure, remove costly shadows/blurs on dense app surfaces. */
.chat-menu,
.msg.actions-visible .msg-controls,
.msg .msg-controls.is-hiding,
.msg:hover .msg-controls,
.brand-confirm-card,
.brand-confirm-logo,
.report-modal-card,
.delete-account-warning-card,
.chat-start-choice-card,
.history-card,
.history-session,
.memory-panel,
.chat-style-model-card,
.chat-style-model-card.selected,
.settings-overview-card,
#settingsView .panel,
#settingsView .form-group,
#settingsView .profile-interest-panel,
#settingsView .ai-provider-fields,
#settingsView .roleplay-style-panel,
#settingsView #dangerZonePanel,
#creditsView .credit-history-item,
#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card,
#aimodelratingView .ai-model-card,
#aimodelratingView .ai-model-comment {
  box-shadow: none !important;
}

.chat-menu,
.brand-confirm-modal,
.delete-account-warning-modal,
.chat-start-choice-modal,
body.chat-overlay-open #historyView.active,
body.chat-overlay-open #chatStyleView.active,
body.chat-overlay-open #userPersonaView.active,
body.chat-overlay-open #conversationMemoryView.active {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.chat-menu,
.chat-menu button,
.msg-controls,
.msg-action-btn,
.history-session,
.chat-style-model-card,
.report-reason-option {
  transition: none !important;
}

.msg.actions-visible .msg-controls,
.msg:focus-within .msg-controls,
.msg-controls:focus-within,
.msg .msg-controls.is-hiding,
.msg:hover .msg-controls {
  box-shadow: none !important;
  transform: none !important;
}

.msg-action-btn:hover {
  transform: none !important;
}

@media (max-width: 960px) {
  .msg.actions-visible .msg-controls,
  .msg:focus-within .msg-controls,
  .msg-controls:focus-within {
    transform: translateY(-100%) !important;
  }

  .msg-controls.is-anchored,
  .msg.user .msg-controls.is-anchored {
    left: var(--msg-actions-x, 50vw) !important;
    top: var(--msg-actions-y, 50vh) !important;
    right: auto !important;
  }

  .msg.actions-visible .msg-controls.is-anchored,
  .msg:focus-within .msg-controls.is-anchored,
  .msg-controls.is-anchored:focus-within {
    transform: translate(-50%, calc(-100% - 10px)) !important;
  }

  .msg .msg-controls.is-hiding.is-anchored,
  .msg:hover .msg-controls.is-hiding.is-anchored,
  .msg.actions-visible:hover .msg-controls.is-hiding.is-anchored,
  .msg:focus-within:hover .msg-controls.is-hiding.is-anchored {
    transform: translate(-50%, calc(-100% + 8px)) !important;
  }
}

@media (min-width: 961px) {
  body.chat-overlay-open #historyView.active,
  body.chat-overlay-open #chatStyleView.active,
  body.chat-overlay-open #userPersonaView.active,
  body.chat-overlay-open #conversationMemoryView.active,
  body.chat-overlay-open #historyView .history-topbar,
  body.chat-overlay-open #chatStyleView .history-topbar,
  body.chat-overlay-open #userPersonaView .history-topbar,
  body.chat-overlay-open #conversationMemoryView .history-topbar,
  body.chat-overlay-open #historyView .history-body,
  body.chat-overlay-open #chatStyleView .history-body,
  body.chat-overlay-open #userPersonaView .history-body,
  body.chat-overlay-open #conversationMemoryView .history-body {
    animation: none !important;
    box-shadow: none !important;
  }
}

@media (max-width: 960px) {
  body.mobile-tab-switching *,
  body.native-app-shell.mobile-tab-switching *,
  body.capacitor-app.mobile-tab-switching * {
    animation: none !important;
    transition: none !important;
  }

  .mobile-bottom-nav,
  .mobile-home-topbar,
  #homeView .discovery-tabs,
  #homeView .discovery-search-open-btn,
  #homeView .discovery-support-banner,
  #homeView .today-with-chayt,
  #homeView .today-chayt-card,
  #homeView .bot-card,
  #homeView .bot-card:hover,
  #homeView .bot-card:active,
  #homeView .bot-card:focus-visible,
  #homeView .bot-card-media,
  #homeView .bot-card-avatar,
  #recentChatsView .recent-chat-card,
  #yourCharactersView .your-character-card,
  #creditsView .credits-plan-card,
  #creditsView .credit-pack-card,
  #creditsView .chayt-plus-plan-card,
  #aimodelratingView .ai-model-card {
    box-shadow: none !important;
    transform: none !important;
  }

  .mobile-bottom-nav,
  .mobile-home-topbar,
  #homeView .discovery-tabs,
  #homeView .discovery-search-open-btn,
  #recentChatsView .create-topbar,
  #settingsView .create-topbar,
  #creditsView .create-topbar,
  #aimodelratingView .create-topbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .mobile-bottom-nav {
    background: #0d0d10 !important;
  }

  .mobile-bottom-nav-item,
  .mobile-bottom-nav-item *,
  #homeView .bot-card,
  #homeView .bot-card *,
  #recentChatsView .recent-chat-card,
  #yourCharactersView .your-character-card,
  #creditsView .credits-plan-card,
  #creditsView .credit-pack-card,
  #aimodelratingView .ai-model-card {
    transition: none !important;
  }

  .mobile-bottom-nav-item .mobile-energy-icon,
  .premium-verify-badge,
  .chayt-plus-benefit-energy-icon {
    filter: none !important;
  }
}

/* Native banner layout fixes: reserve top space per view instead of letting the
   ad overlay hide chat headers or the mobile Discovery search/tabs. */
@media (max-width: 960px) {
  body.native-app-shell.native-ad-banner-visible #main,
  body.capacitor-app.native-ad-banner-visible #main {
    padding-top: 0 !important;
    height: var(--app-height) !important;
  }

  body.native-app-shell #homeView,
  body.capacitor-app #homeView {
    padding-top: calc(112px + var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  }

  body.native-app-shell #homeView .mobile-home-topbar,
  body.capacitor-app #homeView .mobile-home-topbar {
    position: fixed !important;
    top: var(--native-ad-banner-height, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100dvw !important;
    min-width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: #121218 !important;
    overflow: hidden !important;
    z-index: 1900 !important;
  }

  body.native-app-shell #homeView .discovery-search-open-btn,
  body.capacitor-app #homeView .discovery-search-open-btn {
    position: absolute !important;
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    left: 16px !important;
    width: calc(100dvw - 32px) !important;
    max-width: calc(100dvw - 32px) !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border-radius: 18px !important;
    background: #202026 !important;
    transform: none !important;
    z-index: 1902 !important;
  }

  body.native-app-shell #homeView .discovery-search-open-label,
  body.capacitor-app #homeView .discovery-search-open-label {
    display: inline-block !important;
  }

  body.native-app-shell #homeView .discovery-tabs,
  body.capacitor-app #homeView .discovery-tabs {
    position: fixed !important;
    top: calc(var(--native-ad-banner-height, 0px) + 56px + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    width: 100dvw !important;
    min-width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 8px 14px 0 !important;
    background: #121218 !important;
    overflow-x: auto !important;
    z-index: 1901 !important;
  }

  body.native-app-shell #homeView .mobile-discovery-search-clear-btn,
  body.capacitor-app #homeView .mobile-discovery-search-clear-btn {
    position: absolute !important;
    top: calc(17px + env(safe-area-inset-top, 0px)) !important;
    z-index: 1903 !important;
  }

  body.native-app-shell #homeView .discovery-support-banner,
  body.capacitor-app #homeView .discovery-support-banner {
    margin: 8px 16px 12px !important;
    width: calc(100dvw - 32px) !important;
    max-width: calc(100dvw - 32px) !important;
  }

  body.native-app-shell #homeView .today-with-chayt,
  body.capacitor-app #homeView .today-with-chayt {
    margin-top: 10px !important;
    margin-bottom: -8px !important;
  }

  body.native-app-shell #homeView.today-chayt-hidden #userSection.hidden + .bot-section,
  body.capacitor-app #homeView.today-chayt-hidden #userSection.hidden + .bot-section {
    margin-top: 0 !important;
  }

  body.native-app-shell.native-ad-banner-visible #chatView .chat-topbar,
  body.capacitor-app.native-ad-banner-visible #chatView .chat-topbar {
    margin-top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
    padding-top: 8px !important;
    min-height: 58px !important;
  }

  body.native-app-shell.native-ad-banner-visible #recentChatsView > .create-topbar,
  body.capacitor-app.native-ad-banner-visible #recentChatsView > .create-topbar {
    margin-top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
    padding-top: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  body.native-app-shell.native-ad-banner-visible #recentChatsView .recent-chats-page,
  body.capacitor-app.native-ad-banner-visible #recentChatsView .recent-chats-page {
    padding-top: 12px !important;
  }

  body.native-app-shell.native-ad-banner-visible #recentChatsView .recent-chats-panel,
  body.capacitor-app.native-ad-banner-visible #recentChatsView .recent-chats-panel {
    gap: 14px !important;
    padding-top: 0 !important;
  }

  body.native-app-shell.native-ad-banner-visible .support-ad-slot,
  body.native-app-shell.native-ad-banner-visible .support-ad-slot.is-ad-active,
  body.capacitor-app.native-ad-banner-visible .support-ad-slot,
  body.capacitor-app.native-ad-banner-visible .support-ad-slot.is-ad-active {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  body.native-app-shell.native-ad-banner-visible #chatView .messages,
  body.capacitor-app.native-ad-banner-visible #chatView .messages {
    scroll-padding-top: calc(68px + var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  }

  body.native-app-shell.native-ad-banner-visible #chatView .chat-menu,
  body.capacitor-app.native-ad-banner-visible #chatView .chat-menu {
    top: 0 !important;
    height: calc(100dvh - var(--native-ad-banner-height, 0px) - env(safe-area-inset-top, 0px)) !important;
    padding-top: 18px !important;
  }

  body.native-app-shell.native-ad-banner-visible #chatView.menu-open::before,
  body.capacitor-app.native-ad-banner-visible #chatView.menu-open::before {
    top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  }

  body.native-app-shell.native-ad-banner-visible .discovery-search-overlay,
  body.capacitor-app.native-ad-banner-visible .discovery-search-overlay {
    padding-top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  }

  body.native-app-shell.native-ad-banner-visible .discovery-search-page,
  body.capacitor-app.native-ad-banner-visible .discovery-search-page {
    height: calc(100dvh - var(--native-ad-banner-height, 0px) - env(safe-area-inset-top, 0px)) !important;
    min-height: calc(100dvh - var(--native-ad-banner-height, 0px) - env(safe-area-inset-top, 0px)) !important;
    margin-top: 0 !important;
  }

  body.native-app-shell.native-ad-banner-visible .discovery-search-head,
  body.capacitor-app.native-ad-banner-visible .discovery-search-head {
    min-height: 70px !important;
    padding-top: 12px !important;
  }

  .msg-controls.is-anchored,
  .msg.user .msg-controls.is-anchored {
    left: var(--msg-actions-x, 50vw) !important;
    top: var(--msg-actions-y, 50vh) !important;
    right: auto !important;
  }

  .msg.actions-visible .msg-controls.is-anchored,
  .msg:focus-within .msg-controls.is-anchored,
  .msg-controls.is-anchored:focus-within {
    transform: translate(-50%, calc(-100% - 12px)) !important;
  }
}

/* Credits revamp */
#creditsView .credits-page-revamp {
  width: min(760px, 100%);
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 110px;
  gap: 14px;
}

#creditsView .credits-page-revamp .credits-panel,
#creditsView .credits-shop-hero,
#creditsView .credits-balance-card {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  background: rgba(17, 17, 24, .96) !important;
  box-shadow: none !important;
}

#creditsView .credits-shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

#creditsView .credits-shop-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(17, 17, 24, .96);
}

#creditsView .energy-hero-heading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffd447;
  font-size: 15px;
  font-weight: 950;
}

#creditsView .energy-hero-icon {
  width: 34px;
  height: 34px;
}

#creditsView .credits-shop-copy h1 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: 0;
}

#creditsView .credits-shop-copy p {
  margin: 0;
  color: rgba(235, 235, 248, .74);
  font-size: 14px;
  line-height: 1.5;
}

#creditsView .credits-balance-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
  min-width: 0;
}

#creditsView .credits-hero-art {
  width: calc(100% + 36px);
  height: 152px;
  margin: 0 -18px 8px;
  object-fit: cover;
  object-position: center;
  opacity: .88;
  filter: saturate(.92) contrast(.96);
  mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
}

#creditsView .credits-balance-label,
#creditsView .credits-daily-label {
  color: rgba(235, 235, 248, .62);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#creditsView .credits-balance-value {
  color: #fff;
  font-size: 52px;
  line-height: .95;
  font-weight: 950;
  letter-spacing: 0;
}

#creditsView .credits-balance-sub {
  color: rgba(235, 235, 248, .66);
  font-size: 13px;
  line-height: 1.35;
}

#creditsView .credits-mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

#creditsView .credits-mini-stat {
  min-width: 0;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
}

#creditsView .credits-mini-stat span {
  font-size: 10px;
  letter-spacing: 0;
}

#creditsView .credits-mini-stat strong {
  font-size: 18px;
}

#creditsView .credits-daily-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 69, 79, .45);
  background: rgba(255, 69, 79, .06);
}

#creditsView .credits-daily-copy {
  color: rgba(245, 245, 252, .78);
  font-size: 13px;
  line-height: 1.35;
}

#creditsView .credits-daily-card .btn-save {
  min-height: 42px;
  border-color: rgba(255, 255, 255, .78);
  background: #fff;
  color: #121218;
}

#creditsView .credits-panel {
  padding: 16px !important;
}

#creditsView .credits-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

#creditsView .credits-panel .section-title {
  color: #fff;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

#creditsView .credits-panel .section-subtitle,
#creditsView .credits-inline-note {
  color: rgba(235, 235, 248, .64);
  font-size: 13px;
  line-height: 1.45;
}

#creditsView .credits-energy-guide-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

#creditsView .credits-energy-guide-list > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
}

#creditsView .credits-energy-guide-list span {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 69, 79, .14);
  color: #ff5963;
  font-size: 13px;
  font-weight: 950;
}

#creditsView .credits-energy-guide-list strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}

#creditsView .credits-energy-guide-list small {
  color: rgba(235, 235, 248, .62);
  font-size: 12px;
  line-height: 1.35;
}

#creditsView .credits-rewarded-ad-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-color: rgba(255, 69, 79, .42) !important;
  background:
    linear-gradient(135deg, rgba(255, 69, 79, .1), rgba(255, 212, 71, .06)),
    rgba(17, 17, 24, .96) !important;
}

#creditsView .credits-rewarded-ad-panel.hidden {
  display: none !important;
}

#creditsView .credits-rewarded-ad-panel .section-title {
  color: #fff;
}

#creditsView .credits-rewarded-ad-btn {
  min-height: 46px;
  border-color: rgba(255, 255, 255, .82) !important;
  background: #fff !important;
  color: #111119 !important;
  font-weight: 950;
  white-space: nowrap;
}

#creditsView .credits-rewarded-ad-status {
  grid-column: 1 / -1;
  margin-top: -4px;
}

#creditsView .chayt-plus-credit-panel {
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
  border-color: rgba(255, 69, 79, .42);
  background: rgba(17, 17, 24, .96);
  box-shadow: none;
}

#creditsView .chayt-plus-credit-panel::before {
  content: none;
}

#creditsView .chayt-plus-credit-panel .section-title {
  color: #ffd447;
  font-size: 22px;
  letter-spacing: 0;
}

#creditsView .chayt-plus-mini-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

#creditsView .chayt-plus-mini-plan {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
}

#creditsView .chayt-plus-mini-plan:nth-child(2) {
  border-color: rgba(255, 69, 79, .76);
  background: rgba(255, 69, 79, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 79, .24);
}

#creditsView .chayt-plus-plan-title {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
}

#creditsView .chayt-plus-plan-copy {
  color: rgba(235, 235, 248, .6);
  font-size: 12px;
  font-weight: 800;
}

#creditsView .chayt-plus-plan-price {
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

#creditsView .chayt-plus-list-price {
  color: rgba(235, 235, 248, .48);
  font-size: 13px;
}

#creditsView .chayt-plus-plan-period {
  color: rgba(235, 235, 248, .65);
  font-size: 12px;
}

#creditsView .credit-offers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

#creditsView .credit-pack-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 69, 79, .34);
  background: rgba(255, 255, 255, .035);
}

#creditsView .credit-pack-card.featured {
  border-color: rgba(255, 69, 79, .78);
  background: rgba(255, 69, 79, .055);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 79, .24);
}

#creditsView .credit-pack-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

#creditsView .credit-pack-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
}

#creditsView .credit-offer-badge {
  margin-left: 0;
  border-color: rgba(255, 69, 79, .44);
  background: rgba(255, 69, 79, .1);
  color: #ff9aa1;
}

#creditsView .credit-pack-copy {
  margin-top: 4px;
  color: rgba(235, 235, 248, .62);
  font-size: 12px;
  line-height: 1.35;
}

#creditsView .credit-offer-price {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 7px;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

#creditsView .credit-offer-old-price {
  width: 100%;
  color: rgba(235, 235, 248, .48);
  font-size: 12px;
  text-align: right;
}

#creditsView .credit-pack-amount {
  margin-top: 0;
}

#creditsView .credit-pack-energy-amount {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffd447;
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
}

#creditsView .credit-pack-energy-amount .energy-inline-icon {
  width: 30px;
  height: 30px;
}

#creditsView .credit-offer-card .btn-save,
#creditsView .credit-offer-card .btn-save.secondary,
#creditsView .credit-pack-card .google-play-billing-btn {
  margin-top: 0;
  min-height: 56px;
  border-radius: 15px;
}

#creditsView .credit-pack-card .paypal-button-slot {
  min-height: 74px;
  margin-top: 0;
}

#creditsView .credit-pack-card .google-play-button-slot,
#creditsView .credit-pack-card .google-pay-button-slot {
  margin-top: 0;
}

#creditsView .custom-credit-row {
  margin-top: 0;
}

#creditsView .credits-referral-panel,
#creditsView .credits-support-goal-panel {
  background: rgba(17, 17, 24, .9);
}

#creditsView .credits-referral-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

#creditsView .credits-referral-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
}

#creditsView .credits-referral-code {
  border-radius: 13px;
  font-size: 22px;
  letter-spacing: .12em;
}

#creditsView .credits-support-goal-panel {
  gap: 12px;
}

#creditsView .credits-support-goal-fill {
  background: linear-gradient(90deg, #ff454f, #ffd447);
}

#creditsView .credit-history-list {
  max-height: 320px;
}

#creditsView .credit-history-item {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
}

@media (max-width: 760px) {
  #creditsView .credits-page-revamp {
    padding: calc(72px + env(safe-area-inset-top, 0px)) 12px calc(106px + env(safe-area-inset-bottom, 0px));
  }

  #creditsView .credits-shop-hero {
    grid-template-columns: 1fr;
  }

  #creditsView .credits-shop-copy {
    padding: 18px 15px;
  }

  #creditsView .credits-shop-copy h1 {
    font-size: 29px;
  }

  #creditsView .credits-hero-art {
    height: 142px;
  }

  #creditsView .credits-balance-value {
    font-size: 46px;
  }

  #creditsView .credits-daily-card,
  #creditsView .credits-panel-head,
  #creditsView .credit-pack-panel-head,
  #creditsView .credits-rewarded-ad-panel,
  #creditsView .credits-support-goal-row {
    grid-template-columns: 1fr;
  }

  #creditsView .credits-daily-card .btn-save,
  #creditsView .credits-panel-head .mini-btn,
  #creditsView .credits-rewarded-ad-btn {
    width: fit-content;
  }

  #creditsView .chayt-plus-mini-plans {
    grid-template-columns: 1fr;
  }

  #creditsView .credit-offer-price {
    justify-content: flex-start;
  }

  #creditsView .credit-offer-old-price {
    text-align: left;
  }

  #creditsView .credits-referral-code-row,
  #creditsView .credits-redeem-row {
    grid-template-columns: 1fr;
  }
}

body:not(.sidebar-collapsed) #creditsView .credits-page-revamp .chayt-plus-credit-panel,
#creditsView .credits-page-revamp .chayt-plus-credit-panel {
  display: grid !important;
  height: max-content !important;
  min-height: max-content !important;
  max-height: none !important;
  overflow: visible !important;
  align-content: start !important;
  gap: 12px !important;
}

body:not(.sidebar-collapsed) #creditsView .credits-page-revamp .chayt-plus-mini-plans,
#creditsView .credits-page-revamp .chayt-plus-mini-plans {
  display: grid !important;
}

/* Chayt+ full page revamp */
#chaytPlusView .chayt-plus-page {
  width: min(1120px, 100%);
  max-width: 1120px;
  padding: 28px;
  gap: 16px;
}

#chaytPlusView .chayt-plus-hero {
  border-color: rgba(255, 69, 79, .34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(120, 198, 255, .16), transparent 38%),
    radial-gradient(circle at 0% 0%, rgba(255, 69, 79, .18), transparent 34%),
    rgba(17, 17, 24, .98);
}

#chaytPlusView .chayt-plus-kicker,
#chaytPlusView .chayt-plus-plan-kicker {
  width: fit-content;
  border: 1px solid rgba(255, 212, 71, .45);
  border-radius: 999px;
  background: rgba(255, 212, 71, .12);
  color: #ffe7a3;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#chaytPlusView .chayt-plus-hero h1 {
  color: #fff;
  font-size: 46px;
  line-height: 1.03;
}

#chaytPlusView .chayt-plus-proof {
  border-color: rgba(255, 212, 71, .22);
  background:
    linear-gradient(135deg, rgba(255, 212, 71, .12), rgba(120, 198, 255, .08)),
    rgba(255, 255, 255, .04);
}

#chaytPlusView .chayt-plus-proof .review-vote {
  display: none;
}

#chaytPlusView .chayt-plus-compare-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: rgba(17, 17, 24, .96);
}

#chaytPlusView .chayt-plus-energy-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#chaytPlusView .chayt-plus-energy-note > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 212, 71, .22);
  background: rgba(255, 212, 71, .06);
}

#chaytPlusView .chayt-plus-energy-note span {
  color: #ffd447;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

#chaytPlusView .chayt-plus-energy-note strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
}

#chaytPlusView .chayt-plus-energy-note small {
  grid-column: 1 / -1;
  color: rgba(235, 235, 248, .68);
  font-size: 13px;
  line-height: 1.4;
}

#chaytPlusView .chayt-plus-compare-table {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
}

#chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-row {
  grid-template-columns: minmax(0, 1fr) 68px 84px;
  min-height: 52px;
  font-size: 14px;
}

#chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-row.header {
  min-height: 40px;
  font-size: 12px;
}

#chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-name {
  font-weight: 850;
}

#chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-compare-icon {
  width: 30px;
  height: 30px;
}

#chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-compare-icon svg {
  width: 19px;
  height: 19px;
}

#chaytPlusView .chayt-plus-plans {
  gap: 14px;
  margin-top: 0;
}

#chaytPlusView .chayt-plus-plan-card {
  align-content: start;
  border-color: rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(17, 17, 24, .96);
}

#chaytPlusView .chayt-plus-plan-card.featured {
  border-color: rgba(255, 69, 79, .78);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 69, 79, .18), transparent 42%),
    rgba(17, 17, 24, .98);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 79, .22);
}

#chaytPlusView .chayt-plus-plan-card .google-play-billing-btn {
  min-height: 72px;
}

#chaytPlusView .chayt-plus-plan-price.large {
  font-size: 36px;
}

@media (min-width: 1000px) {
  #creditsView .credits-page-revamp {
    width: min(1120px, 100%);
    max-width: 1120px;
    padding: 32px 28px 126px;
    gap: 18px;
  }

  #creditsView .credits-shop-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 16px;
  }

  #creditsView .credits-shop-copy {
    min-height: 360px;
    padding: 28px;
  }

  #creditsView .credits-shop-copy h1 {
    font-size: 42px;
  }

  #creditsView .credits-hero-art {
    height: 210px;
  }

  #creditsView .credits-energy-guide-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #creditsView .credit-offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #creditsView .credit-pack-card.featured {
    grid-column: span 2;
  }

  #creditsView .credits-referral-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #creditsView .credits-support-goal-row {
    grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  }

  #creditsView .credits-page-revamp .chayt-plus-credit-panel {
    min-height: max-content !important;
  }
}

body:not(.sidebar-collapsed) #creditsView .credits-page-revamp .chayt-plus-credit-panel,
#creditsView .credits-page-revamp .chayt-plus-credit-panel {
  height: max-content !important;
  min-height: max-content !important;
  overflow: visible !important;
}

#creditsView .credits-support-subscribe-btn {
  border-color: rgba(255, 69, 79, .68);
  background: rgba(255, 69, 79, .12);
  color: #fff;
}

#creditsView .credits-support-subscribe-btn:hover,
#creditsView .credits-support-subscribe-btn:focus-visible {
  border-color: rgba(255, 69, 79, .9);
  background: rgba(255, 69, 79, .22);
  outline: none;
}

@media (max-width: 760px) {
  #chaytPlusView .chayt-plus-page {
    padding: calc(72px + env(safe-area-inset-top, 0px)) 12px calc(106px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  #chaytPlusView .chayt-plus-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 15px;
  }

  #chaytPlusView .chayt-plus-hero h1 {
    font-size: 33px;
  }

  #chaytPlusView .chayt-plus-compare-panel {
    padding: 12px;
  }

  #chaytPlusView .chayt-plus-energy-note {
    grid-template-columns: 1fr;
  }

  #chaytPlusView .chayt-plus-energy-note small {
    grid-column: auto;
  }

  #chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-row {
    grid-template-columns: minmax(0, 1fr) 48px 64px;
    min-height: 48px;
    font-size: 12px;
  }

  #chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-row > span {
    padding-left: 8px;
    padding-right: 8px;
  }

  #chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-compare-icon {
    width: 26px;
    height: 26px;
  }

  #chaytPlusView .chayt-plus-plans {
    grid-template-columns: 1fr;
  }

  #chaytPlusView .chayt-plus-plan-price.large {
    font-size: 32px;
  }
}

/* Models revamp */
#aimodelratingView .create-body.ai-model-rating-page {
  width: min(1180px, 100%);
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 128px;
}

#aimodelratingView .ai-model-rating-shell {
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  background:
    linear-gradient(135deg, rgba(255, 212, 71, .1), rgba(255, 69, 79, .055) 48%, rgba(120, 198, 255, .055)),
    rgba(17, 17, 24, .96);
  box-shadow: none;
}

#aimodelratingView .ai-model-rating-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end;
  gap: 18px;
  padding: 22px;
}

#aimodelratingView .ai-model-rating-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: #ffd447;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#aimodelratingView .ai-model-rating-kicker svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

#aimodelratingView .ai-model-rating-toolbar-copy h2,
#aimodelratingView .ai-model-rating-detail-meta h2 {
  margin: 9px 0 8px;
  color: #fff;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
}

#aimodelratingView .ai-model-rating-toolbar-copy .setting-help {
  max-width: 620px;
  color: rgba(235, 235, 248, .72);
  font-size: 14px;
  line-height: 1.45;
}

#aimodelratingView .ai-model-rating-actions {
  width: 100%;
}

#aimodelratingView .ai-model-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 16px;
  background: rgba(7, 7, 11, .52);
}

#aimodelratingView .ai-model-search-wrap:focus-within {
  border-color: rgba(255, 212, 71, .5);
}

#aimodelratingView .ai-model-search-wrap svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: rgba(235, 235, 248, .7);
  stroke-width: 2;
  stroke-linecap: round;
}

#aimodelratingView .ai-model-rating-actions input {
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 15px;
}

#aimodelratingView .ai-model-rating-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#aimodelratingView .ai-model-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .02)),
    rgba(14, 14, 20, .96);
  box-shadow: none;
  transition: none;
}

#aimodelratingView .ai-model-card.featured {
  border-color: rgba(255, 69, 79, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 69, 79, .2);
}

#aimodelratingView .ai-model-card:hover {
  transform: none;
  border-color: rgba(255, 212, 71, .38);
}

#aimodelratingView .ai-model-card-link {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(96px, auto);
  gap: 13px;
  min-height: 178px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

#aimodelratingView .ai-model-card-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 212, 71, .32);
  border-radius: 14px;
  background: rgba(255, 212, 71, .1);
}

#aimodelratingView .ai-model-card-mark .ai-model-star-svg {
  width: 24px;
  height: 24px;
}

#aimodelratingView .ai-model-card-main {
  display: grid;
  align-content: start;
  min-width: 0;
}

#aimodelratingView .ai-model-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

#aimodelratingView .ai-model-card-title {
  color: #fff;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

#aimodelratingView .ai-model-card-id {
  margin-top: 5px;
  color: rgba(235, 235, 248, .48);
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

#aimodelratingView .ai-model-card-default {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 69, 79, .42);
  border-radius: 999px;
  color: #ffb6bb;
  background: rgba(255, 69, 79, .12);
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
}

#aimodelratingView .ai-model-card-badges,
#aimodelratingView #aiModelRatingDetailBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

#aimodelratingView .model-help-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .03em;
}

#aimodelratingView .ai-model-card-desc,
#aimodelratingView .memory-model-help {
  margin-top: 12px;
  color: rgba(235, 235, 248, .72);
  font-size: 13px;
  line-height: 1.45;
}

#aimodelratingView .ai-model-card-score {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  min-width: 92px;
  color: rgba(235, 235, 248, .58);
  text-align: right;
  font-size: 12px;
}

#aimodelratingView .ai-model-card-score strong,
#aimodelratingView .ai-model-rating-hero-score strong {
  color: #ffd447;
  font-weight: 950;
  letter-spacing: 0;
}

#aimodelratingView .ai-model-card-score strong {
  font-size: 32px;
  line-height: .95;
}

#aimodelratingView .ai-model-star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
}

#aimodelratingView .ai-model-star-rating.compact {
  gap: 1px;
}

#aimodelratingView .ai-model-star-svg {
  width: 17px;
  height: 17px;
  fill: rgba(255, 255, 255, .12);
  stroke: rgba(255, 255, 255, .2);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

#aimodelratingView .ai-model-star-svg.filled {
  fill: #ffd447;
  stroke: #ffe6a0;
}

#aimodelratingView .ai-model-rating-detail-head {
  display: grid;
  gap: 16px;
  padding: 18px;
}

#aimodelratingView .ai-model-rating-detail-head-top .mini-btn {
  min-height: 38px;
  border-radius: 12px;
}

#aimodelratingView .ai-model-rating-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

#aimodelratingView .ai-model-rating-detail-meta h2 {
  margin-bottom: 0;
}

#aimodelratingView .ai-model-rating-hero-score {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 132px;
  text-align: right;
}

#aimodelratingView .ai-model-rating-hero-score span {
  color: rgba(235, 235, 248, .62);
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#aimodelratingView .ai-model-rating-hero-score strong {
  font-size: 52px;
  line-height: .92;
}

#aimodelratingView .ai-model-rating-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(310px, .78fr);
  gap: 12px;
}

#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card {
  padding: 16px;
}

#aimodelratingView .panel-title {
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

#aimodelratingView .ai-model-rating-score-line {
  margin-top: 10px;
}

#aimodelratingView .ai-model-rating-stars-display,
#aimodelratingView .ai-model-star-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

#aimodelratingView .ai-model-star {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  color: inherit;
  cursor: pointer;
}

#aimodelratingView .ai-model-star:disabled {
  cursor: default;
  opacity: 1;
}

#aimodelratingView .ai-model-star.active {
  border-color: rgba(255, 212, 71, .34);
  background: rgba(255, 212, 71, .1);
}

#aimodelratingView .ai-model-rating-stars-display .ai-model-star {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
}

#aimodelratingView .ai-model-rating-form-card textarea {
  min-height: 118px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(7, 7, 11, .62);
  font-size: 14px;
}

#aimodelratingView .ai-model-rating-form-card .btn-save {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
}

#aimodelratingView #aiModelRatingComments {
  gap: 10px;
  max-height: 520px;
}

#aimodelratingView .ai-model-comment {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .035);
  box-shadow: none;
}

#aimodelratingView .ai-model-comment-avatar {
  border-radius: 12px;
}

#aimodelratingView .ai-model-comment-stars {
  flex: 0 0 auto;
}

@media (max-width: 960px) {
  #aimodelratingView .create-body.ai-model-rating-page {
    width: 100%;
    max-width: none;
    padding: 12px 12px calc(108px + env(safe-area-inset-bottom, 0px));
  }

  body.native-app-shell.native-ad-banner-visible #aimodelratingView > .create-topbar,
  body.capacitor-app.native-ad-banner-visible #aimodelratingView > .create-topbar {
    margin-top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  body.native-app-shell.native-ad-banner-visible #aimodelratingView .create-body.ai-model-rating-page,
  body.capacitor-app.native-ad-banner-visible #aimodelratingView .create-body.ai-model-rating-page {
    padding-top: 12px !important;
  }

  #aimodelratingView .ai-model-rating-toolbar,
  #aimodelratingView .ai-model-rating-detail-hero,
  #aimodelratingView .ai-model-rating-detail-grid {
    grid-template-columns: 1fr;
  }

  #aimodelratingView .ai-model-rating-toolbar {
    gap: 14px;
    padding: 16px;
  }

  #aimodelratingView .ai-model-rating-toolbar-copy h2,
  #aimodelratingView .ai-model-rating-detail-meta h2 {
    font-size: 29px;
  }

  #aimodelratingView .ai-model-rating-grid {
    grid-template-columns: 1fr;
  }

  #aimodelratingView .ai-model-card-link {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 0;
    padding: 14px;
  }

  #aimodelratingView .ai-model-card-score {
    grid-column: 1 / -1;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  #aimodelratingView .ai-model-card-score strong {
    font-size: 26px;
  }

  #aimodelratingView .ai-model-rating-hero-score {
    justify-items: start;
    text-align: left;
  }

  #aimodelratingView .ai-model-rating-hero-score strong {
    font-size: 44px;
  }
}

/* Models detail profile cleanup */
#aimodelratingView.ai-model-detail-open .ai-model-rating-toolbar {
  display: none !important;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingDetailPage {
  display: grid;
  gap: 14px;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingDetailPage.hidden {
  display: none !important;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-color: rgba(255, 212, 71, .22);
  background:
    linear-gradient(135deg, rgba(255, 212, 71, .12), rgba(255, 69, 79, .07) 46%, rgba(120, 198, 255, .08)),
    rgba(17, 17, 24, .98);
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 212, 71, .11), transparent 28%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, .12));
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head > * {
  position: relative;
  z-index: 1;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head-top {
  display: flex;
  justify-content: flex-start;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingDetailBackBtn {
  min-height: 38px;
  padding: 0 13px;
  border-color: rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(7, 7, 11, .34);
  color: rgba(235, 235, 248, .78);
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 24px;
  align-items: end;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-meta h2 {
  max-width: 760px;
  margin-top: 10px;
  color: #fff;
  font-size: 44px;
  line-height: 1.02;
  font-weight: 950;
}

#aimodelratingView .ai-model-rating-detail-copy {
  max-width: 720px;
  margin: 13px 0 0;
  color: rgba(235, 235, 248, .76);
  font-size: 15px;
  line-height: 1.48;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 212, 71, .22);
  border-radius: 16px;
  background: rgba(255, 212, 71, .075);
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score strong {
  font-size: 58px;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, .72fr);
  gap: 14px;
  align-items: start;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-summary-card,
#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card,
#aimodelratingView.ai-model-detail-open .ai-model-comments-card {
  padding: 18px;
  border-color: rgba(255, 255, 255, .105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)),
    rgba(17, 17, 24, .98);
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-summary-card {
  min-height: 0;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-summary-card .panel-title,
#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card .panel-title,
#aimodelratingView.ai-model-detail-open .ai-model-comments-card .panel-title {
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-score-line {
  margin-top: 14px;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingDetailDescription {
  display: none;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingDetailCount {
  margin-top: 10px;
  color: rgba(235, 235, 248, .62);
}

#aimodelratingView.ai-model-detail-open .ai-model-star-picker {
  margin-top: 14px;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card textarea {
  min-height: 138px;
  margin-top: 14px;
  margin-bottom: 12px;
  background: rgba(7, 7, 11, .78);
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card .btn-save {
  border-color: rgba(255, 69, 79, .7);
  background:
    linear-gradient(135deg, rgba(255, 69, 79, .26), rgba(138, 105, 255, .24)),
    rgba(255, 255, 255, .06);
  color: #fff;
}

#aimodelratingView.ai-model-detail-open .ai-model-comments-card {
  margin-top: 0;
}

#aimodelratingView.ai-model-detail-open .ai-model-comments-head {
  margin-bottom: 12px;
}

#aimodelratingView.ai-model-detail-open .ai-model-comments-head .setting-help {
  color: rgba(235, 235, 248, .58);
  font-size: 13px;
}

#aimodelratingView.ai-model-detail-open #aiModelRatingComments {
  max-height: 420px;
}

#aimodelratingView.ai-model-detail-open .model-picker-empty {
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(7, 7, 11, .34);
  color: rgba(235, 235, 248, .72);
}

@media (min-width: 1200px) {
  #aimodelratingView.ai-model-detail-open .create-body.ai-model-rating-page {
    width: min(1060px, calc(100% - 56px)) !important;
    max-width: 1060px !important;
  }
}

@media (max-width: 960px) {
  #aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head {
    padding: 16px;
  }

  #aimodelratingView.ai-model-detail-open .ai-model-rating-detail-hero,
  #aimodelratingView.ai-model-detail-open .ai-model-rating-detail-grid {
    grid-template-columns: 1fr;
  }

  #aimodelratingView.ai-model-detail-open .ai-model-rating-detail-meta h2 {
    font-size: 31px;
  }

  #aimodelratingView .ai-model-rating-detail-copy {
    font-size: 14px;
  }

  #aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score {
    justify-items: start;
    text-align: left;
  }

  #aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score strong {
    font-size: 44px;
  }
}

/* Larger app nav icons */
#sidebar .nav-item {
  gap: 13px;
  min-height: 48px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 8px;
  line-height: 1;
}

#sidebar .nav-item svg {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  opacity: .96;
  transform-origin: center;
}

#sidebar #navModels svg {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
  margin-left: -1.5px;
  margin-right: -1.5px;
}

#sidebar .nav-energy-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  margin-left: -1.5px;
  margin-right: -1.5px;
}

body.sidebar-collapsed #sidebar .nav-item svg {
  width: 27px !important;
  height: 27px !important;
  flex-basis: 27px !important;
}

body.sidebar-collapsed #sidebar #navModels svg {
  width: 31px !important;
  height: 31px !important;
  flex-basis: 31px !important;
}

body.sidebar-collapsed #sidebar .nav-energy-icon {
  width: 31px !important;
  height: 31px !important;
  flex-basis: 31px !important;
}

@media (max-width: 960px) {
  .mobile-bottom-nav-item {
    gap: 5px;
    min-height: 58px;
    font-size: 10px;
  }

  .mobile-bottom-nav-item svg {
    display: block;
    width: 27px;
    height: 27px;
    transform-origin: center;
  }

  #mobileNavModels svg {
    width: 31px;
    height: 31px;
  }

  .mobile-bottom-nav-item .mobile-energy-icon {
    width: 31px;
    height: 31px;
  }

  .mobile-bottom-nav-item.active::after {
    width: 26px;
  }
}

/* Keep Energy and Chayt+ content tight under their mobile header. */
@media (max-width: 760px) {
  #creditsView .credits-page-revamp,
  #chaytPlusView .chayt-plus-page {
    padding-top: 12px !important;
  }
}

/* Personas visual polish: let the art carry the hero instead of gradients. */
#userPersonaView .user-persona-hero {
  min-height: 320px !important;
  grid-template-columns: auto minmax(0, .95fr) minmax(430px, 540px) !important;
  padding: 28px 0 28px 28px !important;
  background:
    linear-gradient(90deg, #15161d 0%, #15161d 48%, rgba(21, 22, 29, .86) 68%, rgba(21, 22, 29, .62) 100%) !important;
  border-color: rgba(255, 255, 255, .12) !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .26) !important;
}

#userPersonaView .user-persona-hero-logo {
  background: #1d1e27 !important;
  border-color: rgba(255, 255, 255, .12) !important;
}

#userPersonaView .user-persona-hero-art {
  margin: -28px 0 -28px;
  min-height: 320px;
  height: calc(100% + 56px);
  align-self: stretch;
  border: 0;
  border-radius: 0 22px 22px 0;
  opacity: 1;
  filter: none;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.36) 10%, #000 24%, #000 100%) !important;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.36) 10%, #000 24%, #000 100%) !important;
}

#personaEditAvatarPreview.avatar-edit-target::after,
#userBigAvatar.avatar-edit-target::after {
  display: none !important;
}

@media (max-width: 760px) {
  #userPersonaView .user-persona-hero {
    min-height: 0 !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    padding: 14px !important;
    background: #15161d !important;
    box-shadow: none !important;
  }

  #userPersonaView .user-persona-hero-art {
    width: calc(100% + 28px);
    height: 156px;
    min-height: 156px;
    margin: 4px -14px -14px;
    border-radius: 14px;
    mask-image: linear-gradient(180deg, #000 58%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%) !important;
  }
}

/* Standalone Personas page: keep it centered and full-width on desktop. */
@media (min-width: 961px) {
  body[data-current-view="userPersona"] #userPersonaView.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    min-height: 100dvh !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .history-topbar {
    width: 100% !important;
    max-width: none !important;
    padding-inline: max(34px, calc((100% - 1180px) / 2 + 24px)) !important;
    box-sizing: border-box !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .history-body.user-persona-body {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    justify-items: center !important;
    align-content: start !important;
    padding: 30px max(34px, calc((100% - 1180px) / 2 + 24px)) 120px !important;
    box-sizing: border-box !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .user-persona-page-panel {
    width: min(1180px, 100%) !important;
    max-width: 1180px !important;
    margin-inline: auto !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .user-persona-edit-pane {
    width: min(1180px, 100%) !important;
    max-width: 1180px !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .user-persona-edit-grid {
    width: 100% !important;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr) !important;
    column-gap: 28px !important;
  }

  body[data-current-view="userPersona"] #userPersonaView .user-persona-edit-grid input:not([type="checkbox"]),
  body[data-current-view="userPersona"] #userPersonaView .user-persona-edit-grid textarea,
  body[data-current-view="userPersona"] #userPersonaView .user-persona-edit-grid select {
    width: 100% !important;
  }

  body[data-current-view="userPersona"] #personaEditAvatarPreview.big-avatar {
    width: 138px !important;
    height: 138px !important;
    border-radius: 50% !important;
  }
}

/* Clean model ratings and native pull-refresh polish. */
#aimodelratingView .ai-model-rating-shell {
  background: transparent !important;
  box-shadow: none !important;
}

#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card,
#aimodelratingView .ai-model-card,
#aimodelratingView .ai-model-comment {
  background: #15151d !important;
  box-shadow: none !important;
}

#aimodelratingView .ai-model-rating-toolbar,
#aimodelratingView .ai-model-rating-detail-head,
#aimodelratingView .ai-model-rating-summary-card,
#aimodelratingView .ai-model-rating-form-card,
#aimodelratingView .ai-model-comments-card {
  border-color: rgba(255, 255, 255, 0.11) !important;
}

#aimodelratingView .ai-model-card {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

#aimodelratingView .ai-model-card.featured,
#aimodelratingView .ai-model-card:hover {
  border-color: rgba(255, 212, 71, 0.3) !important;
  box-shadow: none !important;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head {
  border-color: rgba(255, 212, 71, 0.26) !important;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head::before {
  content: none !important;
  display: none !important;
}

#aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score {
  background: #1d1a12 !important;
  border-color: rgba(255, 212, 71, 0.28) !important;
}

#aimodelratingView .ai-model-rating-form-card .btn-save,
#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card .btn-save {
  border-color: rgba(139, 124, 246, 0.55) !important;
  background: #806cff !important;
  box-shadow: none !important;
  color: #fff !important;
}

#aimodelratingView .ai-model-search-wrap,
#aimodelratingView .ai-model-rating-form-card textarea,
#aimodelratingView.ai-model-detail-open .ai-model-rating-form-card textarea,
#aimodelratingView.ai-model-detail-open .model-picker-empty {
  background: #0f0f15 !important;
  box-shadow: none !important;
}

@media (max-width: 960px) {
  body.native-app-shell.native-ad-banner-visible .mobile-pull-refresh,
  body.capacitor-app.native-ad-banner-visible .mobile-pull-refresh {
    top: calc(var(--native-ad-banner-height, 0px) + 16px + env(safe-area-inset-top, 0px)) !important;
    z-index: 7600 !important;
  }
}

/* Discovery What's New notice stays compact above Today With Chayt. */
#homeView .ollama-discovery-notice {
  grid-template-columns: 36px minmax(0, 1fr) auto 36px !important;
  align-items: center !important;
  height: auto !important;
  min-height: 72px !important;
  margin-bottom: 14px !important;
  overflow: hidden !important;
}

#homeView .ollama-notice-copy {
  min-width: 0 !important;
}

#homeView .ollama-notice-copy p {
  display: block !important;
  max-width: 100% !important;
  max-height: 3.1em !important;
  overflow: hidden !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

#homeView .ollama-notice-close {
  align-self: center !important;
  justify-self: end !important;
}

#homeView .today-with-chayt {
  margin-top: 0 !important;
}

#homeView .ollama-discovery-notice:not(.hidden) + #todayWithChayt {
  margin-top: 14px !important;
}

@media (max-width: 960px) {
  #homeView .ollama-discovery-notice {
    grid-template-columns: 30px minmax(0, 1fr) auto 30px !important;
    align-items: center !important;
    min-height: 76px !important;
    margin-bottom: 10px !important;
  }

  #homeView .ollama-notice-copy p {
    max-height: 3.1em !important;
  }
}

/* ChaytAI appearance themes */
.theme-preference-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.theme-preference-heading .form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 800;
}

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

.theme-choice-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 106px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.theme-choice-card:hover {
  transform: translateY(-1px);
  border-color: var(--border2);
}

.theme-choice-card.is-selected,
.theme-choice-card:has(input:checked) {
  border-color: rgba(225, 29, 138, .62);
  box-shadow: 0 0 0 3px rgba(225, 29, 138, .11);
}

.theme-choice-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-choice-preview {
  position: relative;
  width: 104px;
  height: 74px;
  display: grid;
  grid-template-columns: 25px 1fr;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(127, 74, 107, .18);
  box-shadow: 0 8px 22px rgba(37, 14, 30, .12);
}

.theme-choice-preview-original { background: #0d0d10; }
.theme-choice-preview-original .theme-preview-sidebar { background: #17171d; }
.theme-choice-preview-white { background: #fff9fc; }
.theme-choice-preview-white .theme-preview-sidebar { background: linear-gradient(180deg, #fff, #fff0f7); }
.theme-preview-content { position: relative; display: block; padding: 10px 8px; }
.theme-preview-content::before {
  content: '';
  display: block;
  width: 70%;
  height: 6px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff3b8d, #d91ca7 55%, #8b5cf6);
}
.theme-preview-content i,
.theme-preview-content b {
  display: block;
  width: 78%;
  height: 12px;
  margin: 5px 0;
  border-radius: 5px;
  background: #292831;
}
.theme-preview-content i:nth-child(2) { width: 58%; }
.theme-preview-content b { width: 44%; margin-left: auto; background: linear-gradient(135deg, #ff3b8d, #d91ca7 58%, #8b5cf6); }
.theme-choice-preview-white .theme-preview-content i { background: #fff; border: 1px solid #f1cfdf; }

.theme-choice-copy { display: grid; gap: 5px; min-width: 0; }
.theme-choice-copy strong { color: var(--text); font-size: 13px; line-height: 1.35; }
.theme-choice-copy small { color: var(--sub); font-size: 11px; line-height: 1.45; }
.theme-choice-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border2);
  color: transparent;
  font-size: 13px;
  font-weight: 900;
}
.theme-choice-card.is-selected .theme-choice-check,
.theme-choice-card:has(input:checked) .theme-choice-check {
  border-color: transparent;
  background: linear-gradient(135deg, #ff3b8d, #d91ca7 55%, #8b5cf6);
  color: #fff;
}

.theme-bubble-bypass-row {
  gap: 20px;
  padding: 13px 2px 0;
}
.theme-bubble-bypass-row > span:first-child { display: grid; gap: 4px; }
.theme-bubble-bypass-row .setting-help { display: block; }
.theme-bubble-bypass-row.is-disabled { opacity: .48; }

@media (max-width: 760px) {
  .theme-choice-grid { grid-template-columns: 1fr; }
  .theme-choice-card { grid-template-columns: 88px minmax(0, 1fr) 22px; min-height: 92px; padding: 10px; }
  .theme-choice-preview { width: 88px; height: 64px; }
}

html[data-theme="white"] {
  color-scheme: light;
  --bg: #fffafd;
  --surface: #ffffff;
  --card: #fff3f8;
  --card-h: #ffe8f2;
  --border: #eedde7;
  --border2: #dcb9cd;
  --text: #2d1b2a;
  --muted: #826b7c;
  --sub: #765f70;
  --accent: #df1d88;
  --accent-d: #bd146f;
  --danger: #d83b54;
  --rp-action-color: #664f60;
  --rp-speech-color: #2d1b2a;
  --rp-whisper-color: #7a6374;
  --rp-emphasis-color: #a41369;
  --rp-ooc-color: #786a74;
  --rp-quote-color: #6d48b7;
  --rp-scene-color: #c01979;
  --rp-transition-color: #a15b12;
  --rp-divider-color: #9f758e;
}

html[data-theme="white"],
html[data-theme="white"] body,
html[data-theme="white"] #main,
html[data-theme="white"] .view {
  background: var(--bg) !important;
  color: var(--text);
}

html[data-theme="white"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 86% -10%, rgba(255, 62, 145, .11), transparent 31%),
    radial-gradient(circle at 18% 110%, rgba(139, 92, 246, .08), transparent 34%);
  z-index: 0;
}

html[data-theme="white"] #sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fff6fa 100%) !important;
  border-right-color: #eedde7 !important;
  box-shadow: 12px 0 34px rgba(125, 44, 91, .055);
}

html[data-theme="white"] .brand-text {
  background: linear-gradient(100deg, #f12b8a 0%, #c31aa0 54%, #7258df 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="white"] #sidebar .create-btn,
html[data-theme="white"] .btn-save:not(.secondary),
html[data-theme="white"] #sendBtn:not(.is-stop):not(:disabled),
html[data-theme="white"] .toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, #ff3b8d 0%, #d91ca7 55%, #8b5cf6 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] #sidebar .nav-item:hover,
html[data-theme="white"] #sidebar .nav-item.active,
html[data-theme="white"] .recent-item:hover,
html[data-theme="white"] .recent-item.active {
  background: linear-gradient(100deg, rgba(255, 59, 141, .11), rgba(139, 92, 246, .07)) !important;
  color: #bd146f !important;
}

html[data-theme="white"] .sidebar-collapse-btn,
html[data-theme="white"] .sidebar-social-link,
html[data-theme="white"] .recent-sidebar-status,
html[data-theme="white"] .chat-action-btn,
html[data-theme="white"] .icon-btn,
html[data-theme="white"] .mini-btn,
html[data-theme="white"] .memory-icon-btn,
html[data-theme="white"] .icon-tool-btn {
  background: rgba(255, 255, 255, .88) !important;
  border-color: #ead8e3 !important;
  color: #765f70 !important;
  box-shadow: none !important;
}

html[data-theme="white"] .chat-topbar,
html[data-theme="white"] .create-topbar,
html[data-theme="white"] .history-topbar,
html[data-theme="white"] .input-bar,
html[data-theme="white"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, .92) !important;
  border-color: #eedde7 !important;
  color: var(--text) !important;
  box-shadow: 0 6px 22px rgba(116, 44, 84, .055);
}

html[data-theme="white"] .chat-topbar,
html[data-theme="white"] .create-topbar,
html[data-theme="white"] .history-topbar {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html[data-theme="white"] .panel,
html[data-theme="white"] #settingsView .panel,
html[data-theme="white"] .settings-overview-card,
html[data-theme="white"] .bot-card,
html[data-theme="white"] .recent-chat-card,
html[data-theme="white"] .your-character-card,
html[data-theme="white"] .detail-panel,
html[data-theme="white"] .modal-card,
html[data-theme="white"] .message-modal-card,
html[data-theme="white"] .archive-modal-card,
html[data-theme="white"] .composer-tools-card,
html[data-theme="white"] .user-persona-page-panel,
html[data-theme="white"] .ai-model-card,
html[data-theme="white"] .chayt-plus-plan-card {
  background: rgba(255, 255, 255, .93) !important;
  border-color: #eedde7 !important;
  color: var(--text) !important;
  box-shadow: 0 12px 34px rgba(103, 35, 74, .07) !important;
}

html[data-theme="white"] #settingsView .panel:hover,
html[data-theme="white"] .bot-card:hover,
html[data-theme="white"] .recent-chat-card:hover,
html[data-theme="white"] .your-character-card:hover {
  border-color: #e4bfd3 !important;
  box-shadow: 0 16px 38px rgba(134, 39, 93, .10) !important;
}

html[data-theme="white"] .form-group input:not([type="color"]),
html[data-theme="white"] .form-group textarea,
html[data-theme="white"] .form-group select,
html[data-theme="white"] .custom-picker-trigger,
html[data-theme="white"] .custom-picker-menu,
html[data-theme="white"] .custom-picker-option,
html[data-theme="white"] #conversationSummaryInput,
html[data-theme="white"] .composer-suggestion-card textarea,
html[data-theme="white"] .ai-model-search-wrap,
html[data-theme="white"] .search-input,
html[data-theme="white"] input[type="search"] {
  background: #fff9fc !important;
  border-color: #ead8e3 !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme="white"] select,
html[data-theme="white"] select option,
html[data-theme="white"] .form-group select option {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="white"] .form-group input:focus,
html[data-theme="white"] .form-group textarea:focus,
html[data-theme="white"] .custom-picker-trigger:focus-visible,
html[data-theme="white"] .composer-shell:focus-within {
  border-color: rgba(220, 35, 135, .48) !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 138, .09) !important;
}

html[data-theme="white"] .composer-shell {
  background: #fff7fb !important;
  border-color: #ead8e3 !important;
}

html[data-theme="white"] #msgInput {
  color: var(--text) !important;
  caret-color: #d91c83 !important;
}

html[data-theme="white"] #msgInput::selection {
  background: rgba(225, 29, 138, .22);
  color: #49152f;
}

html[data-theme="white"] #sendBtn:disabled,
html[data-theme="white"] #sendBtn.is-empty,
html[data-theme="white"] #sendBtn.is-empty:disabled,
html[data-theme="white"] #sendBtn.is-pending,
html[data-theme="white"] #sendBtn.is-pending:disabled {
  background: #f2dce7 !important;
  border-color: #ead1de !important;
  color: #a98598 !important;
}

html[data-theme="white"] .msg.user .bubble {
  box-shadow: 0 9px 22px rgba(204, 30, 126, .17) !important;
}

html[data-theme="white"] .msg.assistant .bubble {
  box-shadow: 0 7px 22px rgba(102, 39, 75, .075) !important;
}

html[data-theme="white"] .chat-character-intro-name,
html[data-theme="white"] .chat-character-intro-message,
html[data-theme="white"] .chat-fiction-disclaimer,
html[data-theme="white"] .chat-name,
html[data-theme="white"] .create-title,
html[data-theme="white"] .panel-title,
html[data-theme="white"] .bot-card-name,
html[data-theme="white"] .detail-name {
  color: var(--text) !important;
}

html[data-theme="white"] .chat-owner-attribution,
html[data-theme="white"] .tag,
html[data-theme="white"] .chip,
html[data-theme="white"] .filter-pill,
html[data-theme="white"] .profile-interest-chip {
  background: #fff0f7 !important;
  border-color: #efccde !important;
  color: #a81768 !important;
}

html[data-theme="white"] .profile-interest-chip.selected,
html[data-theme="white"] .filter-pill.active,
html[data-theme="white"] .chip.selected {
  background: linear-gradient(135deg, rgba(255, 59, 141, .16), rgba(139, 92, 246, .12)) !important;
  border-color: rgba(210, 29, 129, .35) !important;
  color: #a41369 !important;
}

html[data-theme="white"] .form-row,
html[data-theme="white"] .sidebar-legal,
html[data-theme="white"] .sidebar-socials,
html[data-theme="white"] .section-divider {
  border-color: #eedde7 !important;
}

html[data-theme="white"] .toggle-track { background: #dcc9d4; }
html[data-theme="white"] .theme-preference-panel { background: linear-gradient(135deg, #fff8fb, #fff2f8); }
html[data-theme="white"] .theme-choice-card { background: rgba(255, 255, 255, .94); }

html[data-theme="white"] .message-modal-backdrop,
html[data-theme="white"] .archive-modal-backdrop,
html[data-theme="white"] .modal-backdrop,
html[data-theme="white"] .composer-tools-backdrop {
  background: rgba(73, 30, 55, .26) !important;
}

html[data-theme="white"] .toast,
html[data-theme="white"] .notification-toast {
  background: #ffffff !important;
  border-color: #ead8e3 !important;
  color: var(--text) !important;
  box-shadow: 0 14px 38px rgba(92, 29, 66, .16) !important;
}

html[data-theme="white"] .loading-card,
html[data-theme="white"] .app-loading-card {
  background: #ffffff !important;
  border-color: #ead8e3 !important;
  color: var(--text) !important;
}

html[data-theme="white"] .loading-overlay,
html[data-theme="white"] .app-loading-backdrop {
  background: rgba(255, 248, 252, .82) !important;
}

html[data-theme="white"] ::-webkit-scrollbar-thumb {
  background-color: #d8baca !important;
}

@media (max-width: 960px) {
  html[data-theme="white"] .mobile-bottom-nav {
    box-shadow: 0 -8px 26px rgba(112, 39, 81, .08) !important;
  }
  html[data-theme="white"] .mobile-bottom-nav .nav-item.active,
  html[data-theme="white"] .mobile-bottom-nav button.active {
    color: #d91c83 !important;
  }
}

/* White Theme completion pass: pink navigation, light overlays, and high-contrast cards. */
html[data-theme="white"] {
  --chayt-pink-gradient: linear-gradient(115deg, #ff3b8d 0%, #df1d92 46%, #9b4de3 100%);
  --chayt-pink-gradient-soft: linear-gradient(135deg, #fff7fb 0%, #ffe9f4 52%, #f3ebff 100%);
  --chayt-pink-panel: #fff2f8;
  --chayt-pink-line: #edc9dc;
  --chayt-ink: #321a2c;
}

/* Discovery and bot cards */
html[data-theme="white"] body #homeView .mobile-home-topbar {
  background: var(--chayt-pink-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body #homeView .mobile-home-copy h1,
html[data-theme="white"] body #homeView .mobile-home-copy p,
html[data-theme="white"] body #homeView .mobile-home-topbar .discovery-social-link {
  color: #fff !important;
}

html[data-theme="white"] body #homeView .discovery-search-open-btn {
  background: rgba(255,255,255,.95) !important;
  border-color: rgba(255,255,255,.72) !important;
  color: #a81768 !important;
  box-shadow: 0 7px 20px rgba(91, 17, 62, .18) !important;
}

html[data-theme="white"] body #homeView .discovery-tabs {
  background: #fff6fa !important;
  border-color: #efd4e2 !important;
  color: #896e80 !important;
}

html[data-theme="white"] body #homeView .discovery-tab,
html[data-theme="white"] body #homeView .discovery-tab * {
  color: #896e80 !important;
}

html[data-theme="white"] body #homeView .discovery-tab.active,
html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"],
html[data-theme="white"] body #homeView .discovery-tab.active * {
  color: #d51b7e !important;
}

html[data-theme="white"] body #homeView .discovery-tab.active::after,
html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"]::after {
  background: var(--chayt-pink-gradient) !important;
}

html[data-theme="white"] body #homeView .today-with-chayt,
html[data-theme="white"] body #homeView .today-chayt-rail,
html[data-theme="white"] body #homeView .today-chayt-card {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: var(--chayt-pink-line) !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #homeView .today-chayt-card-title,
html[data-theme="white"] body #homeView .today-chayt-card-copy,
html[data-theme="white"] body #homeView .today-chayt-card-action {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #homeView .bot-card,
html[data-theme="white"] body .discovery-search-result-card {
  background: #ffffff !important;
  border-color: #ebd2df !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #homeView .bot-card-media,
html[data-theme="white"] body .discovery-search-result-card .bot-card-media,
html[data-theme="white"] body .discovery-search-simple-image {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #ebd2df !important;
}

html[data-theme="white"] body #homeView .bot-card-name,
html[data-theme="white"] body #homeView .bot-card-desc,
html[data-theme="white"] body #homeView .bot-card-meta,
html[data-theme="white"] body .discovery-search-simple-name,
html[data-theme="white"] body .discovery-search-simple-desc {
  color: var(--chayt-ink) !important;
}

/* Discovery search overlay */
html[data-theme="white"] body .discovery-search-overlay,
html[data-theme="white"] body .discovery-search-page,
html[data-theme="white"] body .discovery-search-head,
html[data-theme="white"] body .discovery-search-body {
  background: #fffafd !important;
  border-color: #efd9e5 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .discovery-search-head {
  background: var(--chayt-pink-gradient) !important;
}

html[data-theme="white"] body .discovery-search-field {
  background: rgba(255,255,255,.96) !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .discovery-search-field input {
  background: transparent !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .discovery-search-cancel-btn {
  color: #fff !important;
}

html[data-theme="white"] body .discovery-search-actions {
  background: #fffafd !important;
}

html[data-theme="white"] body .discovery-search-result-card:hover {
  background: #fff2f8 !important;
  border-color: #e4b7cf !important;
}

/* Consistent pink page headers on mobile. */
@media (max-width: 960px) {
  html[data-theme="white"] body #createView > .create-topbar,
  html[data-theme="white"] body #yourCharactersView > .create-topbar,
  html[data-theme="white"] body #recentChatsView > .create-topbar,
  html[data-theme="white"] body #creditsView > .create-topbar,
  html[data-theme="white"] body #creditsView > .credits-topbar,
  html[data-theme="white"] body #settingsView > .create-topbar,
  html[data-theme="white"] body #aimodelratingView > .create-topbar,
  html[data-theme="white"] body #chatView > .chat-topbar,
  html[data-theme="white"] body #historyView > .history-topbar,
  html[data-theme="white"] body #chatStyleView > .history-topbar,
  html[data-theme="white"] body #conversationMemoryView > .history-topbar,
  html[data-theme="white"] body #userPersonaView > .history-topbar {
    background: var(--chayt-pink-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(188, 28, 115, .18) !important;
  }

  html[data-theme="white"] body .create-topbar .create-title,
  html[data-theme="white"] body .history-topbar .history-title,
  html[data-theme="white"] body .chat-topbar .chat-name,
  html[data-theme="white"] body .chat-topbar .chat-desc {
    color: #fff !important;
  }

  html[data-theme="white"] body .create-topbar .icon-btn,
  html[data-theme="white"] body .history-topbar .icon-btn,
  html[data-theme="white"] body .chat-topbar .icon-btn,
  html[data-theme="white"] body .chat-topbar .chat-action-btn {
    background: rgba(255,255,255,.16) !important;
    border-color: rgba(255,255,255,.24) !important;
    color: #fff !important;
  }

  html[data-theme="white"] body .mobile-bottom-nav,
  html[data-theme="white"] body[data-current-view="settings"] .mobile-bottom-nav,
  html[data-theme="white"] body[data-current-view="yourCharacters"] .mobile-bottom-nav {
    background: var(--chayt-pink-gradient) !important;
    border-top: 0 !important;
    box-shadow: 0 -10px 28px rgba(167, 24, 103, .25) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html[data-theme="white"] body .mobile-bottom-nav-item,
  html[data-theme="white"] body .mobile-bottom-nav-item * {
    color: rgba(255,255,255,.74) !important;
  }

  html[data-theme="white"] body .mobile-bottom-nav-item.active,
  html[data-theme="white"] body .mobile-bottom-nav-item.active * {
    color: #fff !important;
  }

  html[data-theme="white"] body .mobile-bottom-nav-item.active::after {
    background: #fff !important;
    box-shadow: 0 0 10px rgba(255,255,255,.52) !important;
  }
}

/* Create Character */
html[data-theme="white"] body #createView,
html[data-theme="white"] body #createView .create-body,
html[data-theme="white"] body #createView .panel,
html[data-theme="white"] body #createView .create-character-panel,
html[data-theme="white"] body #createView .media-combined-panel {
  background: #fffafd !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #createView .form-group input:not([type="color"]),
html[data-theme="white"] body #createView .form-group textarea,
html[data-theme="white"] body #createView .form-group select,
html[data-theme="white"] body #createView .visibility-trigger,
html[data-theme="white"] body #createView .rating-trigger,
html[data-theme="white"] body #createView .custom-picker-trigger,
html[data-theme="white"] body #createView .persona-action-card {
  background: #fff7fb !important;
  border-color: #edcede !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #createView .custom-select-menu,
html[data-theme="white"] body #createView .custom-picker-menu {
  background: #fff !important;
  border-color: #eac9da !important;
  color: var(--chayt-ink) !important;
}

/* Your Characters and Recent Chats; specificity beats the mobile glitch fallback. */
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-page {
  background: #fffafd !important;
}

html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-characters-toolbar,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-card {
  background: #fff !important;
  border-color: #ebd2df !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 9px 25px rgba(116, 36, 80, .07) !important;
}

html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .search-field {
  background: #fff7fb !important;
  border-color: #eac9da !important;
}

html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-avatar {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e6bfd3 !important;
}

html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-copy h3,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-copy p,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-stat,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-chip {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-stat,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-chip,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .your-character-action-btn,
html[data-theme="white"] body[data-current-view="yourCharacters"] #yourCharactersView .memory-icon-btn {
  background: #fff3f8 !important;
  border-color: #e8c9da !important;
  color: #7a4263 !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-panel,
html[data-theme="white"] body #recentChatsView .recent-chat-card {
  background: #fff !important;
  border-color: #ebd2df !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #recentChatsView .recent-chat-card-title,
html[data-theme="white"] body #recentChatsView .recent-chat-card-subtitle,
html[data-theme="white"] body #recentChatsView .recent-chat-card-time {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-search,
html[data-theme="white"] body #recentChatsView .search-field {
  background: #fff7fb !important;
  border-color: #eac9da !important;
}

/* Character details */
html[data-theme="white"] body .detail-quick-actions {
  background: var(--chayt-pink-gradient-soft) !important;
  border: 1px solid #e8c5d7 !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 10px 28px rgba(124, 35, 84, .10) !important;
}

html[data-theme="white"] body .detail-quick-actions .icon-btn,
html[data-theme="white"] body .detail-quick-actions button:not(.btn-save) {
  background: rgba(255,255,255,.82) !important;
  border-color: #e4bfd2 !important;
  color: #7e4767 !important;
}

html[data-theme="white"] body .detail-review-stat-chip,
html[data-theme="white"] body .detail-review-form,
html[data-theme="white"] body .detail-review-item {
  background: #fff5fa !important;
  border-color: #ead0dd !important;
  color: var(--chayt-ink) !important;
}

/* Energy */
html[data-theme="white"] body #creditsView .credits-hero > div:first-child,
html[data-theme="white"] body #creditsView .credits-balance-card,
html[data-theme="white"] body #creditsView .credits-panel {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e8c7d8 !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 12px 32px rgba(126, 38, 88, .09) !important;
}

html[data-theme="white"] body #creditsView .credits-hero h1,
html[data-theme="white"] body #creditsView .credits-hero p,
html[data-theme="white"] body #creditsView .credits-balance-label,
html[data-theme="white"] body #creditsView .credits-balance-value,
html[data-theme="white"] body #creditsView .credits-balance-sub {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #creditsView .credits-daily-card,
html[data-theme="white"] body #creditsView .credits-mini-stat,
html[data-theme="white"] body #creditsView .credits-referral-card,
html[data-theme="white"] body #creditsView .credits-referral-stat-card,
html[data-theme="white"] body #creditsView .credit-pack-card,
html[data-theme="white"] body #creditsView .credits-plan-card {
  background: rgba(255,255,255,.86) !important;
  border-color: #e7c5d7 !important;
  color: var(--chayt-ink) !important;
}

/* Models and model ratings */
html[data-theme="white"] body #aimodelratingView .ai-model-rating-shell {
  background: transparent !important;
}

html[data-theme="white"] body #aimodelratingView .ai-model-rating-toolbar,
html[data-theme="white"] body #aimodelratingView .ai-model-card,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-detail-head,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-summary-card,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-form-card,
html[data-theme="white"] body #aimodelratingView .ai-model-comments-card,
html[data-theme="white"] body #aimodelratingView .ai-model-comment {
  background: #fff !important;
  border-color: #ebd1df !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 10px 28px rgba(116, 36, 80, .07) !important;
}

html[data-theme="white"] body #aimodelratingView.ai-model-detail-open .ai-model-rating-detail-head {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e7bdd3 !important;
}

html[data-theme="white"] body #aimodelratingView .ai-model-rating-toolbar-copy h2,
html[data-theme="white"] body #aimodelratingView .ai-model-card-title,
html[data-theme="white"] body #aimodelratingView .ai-model-card-desc,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-detail-meta h2,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-detail-copy,
html[data-theme="white"] body #aimodelratingView .panel-title,
html[data-theme="white"] body #aimodelratingView .setting-help {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #aimodelratingView .ai-model-search-wrap,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-form-card textarea,
html[data-theme="white"] body #aimodelratingView.ai-model-detail-open .model-picker-empty,
html[data-theme="white"] body #aimodelratingView.ai-model-detail-open .ai-model-rating-hero-score {
  background: #fff6fa !important;
  border-color: #e7c6d7 !important;
  color: var(--chayt-ink) !important;
}

/* Helpful Pages, profile personas, and gender */
html[data-theme="white"] body[data-current-view="settings"] #settingsView .settings-social-link,
html[data-theme="white"] body[data-current-view="settings"] #settingsView .settings-resource-link,
html[data-theme="white"] body #settingsView .settings-social-link,
html[data-theme="white"] body #settingsView .settings-resource-link {
  background: #fff6fa !important;
  border-color: #e8c9d9 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #settingsView .settings-resource-icon {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e4bed1 !important;
  color: #c81976 !important;
}

html[data-theme="white"] body #settingsView .settings-resource-link small,
html[data-theme="white"] body #settingsView .settings-social-link small {
  color: #7d6675 !important;
}

html[data-theme="white"] body #settingsView .persona-open-btn,
html[data-theme="white"] body #settingsView .persona-count {
  background: #fff5fa !important;
  border: 1px solid #e8c9d9 !important;
  border-radius: 12px !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #settingsView .persona-open-btn {
  padding-inline: 12px !important;
}

html[data-theme="white"] body .profile-gender-orb {
  background: #fff6fa !important;
  border-color: #e5c4d6 !important;
  color: #a95b82 !important;
  box-shadow: 0 8px 20px rgba(112, 34, 78, .08) !important;
}

html[data-theme="white"] body .profile-gender-circle.is-selected .profile-gender-orb {
  background: var(--chayt-pink-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 0 0 4px rgba(218, 28, 129, .12) !important;
}

html[data-theme="white"] body #userPersonaView .user-persona-hero,
html[data-theme="white"] body #userPersonaView .user-persona-page-card,
html[data-theme="white"] body #userPersonaView .user-persona-avatar-editor {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e6c2d5 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #userPersonaView .user-persona-hero h2,
html[data-theme="white"] body #userPersonaView .user-persona-hero p,
html[data-theme="white"] body #userPersonaView .user-persona-item-title,
html[data-theme="white"] body #userPersonaView .user-persona-item-meta {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #userPersonaView .user-persona-page-card.is-active {
  background: #ffeaf4 !important;
  border-color: #de9fbe !important;
}

/* Chat actions, Chat Style, memory, conversations, and new-chat prompt */
html[data-theme="white"] body #chatView.menu-open::before {
  background: rgba(94, 29, 67, .22) !important;
}

html[data-theme="white"] body #chatView .chat-menu {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e5bed2 !important;
  color: var(--chayt-ink) !important;
  box-shadow: -14px 0 32px rgba(118, 31, 80, .16) !important;
}

html[data-theme="white"] body #chatView .chat-menu button,
html[data-theme="white"] body #chatView .chat-menu button::after {
  color: #5f3b53 !important;
}

html[data-theme="white"] body #chatView .chat-menu .chat-menu-new-btn {
  background: var(--chayt-pink-gradient) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(185, 28, 112, .20) !important;
}

html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-chat"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-user"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-bot"] {
  color: #cb314d !important;
  border-color: #efc8d0 !important;
}

html[data-theme="white"] body #chatStyleView .chat-style-model-card,
html[data-theme="white"] body #conversationMemoryView .chat-style-model-card,
html[data-theme="white"] body #conversationMemoryView .memory-panel,
html[data-theme="white"] body #historyView .history-card,
html[data-theme="white"] body #historyView .history-session {
  background: #fff !important;
  border-color: #e9cedc !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #chatStyleView .chat-style-section-pill,
html[data-theme="white"] body #chatStyleView .chat-style-model-title,
html[data-theme="white"] body #chatStyleView .chat-style-model-desc,
html[data-theme="white"] body #conversationMemoryView .chat-style-section-pill,
html[data-theme="white"] body #conversationMemoryView .chat-style-model-title,
html[data-theme="white"] body #conversationMemoryView .chat-style-model-desc {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .chat-start-choice-modal {
  background: rgba(102, 31, 72, .30) !important;
}

html[data-theme="white"] body .chat-start-choice-card,
html[data-theme="white"] body .chat-start-choice-preview,
html[data-theme="white"] body .chat-start-choice-btn {
  background: #fff !important;
  border-color: #e8c6d8 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .chat-start-choice-btn.primary {
  background: var(--chayt-pink-gradient) !important;
  color: #fff !important;
}

/* Destructive and report dialogs */
html[data-theme="white"] body .brand-confirm-card,
html[data-theme="white"] body .report-modal-card,
html[data-theme="white"] body .delete-account-warning-card,
html[data-theme="white"] body .settings-unsaved-card,
html[data-theme="white"] body .persona-delete-confirm-card,
html[data-theme="white"] body .message-modal-card,
html[data-theme="white"] body .archive-modal-card,
html[data-theme="white"] body .composer-tools-card,
html[data-theme="white"] body .complete-profile-card,
html[data-theme="white"] body .mobile-app-update-card {
  background: #fff !important;
  border-color: #e8c8d9 !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 22px 56px rgba(91, 25, 63, .20) !important;
}

html[data-theme="white"] body .report-reason-option,
html[data-theme="white"] body .report-modal-textarea,
html[data-theme="white"] body .archive-modal-body,
html[data-theme="white"] body .composer-tool-option {
  background: #fff5fa !important;
  border-color: #e8c8d9 !important;
  color: var(--chayt-ink) !important;
}

/* Splash and loading */
html[data-theme="white"] body .splash-screen {
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.30), transparent 28%),
    var(--chayt-pink-gradient) !important;
}

html[data-theme="white"] body .splash-title {
  color: #fff !important;
  text-shadow: 0 4px 18px rgba(91, 17, 62, .25);
}

html[data-theme="white"] body .splash-trace {
  background: rgba(255,255,255,.26) !important;
}

html[data-theme="white"] body .splash-trace span {
  background: #fff !important;
}

html[data-theme="white"] body .loading-overlay,
html[data-theme="white"] body .app-loading-backdrop {
  background: rgba(98, 28, 69, .28) !important;
}

html[data-theme="white"] body .loading-card,
html[data-theme="white"] body .app-loading-card {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e6bdd2 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .app-loading-dots span,
html[data-theme="white"] body .loading-spinner {
  background-color: #d51b7e !important;
  border-top-color: #d51b7e !important;
}

html[data-theme="white"] body .mobile-pull-refresh-pill {
  background: var(--chayt-pink-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* The mobile display-glitch reporter is injected after styles.css. */
html[data-theme="white"] body .display-glitch-reporter {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #dca6c2 !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 16px 38px rgba(114, 31, 78, .18) !important;
}

html[data-theme="white"] body .display-glitch-reporter span {
  color: #765a6c !important;
}

html[data-theme="white"] body .display-glitch-reporter button {
  background: #fff !important;
  border-color: #e3bfd2 !important;
  color: #713c5c !important;
}

html[data-theme="white"] body .display-glitch-reporter [data-glitch-report-send] {
  background: var(--chayt-pink-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* White + Pink readability contract. Keep these last: dynamic panels inject dark defaults. */
html[data-theme="white"] {
  --rp-action-color: #69445d !important;
  --rp-speech-color: #321a2c !important;
  --rp-whisper-color: #78566d !important;
  --rp-emphasis-color: #bd176d !important;
  --rp-loud-color: #c9234b !important;
  --rp-ooc-color: #705a68 !important;
  --rp-quote-color: #7c3f9f !important;
  --rp-scene-color: #c01877 !important;
  --rp-transition-color: #95510e !important;
  --rp-divider-color: #bd7da0 !important;
}

html[data-theme="white"] body .setting-help,
html[data-theme="white"] body .section-subtitle,
html[data-theme="white"] body .panel-subtitle,
html[data-theme="white"] body .form-group small,
html[data-theme="white"] body .form-group label,
html[data-theme="white"] body .char-counter {
  color: #765a6c !important;
}

/* Every custom select/model picker uses the light palette. */
html[data-theme="white"] body .custom-select-menu,
html[data-theme="white"] body .visibility-menu,
html[data-theme="white"] body .custom-picker-menu,
html[data-theme="white"] body .model-picker-popover,
html[data-theme="white"] body .model-picker-list,
html[data-theme="white"] body .model-picker-option,
html[data-theme="white"] body .model-picker-empty {
  background: #fff !important;
  border-color: #e6bfd3 !important;
  color: var(--chayt-ink) !important;
  box-shadow: 0 16px 38px rgba(112, 31, 77, .14) !important;
}

html[data-theme="white"] body .custom-select-option,
html[data-theme="white"] body .visibility-option,
html[data-theme="white"] body .custom-picker-option,
html[data-theme="white"] body .model-picker-option {
  background: #fff7fb !important;
  border-color: #edd2df !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .custom-select-option:hover,
html[data-theme="white"] body .custom-select-option.selected,
html[data-theme="white"] body .visibility-option:hover,
html[data-theme="white"] body .visibility-option.selected,
html[data-theme="white"] body .custom-picker-option:hover,
html[data-theme="white"] body .custom-picker-option.selected,
html[data-theme="white"] body .model-picker-option:hover,
html[data-theme="white"] body .model-picker-option.selected {
  background: #ffe6f2 !important;
  border-color: #dc9fbe !important;
  color: #9e145d !important;
}

html[data-theme="white"] body .model-picker-trigger,
html[data-theme="white"] body .model-picker-search,
html[data-theme="white"] body .model-picker-search-btn,
html[data-theme="white"] body .model-picker-rating-link {
  background: #fff7fb !important;
  border-color: #e6c4d6 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .model-picker-trigger-title,
html[data-theme="white"] body .model-picker-option-title {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .model-picker-trigger-sub,
html[data-theme="white"] body .model-picker-option-desc,
html[data-theme="white"] body .model-picker-rating,
html[data-theme="white"] body .model-picker-current-rating {
  color: #765a6c !important;
}

/* Pills: recommendations and model metadata are pink and readable. */
html[data-theme="white"] body #createView .create-tag-chip,
html[data-theme="white"] body #createView .create-tag-suggestion-chip,
html[data-theme="white"] body .model-help-badge,
html[data-theme="white"] body .ai-model-badge,
html[data-theme="white"] body .model-picker-option-badges span,
html[data-theme="white"] body .model-picker-trigger-badges span,
html[data-theme="white"] body #aimodelratingView .ai-model-card-badges span {
  background: #ffe8f3 !important;
  border-color: #e6abc9 !important;
  color: #aa1765 !important;
}

html[data-theme="white"] body #createView .create-tag-suggestion-title,
html[data-theme="white"] body #createView .create-tag-suggestion-chip strong,
html[data-theme="white"] body #createView .create-tag-chip span::before,
html[data-theme="white"] body #createView .create-tag-suggestion-chip span::before {
  color: #a51a64 !important;
}

/* Import/export controls and their injected dialogs. */
html[data-theme="white"] body #createView .persona-action-card,
html[data-theme="white"] body #personaImportModal .auth-gate-card,
html[data-theme="white"] body #personaExportModal .auth-gate-card,
html[data-theme="white"] body #personaExportModal .persona-export-card,
html[data-theme="white"] body #personaImportModal .persona-import-card {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e4bcd0 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #createView .persona-action-card strong,
html[data-theme="white"] body #personaExportModal .persona-export-card-title,
html[data-theme="white"] body #personaImportModal .auth-gate-title,
html[data-theme="white"] body #personaExportModal .auth-gate-title {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #createView .persona-action-card small,
html[data-theme="white"] body #personaExportModal .persona-export-card-copy,
html[data-theme="white"] body #personaImportModal .auth-gate-subtitle,
html[data-theme="white"] body #personaExportModal .auth-gate-subtitle {
  color: #765a6c !important;
}

html[data-theme="white"] body #personaImportModal .auth-fields textarea,
html[data-theme="white"] body #personaImportModal .auth-fields input {
  background: #fff !important;
  border-color: #e5c2d5 !important;
  color: var(--chayt-ink) !important;
}

/* Roleplay formatting panel and rendered syntax. */
html[data-theme="white"] body #settingsView .roleplay-style-panel,
html[data-theme="white"] body .roleplay-style-nav,
html[data-theme="white"] body .roleplay-style-row,
html[data-theme="white"] body .roleplay-preview-wrap {
  background: #fff5fa !important;
  border-color: #e7c4d6 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .roleplay-style-nav-btn,
html[data-theme="white"] body .roleplay-style-row strong,
html[data-theme="white"] body .roleplay-preview-label,
html[data-theme="white"] body .roleplay-format-toggle {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .roleplay-style-nav-btn.active,
html[data-theme="white"] body .roleplay-style-nav-btn:hover,
html[data-theme="white"] body .roleplay-format-toggle {
  background: #ffe6f2 !important;
  border-color: #dda4c1 !important;
}

html[data-theme="white"] body .roleplay-preview-bubble {
  background: #fff !important;
  border-color: #e2b7cd !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body .rich-strong,
html[data-theme="white"] body .rich-speech,
html[data-theme="white"] body .rich-whisper,
html[data-theme="white"] body .rich-action,
html[data-theme="white"] body .rich-emphasis,
html[data-theme="white"] body .rich-loud,
html[data-theme="white"] body .rich-ooc,
html[data-theme="white"] body .rich-quote,
html[data-theme="white"] body .rich-scene-command,
html[data-theme="white"] body .rich-scene-heading,
html[data-theme="white"] body .rich-transition,
html[data-theme="white"] body .rich-text-heading,
html[data-theme="white"] body .rich-phone-text {
  opacity: 1 !important;
}

/* Conversation Memory and Chat Style have a two-ID dark override. */
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card.chayt-mode-card,
html[data-theme="white"] body #chatStyleView .chat-style-model-card,
html[data-theme="white"] body #chatStyleView .chat-style-model-card.chayt-mode-card {
  background: #fff !important;
  border-color: #e6c3d5 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-card.selected,
html[data-theme="white"] body #chatStyleView .chat-style-model-card.selected {
  background: #ffe8f3 !important;
  border-color: #d991b5 !important;
}

html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-title,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-desc,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-foot,
html[data-theme="white"] body #chatStyleView .chat-style-model-title,
html[data-theme="white"] body #chatStyleView .chat-style-model-desc,
html[data-theme="white"] body #chatStyleView .chat-style-model-foot,
html[data-theme="white"] body #userPersonaView .chat-style-section-pill,
html[data-theme="white"] body #userPersonaView .chat-style-section-note {
  color: var(--chayt-ink) !important;
}

/* Report/delete sheets: no black footer and readable actions. */
html[data-theme="white"] body .brand-confirm-modal,
html[data-theme="white"] body .delete-account-warning-modal,
html[data-theme="white"] body .settings-unsaved-modal,
html[data-theme="white"] body .persona-delete-confirm-modal {
  background: rgba(108, 29, 74, .30) !important;
}

html[data-theme="white"] body .brand-confirm-actions,
html[data-theme="white"] body .brand-confirm-modal.report-modal .brand-confirm-actions,
html[data-theme="white"] body .delete-account-warning-actions,
html[data-theme="white"] body .settings-unsaved-actions,
html[data-theme="white"] body .persona-delete-confirm-actions {
  background: #fff0f7 !important;
  border-color: #e4bed1 !important;
}

html[data-theme="white"] body .brand-confirm-actions button,
html[data-theme="white"] body .delete-account-warning-actions button,
html[data-theme="white"] body .settings-unsaved-actions button,
html[data-theme="white"] body .persona-delete-confirm-actions button {
  background: #fff !important;
  border-color: #dfb4ca !important;
  color: #713b5b !important;
}

html[data-theme="white"] body .brand-confirm-actions .danger,
html[data-theme="white"] body .brand-confirm-actions .btn-delete,
html[data-theme="white"] body .delete-account-warning-actions .btn-delete,
html[data-theme="white"] body .persona-confirm-delete-btn,
html[data-theme="white"] body #botReportSubmit {
  background: var(--chayt-pink-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Credits: every label and offer card gets a high-contrast light palette. */
html[data-theme="white"] body #creditsView .credits-referral-panel,
html[data-theme="white"] body #creditsView .credits-support-goal-panel,
html[data-theme="white"] body #creditsView .chayt-plus-mini-plan,
html[data-theme="white"] body #creditsView .credit-pack-card,
html[data-theme="white"] body #creditsView .credit-history-item,
html[data-theme="white"] body #creditsView .credits-referral-card,
html[data-theme="white"] body #creditsView .credits-daily-card,
html[data-theme="white"] body #creditsView .credits-mini-stat {
  background: #fff !important;
  border-color: #e6c3d5 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #creditsView .credits-daily-label,
html[data-theme="white"] body #creditsView .credits-daily-copy,
html[data-theme="white"] body #creditsView .credits-panel .section-title,
html[data-theme="white"] body #creditsView .credits-panel .section-subtitle,
html[data-theme="white"] body #creditsView .credits-inline-note,
html[data-theme="white"] body #creditsView .credits-mini-stat span,
html[data-theme="white"] body #creditsView .credits-mini-stat strong,
html[data-theme="white"] body #creditsView .chayt-plus-plan-title,
html[data-theme="white"] body #creditsView .chayt-plus-plan-copy,
html[data-theme="white"] body #creditsView .chayt-plus-plan-price,
html[data-theme="white"] body #creditsView .chayt-plus-list-price,
html[data-theme="white"] body #creditsView .chayt-plus-plan-period,
html[data-theme="white"] body #creditsView .credit-pack-title,
html[data-theme="white"] body #creditsView .credit-pack-copy,
html[data-theme="white"] body #creditsView .credit-offer-price,
html[data-theme="white"] body #creditsView .credit-offer-old-price,
html[data-theme="white"] body #creditsView .credits-support-goal-amount {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #creditsView .credit-offer-badge,
html[data-theme="white"] body #creditsView .credits-support-goal-pill {
  background: #ffe6f2 !important;
  border-color: #dda2c0 !important;
  color: #a81664 !important;
}

/* Chayt+ full page and launch modal. */
html[data-theme="white"] body #chaytPlusView .chayt-plus-page,
html[data-theme="white"] body #chaytPlusView .chayt-plus-hero,
html[data-theme="white"] body #chaytPlusView .chayt-plus-compare-panel,
html[data-theme="white"] body #chaytPlusView .chayt-plus-compare-table,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-card,
html[data-theme="white"] body #chaytPlusView .chayt-plus-benefits article,
html[data-theme="white"] body .chayt-plus-launch-card,
html[data-theme="white"] body .chayt-plus-launch-plan,
html[data-theme="white"] body .chayt-plus-launch-benefits {
  background: var(--chayt-pink-gradient-soft) !important;
  border-color: #e4bad0 !important;
  color: var(--chayt-ink) !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-card,
html[data-theme="white"] body #chaytPlusView .chayt-plus-energy-note > div,
html[data-theme="white"] body #chaytPlusView .chayt-plus-compare-table .chayt-plus-launch-benefit-row,
html[data-theme="white"] body .chayt-plus-launch-plan,
html[data-theme="white"] body .chayt-plus-launch-benefit-row {
  background: #fff !important;
  border-color: #e6c3d5 !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-card.featured,
html[data-theme="white"] body .chayt-plus-launch-plan.selected {
  background: #ffe7f2 !important;
  border-color: #d88fb3 !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-hero h1,
html[data-theme="white"] body #chaytPlusView .chayt-plus-hero p,
html[data-theme="white"] body #chaytPlusView .chayt-plus-energy-note strong,
html[data-theme="white"] body #chaytPlusView .chayt-plus-energy-note small,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-title,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-copy,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-price,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-period,
html[data-theme="white"] body .chayt-plus-launch-card h2,
html[data-theme="white"] body .chayt-plus-launch-plan-name,
html[data-theme="white"] body .chayt-plus-launch-plan-subtitle,
html[data-theme="white"] body .chayt-plus-launch-plan-price,
html[data-theme="white"] body .chayt-plus-launch-fineprint,
html[data-theme="white"] body .chayt-plus-launch-benefit-name {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #chaytPlusView .chayt-plus-kicker,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-kicker,
html[data-theme="white"] body .chayt-plus-launch-plan.selected .chayt-plus-launch-plan-name {
  background: #ffe4f1 !important;
  border-color: #dda2c0 !important;
  color: #a61562 !important;
}

/* Discovery notices, server goal, and logo-only Today cards. */
html[data-theme="white"] body #homeView .ollama-discovery-notice,
html[data-theme="white"] body #homeView .support-goal-inline {
  background: #fff0f7 !important;
  border-color: #e0a9c5 !important;
  color: var(--chayt-ink) !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #homeView .ollama-notice-title,
html[data-theme="white"] body #homeView .ollama-notice-copy p,
html[data-theme="white"] body #homeView .support-goal-inline {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #homeView .ollama-notice-icon,
html[data-theme="white"] body #homeView .ollama-notice-close {
  background: #ffe0ee !important;
  border-color: #d99ab9 !important;
  color: #ae1768 !important;
}

html[data-theme="white"] body #homeView .ollama-notice-action {
  background: #d91c83 !important;
  border-color: #d91c83 !important;
  color: #fff !important;
}

html[data-theme="white"] body .whats-new-backdrop {
  background: rgba(98, 28, 74, 0.28) !important;
}

html[data-theme="white"] body .whats-new-panel {
  background: #fff !important;
  border-color: #e4b8cf !important;
  color: #321a2c !important;
  box-shadow: 0 24px 70px rgba(111, 29, 79, 0.2) !important;
}

html[data-theme="white"] body .whats-new-kicker {
  color: #b51468 !important;
}

html[data-theme="white"] body .whats-new-intro,
html[data-theme="white"] body .whats-new-model-row p,
html[data-theme="white"] body .whats-new-footer span {
  color: #67475b !important;
}

html[data-theme="white"] body .whats-new-model-list,
html[data-theme="white"] body .whats-new-model-row + .whats-new-model-row {
  border-color: #ead1de !important;
}

html[data-theme="white"] body .whats-new-close {
  background: #fff1f7 !important;
  border-color: #e1b7cc !important;
  color: #7d315d !important;
}

html[data-theme="white"] body .whats-new-model-pill {
  background: #e8fff7 !important;
  border-color: #8bcfb9 !important;
  color: #176b54 !important;
}

html[data-theme="white"] body .whats-new-model-type {
  background: #fff0f7 !important;
  border-color: #dfa6c2 !important;
  color: #a61562 !important;
}

html[data-theme="white"] body .whats-new-done {
  background: #d91c83 !important;
  border-color: #d91c83 !important;
  color: #fff !important;
}

html[data-theme="white"] body #homeView .today-chayt-card-media,
html[data-theme="white"] body #homeView .today-chayt-card-blur-wrap,
html[data-theme="white"] body #homeView .today-chayt-card.energy .today-chayt-card-media {
  background: var(--chayt-pink-gradient-soft) !important;
}

/* Patch Notes and syntax examples. */
html[data-theme="white"] body #patchNotesView .patch-notes-hero,
html[data-theme="white"] body #patchNotesView .patch-notes-card,
html[data-theme="white"] body #patchNotesView .patch-syntax-grid,
html[data-theme="white"] body #patchNotesView .patch-syntax-item,
html[data-theme="white"] body #patchNotesView .patch-chat-example,
html[data-theme="white"] body #patchNotesView .patch-showcase-card,
html[data-theme="white"] body #patchNotesView .patch-plus-mini div {
  background: #fff !important;
  border-color: #e6c4d6 !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #patchNotesView .patch-notes-hero {
  background: var(--chayt-pink-gradient-soft) !important;
}

html[data-theme="white"] body #patchNotesView .patch-notes-kicker,
html[data-theme="white"] body #patchNotesView .patch-notes-hero h1,
html[data-theme="white"] body #patchNotesView .patch-notes-hero p,
html[data-theme="white"] body #patchNotesView .patch-note-item h2,
html[data-theme="white"] body #patchNotesView .patch-note-item p,
html[data-theme="white"] body #patchNotesView .patch-syntax-item summary code,
html[data-theme="white"] body #patchNotesView .patch-syntax-item summary span,
html[data-theme="white"] body #patchNotesView .patch-syntax-example > code,
html[data-theme="white"] body #patchNotesView .patch-showcase-label,
html[data-theme="white"] body #patchNotesView .patch-showcase-card p,
html[data-theme="white"] body #patchNotesView .patch-review-demo p,
html[data-theme="white"] body #patchNotesView .patch-review-actions,
html[data-theme="white"] body #patchNotesView .patch-reply-like,
html[data-theme="white"] body #patchNotesView .patch-tabs span,
html[data-theme="white"] body #patchNotesView .patch-tags span,
html[data-theme="white"] body #patchNotesView .patch-notes-note {
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #patchNotesView .patch-tags span,
html[data-theme="white"] body #patchNotesView .patch-tabs span.active {
  background: #ffe7f2 !important;
  border-color: #dda3c1 !important;
  color: #a51561 !important;
}

/* Settings cards that were made transparent by the mobile cleanup. */
html[data-theme="white"] body #settingsView .profile-interest-panel,
html[data-theme="white"] body #settingsView .persona-manager,
html[data-theme="white"] body #settingsView .ai-provider-fields,
html[data-theme="white"] body #settingsView #blockedBotsList,
html[data-theme="white"] body #settingsView .blocked-bot-row,
html[data-theme="white"] body #settingsView .blocked-bots-empty {
  background: #fff5fa !important;
  border: 1px solid #e7c6d7 !important;
  border-radius: 12px !important;
  color: var(--chayt-ink) !important;
}

html[data-theme="white"] body #settingsView .profile-interest-panel,
html[data-theme="white"] body #settingsView .persona-manager,
html[data-theme="white"] body #settingsView .ai-provider-fields,
html[data-theme="white"] body #settingsView #blockedBotsList {
  padding: 12px !important;
}

html[data-theme="white"] body #settingsView .blocked-bots-empty,
html[data-theme="white"] body #settingsView .blocked-bot-copy small {
  color: #765a6c !important;
}

@media (max-width: 960px) {
  html[data-theme="white"] body #chaytPlusView > .create-topbar,
  html[data-theme="white"] body #chaytPlusView > .credits-topbar,
  html[data-theme="white"] body #patchNotesView > .create-topbar {
    background: var(--chayt-pink-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
  }
}

/* White + Pink mobile component finish. */
html[data-theme="white"] body #createView,
html[data-theme="white"] body #createView .create-body {
  background: #fff6fa !important;
}

html[data-theme="white"] body #createView > .create-topbar {
  background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #d52cab 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body #createView > .create-topbar .icon-btn {
  background: rgba(255,255,255,.16) !important;
  border-color: rgba(255,255,255,.25) !important;
  color: #fff !important;
}

html[data-theme="white"] body #createView .create-body > .panel,
html[data-theme="white"] body #createView .appearance-panel,
html[data-theme="white"] body #createView .media-content-panel,
html[data-theme="white"] body #createView .media-sidebar,
html[data-theme="white"] body #createView .create-advanced-options {
  background: linear-gradient(145deg, #fff 0%, #fff0f7 100%) !important;
  border-color: #e9bfd4 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #createView .media-nav-btn,
html[data-theme="white"] body #createView .media-pane,
html[data-theme="white"] body #createView .form-group input,
html[data-theme="white"] body #createView .form-group textarea {
  background-color: #fff !important;
  border-color: #e5bdd1 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #createView .media-nav-btn.active,
html[data-theme="white"] body #createView .media-nav-btn:hover {
  background: #ffe3f0 !important;
  border-color: #dfa7c3 !important;
  color: #a81463 !important;
}

html[data-theme="white"] body .mobile-floating-create-btn,
html[data-theme="white"] body .mobile-create-btn,
html[data-theme="white"] body .mobile-hero-create-btn,
html[data-theme="white"] body .your-characters-mobile-create-cta,
html[data-theme="white"] body .your-characters-mobile-create-btn {
  background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #d52cab 100%) !important;
  border-color: rgba(255,255,255,.72) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(205, 34, 127, .24) !important;
}

html[data-theme="white"] body #homeView .discovery-search-open-label,
html[data-theme="white"] body #homeView .discovery-search-open-btn input,
html[data-theme="white"] body #homeView #homeSearch,
html[data-theme="white"] body #homeView #homeSearch::placeholder,
html[data-theme="white"] body .discovery-search-field input,
html[data-theme="white"] body .discovery-search-field input::placeholder {
  color: #75485f !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #75485f !important;
}

html[data-theme="white"] body .discovery-search-page {
  background: #fff8fc !important;
  border-color: #e2b5cc !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .discovery-search-head {
  background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #d52cab 100%) !important;
  border-color: transparent !important;
}

html[data-theme="white"] body .discovery-search-cancel-btn {
  color: #fff !important;
}

html[data-theme="white"] body .discovery-search-result-card,
html[data-theme="white"] body .discovery-search-result-card:hover {
  background: linear-gradient(135deg, #fff 0%, #fff0f7 100%) !important;
  border: 1px solid #e6bfd3 !important;
  border-radius: 15px !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-card-name,
html[data-theme="white"] body .discovery-search-result-card .bot-card-desc,
html[data-theme="white"] body .discovery-search-result-card .bot-card-footer {
  color: #422539 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-chip {
  background: #ffe8f3 !important;
  border-color: #e3aac7 !important;
  color: #7b315c !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-chip-sfw {
  background: #e7fbf0 !important;
  border-color: #83dbaf !important;
  color: #187247 !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-chip-nsfw {
  background: #ffe9ec !important;
  border-color: #f39aa7 !important;
  color: #a6243b !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-chip-gender {
  background: #edf5ff !important;
  border-color: #a9cff5 !important;
  color: #315f91 !important;
}

html[data-theme="white"] body .discovery-search-result-card .bot-card-chat-count {
  background: linear-gradient(135deg, #ed258a, #c22cab) !important;
  border-color: rgba(255,255,255,.78) !important;
  color: #fff !important;
}

html[data-theme="white"] body .discovery-search-empty,
html[data-theme="white"] body .discovery-search-loading-copy strong,
html[data-theme="white"] body .discovery-search-loading-copy span {
  color: #68475c !important;
}

html[data-theme="white"] body .composer-tools-card {
  background: linear-gradient(160deg, #fff 0%, #fff1f7 100%) !important;
  border-color: #e4b6ce !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .composer-tools-title,
html[data-theme="white"] body .composer-tool-copy strong,
html[data-theme="white"] body .composer-tool-copy small,
html[data-theme="white"] body .composer-suggestion-status,
html[data-theme="white"] body .composer-suggestion-note,
html[data-theme="white"] body .composer-suggestion-card span {
  color: #57374c !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .composer-tools-close {
  color: #77566b !important;
}

html[data-theme="white"] body .composer-tool-option,
html[data-theme="white"] body .composer-suggestion-card,
html[data-theme="white"] body .composer-suggestion-status,
html[data-theme="white"] body .composer-suggestion-note {
  background: #fff5fa !important;
  border-color: #e7bfd3 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .composer-tool-icon {
  background: #ffe4f0 !important;
  color: #d51d7d !important;
}

html[data-theme="white"] body .composer-suggestion-card textarea,
html[data-theme="white"] body .composer-suggestion-message-preview {
  background: #fff !important;
  border-color: #dfa9c4 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .composer-tools-actions .mini-btn,
html[data-theme="white"] body .composer-suggestion-card .mini-btn {
  background: #fff !important;
  border-color: #ddb0c7 !important;
  color: #71415d !important;
}

html[data-theme="white"] body #recentChatsView .mobile-recent-your-characters-btn {
  background: linear-gradient(135deg, #fff1f7, #f8eaff) !important;
  border: 1px solid #de9fbe !important;
  color: #9e145d !important;
  box-shadow: 0 7px 18px rgba(190, 35, 124, .10) !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-page {
  background: #fff8fc !important;
}

html[data-theme="white"] body #recentChatsView .recent-chat-card {
  background: linear-gradient(135deg, #fff 0%, #fff0f7 100%) !important;
  border-color: #e4b8ce !important;
}

html[data-theme="white"] body #creditsView .credits-hero {
  background: #fff0f7 !important;
  border-color: #e5b9d0 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #creditsView .credits-shop-copy,
html[data-theme="white"] body #creditsView .credits-balance-card {
  background: linear-gradient(155deg, #fff6fa 0%, #fceaf5 100%) !important;
}

html[data-theme="white"] body #settingsView #userProfilePanel,
html[data-theme="white"] body #settingsView #aiProvidersPanel,
html[data-theme="white"] body #settingsView #discoveryMotionPanel,
html[data-theme="white"] body #settingsView #imageSafetyPanel,
html[data-theme="white"] body #settingsView #notificationsPanel,
html[data-theme="white"] body #settingsView #chatOverridesPanel,
html[data-theme="white"] body #settingsView #settingsResourcePanel {
  background: linear-gradient(145deg, #fff7fb 0%, #ffeef6 100%) !important;
  border: 1px solid #e8bfd3 !important;
  border-radius: 16px !important;
  color: #321a2c !important;
  box-shadow: 0 8px 24px rgba(191, 39, 124, .06) !important;
}

html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-card {
  background: linear-gradient(145deg, #fff1f7 0%, #ffe3ee 100%) !important;
  border: 1px solid #e48eaf !important;
  color: #5d2842 !important;
  box-shadow: 0 10px 28px rgba(199, 39, 108, .10) !important;
}

html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-mobile-card {
  background: linear-gradient(145deg, #fff1f7 0%, #ffe3ee 100%) !important;
  border: 1px solid #e48eaf !important;
  color: #5d2842 !important;
  box-shadow: 0 10px 28px rgba(199, 39, 108, .10) !important;
}

html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-card strong,
html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-card p,
html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-mobile-card strong,
html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-mobile-card p {
  color: #63334b !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-card .btn-delete {
  background: #fff !important;
  border-color: #e43472 !important;
  color: #d71f62 !important;
}

html[data-theme="white"] body #settingsView #dangerZonePanel .danger-zone-mobile-card .btn-delete {
  background: #fff !important;
  border-color: #e43472 !important;
  color: #d71f62 !important;
}

html[data-theme="white"] body .brand-confirm-card,
html[data-theme="white"] body .brand-confirm-card.block-modal-card,
html[data-theme="white"] body .brand-confirm-card.report-modal-card,
html[data-theme="white"] body .delete-account-warning-card {
  background: linear-gradient(160deg, #fff 0%, #fff0f7 100%) !important;
  background-color: #fff5fa !important;
  border-color: #e2b4ca !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .brand-confirm-title,
html[data-theme="white"] body .brand-confirm-copy,
html[data-theme="white"] body .delete-account-warning-card h2,
html[data-theme="white"] body .delete-account-warning-card p,
html[data-theme="white"] body .delete-account-warning-kicker,
html[data-theme="white"] body .delete-account-warning-list,
html[data-theme="white"] body .delete-account-confirm-field {
  color: #5e3b51 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .delete-account-warning-list,
html[data-theme="white"] body .delete-account-confirm-field input {
  background: #fff !important;
  border-color: #dda9c2 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .brand-confirm-actions,
html[data-theme="white"] body .delete-account-warning-actions {
  background: #ffeaf4 !important;
  border: 1px solid #e5b9cf !important;
  border-radius: 16px !important;
  padding: 10px !important;
}

/* Flat white-theme layout: match the dark theme's unboxed outer sections. */
html[data-theme="white"] body #settingsView #userProfilePanel,
html[data-theme="white"] body #settingsView #aiProvidersPanel,
html[data-theme="white"] body #settingsView #discoveryMotionPanel,
html[data-theme="white"] body #settingsView #imageSafetyPanel,
html[data-theme="white"] body #settingsView #notificationsPanel,
html[data-theme="white"] body #settingsView #chatOverridesPanel,
html[data-theme="white"] body #settingsView #settingsResourcePanel,
html[data-theme="white"] body #settingsView #blockedBotsPanel {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #settingsView #blockedBotsList,
html[data-theme="white"] body #settingsView .blocked-bots-empty {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-inline: 0 !important;
}

html[data-theme="white"] body #createView .create-body > .panel,
html[data-theme="white"] body #createView .appearance-panel,
html[data-theme="white"] body #createView .media-content-panel,
html[data-theme="white"] body #createView .media-sidebar,
html[data-theme="white"] body #createView .create-advanced-options {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-panel {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body .discovery-search-simple-count {
  background: linear-gradient(135deg, #ed258a 0%, #ca2ead 100%) !important;
  border: 1px solid rgba(255,255,255,.78) !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(179, 35, 123, .20) !important;
}

html[data-theme="white"] body .discovery-search-simple-count svg,
html[data-theme="white"] body .discovery-search-simple-count svg * {
  fill: currentColor !important;
  color: #fff !important;
}

html[data-theme="white"] body #yourCharactersView .your-characters-bulk-panel {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  border-color: #dfa9c4 !important;
  color: #321a2c !important;
  box-shadow: 0 22px 56px rgba(105, 28, 74, .20) !important;
}

html[data-theme="white"] body #yourCharactersView .your-characters-bulk-head .section-title,
html[data-theme="white"] body #yourCharactersView .your-characters-bulk-head .section-subtitle,
html[data-theme="white"] body #yourCharactersView .bulk-setting-card,
html[data-theme="white"] body #yourCharactersView .bulk-setting-card strong,
html[data-theme="white"] body #yourCharactersView .bulk-setting-card small {
  color: #57374c !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #yourCharactersView .bulk-control-row {
  background: #fff7fb !important;
  border-color: #e6bfd2 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #yourCharactersView .bulk-control-row:focus-within,
html[data-theme="white"] body #yourCharactersView .bulk-control-row:has(.model-picker.open),
html[data-theme="white"] body #yourCharactersView .bulk-control-row:has(.visibility-picker.open) {
  background: #ffeaf4 !important;
  border-color: #d99ab9 !important;
}

html[data-theme="white"] body #yourCharactersView .your-characters-bulk-panel input,
html[data-theme="white"] body #yourCharactersView .your-characters-bulk-panel .visibility-trigger,
html[data-theme="white"] body #yourCharactersView .your-characters-bulk-panel .model-picker-trigger,
html[data-theme="white"] body #yourCharactersView .your-characters-bulk-panel .premium-portrait-toggle {
  background: #fff !important;
  border-color: #dfb3c9 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body #yourCharactersView .your-characters-bulk-actions,
html[data-theme="white"] body #yourCharactersView .your-characters-bulk-head .your-characters-tool-btn {
  color: #a81768 !important;
}

/* Flatten remaining creator, persona, and memory wrappers. */
html[data-theme="white"] body #createView .media-workspace,
html[data-theme="white"] body #createView .media-pane,
html[data-theme="white"] body #createView .media-pane-body,
html[data-theme="white"] body #createView .media-combined-panel,
html[data-theme="white"] body #createView .avatar-column {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #createView .media-nav-btn,
html[data-theme="white"] body #createView .media-nav-btn:hover,
html[data-theme="white"] body #createView .media-nav-btn.active {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #68485c !important;
}

html[data-theme="white"] body #createView .media-nav-btn.active {
  border-bottom: 2px solid #e22788 !important;
  color: #b01668 !important;
}

html[data-theme="white"] body #userPersonaView .user-persona-page-panel,
html[data-theme="white"] body #userPersonaView .user-persona-edit-pane,
html[data-theme="white"] body #userPersonaView .user-persona-edit-grid,
html[data-theme="white"] body #userPersonaView .user-persona-hero,
html[data-theme="white"] body #userPersonaView .user-persona-avatar-editor {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #settingsView .persona-manager {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-inline: 0 !important;
}

html[data-theme="white"] body #conversationMemoryView .memory-panel {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Chat display preference controls. */
.bubble-message-preference-panel {
  display: grid;
  gap: 12px;
}

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

.bubble-style-choice-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
}

.bubble-style-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bubble-style-choice-card strong,
.bubble-style-choice-card small {
  display: block;
}

.bubble-style-choice-card small {
  margin-top: 4px;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.35;
}

.bubble-style-preview {
  height: 54px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 7px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
}

.bubble-style-preview i,
.bubble-style-preview b {
  display: block;
  width: 78%;
  height: 15px;
  border-radius: 10px;
  background: rgba(255,255,255,.16);
}

.bubble-style-preview b {
  justify-self: end;
  width: 62%;
  background: linear-gradient(135deg, #f32a8e, #b541d8);
}

.bubble-style-preview.pointed i { border-bottom-left-radius: 3px; }
.bubble-style-preview.pointed b { border-bottom-right-radius: 3px; }
.bubble-style-preview.rounded i,
.bubble-style-preview.rounded b { border-radius: 999px; }
.bubble-style-preview.soft-square i,
.bubble-style-preview.soft-square b { border-radius: 4px; }
.bubble-style-preview.tail i,
.bubble-style-preview.tail b { position: relative; border-radius: 10px; }
.bubble-style-preview.tail i::after,
.bubble-style-preview.tail b::after {
  content: '';
  position: absolute;
  bottom: -2px;
  width: 7px;
  height: 7px;
  background: inherit;
  transform: rotate(45deg);
}
.bubble-style-preview.tail i::after { left: 2px; }
.bubble-style-preview.tail b::after { right: 2px; }
.bubble-style-preview.capsule i,
.bubble-style-preview.capsule b {
  height: 12px;
  border-radius: 999px;
}

.bubble-style-choice-card.is-selected {
  border-color: #e3358d;
  box-shadow: 0 0 0 2px rgba(227,53,141,.12);
}

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

.chat-message-visibility-grid .form-row {
  margin: 0;
}

html[data-theme="white"] body .bubble-style-choice-card,
html[data-theme="white"] body .chat-message-visibility-grid .form-row {
  background: #fff5fa !important;
  border-color: #e4b8ce !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .bubble-style-choice-card strong,
html[data-theme="white"] body .bubble-style-choice-card small,
html[data-theme="white"] body .chat-message-visibility-grid .form-label,
html[data-theme="white"] body .chat-message-visibility-grid .setting-help {
  color: #604056 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .bubble-style-preview {
  background: #ffe9f3 !important;
}

html[data-theme="white"] body .bubble-style-preview i {
  background: #fff !important;
  border: 1px solid #dfb3c9;
}

html[data-bubble-message-theme="rounded"] body .msg.user .bubble,
html[data-bubble-message-theme="rounded"] body .msg.assistant .bubble,
body[data-bubble-message-theme="rounded"] .msg.user .bubble,
body[data-bubble-message-theme="rounded"] .msg.assistant .bubble {
  border-radius: 20px !important;
}

html[data-bubble-message-theme="soft-square"] body .msg.user .bubble,
html[data-bubble-message-theme="soft-square"] body .msg.assistant .bubble,
body[data-bubble-message-theme="soft-square"] .msg.user .bubble,
body[data-bubble-message-theme="soft-square"] .msg.assistant .bubble {
  border-radius: 10px !important;
}

html[data-bubble-message-theme="capsule"] body .msg.user .bubble,
html[data-bubble-message-theme="capsule"] body .msg.assistant .bubble,
body[data-bubble-message-theme="capsule"] .msg.user .bubble,
body[data-bubble-message-theme="capsule"] .msg.assistant .bubble {
  border-radius: 30px !important;
  padding-inline: 20px !important;
}

html[data-bubble-message-theme="tail"] body .msg.user .bubble,
html[data-bubble-message-theme="tail"] body .msg.assistant .bubble,
body[data-bubble-message-theme="tail"] .msg.user .bubble,
body[data-bubble-message-theme="tail"] .msg.assistant .bubble {
  position: relative;
  border-radius: 19px !important;
}

html[data-bubble-message-theme="tail"] body .msg.user .bubble::after,
html[data-bubble-message-theme="tail"] body .msg.assistant .bubble::after,
body[data-bubble-message-theme="tail"] .msg.user .bubble::after,
body[data-bubble-message-theme="tail"] .msg.assistant .bubble::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  pointer-events: none;
}

html[data-bubble-message-theme="tail"] body .msg.assistant .bubble::after,
body[data-bubble-message-theme="tail"] .msg.assistant .bubble::after {
  left: -6px;
  background: var(--bot-bubble-bg);
  border-bottom: 1px solid var(--bot-bubble-border);
  border-left: 1px solid var(--bot-bubble-border);
}

html[data-bubble-message-theme="tail"] body .msg.user .bubble::after,
body[data-bubble-message-theme="tail"] .msg.user .bubble::after {
  right: -6px;
  background: var(--chat-bubble-bg);
  border-right: 1px solid var(--chat-bubble-border);
  border-top: 1px solid var(--chat-bubble-border);
}

html[data-theme="white"][data-use-custom-bubble-colors-with-theme="false"] body .msg.assistant .bubble,
body[data-theme="white"][data-use-custom-bubble-colors-with-theme="false"] .msg.assistant .bubble {
  background: #fff !important;
  background-image: none !important;
  border-color: rgba(220, 35, 135, .24) !important;
  color: #2d1830 !important;
}

html[data-theme="white"][data-use-custom-bubble-colors-with-theme="false"] body .msg.user .bubble,
body[data-theme="white"][data-use-custom-bubble-colors-with-theme="false"] .msg.user .bubble {
  background: #f0edf1 !important;
  background-image: none !important;
  border-color: rgba(126, 91, 116, .18) !important;
  color: #2d1830 !important;
}

html[data-theme="white"][data-bubble-message-theme="tail"][data-use-custom-bubble-colors-with-theme="false"] body .msg.assistant .bubble::after,
body[data-theme="white"][data-bubble-message-theme="tail"][data-use-custom-bubble-colors-with-theme="false"] .msg.assistant .bubble::after {
  background: #fff !important;
  border-color: rgba(220, 35, 135, .24) !important;
}

html[data-theme="white"][data-bubble-message-theme="tail"][data-use-custom-bubble-colors-with-theme="false"] body .msg.user .bubble::after,
body[data-theme="white"][data-bubble-message-theme="tail"][data-use-custom-bubble-colors-with-theme="false"] .msg.user .bubble::after {
  background: #f0edf1 !important;
  border-color: rgba(126, 91, 116, .18) !important;
}

html[data-show-bot-message-avatars="false"] body .msg.assistant > .msg-avatar,
body[data-show-bot-message-avatars="false"] .msg.assistant > .msg-avatar,
html[data-show-user-message-avatars="false"] body .msg.user > .msg-avatar,
body[data-show-user-message-avatars="false"] .msg.user > .msg-avatar {
  display: none !important;
}

html[data-show-bot-message-names="false"] body .msg.assistant .msg-meta,
body[data-show-bot-message-names="false"] .msg.assistant .msg-meta,
html[data-show-user-message-names="false"] body .msg.user .msg-meta,
body[data-show-user-message-names="false"] .msg.user .msg-meta {
  display: none !important;
}

@media (max-width: 720px) {
  .bubble-style-choice-grid,
  .chat-message-visibility-grid {
    grid-template-columns: 1fr;
  }
}

/* Discovery Today copy. */
html[data-theme="white"] body #homeView .today-chayt-title,
html[data-theme="white"] body #homeView .today-chayt-subtitle {
  color: #5a344d !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="white"] body #homeView .today-chayt-title {
  color: #a81768 !important;
}

/* Model slugs, ratings, and stars. */
html[data-theme="white"] body #aimodelratingView .ai-model-card-id,
html[data-theme="white"] body #aimodelratingView .ai-model-card-score,
html[data-theme="white"] body #aimodelratingView .ai-model-card-score span,
html[data-theme="white"] body #aimodelratingView .memory-model-help,
html[data-theme="white"] body #aimodelratingView #aiModelRatingDetailCount {
  color: #76566b !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #aimodelratingView .ai-model-card-score strong,
html[data-theme="white"] body #aimodelratingView .ai-model-rating-hero-score strong,
html[data-theme="white"] body #aimodelratingView .ai-model-star,
html[data-theme="white"] body #aimodelratingView .ai-model-star-svg,
html[data-theme="white"] body #aimodelratingView .ai-model-star-svg * {
  color: #e42688 !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

html[data-theme="white"] body #aimodelratingView .ai-model-card-mark {
  background: #ffe7f2 !important;
  border-color: #e3a9c6 !important;
  color: #e42688 !important;
}

/* Crop dialog. */
html[data-theme="white"] body .avatar-crop-modal {
  background: rgba(105, 28, 76, .32) !important;
}

html[data-theme="white"] body .avatar-crop-card {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  border-color: #dfa8c3 !important;
  color: #321a2c !important;
}

html[data-theme="white"] body .avatar-crop-title,
html[data-theme="white"] body .avatar-crop-subtitle,
html[data-theme="white"] body .avatar-crop-preview-label,
html[data-theme="white"] body .avatar-crop-slider-row label {
  color: #5d3950 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .avatar-crop-head .icon-btn,
html[data-theme="white"] body .avatar-crop-actions .mini-btn {
  background: #fff !important;
  border-color: #ddb1c7 !important;
  color: #6b3f59 !important;
}

html[data-theme="white"] body .avatar-crop-actions .btn-save {
  background: linear-gradient(135deg, #f62f91, #c52db0) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Energy actions and referrals. */
html[data-theme="white"] body #dailyCreditsBtn,
html[data-theme="white"] body #referralRedeemBtn {
  background: linear-gradient(135deg, #f62f91, #c52db0) !important;
  border-color: transparent !important;
  color: #fff !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #creditsView .credits-referral-badge,
html[data-theme="white"] body #creditsView .credits-support-goal-pill {
  background: #ffe5f0 !important;
  border-color: #e1a6c2 !important;
  color: #b01668 !important;
}

html[data-theme="white"] body #creditsView .credits-referral-code,
html[data-theme="white"] body #creditsView .credits-redeem-row input,
html[data-theme="white"] body #creditsView .credits-referral-actions .mini-btn {
  background: #fff4f9 !important;
  border-color: #dfb1c7 !important;
  color: #513247 !important;
  -webkit-text-fill-color: #513247 !important;
}

html[data-theme="white"] body #creditsView .credits-referral-card,
html[data-theme="white"] body #creditsView .credits-invite-panel {
  background: #fff7fb !important;
  border-color: #e5bbd0 !important;
}

/* Public reviews and comments. */
html[data-theme="white"] body #botDetailView .review-list,
html[data-theme="white"] body #botDetailView .review-item,
html[data-theme="white"] body #botDetailView .review-item *,
html[data-theme="white"] body #botDetailView .review-reply,
html[data-theme="white"] body #botDetailView .review-reply *,
html[data-theme="white"] body #aimodelratingView .ai-model-comment,
html[data-theme="white"] body #aimodelratingView .ai-model-comment * {
  color: #54364a !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #botDetailView .review-vote,
html[data-theme="white"] body #botDetailView .review-reply-like,
html[data-theme="white"] body #botDetailView .review-reply-reaction-btn {
  background: #ffeaf4 !important;
  border-color: #e2afc8 !important;
  color: #a81768 !important;
}

/* Desktop White + Pink completion: overlay views must not fall back to dark shells. */
@media (min-width: 961px) {
  html[data-theme="white"] body.settings-overlay-open #settingsView.active,
  html[data-theme="white"] body.chat-overlay-open #historyView.active,
  html[data-theme="white"] body.chat-overlay-open #chatStyleView.active,
  html[data-theme="white"] body.chat-overlay-open #userPersonaView.active,
  html[data-theme="white"] body.chat-overlay-open #conversationMemoryView.active {
    background: rgba(112, 31, 81, .24) !important;
    color: #321a2c !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }

  html[data-theme="white"] body.settings-overlay-open #settingsView > .create-topbar,
  html[data-theme="white"] body.chat-overlay-open #historyView > .history-topbar,
  html[data-theme="white"] body.chat-overlay-open #chatStyleView > .history-topbar,
  html[data-theme="white"] body.chat-overlay-open #userPersonaView > .history-topbar,
  html[data-theme="white"] body.chat-overlay-open #conversationMemoryView > .history-topbar {
    background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #b23fd2 100%) !important;
    background-color: #e82391 !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 22px 65px rgba(124, 25, 86, .22) !important;
  }

  html[data-theme="white"] body.settings-overlay-open #settingsView > .create-topbar .create-title,
  html[data-theme="white"] body.settings-overlay-open #settingsView > .create-topbar .icon-btn,
  html[data-theme="white"] body.chat-overlay-open .history-topbar .history-title,
  html[data-theme="white"] body.chat-overlay-open .history-topbar .history-subtitle,
  html[data-theme="white"] body.chat-overlay-open .history-topbar .icon-btn {
    color: #fff !important;
  }

  html[data-theme="white"] body.settings-overlay-open #settingsView > .create-body,
  html[data-theme="white"] body.chat-overlay-open #historyView > .history-body,
  html[data-theme="white"] body.chat-overlay-open #chatStyleView > .history-body,
  html[data-theme="white"] body.chat-overlay-open #userPersonaView > .history-body,
  html[data-theme="white"] body.chat-overlay-open #conversationMemoryView > .history-body {
    background: linear-gradient(155deg, #fff 0%, #fff7fb 62%, #ffedf6 100%) !important;
    background-color: #fff8fc !important;
    border-color: #e5bfd2 !important;
    color: #321a2c !important;
    box-shadow: 0 24px 70px rgba(105, 27, 75, .18) !important;
  }

  html[data-theme="white"] body.settings-overlay-open #settingsView .panel {
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    color: #321a2c !important;
  }

  /* Search results use the dark theme's flat list rhythm on desktop. */
  html[data-theme="white"] body .discovery-search-results {
    gap: 0 !important;
  }

  html[data-theme="white"] body .discovery-search-result-card,
  html[data-theme="white"] body .discovery-search-result-card:hover,
  html[data-theme="white"] body .discovery-search-result-card.discovery-search-simple-card {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-bottom: 1px solid #e8c8d8 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html[data-theme="white"] body .discovery-search-result-card .bot-card-media,
  html[data-theme="white"] body .discovery-search-simple-image {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Chat menu and every action sheet share one white/pink surface on all breakpoints. */
html[data-theme="white"] body #chatView .chat-menu,
html[data-theme="white"] body .chat-menu {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  background-color: #fff6fa !important;
  border-color: #e4b6cc !important;
  color: #321a2c !important;
  box-shadow: 0 22px 56px rgba(93, 24, 65, .22) !important;
}

html[data-theme="white"] body #chatView .chat-menu button,
html[data-theme="white"] body #chatView .chat-menu button::after,
html[data-theme="white"] body .chat-menu button,
html[data-theme="white"] body .chat-menu button::after {
  background-color: transparent !important;
  border-color: #efd5e2 !important;
  color: #5d354d !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #chatView .chat-menu button:hover {
  background: #ffe5f1 !important;
  color: #a81768 !important;
}

html[data-theme="white"] body #chatView .chat-menu .chat-menu-new-btn,
html[data-theme="white"] body #chatView .chat-menu .chat-menu-new-btn span {
  background: linear-gradient(112deg, #ff358d, #e82391 58%, #b23fd2) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-chat"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-user"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-bot"] {
  background: #fff1f4 !important;
  border-color: #efbdc8 !important;
  color: #c82a4b !important;
}

html[data-theme="white"] body .message-modal,
html[data-theme="white"] body .archive-modal,
html[data-theme="white"] body .brand-confirm-modal,
html[data-theme="white"] body .chat-start-choice-modal,
html[data-theme="white"] body .chayt-plus-upsell-modal,
html[data-theme="white"] body .chayt-plus-launch-modal {
  background: rgba(103, 28, 75, .30) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

html[data-theme="white"] body .message-modal-card,
html[data-theme="white"] body .archive-modal-card,
html[data-theme="white"] body .brand-confirm-card,
html[data-theme="white"] body .chat-start-choice-card,
html[data-theme="white"] body .chayt-plus-upsell-card,
html[data-theme="white"] body .chayt-plus-launch-card,
html[data-theme="white"] body .bot-rating-card {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  background-color: #fff6fa !important;
  border-color: #e2aec8 !important;
  color: #321a2c !important;
  box-shadow: 0 24px 68px rgba(97, 25, 68, .22) !important;
}

html[data-theme="white"] body .message-modal-title,
html[data-theme="white"] body .archive-modal-title,
html[data-theme="white"] body .archive-modal-subtitle,
html[data-theme="white"] body .brand-confirm-title,
html[data-theme="white"] body .brand-confirm-copy,
html[data-theme="white"] body .chat-start-choice-title,
html[data-theme="white"] body .chat-start-choice-copy,
html[data-theme="white"] body .chayt-plus-upsell-title,
html[data-theme="white"] body .chayt-plus-upsell-card .credit-modal-copy,
html[data-theme="white"] body .chayt-plus-launch-card h2,
html[data-theme="white"] body .chayt-plus-launch-brand p,
html[data-theme="white"] body .chayt-plus-launch-fineprint {
  color: #533247 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #messageEditorInput,
html[data-theme="white"] body .archive-modal-body,
html[data-theme="white"] body .chat-start-choice-preview,
html[data-theme="white"] body .chat-start-choice-btn,
html[data-theme="white"] body .report-reason-option,
html[data-theme="white"] body .report-modal-textarea,
html[data-theme="white"] body .chayt-plus-upsell-balance div,
html[data-theme="white"] body .chayt-plus-upsell-benefits span,
html[data-theme="white"] body .chayt-plus-launch-plan,
html[data-theme="white"] body .chayt-plus-launch-benefits,
html[data-theme="white"] body .chayt-plus-launch-benefit-row {
  background: #fff !important;
  border-color: #e4bfd1 !important;
  color: #4d2d41 !important;
}

html[data-theme="white"] body .chayt-plus-upsell-kicker,
html[data-theme="white"] body .chayt-plus-launch-logo,
html[data-theme="white"] body .chayt-plus-launch-logo span,
html[data-theme="white"] body .chayt-plus-upsell-balance strong {
  color: #d91d80 !important;
}

html[data-theme="white"] body .chayt-plus-upsell-benefits strong,
html[data-theme="white"] body .chayt-plus-upsell-benefits small,
html[data-theme="white"] body .chayt-plus-upsell-balance span,
html[data-theme="white"] body .chayt-plus-launch-plan-name,
html[data-theme="white"] body .chayt-plus-launch-plan-subtitle,
html[data-theme="white"] body .chayt-plus-launch-plan-price,
html[data-theme="white"] body .chayt-plus-launch-plan-price small,
html[data-theme="white"] body .chayt-plus-launch-energy-note strong,
html[data-theme="white"] body .chayt-plus-launch-energy-note small,
html[data-theme="white"] body .chayt-plus-launch-benefit-name,
html[data-theme="white"] body .chayt-plus-launch-benefit-row.header {
  color: #553348 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .chayt-plus-launch-plan.selected {
  background: #ffe5f1 !important;
  border-color: #d889b0 !important;
  box-shadow: inset 0 0 0 1px rgba(214, 32, 123, .16) !important;
}

html[data-theme="white"] body .chayt-plus-upsell-actions .mini-btn,
html[data-theme="white"] body .chayt-plus-launch-checkout .google-play-billing-btn,
html[data-theme="white"] body #chaytPlusView .google-play-billing-btn,
html[data-theme="white"] body #creditsView .google-play-billing-btn,
html[data-theme="white"] body .google-play-billing-btn {
  background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #b23fd2 100%) !important;
  background-color: #e82391 !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(193, 31, 122, .18) !important;
}

html[data-theme="white"] body .google-play-billing-btn *,
html[data-theme="white"] body .google-play-billing-btn strong,
html[data-theme="white"] body .google-play-billing-btn small {
  color: #fff !important;
  opacity: 1 !important;
}

/* Energy CTAs all use the same pink action language as Claim +60. */
html[data-theme="white"] body #creditsRewardedAdBtn,
html[data-theme="white"] body #outOfCreditsRewardAdBtn,
html[data-theme="white"] body #chaytPlusUpsellRewardAd,
html[data-theme="white"] body #creditsChaytPlusDetailsBtn,
html[data-theme="white"] body #creditsSupportBuyBtn,
html[data-theme="white"] body #creditsSupportPlusBtn,
html[data-theme="white"] body .credits-buy-panel .mini-btn,
html[data-theme="white"] body .credits-buy-panel .btn-save {
  background: linear-gradient(112deg, #ff358d 0%, #e82391 58%, #b23fd2 100%) !important;
  background-color: #e82391 !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(193, 31, 122, .18) !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #creditsView .credits-rewarded-ad-panel,
html[data-theme="white"] body #creditsView .chayt-plus-credit-panel,
html[data-theme="white"] body #creditsView .credits-buy-panel,
html[data-theme="white"] body #creditsView .credit-pack-card {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  border-color: #e3b6cc !important;
  color: #321a2c !important;
  box-shadow: none !important;
}

html[data-theme="white"] body #creditsView .credits-rewarded-ad-panel .section-title,
html[data-theme="white"] body #creditsView .chayt-plus-credit-panel .section-title,
html[data-theme="white"] body #creditsView .credit-pack-title,
html[data-theme="white"] body #creditsView .credit-pack-copy,
html[data-theme="white"] body #creditsView .chayt-plus-plan-title,
html[data-theme="white"] body #creditsView .chayt-plus-plan-copy,
html[data-theme="white"] body #creditsView .chayt-plus-plan-price,
html[data-theme="white"] body #creditsView .chayt-plus-plan-period {
  color: #533247 !important;
  opacity: 1 !important;
}

/* Today keeps pink cards, but the section/rail itself stays flat like the original theme. */
html[data-theme="white"] body #homeView .today-with-chayt,
html[data-theme="white"] body #homeView .today-chayt-rail {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* The rating prompt is app-owned so it can follow both themes instead of browser chrome. */
.bot-rating-stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.bot-rating-star {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: #ffd447;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.bot-rating-star:hover,
.bot-rating-star:focus-visible {
  transform: translateY(-1px);
  border-color: currentColor;
  outline: none;
}

html[data-theme="white"] body .bot-rating-star {
  background: #fff !important;
  border-color: #dfabc4 !important;
  color: #e52587 !important;
}

html[data-theme="white"] body .bot-rating-star:hover,
html[data-theme="white"] body .bot-rating-star:focus-visible {
  background: #ffe5f1 !important;
}

/* Flat white-theme rows: remove decorative card wrappers that add no hierarchy. */
html[data-theme="white"] body #recentChatsView .recent-chats-panel,
html[data-theme="white"] body #recentChatsView .recent-chats-list,
html[data-theme="white"] body #recentChatsView .recent-chat-card,
html[data-theme="white"] body #recentChatsView .recent-chat-card:hover,
html[data-theme="white"] body #recentChatsView .recent-chat-card:active,
html[data-theme="white"] body #recentChatsView .recent-chat-card:focus:not(:focus-visible) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="white"] body #recentChatsView .recent-chat-card {
  padding-inline: 0 !important;
}

html[data-theme="white"] body #recentChatsView .recent-chats-selection-bar {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-inline: 0 !important;
}

html[data-theme="white"] body .chat-message-visibility-grid {
  gap: 0 !important;
}

html[data-theme="white"] body .chat-message-visibility-grid .form-row {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-bottom: 1px solid #efd6e2 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 0 !important;
}

html[data-theme="white"] body .chat-message-visibility-grid .form-row:nth-last-child(-n + 2) {
  border-bottom-color: transparent !important;
}

@media (max-width: 720px) {
  html[data-theme="white"] body .chat-message-visibility-grid .form-row:nth-last-child(2) {
    border-bottom-color: #efd6e2 !important;
  }
}

/* Destructive chat actions are plain menu rows, not nested cards. */
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-chat"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-user"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-bot"],
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-chat"]:hover,
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-user"]:hover,
html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-bot"]:hover {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #b52b51 !important;
}

html[data-theme="white"] body #chatView .chat-menu button[data-action="delete-chat"] {
  border-top: 1px solid #e7b9cf !important;
  margin-top: 8px !important;
  padding-top: 18px !important;
}

/* Dynamically injected delete confirmations: force the light surface by id. */
html[data-theme="white"] body #brandConfirmModal.brand-confirm-modal {
  background: rgba(102, 28, 74, .30) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

html[data-theme="white"] body #brandConfirmModal .brand-confirm-card {
  background: linear-gradient(155deg, #fff 0%, #fff0f7 100%) !important;
  background-color: #fff7fb !important;
  border: 1px solid #dfa9c2 !important;
  color: #321a2c !important;
  box-shadow: 0 24px 68px rgba(94, 24, 65, .22) !important;
}

html[data-theme="white"] body #brandConfirmModal .brand-confirm-title,
html[data-theme="white"] body #brandConfirmModal .brand-confirm-copy {
  color: #543247 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #brandConfirmModal .brand-confirm-actions {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

html[data-theme="white"] body #brandConfirmModal #brandConfirmAccept {
  background: linear-gradient(112deg, #f33a79, #e12573 58%, #bf397f) !important;
  border-color: transparent !important;
  color: #fff !important;
}

html[data-theme="white"] body #brandConfirmModal #brandConfirmCancel {
  background: #fff !important;
  border-color: #dfb4c8 !important;
  color: #684158 !important;
}

/* Chai-inspired public card stats: separate star and chat counts, never image pills. */
#homeView .bot-card-chat-count {
  display: none !important;
}

#homeView .bot-card-public-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
}

#homeView .bot-card-public-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

#homeView .bot-card-public-stat svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

#homeView .bot-card-public-stat.is-review svg {
  color: #ffcf43;
  fill: currentColor;
}

#homeView .bot-card-public-stat.is-chat svg {
  color: #ef8fba;
  fill: currentColor;
}

html[data-theme="white"] body #homeView .bot-card-public-stat,
html[data-theme="white"] body #homeView .bot-card-public-stat strong {
  color: #4f3245 !important;
}

html[data-theme="white"] body #homeView .bot-card-public-stat.is-review svg {
  color: #f6c934 !important;
}

html[data-theme="white"] body #homeView .bot-card-public-stat.is-chat svg {
  color: #e98ab5 !important;
}

/* Public discovery cards: the stats are a flat row above the character name. */
#homeView .bot-card .bot-card-meta {
  display: flex !important;
  align-items: center !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#homeView .bot-card .bot-card-meta-text {
  display: block !important;
  width: 100% !important;
}

#homeView .bot-card .bot-card-public-stats {
  gap: 18px !important;
}

#homeView .bot-card .bot-card-public-stat {
  gap: 7px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
}

#homeView .bot-card .bot-card-public-stat svg {
  width: 21px !important;
  height: 21px !important;
  filter: drop-shadow(0 1px 1px rgba(74, 26, 56, .12));
}

#homeView .bot-card .bot-card-public-stat strong {
  font-size: 14px !important;
  font-weight: 900 !important;
  color: inherit !important;
}

html[data-theme="white"] body #homeView .bot-card-public-stat.is-review svg {
  color: #d89d00 !important;
}

html[data-theme="white"] body #homeView .bot-card-public-stat.is-chat svg {
  color: #d51a79 !important;
}

/* Never darken public discovery artwork. Transparent/logo-only assets should
   sit directly on the theme surface in every feed. */
#homeView .bot-card .bot-card-overlay,
#featuredGrid .bot-card .bot-card-overlay {
  display: none !important;
  background: none !important;
  opacity: 0 !important;
}

html[data-theme="white"] body #homeView .bot-card-media,
html[data-theme="white"] body #featuredGrid .bot-card-media {
  background: #fff1f7 !important;
  background-image: none !important;
}

/* Keep Chayt+ dialogs below native banner ads and make their exits obvious. */
.chayt-plus-launch-close,
.chayt-plus-upsell-close {
  z-index: 30 !important;
}

/* The startup launch panel shares the screen with the APK banner. Its whole
   viewport begins below that native overlay, even while the banner height is
   updated asynchronously after boot. */
.chayt-plus-launch-modal {
  top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  bottom: 0 !important;
  height: auto !important;
  padding-top: 12px !important;
}

.chayt-plus-launch-card {
  max-height: calc(100dvh - var(--native-ad-banner-height, 0px) - env(safe-area-inset-top, 0px) - 24px) !important;
}

.chayt-plus-launch-close {
  width: 46px !important;
  height: 46px !important;
  top: 10px !important;
  right: 10px !important;
  touch-action: manipulation;
}

body.native-ad-banner-visible .chayt-plus-launch-modal,
body.capacitor-app.native-ad-banner-visible .chayt-plus-launch-modal,
body.native-ad-banner-visible .chayt-plus-upsell-modal,
body.capacitor-app.native-ad-banner-visible .chayt-plus-upsell-modal {
  top: calc(var(--native-ad-banner-height, 0px) + env(safe-area-inset-top, 0px)) !important;
  bottom: 0 !important;
  height: auto !important;
  padding-top: 12px !important;
}

html[data-theme="white"] body .chayt-plus-launch-close,
html[data-theme="white"] body .chayt-plus-upsell-close {
  border-color: #e9a9c8 !important;
  background: #fff !important;
  color: #d91c83 !important;
  box-shadow: 0 7px 20px rgba(166, 35, 111, .18) !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .chayt-plus-launch-close:hover,
html[data-theme="white"] body .chayt-plus-launch-close:focus-visible,
html[data-theme="white"] body .chayt-plus-upsell-close:hover,
html[data-theme="white"] body .chayt-plus-upsell-close:focus-visible {
  border-color: #d91c83 !important;
  background: #ffe6f2 !important;
  color: #b70e69 !important;
}

/* High-contrast type inside the APK startup Chayt+ panel. */
html[data-theme="white"] body .chayt-plus-launch-card,
html[data-theme="white"] body .chayt-plus-launch-card h2,
html[data-theme="white"] body .chayt-plus-launch-brand p,
html[data-theme="white"] body .chayt-plus-launch-plan-name,
html[data-theme="white"] body .chayt-plus-launch-plan-subtitle,
html[data-theme="white"] body .chayt-plus-launch-plan-price,
html[data-theme="white"] body .chayt-plus-launch-plan-price strong,
html[data-theme="white"] body .chayt-plus-launch-plan-price small,
html[data-theme="white"] body .chayt-plus-launch-energy-note strong,
html[data-theme="white"] body .chayt-plus-launch-energy-note small,
html[data-theme="white"] body .chayt-plus-launch-benefit-row,
html[data-theme="white"] body .chayt-plus-launch-benefit-row > span,
html[data-theme="white"] body .chayt-plus-launch-benefit-name,
html[data-theme="white"] body .chayt-plus-launch-benefit-empty,
html[data-theme="white"] body .chayt-plus-launch-fineprint {
  color: #3b2133 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="white"] body .chayt-plus-launch-card h2,
html[data-theme="white"] body .chayt-plus-launch-plan-name,
html[data-theme="white"] body .chayt-plus-launch-plan-price strong,
html[data-theme="white"] body .chayt-plus-launch-energy-note strong,
html[data-theme="white"] body .chayt-plus-launch-benefit-name {
  font-weight: 900 !important;
}

html[data-theme="white"] body .chayt-plus-launch-old-price {
  color: #765569 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .chayt-plus-launch-energy-note {
  border-color: #e8bdd2 !important;
}

html[data-theme="white"] body .chayt-plus-launch-energy-note > span {
  color: #b80f6a !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .chayt-plus-launch-benefit-row.header {
  background: #ffe8f3 !important;
  color: #6b354f !important;
  font-weight: 950 !important;
}

html[data-theme="white"] body .chayt-plus-launch-compare-icon.included {
  background: #ffe5f1 !important;
  color: #c31370 !important;
}

html[data-theme="white"] body .chayt-plus-launch-compare-icon.missing {
  background: #f4e9ef !important;
  color: #78596b !important;
}

/* The full Chayt+ page uses the same readable ink palette. */
html[data-theme="white"] body #chaytPlusView .chayt-plus-page,
html[data-theme="white"] body #chaytPlusView .chayt-plus-page p,
html[data-theme="white"] body #chaytPlusView .chayt-plus-status,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-copy,
html[data-theme="white"] body #chaytPlusView .chayt-plus-plan-period,
html[data-theme="white"] body #chaytPlusView .review-user-copy,
html[data-theme="white"] body #chaytPlusView .review-user-copy span,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-row,
html[data-theme="white"] body #chaytPlusView .chayt-plus-launch-benefit-row > span {
  color: #3b2133 !important;
  opacity: 1 !important;
}

/* Chayt+ model entitlements in Chat Style, Conversation Memory, and pickers. */
.model-help-badge.badge-plus,
.chat-style-plus-badge,
.model-help-badge.badge-new,
.chat-style-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(245, 73, 164, .5);
  border-radius: 999px;
  background: rgba(245, 73, 164, .14);
  color: #ff9dce;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.model-help-badge.badge-new,
.chat-style-new-badge {
  border-color: rgba(75, 222, 176, .5);
  background: rgba(75, 222, 176, .13);
  color: #8cf2d2;
}

.chat-style-model-title {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-style-model-title-copy {
  min-width: 0;
  flex: 1 1 120px;
  overflow-wrap: anywhere;
}

.chat-style-model-title-badges {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  margin-inline-start: 8px;
}

.chat-style-model-card.chayt-plus-locked,
.model-picker-option.chayt-plus-only {
  border-color: rgba(245, 73, 164, .38);
}

.chat-style-model-card.chayt-plus-locked .chat-style-energy-note {
  color: #ff9dce;
  font-weight: 900;
}

html[data-theme="white"] body .model-help-badge.badge-plus,
html[data-theme="white"] body .chat-style-plus-badge {
  border-color: #df8bb6 !important;
  background: #ffe4f1 !important;
  color: #a80f61 !important;
}

html[data-theme="white"] body .model-help-badge.badge-new,
html[data-theme="white"] body .chat-style-new-badge {
  border-color: #8bcfb9 !important;
  background: #e8fff7 !important;
  color: #176b54 !important;
}

html[data-theme="white"] body #chatStyleView .chat-style-model-includes,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-includes {
  color: #654057 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body #chatStyleView .chat-style-model-includes span,
html[data-theme="white"] body #conversationMemoryView #conversationSummaryModelPicker .chat-style-model-includes span {
  color: #a61562 !important;
  opacity: 1 !important;
}

html[data-theme="white"] body .chat-style-model-card.chayt-plus-locked,
html[data-theme="white"] body .model-picker-option.chayt-plus-only {
  border-color: #df9cbd !important;
  background: #fff3f8 !important;
}

html[data-theme="white"] body .chat-style-model-card.chayt-plus-locked .chat-style-energy-note {
  color: #aa155f !important;
}

.composer-suggestion-limit-note {
  padding: 16px;
  border: 1px solid rgba(245, 73, 164, .36);
  border-radius: 14px;
  background: rgba(245, 73, 164, .1);
  color: var(--text);
  font-weight: 750;
  line-height: 1.5;
}

html[data-theme="white"] body .composer-suggestion-limit-note {
  border-color: #dfa6c2 !important;
  background: #fff0f7 !important;
  color: #4b293d !important;
}

/* Desktop discovery is flat: no gradient masthead or tab-group wrapper. */
@media (min-width: 961px) {
  html[data-theme="white"] body #homeView .mobile-home-topbar,
  html[data-theme="white"] body #homeView .mobile-home-copy,
  html[data-theme="white"] body #homeView .discovery-tabs {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html[data-theme="white"] body #homeView .mobile-home-copy h1 {
    color: #d91c83 !important;
    background: none !important;
    -webkit-text-fill-color: #d91c83 !important;
    text-shadow: none !important;
  }

  html[data-theme="white"] body #homeView .discovery-tab,
  html[data-theme="white"] body #homeView .discovery-tab:hover,
  html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"],
  html[data-theme="white"] body #homeView .discovery-tab.active {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html[data-theme="white"] body #homeView .discovery-tab.active,
  html[data-theme="white"] body #homeView .discovery-tab.active *,
  html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"],
  html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"] * {
    color: #d91c83 !important;
    -webkit-text-fill-color: #d91c83 !important;
  }

  html[data-theme="white"] body #homeView .discovery-tab.active::after,
  html[data-theme="white"] body #homeView .discovery-tab[aria-selected="true"]::after,
  html[data-theme="white"] body #homeView .discovery-tab-indicator {
    background: #d91c83 !important;
    background-image: none !important;
    box-shadow: none !important;
  }
}

