/* Typography using fomo's sizes (measured on 2026-11-16): text 12 and 14 px at weight 500,
   titles 16 px, price 18 px, big value 30 px, buttons at 700. The fomo font (Aeonik) is paid;
   the site uses Figtree, the closest match among 11 free fonts measured (Roberto's decision, 2026-11-17). */
:root {
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #08070f;
  --panel: #12111a;
  --panel-2: #1a1924;
  --panel-3: #24232f;
  --border: rgba(203, 208, 235, 0.09);
  --border-strong: rgba(203, 208, 235, 0.18);
  --text: #f7f7f7;
  --text-2: #9899a3;
  --text-3: #5e616b;
  --green: #21c95e;
  --green-bg: rgba(33, 201, 94, 0.12);
  --green-btn: #0e9f57;
  --red: #ff5c3a;
  --red-bg: rgba(255, 92, 58, 0.12);
  --red-btn: #d9442a;
  --yellow: #f5c451;
  --accent: #c6f432;
  --accent-text: #0b0b12;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 36px; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 500; }
h3 { font-size: 14px; line-height: 20px; font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.page { flex: 1; padding-top: 20px; padding-bottom: 48px; outline: none; }
.small { font-size: 12px; line-height: 16px; }
.micro { font-size: 10px; line-height: 14px; font-weight: 700; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.green { color: var(--green); }
.red { color: var(--red); }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.overline { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.is-hidden { display: none !important; }
.break { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ banner and top bar */
.test-banner { background: rgba(245, 196, 81, 0.1); color: var(--yellow); text-align: center; font-size: 12px; line-height: 16px; padding: 6px 16px; border-bottom: 1px solid rgba(245, 196, 81, 0.18); }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8, 7, 15, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-row { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { flex: none; width: 28px; height: 28px; border-radius: 8px; }
.brand-sm img { width: 20px; height: 20px; }
.brand-sm { font-size: 16px; }
.search { flex: 1; min-width: 0; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-2); }
.search:focus-within { border-color: var(--border-strong); }
.search input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: none; font-size: 14px; font-weight: 400; color: var(--text); }
.search input::placeholder { color: var(--text-2); }
.search kbd { font: 700 10px/14px var(--font); color: var(--text-2); background: rgba(203, 208, 235, 0.1); border-radius: 4px; padding: 1px 6px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 12px; line-height: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, opacity 0.15s; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { filter: brightness(1.06); color: var(--accent-text); }
.btn-secondary { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--panel-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }
.btn-lg { height: 48px; font-size: 16px; line-height: 24px; width: 100%; border-radius: 10px; }
.btn-buy { background: var(--green-btn); color: #fff; }
.btn-buy:hover:not(:disabled) { background: #11b263; color: #fff; }
.btn-sell { background: var(--red-btn); color: #fff; }
.btn-sell:hover:not(:disabled) { background: #ec5136; color: #fff; }
.btn-icon { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 6px; line-height: 1; }
.btn-icon:hover { color: var(--text); background: var(--panel-2); }
.connected { gap: 8px; }
.connected .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.connected.wrong-chain .dot { background: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; }
.chip:hover { background: var(--panel-3); }
.chip.active { border-color: var(--accent); color: var(--accent); background: rgba(198, 244, 50, 0.08); }
.chip-sm { height: 26px; padding: 0 10px; font-size: 12px; }

/* ------------------------------------------------------------------ cards and blocks */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-body { padding: 16px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 12px; line-height: 16px; }
.kv-row > span:first-child { color: var(--text-2); }
.kv-row > span:last-child { text-align: right; }
.divider { height: 1px; background: var(--border); margin: 12px 0; border: 0; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 10px; line-height: 14px; font-weight: 700; background: rgba(203, 208, 235, 0.1); color: var(--text-2); white-space: nowrap; }
.tag-graduated { background: rgba(245, 196, 81, 0.14); color: var(--yellow); }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-accent { background: rgba(198, 244, 50, 0.12); color: var(--accent); }

.bar { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.split-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; }
.split-bar > i { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 10px; font-size: 12px; line-height: 16px; }
.legend .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

/* coin logo (the creator's image or a square with the symbol) */
.coin-logo { position: relative; flex: none; overflow: hidden; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; color: #fff; font-weight: 700; }
.coin-logo img { width: 100%; height: 100%; object-fit: cover; }
.coin-logo .initials { font-size: 40%; letter-spacing: 0.02em; }

/* ------------------------------------------------------------------ home */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.hero { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 260px; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 0; }
.hero-coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-name { font-size: 30px; line-height: 36px; font-weight: 500; letter-spacing: -0.01em; }
.hero-mc { text-align: right; }
.hero-mc .value { font-size: 30px; line-height: 36px; font-weight: 500; }
.hero-chart { flex: 1; min-height: 120px; padding: 8px 0 0; }
.hero-chart canvas { width: 100%; height: 100%; display: block; }
.hero-foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.hero-foot .small { color: var(--text-2); }
.race-row { display: grid; grid-template-columns: 18px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); }
.race-row:first-of-type { border-top: 0; }
.race-row:hover { background: var(--panel-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 10px; margin-bottom: -1px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px; margin-top: 16px; }
.coin-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.coin-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.coin-card .cover { position: relative; aspect-ratio: 1 / 1; background: var(--panel-2); }
.coin-card .cover .coin-logo { width: 100%; height: 100%; border-radius: 0; }
.coin-card .cover .coin-logo .initials { font-size: 36px; }
.coin-card .badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; }
.coin-card .badges .tag { background: rgba(8, 7, 15, 0.78); backdrop-filter: blur(6px); }
.coin-card .cover-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(8, 7, 15, 0.6); }
.coin-card .cover-progress > i { display: block; height: 100%; background: var(--accent); }
.coin-card .main { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.coin-card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.coin-card .symbol { font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-card .mc { font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap; }
.coin-card .card-foot { display: flex; justify-content: space-between; gap: 6px; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--border); }
.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ------------------------------------------------------------------ coin page */
.coin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.coin-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.coin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.coin-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin-id .name { font-size: 30px; line-height: 36px; font-weight: 500; letter-spacing: -0.01em; }
.coin-values { text-align: right; }
.coin-values .mc { font-size: 30px; line-height: 36px; font-weight: 500; }
.info-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; line-height: 16px; }
.info-row .item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.info-row .item b { color: var(--text); font-weight: 500; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--text); cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.link-btn:hover { color: var(--accent); }
.chart-box { margin-top: 14px; }
.chart-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.chart-area { height: 360px; }
.chart-area canvas { width: 100%; height: 100%; display: block; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 16px; }
.data-table th { text-align: left; font-weight: 500; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .right { text-align: right; }
.table-scroll { overflow-x: auto; }

.trade-panel { padding: 12px; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.toggle button { height: 40px; border-radius: 10px; border: 0; background: var(--panel-2); color: var(--text-2); font-size: 16px; font-weight: 700; cursor: pointer; }
.toggle button.active.buy { background: var(--green-bg); color: var(--green); }
.toggle button.active.sell { background: var(--red-bg); color: var(--red); }
.amount-field { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.amount-field:focus-within { border-color: var(--border-strong); }
.amount-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 30px; line-height: 36px; font-weight: 500; color: var(--text); }
.amount-field input::placeholder { color: var(--text-3); }
.amount-field .unit { font-size: 14px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.trade-panel .chips { margin: 10px 0 12px; }
.trade-panel .chips .chip { flex: 1; }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 16px; margin: 10px 0; }
.notice.warning { background: rgba(245, 196, 81, 0.1); color: var(--yellow); }
.notice.danger { background: var(--red-bg); color: var(--red); }
.notice.info { background: var(--panel-2); color: var(--text-2); }
.slippage { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.slippage input { width: 56px; height: 26px; text-align: right; padding: 0 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; outline: none; }

/* ------------------------------------------------------------------ create */
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-top: 20px; }
.create-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.form-block { padding: 20px; }
.form-block + .form-block { margin-top: 16px; }
.form-block > h2 { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .field-legend { font-size: 12px; line-height: 16px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.field input, .field textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; font-weight: 400; outline: none; color: var(--text); }
.field textarea { min-height: 96px; resize: vertical; line-height: 20px; }
.field input:focus, .field textarea:focus { border-color: var(--border-strong); }
.field .field-error { color: var(--red); font-size: 12px; line-height: 16px; }
.field.invalid input, .field.invalid textarea { border-color: rgba(255, 92, 58, 0.6); }
.logo-picker { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; }
.logo-picker .coin-logo { width: 96px; height: 96px; border: 1px dashed var(--border-strong); }
details.more { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
details.more > summary { cursor: pointer; font-size: 14px; color: var(--text); list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "▾"; color: var(--text-2); transition: transform 0.15s; }
details.more[open] > summary::after { transform: rotate(180deg); }
details.more > div { margin-top: 14px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tier { text-align: left; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; }
.tier:hover { border-color: var(--border-strong); }
.tier.active { border-color: var(--accent); background: rgba(198, 244, 50, 0.07); }
.tier .big { font-size: 18px; line-height: 24px; font-weight: 500; }
.terms .kv-row { font-size: 12px; }

/* ------------------------------------------------------------------ account */
.account-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.account-top .value { font-size: 18px; line-height: 24px; margin-top: 4px; }

/* ------------------------------------------------------------------ loading */
.skeleton { background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 6px; color: transparent !important; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .coin-card:hover { transform: none; } }

/* ------------------------------------------------------------------ modal and toasts */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 3, 10, 0.72); }
.modal-box { position: relative; width: 100%; max-width: 400px; max-height: 86vh; overflow: auto; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; padding: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-list button { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; font-size: 14px; font-weight: 500; text-align: left; }
.wallet-list button:hover { border-color: var(--border-strong); }
.wallet-list img { width: 28px; height: 28px; border-radius: 6px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 14px; font-size: 12px; line-height: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); transition: opacity 0.3s, transform 0.3s; }
.toast a { color: var(--accent); white-space: nowrap; }
.toast-ok { border-color: rgba(33, 201, 94, 0.45); }
.toast-error { border-color: rgba(255, 92, 58, 0.5); }
.toast.leaving { opacity: 0; transform: translateY(6px); }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--border); padding: 24px 0 32px; margin-top: auto; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-row p { margin-top: 6px; }
.footer-links { display: flex; gap: 18px; color: var(--text-2); }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1080px) {
  .home-top, .coin-layout, .create-grid { grid-template-columns: minmax(0, 1fr); }
  .coin-side, .create-side { position: static; }
  .coin-side { order: -1; }
}
@media (max-width: 760px) {
  .topbar-row { gap: 10px; }
  .search kbd { display: none; }
  #create-button span, .brand span { display: none; }
  .hero-name, .coin-id .name, .hero-mc .value, .coin-values .mc { font-size: 24px; line-height: 30px; }
  .hero-foot { grid-template-columns: repeat(2, 1fr); }
  .coin-values { text-align: left; }
  .chart-area { height: 280px; }
  .form-row, .account-top { grid-template-columns: minmax(0, 1fr); }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .coin-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
  /* tabs in a single row, scrolling sideways */
  .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; white-space: nowrap; margin-bottom: 0; }
}
