/* ==========================================================================
   RobinGPT — Design tokens
   ========================================================================== */
:root {
  --bg: #08090C;
  --bg-elev-1: #0D0F13;
  --bg-elev-2: #121419;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-solid: #15171C;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --primary: #00C805;
  --primary-2: #33E04B;
  --primary-dim: rgba(0, 200, 5, 0.14);
  --primary-glow: rgba(0, 200, 5, 0.35);
  --danger: #FF5C5C;
  --danger-dim: rgba(255, 92, 92, 0.14);
  --warning: #FFB800;
  --warning-dim: rgba(255, 184, 0, 0.14);

  --text-primary: #F3F5F3;
  --text-secondary: #A2ABA5;
  --text-tertiary: #7B847E;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.45);

  --sidebar-w: 272px;
  --sidebar-w-collapsed: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light theme — same identity (green accent, same radii/shadows/spacing),
   inverted surfaces only. Applied via data-theme="light" on <html>,
   toggled from Settings and persisted to localStorage (see js/app.js
   initTheme()). */
:root[data-theme="light"] {
  --bg: #F6F8F6;
  --bg-elev-1: #FFFFFF;
  --bg-elev-2: #EEF2EF;
  --surface: rgba(8, 20, 12, 0.035);
  --surface-hover: rgba(8, 20, 12, 0.06);
  --surface-solid: #FFFFFF;
  --border: rgba(8, 20, 12, 0.1);
  --border-strong: rgba(8, 20, 12, 0.16);

  --primary: #00A804;
  --primary-2: #128A1B;
  --primary-dim: rgba(0, 168, 4, 0.12);
  --primary-glow: rgba(0, 168, 4, 0.28);

  --text-primary: #10140F;
  --text-secondary: #4B564E;
  --text-tertiary: #7C877F;

  --shadow-soft: 0 8px 30px rgba(20, 30, 22, 0.10);
  --shadow-lift: 0 20px 60px rgba(20, 30, 22, 0.14);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(760px 480px at 14% -8%, rgba(0, 168, 4, 0.07), transparent 60%),
    radial-gradient(600px 400px at 100% 12%, rgba(0, 168, 4, 0.05), transparent 55%);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(8,20,12,0.14); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(8,20,12,0.22); }
:root[data-theme="light"] .composer-inner { background: rgba(255,255,255,0.9); }

/* Smooth, immediate cross-fade between themes rather than a jarring snap */
body, .sidebar, .composer-inner, .report-card, .report-stat, .modal, .app-footer, .topbar {
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

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

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--primary-dim); color: var(--primary-2); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: #05130A;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
  font-size: 14px;
}
.skip-link:focus { left: 0; }
.main:focus-visible { outline: none; }

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(760px 480px at 14% -8%, rgba(0, 200, 5, 0.10), transparent 60%),
    radial-gradient(600px 400px at 100% 12%, rgba(0, 200, 5, 0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
  transition: grid-template-columns 0.32s var(--ease);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  background: linear-gradient(180deg, var(--bg-elev-1), var(--bg-elev-2));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  min-width: 0;
  overflow: hidden;
  transition: padding 0.32s var(--ease);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: flex; flex: 0 0 auto; width: 40px; height: 40px; filter: drop-shadow(0 0 14px var(--primary-glow)); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  flex: 0 0 auto;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border); }
.icon-btn:active { transform: scale(0.94); }

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.new-chat-btn:hover { background: var(--primary-dim); border-color: rgba(0,200,5,0.4); color: var(--primary-2); }
.new-chat-btn:active { transform: scale(0.98); }
.new-chat-btn svg { flex: 0 0 auto; }

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  margin-top: 16px;
  padding-right: 2px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 6px 10px 8px;
  white-space: nowrap;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.history-item span { overflow: hidden; text-overflow: ellipsis; }
.history-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.history-item.active { background: var(--primary-dim); color: var(--primary-2); border-color: rgba(0,200,5,0.25); }
.history-item svg { flex: 0 0 auto; opacity: 0.7; }
.history-empty { color: var(--text-tertiary); font-size: 12.5px; padding: 8px 10px; }

.sidebar-bottom { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 8px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.sidebar-item svg { flex: 0 0 auto; }
.version-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  padding: 10px 10px 2px;
  white-space: nowrap;
}
.version-tag span { color: var(--primary); }

/* Collapsed state */
.app.collapsed .brand-name,
.app.collapsed .new-chat-btn span,
.app.collapsed .sidebar-history,
.app.collapsed .sidebar-item span,
.app.collapsed .version-tag {
  display: none;
}
.app.collapsed .sidebar { align-items: center; }
.app.collapsed .new-chat-btn { justify-content: center; padding: 11px; }
.app.collapsed .sidebar-item { justify-content: center; }
.app.collapsed .sidebar-top { justify-content: center; padding-bottom: 22px; }
.app.collapsed .sidebar-top .icon-btn { display: none; }
.app.collapsed .sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 40;
}

/* ==========================================================================
   Main / topbar
   ========================================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(14px);
  flex: 0 0 auto;
}
.mobile-only { display: none; }

.ticker-marquee {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: ticker-scroll 34s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ticker-item .sym { color: var(--text-primary); font-weight: 600; }
.ticker-item .chg.up { color: var(--primary); }
.ticker-item .chg.down { color: var(--danger); }
.ticker-item--muted { color: var(--text-tertiary); font-size: 12px; }
.ticker-marquee.ticker-empty .ticker-track { animation-play-state: paused; }

.topbar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-tertiary);
}
.status-dot.pending { animation: pulse-dot 1.2s ease-in-out infinite; }
.status-dot.live { background: var(--primary); box-shadow: 0 0 6px var(--primary-glow); }
.status-dot.limited { background: #E0B84A; box-shadow: 0 0 6px rgba(224,184,74,0.35); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 6px rgba(255,92,92,0.3); }
@media (max-width: 640px) {
  .status-pill span:not(.status-dot) { display: none; }
  .status-pill { padding: 6px; }
}
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s var(--ease);
}
.ghost-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-hover); }
.ghost-btn:active { transform: scale(0.96); }
.ghost-btn.accent {
  color: var(--primary);
  border-color: rgba(0, 200, 5, 0.28);
  background: rgba(0, 200, 5, 0.06);
}
.ghost-btn.accent:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 200, 5, 0.12);
}

/* ==========================================================================
   Chat viewport
   ========================================================================== */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.welcome-screen {
  max-width: 780px;
  margin: 0 auto;
  padding: 10vh 24px 40px;
  text-align: center;
  animation: fade-up 0.5s var(--ease);
}
.welcome-mark {
  display: inline-flex;
  padding: 18px;
  border-radius: 26px;
  background: var(--primary-dim);
  border: 1px solid rgba(0,200,5,0.22);
  margin-bottom: 22px;
  animation: pulse-glow 2.8s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,200,5,0.25); }
  50% { box-shadow: 0 0 0 14px rgba(0,200,5,0); }
}
.welcome-screen h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.welcome-screen p {
  color: var(--text-secondary);
  font-size: 15.5px;
  margin: 0 0 40px;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: left;
}
.suggestion-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  text-align: left;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.suggestion-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,200,5,0.35);
  background: var(--surface-hover);
  box-shadow: var(--shadow-soft);
}
.suggestion-card:active { transform: translateY(-1px) scale(0.99); }
.suggestion-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  color: var(--text-tertiary);
}
.suggestion-tag.up { background: var(--primary-dim); color: var(--primary-2); }
.suggestion-tag.down { background: var(--danger-dim); color: var(--danger); }
.suggestion-title { font-weight: 600; font-size: 14px; }
.suggestion-sub { font-size: 12.5px; color: var(--text-tertiary); }

/* ==========================================================================
   Messages
   ========================================================================== */
.messages {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.msg {
  display: flex;
  gap: 14px;
  animation: fade-up 0.35s var(--ease);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.msg.user .msg-avatar { background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.msg.assistant .msg-avatar {
  background: linear-gradient(155deg, var(--primary), #049B0A);
  color: #05130A;
  box-shadow: 0 0 0 1px rgba(0,200,5,0.25), 0 4px 14px rgba(0,200,5,0.25);
}

.msg-body { flex: 1; min-width: 0; }
.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.msg-name { font-weight: 600; font-size: 13.5px; }
.msg-time { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }

.msg-bubble {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-primary);
}
.msg.user .msg-bubble {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: inline-block;
}

.msg-bubble p { margin: 0 0 12px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 0 0 12px; padding-left: 22px; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 18px 0 10px;
  letter-spacing: -0.01em;
}
.msg-bubble h1:first-child, .msg-bubble h2:first-child, .msg-bubble h3:first-child { margin-top: 0; }
.msg-bubble h1 { font-size: 19px; }
.msg-bubble h2 { font-size: 17px; }
.msg-bubble h3 { font-size: 15px; }
.msg-bubble strong { color: #fff; font-weight: 600; }
.msg-bubble a { color: var(--primary-2); text-decoration: underline; text-underline-offset: 2px; }
.msg-bubble blockquote {
  margin: 0 0 12px;
  padding: 4px 14px;
  border-left: 3px solid var(--primary);
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.msg-bubble code.inline-code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--primary-2);
}

/* ==========================================================================
   Live token cards (DexScreener — token / compare / trending)
   ========================================================================== */
.token-cards { margin: 4px 0 14px; }
.token-cards-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  animation: liveDotPulse 2.2s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.token-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.token-cards--token .token-card-grid { grid-template-columns: minmax(220px, 320px); }

.token-card {
  display: block;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255,255,255,0.015) 100%);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
a.token-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.token-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.token-card-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.token-card-symbol {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
}
.token-card-chain {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.token-card-name {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.token-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.token-card-price-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.token-card-change {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.token-card-change.up { color: var(--primary-2); background: var(--primary-dim); }
.token-card-change.down { color: var(--danger); background: var(--danger-dim); }
.token-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.token-card-stats div { display: flex; flex-direction: column; gap: 2px; }
.token-card-stats span { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.03em; }
.token-card-stats strong { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.token-card-dex {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.msg-bubble table { border-collapse: collapse; width: 100%; font-size: 13px; }
.msg-bubble th, .msg-bubble td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.msg-bubble thead th { background: var(--surface); color: var(--text-secondary); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.msg-bubble tbody tr:last-child td { border-bottom: none; }
.msg-bubble tbody tr:hover { background: rgba(255,255,255,0.02); }

/* code blocks */
.code-block {
  margin: 0 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0B0D10;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.code-lang { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.copy-code-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 11.5px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.copy-code-btn:hover { color: var(--text-primary); background: var(--surface-hover); }
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.tok-kw { color: #33E04B; }
.tok-str { color: #E0C466; }
.tok-com { color: #6B746E; font-style: italic; }
.tok-num { color: #6FB8FF; }
.tok-fn { color: #B392F0; }

/* message actions */
.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.msg:hover .msg-actions, .msg-actions.always { opacity: 1; }
.msg-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-tertiary);
  font-size: 11.5px;
  transition: all 0.15s var(--ease);
}
.msg-action-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-hover); }
.msg-action-btn.copied { color: var(--primary-2); border-color: rgba(0,200,5,0.35); }

/* Thinking state */
.thinking-row { display: flex; gap: 14px; animation: fade-up 0.3s var(--ease); }
.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.thinking-text { font-size: 13px; color: var(--text-secondary); transition: opacity 0.18s var(--ease); }
.thinking-dots { display: flex; gap: 4px; }
.thinking-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* typing cursor for streaming text */
.type-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--primary);
  margin-left: 2px;
  transform: translateY(2px);
  animation: cursor-blink 0.9s steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* ==========================================================================
   Composer
   ========================================================================== */
.composer {
  flex: 0 0 auto;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.composer-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: rgba(21, 23, 28, 0.85);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.composer-inner:focus-within {
  border-color: rgba(0,200,5,0.45);
  box-shadow: 0 0 0 3px rgba(0,200,5,0.12), var(--shadow-soft);
}
#promptInput {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  padding: 8px 4px;
  max-height: 200px;
  outline: none;
}
#promptInput::placeholder { color: var(--text-tertiary); }

.send-btn, .stop-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), opacity 0.15s var(--ease);
}
.send-btn {
  background: var(--primary);
  color: #05130A;
}
.send-btn:disabled { background: var(--surface-solid); color: var(--text-tertiary); cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(0,200,5,0.15); }
.send-btn:not(:disabled):active { transform: scale(0.96); }
.stop-btn { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,92,92,0.35); }
.stop-btn:hover { background: rgba(255,92,92,0.22); }
.hidden { display: none !important; }

.attach-btn { align-self: center; }
.attach-btn.shake { animation: attach-shake 0.4s var(--ease); }
@keyframes attach-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.composer-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 10px;
}

/* ==========================================================================
   App footer
   ========================================================================== */
.app-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 20px 14px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.app-footer-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.app-footer-brand { font-weight: 600; color: var(--text-primary); }
.app-footer-tagline { color: var(--text-tertiary); }
.app-footer-chain-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  padding: 2px 9px;
  border-radius: 999px;
}
.app-footer-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.app-footer-dot { opacity: 0.5; }
.app-footer-x {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.app-footer-x:hover { color: var(--primary); }
@media (max-width: 640px) {
  .app-footer { font-size: 10.5px; padding: 8px 12px 10px; gap: 2px; }
  .app-footer-main { font-size: 11px; }
  .app-footer-sub { font-size: 10px; }
  .app-footer-tagline { opacity: 0.85; }
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,5,7,0.65);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: overlay-in 0.2s var(--ease);
}
.modal-overlay.open { display: flex; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  animation: modal-in 0.28s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-body { padding: 18px 20px 22px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.settings-row-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.settings-row-sub { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }
.settings-divider { height: 1px; background: var(--border); margin: 6px 0; }
.settings-block { padding: 10px 0; }

.switch { display: inline-block; width: 40px; height: 24px; position: relative; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background 0.2s var(--ease);
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--primary-dim); border-color: rgba(0,200,5,0.5); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: var(--primary); }
.switch input:disabled + .switch-track { opacity: 0.7; }

.integration-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.integration-list li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-secondary); }
.integration-list .integration-row { display: flex; align-items: center; gap: 9px; }
.integration-list .integration-hint {
  margin-left: 15px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.integration-list .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; box-shadow: 0 0 8px var(--primary-glow); }
.integration-list .dot.pending { background: var(--text-tertiary); box-shadow: none; animation: pulse-dot 1.2s ease-in-out infinite; }
/* Traffic-light states: connected (green), coming-soon (amber, calm —
   never alarming), offline (red — reserved for a configured service that
   genuinely failed a live reachability check). */
.integration-list .dot.connected { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.integration-list .dot.coming-soon { background: var(--warning); box-shadow: 0 0 6px rgba(255,184,0,0.3); }
.integration-list .dot.offline { background: var(--danger); box-shadow: 0 0 6px rgba(255,92,92,0.3); }
@keyframes pulse-dot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.integration-list .pill {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.integration-list .pill.pending { color: var(--text-tertiary); }
.integration-list .pill.connected { color: var(--primary-2); border-color: rgba(0,200,5,0.3); }
.integration-list .pill.coming-soon { color: var(--warning); border-color: var(--warning-dim); }
.integration-list .pill.offline { color: var(--danger); border-color: var(--danger-dim); }

.danger-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,92,92,0.35);
  background: var(--danger-dim);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s var(--ease);
}
.danger-btn:hover { background: rgba(255,92,92,0.24); }

.about-mark { margin-bottom: 14px; }
.about-lead { font-size: 14.5px; line-height: 1.6; margin: 0 0 10px; }
.about-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 18px; }
.about-meta { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--border); padding-top: 14px; }
.about-meta div { display: flex; justify-content: space-between; font-size: 12.5px; }
.about-meta span { color: var(--text-tertiary); }
.about-meta strong { font-weight: 600; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .suggestion-grid { grid-template-columns: repeat(2, 1fr); }
  :root { --sidebar-w: 240px; }
}

@media (max-width: 860px) {
  .ticker-marquee { display: none; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(84vw, 300px);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--shadow-lift);
  }
  .app.mobile-open .sidebar { transform: translateX(0); }
  .app.mobile-open .sidebar-scrim { display: block; }
  .app.collapsed .sidebar-history,
  .app.collapsed .new-chat-btn span,
  .app.collapsed .brand-name,
  .app.collapsed .sidebar-item span,
  .app.collapsed .version-tag { display: flex; }
  .mobile-only { display: inline-flex; }
  .welcome-screen h1 { font-size: 26px; }
  .suggestion-grid { grid-template-columns: 1fr; }
  .messages { padding: 16px 12px 22px; gap: 18px; }
  .msg.user .msg-bubble { max-width: 88%; }
  .topbar { padding: 9px 14px; gap: 8px; }
  .composer { padding: 8px 12px 10px; }
  .composer-inner { padding: 7px 7px 7px 12px; }
  .composer-footnote { margin-top: 6px; font-size: 10px; }
}

@media (max-width: 768px) {
  .icon-btn { width: 40px; height: 40px; }
  .send-btn, .stop-btn { width: 40px; height: 40px; }
  .history-item, .sidebar-item { padding: 11px 10px; }
}

@media (max-width: 480px) {
  .topbar { padding: 8px 12px; }
  .composer { padding: 7px 10px 9px; }
  .welcome-screen { padding: 6vh 16px 20px; }
  .modal { width: 100%; }
  .ghost-btn span { display: none; }
  .ghost-btn { padding: 8px 10px; }
  .token-card-grid { grid-template-columns: 1fr; }
  .token-cards--token .token-card-grid { grid-template-columns: 1fr; }
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24%;
}


/* RobinGPT v2 mobile readability improvements */
.message, .msg-bubble {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg-bubble {
  line-height: 1.7;
}
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.msg-bubble p {
  margin: 10px 0;
}
.msg-bubble ul, .msg-bubble ol {
  padding-left: 22px;
}
.msg-bubble code {
  overflow-x: auto;
}
.composer {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}
@media (max-width: 480px) {
  .brand-name {
    font-size: 18px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .msg-bubble {
    font-size: 14px;
    line-height: 1.65;
  }
  .welcome-screen h1 {
    font-size: 24px;
  }
  .welcome-screen p {
    font-size: 14px;
  }
}

/* ==========================================================================
   RobinGPT v3 — AI Blockchain Agent: Investigate landing + Investigation report
   ========================================================================== */

/* ---- Landing / Investigate hero ---- */
.landing-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 24px 40px;
  text-align: center;
  animation: fade-up 0.5s var(--ease);
}
.landing-inner { max-width: 640px; width: 100%; margin: 0 auto; }
.landing-mark {
  display: inline-flex;
  padding: 18px;
  border-radius: 26px;
  background: var(--primary-dim);
  border: 1px solid rgba(0, 200, 5, 0.22);
  margin-bottom: 22px;
  animation: pulse-glow 2.8s ease-in-out infinite;
}
.landing-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.landing-kicker {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--primary-2);
  margin: 0 0 14px;
}
.landing-sub {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 32px;
}

.address-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.address-form:focus-within {
  border-color: rgba(0, 200, 5, 0.5);
  box-shadow: 0 0 0 4px var(--primary-dim), var(--shadow-soft);
}
.address-form-icon { color: var(--text-tertiary); flex-shrink: 0; }
.address-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14.5px;
  padding: 11px 0;
}
.address-input::placeholder { color: var(--text-tertiary); font-family: var(--font-body); }
.analyze-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #05130A;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14.5px;
  font-family: var(--font-display);
  white-space: nowrap;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
}
.analyze-btn:hover { background: var(--primary-2); box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-1px); }
.analyze-btn:active { transform: translateY(0) scale(0.98); }
.analyze-btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.address-error { min-height: 20px; color: var(--danger); font-size: 13px; margin-top: 10px; }

.chain-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.chain-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }

.landing-chat-link {
  display: inline-block;
  margin-top: 40px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 13px;
  transition: color 0.2s;
}
.landing-chat-link:hover { color: var(--primary-2); }

/* ---- Investigation / report view ---- */
.investigate-view { max-width: 820px; margin: 0 auto; padding: 28px 20px 60px; width: 100%; }
.investigate-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font-mono);
  margin-bottom: 22px;
  animation: fade-up 0.4s var(--ease);
}
.investigate-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: status-pulse 1.1s ease-in-out infinite; }
@keyframes status-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

.report-error { text-align: center; padding: 60px 20px; }
.report-error-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.report-error-text { color: var(--text-secondary); font-size: 14.5px; max-width: 440px; margin: 0 auto 22px; line-height: 1.6; }

.report-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; animation: fade-up 0.35s var(--ease) both; }
.report-token-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.report-token-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--primary-2);
  flex-shrink: 0;
}
.report-token-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.report-token-addr { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; overflow-wrap: anywhere; }
.report-chain-pill {
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--primary-dim); border: 1px solid rgba(0, 200, 5, 0.25);
  color: var(--primary-2); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}

.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.report-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
}
.report-stat-label { font-size: 11.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.report-stat-value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }

.skeleton-text {
  display: inline-block;
  color: transparent !important;
  background: linear-gradient(90deg, var(--surface-hover) 25%, rgba(255,255,255,0.1) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-sheen 1.4s ease-in-out infinite;
  border-radius: 6px;
  min-width: 64px;
}
@keyframes skeleton-sheen { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.report-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.report-card--wide { grid-column: 1 / -1; }
.report-card-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

.score-gauge { position: relative; display: flex; justify-content: center; }
.score-value { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.score-label { text-align: center; color: var(--text-secondary); font-size: 13px; margin-top: 6px; }
#scoreArc { transition: stroke-dashoffset 1s var(--ease), stroke 0.3s; }

.risk-level-row { margin-bottom: 12px; }
.risk-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.risk-pill.low { background: var(--primary-dim); color: var(--primary-2); }
.risk-pill.medium { background: var(--warning-dim); color: var(--warning); }
.risk-pill.high { background: var(--danger-dim); color: var(--danger); }
.risk-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.risk-flags li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.risk-flag-icon { flex-shrink: 0; margin-top: 1px; }
.risk-flags li.positive .risk-flag-icon { color: var(--primary-2); }
.risk-flags li.warning .risk-flag-icon { color: var(--warning); }
.risk-flags li.critical .risk-flag-icon { color: var(--danger); }

.summary-text { color: var(--text-primary); font-size: 14.5px; line-height: 1.75; margin: 0; }
.summary-source-note { display: block; margin-top: 12px; font-size: 12px; color: var(--text-tertiary); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-action-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); font-size: 13.5px; font-weight: 500;
  transition: all 0.18s var(--ease);
}
.quick-action-btn:hover { border-color: rgba(0, 200, 5, 0.35); background: var(--surface-hover); transform: translateY(-1px); }
.quick-action-btn.copied { color: var(--primary-2); border-color: rgba(0, 200, 5, 0.4); }

.token-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 4px 4px; max-width: 900px; margin: 0 auto;
}
.token-suggestion-chip {
  padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); font-size: 13px;
  transition: all 0.18s var(--ease);
}
.token-suggestion-chip:hover { border-color: rgba(0, 200, 5, 0.35); color: var(--text-primary); background: var(--surface-hover); }
.token-suggestion-more { color: var(--primary-2); border-style: dashed; font-weight: 600; }

.reveal-in { animation: reveal-in 0.45s var(--ease) both; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 860px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .report-cards { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
  .landing-title { font-size: 34px; }
  .investigate-view { padding: 16px 14px 28px; }
  .landing-view { padding: 4vh 18px 24px; }
  .landing-sub { margin-bottom: 22px; }
  .chain-badges { margin-top: 20px; }
  .report-header { margin-bottom: 14px; }
  .report-grid { gap: 8px; margin-bottom: 14px; }
  .report-stat { padding: 10px 12px; gap: 3px; }
  .report-stat-value { font-size: 14px; }
  .report-card { padding: 14px; }
  .report-card-head { margin-bottom: 10px; }
  .quick-actions { gap: 8px; }

  /* Only the most important metrics show above the fold on mobile —
     everything else lives behind "Show more" so the first screen reads
     calm and immediate rather than dashboard-dense. */
  .report-stat--secondary { display: none; }
  .report-grid.show-secondary .report-stat--secondary { display: flex; }
  .show-more-stats-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: -4px 0 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12.5px;
    font-weight: 600;
  }
  .show-more-stats-btn:hover { color: var(--text-primary); border-color: var(--primary); }
  .show-more-stats-btn svg { transition: transform 0.2s var(--ease); }
  .show-more-stats-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
}
@media (min-width: 769px) {
  .show-more-stats-btn { display: none; }
}
@media (max-width: 480px) {
  .report-grid { grid-template-columns: 1fr 1fr; }
  .address-form { flex-wrap: wrap; padding: 10px 10px 10px 16px; }
  .address-input { width: 100%; order: 1; }
  .address-form-icon { order: 0; }
  .analyze-btn { order: 2; width: 100%; justify-content: center; margin-top: 4px; }
  .landing-title { font-size: 28px; }
  .landing-sub { font-size: 14.5px; }
  .chain-badges { gap: 8px; margin-top: 16px; }
  .chain-badge { padding: 6px 11px; font-size: 11.5px; }
  .report-token-avatar { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
  .report-token-name { font-size: 16px; }
  .report-token-addr { font-size: 11px; }
  .report-chain-pill { padding: 5px 11px; font-size: 11.5px; }
  .token-suggestions { padding: 8px 4px 4px; gap: 6px; }
  .token-suggestion-chip { padding: 7px 12px; font-size: 12.5px; }
}

/* ==========================================================================
   Live Market Dashboard — homepage trending/new/gainers/volume sections.
   Pure market-data cards; refreshed on a timer by js/app.js. Never tied
   to AI generation, so this whole block never costs an OpenRouter call.
   ========================================================================== */
.landing-mark img { display: block; border-radius: 14px; }

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
}
.live-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  animation: pulse-glow 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

.market-dashboard {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.market-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.market-section-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.market-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.market-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}
.market-card:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-2px); }
.market-card:active { transform: translateY(0) scale(0.98); }
.market-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.market-card-logo {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  object-fit: cover; background: var(--bg-elev-2);
}
.market-card-logo-fallback {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary-2);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
.market-card-id { min-width: 0; }
.market-card-symbol { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-card-name { font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-card-price { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.market-card-change { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.market-card-change.up { color: var(--primary-2); }
.market-card-change.down { color: var(--danger); }
.market-card-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-tertiary); border-top: 1px solid var(--border); padding-top: 8px; }
.market-card-skeleton {
  height: 118px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-hover) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: skeleton-sheen 1.4s ease-in-out infinite;
}
.market-empty { grid-column: 1 / -1; color: var(--text-tertiary); font-size: 13px; padding: 18px 0; text-align: center; }

@media (max-width: 900px) {
  .market-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .market-dashboard { padding: 4px 14px 36px; gap: 22px; }
  .market-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .market-card { padding: 10px; }
}

/* ==========================================================================
   Token page additions — logo, socials, primary Trade button, and the
   on-demand "🤖 Generate AI Report" block.
   ========================================================================== */
.report-token-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.powered-by-tag {
  display: inline-block;
  margin: 2px 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
}

.report-social-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.social-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }

.trade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #05130A;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
}
.trade-btn:hover { background: var(--primary-2); box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-1px); }
.trade-btn:active { transform: translateY(0) scale(0.98); }

.ai-report-block { margin-top: 6px; }
.generate-ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 200, 5, 0.35);
  background: var(--primary-dim);
  color: var(--primary-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.generate-ai-btn:hover { background: rgba(0, 200, 5, 0.22); transform: translateY(-1px); }
.generate-ai-btn:disabled { opacity: 0.7; cursor: default; transform: none; }
.generate-ai-btn.is-loading { animation: pulse-glow 1.4s ease-in-out infinite; }

.ai-report-cta-note { text-align: center; color: var(--text-tertiary); font-size: 12px; margin-top: 8px; }
.ai-report-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 10px; }

@media (max-width: 768px) {
  .trade-btn { padding: 15px; font-size: 15px; }
  .generate-ai-btn { padding: 16px; }
}
