/* Markets screen: quiet charcoal surfaces, clear price hierarchy, restrained
   chart ink. Rules stay scoped so the surrounding app can evolve separately. */
#markets .markets-header {
  position: relative;
  align-items: center;
  margin: 18px 0 16px;
  padding-bottom: 4px;
}

#markets .markets-header .section-sub.wm-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 0 auto;
  color: rgba(255,255,255,.62);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.wm-ranges-host { margin: 0 0 22px; }
.wm-range-picker {
  display: flex;
  gap: 3px;
  width: 100%;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 15px;
  background: #151517;
}
.wm-range {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: rgba(255,255,255,.66);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.wm-range:hover { color: #fff; background: rgba(255,255,255,.055); }
.wm-range.active {
  border-color: rgba(255,255,255,.12);
  background: #303033;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.22);
}
.wm-range:focus-visible { outline: 2px solid rgba(255,255,255,.8); outline-offset: 2px; }

#markets #marketGrid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 14px;
  min-width: 0;
}
.wm-card {
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: linear-gradient(145deg, #1b1b1e 0%, #151517 58%, #121214 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 28px rgba(0,0,0,.16);
}
.wm-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wm-card-handle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab; }
.wm-card-lifted { position: relative; z-index: 5; cursor: grabbing; box-shadow: 0 18px 40px rgba(0,0,0,.45); border-color: rgba(255,255,255,.28); }
.wm-order-reset-host { display: flex; justify-content: center; }
.wm-reset-order { margin-top: 10px; padding: 10px 16px; border: 0; background: none; color: rgba(255,255,255,.56); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.wm-badge {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--wm-badge), transparent 65%);
  border-radius: 13px;
  background: color-mix(in srgb, var(--wm-badge), #141416 88%);
  color: var(--wm-badge);
  font-size: 17px;
  font-weight: 700;
}
.wm-badge svg { width: 19px; height: 19px; }
.wm-name { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.wm-name strong { overflow: hidden; font-size: 17px; font-weight: 680; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.wm-name span { overflow: hidden; color: rgba(255,255,255,.57); font-size: 12px; font-weight: 500; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.wm-change {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  line-height: 18px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.wm-change.positive { border-color: rgba(37,211,102,.16); background: rgba(37,211,102,.09); color: #45d483; }
.wm-change.negative { border-color: rgba(255,79,82,.17); background: rgba(255,79,82,.09); color: #ff7477; }
.wm-price-row { display: flex; align-items: baseline; gap: 9px; margin-top: 17px; }
.wm-price-row strong { color: #f7f7f8; font-size: clamp(32px, 8vw, 40px); font-weight: 690; line-height: 1.08; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.wm-price-row span { color: rgba(255,255,255,.58); font-size: 13px; font-weight: 600; white-space: nowrap; }
.wm-chart {
  display: block;
  width: 100%;
  height: 104px;
  margin: 14px 0 4px;
  overflow: visible;
  touch-action: none;
  user-select: none;
  outline: none;
}
.wm-chart:focus-visible { filter: drop-shadow(0 0 2px rgba(255,255,255,.34)); }
.wm-chart text { fill: rgba(255,255,255,.64); font-family: inherit; font-size: 9px; font-weight: 600; }
.wm-chart .wm-y-label { fill: rgba(255,255,255,.76); font-size: 10px; }
.wm-chart .wm-y-grid { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 1; }
.wm-chart .wm-x-grid { fill: none; stroke: rgba(255,255,255,.055); stroke-width: 1; }
.wm-chart .wm-roll path { fill: none; stroke: rgba(255,255,255,.34); stroke-width: 1; stroke-dasharray: 2 3; }
.wm-chart .wm-roll text { fill: rgba(255,255,255,.52); font-size: 8px; font-weight: 600; }
.wm-chart .wm-axis { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1; }
.wm-chart .wm-trend { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.wm-chart .wm-area { opacity: .08; }
.wm-chart .wm-last-point { filter: none; }
.wm-chart .wm-selection circle { fill: #171719; stroke-width: 2.5; }
.wm-chart .wm-selection .wm-crosshair { fill: none; stroke: rgba(255,255,255,.48); stroke-width: 1; stroke-dasharray: 3 3; }
.wm-chart .wm-selection .wm-tooltip-bg { fill: #252528; stroke: rgba(255,255,255,.2); }
.wm-chart .wm-selection text { fill: #fff; font-size: 10px; font-weight: 650; }
.wm-chart-empty {
  display: grid;
  min-height: 104px;
  place-items: center;
  color: rgba(255,255,255,.58);
  font-size: 13px;
}
.wm-session {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 3px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.68);
  font-size: 11px;
  line-height: 16px;
  font-weight: 550;
}
.wm-source { display: block; width: fit-content; margin: 10px 0 0 3px; color: rgba(255,255,255,.56); font-size: 10px; line-height: 16px; text-underline-offset: 3px; }
.wm-source:hover, .wm-source:focus-visible { color: #e3ae71; }
.wm-empty-state {
  grid-column: 1 / -1;
  padding: 36px 20px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: #151517;
  color: rgba(255,255,255,.68);
  text-align: center;
  font-size: 14px;
}

@media (min-width: 700px) {
  #markets #marketGrid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  #markets .markets-header, #markets .wm-ranges-host { max-width: 900px; }
  #markets .wm-ranges-host { margin-bottom: 26px; }
  #markets #marketGrid { max-width: 900px; }
  .wm-card { padding: 22px; border-radius: 24px; }
  .wm-chart { height: 128px; margin-top: 16px; }
}
@media (min-width: 1000px) {
  #markets .markets-header, #markets .wm-ranges-host { max-width: none; }
  #markets .wm-ranges-host { max-width: 640px; }
  #markets #marketGrid { max-width: none; gap: 18px; }
  .wm-chart { height: 138px; }
}
@media (min-width: 1280px) {
  #markets #marketGrid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
  .wm-card { padding: 22px; }
  .wm-chart { height: 132px; }
}
@media (max-width: 360px) {
  #markets .markets-header .section-sub.wm-date { margin-right: 0; font-size: 12px; }
  .wm-ranges-host { margin-bottom: 18px; }
  .wm-range-picker { gap: 1px; padding: 3px; }
  .wm-range { min-height: 38px; padding-inline: 3px; font-size: 12px; }
  .wm-card { padding: 16px; border-radius: 19px; }
  .wm-card-heading { gap: 9px; }
  .wm-badge { flex-basis: 36px; width: 36px; height: 36px; border-radius: 11px; }
  .wm-name strong { font-size: 16px; }
  .wm-name span { font-size: 11px; }
  .wm-change { padding: 5px 7px; font-size: 12px; }
  .wm-chart { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm-range { transition: none; }
}
