:root {
  color-scheme: dark;
  --background: #0b161c;
  --panel: #122229;
  --surface: #192e35;
  --line: #2c434a;
  --text: #eff8f4;
  --muted: #acc1bf;
  --accent: #a9efcf;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 14px system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button, input, select, summary { border-radius: 7px; }
button, select, input { border: 1px solid var(--line); background: var(--surface); padding: 8px 10px; }
button, summary, select { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: #102521; border-color: transparent; font-weight: 700; }
.danger { color: #ffb4a1; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 15px 24px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.brand { display: flex; gap: 11px; align-items: center; }
.mark { display: grid; place-items: center; border: 1px solid #487267; background: #1c3d3c; color: var(--accent); width: 38px; height: 38px; border-radius: 12px; font-size: 22px; }
small, .muted { color: var(--muted); }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; height: calc(100dvh - 72px); min-height: 520px; }
#view { position: relative; min-height: 0; overflow: hidden; background: #8bcad0; }
canvas { display: block; touch-action: none; width: 100%; height: 100%; }
.overlay { position: absolute; z-index: 1; padding: 8px 12px; border: 1px solid #c2ebe655; border-radius: 9px; background: #0b262de8; color: #dff7ef; }
#state { top: 14px; left: 14px; }
#camera { top: 14px; right: 14px; position: absolute; z-index: 1; }
#status { bottom: 14px; left: 14px; max-width: calc(100% - 28px); pointer-events: none; }
aside { overflow: auto; border-left: 1px solid var(--line); background: var(--panel); }
section, details { padding: 15px 16px; border-bottom: 1px solid var(--line); }
h2 { font-size: 15px; margin: 0 0 10px; }
#palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#palette button { padding: 6px 3px; font-size: 12px; }
.glyph { display: block; font-size: 17px; color: var(--accent); line-height: 1.15; }
#objects { display: grid; gap: 4px; max-height: 145px; overflow: auto; }
.object { display: flex; align-items: center; gap: 8px; text-align: left; }
.object[aria-pressed="true"] { border-color: var(--accent); background: #25463f; }
.object span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 8px 0; }
label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
input, select { width: 100%; min-width: 0; }
input[type="color"] { height: 37px; padding: 3px; }
.wide { grid-column: 1 / -1; }
#readout { margin: 10px 0; display: block; }
p { margin: 7px 0; line-height: 1.5; }
summary { font-weight: 650; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  header { padding: 10px 12px; }
  main { display: block; height: auto; }
  #view { height: 54dvh; min-height: 290px; }
  aside { border-left: 0; }
}
