.layout-projection_lab .site-header {
  display: none;
}

.layout-projection_lab .site-main {
  padding-block: 0;
}

.projection-lab {
  --lab-ink: var(--primary);
  --lab-muted: var(--text-muted);
  --lab-border: var(--border-medium);
  --lab-surface: color-mix(in srgb, var(--surface) 94%, var(--accent-light));
  --lab-user: #0fa76e;
  --lab-pca: #d65f2e;
  --lab-blue: #3b73d9;
  min-height: 100vh;
  padding: 28px 0 42px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent-light) 42%, transparent),
      transparent 360px
    ),
    var(--bg);
}

[data-theme='dark'] .projection-lab {
  --lab-surface: #151515;
  --lab-blue: #7da2ff;
}

.projection-shell {
  width: min(1180px, 94vw);
  margin: 0 auto;
}

.projection-header {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 18px;
}

.projection-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lab-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.projection-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3.25vw, 3.35rem);
  line-height: 1.02;
  color: var(--lab-ink);
  letter-spacing: 0;
}

.projection-nowrap {
  white-space: nowrap;
}

.projection-header p:last-child {
  margin: 0;
  max-width: 680px;
  color: var(--text);
  font-size: clamp(0.98rem, 1.45vw, 1.14rem);
}

.projection-toolbar,
.projection-panel {
  border: 1px solid var(--lab-border);
  border-radius: 8px;
  background: var(--lab-surface);
  box-shadow: var(--shadow-sm);
}

.projection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.projection-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--lab-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.projection-toolbar select,
.projection-toolbar button {
  min-height: 38px;
  border: 1px solid var(--lab-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.projection-toolbar select {
  width: 190px;
  padding: 0 34px 0 12px;
}

.projection-toolbar button {
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.projection-toolbar button:hover,
.projection-toolbar button:focus {
  border-color: var(--accent);
  color: var(--primary);
}

.projection-toolbar button[data-pca-view] {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.projection-workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 12px;
  align-items: stretch;
}

.projection-panel {
  min-width: 0;
  overflow: hidden;
}

.projection-panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--lab-border);
}

.projection-panel h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--lab-ink);
}

.projection-panel-head span {
  color: var(--lab-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.projection-scene {
  height: clamp(360px, 54vh, 620px);
  min-height: 360px;
  cursor: grab;
  touch-action: none;
}

.projection-scene:active {
  cursor: grabbing;
}

.projection-scene canvas,
.projection-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.projection-panel--plot {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
}

.projection-canvas {
  min-height: 360px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-light));
}

.projection-lower {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.projection-panel--sliders,
.projection-panel--metrics,
.projection-panel--note {
  padding: 14px;
}

.projection-panel--sliders h2,
.projection-panel--metrics h2,
.projection-panel--note h2 {
  margin-bottom: 12px;
}

.projection-panel--sliders label {
  display: grid;
  grid-template-columns: 72px minmax(120px, 1fr) 58px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  color: var(--lab-muted);
  font-size: 0.9rem;
}

.projection-panel--sliders output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.projection-panel--sliders input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

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

.projection-metrics div {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--lab-border);
  border-radius: 8px;
  background: var(--surface);
}

.projection-metrics span {
  display: block;
  color: var(--lab-muted);
  font-size: 0.82rem;
}

.projection-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--lab-ink);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.projection-panel--note p {
  margin: 0;
  color: var(--text);
}

.projection-panel--scene.is-loading .projection-scene::before {
  content: 'Loading 3D view';
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--lab-muted);
}

@media (max-width: 920px) {
  .projection-header,
  .projection-workbench,
  .projection-lower {
    grid-template-columns: 1fr;
  }

  .projection-header {
    align-items: start;
  }

  .projection-toolbar label {
    width: 100%;
    margin-right: 0;
  }

  .projection-toolbar select {
    flex: 1;
    width: auto;
  }

  .projection-toolbar button {
    flex: 1 1 132px;
  }
}

@media (max-width: 560px) {
  .projection-lab {
    padding-top: 18px;
  }

  .projection-shell {
    width: min(100% - 24px, 1180px);
  }

  .projection-header {
    gap: 14px;
  }

  .projection-scene,
  .projection-canvas,
  .projection-panel--plot {
    min-height: 320px;
  }

  .projection-panel--sliders label {
    grid-template-columns: 64px minmax(100px, 1fr);
  }

  .projection-panel--sliders output {
    grid-column: 2;
    text-align: left;
    margin-top: -8px;
  }

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