/* ── Fonts ──────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&family=Outfit:wght@300;400;500;600&display=swap");

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg: #faf8f4;
  --paper: #ffffff;
  --ink: #1a1612;
  --ink-secondary: #3d352c;
  --muted: #94877a;
  --line: #ebe5dc;
  --accent: #fd9a26;
  --accent-soft: #fff4e6;
  --accent-hover: #e88a1a;
  --accent-glow: rgba(253, 154, 38, 0.15);
  --user-bg: #1e1a15;
  --bot-bg: #ffffff;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-xs: 0 1px 2px rgba(26, 22, 18, 0.04);
  --shadow-sm: 0 1px 4px rgba(26, 22, 18, 0.05),
    0 1px 2px rgba(26, 22, 18, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 22, 18, 0.06),
    0 2px 4px rgba(26, 22, 18, 0.03);
  --shadow-lg: 0 12px 40px rgba(26, 22, 18, 0.08);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Outfit", -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(
      ellipse at 15% -5%,
      rgba(253, 154, 38, 0.07) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 85% 105%,
      rgba(253, 154, 38, 0.04) 0%,
      transparent 40%
    ),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ── Shell (Primary · 66%) ─────────────────────────────── */
.shell {
  flex: 2;
  min-width: 0;
  margin: 20px 0 0 20px;
  height: calc(100vh - 20px);
  height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  padding: 0 24px 20px;
  border: 1px solid #dbdbdb;
  border-bottom: none;
  box-shadow: 0px 0px 14px #eeeeee;
  border-radius: 24px 24px 0 0;
  background: var(--paper);
}

/* ── Sidebar (Secondary · 33%) ─────────────────────────── */
.sidebar {
  flex: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.sidebar-section h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.sidebar-section p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.sidebar-section a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.sidebar-section a:hover {
  color: var(--accent-hover);
}

.sidebar-section:nth-child(1) { animation: fade-in 0.5s ease 0.1s both; }
.sidebar-section:nth-child(2) { animation: fade-in 0.5s ease 0.2s both; }
.sidebar-section:nth-child(3) { animation: fade-in 0.5s ease 0.3s both; }
.sidebar-section:nth-child(4) { animation: fade-in 0.5s ease 0.4s both; }

/* ── Bonus Credits ─────────────────────────────────────── */
.bonus-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.bonus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.bonus-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bonus-item-locked {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.bonus-item-muted {
  opacity: 0.7;
}

.bonus-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  letter-spacing: -0.01em;
  vertical-align: middle;
  margin-left: 4px;
}

.bonus-tag-lg {
  color: #fff;
  background: var(--accent);
}

.bonus-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.bonus-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-display);
}

.bonus-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.bonus-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.bonus-cta:hover {
  border-color: var(--ink);
  background: var(--bg);
  transform: translateY(-1px);
}

.bonus-cta:active {
  transform: scale(0.97);
}

.bonus-cta-done {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
  cursor: default;
}

.bonus-cta-done:hover {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
  transform: none;
}

.bonus-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.bonus-link:hover {
  text-decoration: underline;
}

/* ── Roadmap ───────────────────────────────────────────── */
.roadmap-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}

.roadmap-item:last-child {
  padding-bottom: 0;
}

/* Vertical connector line */
.roadmap-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.roadmap-item:last-child::before {
  display: none;
}

.roadmap-item.done::before {
  background: linear-gradient(to bottom, var(--accent), var(--line));
}

/* Marker circle */
.roadmap-marker {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 2px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.roadmap-item.done .roadmap-marker {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Body text */
.roadmap-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.roadmap-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-display);
}

.roadmap-item.done .roadmap-label {
  color: var(--accent);
}

.roadmap-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Header ────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.brand-icon:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-glow);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.handle {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  margin-top: 1px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.handle:hover {
  color: #1d9bf0;
}

/* ── Auth Actions ──────────────────────────────────────── */
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Hamburger Button (mobile only) ────────────────────── */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn:hover {
  border-color: var(--muted);
}

.menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.menu-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Mobile Overlay ────────────────────────────────────── */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.3);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Meta Section ──────────────────────────────────────── */
.meta {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  flex-shrink: 0;
}

/* ── Badge ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(253, 154, 38, 0.2);
}

/* ── Usage Bar ─────────────────────────────────────────── */
.usage-bar-wrap {
  flex: 0 1 100px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.usage-bar {
  height: 100%;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, var(--accent), #ffb84d);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Turnstile ─────────────────────────────────────────── */
.turnstile-wrap {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

/* ── Messages ──────────────────────────────────────────── */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 5px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ── Message Suggestions ───────────────────────────────── */
.message-suggestions {
  padding: 2px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-in 0.45s ease 0.12s both;
}

.message-suggestions[hidden] {
  display: none;
}

.message-suggestions-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}

.message-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-suggestion {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 18px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  max-width: 340px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease,
    box-shadow 0.2s ease;
}

.message-suggestion:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.message-suggestion:active {
  transform: translateY(1px);
}

/* ── Message Bubbles ───────────────────────────────────── */
.msg {
  max-width: 82%;
  padding: 10px 16px;
  border-radius: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14.5px;
}

.msg.user {
  align-self: flex-end;
  background: var(--user-bg);
  color: #f5f0eb;
  border-bottom-right-radius: 6px;
}

.msg.bot {
  align-self: flex-start;
  background: var(--paper);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-xs);
}

.msg-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(253, 154, 38, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.msg-link:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.msg-ticker {
  color: var(--accent);
  font-weight: 600;
}

.msg.user .msg-ticker {
  color: #ffb84d;
}

.msg-handle {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.msg-handle:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.msg.user .msg-handle {
  color: #ffb84d;
}

/* ── Typing Indicator ──────────────────────────────────── */
.typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-xs);
  animation: msg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot-bounce 1.4s ease-in-out infinite;
}

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

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

/* ── Share Button ──────────────────────────────────────── */
.share-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.share-btn[hidden] {
  display: none;
}

.share-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
  background: var(--bg);
}

.share-btn:active {
  transform: scale(0.97);
}

/* ── Composer ──────────────────────────────────────────── */
.composer {
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer-inner:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-glow);
}

.composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 24px;
  max-height: 160px;
  padding: 8px 0;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.5;
  outline: none;
}

.composer textarea::placeholder {
  color: var(--muted);
  font-weight: 300;
}

/* ── Send Button ───────────────────────────────────────── */
.send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease,
    box-shadow 0.2s ease;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn[hidden] {
  display: none;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn.accent {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #fff;
  font-weight: 600;
}

.btn.accent:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--muted);
}


/* ── Animations ────────────────────────────────────────── */
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dot-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  animation: fade-in 0.5s ease both;
}
.meta {
  animation: fade-in 0.5s ease 0.08s both;
}
.messages {
  animation: fade-in 0.5s ease 0.16s both;
}
.composer {
  animation: fade-in 0.5s ease 0.24s both;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .shell {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0 14px 16px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    height: 100vh;
    height: 100dvh;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
  }

  .brand {
    flex: 1;
    min-width: 0;
  }

  .brand-name {
    font-size: 15px;
    display: none;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .handle {
    display: none;
  }

  .auth-actions {
    flex-shrink: 0;
  }

  .new-chat-btn {
    padding: 6px;
    font-size: 0;
    gap: 0;
    border-radius: 8px;
  }

  .new-chat-btn svg {
    display: block;
    width: 16px;
    height: 16px;
  }

  .menu-btn {
    display: flex;
  }

  .menu-overlay {
    display: block;
  }

  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    position: fixed;
    top: 0;
    right: -95vw;
    width: 95vw;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    background: var(--bg);
    padding: 48px 16px 20px;
    box-shadow: -4px 0 20px rgba(26, 22, 18, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    right: 0;
  }

  .sidebar-close {
    display: flex;
  }

  .sidebar-section {
    background: var(--paper);
  }

  .msg {
    max-width: 90%;
    font-size: 14px;
  }

  .message-suggestion {
    max-width: 100%;
    width: 100%;
    text-align: left;
    font-size: 13px;
  }

  .usage-bar-wrap {
    flex: 0 1 80px;
  }

  .composer-inner {
    padding: 4px 4px 4px 14px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }
}

/* ── Tokenomics ───────────────────────────────────────── */
.tokenomics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.tokenomics-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tokenomics-stat[hidden] {
  display: none;
}

.tokenomics-cta[hidden] {
  display: none;
}

.tokenomics-label {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.tokenomics-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-display);
}

.tokenomics-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.tokenomics-cta {
  grid-column: 1 / -1;
}

.tokenomics-cta-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1.5px dashed rgba(253, 154, 38, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tokenomics-cta-btn:hover {
  background: rgba(253, 154, 38, 0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tokenomics-cta-btn:active {
  transform: scale(0.98);
}

.tokenomics-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.buy-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 3px;
  color: var(--accent);
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}

.buy-more:hover {
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.tokenomics-ca {
  margin-top: 12px;
}

.ca-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.ca-input-wrap:hover {
  border-color: var(--accent);
}

.ca-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 11.5px;
  font-family: monospace, var(--font-body);
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
}

.ca-copy-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: none;
  border-left: 1.5px solid var(--line);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ca-copy-btn:hover {
  background: rgba(253, 154, 38, 0.15);
}

.ca-copy-btn.copied {
  color: #22c55e;
}

/* ── Wallet Modal ─────────────────────────────────────── */
.wallet-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 22, 18, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-overlay-in 0.25s ease both;
}

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

.wallet-modal {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  max-width: 380px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(253, 154, 38, 0.06);
  animation: modal-card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wallet-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wallet-modal-close:hover {
  background: var(--line);
  color: var(--ink);
}

.wallet-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid rgba(253, 154, 38, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.wallet-modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.wallet-modal-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.wallet-modal-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 14.5px;
  border-radius: 12px;
}

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

@keyframes modal-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Share Modal ──────────────────────────────────────── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 22, 18, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-overlay-in 0.25s ease both;
}

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

.share-modal {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 24px 24px;
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(253, 154, 38, 0.06);
  animation: modal-card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.share-preview {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}

.share-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.share-actions {
  display: flex;
  gap: 8px;
}

.share-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.share-action-btn:hover {
  border-color: var(--muted);
  background: var(--bg);
  transform: translateY(-1px);
}

.share-action-btn:active {
  transform: scale(0.97);
}

.share-x {
  background: #0f1419;
  border-color: #0f1419;
  color: #fff;
}

.share-x:hover {
  background: #1a2430;
  border-color: #1a2430;
}

.share-copy.copied {
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

/* ── Sidebar Close Button ─────────────────────────────── */
.sidebar-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-close:hover {
  background: var(--line);
  color: var(--ink);
  border-color: var(--muted);
}

/* ── New Chat Button ──────────────────────────────────── */
.new-chat-btn[hidden] {
  display: none;
}

/* ── Thread List ─────────────────────────────────────── */
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
}

.thread-list::-webkit-scrollbar {
  width: 4px;
}

.thread-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.thread-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.thread-item-row:hover {
  background: var(--bg);
}

.thread-item-row.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.thread-item-row:hover .thread-item-delete {
  opacity: 1;
}

.thread-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  width: 100%;
}

.thread-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
  margin-right: 4px;
}

.thread-item-delete:hover {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
}

.thread-item-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-item-time {
  font-size: 10.5px;
  color: var(--muted);
}

/* ── Share View Mode ─────────────────────────────────── */
.share-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(253, 154, 38, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.share-view-banner span {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.share-view-banner a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.share-view-banner a:hover {
  text-decoration: underline;
}

/* ── Selection ─────────────────────────────────────────── */
::selection {
  background: rgba(253, 154, 38, 0.2);
  color: var(--ink);
}

/* ── Focus Visible ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.send-btn:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
