/* 2026-12-01: the mat designer. The mat under the lamp is the show; the tools around it stay quiet. */
:root { color-scheme: dark; --room: #14251d; --rail: #0d1a14; --wood: #1a2421; --wood-lit: #46564f; --brass: #d2ae5f; --ivory: #f3ebd8; --dim: #b3bfae; --line: #2f4538; --warn: #f2a65a; --bad: #ff9a86; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--room); color: var(--ivory); font: 17px/1.45 'Alegreya Sans', 'Segoe UI', sans-serif; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 22px; background: var(--rail); flex: none; }
.brand { font: 24px/1.2 Marcellus, Georgia, serif; color: var(--brass); text-decoration: none; }
.bar-tools { display: flex; gap: 6px; }
.bar-tools button, .bar-tools a, .acts button, .link button { background: none; border: 1px solid var(--line); border-radius: 4px; padding: 5px 12px; cursor: pointer; }
.bar-tools button:hover:not(:disabled), .bar-tools a:hover, .acts button:hover, .link button:hover { border-color: var(--brass); }
.bar-tools button:disabled { opacity: .4; cursor: default; }

.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; }
.stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 18px 22px 14px;
	background: radial-gradient(ellipse 75% 70% at 50% 42%, var(--wood-lit) 0, var(--wood) 55%, #090e0c 100%); }
.mat { flex: 1; min-height: 0; border-radius: 4px; outline-offset: -2px !important; }
.mat svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; overflow: visible; }
.mat .shadow { filter: drop-shadow(0 1.1px 1.3px rgba(0, 0, 0, .6)); }
.mat [data-layer] { cursor: move; }
.dims { margin: 8px 0 0; text-align: center; color: #dfe5dd; }
.alerts { text-align: center; color: var(--warn); min-height: 1.45em; }
.alerts p { margin: 0; }

.panel { background: var(--room); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; flex: none; background: var(--rail); padding: 0 10px; }
.tabs button { flex: 1 1 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 4px 9px; cursor: pointer; color: var(--dim); }
.tabs button[aria-selected=true] { color: var(--ivory); border-color: var(--brass); }
.pane { flex: 1; min-height: 0; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.pane > * { flex: none; }
.pane h2 { font: 20px/1.2 Marcellus, Georgia, serif; margin: 0; color: var(--brass); }
.pane h2:not(:first-child) { margin-top: 8px; }
.pane label { display: flex; flex-direction: column; gap: 4px; }
.pane .check { flex-direction: row; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--brass); }
input[type=number], input[type=text], select { background: var(--rail); border: 1px solid #51685a; border-radius: 4px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=color] { width: 100%; height: 40px; padding: 3px; background: var(--rail); border: 1px solid #51685a; border-radius: 4px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--brass); height: 28px; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shapes { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shapes legend { padding: 0 0 6px; }
.shapes label { align-items: center; padding: 10px 4px 6px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.shapes input { position: absolute; opacity: 0; }
.shapes svg { width: 56px; fill: none; stroke: currentColor; stroke-width: 2; }
.shapes label:has(:checked) { border-color: var(--brass); color: var(--brass); }
.shapes label:has(:focus-visible) { outline: 2px solid var(--brass); outline-offset: 2px; }
.note { margin: 0; color: var(--dim); }
.err { margin: 0; color: var(--bad); }
.err:empty, .note:empty { display: none; }

.clear { background: none; border: 1px solid var(--brass); color: var(--brass); border-radius: 4px; padding: 8px; cursor: pointer; }
#names-box { display: flex; flex-direction: column; gap: 14px; }
#names { margin: 0; padding: 0 0 0 26px; display: grid; gap: 7px; }
#names li::marker { color: var(--brass); }
#names li { padding-left: 4px; }
#names input { width: calc(50% - 4px); }
#names input + input { margin-left: 8px; }
.check:has(input:disabled) { opacity: .5; }

.looks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.looks button { background: none; border: 1px solid transparent; border-radius: 4px; padding: 4px; cursor: pointer; font-size: 15px; line-height: 1.2; }
.looks button:hover, .looks button[aria-pressed=true] { border-color: var(--brass); }
.looks svg { display: block; width: 100%; margin-bottom: 4px; }

.drop { border: 1px dashed #6d8575; border-radius: 4px; padding: 16px; text-align: center; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--brass); }
.drop:has(:focus-visible) { outline: 2px solid var(--brass); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop span { color: var(--dim); }
.add { background: var(--brass); color: #1d130b; border: 0; border-radius: 4px; padding: 10px; font-weight: 700; cursor: pointer; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list button { width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list button[aria-pressed=true] { border-color: var(--brass); }
.inspect { display: flex; flex-direction: column; gap: 12px; }
.q { margin: 0; color: var(--dim); }
.q.low { color: var(--warn); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }

.total { flex: none; background: var(--rail); padding: 12px 22px; }
.price { font: 30px/1.1 Marcellus, Georgia, serif; color: var(--brass); margin-right: 10px; }
.ship, .saved { color: var(--dim); }
.saved { margin: 6px 0 0; font-size: 15px; }
.saved.bad { color: var(--bad); }
.total .add { width: 100%; margin-top: 8px; }
.add:disabled { opacity: .55; cursor: default; }
.bar-tools a { color: inherit; text-decoration: none; }
.link form { margin-top: 4px; }
.link input[type=email] { background: var(--rail); border: 1px solid #51685a; border-radius: 4px; width: 100%; min-width: 0; }
.link { margin-top: 6px; font-size: 15px; }
.link label { color: var(--dim); }
.link div { display: flex; gap: 6px; }
.link input { padding: 4px 8px; text-overflow: ellipsis; }

@media (max-width: 860px) {
	body { height: 100dvh; }
	.bar { padding: 8px 12px; }
	.brand { font-size: 19px; }
	.bar-tools { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
	.bar-tools button, .bar-tools a { padding: 4px 8px; font-size: 15px; }
	.total .add { margin-top: 4px; padding: 7px; }
	.saved { margin-top: 2px; }
	.work { display: flex; flex-direction: column; }
	.stage { flex: none; height: 36dvh; padding: 8px 10px 4px; }
	.dims, .alerts { font-size: 15px; margin: 0; min-height: 0; }
	.panel { flex: 1; }
	.tabs { padding: 0 2px; }
	.tabs button { padding: 12px 2px 9px; font-size: 16px; }
	.pane { padding: 14px; }
	.total { padding: 8px 14px; }
	.price { font-size: 24px; }
}
@media (max-width: 400px) { #reset { font-size: 0; } #reset::after { content: 'Reset'; font-size: 15px; } }
