.market-wrap {
  --mk-ink: #0b1b2b;
  --mk-ink-2: #14304a;
  --mk-accent: #0e7c86;
  --mk-accent-soft: rgba(14, 124, 134, .1);
  --mk-up: #0f9d77;
  --mk-down: #e5484d;
  --mk-line: rgba(100, 116, 139, .25);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}

.market-wrap .mk-up { color: var(--mk-up) !important; }
.market-wrap .mk-down { color: var(--mk-down) !important; }

/* ---------- Hero ---------- */
.market-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 2rem 2rem 2.25rem;
  color: #fff;
  background-color: var(--mk-ink);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cpolyline fill='none' stroke='%232dd4bf' stroke-opacity='.35' stroke-width='2' points='0,95 50,80 100,88 150,60 200,70 250,40 300,52 350,30 400,44 450,22 500,34 550,12 600,18'/%3E%3C/svg%3E"),
    linear-gradient(120deg, var(--mk-ink) 40%, var(--mk-ink-2));
  background-repeat: no-repeat;
  background-position: bottom right, center;
  background-size: 70% 55%, cover;
}
.market-hero h1 { letter-spacing: -.02em; }
.market-hero .mk-chip {
  display: inline-block; padding: .2rem .65rem; margin: .15rem .15rem 0 0;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px;
  color: #e2e8f0; font-size: .8rem; text-decoration: none;
}
.market-hero .mk-chip:hover, .market-hero .mk-chip.active { background: rgba(255, 255, 255, .15); color: #fff; }

/* ---------- Cards ---------- */
.market-card, .market-panel {
  border: 1px solid var(--mk-line);
  border-radius: .85rem;
  background: var(--bs-body-bg, #fff);
}
.market-card .market-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mk-accent-soft); color: var(--mk-accent); font-size: 1.2rem;
}
.market-card .card-title { font-size: 1.05rem; font-weight: 600; }
.market-card:hover { border-color: var(--mk-accent); }

.market-price { font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.market-badge { display: inline-block; padding: .2rem .55rem; border-radius: .4rem; font-size: .85rem; font-weight: 600; }
.market-badge.up { background: rgba(15, 157, 119, .12); color: var(--mk-up); }
.market-badge.down { background: rgba(229, 72, 77, .12); color: var(--mk-down); }

.market-stat {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4rem 0; border-bottom: 1px dashed var(--mk-line); font-size: .9rem;
}
.market-stat:last-child { border-bottom: 0; }
.market-stat span:first-child { color: var(--bs-secondary-color, #6c757d); }
.market-stat span:last-child { font-weight: 600; text-align: right; }

.market-view-btn {
  background: var(--mk-ink); border-color: var(--mk-ink); color: #fff;
  display: block; width: 100%; text-align: center;
}
.market-view-btn:hover { background: var(--mk-accent); border-color: var(--mk-accent); color: #fff; }

.mk-link-chip {
  display: inline-block; padding: .15rem .55rem; margin: 0 .25rem .35rem 0;
  border: 1px solid var(--mk-line); border-radius: 999px; font-size: .8rem;
  color: inherit; text-decoration: none;
}
.mk-link-chip:hover { border-color: var(--mk-accent); color: var(--mk-accent); }

/* ---------- Detail pages ---------- */
.market-symbol {
  background: var(--mk-ink); color: #fff; font-weight: 600; letter-spacing: .02em;
  padding: .45rem .7rem; border-radius: .45rem; font-size: .95rem;
}
.market-nav .nav-link { color: inherit; font-size: .9rem; white-space: nowrap; border-radius: .5rem; }
.market-nav .nav-link.active { background: var(--mk-ink); color: #fff; }
.market-nav { scrollbar-width: thin; }

.market-table { font-size: .9rem; }
.market-table thead th {
  position: sticky; top: 0; background: var(--bs-tertiary-bg, #f8f9fa);
  font-weight: 600; white-space: nowrap;
}
.market-table .latest-col, .market-table .latest-row td { background: var(--mk-accent-soft); font-weight: 600; }
.market-table tbody th { font-weight: 500; white-space: nowrap; }

.market-chart-wrap { position: relative; height: 320px; }
.market-kpi { border: 1px solid var(--mk-line); border-radius: .7rem; padding: .9rem 1rem; height: 100%; }
.market-kpi .label { font-size: .8rem; color: var(--bs-secondary-color, #6c757d); }
.market-kpi .value { font-size: 1.35rem; font-weight: 700; }

.market-note {
  border-left: 3px solid var(--mk-accent); background: var(--mk-accent-soft);
  padding: .75rem 1rem; border-radius: .25rem; font-size: .9rem;
}
.market-empty { text-align: center; padding: 2.5rem 1rem; color: var(--bs-secondary-color, #6c757d); }
.market-empty i { font-size: 2rem; display: block; margin-bottom: .5rem; }

@media (max-width: 575.98px) {
  .market-hero { padding: 1.25rem; }
  .market-price { font-size: 1.7rem; }
  .market-chart-wrap { height: 240px; }
}
@media (prefers-reduced-motion: no-preference) {
  .market-card { transition: border-color .15s ease; }
}
