/* The preview page, on the shared design system (../site/theme.css). The canvas stays 640 x 480 CSS pixels with a
   1 px border on a wide screen (the smoke tests read it at that size); on a narrow screen it is the full width at 4:3. */

.bench { display: grid; grid-template-columns: 642px minmax(18rem, 1fr); gap: 1.5rem; align-items: start; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.view x3d-canvas { display: block; width: 640px; max-width: 100%; height: auto; aspect-ratio: 4 / 3; border: 1px solid var(--line2); background: var(--canvas); }
.view .chip { color: var(--muted); flex-wrap: wrap; min-width: 0; height: auto; padding-block: 0.35rem; line-height: 1.4; overflow-wrap: anywhere; }
.view .panel-head { max-width: 642px; }
.status-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0; padding: 0.75rem 1rem; max-width: 642px; font: 0.875rem/1.5 var(--mono); overflow-wrap: anywhere; }
#status a { color: var(--orange2); }

.controls { display: grid; gap: 1rem; }
fieldset.panel { margin: 0; min-width: 0; padding: 0.9rem 1rem 1rem; border: 0; display: grid; gap: 0.75rem; }
fieldset.panel legend { float: left; width: 100%; padding: 0; font: 600 0.75rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
fieldset.panel label { display: grid; gap: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hint { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.swatch::before { content: ""; width: 0.75rem; height: 0.75rem; margin-right: 0.5rem; border-radius: 50%; background: currentColor; }
.swatch[data-color="0.9 0.15 0.15"]::before { background: #e63a3a; }
.swatch[data-color="0.15 0.8 0.2"]::before { background: #3acc4a; }
.swatch[data-color="0.95 0.85 0.1"]::before { background: #f2d91a; }

.help { margin-top: 1.5rem; padding: 1.25rem 1.5rem 1.5rem; }
.help h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.help ul { margin: 0 0 0.9rem; padding-left: 1.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 2rem; font-size: 0.9375rem; color: #d3d9e3; }
.help b { color: var(--text); font-weight: 600; }

.tech { margin-top: 2.5rem; }
.tech > .label { margin-bottom: 0.75rem; }
.tech-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.tech-grid .panel { min-width: 0; }
.tech-grid .panel-head { display: block; }
.tech-grid pre { margin: 0.75rem; max-height: 16rem; }
#log { max-height: 16rem; overflow: auto; }
#log .error { color: var(--red); }
.facts { margin: 0.25rem 0; font-size: 0.8125rem; }
.facts th, .facts td { padding: 0.55rem 1rem; }
.facts th { white-space: nowrap; width: 1%; }
.facts td { font-family: var(--mono); word-break: break-all; }

@media (max-width: 1100px)
{
   .bench { grid-template-columns: minmax(0, 1fr); }
   .view { min-width: 0; max-width: 642px; }
   .controls { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
   .tech-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
   .tech-grid .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 767px)
{
   .help ul, .tech-grid { grid-template-columns: minmax(0, 1fr); }
   .tool { flex: 1 1 auto; }
}
