/* Workshop visual language for the dense Lab surface. Behavioural layout rules
   remain in the page stylesheet; this file only sets the shared shell and skin. */
:root {
  --lab-accent: #d47b72;
  --lab-control-radius: 4px;
  --lab-box-radius: 6px;
}

body { padding: 0; background: radial-gradient(circle at 50% -20%, #333b48, var(--lab-bg) 48%); }
main { top: auto; width: 100%; min-height: 100vh; box-sizing: border-box; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--lab-border-strong); border-radius: 0; background: rgb(24 27 33 / 94%); box-shadow: none; display: flex; flex-direction: column; }

.lab-header { height: 64px; min-height: 64px; box-sizing: border-box; padding: 10px 16px; border-bottom: 1px solid var(--lab-border-strong); background: #242830; }
.lab-brand { gap: 11px; }
.lab-mark { display: grid; place-items: center; width: 32px; height: 32px; box-sizing: border-box; border: 1px solid var(--lab-accent); border-radius: 50%; color: var(--lab-accent); font-weight: 800; }
.lab-title { display: block; }
.lab-title h1 { position: static; top: auto; color: #f0f2f4; font-size: 15px; line-height: 1.2; }
.lab-build { color: var(--lab-muted); font-size: 10px; font-weight: 500; letter-spacing: .04em; }
.lab-title p { position: static; top: auto; max-width: 720px; margin: 3px 0 0; overflow: hidden; color: var(--lab-muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.header-links { gap: 4px; }
/* The page's own <style> block still declares .header-link as an inline-flex row with a 6px gap, a leftover
   from before this skin existed. Reset to a plain inline link, matching .workshop-nav a and .gallery-nav a: a
   flex gap here would double up with the GitHub icon's own margin (site-nav.css) and widen that one link,
   which then shifts every link before it, since the row is anchored to the header's right edge. */
.header-link { display: inline-block; gap: normal; padding: 5px 7px; border-color: transparent; color: var(--lab-muted); background: transparent; font-size: 11px; }
.header-link:hover, .header-link:focus-visible { border-color: var(--lab-border-strong); color: var(--lab-text); background: var(--lab-panel); }
/* Export, Import and Reset session act on the Lab's own state, not on which page is shown, so a divider sets them
   apart from the page links beside them. It adds no height, so the header row keeps its layout. */
.persistence-actions { gap: 4px; margin-right: 8px; padding-right: 12px; border-right: 1px solid var(--lab-border-strong); }

.toolbar { gap: 8px; margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--lab-border-strong); background: #242830; }
.motion-actions { gap: 8px; }
.motion-demo-group, .motion-tool-group { gap: 4px; padding: 4px; border-color: var(--lab-border); border-radius: var(--lab-box-radius); background: var(--lab-bg-deep); }
.motion-tool-group { background: transparent; }
.motion-group-label { padding: 0 5px; color: var(--lab-muted); font-size: 10px; }
.motion-actions > .motion-demo-group button, .motion-actions > .motion-tool-group button { height: 30px; padding: 5px 8px; border-radius: var(--lab-control-radius); font-size: 11px; }
.motion-actions .motion-speed-control { height: 30px; min-width: 160px; border-color: var(--lab-border); background: #20252d; font-size: 10px; }
.motion-actions .motion-speed-control input[type="range"] { accent-color: var(--lab-accent); }
.motion-actions .motion-speed-control output { color: var(--lab-accent); }

button, label, select { border-radius: var(--lab-control-radius); padding: 7px 9px; }
button:hover, button:focus-visible { border-color: var(--lab-accent); }
button[aria-pressed="true"], label:has(> input[type="checkbox"]:checked) { border-color: var(--lab-accent); background: rgb(212 123 114 / 10%); color: var(--lab-accent); box-shadow: 0 0 0 1px rgb(212 123 114 / 22%); }
button:disabled, button:disabled:hover, button:disabled:focus-visible { border-color: var(--lab-border); background: #1d2026; box-shadow: none; }
#add-card { border-color: var(--lab-accent); background: var(--lab-panel); color: var(--lab-accent); box-shadow: 0 0 9px rgb(212 123 114 / 20%); }
#add-card:hover, #add-card:focus-visible { border-color: #e39a92; color: #e39a92; background: #303640; box-shadow: 0 0 15px rgb(212 123 114 / 35%); }
input[type="checkbox"], input[type="range"] { accent-color: var(--lab-accent); }

.lab-workspace { flex: 1 1 auto; grid-template-columns: 320px minmax(420px, 1fr) 360px; grid-template-rows: minmax(0, 1fr); gap: 0; height: max(786px, calc(100vh - 64px)); min-height: max(786px, calc(100vh - 64px)); align-items: stretch; background: var(--lab-bg-deep); }
.side-controls { grid-auto-rows: max-content; align-content: start; gap: 0; padding: 0; background: linear-gradient(180deg, rgb(44 49 58 / 96%), rgb(35 40 48 / 96%)); }
.cards-sidebar { border-right: 1px solid var(--lab-border-strong); }
.elements-sidebar { border-left: 1px solid var(--lab-border-strong); }
.side-controls-header { display: flex; align-items: center; justify-content: space-between; min-height: 45px; box-sizing: border-box; padding: 11px 13px; border-bottom: 1px solid var(--lab-border-strong); }
.side-controls-header h2 { margin: 0; color: #edf0f4; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.side-controls .control-group { margin: 0 12px; padding: 12px 0 13px; border: 0; border-bottom: 1px solid var(--lab-border); border-radius: 0; background: transparent; }
.side-controls .control-group:last-child { border-bottom: 0; }
.control-group > summary, #diagnostics-panel > summary { color: var(--lab-accent); }
.side-controls .control-group > summary { display: flex; align-items: center; gap: 0; min-height: 20px; margin: 0 0 8px; padding: 0; color: var(--lab-accent); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.side-controls .control-group > summary::-webkit-details-marker { display: none; }
.side-controls .control-group > summary::before { width: 1em; height: auto; margin-inline-end: 3px; border: 0; color: var(--lab-muted); content: "▸"; flex: 0 0 auto; transform: none; }
.side-controls .control-group[open] > summary { margin-bottom: 8px; border-bottom: 0; }
.side-controls .control-group[open] > summary::before { border: 0; content: "▾"; transform: none; }
.side-controls .control-group:not([open]) { padding-bottom: 0; }
.side-controls .control-group:not([open]) > summary { margin-bottom: 0; }
.control-group > summary .summary-meta { color: var(--lab-muted); }
.control-group p { font-size: 11px; line-height: 1.45; }
.control-row { gap: 7px; margin: 6px 0; font-size: 11px; }
.control-row select, .control-row input { font-size: 11px; }
.control-row output { color: var(--lab-accent); font-size: 10px; }
.drag-motion-tuning { border-color: var(--lab-border); border-radius: var(--lab-control-radius); background: var(--lab-panel); }
.drag-motion-tuning > summary, #drag-help summary { color: var(--lab-muted); font-size: 11px; }
.presets { gap: 4px; margin-top: 8px; font-size: 11px; }
.presets button { padding: 5px 7px; font-size: 11px; }
#card-list { scrollbar-color: var(--lab-border-strong) transparent; }
#card-list label { min-height: 32px; padding: 5px 7px; border-color: transparent; border-radius: var(--lab-control-radius); background: transparent; font-size: 11px; }
#card-list label:has(> input[type="checkbox"]:checked) { border-color: var(--lab-accent); background: rgb(212 123 114 / 10%); box-shadow: inset 0 0 0 1px rgb(212 123 114 / 12%); }
#card-list .card-title { color: var(--lab-accent); }
#selection-status, #selection-detail { font-size: 10px; line-height: 1.4; }
.zone-row, .element-row, .attachment-row { border-color: var(--lab-border); border-radius: var(--lab-control-radius); background: var(--lab-panel); }
.zone-count { color: var(--lab-accent); }
.zone-actions-label { color: var(--lab-muted); font-size: 10px; }
.zone-arrangement-settings summary { color: var(--lab-muted); font-size: 11px; }
#highlight-group input[type="color"] { justify-self: end; width: 42px; height: 24px; padding: 2px; }
#highlight-group .control-subgroup-title { margin: 10px 0 4px; padding-top: 8px; border-top: 1px solid var(--lab-border); color: var(--lab-accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.scene-column { display: flex; flex-direction: column; min-height: 0; padding: 12px 12px 0; background: #242830; }
.scene-column > .motion-actions { margin: 0 0 8px; }
#stage { height: min(900px, calc(100vh - 260px)); min-height: 520px; flex: 1 1 auto; border-color: var(--lab-border-strong); border-radius: 7px; background: radial-gradient(ellipse at center, #333944 0%, #252a32 56%, #20242b 100%); }
.lab-zone-anchor { border-radius: 10px; }
.lab-zone-anchor span { padding: 2px 5px; border-radius: 3px; background: rgb(33 37 43 / 88%); font-size: 10px; }
.status-meta { margin-top: 8px; }
#fps-status { flex-basis: auto; }
#renderer-status, #fps-status, #pointer-status { font-size: 10px; }
#status { color: var(--lab-accent); font-size: 11px; }
#diagnostics-panel { margin-top: 10px; padding: 0 0 10px; border: 0; border-bottom: 1px solid var(--lab-border); border-radius: 0; background: transparent; }
#diagnostics-panel > summary { padding: 9px 0; }
#diagnostics-panel[open] > summary { margin-bottom: 10px; border-bottom: 1px solid var(--lab-border); }
#run-diagnostics-benchmark { border-color: var(--lab-accent); color: var(--lab-accent); background: var(--lab-panel); }
#run-diagnostics-benchmark:hover, #run-diagnostics-benchmark:focus-visible { border-color: #e39a92; color: #e39a92; background: rgb(212 123 114 / 15%); box-shadow: 0 0 14px rgb(212 123 114 / 20%); }
#diagnostics-status, #diagnostics-report { border-color: var(--lab-border); border-radius: var(--lab-control-radius); }
.cardinal-inspection { --cardinal-inspection-accent: var(--lab-accent); }
.inspection-status[data-open="true"] { box-shadow: 0 0 8px rgb(212 123 114 / 72%); }
#inspect-card { border-color: var(--lab-accent); color: var(--lab-accent); background: rgb(212 123 114 / 8%); }
#inspect-card:hover, #inspect-card:focus-visible { background: rgb(212 123 114 / 16%); }
.cardinal-webgl-attachment-controls button:hover, .cardinal-webgl-attachment-controls button:focus-visible { border-color: #e39a92; color: #e39a92; background: rgb(212 123 114 / 12%); outline-color: var(--lab-accent); }
body.stage-full-window #full-window-fps { border-color: rgb(212 123 114 / 55%); box-shadow: 0 3px 16px rgb(0 0 0 / 28%), 0 0 12px rgb(212 123 114 / 18%); }

@media (max-width: 1120px) {
  .lab-workspace { grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); grid-template-rows: max(786px, calc(100vh - 64px)) auto; height: auto; min-height: 0; }
  .elements-sidebar { grid-column: 1 / -1; border-top: 1px solid var(--lab-border-strong); border-left: 0; }
}

@media (max-width: 640px) {
  body { padding: 0; }
  main { width: 100%; border-radius: 0; }
  .lab-header { height: auto; min-height: 64px; align-items: flex-start; flex-wrap: wrap; }
  .lab-title p { white-space: normal; }
  .header-links { width: 100%; flex-wrap: wrap; }
  .lab-workspace { grid-template-columns: 1fr; grid-template-rows: none; height: auto; min-height: 0; }
  .cards-sidebar { border-right: 0; border-bottom: 1px solid var(--lab-border-strong); }
  .scene-column { order: -1; }
}

body.stage-full-window main { border: 0; border-radius: 0; box-shadow: none; }
