﻿:root {
  color-scheme: light;
  --artist-band-height: clamp(490px, 55vh, 610px);
  --builder-panel-width: clamp(330px, 21vw, 420px);
  --evolution-column-width: 30%;
  --bg: #d9ded7;
  --panel: #ffffff;
  --ink: #1f2528;
  --muted: #667075;
  --line: #c9d0c8;
  --sidebar: #d9ded7;
  --sidebar-ink: #1f2528;
  --sidebar-muted: #596660;
  --blue: #2f6f9f;
  --green: #4f8a67;
  --red: #b35a4a;
  --gold: #b88932;
  --violet: #6f5b9a;
  --neutral: #c3cac5;
  --neutral-light: #eef0ec;
  --shadow: 0 10px 30px rgba(31, 37, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 10px;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: var(--builder-panel-width) minmax(0, 1fr) minmax(320px, 460px);
  align-items: stretch;
  column-gap: 8px;
  min-height: 50px;
  padding: 0 2px;
}

.active-summary {
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: none;
  padding: 6px 10px;
  border: 1px solid rgba(31, 37, 40, 0.15);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 18px rgba(31, 37, 40, 0.06);
  color: var(--ink);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
}
.model-tabs {
  display: flex;
  align-items: end;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  align-self: end;
  padding-left: 10px;
}

.model-tab {
  min-width: 188px;
  max-width: 285px;
  min-height: 64px;
  border: 1px solid rgba(31, 37, 40, 0.14);
  border-bottom-color: rgba(31, 37, 40, 0.28);
  border-radius: 8px 8px 0 0;
  background: rgba(238, 240, 236, 0.68);
  color: var(--muted);
  padding: 6px 10px 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  overflow: hidden;
}

.model-tab + .model-tab {
  margin-left: 2px;
}

.model-tab.is-active {
  border-color: rgba(31, 37, 40, 0.28);
  border-bottom-color: rgba(255, 255, 255, 0.88);
  background: var(--panel);
  color: var(--ink);
  transform: translateY(1px);
  position: relative;
  z-index: 2;
}

.model-tab.is-pending {
  border-color: rgba(47, 111, 159, 0.3);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  cursor: progress;
}

.model-tab-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-tab-meta {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.15;
  font-weight: 760;
  color: var(--muted);
  white-space: normal;
}

.model-tab.is-active .model-tab-meta {
  color: var(--ink);
}

.model-tab-bars {
  display: grid;
  gap: 2px;
  margin-top: 5px;
}

.tab-mini-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.tab-mini-row b {
  color: var(--muted);
  font-size: 8px;
  font-weight: 820;
  text-transform: uppercase;
}

.tab-mini-row span {
  height: 4px;
  border-radius: 999px;
  background: rgba(31, 37, 40, 0.1);
  overflow: hidden;
}

.tab-mini-row i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--bar, var(--ink));
}

.model-tab-waitbar {
  display: block;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(31, 37, 40, 0.1);
}

.model-tab-waitbar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  animation: waitbar 1.1s ease-in-out infinite alternate;
}

@keyframes waitbar {
  from { transform: translateX(-18%); }
  to { transform: translateX(150%); }
}

.model-tab-glyph {
  --tab-color: var(--neutral);
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1px solid rgba(31, 37, 40, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(31,37,40,0.48) 46% 54%, transparent 54%),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-diagonal,
.model-tab-glyph.pattern-steep {
  background:
    repeating-linear-gradient(135deg, transparent 0 3px, rgba(31,37,40,0.58) 3px 4px),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-vertical {
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(31,37,40,0.5) 3px 4px),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-horizontal {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(31,37,40,0.5) 3px 4px),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-dots {
  background:
    radial-gradient(rgba(31,37,40,0.65) 1px, transparent 1.2px) 0 0 / 5px 5px,
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-cross {
  background:
    repeating-linear-gradient(135deg, transparent 0 3px, rgba(31,37,40,0.46) 3px 4px),
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(31,37,40,0.46) 3px 4px),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph.pattern-grid {
  background:
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(31,37,40,0.44) 4px 5px),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(31,37,40,0.44) 4px 5px),
    linear-gradient(135deg, var(--tab-color) 0 50%, #ef8f2f 50% 100%);
}

.model-tab-glyph,
.model-tab-glyph.pattern-diagonal,
.model-tab-glyph.pattern-steep,
.model-tab-glyph.pattern-vertical,
.model-tab-glyph.pattern-horizontal,
.model-tab-glyph.pattern-dots,
.model-tab-glyph.pattern-cross,
.model-tab-glyph.pattern-grid {
  background: var(--tab-color);
}

.tab-spinner {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid rgba(47, 111, 159, 0.2);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: tab-spin 820ms linear infinite;
}

@keyframes tab-spin {
  to {
    transform: rotate(360deg);
  }
}

.model-tab-meta {
  display: flex;
  gap: 7px;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
  white-space: nowrap;
}

.model-tab-add {
  flex: 0 0 auto;
  width: 42px;
  height: 66px;
  border: 1px solid rgba(31, 37, 40, 0.24);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 760;
  line-height: 1;
  align-self: end;
  margin-left: 6px;
  transform: translateY(1px);
  position: relative;
  z-index: 2;
  box-shadow: inset 0 -1px 0 rgba(31, 37, 40, 0.08);
}

.model-tab + .model-tab-add {
  margin-left: 6px;
}

.model-tab-add:hover {
  background: #ffffff;
  border-color: rgba(31, 37, 40, 0.34);
}

.size-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  white-space: nowrap;
  align-self: center;
  margin-left: 8px;
}

.size-dot {
  display: inline-block;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.62;
}

.size-dot.small {
  width: 6px;
  height: 6px;
}

.size-dot.large {
  width: 13px;
  height: 13px;
}

.card-size-key {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 720;
  white-space: nowrap;
}

.card-size-key span {
  display: inline-block;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.56;
}

.card-size-key span:first-child {
  width: 4px;
  height: 4px;
}

.card-size-key span:nth-child(2) {
  width: 9px;
  height: 9px;
}

.matrix-target-key span:first-child {
  width: 8px;
  height: 8px;
  background: var(--ink);
  opacity: 0.46;
}

.matrix-target-key span:nth-child(2) {
  width: 10px;
  height: 10px;
  background: transparent;
  border: 1.5px solid var(--ink);
  opacity: 0.9;
}

.model-tab-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  margin-top: -1px;
}

.model-tab-content {
  display: grid;
  position: relative;
  grid-template-columns: var(--builder-panel-width) minmax(0, 1fr);
  grid-template-rows: var(--artist-band-height) minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.model-tab-content::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(var(--builder-panel-width) + 10px);
  right: 0;
  top: 0;
  bottom: 0;
  border: 1px solid rgba(31, 37, 40, 0.28);
  border-radius: 0 10px 10px 10px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 42px rgba(31, 37, 40, 0.09);
  pointer-events: none;
}

.artist-band {
  display: contents;
  box-sizing: border-box;
}

.run-control-drawer {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 30;
  display: none;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 66px);
}

.run-control-drawer.is-open {
  display: block;
}

.run-control-drawer .run-panel {
  max-height: calc(100vh - 66px);
  overflow: auto;
}

.run-control-drawer .model-run-list {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 2px 2px 0;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--sidebar-ink);
}

.vista-mark {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  align-self: center;
  border: 1px solid rgba(31, 37, 40, 0.24);
  border-radius: 999px;
  background:
    repeating-linear-gradient(135deg, transparent 0 4px, rgba(31,37,40,0.5) 4px 5px),
    linear-gradient(135deg, #ef8f2f 0 50%, #f4b66b 50% 100%);
  clip-path: circle(50% at 50% 50%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.28);
  filter: none;
}

.tour-start {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(31, 37, 40, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 4px 9px 4px 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 820;
}

.tour-start svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-start:hover {
  background: rgba(255, 255, 255, 0.82);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
}

h2 {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 760;
}

.brand p,
.hint,
.eyebrow,
small {
  color: var(--muted);
}

.brand p {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.artist-workspace {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 8px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 0;
}

.header-metrics {
  flex: 0 1 410px;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  margin-left: 4px;
}

.metric-strip div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-strip div {
  border-color: rgba(31, 37, 40, 0.08);
  background: rgba(255, 255, 255, 0.62);
  padding: 5px 7px;
  box-shadow: 0 6px 16px rgba(31, 37, 40, 0.04);
}

.metric-strip span {
  display: block;
  font-size: 14px;
  font-weight: 780;
  color: var(--ink);
}

.metric-strip small {
  display: block;
  margin-top: 1px;
  font-size: 8px;
  line-height: 1.15;
  color: var(--muted);
}

.main-grid {
  display: grid;
  height: 100%;
  max-height: none;
  align-content: stretch;
  grid-template-columns: minmax(520px, 1fr) var(--evolution-column-width);
  grid-template-rows: auto minmax(210px, 1fr);
  grid-template-areas:
    "groupmap groupmap"
    "provideroverview trajectory";
  gap: 10px;
  align-items: stretch;
}

.group-trajectory {
  grid-area: trajectory;
  align-self: stretch;
}
.group-map {
  grid-area: groupmap;
  align-self: start;
}
.group-bars { grid-area: groupbars; }
.user-sketch { grid-area: usersketch; }
.user-detail { grid-area: userdetail; }
.provider-overview {
  grid-area: provideroverview;
  align-self: stretch;
}
.provider-ranks { grid-area: providerranks; }
.set-overlap { grid-area: setoverlap; }

.user-sketch,
.user-detail,
.provider-ranks,
.group-bars,
.set-overlap {
  display: none;
}

.provider-overview .chart,
.group-trajectory .chart {
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.compact {
  margin-bottom: 0;
  padding: 10px;
  border-color: rgba(31, 37, 40, 0.1);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 24px rgba(31, 37, 40, 0.07);
  color: var(--ink);
  min-height: 0;
}

.user-band {
  display: contents;
}

.artist-band-panel,
.user-band .compact {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: visible;
}

.artist-band-panel {
  grid-column: 1;
  grid-row: 1;
}

.artist-band .compact .hint,
.artist-band .compact small,
.user-band .compact .hint,
.user-band .compact small {
  color: #6c756f;
}

.group-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto auto auto auto minmax(0, 1fr);
  gap: 6px 9px;
  align-content: stretch;
}

.artist-band-panel {
  border-color: rgba(31, 37, 40, 0.16);
}

.artist-band-panel .group-list,
.user-band-panel .group-list {
  align-self: stretch;
}

.group-panel > .panel-title,
.group-panel > label,
.group-panel > .control-grid,
.group-panel > .selection-status,
.group-panel > .group-list {
  grid-column: 1 / -1;
}

.group-panel > button {
  grid-column: 1 / -1;
  margin: 0;
  justify-self: center;
  align-self: center;
  width: min(190px, 78%);
  min-height: 22px;
  max-height: 24px;
  padding: 3px 12px;
}

.run-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 6px 9px;
  min-height: 0;
  align-content: start;
}

.user-band-panel {
  grid-column: 1;
  grid-row: 2;
  border-color: rgba(31, 37, 40, 0.16);
}

.user-workspace {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 8px;
}

.user-grid {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) var(--evolution-column-width);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "useroutcome userbars userevolution";
  gap: 10px;
}

.user-artist-bars { grid-area: userbars; }
.user-artist-outcome { grid-area: useroutcome; }
.user-artist-evolution { grid-area: userevolution; }

.user-artist-bars .chart,
.user-artist-outcome .chart {
  display: grid;
  place-items: center;
}

.user-grid .panel-title {
  min-height: 16px;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 0;
}

.user-grid .panel-title .title-with-icon {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.user-grid .panel-title .hint {
  display: none;
}

.user-artist-bars .panel-title .hint {
  display: inline;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-grid .panel-title .panel-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.run-panel > .panel-title,
.run-panel > label,
.run-panel > .control-grid,
.run-panel > .model-run-list,
.run-panel > .backend-diagnostic,
.run-panel > .run-divider,
.run-panel > label:nth-of-type(n + 7) {
  grid-column: 1 / -1;
}

.run-panel > label:nth-of-type(1),
.run-panel > label:nth-of-type(2),
.run-panel > label:nth-of-type(4),
.run-panel > label:nth-of-type(5) {
  grid-column: auto;
}

.run-panel label,
.run-panel .view-switch,
.run-panel .primary {
  margin: 0;
}

.run-panel .control-grid {
  gap: 9px;
}

.span-2 {
  grid-column: span 2;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden-for-artist {
  display: none !important;
}

.panel-title {
  display: flex;
  min-height: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 780;
}

.main-grid .panel-title {
  min-height: 16px;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 0;
}

.main-grid .panel-title .title-with-icon {
  display: inline-flex;
  margin-right: auto;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.main-grid .panel-title .hint {
  display: none;
}

.main-grid .panel-title .panel-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.panel-title .hint,
.panel-title .status-pill {
  margin-left: auto;
}

.title-target-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
  white-space: nowrap;
}

.title-target-control select {
  min-height: 19px;
  padding: 1px 18px 1px 6px;
  border-radius: 5px;
  font-size: 9px;
}

.panel-expand,
.panel-download {
  position: relative;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcfa;
  color: var(--muted);
  cursor: pointer;
}

.panel-expand {
  width: 16px;
  flex: 0 0 16px;
}

.panel-download {
  flex: 0 0 auto;
  padding: 0 5px;
  font-size: 9px;
  font-weight: 820;
  line-height: 14px;
}

.panel-expand::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px solid var(--muted);
  border-radius: 2px;
}

.panel-expand:hover,
.panel-download:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.title-with-two-icons {
  gap: 3px;
}

.title-with-two-icons svg + svg {
  margin-left: -1px;
}

.panel-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

svg.panel-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.run-icon-svg {
  color: #31453a;
  fill: currentColor;
  stroke: none;
}

.user-group-icon-svg {
  color: #31453a;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-icon::before,
.panel-icon::after {
  content: "";
  position: absolute;
  border: 1.8px solid var(--ink);
  background: transparent;
}

.user-icon::before {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.user-icon::after {
  left: 3px;
  top: 10px;
  width: 11px;
  height: 6px;
  border-radius: 8px 8px 2px 2px;
}

.provider-icon::before {
  left: 2px;
  top: 4px;
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

.provider-icon::after {
  left: 5px;
  top: 1px;
  width: 8px;
  height: 5px;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}

.hint {
  font-size: 10px;
  font-weight: 560;
}

.status-pill {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.status-pill.is-ready {
  border-color: rgba(79, 138, 103, 0.36);
  background: rgba(79, 138, 103, 0.14);
  color: #2f6547;
}

.status-pill.is-error {
  border-color: rgba(179, 90, 74, 0.32);
  background: rgba(179, 90, 74, 0.1);
  color: #7a3d33;
}

label {
  display: grid;
  gap: 3px;
  margin-bottom: 0;
  color: #414a4e;
  font-size: 10px;
  font-weight: 700;
}

label.is-disabled {
  opacity: 0.48;
}

.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

select,
input[type="number"],
input[type="text"],
input[type="color"] {
  width: 100%;
  min-height: 23px;
  border: 1px solid #c7d0c8;
  border-radius: 6px;
  background: #fbfcf8;
  color: var(--ink);
  padding: 3px 7px;
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  height: 15px;
  accent-color: var(--ink);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.primary {
  width: 100%;
  min-height: 27px;
  border: 0;
  border-radius: 6px;
  background: #4f8a67;
  color: #fff;
  font-weight: 760;
  font-size: 12px;
  cursor: pointer;
}

.run-divider {
  height: 1px;
  margin: 0;
  background: var(--line);
}

.backend-diagnostic {
  display: none;
  border: 1px solid rgba(31, 37, 40, 0.12);
  border-radius: 7px;
  background: rgba(251, 252, 250, 0.84);
  color: var(--muted);
  padding: 6px 7px;
  font-size: 10px;
  line-height: 1.3;
  word-break: break-word;
}

.backend-diagnostic.is-visible {
  display: block;
}

.backend-diagnostic.is-ok {
  border-color: rgba(79, 138, 103, 0.28);
  background: rgba(79, 138, 103, 0.08);
  color: #355f47;
}

.backend-diagnostic.is-error {
  border-color: rgba(179, 90, 74, 0.3);
  background: rgba(179, 90, 74, 0.08);
  color: #7a3d33;
}

.backend-diagnostic strong {
  display: block;
  margin-bottom: 2px;
  color: currentColor;
}

.secondary {
  width: 100%;
  min-height: 24px;
  margin-top: 0;
  border: 1px solid rgba(44, 99, 67, 0.3);
  border-radius: 6px;
  background: #4f8a67;
  color: #ffffff;
  font-weight: 760;
  font-size: 12px;
  cursor: pointer;
}

.view-switch {
  width: 100%;
  min-height: 27px;
  border: 1px solid #31453a;
  border-radius: 6px;
  background: #edf3ed;
  color: #25342c;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.view-switch:disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  cursor: default;
  opacity: 0.68;
}

.view-switch.is-active {
  background: #31453a;
  color: #fff;
}

.secondary:disabled {
  cursor: default;
  opacity: 0.5;
}

.primary:disabled {
  cursor: wait;
  opacity: 0.6;
}

.chart {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  min-width: 0;
}

.chart.large {
  height: auto;
}

.chart.xlarge {
  height: auto;
}

.chart.short {
  height: auto;
}

.chart-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 5px;
  align-items: end;
  margin-bottom: 2px;
  flex: 0 0 auto;
}

.chart-toolbar label {
  margin-bottom: 0;
}

.atlas-controls {
  grid-template-columns: minmax(116px, 150px) minmax(106px, 140px) minmax(116px, 154px) auto minmax(220px, 1fr);
  justify-content: start;
  max-width: none;
  margin-bottom: 0;
  gap: 4px;
}

.atlas-controls select {
  min-height: 20px;
  padding: 2px 6px;
  font-size: 10px;
}

.atlas-controls label {
  font-size: 10px;
}

.set-overlap .user-card {
  grid-template-columns: 1fr;
}

.set-overlap .song-list {
  max-height: 118px;
}

.group-bars .axis text {
  font-size: 9px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.range-row span {
  display: none;
}

.range-row strong {
  color: var(--ink);
  text-align: right;
}

.group-list,
.model-run-list {
  display: grid;
  gap: 5px;
  margin-top: 2px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  align-content: start;
  align-items: start;
}

.model-run-list {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.group-chip,
.model-run-chip {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 6px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 11px;
  min-height: 34px;
  max-height: 38px;
}

.member-count {
  min-width: 34px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--neutral-light);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.model-run-chip {
  grid-template-columns: 10px 1fr;
  cursor: pointer;
}

.group-chip.is-selected,
.model-run-chip.is-selected {
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.group-chip.selectable {
  cursor: pointer;
}

.group-chip strong,
.model-run-chip strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.05;
}

.selection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 19px;
  border: 1px solid rgba(31, 37, 40, 0.1);
  border-radius: 6px;
  padding: 2px 6px;
  background: rgba(238, 240, 236, 0.7);
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
}

.compact-clear-button {
  justify-self: center;
  width: auto;
  min-height: 20px;
  padding: 2px 9px;
  border-color: rgba(31, 37, 40, 0.18);
  background: #ffffff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.config-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}

.import-config-button {
  display: grid;
  place-items: center;
  min-height: 27px;
  margin: 0;
  cursor: pointer;
  text-align: center;
}

#exportConfigButton,
.import-config-button {
  min-height: 22px;
  border-color: rgba(31, 37, 40, 0.18);
  background: #ffffff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.run-primary-centered {
  justify-self: center;
  width: min(230px, 84%);
}

.swatch {
  width: 10px;
  height: 20px;
  border-radius: 999px;
}

.user-pattern-swatch {
  --pattern-color: #31453a;
  border: 1px solid rgba(31, 37, 40, 0.24);
  background-color: #eef0ec;
}

.user-pattern-swatch.pattern-solid {
  background: #c3cac5;
}

.user-pattern-swatch.pattern-diagonal {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--pattern-color) 3px 4px);
}

.user-pattern-swatch.pattern-vertical {
  background-image: repeating-linear-gradient(90deg, transparent 0 3px, var(--pattern-color) 3px 4px);
}

.user-pattern-swatch.pattern-horizontal {
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, var(--pattern-color) 3px 4px);
}

.user-pattern-swatch.pattern-dots {
  background-image: radial-gradient(var(--pattern-color) 1px, transparent 1.2px);
  background-size: 5px 5px;
}

.user-pattern-swatch.pattern-cross {
  background-image:
    repeating-linear-gradient(135deg, transparent 0 3px, var(--pattern-color) 3px 4px),
    repeating-linear-gradient(45deg, transparent 0 3px, var(--pattern-color) 3px 4px);
}

.user-pattern-swatch.pattern-grid {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 4px, var(--pattern-color) 4px 5px),
    repeating-linear-gradient(0deg, transparent 0 4px, var(--pattern-color) 4px 5px);
}

.user-pattern-swatch.pattern-steep {
  background-image: repeating-linear-gradient(70deg, transparent 0 3px, var(--pattern-color) 3px 4px);
}

.tiny-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.atlas-toggle {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--neutral-light);
  font-size: 10px;
}

.atlas-toggle[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(31, 37, 40, 0.26);
}

.atlas-bias-key {
  display: inline-grid;
  grid-template-columns: auto 84px auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.atlas-bias-ramp {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(31, 37, 40, 0.14);
  background: linear-gradient(90deg, #c46a4a 0%, #d7cfad 50%, #3f7f93 100%);
}

.atlas-bar-key {
  display: inline-grid;
  grid-template-columns: 21px auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 2px 3px;
  border: 1px solid rgba(31, 37, 40, 0.12);
  border-radius: 5px;
  background: rgba(251, 252, 250, 0.72);
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.atlas-mini-cell {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 3px);
  align-items: end;
  gap: 2px;
  width: 21px;
  height: 18px;
  padding: 3px 4px;
  border-radius: 3px;
  background: #d7cfad;
  border: 1px solid rgba(31, 37, 40, 0.12);
}

.atlas-mini-cell i {
  display: block;
  width: 3px;
  border-radius: 1px 1px 0 0;
  background: var(--ink);
}

.atlas-mini-cell i:nth-child(1) { height: 7px; opacity: 0.55; }
.atlas-mini-cell i:nth-child(2) { height: 11px; opacity: 0.73; }
.atlas-mini-cell i:nth-child(3) { height: 14px; opacity: 0.96; }

.atlas-bar-key > span:not(.atlas-mini-cell) {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend-dot {
  display: inline-block;
  width: 4px;
  height: 10px;
  border-radius: 1px;
  background: var(--ink);
}

.legend-catalog { opacity: 0.55; }
.legend-training { opacity: 0.73; }
.legend-rec { opacity: 0.96; }

.atlas-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  white-space: nowrap;
}

.atlas-check input {
  width: 12px;
  height: 12px;
}

.atlas-info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  z-index: 20;
}

.concept-info {
  margin-left: 3px;
  vertical-align: middle;
}

.atlas-info strong {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.atlas-info-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 200;
  display: block;
  width: min(260px, calc(100vw - 32px));
  padding: 8px 10px;
  border: 1px solid rgba(31, 37, 40, 0.16);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(31, 37, 40, 0.16);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.atlas-info:hover .atlas-info-popover,
.atlas-info:focus-within .atlas-info-popover {
  opacity: 1;
  transform: translateY(0);
}

.panel-title .atlas-info-popover {
  left: 0;
  right: auto;
}

.atlas-check .atlas-info-popover {
  left: auto;
  right: 0;
}

.artist-token-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

.artist-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 5px;
  border: 1px solid rgba(31, 37, 40, 0.12);
  border-radius: 999px;
  background: rgba(238, 240, 236, 0.82);
  color: var(--ink);
  font-size: 9px;
  font-weight: 760;
}

.artist-token button {
  width: 13px;
  height: 13px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 37, 40, 0.12);
  color: var(--ink);
  font-size: 9px;
  line-height: 12px;
  cursor: pointer;
}

.file-mini {
  overflow: hidden;
}

.file-mini input[type="file"] {
  width: 100%;
  font-size: 9px;
}

.viz-fade {
  animation: viz-fade 180ms ease-out;
}

@keyframes viz-fade {
  from { opacity: 0.45; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
}

.suggestion-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  padding: 3px 6px;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.metric-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.axis text {
  fill: var(--muted);
  font-size: 10px;
}

.iteration-axis text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.iteration-band {
  shape-rendering: crispEdges;
}

.artist-window-brush .selection {
  fill: #31453a;
  fill-opacity: 0.12;
  stroke: #31453a;
  stroke-opacity: 0.42;
}

.artist-window-brush .overlay {
  cursor: crosshair;
}

.artist-selection-ring {
  pointer-events: none;
}

.iteration-active-label {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.iteration-point {
  pointer-events: none;
}

.artist-atlas-cell.is-interactive,
.artist-atlas-cell.is-interactive .artist-cell-hit-target {
  cursor: pointer;
}

.artist-atlas-cell.is-hovered .atlas-cell-bg,
.artist-atlas-cell.is-interactive:hover .atlas-cell-bg {
  stroke: var(--ink);
  stroke-width: 2.2px;
}

.artist-atlas-cell.is-focused .atlas-cell-bg {
  stroke: var(--ink);
  stroke-width: 2.4px;
}

.axis text.linked-label {
  cursor: pointer;
  font-weight: 760;
}

.artist-tick text {
  font-size: 9px;
}

.rank-cell-label {
  fill: var(--ink);
  font-size: 7px;
  font-weight: 800;
  pointer-events: none;
}

.axis path,
.axis line,
.grid line {
  stroke: var(--line);
}

.tooltip {
  position: fixed;
  z-index: 10;
  max-width: min(320px, calc(100vw - 24px));
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.34;
  overflow-wrap: anywhere;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
}

.tooltip strong {
  display: block;
  margin-bottom: 3px;
}

.user-panel {
  display: grid;
  gap: 6px;
  min-height: 0;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
}

.user-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.user-card div,
.song-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #fbfcfa;
}

.user-card div {
  background: var(--user-bg, #fbfcfa);
}

.song-row {
  background: var(--provider-bg, #fbfcfa);
  background-blend-mode: screen;
}

.panel-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
}

.panel-modal.is-open {
  display: grid;
}

.panel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 37, 40, 0.34);
}

.panel-modal-content {
  position: relative;
  width: min(1180px, calc(100vw - 80px));
  height: min(760px, calc(100vh - 70px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(31, 37, 40, 0.28);
  padding: 12px;
}

.panel-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.panel-modal-body {
  height: 100%;
}

.panel-modal-body > .panel {
  height: 100%;
  box-shadow: none;
}

.panel-modal-body svg {
  width: 100%;
  height: 100%;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  pointer-events: none;
}

.artist-context-menu {
  position: fixed;
  z-index: 80;
  display: none;
  min-width: 148px;
  padding: 5px;
  border: 1px solid rgba(31, 37, 40, 0.16);
  border-radius: 7px;
  background: #fbfcfa;
  box-shadow: 0 14px 32px rgba(31, 37, 40, 0.18);
}

.artist-context-menu.is-open {
  display: grid;
  gap: 4px;
}

.artist-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 5px 7px;
  text-align: left;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.artist-context-menu button:hover {
  background: var(--neutral-light);
}

.tour-overlay.is-open {
  display: block;
}

.tour-dim {
  position: absolute;
  inset: 0;
  background: rgba(31, 37, 40, 0.38);
  pointer-events: auto;
}

.tour-spotlight {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 11px;
  box-shadow: 0 0 0 9999px rgba(31, 37, 40, 0.36), 0 14px 42px rgba(31, 37, 40, 0.28);
  transition: left 160ms ease, top 160ms ease, width 160ms ease, height 160ms ease;
  pointer-events: none;
}

.tour-card {
  position: absolute;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid rgba(31, 37, 40, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(31, 37, 40, 0.22);
  padding: 12px;
  color: var(--ink);
  pointer-events: auto;
  transition: left 160ms ease, top 160ms ease;
}

.tour-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.tour-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tour-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 820;
}

.tour-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tour-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.tour-actions button:disabled {
  opacity: 0.42;
  cursor: default;
}

.user-card strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.song-list {
  display: grid;
  gap: 4px;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.song-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--ink);
}

@media (max-width: 1450px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .artist-band {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .app-shell {
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto;
  }

  .model-tab-content {
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .model-tab-content::before {
    display: none;
  }

  .artist-band-panel,
  .artist-workspace,
  .user-band-panel,
  .user-workspace {
    grid-column: 1;
    grid-row: auto;
  }

  .artist-band,
  .user-band {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .topbar,
  .metric-strip {
    display: grid;
    min-width: 0;
  }

  .main-grid {
    height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    grid-template-areas:
      "groupmap"
      "provideroverview"
      "trajectory";
  }

  .user-grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(220px, auto));
    grid-template-areas:
      "useroutcome"
      "userbars"
      "userevolution";
  }

  .span-2 {
    grid-column: auto;
  }
}



