/*
  ZOO's art direction: pixels, dot-matrix type and ASCII, after the references the user picked.
  - An AI platform's hero: a grainy pastel sky (lavender, blush, peach) over a dark dune, ASCII
    glyphs raining in it, a dot-matrix headline, white pills, and its numbers underneath with
    small pixel icons. It opens the board.
  - An AI studio's footer: rainbow light through a dot-matrix screen, the wordmark in big pixels.
  - A creative studio's pixel art: every coin is drawn as its own pixel creature.
  The layouts come from real products found on Refero, kept light: usepaid.app for the chrome
  (an open sidebar, pill buttons), OpenSea's cards for the board (one grid of coins, each its
  creature big), Wealthsimple's security page for a coin (the price big, a clean line, a few key
  numbers, the order card on the right; the rest behind tabs).
  Doto (dot-matrix) for display, Inter for reading, JetBrains Mono for numbers and labels. Black
  canvas, near-black surfaces; green and red only for gains and losses.
*/

:root {
  color-scheme: dark;

  --ink: #070707;
  --graphite: #121213;
  --card: #1a1a1c;
  --steel: #232326;
  --stone: #333337;
  --ghost: #3c3d40;
  --white: #ffffff;
  --silver: #adadb1;
  --dim: #6f7074;
  --blue: #9db4ff;
  --green: #47bb64;
  --red: #ff5a5f;
  --inset: inset 0 0 0 1px rgba(255, 255, 255, 0.07);

  /* The hero's sky and the footer's light. The sky is a dusk, lavender down to a peach glow over
     the dune, kept deep enough behind the headline for its white dots (about 3:1, no shadow). */
  --sky: linear-gradient(180deg, #857bc8 0%, #9084c9 20%, #9f84c0 36%, #b080b0 50%, #c0829f 62%, #d4928f 76%, #b86f7e 86%, #6a3048 95%, #3a1b2c 100%);
  --rainbow: linear-gradient(90deg, #ff6a1a 0%, #ff2d55 11%, #d21fc9 24%, #7b2dff 36%, #2c3cff 48%, #1a8cff 58%, #12c6dc 68%, #19c25c 80%, #b8d41c 91%, #ffd21a 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: 'Doto', var(--mono);

  /* The sidebar, open by default (usepaid.app), folded to icons on demand. */
  --sidebar: 260px;
}

/* Dot-matrix display type: square dots, heavy enough to read. */
.pixel-type {
  font-family: var(--pixel);
  font-weight: 900;
  font-variation-settings: 'ROND' 0;
}

body.sidebar-folded {
  --sidebar: 76px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--white);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--white);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  color: var(--white);
}

p {
  margin: 0 0 8px;
}

.mono,
.num,
code {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--silver);
}

.dim {
  color: var(--dim);
}

.small {
  font-size: 12px;
}

.up,
.buy {
  color: var(--green);
}

.down,
.sell {
  color: var(--red);
}

.warn {
  color: #f5c451;
}

.icon {
  display: inline-flex;
  flex-shrink: 0;
}

.icon svg {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- shell */

/* The sidebar, open by default like usepaid.app's: big icons, plain labels, pill hover. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 0 12px 12px;
  background: var(--ink);
  border-right: 1px solid var(--steel);
  transition: width 0.18s ease;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 4px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
}

.brand:hover {
  color: var(--white);
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 10px;
}

.brand-mark svg,
.footer-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-name {
  font: 900 30px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
  letter-spacing: 0.02em;
}

button.fold {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--silver);
}

.nav {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  color: var(--white);
  font-weight: 700;
}

.nav-item.active .icon svg {
  stroke-width: 2.6;
}

/* Folded: icons only, centred. */
body.sidebar-folded .sidebar {
  padding: 0 12px 12px;
}

body.sidebar-folded .sidebar-top {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: auto;
  padding: 14px 0 10px;
}

body.sidebar-folded .brand-name,
body.sidebar-folded .nav-item span:not(.icon) {
  display: none;
}

body.sidebar-folded .nav-item {
  justify-content: center;
  padding: 12px 0;
}

.shell {
  margin-left: var(--sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.18s ease;
}

/* Top bar: a centred pill search, the actions on the right. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 24px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--steel);
}

.search {
  position: relative;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}

.search input {
  height: 44px;
  padding: 0 44px 0 42px;
  border-radius: 9999px;
  background: var(--ink);
  border: 1px solid var(--steel);
  font-size: 14px;
}

.search .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
}

.search kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 8px;
  border: 1px solid var(--steel);
  border-radius: 6px;
  color: var(--silver);
  font: 12px var(--mono);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1325px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.page.narrow {
  max-width: 760px;
}

/* The footer (AI studio reference): rainbow light through a dot-matrix screen fading into black,
   the wordmark in big pixels, a few links, a "back to top" tile. */
.site-footer {
  position: relative;
  margin-top: 72px;
  overflow: hidden;
  background: #000;
}

.footer-glow {
  position: relative;
  height: 320px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.42) 37px, rgba(0, 0, 0, 0) 73px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0) 61px, rgba(0, 0, 0, 0.3) 131px),
    var(--rainbow);
}

/* The LED screen: dots lit in columns, brightest at the top. */
.footer-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.4px, transparent 1.9px) 0 0 / 10px 10px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 35%, transparent 70%), repeating-linear-gradient(90deg, #000 0 50px, transparent 50px 90px, #000 90px 120px, transparent 120px 210px);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 35%, transparent 70%), repeating-linear-gradient(90deg, #000 0 50px, transparent 50px 90px, #000 90px 120px, transparent 120px 210px);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  mix-blend-mode: overlay;
}

.footer-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0.8) 72%, #000 100%);
}

.footer-inner {
  position: relative;
  margin-top: -84px;
  padding: 0 32px 20px;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 40px;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  color: var(--white);
}

.footer-brand:hover {
  color: var(--white);
}

.footer-mark {
  display: block;
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 22px;
}

.footer-word {
  font: 900 clamp(72px, 10vw, 136px)/0.9 var(--pixel);
  font-variation-settings: 'ROND' 0;
  letter-spacing: 0.02em;
}

.footer-links {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
}

.footer-links a:hover {
  color: var(--white);
}

button.footer-top {
  flex-direction: column;
  gap: 6px;
  width: 104px;
  height: 104px;
  padding: 0;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.45) 9px, rgba(0, 0, 0, 0) 17px),
    linear-gradient(180deg, #0d3b5e 0%, #081a2c 70%, #050b12 100%);
  box-shadow: var(--inset);
  font-size: 12px;
  font-weight: 500;
}

button.footer-top:hover:not(:disabled) {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.35) 9px, rgba(0, 0, 0, 0) 17px),
    linear-gradient(180deg, #145487 0%, #0a2338 70%, #050b12 100%);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--dim);
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

.loading {
  padding: 40px 0;
  color: var(--silver);
}

/* ------------------------------------------------------------- controls */

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Buttons are pills, as in the hero reference: white for the main action, a dark pill for the
   rest ("Sign in"). */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: #242427;
  color: var(--white);
  font: 600 14px/20px var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, transform 0.08s ease;
}

button:hover:not(:disabled),
.button:hover {
  background: #313135;
  color: var(--white);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.primary,
.button.primary {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}

button.primary:hover:not(:disabled),
.button.primary:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: transparent;
  color: var(--ink);
}

button.buy-fill {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

button.buy-fill:hover:not(:disabled) {
  background: #5fcf7b;
  border-color: #5fcf7b;
}

button.sell-fill {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

button.sell-fill:hover:not(:disabled) {
  background: #ee5d6b;
  border-color: #ee5d6b;
}

button.ghost {
  background: transparent;
  color: var(--silver);
}

button.small,
.button.small {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

button.wide {
  width: 100%;
  height: 48px;
  font-size: 15px;
}

/* Filter chips: pills, the selected one white. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
button.chip {
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  border: 1px solid var(--steel);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: 500 14px/20px var(--font);
}

button.chip:hover:not(:disabled) {
  color: var(--white);
}

.chip.active,
button.chip.active,
button.chip.active:hover:not(:disabled) {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}

/* Small presets in the order card. */
.quick button.chip {
  height: 28px;
  padding: 0 11px;
  font: 500 12px var(--mono);
}

button.link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 500;
}

button.link:hover:not(:disabled) {
  background: none;
  color: var(--white);
}

button.is-busy {
  position: relative;
  color: transparent !important;
}

button.is-busy > * {
  opacity: 0;
}

button.is-busy::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

button.primary.is-busy::after,
button.buy-fill.is-busy::after {
  border-color: rgba(8, 8, 9, 0.8);
  border-top-color: transparent;
}

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

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--steel);
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
}

select {
  appearance: none;
  width: auto;
  height: 40px;
  padding: 0 34px 0 16px;
  border-radius: 9999px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23acadae' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border-color: var(--steel);
  color: var(--white);
  font: 500 14px var(--font);
  cursor: pointer;
}

select option {
  background: var(--graphite);
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field > span {
  color: var(--silver);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field small {
  color: var(--dim);
  font-size: 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* A pill toggle (Wealthsimple's Stocks / Options): the chosen side lit. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9999px;
  background: var(--graphite);
  box-shadow: var(--inset);
}

.segmented button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--silver);
  font-size: 13px;
}

.segmented button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.segmented button.active,
.segmented button.active:hover:not(:disabled) {
  background: var(--stone);
  color: var(--white);
}

/* ------------------------------------------------------------- data bits */

/* Labels in small spaced capitals, in mono, like the studio reference's navigation. */
.label {
  color: var(--silver);
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coin-img {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
  background: var(--card);
}

.coin-img svg {
  display: block;
  width: 100%;
  height: 100%;
}

.verified {
  display: inline-flex;
  color: var(--blue);
  vertical-align: -2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--silver);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag.blue {
  color: var(--blue);
  background: rgba(131, 195, 255, 0.1);
}

.tag.green {
  color: var(--green);
  background: rgba(71, 187, 100, 0.12);
}

.progress,
.meter {
  height: 4px;
  border-radius: 999px;
  background: var(--stone);
  overflow: hidden;
}

/* Progress in the hero's colours, lavender to peach. */
.progress span,
.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a59ed6, #f0b8b0);
  transition: width 0.4s ease;
}

.panel {
  border-radius: 8px;
  background: var(--graphite);
  box-shadow: var(--inset);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--steel);
  font-weight: 500;
}

.panel-body {
  padding: 12px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.facts dt {
  color: var(--silver);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- board */

/* The hero (AI platform reference): a grainy pastel sky over a dark dune, glyphs raining in it,
   a dot-matrix headline, a white pill. */
.hero {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  /* Two dark dunes, the big one with a lit rim, over the pastel sky; the foot fades into the page
     so the numbers underneath sit on the same black, like the reference. */
  background:
    linear-gradient(180deg, rgba(7, 7, 7, 0) 80%, #070707 100%),
    radial-gradient(80% 62% at 62% 106%, #070407 0 64%, #26111e 70%, #b86f7e 78%, rgba(240, 184, 176, 0) 86%),
    radial-gradient(54% 46% at 6% 106%, #060305 0 58%, rgba(36, 16, 28, 0.85) 70%, rgba(36, 16, 28, 0) 84%),
    var(--sky);
}

.hero-ascii {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--grain);
  opacity: 0.75;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero-body {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 0 24px 64px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px 0 6px;
  border-radius: 9999px;
  background: rgba(24, 18, 22, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 500;
}

.hero-faces {
  display: flex;
}

.hero-faces .coin-img {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #1a1318;
}

.hero-faces .coin-img:first-child {
  margin-left: 0;
}

.hero-title {
  font: 900 clamp(44px, 6.4vw, 88px)/1.04 var(--pixel);
  font-variation-settings: 'ROND' 0;
  letter-spacing: 0.01em;
  color: var(--white);
}

.hero-sub {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.hero-cta .button,
.hero-cta button {
  height: 44px;
  padding: 0 24px;
}

/* Its numbers, each under a small pixel icon. */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 36px 0 12px;
  text-align: center;
}

.hero-stat {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.pixel-icon {
  display: inline-flex;
  color: var(--white);
}

.pixel-icon svg {
  display: block;
}

.hero-stat-value {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  color: var(--dim);
  font-size: 13px;
}

/* The spotlight: the king of the hill, lit by its own colours, its creature big on the right. */
.spotlight {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 28px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 24px;
  background:
    radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--glow-a) 55%, transparent), transparent 60%),
    radial-gradient(70% 120% at 80% 120%, color-mix(in srgb, var(--glow-b) 50%, transparent), transparent 60%),
    var(--graphite);
  box-shadow: var(--inset);
  color: var(--white);
}

.spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  opacity: 0.35;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.spotlight:hover {
  color: var(--white);
}

.spotlight-body {
  min-width: 0;
}

.spotlight-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(10, 10, 10, 0.5);
  color: #fcd34d;
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spotlight-name {
  font: 900 clamp(34px, 4vw, 52px)/1.05 var(--pixel);
  font-variation-settings: 'ROND' 0;
  overflow-wrap: break-word;
}

.spotlight-by {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.spotlight-stats {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 28px;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(10, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--inset);
}

.spotlight-stats span {
  display: block;
}

.spotlight-stats .num {
  font-size: 14px;
}

.spotlight-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  white-space: nowrap;
}

.spotlight-progress .progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
}

.spotlight-progress .progress span {
  background: var(--white);
}

.spotlight-cta {
  margin-top: 20px;
  height: 44px;
  padding: 0 24px;
}

.spotlight-art .coin-img {
  width: 188px;
  height: 188px;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* The create page's preview: the same card, stacked to fit its narrow column. */
.spotlight.preview {
  flex-direction: column-reverse;
  align-items: flex-start;
  margin-top: 0;
  padding: 20px;
  pointer-events: none;
}

.spotlight.preview .spotlight-name {
  font-size: 32px;
}

.spotlight.preview .spotlight-art .coin-img {
  width: 104px;
  height: 104px;
  border-radius: 20px;
}

/* The coins: a title with its filters on one line, then a grid of cards, each coin's creature big
   and only what decides a click (name, market cap, 24h, progress to graduation). */
.coins-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 44px 0 18px;
  scroll-margin-top: 84px;
}

.coins-head h2 {
  font: 900 36px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
}

.coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 16px;
}

.coin-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--graphite);
  box-shadow: var(--inset);
  color: var(--white);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.coin-card:hover {
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.coin-card-art {
  position: relative;
}

.coin-card-art .coin-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.king-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 9999px;
  background: rgba(10, 10, 10, 0.72);
  color: #fcd34d;
  font: 500 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.coin-card-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.coin-card-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}

.coin-card-name span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-card-name .dim {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
}

.coin-card-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 13px var(--mono);
  font-variant-numeric: tabular-nums;
}

.coin-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: var(--dim);
  font-size: 12px;
}

.coin-card-foot .progress {
  flex: 1;
}

button.more {
  display: flex;
  margin: 20px auto 0;
}

.empty {
  padding: 32px 16px;
  border-radius: 8px;
  box-shadow: var(--inset);
  color: var(--silver);
  text-align: center;
}

/* ------------------------------------------------------------- coin page */

/* Laid out like Wealthsimple's security page (dark): the price big, a clean line with its
   ranges, then market details and sections; the order card sticks on the right. */
.asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'top side'
    'rest side';
  gap: 0 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.asset-top {
  grid-area: top;
  min-width: 0;
}

.asset-rest {
  grid-area: rest;
  min-width: 0;
}

.asset-side {
  grid-area: side;
  align-self: start;
  position: sticky;
  top: 84px;
  display: grid;
  gap: 16px;
}

.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.asset-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.asset-id .coin-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.asset-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
}

.asset-name {
  color: var(--silver);
  font-size: 13px;
}

.asset-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-tools button.small {
  height: 36px;
}

.asset-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 22px;
}

/* The price on a dot-matrix display. */
.big-price {
  font: 900 56px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.price-unit {
  color: var(--silver);
  font-size: 16px;
  font-weight: 600;
}

.price-change {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.chart-box {
  position: relative;
  height: 340px;
  margin-top: 12px;
}

.chart-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-readout {
  position: absolute;
  top: 8px;
  left: 12px;
  display: flex;
  gap: 10px;
  color: var(--silver);
  font: 12px var(--mono);
  pointer-events: none;
}

.ranges {
  display: flex;
  width: fit-content;
  margin: 14px auto 0;
}

.ranges button {
  min-width: 48px;
  font: 500 12px var(--mono);
}

/* Four key numbers under the chart. */
.key-stats {
  margin-top: 36px;
  padding: 20px;
  border-radius: 18px;
  background: var(--graphite);
  box-shadow: var(--inset);
}

.section-lead {
  margin: -8px 0 16px;
}

/* Its brain, in one card: the replay, its last decision, its piles; the rest folds away. */
.brain-card {
  display: grid;
  gap: 16px;
}

.brain-last {
  margin: 0;
  font-size: 15px;
}

.brain-piles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.brain-piles .pile {
  margin: 0;
}

.brain-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.brain-more {
  border-top: 1px solid var(--steel);
  padding-top: 12px;
}

.brain-more summary {
  width: fit-content;
  color: var(--silver);
  font-weight: 600;
  cursor: pointer;
}

.brain-more summary:hover {
  color: var(--white);
}

.brain-more[open] summary {
  margin-bottom: 4px;
}

/* Activity, holders, about: underlined tabs over one card. */
.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--steel);
}

.tabs button {
  height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--silver);
  font-size: 16px;
  font-weight: 600;
}

.tabs button:hover:not(:disabled) {
  background: none;
  color: var(--white);
}

.tabs button.active {
  border-bottom-color: var(--white);
  color: var(--white);
}

.list-card.plain {
  padding: 4px 0 0;
  background: none;
  box-shadow: none;
}

/* Order card: its staking side. */
.stake-actions {
  display: grid;
  gap: 10px;
}

.stake-actions .row {
  justify-content: center;
}

.section {
  margin-top: 48px;
  scroll-margin-top: 84px;
}

.section > h2,
.section-title h2 {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 600;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* Market details: a four-column grid, the label white over its value. */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 24px;
}

.fact {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fact-label {
  font-size: 13px;
  font-weight: 600;
}

.fact-value {
  color: var(--silver);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.about > p {
  max-width: 680px;
  margin-bottom: 22px;
  color: var(--silver);
}

/* Lists (activity, holders) sit in one card, rows split by hairlines. */
.list-card {
  padding: 4px 18px;
  border-radius: 18px;
  background: var(--graphite);
  box-shadow: var(--inset);
}

.list-note {
  margin: 12px 0 4px;
  color: var(--dim);
  font-size: 12px;
}

.empty-line {
  margin: 0;
  padding: 18px 0;
  color: var(--silver);
}

.activity-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 160px 64px 96px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--steel);
  font-size: 13px;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-when,
.activity-tx {
  text-align: right;
}

.side-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  border-radius: 9999px;
  font: 600 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.side-pill.buy {
  background: rgba(71, 187, 100, 0.14);
}

.side-pill.sell {
  background: rgba(255, 90, 95, 0.14);
}

.holder {
  display: grid;
  grid-template-columns: 26px 1fr 72px;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--steel);
}

.holder:last-child {
  border-bottom: 0;
}

.holder .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
}

.holder .pct {
  text-align: right;
  font-family: var(--mono);
}

.holder .bar {
  grid-column: 2 / -1;
  height: 3px;
  border-radius: 999px;
  background: var(--stone);
  overflow: hidden;
}

.holder .bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a59ed6, #eaa7a3);
}

/* Cards on the right. The order card follows Wealthsimple's Buy card: labelled rows, a total,
   a note, one white pill. */
.card {
  padding: 20px;
  border-radius: 18px;
  background: var(--graphite);
  box-shadow: var(--inset);
}

.card-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.order-head h3 {
  font-size: 24px;
  font-weight: 600;
}

.order-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.order-line .num {
  font-weight: 500;
}

.order-line.total {
  margin: 0;
}

.order-rule {
  height: 1px;
  margin: 16px 0;
  background: var(--steel);
}

.order-note {
  margin: 14px 0 16px;
  color: var(--silver);
  font-size: 12px;
  line-height: 1.5;
}

.trade-input {
  position: relative;
  width: 200px;
}

.trade-input input {
  height: 42px;
  padding: 0 66px 0 14px;
  border-radius: 12px;
  background: var(--ink);
  font: 500 16px var(--mono);
}

.trade-input .unit {
  position: absolute;
  top: 50%;
  right: 12px;
  max-width: 58px;
  overflow: hidden;
  transform: translateY(-50%);
  color: var(--silver);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
}

.kv span:first-child {
  color: var(--silver);
}

.kv span:last-child {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.curve-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.curve-pct {
  font: 900 32px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
}

/* The brain. */
.brain-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2.4 / 1;
  border-radius: 18px;
  background: var(--ink);
  box-shadow: var(--inset);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 16px;
  color: var(--silver);
  font-size: 12px;
}

.legend span,
.pool-row,
.sense-row,
.temper-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i,
.pool-row i {
  display: inline-block;
  width: 8px;
  height: 8px;
}

.brain-panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.brain-panels h3 {
  margin: 0 0 8px;
  color: var(--silver);
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sense-row {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  font-size: 12px;
}

.pool-row {
  padding: 2px 0;
  font-size: 12px;
}

.pool-row span {
  flex: 1;
}

.last-tick {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--steel);
}

.tick-line {
  display: grid;
  grid-template-columns: 64px 96px 1fr;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}

.pile {
  margin-bottom: 12px;
}

.pile-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.pile .meter {
  margin-top: 6px;
}

.temper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0 0 10px;
}

.temper-row {
  justify-content: space-between;
  font-size: 12px;
}

/* ------------------------------------------------------------- create & stake */

.page-title {
  font: 900 48px/1.1 var(--pixel);
  font-variation-settings: 'ROND' 0;
}

.page-lead {
  margin: 4px 0 24px;
  color: var(--silver);
  font-size: 16px;
}

.create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stats .panel {
  padding: 14px 16px;
}

.stats .num {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 500;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.big {
  margin: 8px 0 12px;
  font: 500 20px var(--mono);
}

/* The create form: its sections, the image drop zone, the fee sliders and their split. */
.form-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}

.form-section {
  margin: 28px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--steel);
  font-size: 16px;
  font-weight: 600;
}

.form-section .dim {
  font-size: 13px;
  font-weight: 400;
}

.form-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 20px;
  color: var(--silver);
  font-size: 13px;
}

.drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--stone);
  border-radius: 16px;
  background: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.drop:hover,
.drop.over {
  border-color: var(--silver);
  background: rgba(255, 255, 255, 0.03);
}

.drop.has-image {
  border-style: solid;
}

.drop-thumb {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--graphite);
  color: var(--silver);
}

.drop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drop-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}

.drop-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop + input {
  margin-top: 8px;
}

.field > span.range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.range-value {
  color: var(--white);
  font: 900 24px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
  letter-spacing: 0;
  text-transform: none;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  margin: 8px 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--stone);
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14);
}

input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
}

input[type='range']:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 6px;
}

/* Who gets the buy fee: the creator in white, the brain in the hero's peach, the platform in
   its lavender. */
.fee-split {
  display: grid;
  gap: 10px;
  margin: -4px 0 8px;
}

.split-bar {
  display: flex;
  gap: 3px;
  height: 10px;
}

.split-bar span {
  border-radius: 3px;
}

.split-bar .you,
.split-legend i.you {
  background: var(--white);
}

.split-bar .brain,
.split-legend i.brain {
  background: #eaa7a3;
}

.split-bar .platform,
.split-legend i.platform {
  background: #a59ed6;
}

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
}

.split-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.split-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.fee-split small {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.links-grid .field {
  margin-bottom: 8px;
}

/* A coin's links, under its name. */
.link-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.link-pills:empty {
  display: none;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 9999px;
  background: var(--graphite);
  box-shadow: var(--inset);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
}

.link-pill:hover {
  background: var(--card);
  color: var(--white);
}

/* What only a coin's creator sees on its page. */
.creator-fees {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creator-fees > div {
  display: grid;
  gap: 4px;
}

.creator-earned {
  font: 900 26px/1 var(--pixel);
  font-variation-settings: 'ROND' 0;
}

.agent summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-weight: 600;
  cursor: pointer;
}

.agent[open] summary {
  margin-bottom: 12px;
}

/* On, off, or waiting for its creator. */
.agent-chip {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--steel);
  color: var(--silver);
  font-size: 12px;
  font-weight: 500;
}

.agent-chip.is-on {
  background: rgba(71, 187, 100, 0.16);
  color: var(--green);
}

.agent-chip.is-problem {
  background: rgba(255, 90, 95, 0.14);
  color: var(--red);
}

.agent-problem {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 13px;
}

.agent-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-who {
  display: grid;
  gap: 4px;
}

.agent-help {
  margin: 8px 0 14px;
  line-height: 1.5;
}

.agent-help a {
  color: var(--white);
}

/* The four keys of the creator's X app, two by two. */
.agent-keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.agent-account {
  color: var(--silver);
  font-size: 14px;
}

.agent-line .agent-language {
  flex: 1;
  max-width: 240px;
  margin-bottom: 0;
}

.agent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--silver);
  font-size: 14px;
  cursor: pointer;
}

/* A switch rather than a box. */
.agent-toggle input {
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: var(--stone);
  cursor: pointer;
  transition: background 0.15s;
}

.agent-toggle input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.15s;
}

.agent-toggle input:checked {
  background: var(--green);
}

.agent-toggle input:checked::after {
  transform: translateX(16px);
}

.agent-toggle input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.agent-last {
  margin: 12px 0 0;
  line-height: 1.5;
}

.agent-last a {
  color: var(--white);
}

.agent-fine {
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--inset), 0 8px 24px rgba(0, 0, 0, 0.5);
  border-left: 3px solid var(--silver);
  animation: toast-in 0.2s ease;
  transition: opacity 0.5s ease;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-out {
  opacity: 0;
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ------------------------------------------------------------- small screens */

@media (max-width: 1180px) {
  .asset {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 0 28px;
  }
  .trade-input {
    width: 170px;
  }
}

@media (max-width: 1000px) {
  .create {
    grid-template-columns: 1fr;
  }
  /* One column: the order card right under the chart, the sections after it. */
  .asset {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      'top'
      'side'
      'rest';
  }
  .asset-side {
    position: static;
    margin-top: 28px;
  }
  .trade-input {
    width: 200px;
  }
}

@media (max-width: 900px) {
  /* Not enough room for an open menu next to the board: icons only. */
  body:not(.sidebar-open) {
    --sidebar: 76px;
  }
  body:not(.sidebar-open) .brand-name,
  body:not(.sidebar-open) .nav-item span:not(.icon),
  body:not(.sidebar-open) button.fold {
    display: none;
  }
  body:not(.sidebar-open) .sidebar-top {
    justify-content: center;
    padding: 0;
  }
  body:not(.sidebar-open) .nav-item {
    justify-content: center;
    padding: 12px 0;
  }
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }
  .spotlight {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .spotlight-art .coin-img {
    width: 112px;
    height: 112px;
    border-radius: 20px;
  }
  .facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  /* On a phone the menu becomes a tab bar along the bottom. */
  body:not(.sidebar-open),
  body.sidebar-folded {
    --sidebar: 0px;
  }
  .sidebar {
    inset: auto 0 0 0;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 60px;
    padding: 0 8px;
    border-right: 0;
    border-top: 1px solid var(--steel);
  }
  .sidebar-top {
    display: none;
  }
  .nav {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }
  .nav-item,
  body:not(.sidebar-open) .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    font-size: 11px;
    line-height: 14px;
  }
  body:not(.sidebar-open) .nav-item span:not(.icon) {
    display: inline;
  }
  .shell {
    padding-bottom: 60px;
  }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
  }
  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .search kbd {
    display: none;
  }
  .page {
    padding: 12px 12px 32px;
  }
  .hero {
    min-height: 540px;
    border-radius: 20px;
  }
  .hero-body {
    padding-bottom: 44px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .spotlight {
    padding: 20px;
  }
  .spotlight-stats {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, auto);
    gap: 8px 20px;
  }
  .form-pair,
  .links-grid,
  .agent-keys,
  .stats,
  .two-col,
  .brain-panels,
  .brain-piles,
  .temper-grid {
    grid-template-columns: 1fr;
  }
  .coin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .coins-head h2 {
    font-size: 30px;
  }
  .big-price {
    font-size: 42px;
  }
  .chart-box {
    height: 260px;
  }
  .activity-row {
    grid-template-columns: 48px minmax(0, 1fr) 60px;
  }
  .activity-who,
  .activity-tx {
    display: none;
  }
  .footer-inner {
    padding: 0 16px 16px;
  }
  .footer-mark {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }
  .footer-word {
    font-size: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
