:root {
  --bg: #08070d;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f8f3ff;
  --muted: rgba(248, 243, 255, 0.62);
  --soft: rgba(248, 243, 255, 0.08);
  --accent: #ff4bb8;
  --accent-soft: rgba(255, 75, 184, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --mono: "Space Mono", monospace;
  --serif: "Noto Serif Thai", serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--serif);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 60, 176, 0.34), transparent 31%),
    radial-gradient(circle at 72% 14%, rgba(83, 101, 255, 0.28), transparent 35%),
    radial-gradient(circle at 74% 84%, rgba(255, 116, 48, 0.22), transparent 28%),
    radial-gradient(circle at 38% 72%, rgba(32, 214, 255, 0.13), transparent 30%),
    #08070d;
}

.mesh-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 88%);
}

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

.app-shell.active {
  display: grid;
}

.app-sidebar {
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: rgba(7, 5, 12, 0.76);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: sidebarIn 0.55s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  padding: 2px 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  background: linear-gradient(145deg, #ff4bb8, #8d5cff);
  box-shadow: 0 14px 34px rgba(255, 75, 184, 0.24);
}

.brand strong {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
}

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

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

.nav-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  font-weight: 700;
  text-align: left;
}

.nav-btn span {
  width: 18px;
  font-family: var(--mono);
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.09);
}

.recent-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  overflow: hidden;
}

.recent-panel h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font: 700 11px var(--mono);
  text-transform: uppercase;
}

.recent-list,
.thread-list {
  display: grid;
  gap: 10px;
}

.recent-item,
.thread-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.recent-item:hover,
.thread-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mini-avatar,
.thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.mini-avatar img,
.thread-avatar img,
.chat-avatar img,
.side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-item strong,
.thread-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item small,
.thread-card small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-area {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 54px 30px 80px;
}

.view-panel {
  display: none;
  max-width: 1180px;
  animation: pageIn 0.42s ease both;
}

.view-panel.active {
  display: block;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 28px;
  align-items: end;
  margin-bottom: 26px;
}

.page-header p,
.section-head p {
  margin: 0;
  color: #ff83ce;
  font: 700 12px var(--mono);
}

.page-header h1,
.section-head h2 {
  margin: 0;
  font-family: var(--mono);
  letter-spacing: 0;
}

.page-header h1 {
  font-size: clamp(36px, 5vw, 62px);
  grid-column: 1;
}

.page-header span {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.65;
}

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

.search-box {
  flex: 1 1 360px;
  max-width: 520px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  box-shadow: var(--shadow);
}

.search-box span {
  color: #4bb4ff;
  font: 700 12px var(--mono);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder,
textarea::placeholder {
  color: rgba(248, 243, 255, 0.42);
}

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

.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 15px;
  font-weight: 700;
}

.chip.active,
.chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 70%, white 12%);
  background: var(--accent-soft);
}

.tag-filters {
  margin-bottom: 22px;
}

.bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 28px;
  align-items: start;
  perspective: 1100px;
}

.bot-card {
  min-width: 0;
  animation: cardIn 0.52s ease both, cardIdle 4.8s ease-in-out infinite;
  animation-delay: calc(var(--card-i, 0) * 48ms), calc(var(--card-i, 0) * -380ms);
  transform-style: preserve-3d;
  position: relative;
}

.delete-bot {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--text);
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(14px);
  font: 700 18px var(--mono);
  display: grid;
  place-items: center;
  transition: transform 0.16s ease, background 0.16s ease;
}

.delete-bot:hover {
  transform: scale(1.07);
  background: rgba(255, 59, 92, 0.72);
}

.bot-card-button {
  width: 100%;
  min-height: 390px;
  border: 0;
  border-radius: 18px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(240px, 1fr) auto;
  text-align: left;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.bot-card-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 20%), rgba(255, 255, 255, 0.24), transparent 24%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bot-card:hover .bot-card-button::after {
  opacity: 1;
}

.bot-card:hover .bot-card-button,
.bot-card.is-opening .bot-card-button {
  box-shadow: 0 30px 85px rgba(0, 0, 0, 0.48), 0 0 34px var(--accent-soft);
}

.bot-card.is-opening .bot-card-button {
  transform: scale(0.97) rotateX(5deg);
}

.card-art {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 18%, var(--accent-soft), transparent 45%),
    rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.bot-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: auto;
  filter: saturate(1.08) contrast(1.04);
}

.bot-emoji {
  width: 118px;
  height: 118px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  font: 700 42px var(--mono);
  background: var(--accent-soft);
  border: 1px solid var(--line);
}

.msg-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
  padding: 5px 9px;
  font: 700 11px var(--mono);
}

.custom-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 36%, rgba(0, 0, 0, 0.48));
  border: 1px solid color-mix(in srgb, var(--accent) 50%, white 12%);
  backdrop-filter: blur(12px);
  padding: 5px 9px;
  font: 700 11px var(--mono);
}

.card-body {
  padding: 13px 14px 16px;
  background: rgba(10, 8, 16, 0.78);
}

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

.tag-row span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(248, 243, 255, 0.8);
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 8px;
  font: 700 10px var(--mono);
}

.card-body h3 {
  margin: 10px 0 2px;
  font-size: 22px;
  line-height: 1.15;
}

.role,
.desc,
.bio {
  color: var(--muted);
  line-height: 1.55;
}

.role {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.desc {
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
}

.empty-state,
.creator-panel,
.profile-grid,
.modal-box,
.chat-info,
.chat-panel,
.stat-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.empty-state {
  border-radius: 18px;
  padding: 26px;
  color: var(--muted);
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 42px;
}

.thread-card {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding: 14px;
}

.thread-avatar {
  width: 52px;
  height: 52px;
}

.thread-card em {
  color: var(--muted);
  font-style: normal;
  font: 700 12px var(--mono);
}

.creator-panel {
  border-radius: 20px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
}

.creator-panel h3 {
  margin-top: 0;
  font-size: 26px;
}

.creator-form,
.creator-guide {
  min-width: 0;
}

.form-head p,
.creator-guide p {
  color: var(--muted);
  line-height: 1.65;
}

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

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

.creator-form label {
  display: grid;
  gap: 7px;
}

.creator-form label span {
  color: var(--muted);
  font: 700 12px var(--mono);
}

.creator-form input,
.creator-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  padding: 12px 13px;
  resize: vertical;
}

.creator-form input[type="color"] {
  min-height: 44px;
  padding: 5px;
}

.creator-form input:focus,
.creator-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, white 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.creator-guide {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 55%),
    rgba(255, 255, 255, 0.055);
}

.guide-card {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  padding: 16px;
  display: grid;
  gap: 4px;
}

.guide-card span,
.guide-card small {
  color: var(--muted);
  font: 700 11px var(--mono);
}

.guide-card strong {
  font: 700 22px var(--mono);
}

.profile-grid {
  border-radius: 20px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  border-radius: 16px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  font: 700 34px var(--mono);
}

.stat-card span {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
}

.modal.active {
  display: grid;
}

.modal-box {
  width: min(880px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 24px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
  position: relative;
  animation: modalIn 0.28s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.modal-hero {
  min-height: 460px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 25%, var(--accent-soft), transparent 50%);
  overflow: hidden;
}

.modal-hero .bot-image {
  max-height: 560px;
}

.modal-copy {
  padding: 36px;
}

.modal-copy h2 {
  margin: 14px 0 4px;
  font-size: 40px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.detail-list div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-list dt {
  color: var(--muted);
  font: 700 11px var(--mono);
  text-transform: uppercase;
}

.detail-list dd {
  margin: 3px 0 0;
  line-height: 1.6;
}

.start-btn,
.chat-input button,
.comment-form button {
  border: 1px solid color-mix(in srgb, var(--accent) 54%, white 10%);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  padding: 12px 18px;
  font-weight: 800;
}

.start-btn:hover,
.chat-input button:hover,
.comment-form button:hover {
  background: color-mix(in srgb, var(--accent) 36%, transparent);
}

.page {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: none;
  background:
    radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30%),
    radial-gradient(circle at 78% 80%, rgba(65, 118, 255, 0.16), transparent 34%),
    rgba(8, 7, 13, 0.96);
  isolation: isolate;
}

.page.active {
  display: flex;
  flex-direction: column;
}

.chat-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.chat-ambient::before,
.chat-ambient::after {
  content: "";
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.34;
}

.chat-ambient::before {
  left: -14vw;
  top: -20vw;
  background: color-mix(in srgb, var(--accent) 58%, #ffffff 8%);
}

.chat-ambient::after {
  right: -18vw;
  bottom: -22vw;
  background: #3f7dff;
}

.chat-topbar {
  height: 82px;
  flex: 0 0 82px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(15, 12, 24, 0.82), rgba(10, 8, 16, 0.52));
  backdrop-filter: blur(28px) saturate(1.25);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 58%, white 8%);
  background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.1));
}

.chat-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 52%, white 14%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent), 0 16px 36px rgba(0, 0, 0, 0.28);
}

.chat-heading {
  min-width: 0;
  flex: 1;
}

.chat-topbar h2 {
  margin: 0;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #5dffb0;
  box-shadow: 0 0 0 5px rgba(93, 255, 176, 0.1), 0 0 18px rgba(93, 255, 176, 0.52);
}

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

.chat-main {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px;
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 28px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(8, 7, 13, 0.58);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
}

.chat-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 78%);
}

.messages {
  overflow: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  animation: messageIn 0.22s ease both;
}

.from-user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(680px, 78%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px 22px 22px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07));
  padding: 13px 16px;
  line-height: 1.6;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.from-user .message-bubble {
  border-radius: 22px 22px 8px 22px;
  border-color: color-mix(in srgb, var(--accent) 50%, white 8%);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 34%, rgba(255, 255, 255, 0.06)), color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.04)));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--accent) 18%, rgba(0, 0, 0, 0.32));
}

.typing .message-bubble {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  animation: dot 0.9s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing span:nth-child(3) {
  animation-delay: 0.24s;
}

.chat-input {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.16));
}

.chat-input input,
.comment-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  outline: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chat-input input:focus,
.comment-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, white 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.chat-input button {
  min-width: 76px;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 18%, rgba(0, 0, 0, 0.25));
}

.chat-info {
  min-height: 0;
  overflow: auto;
  border-radius: 28px;
  padding: 18px;
  animation: sidebarIn 0.45s ease both;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055)),
    rgba(8, 7, 13, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.side-avatar {
  height: 310px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 16%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font: 700 56px var(--mono);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 22px 55px rgba(0, 0, 0, 0.28);
}

.side-avatar img {
  object-fit: contain;
}

.chat-info h3 {
  margin: 18px 0 3px;
  font-size: 30px;
  line-height: 1.15;
}

.chat-info > p {
  margin: 0 0 14px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.comment-form textarea {
  resize: vertical;
  min-height: 88px;
  border-radius: 18px;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.comment-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  padding: 10px;
  line-height: 1.5;
}

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

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

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

@keyframes cardIdle {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sidebarIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dot {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.active {
    display: flex;
    flex-direction: column-reverse;
  }

  .app-sidebar {
    width: 100%;
    height: 74px;
    flex: 0 0 74px;
    padding: 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
  }

  .brand {
    display: none;
  }

  .side-nav {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .nav-btn {
    min-height: 56px;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
    flex-direction: column;
    gap: 3px;
  }

  .nav-btn span {
    width: auto;
  }

  .recent-panel {
    display: none;
  }

  .main-area {
    height: auto;
    flex: 1;
    padding: 26px 14px 34px;
  }

  .page-header {
    display: block;
  }

  .page-header h1 {
    font-size: 40px;
  }

  .page-header span {
    display: block;
    margin-top: 8px;
  }

  .toolbar {
    display: grid;
  }

  .search-box {
    max-width: none;
  }

  .bot-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 18px;
  }

  .bot-card-button {
    min-height: 350px;
    grid-template-rows: minmax(210px, 1fr) auto;
  }

  .modal-box,
  .creator-panel {
    grid-template-columns: 1fr;
  }

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

  .modal-hero {
    min-height: 320px;
  }

  .modal-copy {
    padding: 24px;
  }

  .chat-main {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .chat-info {
    display: none;
  }

  .message-bubble {
    max-width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
