.performance-surface {
  display: none;
  margin: 8px 0 0;
}

html[data-work-mode="performance"] .performance-surface {
  display: block;
}

.performance-surface .section-head > strong {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line));
  color: var(--amber);
  background: var(--tracker-cell-2);
  font-family: var(--tracker-font);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.performance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.performance-basis-status {
  margin: 0 0 6px;
}

.performance-status {
  min-height: 24px;
  margin: 0 0 8px;
  padding: 6px 8px 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--muted);
  background: var(--tracker-cell);
  font-family: var(--tracker-font);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.performance-guide-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 8px;
  min-width: 0;
}

.performance-guide-strip span {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  min-height: 26px;
  padding: 4px 6px 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  font-family: var(--tracker-font);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.performance-guide-strip span[data-state="active"] {
  border-color: color-mix(in srgb, var(--lime) 44%, var(--line));
  color: var(--lime);
}

.performance-guide-strip span[data-state="warning"] {
  border-color: color-mix(in srgb, var(--amber) 58%, var(--line));
  color: var(--amber);
}

.performance-panel {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 180px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  background: var(--tracker-cell);
}

.performance-panel:hover {
  border-color: color-mix(in srgb, var(--amber) 44%, var(--line));
  background: color-mix(in srgb, var(--tracker-cell) 88%, var(--amber) 6%);
}

.performance-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  font-family: var(--tracker-font);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.performance-panel-title strong,
.performance-macro-readout,
.performance-xy-axis strong {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.performance-panel-note {
  min-height: 24px;
  margin: 0;
  padding: 5px 7px 3px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  font-family: var(--tracker-font);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

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

.performance-macro-pad,
.performance-xy-axis,
.performance-program {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

.performance-macro-name,
.performance-xy-axis span,
.performance-program span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--tracker-font);
  font-size: 0.62rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.performance-macro-pad input[type="range"],
.performance-xy-axis input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--amber);
}

.performance-program select {
  width: 100%;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  color: var(--text);
  background: var(--tracker-cell-2);
  font-family: var(--tracker-font);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.performance-xy-pad {
  position: relative;
  min-height: 190px;
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--amber) 10%, var(--panel))),
    linear-gradient(0deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--cyan) 12%, transparent)),
    repeating-linear-gradient(90deg, transparent 0 24px, color-mix(in srgb, var(--line) 32%, transparent) 24px 25px),
    repeating-linear-gradient(0deg, transparent 0 24px, color-mix(in srgb, var(--line) 32%, transparent) 24px 25px);
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
}

.performance-xy-pad:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--amber) 62%, var(--line));
  outline-offset: 2px;
}

.performance-xy-pad::before,
.performance-xy-pad::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: color-mix(in srgb, var(--amber) 34%, transparent);
}

.performance-xy-pad::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.performance-xy-pad::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.performance-xy-corner {
  position: absolute;
  z-index: 1;
  padding: 4px 5px;
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  font-family: var(--tracker-font);
  font-size: 0.54rem;
  font-weight: 900;
  text-transform: uppercase;
  pointer-events: none;
}

.performance-xy-corner.top-left {
  top: 0;
  left: 0;
}

.performance-xy-corner.top-right {
  top: 0;
  right: 0;
}

.performance-xy-corner.bottom-left {
  bottom: 0;
  left: 0;
}

.performance-xy-corner.bottom-right {
  right: 0;
  bottom: 0;
}

.performance-xy-cursor {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 2px solid var(--amber);
  background: color-mix(in srgb, var(--tracker-cell) 64%, transparent);
  box-shadow:
    0 0 0 1px #000,
    0 0 18px color-mix(in srgb, var(--amber) 36%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.performance-macro-readout,
.performance-xy-axis strong {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--amber) 34%, var(--line));
  background: var(--tracker-cell-2);
  font-family: var(--tracker-font);
  font-size: 0.62rem;
  font-weight: 900;
}

.performance-xy-readout,
.performance-scenes,
.performance-fx-grid {
  display: grid;
  gap: 6px;
}

.performance-xy-readout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.performance-scenes .ghost-button {
  min-height: 30px;
  padding: 0 8px;
  color: var(--text);
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: color-mix(in srgb, var(--tracker-cell) 86%, var(--amber) 8%);
  font-size: 0.58rem;
}

.performance-scenes .ghost-button[data-performance-action] {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 48%, var(--line));
  background: color-mix(in srgb, var(--tracker-cell) 78%, var(--amber) 14%);
}

.performance-scenes .ghost-button:hover,
.performance-scenes .ghost-button:focus-visible {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 56%, var(--line));
}

.performance-fx-chip {
  min-height: 28px;
  display: inline-grid;
  align-items: center;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  font-family: var(--tracker-font);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.performance-fx-chip[data-state="active"] {
  border-color: color-mix(in srgb, var(--lime) 42%, var(--line));
  color: var(--lime);
}

.performance-system {
  min-height: 0;
  border-color: color-mix(in srgb, var(--cyan) 34%, var(--line));
}

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

@media (max-width: 680px) {
  .performance-guide-strip {
    grid-template-columns: 1fr;
  }
}
