/* Markets Understood — Crypto Heatmap UI Core
   38.09.20.17B.04
*/

.heatmap-page {
  padding-bottom: var(--space-16);
}

.heatmap-intro {
  max-width: 900px;
  margin: 0 auto var(--space-8);
  text-align: center;
}

.heatmap-intro h1 {
  margin-bottom: var(--space-4);
}

.heatmap-intro-lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--mu-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.heatmap-tool {
  margin-top: var(--space-8);
  border: 1px solid var(--mu-line);
  border-radius: var(--radius-xl);
  background: var(--mu-surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.heatmap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--mu-line);
  background: var(--mu-bg-soft);
}

.heatmap-toolbar-copy {
  min-width: 0;
}

.heatmap-toolbar-title {
  margin: 0;
  color: var(--mu-heading);
  font-size: 1rem;
  font-weight: 700;
}

.heatmap-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--mu-muted);
  font-size: .86rem;
}

.heatmap-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--mu-line);
  border-radius: var(--radius-pill);
  background: var(--mu-surface);
  color: var(--mu-text);
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
}

.heatmap-chip.is-fresh {
  border-color: rgba(20, 122, 85, .28);
  background: rgba(20, 122, 85, .08);
  color: var(--mu-success);
}

.heatmap-chip.is-stale {
  border-color: rgba(154, 101, 17, .32);
  background: rgba(154, 101, 17, .09);
  color: var(--mu-warning);
}

.heatmap-chip.is-error {
  border-color: rgba(181, 64, 64, .3);
  background: rgba(181, 64, 64, .08);
  color: var(--mu-danger);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--mu-muted);
  font-size: .78rem;
  white-space: nowrap;
}

.heatmap-legend-scale {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 2px;
}

.heatmap-legend-scale span {
  width: 18px;
  height: 10px;
  border-radius: 3px;
}

.heatmap-stage {
  min-height: 560px;
  padding: var(--space-4);
  background: var(--mu-dark);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 74px;
  grid-auto-flow: dense;
  gap: 4px;
}

.heatmap-state {
  display: grid;
  min-height: 500px;
  place-items: center;
  padding: var(--space-8);
  text-align: center;
  color: var(--mu-on-dark-muted);
}

.heatmap-state[hidden] {
  display: none;
}

.heatmap-state strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--mu-on-dark);
  font-size: 1.05rem;
}

.heatmap-note {
  margin: var(--space-5) var(--space-6) var(--space-6);
  color: var(--mu-muted);
  font-size: .88rem;
  line-height: 1.6;
}

.heatmap-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
}

.heatmap-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}

.heatmap-tile-pair {
  position: relative;
  z-index: 1;
  overflow: hidden;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-tile-exchange {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255,255,255,.74);
  font-size: .68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-tile-change {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1;
}

.heatmap-tile-bottom {
  position: relative;
  z-index: 1;
  margin-top: 7px;
}

.heatmap-tile-price,
.heatmap-tile-activity {
  overflow: hidden;
  color: rgba(255,255,255,.82);
  font-size: .68rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-size-s {
  grid-column: span 1;
  grid-row: span 1;
}

.heatmap-size-m {
  grid-column: span 2;
  grid-row: span 1;
}

.heatmap-size-l {
  grid-column: span 2;
  grid-row: span 2;
}

.heatmap-size-xl {
  grid-column: span 3;
  grid-row: span 2;
}

.heatmap-size-s .heatmap-tile-bottom,
.heatmap-size-s .heatmap-tile-exchange {
  display: none;
}

.heatmap-move-neg-5 { background: #7c1f2a; }
.heatmap-move-neg-4 { background: #96303a; }
.heatmap-move-neg-3 { background: #ad4149; }
.heatmap-move-neg-2 { background: #b75a5e; }
.heatmap-move-neg-1 { background: #9c6668; }

.heatmap-move-flat  { background: #405163; }

.heatmap-move-pos-1 { background: #4b7967; }
.heatmap-move-pos-2 { background: #34765b; }
.heatmap-move-pos-3 { background: #247452; }
.heatmap-move-pos-4 { background: #176847; }
.heatmap-move-pos-5 { background: #0b593b; }

.heatmap-move-na {
  background: #354354;
  color: rgba(255,255,255,.75);
}

.heatmap-tile:focus-visible {
  outline: 3px solid #72bfff;
  outline-offset: 2px;
  z-index: 3;
}

@media (hover: hover) {
  .heatmap-tile {
    transition:
      transform var(--transition-fast),
      filter var(--transition-fast);
  }

  .heatmap-tile:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    z-index: 2;
  }
}

@media (max-width: 860px) {
  .heatmap-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .heatmap-stage {
    min-height: 480px;
    padding: 8px;
  }

  .heatmap-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 70px;
  }

  .heatmap-size-xl {
    grid-column: span 3;
  }
}

@media (max-width: 560px) {
  .heatmap-intro {
    text-align: left;
  }

  .heatmap-toolbar {
    padding: var(--space-4);
  }

  .heatmap-toolbar-meta {
    gap: 6px;
  }

  .heatmap-legend {
    width: 100%;
    justify-content: space-between;
  }

  .heatmap-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 68px;
  }

  .heatmap-size-s {
    grid-column: span 1;
  }

  .heatmap-size-m {
    grid-column: span 2;
  }

  .heatmap-size-l {
    grid-column: span 2;
  }

  .heatmap-size-xl {
    grid-column: span 4;
  }

  .heatmap-tile {
    padding: 8px;
  }

  .heatmap-tile-pair {
    font-size: .82rem;
  }

  .heatmap-tile-change {
    font-size: .96rem;
  }

  .heatmap-note {
    margin-left: var(--space-4);
    margin-right: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .heatmap-tile {
    transition: none;
  }
}

.heatmap-legend-neg { background: #96303a; }
.heatmap-legend-neg-soft { background: #b95b5f; }
.heatmap-legend-flat { background: #405163; }
.heatmap-legend-pos-soft { background: #34765b; }
.heatmap-legend-pos { background: #176847; }

/* B04 ui2 — preserve market identity on compact mobile tiles */
@media (max-width: 560px) {
  .heatmap-tile-pair {
    flex-shrink: 0;
    padding-right: 64px;
  }

  .heatmap-tile-exchange {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    max-width: 42%;
    margin-top: 0;
    overflow: hidden;
    font-size: .58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .heatmap-tile-change {
    flex-shrink: 0;
    margin-top: 4px;
  }

  .heatmap-tile-bottom {
    flex-shrink: 0;
    margin-top: 4px;
  }

  .heatmap-size-m .heatmap-tile-activity {
    display: none;
  }

  .heatmap-size-s .heatmap-tile-pair {
    padding-right: 0;
  }
}

/* B04 ui2 — minimum useful mobile tile */
@media (max-width: 560px) {
  .heatmap-size-s {
    grid-column: span 2;
  }

  .heatmap-size-s .heatmap-tile-exchange {
    display: block;
  }

  .heatmap-size-s .heatmap-tile-bottom {
    display: none;
  }

  .heatmap-size-s .heatmap-tile-pair {
    padding-right: 52px;
  }
}

/* B04 ui3 — preserve exchange identity on compact desktop tiles */
@media (min-width: 561px) {
  .heatmap-size-s {
    padding: 6px;
  }

  .heatmap-size-s .heatmap-tile-pair {
    font-size: .72rem;
    line-height: 1.05;
  }

  .heatmap-size-s .heatmap-tile-exchange {
    display: block;
    margin-top: 1px;
    font-size: .50rem;
    line-height: 1;
  }

  .heatmap-size-s .heatmap-tile-change {
    margin-top: 2px;
    font-size: .86rem;
  }
}

/* B04 ui4 — readable mobile heatmap intro */
@media (max-width: 560px) {
  .heatmap-intro {
    margin-top: var(--space-4);
    padding: var(--space-6) var(--space-4);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: var(--radius-lg);
    background: rgba(7, 20, 38, .92);
    text-align: left;
  }

  .heatmap-intro h1 {
    color: #ffffff;
  }

  .heatmap-intro-lead {
    color: rgba(255,255,255,.84);
  }
}

/* B04 ui5 — use the readable intro card on all viewports */
.heatmap-intro {
  max-width: none;
  margin: 0 auto var(--space-8);
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 42% 26%, rgba(36, 214, 255, .16), transparent 22%),
    linear-gradient(180deg, rgba(3, 22, 47, .97), rgba(14, 34, 60, .94));
  box-shadow: var(--shadow-md);
  text-align: left;
}

.heatmap-intro h1 {
  margin-bottom: var(--space-5);
  color: #ffffff;
  line-height: 1.12;
}

.heatmap-intro-lead {
  max-width: 980px;
  margin: 0;
  color: rgba(255,255,255,.86);
}

@media (min-width: 901px) {
  .heatmap-intro h1 {
    font-size: clamp(2.8rem, 5vw, 4.4rem);
    max-width: 12ch;
  }

  .heatmap-intro-lead {
    font-size: 1.3rem;
    line-height: 1.7;
  }
}

/* B04 ui7 — centred desktop heatmap intro */
@media (min-width: 901px) {
  .heatmap-intro {
    text-align: center;
  }

  .heatmap-intro h1 {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .heatmap-intro-lead {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}

/* 38.09.20.17B.05 — Heatmap filter controls */
.heatmap-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(180px, 1fr);
  gap: var(--space-4);
  align-items: end;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--mu-line);
  background: var(--mu-surface);
}

.heatmap-filter-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.heatmap-filter-group legend,
.heatmap-search > span {
  display: block;
  margin-bottom: 6px;
  color: var(--mu-muted);
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.heatmap-filter-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.heatmap-filter-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--mu-line);
  border-radius: var(--radius-pill);
  background: var(--mu-bg-soft);
  color: var(--mu-text);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.heatmap-filter-button:hover {
  border-color: var(--mu-line-strong);
  background: var(--mu-surface-2);
}

.heatmap-filter-button.is-active,
.heatmap-filter-button[aria-pressed="true"] {
  border-color: rgba(8, 124, 255, .35);
  background: var(--mu-blue);
  color: #fff;
}

.heatmap-filter-button:focus-visible,
.heatmap-search input:focus-visible {
  outline: 3px solid #72bfff;
  outline-offset: 2px;
}

.heatmap-search {
  min-width: 0;
}

.heatmap-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--mu-line);
  border-radius: var(--radius-pill);
  background: var(--mu-bg-soft);
  color: var(--mu-text);
  font: inherit;
}

.heatmap-search input::placeholder {
  color: var(--mu-muted-2);
}

@media (max-width: 980px) {
  .heatmap-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .heatmap-controls {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .heatmap-filter-buttons {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .heatmap-filter-button {
    flex: 0 0 auto;
  }
}

/* B05 filters4 — simple market view */
.heatmap-pulse {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--space-6);
  border-bottom: 1px solid var(--mu-line);
  background: var(--mu-bg-soft);
  color: var(--mu-muted);
  font-size: .88rem;
}

.heatmap-pulse strong {
  color: var(--mu-text);
  font-size: .94rem;
}

.heatmap-pulse[data-tone="strongPositive"] strong,
.heatmap-pulse[data-tone="positive"] strong {
  color: #168447;
}

.heatmap-pulse[data-tone="strongNegative"] strong,
.heatmap-pulse[data-tone="negative"] strong {
  color: #b83737;
}

@media (max-width: 560px) {
  .heatmap-pulse {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 11px var(--space-4);
  }
}

/* B05 filters5 — prominent centred Market View */
.heatmap-pulse {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 13px 20px;
  border-top: 1px solid var(--mu-line);
  border-bottom: 1px solid var(--mu-line);
  background: var(--mu-bg-soft);
  text-align: center;
}

.heatmap-pulse strong {
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.2;
  color: var(--mu-text);
}

.heatmap-pulse span {
  font-size: .9rem;
  font-weight: 650;
  color: var(--mu-muted);
}

.heatmap-pulse[data-tone="positive"],
.heatmap-pulse[data-tone="strongPositive"] {
  background: rgba(22, 132, 71, .09);
  border-color: rgba(22, 132, 71, .22);
}

.heatmap-pulse[data-tone="positive"] strong,
.heatmap-pulse[data-tone="strongPositive"] strong {
  color: #168447;
}

.heatmap-pulse[data-tone="negative"],
.heatmap-pulse[data-tone="strongNegative"] {
  background: rgba(184, 55, 55, .08);
  border-color: rgba(184, 55, 55, .20);
}

.heatmap-pulse[data-tone="negative"] strong,
.heatmap-pulse[data-tone="strongNegative"] strong {
  color: #b83737;
}

.heatmap-pulse[data-tone="mixed"],
.heatmap-pulse[data-tone="quiet"] {
  background: rgba(50, 105, 160, .06);
}

@media (max-width: 560px) {
  .heatmap-pulse {
    align-items: center;
    min-height: 58px;
    padding: 11px 14px;
    text-align: center;
  }

  .heatmap-pulse strong {
    font-size: 1rem;
  }

  .heatmap-pulse span {
    font-size: .82rem;
  }
}

/* B05 filters6 — market pulse in top toolbar row */
.heatmap-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
}

.heatmap-toolbar-copy {
  min-width: 0;
}

.heatmap-pulse {
  justify-self: center;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  max-width: 440px;
  padding: 12px 22px;
  border: 1px solid var(--mu-line);
  border-radius: 16px;
  background: rgba(18, 35, 58, .04);
  text-align: center;
  box-shadow: 0 6px 18px rgba(11, 22, 39, .06);
}

.heatmap-pulse strong {
  color: var(--mu-text);
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.2;
}

.heatmap-pulse span {
  margin-top: 3px;
  color: var(--mu-muted);
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.25;
}

.heatmap-pulse[data-tone="strongPositive"] {
  background: linear-gradient(180deg, rgba(22,132,71,.16), rgba(22,132,71,.08));
  border-color: rgba(22,132,71,.28);
}

.heatmap-pulse[data-tone="positive"] {
  background: linear-gradient(180deg, rgba(22,132,71,.12), rgba(22,132,71,.06));
  border-color: rgba(22,132,71,.22);
}

.heatmap-pulse[data-tone="strongNegative"] {
  background: linear-gradient(180deg, rgba(184,55,55,.16), rgba(184,55,55,.08));
  border-color: rgba(184,55,55,.28);
}

.heatmap-pulse[data-tone="negative"] {
  background: linear-gradient(180deg, rgba(184,55,55,.12), rgba(184,55,55,.06));
  border-color: rgba(184,55,55,.22);
}

.heatmap-pulse[data-tone="mixed"] {
  background: linear-gradient(180deg, rgba(31,92,160,.10), rgba(31,92,160,.05));
  border-color: rgba(31,92,160,.18);
}

.heatmap-pulse[data-tone="quiet"] {
  background: linear-gradient(180deg, rgba(84,102,125,.10), rgba(84,102,125,.05));
  border-color: rgba(84,102,125,.18);
}

.heatmap-legend {
  justify-self: end;
}

@media (max-width: 1100px) {
  .heatmap-toolbar {
    grid-template-columns: 1fr;
  }

  .heatmap-pulse {
    justify-self: stretch;
    min-width: 0;
    max-width: none;
  }

  .heatmap-legend {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .heatmap-pulse {
    padding: 11px 14px;
    border-radius: 14px;
  }

  .heatmap-pulse strong {
    font-size: 1.02rem;
  }

  .heatmap-pulse span {
    font-size: .84rem;
  }
}

/* B05 filters7 — exact desktop centering of Market View */
@media (min-width: 1101px) {
  .heatmap-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .heatmap-toolbar-copy {
    justify-self: start;
  }

  .heatmap-pulse {
    justify-self: center;
  }

  .heatmap-legend {
    justify-self: end;
  }
}

/* =========================================================
   B06 SEO5 — crawlable Crypto Heatmap context
   ========================================================= */

.heatmap-seo {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(30px, 4vw, 48px);
  border: 1px solid var(--mu-line);
  border-radius: var(--radius-xl);
  background: var(--mu-bg-soft);
}

.heatmap-seo-intro {
  max-width: 1050px;
  margin-bottom: 28px;
}

.heatmap-seo-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--mu-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .10em;
}

.heatmap-seo-intro h2,
.heatmap-seo-faq h2 {
  margin-top: 0;
  color: var(--mu-heading);
}

.heatmap-seo-intro p {
  margin-bottom: 0;
  font-size: 1.03rem;
  line-height: 1.75;
}

.heatmap-seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 5vw, 72px);
}

.heatmap-seo-block {
  padding: 24px 0;
  border-top: 1px solid var(--mu-line);
}

.heatmap-seo-block h3 {
  margin: 0 0 10px;
  color: var(--mu-heading);
}

.heatmap-seo-block p {
  margin: 0;
  line-height: 1.72;
}

.heatmap-seo a {
  font-weight: 650;
}

.heatmap-seo-faq {
  margin-top: 26px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--mu-surface);
  border: 1px solid var(--mu-line);
}

.heatmap-seo-faq h3 {
  margin: 22px 0 6px;
}

.heatmap-seo-faq p {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .heatmap-seo {
    margin-top: 32px;
    padding: 24px 18px;
  }

  .heatmap-seo-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-seo-block {
    padding: 20px 0;
  }

  .heatmap-seo-faq {
    padding: 22px 18px;
  }
}

/* B06 SEO6 — full-width Heatmap SEO introduction */
.heatmap-seo-intro {
  max-width: none;
  width: 100%;
}

/* B06 SEO8 — centre Heatmap legend on mobile landscape */
@media (max-width: 860px) and (orientation: landscape) {
  .heatmap-legend {
    width: 100%;
    justify-content: center;
  }
}

/* C02 visual fix — preserve identity on medium heatmap tiles */
.heatmap-size-m .heatmap-tile-pair,
.heatmap-size-m .heatmap-tile-exchange,
.heatmap-size-m .heatmap-tile-change,
.heatmap-size-m .heatmap-tile-bottom {
  flex-shrink: 0;
}

.heatmap-size-m .heatmap-tile-activity {
  display: none;
}

.heatmap-size-m .heatmap-tile-change {
  margin-top: 4px;
}

.heatmap-size-m .heatmap-tile-bottom {
  margin-top: 4px;
}

/* C03 — clickable heatmap quick panel */
.heatmap-quick-panel[hidden] {
  display: none;
}

.heatmap-quick-panel {
  margin: 0 var(--space-4) var(--space-5);
  padding: var(--space-5);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: var(--mu-dark);
  color: var(--mu-on-dark);
}

.heatmap-quick-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.heatmap-quick-panel-eyebrow {
  color: var(--mu-on-dark-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.heatmap-quick-panel h2 {
  margin: 4px 0;
  color: var(--mu-on-dark);
  font-size: 1.35rem;
}

.heatmap-quick-panel-head p {
  margin: 0;
  color: var(--mu-on-dark-muted);
}

.heatmap-quick-panel-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: transparent;
  color: var(--mu-on-dark);
  font-size: 1.4rem;
  cursor: pointer;
}

.heatmap-quick-panel-meta,
.heatmap-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: var(--space-4);
}

.heatmap-quick-panel-meta > div,
.heatmap-detail-metrics > div {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.heatmap-quick-panel-meta span,
.heatmap-detail-metrics dt {
  color: var(--mu-on-dark-muted);
  font-size: .7rem;
}

.heatmap-quick-panel-meta strong,
.heatmap-detail-metrics dd {
  display: block;
  margin: 4px 0 0;
  color: var(--mu-on-dark);
  font-size: .95rem;
  font-weight: 750;
}

.heatmap-detail-timeframes {
  display: flex;
  gap: 6px;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.heatmap-detail-timeframes button {
  min-width: 54px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  background: transparent;
  color: var(--mu-on-dark-muted);
  font-weight: 750;
  cursor: pointer;
}

.heatmap-detail-timeframes button[aria-selected="true"] {
  background: #fff;
  color: var(--mu-dark);
}

.heatmap-detail-state {
  min-height: 20px;
  margin-top: var(--space-3);
  color: var(--mu-on-dark-muted);
  font-size: .8rem;
}

.heatmap-quick-panel-note {
  margin: var(--space-4) 0 0;
  color: var(--mu-on-dark-muted);
  font-size: .78rem;
}

.heatmap-quick-panel-close:focus-visible,
.heatmap-detail-timeframes button:focus-visible {
  outline: 3px solid #72bfff;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .heatmap-quick-panel {
    margin: 0 8px var(--space-4);
    padding: var(--space-4);
  }

  .heatmap-quick-panel-meta,
  .heatmap-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* C03 — drawer refinement */
body.heatmap-detail-open {
  overflow: hidden;
}

.heatmap-quick-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  width: min(560px, 92vw);
  max-height: 100vh;
  margin: 0;
  padding: 28px;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
  background: #15202b;
  box-shadow:
    -24px 0 60px rgba(0,0,0,.30),
    0 0 0 9999px rgba(7,14,22,.58);
}

.heatmap-quick-panel-head {
  position: sticky;
  top: -28px;
  z-index: 3;
  margin: -28px -28px 0;
  padding: 28px 28px 18px;
  background: #15202b;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.heatmap-detail-timeframes button[aria-selected="true"] {
  border-color: #72bfff;
  background: #72bfff;
  color: #0d1720;
}

.heatmap-quick-panel-meta strong[data-tone="positive"],
.heatmap-detail-metrics dd[data-tone="positive"] {
  color: #79d6a3;
}

.heatmap-quick-panel-meta strong[data-tone="negative"],
.heatmap-detail-metrics dd[data-tone="negative"] {
  color: #ff9393;
}

.heatmap-quick-panel-meta strong[data-tone="warning"],
.heatmap-detail-metrics dd[data-tone="warning"] {
  color: #f5c66a;
}

.heatmap-quick-panel-meta strong[data-tone="info"],
.heatmap-detail-metrics dd[data-tone="info"] {
  color: #78c8ff;
}

.heatmap-quick-panel-meta strong[data-tone="neutral"],
.heatmap-detail-metrics dd[data-tone="neutral"] {
  color: #c9d4de;
}

.heatmap-quick-panel-close:hover {
  background: rgba(255,255,255,.08);
}

@media (max-width: 760px) {
  .heatmap-quick-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 88vh;
    margin: 0;
    padding: 20px;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.12);
    border-radius: 18px 18px 0 0;
  }

  .heatmap-quick-panel-head {
    top: -20px;
    margin: -20px -20px 0;
    padding: 20px 20px 16px;
    border-radius: 18px 18px 0 0;
  }
}

/* C03 — real interactive backdrop */
body.heatmap-detail-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(7,14,22,.58);
}

body.heatmap-detail-open .heatmap-quick-panel {
  box-shadow: -24px 0 60px rgba(0,0,0,.30);
}

/* C03 — mobile tap reliability */
.heatmap-tile {
  touch-action: pan-y;
  cursor: pointer;
}


/* C04 — multi-timeframe intelligence */
.heatmap-detail-intelligence {
  margin-top: var(--space-4);
  padding: 14px;
  border: 1px solid rgba(114,191,255,.18);
  border-radius: 10px;
  background: rgba(114,191,255,.045);
}

.heatmap-detail-intelligence h3 {
  margin: 0;
  color: var(--mu-on-dark);
  font-size: .9rem;
  font-weight: 800;
}

.heatmap-detail-intelligence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.heatmap-detail-intelligence-grid > div {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.heatmap-detail-intelligence-grid dt {
  color: var(--mu-on-dark-muted);
  font-size: .7rem;
}

.heatmap-detail-intelligence-grid dd {
  display: block;
  margin: 4px 0 0;
  color: var(--mu-on-dark);
  font-size: .95rem;
  font-weight: 750;
}

.heatmap-detail-intelligence-grid dd[data-tone="positive"] {
  color: #79d6a3;
}

.heatmap-detail-intelligence-grid dd[data-tone="negative"] {
  color: #ff9393;
}

.heatmap-detail-intelligence-grid dd[data-tone="warning"] {
  color: #f5c66a;
}

.heatmap-detail-intelligence-grid dd[data-tone="info"] {
  color: #78c8ff;
}

.heatmap-detail-intelligence-grid dd[data-tone="neutral"] {
  color: #c9d4de;
}

.heatmap-detail-intelligence-note {
  margin: 10px 0 0;
  color: var(--mu-on-dark-muted);
  font-size: .76rem;
}

@media (max-width: 760px) {
  .heatmap-detail-intelligence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.heatmap-detail-indicator-cta {
  margin: 18px 0 8px;
}

.heatmap-detail-indicator-link {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  text-decoration: none;
}

.heatmap-detail-indicator-link:hover {
  text-decoration: underline;
}

.heatmap-detail-indicator-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
