:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-panel: #111827;
  --bg-panel-soft: #0f1724;
  --bg-input: #0b1220;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-blue: #58a6ff;
  --accent-cyan: #39d2c0;
  --accent-green: #3fb950;
  --accent-yellow: #f2cc60;
  --accent-orange: #ffa657;
  --accent-purple: #c297ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(88, 166, 255, 0.16), transparent 20%),
    radial-gradient(circle at bottom right, rgba(57, 210, 192, 0.12), transparent 24%),
    linear-gradient(180deg, #0d1117 0%, #0f1724 100%);
  color: var(--text-primary);
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.redirect-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.redirect-panel {
  width: min(480px, calc(100% - 32px));
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 27, 34, 0.98);
  box-shadow: var(--shadow);
}

.redirect-panel h1 {
  margin: 0 0 12px;
  color: var(--accent-cyan);
}

.app-shell {
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: var(--header-height);
  padding: 12px 24px;
  background: rgba(22, 27, 34, 0.98);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.title-group h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.mode-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.8);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.mode-link:hover,
.mode-link.is-active {
  background: rgba(88, 166, 255, 0.18);
  border-color: rgba(88, 166, 255, 0.55);
  color: var(--text-primary);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(57, 210, 192, 0.35);
  background: rgba(57, 210, 192, 0.12);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
}

.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent-blue);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 310px 1fr 310px;
  gap: 10px;
  padding: 10px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.control-panel,
.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
}

.workspace-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 27, 34, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace-panel-split {
  gap: 0;
}

.workspace-panel-scroll {
  overflow-y: auto;
}

.panel-section {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 27, 34, 0.96);
  box-shadow: var(--shadow);
  padding: 12px;
  min-height: 0;
}

.panel-section-compact {
  padding: 10px 12px;
}

.panel-disclosure {
  padding: 0;
  overflow: hidden;
}

.disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.panel-disclosure[open] .disclosure-summary {
  border-bottom: 1px solid rgba(48, 54, 61, 0.7);
}

.disclosure-note {
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: normal;
  text-transform: none;
}

.disclosure-body {
  padding: 12px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.9);
  background: rgba(13, 17, 23, 0.86);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.segmented-button:hover,
.segmented-button.is-active {
  border-color: rgba(57, 210, 192, 0.42);
  background: rgba(57, 210, 192, 0.12);
  color: var(--text-primary);
}

.config-section-hidden {
  display: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-header h2,
.panel-heading h2 {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.panel-heading-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 148, 158, 0.22);
  background: rgba(139, 148, 158, 0.14);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
}

.status-pill-cyan {
  color: var(--accent-cyan);
  border-color: rgba(57, 210, 192, 0.35);
  background: rgba(57, 210, 192, 0.12);
}

.status-pill-green {
  color: var(--accent-green);
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.12);
}

.status-pill-purple {
  color: var(--accent-purple);
  border-color: rgba(194, 151, 255, 0.35);
  background: rgba(194, 151, 255, 0.12);
}

.status-pill-danger {
  color: #ff7b72;
  border-color: rgba(255, 123, 114, 0.38);
  background: rgba(255, 123, 114, 0.12);
}

label,
.panel-text {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 6px;
}

textarea,
input[type="number"],
input[type="file"],
select {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}

input[type="range"] {
  width: 100%;
  margin: 6px 0;
  accent-color: var(--accent-cyan);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--accent-cyan);
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: rgba(57, 210, 192, 0.16);
  color: var(--accent-cyan);
  border-color: rgba(57, 210, 192, 0.35);
}

.btn-primary:hover {
  background: rgba(57, 210, 192, 0.28);
}

.btn-secondary {
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent-blue);
  border-color: rgba(88, 166, 255, 0.28);
}

.btn-secondary:hover {
  background: rgba(88, 166, 255, 0.22);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.inline-value-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.mono-value,
.info-grid dd,
.telemetry-chip strong,
.stage-statusbar,
.material-metrics strong {
  font-family: "Consolas", "Courier New", monospace;
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.84);
}

.status-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-value {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.material-metrics {
  display: grid;
  gap: 8px;
}

.material-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.84);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.material-metrics strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.workspace-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 17, 23, 0.4), rgba(13, 17, 23, 0.88)),
    radial-gradient(circle at top center, rgba(88, 166, 255, 0.12), transparent 28%),
    #0b1220;
}

.stage-3d {
  background:
    linear-gradient(180deg, rgba(13, 17, 23, 0.28), rgba(13, 17, 23, 0.92)),
    linear-gradient(90deg, rgba(48, 54, 61, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(48, 54, 61, 0.1) 1px, transparent 1px),
    #0b1220;
  background-size: auto, 44px 44px, 44px 44px, auto;
}

.stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-overlay {
  position: absolute;
  z-index: 3;
}

.stage-overlay.top-left {
  top: 14px;
  left: 14px;
}

.stage-overlay.top-right {
  top: 14px;
  right: 14px;
}

.stage-overlay.bottom-left {
  left: 14px;
  bottom: 14px;
}

.telemetry-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(13, 17, 23, 0.82);
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.telemetry-chip strong {
  color: var(--text-primary);
}

.key-hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.key-hints span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(13, 17, 23, 0.82);
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.stage-statusbar {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(57, 210, 192, 0.28);
  background: rgba(13, 17, 23, 0.84);
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

.stage-error-overlay {
  position: absolute;
  inset: 22px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(255, 123, 114, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(13, 17, 23, 0.52), rgba(13, 17, 23, 0.92)),
    radial-gradient(circle at top left, rgba(255, 123, 114, 0.18), transparent 36%);
  pointer-events: none;
}

.stage-error-title {
  color: #ff7b72;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-error-body {
  margin: 0;
  max-width: 560px;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.88rem;
}

.subsurface-panel {
  border-top: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.88);
  padding: 14px 16px 18px;
  flex: 0 0 auto;
  max-height: min(250px, 28vh);
  overflow: auto;
}

.subsurface-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.subsurface-header h3 {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.subsurface-note {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.braille-board {
  display: grid;
  gap: 12px;
}

.braille-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.braille-cell-button {
  display: grid;
  gap: 10px;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(48, 54, 61, 0.85);
  background: rgba(13, 17, 23, 0.86);
  color: var(--text-primary);
  cursor: pointer;
}

.braille-cell-button:hover,
.braille-cell-button.is-selected {
  border-color: rgba(57, 210, 192, 0.45);
  box-shadow: 0 0 0 1px rgba(57, 210, 192, 0.12);
}

.braille-cell-matrix {
  display: grid;
  grid-template-columns: repeat(2, 16px);
  grid-template-rows: repeat(3, 16px);
  gap: 8px;
  justify-content: center;
}

.braille-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(139, 148, 158, 0.4);
  background: rgba(139, 148, 158, 0.14);
}

.braille-dot.is-active {
  background: var(--accent-yellow);
  border-color: rgba(242, 204, 96, 0.85);
}

.braille-caption {
  display: block;
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-align: center;
}

.braille-library-card {
  min-width: 0;
  text-align: left;
  align-content: start;
  padding: 12px 14px;
}

.braille-library-title {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
}

.braille-library-meta,
.braille-library-summary {
  display: block;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.5;
}

.braille-library-summary {
  color: var(--text-primary);
}

.braille-scale-compact .braille-cell-button {
  min-width: 74px;
  padding: 8px 10px;
}

.braille-scale-compact .braille-cell-matrix {
  grid-template-columns: repeat(2, 13px);
  grid-template-rows: repeat(3, 13px);
  gap: 6px;
}

.braille-scale-compact .braille-dot {
  width: 13px;
  height: 13px;
}

.braille-scale-large .braille-cell-button {
  min-width: 104px;
  padding: 12px 14px;
}

.braille-scale-large .braille-cell-matrix {
  grid-template-columns: repeat(2, 18px);
  grid-template-rows: repeat(3, 18px);
  gap: 10px;
}

.braille-scale-large .braille-dot {
  width: 18px;
  height: 18px;
}

.info-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-grid div {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.7);
}

.info-grid div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-grid dt {
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.info-grid dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.audio-player {
  width: 100%;
  margin: 6px 0 10px;
  filter: saturate(0.82) brightness(0.92);
}

.manager-surface {
  display: grid;
  gap: 14px;
  padding: 14px;
}

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

.workspace-list {
  display: grid;
  gap: 10px;
}

.workspace-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(48, 54, 61, 0.9);
  background: rgba(13, 17, 23, 0.88);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.workspace-card:hover,
.workspace-card.is-selected {
  border-color: rgba(57, 210, 192, 0.42);
  box-shadow: 0 0 0 1px rgba(57, 210, 192, 0.12);
}

.workspace-card-invalid {
  border-color: rgba(255, 123, 114, 0.42);
  background: rgba(36, 16, 20, 0.9);
  cursor: default;
}

.workspace-card-title {
  color: var(--text-primary);
  font-size: 0.92rem;
}

.workspace-card-body,
.workspace-card-meta,
.workspace-card-path {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.82rem;
}

.workspace-card-path {
  word-break: break-word;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.76rem;
}

.workspace-card-static {
  cursor: default;
}

.mono-block {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid rgba(139, 148, 158, 0.14);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

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

.backend-card {
  cursor: pointer;
}

.backend-card-active {
  border-color: rgba(242, 204, 96, 0.44);
  box-shadow: 0 0 0 1px rgba(242, 204, 96, 0.14);
}

.backend-card-spotlight {
  border-color: rgba(94, 234, 212, 0.46);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.14);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(10, 16, 28, 0.92)),
    rgba(10, 16, 28, 0.92);
}

.backend-card-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backend-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.3;
  border: 1px solid rgba(139, 148, 158, 0.2);
  color: var(--text-primary);
  background: rgba(22, 27, 34, 0.9);
}

.backend-state-pill-selected {
  border-color: rgba(57, 210, 192, 0.38);
  background: rgba(57, 210, 192, 0.14);
}

.backend-state-pill-active {
  border-color: rgba(242, 204, 96, 0.38);
  background: rgba(242, 204, 96, 0.14);
}

.backend-state-pill-spotlight {
  border-color: rgba(94, 234, 212, 0.38);
  background: rgba(94, 234, 212, 0.16);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.scene-trail-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.scene-trail-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 231, 135, 0.26);
  background: rgba(126, 231, 135, 0.08);
  color: var(--text-primary);
  font-size: 0.74rem;
  line-height: 1.4;
  word-break: break-word;
}

.scene-trail-separator {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.evidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(88, 166, 255, 0.32);
  background: rgba(88, 166, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.4;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.modal-visible {
  display: flex;
}

.modal-content {
  width: min(700px, calc(100% - 32px));
  max-height: 82vh;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 18px 22px 22px;
}

.modal-body h3 {
  margin: 0 0 10px;
  color: var(--accent-blue);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-body p,
.modal-body li {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.88rem;
}

.modal-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.modal-body p {
  margin: 0 0 16px;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.compact-list-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.74);
  background: rgba(13, 17, 23, 0.78);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.compact-list-item-danger {
  border-color: rgba(255, 123, 114, 0.34);
  background: rgba(52, 21, 26, 0.72);
  color: #ffb4ae;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #2a3340;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #415063;
}

@media (max-width: 1260px) {
  .workspace-grid {
    grid-template-columns: 290px 1fr;
  }

  .inspector-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .control-panel,
  .inspector-panel {
    overflow: visible;
  }

  .inspector-panel {
    grid-template-columns: 1fr;
  }

  .workspace-stage {
    min-height: 420px;
  }

  .subsurface-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .app-header {
    padding: 12px 14px;
  }

  .workspace-grid {
    padding: 8px;
  }

  .key-hints {
    display: none;
  }

  .subsurface-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .manager-summary-grid {
    grid-template-columns: 1fr;
  }

  .backend-split-grid {
    grid-template-columns: 1fr;
  }
}
