/* ================================================================
   CoinNoriter — Coin Market (mb- prefix)
   coin_market_data.css — panel-card layout, revenue-first
   v15: full rebuild — price table + exchange bridge + sector cards
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --mb-bg:          #080814;
  --mb-surface:     #12122a;
  --mb-surface2:    #0f1528;
  --mb-card:        #1a1a2e;
  --mb-border:      rgba(255,255,255,0.07);
  --mb-gold:        #f0b90b;
  --mb-gold-dim:    rgba(240,185,11,0.18);
  --mb-up:          #26d97b;
  --mb-dn:          #f04e5e;
  --mb-text:        #e8e8f0;
  --mb-muted:       #8888aa;
  --mb-radius:      1.4rem;
  --mb-radius-sm:   8px;
}

/* ── Page wrapper ──────────────────────────────────────────────── */
/* content_wrap_class = "container mt-4" — same as exchange page */
.mb-page {
  color: var(--mb-text);
  word-break: keep-all;
  padding-bottom: 1.5rem;
  overflow-x: hidden; /* prevent page-level horizontal scroll; supported universally */
}

/* Override global style.css: .container { min-height:100vh; display:flex } */
.container.mt-4 {
  min-height: 0 !important;
  display: block !important;
  flex-direction: unset !important;
}

/* ── Shared colours ────────────────────────────────────────────── */
.mb-up { color: var(--mb-up); }
.mb-dn { color: var(--mb-dn); }

/* ================================================================
   SECTIONS — flat sections, same as exchange page card rows
   ================================================================ */
.mb-panel {
  margin-bottom: 0;
  border-bottom: 1px solid var(--mb-border);
}

.mb-panel-content {
  padding: 1.6rem 1rem;
}

/* Hero section */
.mb-panel-hero {
  background:
    radial-gradient(circle at top left,  rgba(26,42,80,0.7), transparent 60%),
    linear-gradient(160deg, #10132e 0%, #0b1322 100%);
}

/* Discovery section */
.mb-panel-discovery {
  background: var(--mb-surface);
}

/* Scanner section */
.mb-panel-scanner {
  background: var(--mb-surface2);
}

/* Action / CTA section */
.mb-panel-action {
  background:
    radial-gradient(circle at top right, rgba(30,50,100,0.5), transparent 55%),
    linear-gradient(135deg, #0f1535 0%, #0a1020 100%);
}

/* ================================================================
   HERO PANEL INNER ELEMENTS
   ================================================================ */

/* Top bar: currency select + time + back link */
.mb-brief-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  gap: 12px;
}

.mb-brief-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Page identity block */
.mb-page-identity {
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--mb-border);
}

.mb-page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--mb-text);
  margin: 0 0 5px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mb-page-tagline {
  font-size: 0.84rem;
  color: var(--mb-muted);
  margin: 0;
  line-height: 1.5;
}

/* currency selector */
.mb-currency-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--mb-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.mb-currency-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mb-muted);
  min-width: 60px;
  padding: 0.48rem 0.82rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.mb-currency-btn:hover {
  color: var(--mb-text);
  background: rgba(255,255,255,0.06);
}

.mb-currency-btn.is-active {
  background: #f0b90b;
  color: #10131f;
  box-shadow: 0 6px 18px rgba(240,185,11,0.22);
}

.mb-cur-select {
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(255,255,255,0.08);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--mb-text) !important;
  border: 1px solid var(--mb-border);
  border-radius: 12px;
  padding: 0.6rem 2.35rem 0.6rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 100px;
  line-height: 1.1;
  cursor: pointer;
  width: 100px;
  text-align: left;
  text-align-last: left;
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.mb-cur-select--hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px !important;
  min-width: 1px;
  padding: 0;
  margin: 0;
}
.mb-cur-select:focus {
  outline: none;
  border-color: var(--mb-gold);
  box-shadow: 0 0 0 3px rgba(240,185,11,0.12);
}
.mb-cur-select:hover {
  border-color: rgba(240,185,11,0.35);
}
.mb-cur-select option {
  color: #10131f;
}

/* live dot + time */
.mb-time {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mb-muted);
  white-space: nowrap;
}

.mb-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--mb-up);
  border-radius: 50%;
  animation: mb-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes mb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.65); }
}

/* back link */
.mb-back {
  font-size: 0.8rem;
  color: var(--mb-muted);
  text-decoration: none;
  white-space: nowrap;
}
.mb-back:hover { color: var(--mb-text); }

/* market headline block */
.mb-headline-block {
  margin-bottom: 1.2rem;
}

/* sentiment badge */
.mb-signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.mb-signal-bull {
  background: rgba(38,217,123,0.15);
  color: var(--mb-up);
  border: 1px solid rgba(38,217,123,0.28);
}
.mb-signal-bear {
  background: rgba(240,78,94,0.15);
  color: var(--mb-dn);
  border: 1px solid rgba(240,78,94,0.28);
}
.mb-signal-mixed {
  background: rgba(255,255,255,0.05);
  color: var(--mb-muted);
  border: 1px solid var(--mb-border);
}

/* market headline h2 */
.mb-headline {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--mb-text);
}
.mb-hl-up { color: var(--mb-up); }
.mb-hl-dn { color: var(--mb-dn); }

/* spotlight pills */
.mb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.mb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--mb-border);
  border-radius: 20px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.mb-pill-trending { border-color: rgba(240,185,11,0.2); }
.mb-pill-gainer   { border-color: rgba(38,217,123,0.22); }
.mb-pill-loser    { border-color: rgba(240,78,94,0.22); }

.mb-pill-ico {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: contain;
}

.mb-stale {
  font-size: 0.76rem;
  color: #f0b90b;
  background: rgba(240,185,11,0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Hero CTAs */
.mb-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

/* ── Shared buttons ─────────────────────────────────────────────── */
.mb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--mb-radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  transition: filter 0.15s, transform 0.12s;
}
.mb-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.mb-btn-primary {
  background: var(--mb-gold);
  color: #000;
}

.mb-btn-exchange {
  background: rgba(255,255,255,0.07);
  color: var(--mb-text);
  border: 1px solid var(--mb-border);
}
.mb-btn-exchange:hover { color: var(--mb-gold); border-color: var(--mb-gold-dim); }

/* ================================================================
   DISCOVERY PANEL — opportunity cards
   ================================================================ */
.mb-discovery-hd {
  margin-bottom: 1.2rem;
}

.mb-discovery-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 5px;
  color: var(--mb-text);
}

.mb-discovery-sub {
  font-size: 0.82rem;
  color: var(--mb-muted);
  margin: 0;
  line-height: 1.5;
}

/* card grid: 4-col desktop → 2-col tablet → 1-col mobile */
.mb-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 991px) {
  .mb-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .mb-cards { grid-template-columns: repeat(2, 1fr); gap: 9px; }
}
@media (max-width: 400px) {
  .mb-cards { grid-template-columns: 1fr; }
}

/* individual card */
.mb-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.15s, transform 0.15s;
}
.mb-card:hover {
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-2px);
}

/* card colour accents by tag */
.mb-card-gainer   { border-top: 2px solid var(--mb-up); }
.mb-card-loser    { border-top: 2px solid var(--mb-dn); }
.mb-card-trending { border-top: 2px solid var(--mb-gold); }

/* tag badge */
.mb-card-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mb-tag-gainer   { color: var(--mb-up); }
.mb-tag-loser    { color: var(--mb-dn); }
.mb-tag-trending { color: var(--mb-gold); }

.mb-card-vol {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--mb-muted);
  margin-left: auto;
  text-transform: none;
}

/* coin row */
.mb-card-coin {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mb-card-ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.mb-card-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mb-card-sym {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.mb-card-name {
  font-size: 0.7rem;
  color: var(--mb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-card-chg {
  font-size: 0.88rem;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.mb-card-price {
  font-size: 0.8rem;
  color: var(--mb-muted);
  font-variant-numeric: tabular-nums;
}

/* card action buttons */
.mb-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 3px;
}

.mb-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.12s;
  white-space: nowrap;
}
.mb-card-btn:hover { filter: brightness(1.12); text-decoration: none; }

.mb-card-demo {
  background: rgba(255,255,255,0.07);
  color: var(--mb-text);
  border: 1px solid var(--mb-border);
}

.mb-card-buy {
  background: var(--mb-gold);
  color: #000;
}

/* ================================================================
   SECTOR STRIP — inside discovery panel, no separate background
   ================================================================ */
.mb-sector-strip {
  padding: 0.8rem 0 0.2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  border-top: 1px solid var(--mb-border);
  margin-top: 1rem;
}

.mb-sector-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mb-muted);
  flex-shrink: 0;
}

.mb-sector-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.79rem;
}

.mb-sector-name {
  color: var(--mb-muted);
}

.mb-sector-div {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--mb-border);
  vertical-align: middle;
}

/* ================================================================
   MARKET SCANNER PANEL
   Replaces the old collapsed ranking table.
   Shows top gainers / losers / trending as signal-based rows.
   ================================================================ */
.mb-scanner-hd {
  margin-bottom: 1.2rem;
}

.mb-scanner-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0 0 4px;
}

.mb-scanner-sub {
  font-size: 0.8rem;
  color: var(--mb-muted);
  margin: 0;
}

/* three-column grid */
.mb-scanner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.2rem;
}

@media (max-width: 767px) {
  .mb-scanner-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .mb-scanner-grid { grid-template-columns: 1fr; }
}

/* column */
.mb-scanner-col {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  overflow: hidden;
}

/* column header */
.mb-scanner-col-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--mb-border);
}
.mb-scanner-col-hd-up {
  color: var(--mb-up);
  background: rgba(38,217,123,0.06);
}
.mb-scanner-col-hd-dn {
  color: var(--mb-dn);
  background: rgba(240,78,94,0.06);
}
.mb-scanner-col-hd-trend {
  color: var(--mb-gold);
  background: rgba(240,185,11,0.06);
}

/* individual row inside column */
.mb-scanner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mb-border);
  text-decoration: none;
  color: var(--mb-text);
  transition: background 0.1s;
}
.mb-scanner-row:last-child { border-bottom: none; }
.mb-scanner-row:hover { background: rgba(255,255,255,0.04); text-decoration: none; color: var(--mb-text); }

.mb-scanner-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.mb-scanner-sym {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mb-scanner-price {
  font-size: 0.76rem;
  color: var(--mb-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: none; /* shown on desktop only */
}

.mb-scanner-chg {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .mb-scanner-price { display: block; }
}

/* scanner CTA strip */
.mb-scanner-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--mb-border);
}

/* empty state */
.mb-scanner-empty {
  padding: 14px 12px;
  font-size: 0.8rem;
  color: var(--mb-muted);
  text-align: center;
}

/* ================================================================
   ACTION / CTA PANEL
   ================================================================ */
.mb-action-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.mb-action-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
}

.mb-action-hl {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mb-text);
  line-height: 1.3;
}

.mb-action-sub {
  font-size: 0.84rem;
  color: var(--mb-muted);
  line-height: 1.5;
}

.mb-action-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 991px) {
  .mb-panel-content {
    padding: 1.6rem 1.6rem;
  }
}

@media (max-width: 767px) {
  .mb-panel-content {
    padding: 1.2rem 1rem;
  }
  .mb-brief-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .mb-brief-left {
    flex-wrap: wrap;
    gap: 10px;
  }
  .mb-time {
    line-height: 1.35;
  }
  .mb-currency-btn {
    min-width: 52px;
    padding: 0.44rem 0.7rem;
    font-size: 0.8rem;
  }
  .mb-page-title { font-size: 1.35rem; }
  .mb-page-tagline { font-size: 0.78rem; }
  .mb-headline { font-size: 1.15rem; }
  .mb-action-inner { flex-direction: column; align-items: flex-start; }
  .mb-action-btns  { width: 100%; }
  .mb-action-btns .mb-btn { flex: 1; }
  .mb-hero-actions .mb-btn { flex: 1; text-align: center; }
}

@media (max-width: 575px) {
  .mb-panel-content {
    padding: 1rem 1rem;
  }
  .mb-headline { font-size: 1rem; }
}

/* ================================================================
   HERO v15 — market status + key coin stats + single CTA
   ================================================================ */

/* market status row */
.mb-market-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.mb-status-counts {
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  line-height: 1;
}
.mb-status-counts .mb-up,
.mb-status-counts .mb-dn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1;
}
.mb-status-div { color: var(--mb-muted); font-weight: 400; }

/* key coin chips row */
.mb-key-coins {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.mb-key-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--mb-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
}
.mb-key-ico {
  width: 18px; height: 18px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.mb-key-sym { font-weight: 700; }
.mb-key-price { color: var(--mb-text); font-variant-numeric: tabular-nums; }

/* single hero CTA */
.mb-hero-cta { margin-top: 0.5rem; }
.mb-btn-sm {
  padding: 7px 16px;
  font-size: 0.82rem;
}

/* ================================================================
   TOP MOVERS PANEL (replaces discovery + scanner)
   ================================================================ */
.mb-panel-movers { background: var(--mb-surface); }

.mb-movers-hd {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.mb-movers-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0;
}
.mb-movers-sub {
  font-size: 0.78rem;
  color: var(--mb-muted);
}

.mb-movers-note {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--mb-muted);
}

/* wrapping chip row — no horizontal scroll, chips wrap to next line */
.mb-mover-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 4px;
}
.mb-mover-row::after {
  content: "";
  flex: 0 0 1rem;
}

.mb-mover-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--mb-border);
  text-decoration: none;
  color: var(--mb-text);
  font-size: 0.8rem;
  transition: background 0.12s, border-color 0.12s;
  scroll-snap-align: start;
}
.mb-mover-chip:hover { background: rgba(255,255,255,0.08); text-decoration: none; color: var(--mb-text); }
.mb-mover-gainer   { border-top: 2px solid var(--mb-up); }
.mb-mover-loser    { border-top: 2px solid var(--mb-dn); }
.mb-mover-trending { border-top: 2px solid var(--mb-gold); }
.mb-mover-ico {
  width: 18px; height: 18px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.mb-mover-sym { font-weight: 700; }
.mb-mover-chg { font-weight: 700; font-size: 0.78rem; }

/* ================================================================
   COIN PRICE TABLE PANEL
   ================================================================ */
.mb-panel-table { background: var(--mb-surface2); }

.mb-table-hd { margin-bottom: 1rem; }
.mb-table-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0 0 4px;
}
.mb-table-sub {
  font-size: 0.8rem;
  color: var(--mb-muted);
  margin: 0;
  line-height: 1.5;
}

.mb-coin-table-wrap { margin-bottom: 0.75rem; }
.mb-coin-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  /* font scales with viewport: 0.72rem floor → 0.83rem cap */
  font-size: clamp(0.72rem, 2.3vw, 0.83rem);
  color: var(--mb-text);
}
.mb-coin-table thead th {
  /* em padding so it scales with the clamp font-size automatically */
  padding: 0.55em 0.65em;
  border-bottom: 1px solid var(--mb-border);
  color: var(--mb-muted);
  font-weight: 600;
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  background: rgba(255,255,255,0.02);
}
.mb-coin-table thead th:hover { color: var(--mb-text); }
.mb-coin-table tbody tr {
  border-bottom: 1px solid var(--mb-border);
  cursor: pointer;
  transition: background 0.1s;
}
.mb-coin-table tbody tr:last-child { border-bottom: none; }
.mb-coin-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.mb-coin-table tbody td {
  padding: 0.55em 0.65em;
  vertical-align: middle;
}

/* rank cell */
.rank-cell { width: 2.2em; text-align: right; }
.rank-number { color: var(--mb-muted); }
.rank-1 { color: #f0b90b; font-weight: 700; }
.rank-2 { color: #a8a8a8; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }

/* coin name cell */
.coin-info-cell { min-width: 0; }
.coin-info-wrapper { display: flex; align-items: center; gap: 0.45em; }
.coin-logo {
  width: 1.6em; height: 1.6em;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.coin-name-truncate {
  font-weight: 700;
  white-space: nowrap;
}

/* price/change cells */
.price-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.change-cell { font-weight: 700; white-space: nowrap; }
.market-cap-cell, .volume-cell { color: var(--mb-muted); white-space: nowrap; }
.high-cell, .low-cell { white-space: nowrap; }

/* loading row */
.mb-table-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--mb-muted);
  font-size: 0.85rem;
}

/* table bottom CTA */
.mb-table-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mb-border);
  flex-wrap: wrap;
}
.mb-table-cta-text {
  font-size: 0.83rem;
  color: var(--mb-muted);
  flex: 1;
  min-width: 10rem;
}

/* ================================================================
   EXCHANGE BRIDGE PANEL
   ================================================================ */
.mb-panel-bridge {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,0.12), transparent 55%),
    linear-gradient(135deg, #0f1535 0%, #0a1020 100%);
  border-top: 1px solid rgba(240,185,11,0.18);
}

.mb-bridge-hd { margin-bottom: 1.2rem; }
.mb-bridge-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0 0 5px;
}
.mb-bridge-sub {
  font-size: 0.83rem;
  color: var(--mb-muted);
  margin: 0;
}

.mb-bridge-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.mb-bridge-card {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--mb-text);
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.mb-bridge-card:hover {
  border-color: rgba(240,185,11,0.45);
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--mb-text);
}
.mb-bridge-card--primary {
  border-color: rgba(240,185,11,0.3);
  background: rgba(240,185,11,0.05);
}

.mb-bridge-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mb-bridge-logo {
  height: 1.8rem;
  max-width: 5rem;
  object-fit: contain;
}
.mb-bridge-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mb-bridge-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.mb-bridge-badge {
  font-size: 0.7rem;
  color: var(--mb-gold);
  font-weight: 600;
}
.mb-bridge-desc {
  font-size: 0.78rem;
  color: var(--mb-muted);
  line-height: 1.4;
}
.mb-bridge-btn {
  display: inline-block;
  background: var(--mb-gold);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 6px;
  text-align: center;
  margin-top: 2px;
}
.mb-bridge-affiliate {
  font-size: 0.72rem;
  color: var(--mb-muted);
}

.mb-bridge-note {
  font-size: 0.75rem;
  color: var(--mb-muted);
  margin: 0;
  opacity: 0.75;
}

/* ================================================================
   SECTOR CARDS PANEL
   ================================================================ */
.mb-panel-sectors { background: var(--mb-surface); }

.mb-sector-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0 0 1rem;
}

.mb-sector-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 991px) { .mb-sector-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .mb-sector-cards { grid-template-columns: 1fr; } }

.mb-sector-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mb-sector-card--up { border-top: 2px solid var(--mb-up); }
.mb-sector-card--dn { border-top: 2px solid var(--mb-dn); }

.mb-sector-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mb-sector-card-name { font-weight: 700; font-size: 0.88rem; }
.mb-sector-card-chg  { font-weight: 700; font-size: 0.85rem; }
.mb-sector-card-meta { font-size: 0.72rem; color: var(--mb-muted); }
.mb-sector-card-leader {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
}
.mb-sector-leader-ico {
  width: 16px; height: 16px;
  border-radius: 50%;
  object-fit: contain;
}
.mb-sector-card-desc {
  font-size: 0.72rem;
  color: var(--mb-muted);
  line-height: 1.4;
  border-top: 1px solid var(--mb-border);
  padding-top: 6px;
  margin-top: 2px;
}

/* ================================================================
   AD SLOT PLACEHOLDERS (not active — commented out in template)
   ================================================================ */
.mb-ad-slot {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--mb-muted);
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--mb-border);
  border-bottom: 1px solid var(--mb-border);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ================================================================
   v15 RESPONSIVE ADDITIONS
   ================================================================ */
@media (max-width: 767px) {
  .mb-key-coins { gap: 6px; }
  .mb-key-coin  { padding: 5px 9px; font-size: 0.76rem; }
  .mb-bridge-card { min-width: 160px; }
  .mb-bridge-cards { flex-direction: column; }
  .mb-sector-cards { gap: 8px; }
}
@media (max-width: 480px) {
  .mb-bridge-card { min-width: 100%; }
}

/* ================================================================
   v16 — TICKER BAR + SOUND SYSTEM + BEGINNER INSIGHTS
   ================================================================ */

/* ── Live Ticker Bar ────────────────────────────────────────────── */
.cm-ticker-bar {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: rgba(8, 10, 28, 0.96);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  margin: 0 0 1.2rem;
  height: 38px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

/* overflow clip container */
.cm-ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  /* soft fade-out on both edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}

/* scrolling track — content doubled in JS for seamless loop */
.cm-ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  height: 100%;
  /* animation started/reset by coin_market_ticker.js */
}

@keyframes cm-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* individual message */
.cm-tk-item {
  display: inline-block;
  padding: 0 18px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--mb-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 38px;
}

/* dot separator between messages */
.cm-tk-sep {
  color: var(--mb-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
  line-height: 38px;
}

/* loading placeholder (before JS populates) */
.cm-tk-loading {
  color: var(--mb-muted);
  font-style: italic;
}

/* ── Sound Toggle Button ─────────────────────────────────────────── */
.cm-sound-btn {
  flex-shrink: 0;
  min-width: 74px;
  height: 100%;
  background: none;
  border: none;
  border-left: 1px solid var(--mb-border);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  color: var(--mb-muted);
  transition: color 0.15s, background 0.15s;
  padding: 0 0.55rem;
}
.cm-sound-btn:hover {
  color: var(--mb-text);
  background: rgba(255,255,255,0.04);
}
.cm-sound-btn:focus-visible {
  outline: 2px solid var(--mb-gold);
  outline-offset: -2px;
}

.cm-sound-icon {
  font-size: 0.98rem;
  line-height: 1;
}

.cm-sound-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ── Beginner Insights Panel ─────────────────────────────────────── */
.mb-panel-insights {
  background: var(--mb-surface2);
  border-top: 1px solid var(--mb-border);
}

.mb-insights-hd {
  margin-bottom: 1.2rem;
}

.mb-insights-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mb-text);
  margin: 0 0 4px;
}

.mb-insights-sub {
  font-size: 0.78rem;
  color: var(--mb-muted);
  margin: 0;
  font-style: italic;
}

/* 3-column grid on desktop, 1-col on mobile */
.mb-insight-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 991px) {
  .mb-insight-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .mb-insight-cards { grid-template-columns: 1fr; }
}

/* Individual insight card */
.mb-insight-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--mb-border);
  border-radius: 10px;
  min-width: 0;       /* prevents flex children from overflowing grid cell */
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word; /* override keep-all for CJK insight text */
}

/* colour accents by sentiment */
.mb-insight-bull { border-top: 2px solid var(--mb-up); }
.mb-insight-bear { border-top: 2px solid var(--mb-dn); }
.mb-insight-mixed { border-top: 2px solid var(--mb-muted); }
.mb-insight-tip  { border-top: 2px solid rgba(240,185,11,0.5); }

/* icon column */
.mb-insight-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

/* text body */
.mb-insight-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mb-insight-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--mb-text);
  line-height: 1.3;
}

.mb-insight-text {
  font-size: 0.78rem;
  color: var(--mb-muted);
  line-height: 1.55;
  margin: 0;
}

/* inline demo CTA link inside standout card */
.mb-insight-cta {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--mb-gold);
  text-decoration: none;
}
.mb-insight-cta:hover {
  text-decoration: underline;
  color: var(--mb-gold);
}

/* ── Ticker bar responsive ───────────────────────────────────────── */
@media (max-width: 767px) {
  .cm-ticker-bar { height: 34px; }
  .cm-tk-item    { font-size: 0.72rem; line-height: 34px; padding: 0 12px; }
  .cm-tk-sep     { line-height: 34px; }
  .cm-sound-btn  { min-width: 64px; }
  .mb-mover-chip {
    padding: 7px 10px;
    font-size: 0.76rem;
  }
  .mb-mover-chg {
    font-size: 0.75rem;
  }
  .mb-sector-card {
    padding: 11px;
  }
}

/* ================================================================
   FIX A — Contain ticker bar's negative-margin bleed.
   cm-ticker-bar uses margin: -X -1rem to bleed edge-to-edge inside
   the hero panel. Without overflow containment on the panel, the
   negative margin escapes to .mb-page / .container and makes the
   page body wider than the viewport, creating a silent horizontal
   scroll. On mobile this causes the last mover chip to appear
   clipped (page is scrolled slightly right by default).
   ================================================================ */
.mb-panel-hero {
  overflow-x: hidden;
}

/* ================================================================
   FIX B — Hide orphaned high/low cells that have no <thead> column.
   coin_market_data.js renders 8 <td> cells per row:
     rank | name | price | change | HIGH | LOW | market_cap | volume
   But <thead> defines only 6 <th>:
     #  | Coin | Price | 24h | Mkt Cap | Volume
   The extra high/low cells push market_cap and volume one column
   right of their matching header, breaking the table layout on all
   screen sizes.
   ================================================================ */
.high-cell,
.low-cell {
  display: none;
}

/* Hide market-cap and volume DATA cells on mobile to match the hidden <th> headers.
   JS renders these cells without Bootstrap d-none classes, causing 6 data cols
   but only 4 header cols on small screens → misalignment + horizontal overflow. */
@media (max-width: 767px) {
  .market-cap-cell,
  .volume-cell {
    display: none;
  }
  .rank-cell { width: 2rem; }
}

/* ================================================================
   v17 — Landing hero + trust row + secondary CTA + demo strip
   ================================================================ */

/* ── Landing hero eyebrow ────────────────────────────────────────── */
.mb-hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mb-gold);
  margin: 0 0 0.55rem;
  opacity: 0.9;
}

/* ── Landing H1: larger, bolder ──────────────────────────────────── */
.mb-page-identity-landing .mb-page-title {
  font-size: clamp(1.55rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

/* ── Tagline under H1 ────────────────────────────────────────────── */
.mb-page-identity-landing .mb-page-tagline {
  font-size: 0.88rem;
  color: var(--mb-muted);
  max-width: 520px;
  line-height: 1.55;
  margin-bottom: 0.8rem;
}

/* ── Trust row ───────────────────────────────────────────────────── */
.mb-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin-bottom: 1.1rem;
}
.mb-trust-item {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--mb-text);
  opacity: 0.82;
  white-space: nowrap;
}

/* ── Hero CTA: side-by-side primary + ghost ─────────────────────── */
.mb-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
}
.mb-btn-lg {
  padding: 0.7rem 1.5rem;
  font-size: 0.97rem;
}
.mb-btn-ghost {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid rgba(240,185,11,0.4);
  border-radius: 100px;
  color: var(--mb-gold);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s;
  white-space: nowrap;
}
.mb-btn-ghost:hover {
  border-color: var(--mb-gold);
  background: var(--mb-gold-dim);
  color: var(--mb-gold);
  text-decoration: none;
}

/* ── Demo CTA strip (between movers and price table) ─────────────── */
.mb-demo-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: linear-gradient(135deg, rgba(240,185,11,0.08) 0%, rgba(240,185,11,0.04) 100%);
  border: 1px solid rgba(240,185,11,0.18);
  border-radius: var(--mb-radius-sm);
  padding: 0.75rem 1.1rem;
  margin-bottom: 0.75rem;
}
.mb-demo-strip-text {
  font-size: 0.84rem;
  color: var(--mb-text);
  opacity: 0.88;
  flex: 1;
  min-width: 0;
}

/* ── Mobile overrides for v17 additions ──────────────────────────── */
@media (max-width: 767px) {
  .mb-page-identity-landing .mb-page-title {
    font-size: 1.55rem;
  }
  .mb-page-identity-landing .mb-page-tagline {
    font-size: 0.82rem;
  }
  .mb-trust-row {
    gap: 0.35rem 0.8rem;
  }
  .mb-btn-lg {
    padding: 0.65rem 1.2rem;
    font-size: 0.9rem;
  }
  .mb-btn-ghost {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
  }
  .mb-demo-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .mb-demo-strip-text {
    font-size: 0.8rem;
  }
}

/* ================================================================
   PHASE 4 — Practice recommendation panel
   ================================================================ */
.mb-panel-practice {
  background: linear-gradient(135deg, #0f1a35 0%, #0b1220 100%);
  border-bottom: 1px solid rgba(240,185,11,0.18);
}
.mb-practice-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.mb-practice-left {
  flex: 1;
  min-width: 0;
}
.mb-practice-badge {
  display: inline-block;
  background: var(--mb-gold-dim);
  color: var(--mb-gold);
  border: 1px solid rgba(240,185,11,0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}
.mb-practice-coin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.mb-practice-ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.mb-practice-sym {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mb-text);
}
.mb-practice-chg {
  font-size: 1rem;
  font-weight: 600;
}
.mb-practice-reason {
  font-size: 0.84rem;
  color: var(--mb-muted);
  margin: 0;
  line-height: 1.5;
}
.mb-practice-cta {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .mb-practice-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .mb-practice-cta {
    width: 100%;
    text-align: center;
  }
}

/* ================================================================
   PHASE 4 — Price flash animation on data refresh
   ================================================================ */
@keyframes cm-flash-up {
  0%   { background-color: rgba(38,217,123,0.25); }
  100% { background-color: transparent; }
}
@keyframes cm-flash-dn {
  0%   { background-color: rgba(240,78,94,0.20); }
  100% { background-color: transparent; }
}
.cm-price-flash-up {
  animation: cm-flash-up 0.9s ease-out forwards;
}
.cm-price-flash-dn {
  animation: cm-flash-dn 0.9s ease-out forwards;
}

/* ================================================================
   PHASE 4 — Sector risk badges + strongest/weakest markers
   ================================================================ */
.mb-sector-card--strongest {
  border-color: rgba(240,185,11,0.45) !important;
}
.mb-sector-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.mb-sector-badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.mb-sector-badge--hot {
  background: rgba(240,185,11,0.15);
  color: var(--mb-gold);
  border: 1px solid rgba(240,185,11,0.3);
}
.mb-sector-badge--weak {
  background: rgba(240,78,94,0.12);
  color: var(--mb-dn);
  border: 1px solid rgba(240,78,94,0.25);
}
.mb-sector-badge--speculative {
  background: rgba(255,100,50,0.12);
  color: #ff8c5a;
  border: 1px solid rgba(255,100,50,0.25);
}
.mb-sector-badge--moderate {
  background: rgba(100,160,255,0.10);
  color: #7fb3ff;
  border: 1px solid rgba(100,160,255,0.22);
}
.mb-sector-badge--stable {
  background: rgba(38,217,123,0.10);
  color: var(--mb-up);
  border: 1px solid rgba(38,217,123,0.22);
}
.mb-sector-card-caution {
  font-size: 0.72rem;
  color: #ff8c5a;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,100,50,0.15);
}

/* ================================================================
   PHASE 4 — Mobile sticky CTA bar
   ================================================================ */
.cm-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: linear-gradient(135deg, #10183a 0%, #0a1020 100%);
  border-top: 1px solid rgba(240,185,11,0.25);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.cm-sticky-cta--visible {
  transform: translateY(0);
}
.cm-sticky-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--mb-muted);
  min-width: 0;
}
.cm-sticky-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.cm-sticky-close {
  background: none;
  border: none;
  color: var(--mb-muted);
  font-size: 1.1rem;
  padding: 0 0.2rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.cm-sticky-close:hover {
  color: var(--mb-text);
}
/* Desktop: never show sticky CTA */
@media (min-width: 768px) {
  .cm-sticky-cta { display: none !important; }
}
}
