/* mintit.fun — Token Launchpad */

:root {
  --bg: #f5f5f8;
  --bg-card: #ffffff;
  --bg-input: #f0f0f5;
  --border: #e0e0e8;
  --text: #1a1a2e;
  --text-dim: #6e6e88;
  --accent: #7c3aed;
  --accent-dim: #6d28d9;
  --red: #ef4444;
  --green: #10b981;
  --yellow: #f59e0b;
  --purple: #7c3aed;
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  color-scheme: light;
}

/* Dark theme — applied via `data-theme="dark"` on <html>. Chart, modals,
   and every component use the same --bg / --text / --border variables, so
   overriding them here switches the whole UI in one shot. */
html[data-theme="dark"] {
  --bg: #0b0b14;
  --bg-card: #161623;
  --bg-input: #1e1e2f;
  --border: #2a2a3d;
  --text: #e8e8f2;
  --text-dim: #8f8fad;
  --accent: #9b6cff;
  --accent-dim: #7c3aed;
  color-scheme: dark;
}

/* Language picker indicator in the header. Shows the active 2-letter
   language code; tapping it goes to /language.html. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  padding: 0 10px;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.lang-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
}

/* Header theme-toggle button. Renders a sun in light mode, moon in dark. */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
}
.theme-toggle-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}
.theme-toggle .theme-toggle-moon { display: none; }
html[data-theme="dark"] .theme-toggle .theme-toggle-sun  { display: none; }
html[data-theme="dark"] .theme-toggle .theme-toggle-moon { display: inline-block; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 60px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.logo-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

.logo-tagline {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav a, .nav button {
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
}

.nav a:hover, .nav button:hover {
  color: var(--text);
  background: var(--bg-card);
  text-decoration: none;
}

.btn-create {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}

.btn-create:hover {
  background: var(--accent-dim) !important;
}

/* Main layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto 24px;
}

.hero-cta {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.hero-cta:hover {
  background: var(--accent-dim);
  text-decoration: none;
  color: #fff;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

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

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.tab {
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: var(--font);
}

.tab.active {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
}

.tab:hover { color: var(--text); }

/* Token grid */
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.token-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.token-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.token-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.token-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
}

.token-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-name {
  font-weight: 700;
  font-size: 16px;
}

.token-ticker {
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--mono);
}

.token-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.token-stat {
  display: flex;
  flex-direction: column;
}

.token-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.token-stat-value {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--mono);
}

.price-up { color: var(--green); }
.price-down { color: var(--red); }

/* Risk signal badge — "CREATOR DUMPED X%" type flags. Sits in the same
   top-right slot as NEW / GRADUATED; only one shows at a time. */
.badge-risk {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: help;
}

/* GRADUATED badge + card accent */
.badge-graduated {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent, #7b4cff);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.token-card.graduated {
  border-color: var(--accent, #7b4cff);
}

/* Graduated detail-page banner */
.graduated-banner {
  background: color-mix(in srgb, var(--accent, #7b4cff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #7b4cff) 40%, transparent);
  color: var(--text, #111);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

/* Disabled Buy tab (graduated pools) */
.trade-tab[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* "About this token" panel on detail page — creator activity / risk
   signals. Sits below the curve progress in the sidebar. */
.creator-panel {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.creator-panel-title {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.creator-panel-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}
.creator-panel-row:last-child { border-bottom: none; }
.creator-panel-row > span:first-child { color: var(--text-dim); }
.creator-panel-row .risk { color: var(--red); font-weight: 700; }
.creator-panel-row small { color: var(--text-dim); font-weight: 400; margin-left: 4px; }

/* Report-this-token button — deliberately low-emphasis, placed below the
   trade panel so it's findable but not a prominent CTA. */
.report-token-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.report-token-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Backup-reminder bar (prepended to <body> 24h after wallet creation if
   the user never downloaded an encrypted backup). Does NOT use position:
   sticky so it pushes content down rather than hovering over the header
   — keeps the nav layout predictable. */
.backup-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff4c2;
  color: #5a4200;
  border-bottom: 1px solid #e8c86a;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}
.backup-reminder span { flex: 1; }
.backup-reminder-btn {
  background: #5a4200;
  color: #fff4c2;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.backup-reminder-btn:hover { opacity: 0.9; }
.backup-reminder-dismiss {
  background: transparent;
  color: #5a4200;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  opacity: 0.6;
}
.backup-reminder-dismiss:hover { opacity: 1; }
@media (max-width: 600px) {
  .backup-reminder { flex-wrap: wrap; }
  .backup-reminder span { flex-basis: 100%; }
}

/* NEW badge */
.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mini bonding curve bar on cards */
.card-curve-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.card-curve-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #a855f7);
  border-radius: 2px;
  transition: width 0.5s;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-dim);
  margin-bottom: 20px;
  font-size: 15px;
}

.empty-state-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.empty-state-btn:hover {
  background: var(--accent-dim);
}

/* Token detail page */
.token-detail {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

@media (max-width: 768px) {
  .token-detail { grid-template-columns: 1fr; }
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}
.chart-container > #priceChart {
  flex: 1;
  min-height: 0;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
}
.chart-tf {
  display: flex;
  gap: 4px;
}
.chart-expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.chart-expand-btn:hover {
  color: var(--accent, #7c3aed);
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.08);
}

/* Fullscreen chart overlay — shared by token detail + creator dashboard. */
.chart-fs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 20, 0.85);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.chart-fs-panel {
  background: var(--bg-card, #12131a);
  border: 1px solid var(--border, #2a2d3a);
  border-radius: 12px;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}
.chart-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.chart-fs-title {
  font-weight: 700;
  font-size: 15px;
}
.chart-fs-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.chart-fs-close:hover { color: var(--text); }
.chart-fs-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
}
@media (max-width: 500px) {
  .chart-fs-overlay { padding: 8px; }
  .chart-fs-panel { max-height: none; height: 100%; }
  .chart-fs-body { padding: 8px; }
}
.chart-tf-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.chart-tf-btn:hover { color: var(--text); }
.chart-tf-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--accent, #7c3aed);
}

/* Trade panel */
.trade-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Wallet-gate banner at the top of the trade panel when the wallet is
   locked. More prominent than the old connect button at the bottom — users
   couldn't tell why the Sell tab was empty until they scrolled. */
.trade-connect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.04));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 10px;
}
.trade-connect-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}
.trade-connect-btn {
  background: var(--accent, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 120ms;
}
.trade-connect-btn:hover { filter: brightness(1.1); }
@media (max-width: 500px) {
  .trade-connect-banner { flex-direction: column; align-items: stretch; }
  .trade-connect-btn { width: 100%; }
}

.trade-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.trade-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  border: none;
  font-family: var(--font);
  transition: all 0.2s;
}

.trade-tab.buy {
  background: var(--bg-input);
  color: var(--text-dim);
}

.trade-tab.buy.active {
  background: var(--accent);
  color: #fff;
}

.trade-tab.sell {
  background: var(--bg-input);
  color: var(--text-dim);
}

.trade-tab.sell.active {
  background: var(--red);
  color: #fff;
}

.trade-input-group {
  margin-bottom: 16px;
}

.trade-input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.trade-input {
  width: 100%;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--mono);
  outline: none;
}

.trade-input:focus {
  border-color: var(--accent);
}

.balance-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.balance-max {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: var(--accent, #7c3aed);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.balance-max:hover {
  background: rgba(124, 58, 237, 0.2);
}

.trade-quote {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

.trade-quote-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.trade-quote-row .label { color: var(--text-dim); }

.price-impact-warn {
  color: var(--yellow);
  font-weight: 600;
}

.price-impact-bad {
  color: var(--red);
  font-weight: 600;
}

.trade-btn {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.trade-btn.buy {
  background: var(--accent);
  color: #fff;
}

.trade-btn.sell {
  background: var(--red);
  color: #fff;
}

.trade-btn.connect-prompt {
  background: var(--bg-input);
  color: var(--accent);
  border: 2px dashed var(--accent);
}

.trade-btn:hover { opacity: 0.9; }
.trade-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Processing animation */
.trade-btn.processing {
  position: relative;
  color: transparent;
}

.trade-btn.processing::after {
  content: "Processing...";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Bonding curve progress */
.curve-progress {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.curve-progress-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.curve-progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.curve-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #a855f7);
  border-radius: 3px;
  transition: width 0.5s;
}

/* Trade history */
.trade-history {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 24px;
}

.trade-history h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.trade-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--mono);
}

.trade-row:last-child { border-bottom: none; }

/* Create token page */
.create-form {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.create-form h2 {
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

.form-submit:hover { background: var(--accent-dim); }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 6px;
}

/* Payment progress indicator */
.payment-progress {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-input);
  border-radius: var(--radius);
  text-align: center;
}

.payment-progress .step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-dim);
}

.payment-progress .step.active {
  color: var(--text);
  font-weight: 600;
}

.payment-progress .step.done {
  color: var(--green);
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step.active .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.step.done .step-dot {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  text-align: center;
  padding: 60px;
  color: var(--text-dim);
  font-size: 15px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  font-size: 14px;
  max-width: 360px;
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 4.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  border-left: 4px solid var(--green);
}

.toast.error {
  border-left: 4px solid var(--red);
}

.toast.info {
  border-left: 4px solid var(--accent);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* How it works section */
.how-it-works {
  max-width: 700px;
  margin: 0 auto;
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 28px;
}

.how-step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.how-step-num {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.how-step-content h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.how-step-content p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

.how-back {
  display: block;
  text-align: center;
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

.how-back:hover {
  color: var(--accent);
}

/* Live feed */
.live-feed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 8px 24px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
  display: flex;
  gap: 24px;
  overflow: hidden;
}

.feed-item {
  white-space: nowrap;
  animation: slide 20s linear infinite;
}

.feed-buy { color: var(--green); }
.feed-sell { color: var(--red); }
.feed-launch { color: var(--yellow); }

@keyframes slide {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Card shadow for light theme */
/* Visible focus ring — the default browser outline is suppressed on
   several custom elements; keyboard users need this back. */
.token-card:focus-visible,
[role="link"]:focus-visible,
[role="button"]:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent, #7b4cff);
  outline-offset: 2px;
}

.token-card, .trade-panel, .chart-container, .trade-history, .create-form {
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* View transitions */
#app {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Trade modal */
#tradeModal {
  animation: fadeIn 0.15s ease;
}

/* Search input focus */
#tokenSearch:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .token-grid { grid-template-columns: 1fr; }
  .trade-panel { width: 100%; min-width: 0; }
  .live-feed { font-size: 11px; padding: 4px 12px; }
  .live-feed .feed-items { gap: 16px; }
  header { padding: 12px 16px; }
  header nav a { font-size: 13px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .logo-tagline { display: none; }
  .toast-container { right: 12px; left: 12px; }
  .toast { max-width: 100%; }
}

@media (max-width: 600px) {
  .header { padding: 12px 16px; }
  .container { padding: 16px; }
  .token-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 16px; }
}

/* --- Mobile pass (2026-04-23): target iPhone SE at 375px --- */
@media (max-width: 500px) {
  /* Header: the tagline ("Token launchpad on BCH2") eats space we don't
     have; drop it below phone width. Nav is already the most important
     thing to keep visible. */
  .logo-tagline { display: none; }
  .logo { font-size: 20px; }
  .header { padding: 10px 14px; gap: 8px; }

  /* Nav items — "How it works" is the first to sacrifice to the nav icon
     row. Keep Explore + Create + Wallet. */
  .nav { gap: 6px; flex-wrap: nowrap; }
  .nav a, .nav button { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .nav a[data-action="showHowItWorks"] { display: none; }
  .btn-create { padding: 6px 10px !important; font-size: 13px; }

  /* Trade panel: fill width; remove the 360px sidebar preference. */
  .trade-panel { max-width: 100%; width: 100%; }

  /* Modals — give the content room to breathe on narrow screens
     without scrolling past the close button. */
  .wallet-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); padding: 18px 14px; }

  /* Token cards: reduce padding/gap so the stat grid doesn't wrap oddly. */
  .token-card-stats { gap: 8px; }
  .token-stat-value { font-size: 13px; }

  /* Long cashaddr strings break without this hint on narrow screens. */
  .wallet-addr, .modal-key { font-size: 11px !important; word-break: break-all; }

  /* Footer links wrap cleanly. */
  .site-footer { gap: 6px; padding: 0 12px; }
}

/* Extra-small phones (Galaxy Fold closed, etc.) */
@media (max-width: 360px) {
  .logo { font-size: 18px; }
  .nav a, .nav button { padding: 5px 8px; font-size: 12px; }
  .btn-wallet { padding: 6px 10px; font-size: 12px; }
}

/* --- Support page --- */
.faq {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 0 14px;
  background: var(--bg-card);
}
.faq[open] { padding-bottom: 12px; }
.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-dim);
  font-weight: 400;
  transition: transform 0.15s;
}
.faq[open] summary::after { content: "−"; }
.faq > div {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  padding-bottom: 4px;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.support-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.support-form input,
.support-form textarea {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.support-form textarea { resize: vertical; min-height: 120px; }
.support-form input:focus,
.support-form textarea:focus { outline: 2px solid var(--accent, #7b4cff); outline-offset: -1px; }
.support-form button[type=submit] {
  background: var(--accent, #7b4cff);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.support-form button[type=submit]:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Footer --- */
.site-footer {
  max-width: 1200px;
  margin: 48px auto 80px;
  padding: 0 24px;
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* --- Inline jargon tooltips ("?" glyph next to technical terms) ---
   Keyboard-accessible via tabindex=0; the bubble appears on :hover and
   :focus-within so touch users can tap to read. */
.jargon-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  user-select: none;
}
.jargon-tooltip:hover,
.jargon-tooltip:focus {
  background: var(--accent, #7b4cff);
  color: #fff;
  outline: none;
}
.jargon-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: left;
  white-space: normal;
}
.jargon-tooltip:hover .jargon-bubble,
.jargon-tooltip:focus .jargon-bubble {
  display: block;
}
@media (max-width: 400px) {
  .jargon-bubble {
    width: 200px;
    left: auto;
    right: 0;
    transform: none;
  }
}

/* --- Wallet UI --- */
.btn-wallet {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-wallet:hover { opacity: 0.9; }
.wallet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.wallet-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.wallet-modal {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.wallet-modal h3 {
  margin: 0 0 16px;
  font-size: 20px;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dim, #888);
}
.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text, #333);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.modal-input:focus { border-color: var(--accent, #7c3aed); }
.modal-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text, #333);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.modal-btn.primary {
  background: var(--accent, #7c3aed);
  color: #fff;
  border: none;
}
.modal-btn:hover { opacity: 0.9; }
.modal-key {
  background: var(--bg-input, #f5f5f5);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  word-break: break-all;
  user-select: all;
}
.wallet-balance {
  font-size: 32px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  margin-bottom: 8px;
}
.wallet-addr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  word-break: break-all;
  text-align: center;
  color: var(--text-dim, #888);
  margin-bottom: 12px;
  padding: 8px;
  background: var(--bg-input, #f5f5f5);
  border-radius: 8px;
}
.wallet-token-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 13px;
}
