/* Light lab page layout. Type, colour and controls come from Dusk: tokens/dusk.css,
   css/dusk.css and the editor's control recipes (dusk-controls.css, the .dk classes). */

[hidden] {
	display: none !important;
}

html,
body.lab {
	height: 100%;
}
body.lab {
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	font-size: 13px;
	line-height: 18px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-synthesis: none;
}
button,
input {
	font: inherit;
}
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* ---- Top bar (DimSum's: 48px, hairline under) ---------------------------- */
.topbar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 48px;
	padding: 0 20px;
	border-bottom: 1px solid var(--color-rule);
}
.crumbs {
	display: flex;
	align-items: baseline;
	min-width: 0;
}
.crumbs .wordmark {
	font-size: 18px;
	color: inherit;
	text-decoration: none;
}
.crumbs .sep {
	margin: 0 10px;
	color: var(--color-ink-faint);
}
.crumbs .page {
	font-size: 15px;
	font-weight: var(--weight-medium);
}
.topbar .dk-meta {
	margin: 0;
	font-size: 12px;
}

/* ---- Workspace: the view, and the panel on the right ---------------------- */
.workspace {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
}
.stage {
	position: relative;
	min-height: 0;
	overflow: hidden;
	background: #f5f5f5; /* the neutral mat behind a drawing */
}
.stage canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}
#overlay {
	touch-action: none;
}
#plan {
	background: var(--color-paper);
	touch-action: none;
}
.view-switch {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	border-radius: var(--radius-md);
	background: var(--color-paper);
	box-shadow: var(--popover-shadow);
}
.view-switch fieldset {
	margin: 0;
	border: 0;
	min-width: 0;
}
.view-switch .dk-segmented > button {
	min-width: 44px;
}
#stage-message {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 24px;
	text-align: center;
	color: var(--color-ink-dim);
}
#stage-message.error {
	color: var(--color-warn);
}

.panel {
	min-height: 0;
	overflow-y: auto;
	border-left: 1px solid var(--color-rule);
	background: var(--color-paper);
}
.panel-section {
	padding: 16px 20px 20px;
	border-bottom: 1px solid var(--color-rule);
}
.panel-section h2 {
	margin: 0 0 12px;
}

/* ---- Fixture -------------------------------------------------------------- */
.fixture-select {
	width: 100%;
}
.dk-input.angle {
	width: 72px;
}
#light-aim .dk-row + .dk-row {
	margin-top: 8px;
}
#light-aim .dk-row-label {
	flex: 1;
}
.fixture-name {
	margin: 0;
	font-size: 15px;
	line-height: 20px;
	font-weight: var(--weight-semibold);
	overflow-wrap: anywhere;
}
.fixture-meta {
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 16px;
	color: var(--color-ink-dim);
}
.polar-wrap {
	margin: 12px 0 4px;
	text-align: center;
}
.polar {
	display: block;
	width: 100%;
	max-width: 232px;
	margin: 0 auto;
}
.polar .grid {
	fill: none;
	stroke: var(--color-rule);
	stroke-width: 1;
}
.polar .tick,
.polar .angle {
	font-family: var(--font-sans);
	font-size: 9px;
	font-variant-numeric: tabular-nums;
	fill: var(--color-ink-faint);
}
.polar .angle {
	text-anchor: middle;
}
.polar .curve {
	fill: rgb(10 10 10 / 5%);
	stroke: var(--color-ink);
	stroke-width: 1.5;
	stroke-linejoin: round;
}
.polar .c90 {
	fill: none;
	stroke: var(--color-ink-dim);
	stroke-dasharray: 4 3;
}
.facts {
	display: grid;
	grid-template-columns: 1fr auto;
	margin: 8px 0 0;
}
.facts dt,
.facts dd {
	padding: 6px 0;
	border-top: 1px solid rgb(10 10 10 / 12%);
}
.facts dt {
	font-size: 12.5px;
	color: var(--color-ink-dim);
}
.facts dd {
	margin: 0;
	text-align: right;
}
.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-top: 14px;
}
.dk-btn svg {
	margin-right: 6px;
}
.error {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--color-warn);
}
.error:empty {
	display: none;
}

/* ---- Lights table: true column heads are the one place for condensed caps --- */
.panel table.lights {
	width: 100%;
	border-collapse: collapse;
}
.panel .lights th {
	padding: 0 8px 6px 0;
	border: none;
	border-bottom: 1px solid var(--color-rule);
	font-size: 10px;
	font-weight: 600;
	font-stretch: 62%;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgb(10 10 10 / 45%);
	text-align: left;
}
.panel .lights td {
	height: 32px;
	padding: 0 8px 0 0;
	border-bottom: 1px solid rgb(10 10 10 / 12%);
	font-size: 12.5px;
	font-weight: 500;
	font-variant-numeric: tabular-nums slashed-zero;
}
.panel .lights th:first-child,
.panel .lights td:first-child {
	padding-left: 8px;
}
.panel .lights .num {
	text-align: right;
}
.panel .lights td.act {
	width: 16px;
	padding-right: 4px;
	text-align: right;
}
.panel .lights tbody tr {
	cursor: pointer;
}
.panel .lights tbody tr:hover td {
	background: rgb(10 10 10 / 3%);
}
.panel .lights tr.selected td {
	background: rgb(43 95 168 / 6%);
}
.panel .lights tr.selected td.name {
	color: var(--color-lead);
	font-weight: 600;
	box-shadow: inset 2px 0 0 var(--color-lead);
}
.dk-x {
	display: inline-grid;
	place-items: center;
	height: 20px;
}

.panel .lights input.dim {
	width: 44px;
	height: 24px;
	padding: 0 4px;
}
/* The false-colour scale bar, as the plan editor draws it (ArchitecturalPlanEditor.css,
   .ce-falsecolor-bar), over the bottom of the view. */
.fc-bar {
	position: absolute;
	left: 50%;
	bottom: 34px;
	transform: translateX(-50%);
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 8px;
	width: min(520px, 70%);
	padding: 7px 12px;
	border: 1px solid var(--color-rule);
	border-radius: var(--radius-md);
	background: rgb(255 255 255 / 93%);
	box-shadow: 0 4px 14px rgb(10 10 10 / 12%);
}
.fc-end {
	flex: none;
	font-family: var(--font-field);
	font-size: 10px;
	color: var(--color-ink-dim);
	white-space: nowrap;
}
.fc-track {
	position: relative;
	flex: 1 1 auto;
	height: 14px;
	border: 1px solid var(--color-rule);
	border-radius: 3px;
}
.fc-dim {
	position: absolute;
	top: 0;
	bottom: 0;
	background: rgb(255 255 255 / 72%);
	pointer-events: none;
}
.fc-handle {
	position: absolute;
	top: -4px;
	bottom: -4px;
	width: 10px;
	margin-left: -5px;
	padding: 0;
	border: 1px solid var(--color-ink);
	border-radius: 2px;
	background: var(--color-paper);
	cursor: ew-resize;
	touch-action: none;
}
.fc-handle:hover {
	border-color: var(--color-lead);
	background: rgb(43 95 168 / 8%);
}
.fc-value {
	position: absolute;
	top: -17px;
	left: 50%;
	transform: translateX(-50%);
	padding: 0 3px;
	border-radius: 2px;
	background: rgb(255 255 255 / 93%);
	font-family: var(--font-field);
	font-size: 9.5px;
	font-weight: 600;
	color: var(--color-ink);
	white-space: nowrap;
	pointer-events: none;
}
.fc-auto {
	flex: none;
	padding: 2px 6px;
	border: 0;
	border-radius: var(--radius-sm);
	background: rgb(10 10 10 / 7%);
	font: 500 11px var(--font-sans);
	cursor: pointer;
}

/* ---- View and controls ---------------------------------------------------- */
.dk-row .dk-slider {
	flex: 1;
	min-width: 0;
}
.dk-row .dk-readout {
	min-width: 36px;
	text-align: right;
}
.keys {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	margin: 0;
	font-size: 12.5px;
}
.keys dt,
.keys dd {
	padding: 5px 0;
}
.keys dt {
	color: var(--color-ink-dim);
}
.keys dd {
	margin: 0;
	text-align: right;
}
kbd {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	margin-left: 3px;
	padding: 0 5px;
	box-sizing: border-box;
	border: 1px solid rgb(10 10 10 / 20%);
	border-radius: 3px;
	background: var(--color-paper);
	font: 500 11px/1 var(--font-sans);
}

/* ---- Drop target ------------------------------------------------------------ */
#drop {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: grid;
	place-items: center;
	background: rgb(255 255 255 / 82%);
}
#drop p {
	margin: 0;
	padding: 28px 40px;
	border: 1.5px dashed rgb(10 10 10 / 45%);
	border-radius: var(--radius-md);
	background: var(--color-paper);
	box-shadow: var(--popover-shadow);
	font-size: 15px;
	font-weight: var(--weight-medium);
}

/* ---- Narrow screens: the panel goes under the view ------------------------------ */
@media (max-width: 860px) {
	body.lab {
		height: auto;
		overflow: auto;
	}
	.workspace {
		grid-template-columns: 1fr;
	}
	.stage {
		height: 62vh;
	}
	.panel {
		border-left: none;
		border-top: 1px solid var(--color-rule);
	}
}
