/* Market map (heatmap.js): the "Table | Map" switch of the list header and the
   treemap that takes the table's place. Tile colours are set by the script. */

/* ---------- Switch: same segmented look as the crypto currency switch ---------- */
body.v2 .v2-view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
body.v2 .v2-view-switch[hidden] { display: none; }
body.v2 .panel-actions .v2-view-switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; box-shadow: none; }
body.v2 .panel-actions .v2-view-switch button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
body.v2 .panel-actions .v2-view-switch button[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }
body.v2 .v2-view-switch svg { width: 14px; height: 14px; flex: none; }

/* ---------- The map replaces the table and its pagination ---------- */
body.v2 .panel.v2-map-on > .table-wrap, body.v2 .panel.v2-map-on > #pagination { display: none !important; }
body.v2 .v2-map { padding: 0 20px 20px; }
body.v2 .v2-map[hidden] { display: none; }
body.v2 .v2-map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0 10px; }
body.v2 .v2-map-caption { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
body.v2 .v2-map-tools { display: flex; align-items: center; gap: 14px; margin-left: auto; }
body.v2 .v2-map-legend { display: inline-flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 12px; font-variant-numeric: tabular-nums; }
body.v2 .v2-map-legend i { display: block; width: 104px; height: 8px; border-radius: 4px; }
body.v2 .v2-map-periods { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
body.v2 .v2-map-periods[hidden] { display: none; }
body.v2 .v2-map-periods button { min-width: 34px; min-height: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
body.v2 .v2-map-periods button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
body.v2 .v2-map-periods button[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }

body.v2 .v2-map-canvas { position: relative; height: 560px; overflow: hidden; border-radius: 10px; background: var(--panel-2); contain: strict; }
/* The 1px border in the panel colour draws the lines between tiles. */
body.v2 .v2-map-tile {
  position: absolute; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; min-height: 0; margin: 0; padding: 6px; border: 1px solid var(--panel); border-radius: 0; box-shadow: none;
  overflow: hidden; white-space: nowrap; text-align: center; line-height: 1.2; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color .6s ease, color .6s ease;
}
body.v2 .v2-map-tile:hover { filter: brightness(1.18); }
body.v2 .v2-map-tile:focus-visible { z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
body.v2 .v2-map-tile > [hidden] { display: none; }
body.v2 .v2-map-ticker { display: block; max-width: 100%; overflow: hidden; font-weight: 650; letter-spacing: -.01em; }
body.v2 .v2-map-change { display: block; max-width: 100%; overflow: hidden; font-weight: 550; opacity: .92; }
body.v2 .v2-map-logo { display: block; flex: none; overflow: hidden; border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
body.v2 .v2-map-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.v2 .v2-map-hint { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) { body.v2 .v2-map-tile { transition: none; } }

/* ---------- Phone: the period comes from the selector above the list ---------- */
@media (max-width: 700px) {
  body.v2 .panel-actions .v2-view-switch button { min-height: 34px; padding: 0 9px; }
  body.v2 .v2-map { padding: 0 8px 10px; }
  body.v2 .v2-map-bar { padding: 8px 2px; }
  body.v2 .v2-map-caption { font-size: 12px; }
  body.v2 .v2-map-tools { margin-left: 0; }
  body.v2 .v2-map-canvas { height: 480px; border-radius: 8px; }
}
