:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: rgb(17 24 33 / 0.82);
  --panel-strong: rgb(18 27 37 / 0.94);
  --line: rgb(147 162 179 / 0.18);
  --line-strong: rgb(147 162 179 / 0.3);
  --text: #edf3f8;
  --muted: #93a2b3;
  --soft: #cbd6e2;
  --teal: #2dd4bf;
  --cyan: #56d9f2;
  --amber: #fbbf24;
  --red: #fb7185;
  --green: #86efac;
  --blue: #60a5fa;
  --purple: #b874ff;
  --radius: 8px;
  --shadow: 0 20px 64px rgb(0 0 0 / 0.38);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-glide: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  overflow-x: clip;
}

body {
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

.graph-body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgb(45 212 191 / 0.13), transparent 28rem),
    linear-gradient(135deg, #090d12 0%, #0f151d 48%, #0b0f14 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.graph-shell {
  width: min(1520px, 100%);
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 12px;
  background-image: none;
}

.graph-page-topbar {
  margin-bottom: 0;
}

.brand-zone,
.top-actions,
.mode-tabs,
.map-head,
.map-stats,
.legend,
.selected-head,
.song-list-item,
.type-button,
.stage-button,
.segmented {
  min-width: 0;
}

.graph-page-topbar h1 {
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.graph-page-topbar .eyebrow {
  margin: 0 0 8px;
}

.graph-site-nav {
  margin-bottom: 0;
}

.graph-command-bar {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: var(--radius);
  padding: 10px;
  background: rgb(10 15 21 / 0.76);
  box-shadow: 0 14px 42px rgb(0 0 0 / 0.18);
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 64px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(57 215 197 / 0.42);
  border-radius: var(--radius);
  color: var(--teal);
  background: rgb(57 215 197 / 0.08);
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0;
}

.global-page-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: rgb(7 12 15 / 0.62);
  scrollbar-width: thin;
}

.global-nav-label {
  flex: 0 0 auto;
  padding-inline: 5px;
  color: var(--teal);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-page-nav a {
  flex: 0 0 auto;
  min-width: 78px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(95 116 125 / 0.2);
  border-radius: 7px;
  color: var(--soft);
  background: rgb(16 23 27 / 0.72);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.global-page-nav a.active {
  border-color: rgb(57 215 197 / 0.58);
  color: #dffdfa;
  background: rgb(57 215 197 / 0.14);
}

.global-page-nav a:hover {
  border-color: rgb(57 215 197 / 0.65);
  color: #eafffc;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.graph-shell h1,
.graph-shell h2,
.graph-shell p {
  margin: 0;
}

.graph-shell h1 {
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0;
}

.graph-intro {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.55;
}

.graph-shell h2 {
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.graph-page-topbar h1 {
  font-size: clamp(2.15rem, 5vw, 3.8rem);
  line-height: 0.95;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mode-control-group {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.ruler-switch {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-radius: 8px;
  padding: 7px;
  background: rgb(7 12 15 / 0.46);
}

.ruler-switch > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ruler-button {
  min-width: 0;
  min-height: 30px;
  padding-inline: 7px;
  font-size: 0.66rem;
  font-weight: 950;
  white-space: nowrap;
}

.mode-description {
  min-height: 34px;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgb(7 12 15 / 0.48);
  font-size: 0.7rem;
  font-weight: 780;
  line-height: 1.4;
}

.mode-description strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 950;
}

.mode-description span {
  display: block;
}

.mode-description .mode-ruler-line {
  margin-top: 4px;
  color: #c5f7ef;
}

.mode-tab,
.ruler-button,
.segment,
.stage-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  background: rgb(16 23 27 / 0.82);
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-smooth),
    border-color 0.28s ease,
    background 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease;
}

.mode-tab {
  min-width: 0;
  height: 38px;
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-tab.active,
.ruler-button.active,
.segment.active,
.stage-button.active,
.type-button.active {
  border-color: rgb(57 215 197 / 0.58);
  color: #dffdfa;
  background: rgb(57 215 197 / 0.14);
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  justify-self: end;
  width: 100%;
  align-items: end;
}

.map-search-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-search-control span {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 950;
}

.top-actions input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  background: rgb(7 12 15 / 0.85);
  outline: none;
}

.map-utility-actions {
  display: flex;
  gap: 6px;
  align-self: end;
}

.map-utility-actions .icon-button {
  height: 40px;
  border-color: rgb(147 162 179 / 0.14);
  color: var(--muted);
  background: rgb(7 12 15 / 0.48);
}

.graph-language-select {
  height: 40px;
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.7rem;
  font-weight: 900;
}

select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  background: rgb(7 12 15 / 0.86);
  outline: none;
}

.top-actions input:focus,
select:focus,
.mode-tab:hover,
.ruler-button:hover,
.segment:hover,
.stage-button:hover,
.type-button:hover,
.icon-button:hover {
  border-color: rgb(57 215 197 / 0.7);
}

.mode-tab:hover,
.ruler-button:hover,
.segment:hover,
.stage-button:hover,
.type-button:hover,
.icon-button:hover,
.song-list-item:hover,
.nearby-item:hover,
.journey-chip:hover {
  transform: translateY(-1px);
}

.mode-tab.active,
.ruler-button.active,
.segment.active,
.stage-button.active,
.type-button.active {
  box-shadow: 0 10px 28px rgb(57 215 197 / 0.09);
}

.icon-button {
  min-width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.map-insight-deck {
  display: grid;
  gap: 8px;
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: var(--radius);
  padding: 10px;
  background: rgb(10 15 21 / 0.76);
  box-shadow: 0 14px 42px rgb(0 0 0 / 0.16);
}

.map-insight-deck > summary {
  list-style: none;
  cursor: pointer;
}

.map-insight-deck > summary::-webkit-details-marker {
  display: none;
}

.insight-deck-head {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
}

.insight-deck-head .panel-title {
  margin-bottom: 3px;
}

.insight-deck-head p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}

.insight-summary-toggle,
.insight-clear-button {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgb(251 191 36 / 0.32);
  border-radius: 7px;
  padding: 0 10px;
  color: #fff4ce;
  background: rgb(251 191 36 / 0.08);
  font-size: 0.66rem;
  font-weight: 950;
  cursor: pointer;
}

.insight-summary-toggle::before {
  content: "+";
}

.map-insight-deck[open] .insight-summary-toggle::before {
  content: "-";
}

.insight-clear-button {
  width: fit-content;
  margin-top: 2px;
}

.insight-route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.insight-route-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-left: 3px solid var(--route-color);
  border-radius: 8px;
  padding: 9px;
  background: rgb(15 22 30 / 0.72);
}

.insight-route-card.active {
  border-color: color-mix(in srgb, var(--route-color) 56%, transparent);
  background: color-mix(in srgb, var(--route-color) 10%, rgb(15 22 30 / 0.78));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--route-color) 10%, transparent);
}

.insight-route-text {
  display: grid;
  gap: 3px;
}

.insight-route-text span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.25;
}

.insight-route-text p {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.38;
}

.insight-route-song {
  min-width: 0;
  display: grid;
  gap: 3px;
  border: 1px solid rgb(147 162 179 / 0.1);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--soft);
  background: rgb(8 13 19 / 0.55);
  text-align: left;
  cursor: pointer;
}

.insight-route-song strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-route-song small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.insight-route-actions button,
.insight-route-actions a {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgb(45 212 191 / 0.24);
  border-radius: 7px;
  padding: 0 8px;
  color: #dffdfa;
  background: rgb(45 212 191 / 0.08);
  font-size: 0.62rem;
  font-weight: 950;
  cursor: pointer;
}

.graph-workbench {
  height: calc(100vh - 260px);
  min-height: 560px;
  max-height: 820px;
  display: grid;
  grid-template-columns: 242px minmax(500px, 1fr) 274px;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: var(--radius);
  background: rgb(7 12 15 / 0.48);
  box-shadow: 0 18px 54px rgb(0 0 0 / 0.2);
}

.side-panel {
  min-height: 0;
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 16px;
  background: rgb(12 18 24 / 0.82);
  backdrop-filter: blur(16px);
}

.left-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-title {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.side-panel section {
  min-height: 0;
}

.filter-group-title {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 950;
}

.filter-detail-block {
  min-width: 0;
  border: 1px solid rgb(147 162 179 / 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgb(7 12 15 / 0.42);
}

.filter-detail-block > summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  list-style: none;
  color: var(--soft);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 950;
}

.filter-detail-block > summary::-webkit-details-marker {
  display: none;
}

.filter-detail-block > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--teal);
}

.filter-detail-block[open] > summary::after {
  content: "-";
}

.filter-detail-block[open] > :not(summary) {
  margin-top: 8px;
}

.distribution-section {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
}

.stage-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.stage-button {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.stage-button span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.phase-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 900;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.segment {
  min-height: 34px;
  font-size: 0.72rem;
  font-weight: 900;
}

.type-list {
  height: 100%;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow: auto;
  padding-right: 3px;
}

.type-button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 48px 32px;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 5px 8px;
  color: var(--soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-smooth),
    border-color 0.28s ease,
    background 0.28s ease,
    color 0.28s ease;
}

.type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--type-color);
  box-shadow: 0 0 12px var(--type-color);
}

.type-name {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-count {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.type-explainer {
  min-width: 0;
  border: 1px solid rgb(57 215 197 / 0.2);
  border-radius: var(--radius);
  padding: 8px;
  background: rgb(7 12 15 / 0.58);
  animation: soft-rise 0.42s var(--ease-smooth) both;
}

.type-explainer-top,
.shape-reading-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.type-explainer-kicker,
.shape-reading-head span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.type-explainer-title {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.type-explainer-count {
  display: none;
  flex: 0 0 auto;
  border: 1px solid rgb(57 215 197 / 0.26);
  border-radius: 999px;
  padding: 4px 7px;
  color: #baf7f0;
  background: rgb(57 215 197 / 0.08);
  font-size: 0.62rem;
  font-weight: 950;
}

.type-explainer-visual {
  margin-top: 9px;
}

.type-shape-bars,
.type-mini-bars,
.selected-type-bars {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
}

.type-shape-bars {
  height: 28px;
}

.type-mini-bars {
  height: 22px;
  gap: 1px;
}

.selected-type-bars {
  height: 42px;
  gap: 2px;
  margin-top: 7px;
}

.type-shape-bars span,
.type-mini-bars span,
.selected-type-bars span {
  min-height: 3px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, var(--type-color), rgb(57 215 197 / 0.35));
  box-shadow: 0 0 10px rgb(57 215 197 / 0.08);
  transform-origin: bottom center;
  animation: type-bar-rise 0.62s var(--ease-smooth) both;
}

.type-mini-bars span {
  border-radius: 2px 2px 0 0;
  box-shadow: none;
}

.type-axis {
  display: none;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.type-cue {
  margin-top: 6px;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-explainer p,
.shape-reading p,
.type-help-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 780;
  line-height: 1.45;
}

.type-explainer p,
.type-help-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.type-explainer p {
  display: none;
}

.type-help-text {
  display: none;
}

.type-band-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.type-band-row span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  color: var(--soft);
  background: rgb(11 17 20 / 0.74);
  font-size: 0.58rem;
  font-weight: 950;
  text-align: center;
}

.type-band-row b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 950;
}

.type-explainer-foot {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.type-explainer-foot span {
  border: 1px solid rgb(125 154 166 / 0.24);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--soft);
  background: rgb(255 255 255 / 0.035);
  font-size: 0.58rem;
  font-weight: 950;
}

.type-help-text {
  color: rgb(143 162 164 / 0.86);
}

.type-mini-all {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

@keyframes type-bar-rise {
  from {
    opacity: 0.28;
    transform: scaleY(0.18);
  }

  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 46% 45%, rgb(45 212 191 / 0.07), transparent 25rem),
    rgb(8 13 18 / 0.9);
}

.map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent 28%);
  pointer-events: none;
}

.map-head {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.map-stats {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.stat-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--soft);
  background: rgb(8 13 16 / 0.68);
  font-size: 0.72rem;
  font-weight: 900;
}

.canvas-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#graphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#graphCanvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(57 215 197 / 0.7);
}

.graph-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 320px;
  border: 1px solid rgb(215 239 235 / 0.24);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--text);
  background: rgb(8 12 14 / 0.88);
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: tooltip-in 0.18s var(--ease-smooth) both;
}

.tooltip-title {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
}

.tooltip-section-label {
  margin-top: 8px;
  color: #dffdfa;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tooltip-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.tooltip-metrics.relative {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tooltip-metrics span {
  min-width: 0;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-radius: 6px;
  padding: 5px 6px;
  color: var(--muted);
  background: rgb(15 22 30 / 0.72);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.2;
}

.tooltip-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.tooltip-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 780;
  line-height: 1.4;
}

.map-guide {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 92px;
  max-width: min(280px, calc(100% - 148px));
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgb(8 13 18 / 0.78);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.22);
}

.map-guide-mini {
  display: grid;
  gap: 6px;
}

.map-state-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.map-state-list div {
  min-width: 0;
}

.map-state-list dt {
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-state-list dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.map-guide p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.4;
}

.map-guide-detail {
  margin-top: 7px;
  border-top: 1px solid rgb(147 162 179 / 0.12);
  padding-top: 7px;
}

.map-guide-detail > summary {
  list-style: none;
  color: #dffdfa;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 950;
}

.map-guide-detail > summary::-webkit-details-marker {
  display: none;
}

.map-guide-detail > summary::after {
  content: "+";
  float: right;
  color: var(--teal);
}

.map-guide-detail[open] > summary::after {
  content: "-";
}

.map-guide-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
}

.map-guide-list div {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
}

.map-guide-list dt {
  color: #dffdfa;
  font-size: 0.6rem;
  font-weight: 950;
}

.map-guide-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 820;
  line-height: 1.35;
}

.map-guide em {
  display: inline-flex;
  margin-top: 7px;
  border: 1px solid rgb(45 212 191 / 0.24);
  border-radius: 999px;
  padding: 3px 7px;
  color: #dffdfa;
  background: rgb(45 212 191 / 0.08);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 950;
}

.nav-pad {
  position: absolute;
  right: 22px;
  bottom: 24px;
  z-index: 2;
  width: 104px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgb(9 15 18 / 0.58);
  transition:
    border-color 0.28s ease,
    background 0.28s ease,
    transform 0.28s var(--ease-smooth);
}

.nav-pad div {
  display: flex;
  gap: 8px;
}

.nav-pad button {
  width: 24px;
  height: 24px;
  border: 0;
  color: rgb(57 215 197 / 0.52);
  background: transparent;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.22s var(--ease-smooth);
}

.nav-pad button:hover {
  color: var(--teal);
  transform: scale(1.12);
}

.selected-card {
  min-height: 0;
  max-height: min(42vh, 320px);
  overflow: visible;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.selected-card-kicker {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.selected-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
}

.cover-wrap {
  width: 64px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgb(57 215 197 / 0.08);
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.selected-title {
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-artist {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-stage-line {
  display: none;
}

.selected-type-icon {
  display: none;
  flex: 0 0 auto;
  align-items: end;
  justify-content: center;
  gap: 2px;
  width: 38px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--selected-type-color, #14b8a6) 36%, #ffffff);
  border-radius: 999px;
  padding: 3px 6px;
  background: color-mix(in srgb, var(--selected-type-color, #14b8a6) 10%, #ffffff);
}

.selected-type-bars,
.selected-type-bands {
  display: inline-flex;
  align-items: end;
  gap: 1px;
  height: 14px;
}

.selected-type-bars span,
.selected-type-bands span {
  display: block;
  width: 2px;
  min-height: 3px;
  border-radius: 999px;
  background: var(--selected-type-color, #14b8a6);
}

.selected-type-bands {
  display: none;
}

.selected-type-fallback-shape {
  display: block;
  width: 18px;
  height: 10px;
  border-radius: 999px;
  background: var(--selected-type-color, #14b8a6);
}

.selected-stage-ranks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.selected-stage-rank {
  min-width: 0;
  border: 1px solid rgb(147 162 179 / 0.18);
  border-radius: 10px;
  padding: 8px 7px;
  color: var(--text);
  background: rgb(7 12 15 / 0.48);
  text-align: left;
}

button.selected-stage-rank {
  cursor: pointer;
  transition:
    border-color 0.24s ease,
    background 0.24s ease,
    transform 0.24s var(--ease-smooth);
}

button.selected-stage-rank:hover {
  border-color: rgb(57 215 197 / 0.5);
  background: rgb(57 215 197 / 0.08);
  transform: translateY(-1px);
}

.selected-stage-rank span,
.selected-stage-rank small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-stage-rank span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.selected-stage-rank strong {
  display: block;
  margin-top: 3px;
  color: #eafffb;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.selected-stage-rank small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
}

.selected-stage-rank.is-active {
  border-color: rgb(57 215 197 / 0.62);
  background: rgb(57 215 197 / 0.12);
}

.selected-stage-rank.is-muted {
  color: rgb(147 162 179 / 0.8);
  background: rgb(7 12 15 / 0.28);
}

.selected-stage-rank.is-muted strong,
.selected-stage-rank.is-muted small {
  color: rgb(147 162 179 / 0.7);
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--soft);
  background: rgb(7 12 15 / 0.72);
  font-size: 0.62rem;
  font-weight: 900;
}

a.tag {
  color: #c8fffa;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}

.map-guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.map-guide-links a {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgb(96 165 250 / 0.22);
  border-radius: 999px;
  padding: 0 8px;
  color: #dbeafe;
  background: rgb(96 165 250 / 0.08);
  font-size: 0.58rem;
  font-weight: 950;
}

.map-legend {
  position: absolute;
  z-index: 2;
  top: 84px;
  right: 18px;
  max-width: min(240px, calc(100% - 36px));
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgb(8 13 18 / 0.66);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.2);
}

.legend-detail > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 950;
}

.legend-detail > summary::-webkit-details-marker {
  display: none;
}

.legend-detail > summary::after {
  content: "+";
  color: var(--teal);
}

.legend-detail[open] > summary::after {
  content: "-";
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.selected-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.selected-note {
  margin-top: 10px;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-radius: 8px;
  padding: 8px;
  color: var(--muted);
  background: rgb(7 12 15 / 0.48);
  font-size: 0.66rem;
  font-weight: 780;
  line-height: 1.45;
}

.detail-link {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(57 215 197 / 0.42);
  border-radius: var(--radius);
  color: #dffdfa;
  background: rgb(57 215 197 / 0.1);
  font-size: 0.72rem;
  font-weight: 950;
  transition:
    transform 0.24s var(--ease-smooth),
    border-color 0.24s ease,
    background 0.24s ease;
}

.detail-link:hover {
  border-color: rgb(57 215 197 / 0.72);
  background: rgb(57 215 197 / 0.16);
  transform: translateY(-1px);
}

.detail-link.secondary {
  border-color: rgb(96 165 250 / 0.28);
  color: #dbeafe;
  background: rgb(96 165 250 / 0.08);
}

.detail-link.secondary:hover {
  border-color: rgb(96 165 250 / 0.56);
  background: rgb(96 165 250 / 0.14);
}

.selected-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.selected-observed-head {
  margin-top: 12px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: rgb(7 12 15 / 0.74);
  animation: soft-rise 0.42s var(--ease-smooth) both;
}

.metric-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.metric-value {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.inspector-block,
.shape-bars,
.journey-block,
.nearby-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: rgb(7 12 15 / 0.52);
  animation: soft-rise 0.42s var(--ease-smooth) both;
}

.selected-ruler {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.selected-relative-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.selected-detail-drawer {
  margin-top: 12px;
  border: 1px solid rgb(147 162 179 / 0.15);
  border-radius: var(--radius);
  padding: 8px;
  background: rgb(7 12 15 / 0.38);
}

.selected-detail-drawer > summary {
  list-style: none;
  color: #dffdfa;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
}

.selected-detail-drawer > summary::-webkit-details-marker {
  display: none;
}

.selected-detail-drawer > summary::after {
  content: "+";
  float: right;
  color: var(--teal);
}

.selected-detail-drawer[open] > summary::after {
  content: "-";
}

.relative-metric {
  min-width: 0;
  border: 1px solid rgb(45 212 191 / 0.16);
  border-radius: 7px;
  padding: 7px;
  background: rgb(45 212 191 / 0.055);
}

.relative-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.25;
}

.relative-metric strong {
  display: block;
  margin-top: 3px;
  color: #dffdfa;
  font-size: 0.86rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.inspector-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.inspector-section-head span {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.18;
}

.inspector-section-head small {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: right;
}

.section-note {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1.45;
}

.vote-breakdown {
  margin-top: 10px;
}

.vote-rank-list {
  display: grid;
  gap: 5px;
}

.vote-rank-row {
  display: grid;
  grid-template-columns: 32px 34px minmax(0, 1fr) 42px;
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.vote-rank-label {
  color: var(--soft);
}

.vote-point-label {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.vote-rank-track {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgb(95 116 125 / 0.18);
}

.vote-rank-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transform-origin: left center;
  animation: bar-glide 0.72s var(--ease-smooth) both;
}

.vote-count-label {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.shape-bars {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shape-reading {
  border: 1px solid rgb(57 215 197 / 0.2);
  border-radius: var(--radius);
  padding: 9px;
  background: rgb(255 255 255 / 0.03);
}

.shape-reading-head strong {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
  text-align: right;
  overflow-wrap: anywhere;
}

.shape-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.shape-row > span:first-child {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.shape-row > span:last-child {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.shape-track {
  height: 6px;
  border-radius: 999px;
  background: rgb(95 116 125 / 0.18);
  overflow: hidden;
}

.shape-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transform-origin: left center;
  animation: bar-glide 0.72s var(--ease-smooth) both;
}

.journey-block {
  margin-top: 12px;
}

.journey-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 5px;
}

.journey-chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  color: var(--muted);
  background: rgb(7 12 15 / 0.42);
  cursor: pointer;
  transition:
    transform 0.24s var(--ease-smooth),
    border-color 0.24s ease,
    background 0.24s ease,
    color 0.24s ease;
}

.journey-chip.active {
  border-color: rgb(57 215 197 / 0.56);
  color: var(--text);
  background: rgb(57 215 197 / 0.1);
}

.journey-phase {
  overflow: hidden;
  font-size: 0.58rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-score {
  margin-top: 3px;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.nearby-block {
  margin-top: 12px;
}

.nearby-list {
  display: grid;
  gap: 5px;
}

.nearby-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: rgb(7 12 15 / 0.48);
  cursor: default;
  transition:
    transform 0.24s var(--ease-smooth),
    border-color 0.24s ease,
    background 0.24s ease;
}

.nearby-item:hover {
  border-color: rgb(57 215 197 / 0.5);
  background: rgb(57 215 197 / 0.08);
}

.nearby-name {
  overflow: hidden;
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-meta {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-score {
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 950;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.nearby-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nearby-actions a,
.nearby-actions button {
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgb(96 165 250 / 0.22);
  border-radius: 7px;
  padding: 0 8px;
  color: #dbeafe;
  background: rgb(96 165 250 / 0.08);
  font-size: 0.58rem;
  font-weight: 950;
  cursor: pointer;
}

.preset-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.preset-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 8px;
  align-items: start;
}

.preset-head select {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 900;
}

.song-list {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.song-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--soft);
  background: transparent;
  cursor: pointer;
  animation: soft-rise 0.34s var(--ease-smooth) both;
  transition:
    transform 0.24s var(--ease-smooth),
    border-color 0.24s ease,
    background 0.24s ease,
    color 0.24s ease;
}

.song-list-item:hover,
.song-list-item.active {
  border-color: var(--line);
  background: rgb(255 255 255 / 0.055);
}

.song-list-name {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list-sub {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list-score {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 950;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.graph-controls {
  display: grid;
  gap: 14px;
  min-height: 0;
  border: 1px solid rgb(147 162 179 / 0.16);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: rgb(10 15 21 / 0.76);
}

.graph-controls > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
}

.graph-controls > summary::-webkit-details-marker {
  display: none;
}

.graph-controls > summary::after {
  content: "-";
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 950;
}

.graph-controls:not([open]) > summary::after {
  content: "+";
}

.graph-controls-grid {
  display: grid;
  grid-template-columns: 156px 156px 156px 118px 112px;
  gap: 14px;
  align-items: center;
}

.graph-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.graph-controls span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.graph-controls input[type="range"] {
  accent-color: var(--teal);
  min-height: 34px;
}

.graph-controls select {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 900;
}

.legend {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  align-content: center;
  max-height: 42px;
  overflow: hidden;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
  box-shadow: 0 0 14px var(--legend-color);
  animation: legend-breathe 3.8s ease-in-out infinite;
}

.side-panel,
.graph-controls,
.selected-card,
.map-head,
.nav-pad {
  animation: soft-rise 0.48s var(--ease-smooth) both;
}

.stage-button:nth-child(2),
.type-button:nth-child(2),
.song-list-item:nth-child(2),
.metric-card:nth-child(2),
.journey-chip:nth-child(2),
.nearby-item:nth-child(2) {
  animation-delay: 0.035s;
}

.stage-button:nth-child(3),
.type-button:nth-child(3),
.song-list-item:nth-child(3),
.metric-card:nth-child(3),
.journey-chip:nth-child(3),
.nearby-item:nth-child(3) {
  animation-delay: 0.07s;
}

.stage-button:nth-child(4),
.type-button:nth-child(4),
.song-list-item:nth-child(4),
.metric-card:nth-child(4),
.journey-chip:nth-child(4),
.nearby-item:nth-child(4) {
  animation-delay: 0.105s;
}

@keyframes soft-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bar-glide {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes map-sheen {
  0%,
  58% {
    transform: translateX(-130%);
  }

  100% {
    transform: translateX(130%);
  }
}

@keyframes tooltip-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes legend-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.84;
  }

  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1120px) {
  .graph-command-bar {
    grid-template-columns: minmax(230px, 0.68fr) minmax(330px, 1fr);
  }

  .insight-route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-workbench {
    grid-template-columns: 218px minmax(430px, 1fr) 246px;
  }

  .mode-tab {
    min-width: 92px;
  }

  .graph-controls-grid {
    grid-template-columns: repeat(5, minmax(86px, 1fr));
    gap: 10px;
  }

  .map-legend .legend-item:nth-child(n + 4) {
    display: none;
  }

  .legend-item {
    gap: 4px;
    font-size: 0.6rem;
  }

  .legend-dot {
    width: 7px;
    height: 7px;
  }
}

@media (max-width: 979px) {
  .graph-body {
    overflow-x: hidden;
  }

  .graph-shell {
    min-width: 0;
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto auto auto;
  }

  .graph-page-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }

  .graph-page-topbar h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .graph-command-bar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    order: 1;
  }

  .mode-control-group {
    order: 2;
  }

  .mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .ruler-switch {
    grid-template-columns: 1fr repeat(3, minmax(0, 1fr));
  }

  .mode-tab {
    min-width: 0;
    height: 36px;
    padding-inline: 6px;
    font-size: 0.72rem;
  }

  .top-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-self: stretch;
  }

  .top-actions input,
  .icon-button {
    min-height: 38px;
  }

  .insight-deck-head {
    align-items: start;
  }

  .map-insight-deck[open] .insight-route-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .map-insight-deck[open] .insight-route-card {
    min-width: min(280px, 82vw);
    scroll-snap-align: start;
  }

  .graph-workbench {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
    min-height: 0;
  }

  .map-panel {
    order: 1;
  }

  .right-panel {
    order: 2;
  }

  .left-panel {
    order: 3;
  }

  .side-panel {
    overflow: visible;
    gap: 12px;
    padding: 12px;
    backdrop-filter: none;
  }

  .left-panel,
  .right-panel {
    border: 0;
    grid-template-rows: none;
  }

  .left-panel {
    border-bottom: 1px solid var(--line);
  }

  .right-panel {
    border-top: 1px solid var(--line);
  }

  .stage-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-button {
    min-height: 36px;
  }

  .type-list {
    max-height: 224px;
  }

  .type-explainer {
    max-width: 100%;
  }

  .map-panel {
    height: min(70vh, 560px);
    min-height: 420px;
  }

  .map-head {
    top: 12px;
    right: 12px;
    left: 12px;
    flex-direction: column;
    gap: 8px;
  }

  .map-stats {
    justify-content: flex-start;
  }

  .stat-pill {
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .nav-pad {
    right: 12px;
    bottom: 12px;
    width: 96px;
    padding: 8px;
  }

  .map-guide {
    top: auto;
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 128px);
  }

  .map-legend {
    top: 98px;
    right: 12px;
    left: auto;
    bottom: auto;
    max-width: min(240px, calc(100% - 24px));
  }

  .selected-card {
    min-height: 0;
    max-height: none;
  }

  .selected-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .cover-wrap {
    width: 58px;
  }

  .selected-title,
  .selected-artist,
  .nearby-name,
  .nearby-meta,
  .song-list-name,
  .song-list-sub {
    white-space: normal;
  }

  .selected-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-section {
    max-height: 420px;
  }

  .song-list {
    max-height: 330px;
  }

  .graph-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .map-legend .legend-item:nth-child(n + 4) {
    display: inline-flex;
  }

  .graph-tooltip {
    max-width: calc(100% - 24px);
  }
}

@media (max-width: 520px) {
  .graph-shell h1 {
    font-size: 1rem;
  }

  .side-panel,
  .graph-controls {
    padding-inline: 10px;
  }

  .graph-page-topbar h1 {
    font-size: clamp(1.9rem, 13vw, 2.55rem);
  }

  .top-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .map-utility-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-deck-head {
    display: grid;
  }

  .icon-button {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
  }

  .stage-buttons,
  .graph-controls-grid {
    grid-template-columns: 1fr;
  }

  .ruler-switch {
    grid-template-columns: 1fr;
  }

  .ruler-switch > span {
    white-space: normal;
  }

  .segmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .segment {
    min-height: 32px;
    padding-inline: 4px;
    font-size: 0.68rem;
  }

  .map-panel {
    min-height: 480px;
  }

  .map-guide {
    right: 12px;
    bottom: 90px;
    max-width: none;
  }

  .map-legend {
    top: 116px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .selected-actions {
    grid-template-columns: 1fr;
  }

  .selected-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .inspector-section-head {
    flex-direction: column;
    gap: 3px;
  }

  .inspector-section-head small {
    text-align: left;
  }

  .vote-rank-row {
    grid-template-columns: 36px 38px minmax(0, 1fr) 44px;
  }

  .shape-row {
    grid-template-columns: 92px minmax(0, 1fr) 36px;
  }

  .nearby-item,
  .song-list-item {
    grid-template-columns: 1fr;
  }

  .nearby-score,
  .song-list-score {
    text-align: left;
  }
}

/* Motion shutdown: keep map and inspector rendering static. */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Keep the Map header aligned with the rest of Vote Lab. */
.graph-shell > .topbar h1 {
  font-size: 3.15rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.graph-shell > .site-nav {
  margin-bottom: 18px;
}

.graph-next-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 18px;
  background: rgba(6, 10, 15, 0.72);
}

.graph-next-panel h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.2rem;
}

.graph-next-panel p:not(.eyebrow) {
  max-width: 680px;
  margin: 6px 0 0;
  color: #a7b7c6;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .graph-shell > .topbar h1 {
    font-size: 2.35rem;
  }

  .graph-next-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .graph-shell > .topbar h1 {
    font-size: 2rem;
  }
}

/* Map UX refinement: keep the first viewport focused on the map itself. */
.graph-command-bar {
  grid-template-columns: minmax(360px, 0.35fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 10px;
}

.top-actions {
  grid-template-columns: minmax(210px, 1fr) auto;
  justify-self: stretch;
  align-self: start;
  align-items: end;
}

.mode-control-group {
  grid-template-columns: minmax(0, 1fr) minmax(166px, 190px);
  align-items: stretch;
  gap: 10px;
}

.mode-axis-group,
.basis-control-group {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: end;
  border: 1px solid rgb(147 162 179 / 0.18);
  border-radius: 8px;
  padding: 22px 10px 10px;
  background:
    linear-gradient(180deg, rgb(18 27 35 / 0.78), rgb(8 13 18 / 0.72)),
    rgb(8 13 18 / 0.84);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.mode-axis-group {
  border-color: rgb(45 212 191 / 0.24);
}

.basis-control-group {
  border-color: rgb(125 211 252 / 0.24);
}

.control-label {
  position: absolute;
  top: 7px;
  left: 10px;
  color: #d7f9f4;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.basis-control-group .control-label {
  color: #dff4ff;
}

.mode-tabs {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
}

.mode-tab {
  min-height: 38px;
  height: auto;
  padding-inline: 8px;
  font-size: 0.7rem;
  line-height: 1.15;
  white-space: normal;
}

.ruler-switch {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
}

.ruler-button {
  min-height: 34px;
  font-size: 0.72rem;
}

.mode-description {
  display: none;
}

.graph-state-chips {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgb(147 162 179 / 0.1);
  padding-top: 9px;
}

.graph-state-current,
.graph-state-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.graph-state-current > span,
.graph-state-active > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.graph-state-current b {
  min-height: 28px;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgb(147 162 179 / 0.13);
  border-radius: 999px;
  padding: 0 9px;
  color: #d7f9f4;
  background: rgb(15 23 31 / 0.76);
  font-size: 0.7rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-state-active.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.graph-state-chip {
  min-height: 28px;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(45 212 191 / 0.34);
  border-radius: 999px;
  padding: 0 9px;
  color: #dffdfa;
  background: rgb(45 212 191 / 0.1);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.graph-state-chip span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 850;
}

.graph-state-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 950;
}

.graph-state-chip em {
  color: var(--teal);
  font-style: normal;
}

.graph-state-chip:hover,
.graph-state-chip:focus-visible {
  border-color: rgb(94 234 212 / 0.72);
  background: rgb(45 212 191 / 0.16);
}

.graph-workbench {
  position: relative;
  height: calc(100vh - 250px);
  min-height: 520px;
  max-height: 820px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 300px);
}

.left-panel.filter-drawer {
  position: absolute;
  z-index: 7;
  top: 76px;
  left: 14px;
  width: auto;
  max-width: min(318px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  display: block;
  border: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  backdrop-filter: none;
}

.left-panel.filter-drawer > summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(57 215 197 / 0.34);
  border-radius: var(--radius);
  padding: 0 13px;
  color: #dffdfa;
  background: rgb(10 18 22 / 0.82);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.2);
  cursor: pointer;
  list-style: none;
}

.left-panel.filter-drawer > summary::-webkit-details-marker {
  display: none;
}

.left-panel.filter-drawer > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 14px rgb(57 215 197 / 0.72);
}

.left-panel.filter-drawer > summary span {
  font-size: 0.72rem;
  font-weight: 950;
}

.left-panel.filter-drawer > summary small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
}

.left-panel.filter-drawer[open] {
  width: min(318px, calc(100% - 28px));
  border: 1px solid rgb(147 162 179 / 0.18);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
  background: rgb(10 15 21 / 0.92);
  box-shadow: 0 22px 54px rgb(0 0 0 / 0.34);
  backdrop-filter: blur(16px);
}

.left-panel.filter-drawer[open] > summary {
  width: 100%;
  justify-content: space-between;
  box-shadow: none;
}

.filter-drawer-content {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.map-panel {
  min-height: calc(100vh - 265px);
}

.map-guide {
  top: auto;
  bottom: 18px;
  left: 18px;
  max-width: min(270px, calc(100% - 150px));
  padding: 7px 9px;
}

.map-guide-mini strong {
  display: block;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
}

.map-guide p {
  font-size: 0.62rem;
}

.selected-card {
  min-height: 0;
  max-height: min(44vh, 390px);
}

.right-panel {
  grid-template-rows: minmax(0, 1fr);
}

.right-panel .preset-section {
  display: none;
}

.right-panel .selected-card {
  max-height: none;
  border-bottom: 0;
  padding-bottom: 0;
}

.selected-relative-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.relative-metric {
  padding: 6px;
}

.relative-metric span {
  font-size: 0.54rem;
}

.relative-metric strong {
  font-size: 0.8rem;
}

@media (max-width: 1180px) {
  .graph-command-bar {
    grid-template-columns: 1fr;
  }

  .mode-control-group {
    grid-template-columns: 1fr;
  }

  .mode-tabs {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }

  .mode-tab {
    min-width: 0;
  }

  .ruler-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-workbench {
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: 1fr;
  }

  .left-panel.filter-drawer {
    position: static;
    order: 3;
    width: auto;
    max-width: none;
    max-height: none;
    border: 1px solid rgb(147 162 179 / 0.16);
    padding: 12px;
    overflow: visible;
    background: rgb(12 18 24 / 0.82);
  }

  .left-panel.filter-drawer > summary {
    width: 100%;
    justify-content: space-between;
    box-shadow: none;
  }

  .left-panel.filter-drawer:not([open]) {
    padding: 12px;
  }

  .filter-drawer-content {
    margin-top: 12px;
  }

  .map-panel {
    min-height: 420px;
    height: min(70vh, 560px);
  }

  .map-guide {
    right: 12px;
    left: 12px;
    bottom: 82px;
    max-width: none;
  }

  .selected-relative-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

  .map-utility-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .selected-relative-grid {
    grid-template-columns: 1fr;
  }

  .left-panel.filter-drawer > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-block: 9px;
  }
}

.mobile-map-panel,
.mobile-map-tabs {
  display: none;
}

@media (max-width: 767px) {
  .graph-shell {
    width: 100%;
    gap: 10px;
    padding-inline: 12px;
  }

  .graph-shell > .topbar {
    margin-bottom: 0;
    padding-block: 14px 10px;
  }

  .graph-shell > .topbar h1 {
    font-size: 1.8rem;
  }

  .graph-intro,
  .graph-command-bar,
  .map-insight-deck,
  .graph-controls,
  .graph-next-panel,
  .graph-data-footer {
    display: none !important;
  }

  .mobile-map-panel {
    display: grid;
    gap: 7px;
    border: 1px solid #d5e0ee;
    border-radius: 12px;
    padding: 9px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 16px 38px rgb(15 23 42 / 0.08);
  }

  .mobile-map-distance {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: baseline;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 780;
    line-height: 1.45;
  }

  .mobile-map-distance strong {
    color: #0f172a;
    font-size: 0.7rem;
    font-weight: 950;
  }

  .mobile-map-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 6px;
    align-items: end;
  }

  .mobile-map-search {
    grid-column: 1 / -1;
  }

  .mobile-map-search,
  .mobile-map-axis {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-map-search span,
  .mobile-map-axis span {
    color: #475569;
    font-size: 0.62rem;
    font-weight: 950;
  }

  .mobile-map-panel input,
  .mobile-map-panel select,
  .mobile-filter-button {
    min-width: 0;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 0 10px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
  }

  .mobile-map-panel input:focus,
  .mobile-map-panel select:focus,
  .mobile-filter-button:focus-visible {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.14);
  }

  .mobile-filter-button {
    color: #312e81;
    background: #eef2ff;
    font-size: 0.74rem;
    font-weight: 950;
    cursor: pointer;
  }

  .mobile-map-ruler {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-map-ruler .ruler-button {
    min-height: 34px;
    border-color: #cbd5e1;
    color: #334155;
    background: #ffffff;
    font-size: 0.72rem;
  }

  .mobile-map-ruler .ruler-button.active {
    border-color: #a5b4fc;
    color: #312e81;
    background: #eef2ff;
    box-shadow: none;
  }

  .mobile-map-tabs {
    display: none !important;
  }

  .mobile-map-tab {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #334155;
    background: #ffffff;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 950;
  }

  .mobile-map-tab.active {
    border-color: #4f46e5;
    color: #312e81;
    background: #eef2ff;
  }

  .graph-workbench {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .graph-shell[data-mobile-view="list"] .map-panel,
  .graph-shell[data-mobile-view="list"] .selected-card,
  .graph-shell[data-mobile-view="map"] .right-panel .preset-section {
    display: none;
  }

  .graph-shell[data-mobile-view="map"] .left-panel.filter-drawer:not([open]),
  .graph-shell[data-mobile-view="list"] .left-panel.filter-drawer:not([open]) {
    display: none;
  }

  .left-panel.filter-drawer[open] {
    position: fixed;
    z-index: 60;
    inset: auto 12px 12px;
    width: auto;
    max-width: none;
    max-height: min(78dvh, 620px);
    overflow: auto;
    border: 1px solid #d5e0ee;
    border-radius: 18px;
    padding: 14px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 26px 80px rgb(15 23 42 / 0.24);
  }

  .left-panel.filter-drawer[open] > summary {
    min-height: 44px;
    border-color: #cbd5e1;
    color: #0f172a;
    background: #f8fafc;
  }

  .left-panel.filter-drawer[open] > summary small,
  .left-panel.filter-drawer[open] .panel-title,
  .left-panel.filter-drawer[open] .filter-group-title,
  .left-panel.filter-drawer[open] .type-count,
  .left-panel.filter-drawer[open] .type-explainer-kicker,
  .left-panel.filter-drawer[open] .type-cue {
    color: #475569;
  }

  .left-panel.filter-drawer[open] .stage-button,
  .left-panel.filter-drawer[open] .segment,
  .left-panel.filter-drawer[open] .type-button,
  .left-panel.filter-drawer[open] .filter-detail-block,
  .left-panel.filter-drawer[open] .phase-select,
  .left-panel.filter-drawer[open] .type-explainer {
    border-color: #d5e0ee;
    color: #0f172a;
    background: #ffffff;
  }

  .left-panel.filter-drawer[open] .stage-button.active,
  .left-panel.filter-drawer[open] .segment.active,
  .left-panel.filter-drawer[open] .type-button.active {
    border-color: #5eead4;
    color: #0f766e;
    background: #f0fdfa;
    box-shadow: none;
  }

  .map-panel {
    height: min(650px, calc(100dvh - 230px));
    min-height: 430px;
    border: 8px solid rgb(15 23 42 / 0.62);
    border-radius: 12px;
    overflow: hidden;
  }

  .canvas-stage {
    height: 100%;
  }

  .map-head {
    top: 12px;
    right: 12px;
    left: 12px;
    gap: 8px;
  }

  .map-head h2 {
    font-size: 0.95rem;
  }

  .map-stats {
    gap: 6px;
  }

  .stat-pill {
    padding: 5px 8px;
    font-size: 0.64rem;
  }

  .map-stats .stat-pill:nth-child(n + 4) {
    display: none;
  }

  .map-guide {
    left: 12px;
    right: auto;
    bottom: 12px;
    max-width: min(188px, calc(100% - 112px));
    padding: 7px 8px;
  }

  .map-guide-detail {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }

  .map-guide-detail > summary {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .map-guide-detail:not([open]) .map-guide-detail-body {
    display: none;
  }

  .map-legend {
    top: 76px;
    right: 12px;
    left: auto;
    max-width: min(176px, calc(100% - 24px));
  }

  .nav-pad {
    right: 12px;
    bottom: 12px;
    width: 92px;
    padding: 8px;
  }

  .right-panel {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: -94px 12px 0;
    border: 0;
    border-radius: 18px 18px 0 0;
    padding: 0;
    color: #0f172a;
    background: transparent;
  }

  .selected-card {
    max-height: 38dvh;
    overflow: auto;
    border: 1px solid #d5e0ee;
    border-radius: 18px 18px 0 0;
    padding: 14px;
    color: #0f172a;
    background: rgb(255 255 255 / 0.97);
    box-shadow: 0 -20px 54px rgb(15 23 42 / 0.16);
  }

  .selected-card::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .selected-card-kicker,
  .selected-stage-rank span,
  .selected-stage-rank small,
  .selected-artist {
    color: #475569;
  }

  .selected-title,
  .selected-stage-rank strong,
  .metric-value {
    color: #0f172a;
  }

  .selected-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .cover-wrap {
    width: 58px;
    border-color: #d5e0ee;
  }

  .selected-stage-ranks {
    gap: 6px;
  }

  .selected-stage-rank,
  .metric-card {
    border-color: #d5e0ee;
    color: #0f172a;
    background: #ffffff;
  }

  .selected-stage-rank.is-active {
    border-color: #5eead4;
    background: #f0fdfa;
  }

  .detail-link.primary {
    min-height: 44px;
    border-color: #4f46e5;
    color: #ffffff;
    background: #4f46e5;
    font-size: 0.9rem;
  }

  .graph-shell[data-mobile-view="list"] .right-panel {
    position: static;
    margin: 0;
    border: 1px solid #d5e0ee;
    border-radius: 14px;
    padding: 12px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 14px 34px rgb(15 23 42 / 0.08);
  }

  .graph-shell[data-mobile-view="list"] .right-panel .preset-section {
    display: grid;
    max-height: none;
  }

  .preset-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .preset-head .panel-title,
  .song-list-name {
    color: #0f172a;
  }

  .song-list {
    max-height: calc(100dvh - 260px);
    overflow: auto;
    padding-right: 0;
  }

  .song-list-item {
    grid-template-columns: minmax(0, 1fr);
    min-height: 58px;
    border-color: #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    color: #0f172a;
    background: #ffffff;
  }

  .song-list-item + .song-list-item {
    margin-top: 8px;
  }

  .song-list-item.active {
    border-color: #5eead4;
    background: #f0fdfa;
  }

  .song-list-sub,
  .song-list-score {
    color: #475569;
    text-align: left;
  }

  .map-reading-callout {
    display: block;
    margin: 8px 4px 0;
    border: 0;
    padding: 0;
    color: #475569;
    background: transparent;
    box-shadow: none;
    font-size: 0.78rem;
    line-height: 1.55;
  }

  .map-reading-callout strong {
    margin-right: 6px;
    color: #0f172a;
    font-weight: 950;
  }
}
