@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/bricolage.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #eeece4;
  --surface: #faf8ef;
  --light: #fffdf5;
  --ink: #273a36;
  --muted: #51645d;
  --border: #ddd8c9;
  --soft: #edece2;
  --accent: #835638;
  --pitch: #28574c;
  --green: #4b7156;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  font-family: var(--body);
  background: var(--background);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; padding: 0 max(22px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(22px, env(safe-area-inset-left)); }
button, input, select, summary { font: inherit; }
button, summary, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: 0.42; }
a { color: inherit; }
button, a, select, input, summary, canvas { outline-offset: 3px; }
:focus-visible { outline: 2px solid #37685d; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.icon-library, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.site-head, .workspace { width: min(100%, 1580px); margin-inline: auto; }
.site-head { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 1px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark, .loading-mark {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 15px; color: #fff3d9; background: var(--pitch);
  box-shadow: inset 0 1px #ffffff30, 0 3px 8px #63321820;
}
.brand-mark svg, .loading-mark svg { width: 31px; height: 31px; stroke-width: 1.65; }
.brand-name { display: flex; align-items: center; gap: 9px; }
.brand h1 { margin: 0; font: 800 clamp(24px, 3.2vw, 35px)/1 var(--display); letter-spacing: -0.062em; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 550; }
.version { padding: 4px 6px 3px; border: 1px solid #c8d3c7; border-radius: 6px; font-size: 10px; font-weight: 800; color: #586c61; white-space: nowrap; }
.top-tools { display: flex; align-items: center; gap: 7px; }
.portfolio { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 11px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 700; border-radius: 10px; }
.top-divider { width: 1px; height: 22px; background: var(--border); margin: 0 5px; }
.portfolio svg { width: 16px; }
.icon-button { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; color: var(--muted); border: 0; border-radius: 10px; background: transparent; }
.portfolio:hover, .icon-button:hover:not(:disabled) { color: var(--ink); background: var(--soft); }

.workspace {
  --scene-height: clamp(383px, calc(100svh - 235px), 820px);
  --stage-head: 57px;
  --stage-dock: 61px;
  display: grid; grid-template-columns: minmax(0, 1fr) 324px; grid-template-areas: "stage controls" "footer footer";
  align-items: start; gap: 13px;
}
.scene-board, .panel {
  min-width: 0; border: 1px solid var(--border); border-radius: 15px; background: var(--surface);
  box-shadow: 0 3px 12px #6941230a, 0 1px 2px #69412309;
}
.scene-board { grid-area: stage; }
.scene-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 14px; min-height: var(--stage-head); gap: 10px; }
.room-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.room-label svg { color: #668478; }
.camera-modes { display: flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 11px; }
.camera-modes button {
  border: 1px solid transparent; min-height: 34px; padding: 0 11px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750;
}
.camera-modes svg { height: 16px; width: 16px; }
.camera-modes button[aria-pressed="true"] { border-color: var(--border); color: #254d44; background: var(--light); box-shadow: 0 1px 3px #47200e0c; }
.camera-modes button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.scene-status { justify-self: end; display: flex; align-items: center; gap: 7px; background: #edf1e5; color: #45634c; border: 1px solid #dce5d5; border-radius: 24px; padding: 5px 9px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.scene-status i, .launcher-status i { width: 6px; height: 6px; background: #5d8764; border-radius: 50%; }
.scene-status.is-paused { color: #80511d; background: #fff0d1; border-color: #eddbb5; }
.scene-status.is-paused i, .launcher-status.is-busy i { background: #ad7538; }

.viewport {
  position: relative; isolation: isolate; overflow: hidden; height: var(--scene-height);
  background: #cabda9; border-block: 1px solid #bdb6a2;
}
#scene { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#scene:focus-visible { outline-offset: -4px; }
#scene[data-mode="explore"] { cursor: grab; }
#scene[data-dragging="true"] { cursor: grabbing; }
.viewport-top, .viewport-bottom { display: flex; position: absolute; pointer-events: none; left: 13px; right: 13px; align-items: center; }
.viewport-top { top: 12px; justify-content: space-between; }
.viewport-bottom { bottom: 12px; gap: 8px; }
.viewport-top > *, .viewport-bottom > * { pointer-events: auto; }
.ambient, .selected-tag, .hint, .camera-tools, .quick-pitch {
  display: inline-flex; align-items: center; border-radius: 11px; color: #385149; border: 1px solid #3f66532e;
  background: #f8faeef5; box-shadow: 0 2px 8px #663a1b15;
}
.ambient { gap: 4px; min-height: 31px; padding: 0 8px; font-size: 12px; font-weight: 750; }
.ambient svg { width: 15px; height: 15px; color: #647e71; }
.placement-hint { position: absolute; pointer-events: none; left: 50%; top: 50px; transform: translateX(-50%); background: #263d36f0; color: #fff9eb;
  font-size: 12px; font-weight: 750; white-space: nowrap; padding: 7px 10px; border-radius: 7px; z-index: 3; }
.selected-tag { padding: 0 3px 0 11px; font-size: 12px; font-weight: 750; }
.selected-tag .icon-button, .hint .icon-button { min-width: 35px; min-height: 36px; }
.hint { padding-left: 10px; gap: 7px; min-height: 37px; font-size: 11.5px; font-weight: 650; }
.hint > svg { width: 15px; height: 15px; color: #5a7668; }
.hint-divider { color: #637a6d; padding: 0 3px; }
kbd { font: 700 10px/1 var(--body); border: 1px solid #8a5e493b; border-radius: 4px; background: #fff9ef90; padding: 3px 5px; white-space: nowrap; vertical-align: 0.06em; }
.hint .icon-button svg, .selected-tag .icon-button svg { width: 14px; height: 14px; }
.camera-tools { padding: 2px; gap: 1px; margin-inline-start: auto; }
.camera-tools .icon-button { width: 38px; min-width: 38px; min-height: 36px; }
.camera-tools svg { width: 18px; height: 18px; }
.quick-pitch { display: none; min-height: 43px; padding: 0 12px; gap: 4px; background: var(--pitch); color: #fffaef; border-color: #2b574e; font-weight: 800; }
.quick-pitch svg { width: 17px; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 22px; text-align: center; z-index: 4; background: #e7ebe1; }
.loading p { font-weight: 700; }
.fallback-link { color: var(--accent); font-size: 13px; font-weight: 800; }

.dock { min-height: var(--stage-dock); display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 8px 12px; }
.dock-group { display: flex; gap: 3px; align-items: center; min-width: 0; }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent;
  border-radius: 9px; background: transparent; min-height: 39px; padding: 0 8px; color: #4f645a;
  white-space: nowrap; font-size: 12px; font-weight: 750; text-decoration: none;
}
.tool:hover:not(:disabled), .tool-menu[open] summary { background: var(--soft); border-color: var(--border); color: var(--ink); }
.tool svg { width: 17px; height: 17px; }
.tool.icon-button { min-width: 36px; padding: 0; }
.playback-tools { gap: 6px; }
.playback-tools button, .speed select { background: var(--light); border: 1px solid var(--border); }
.playback-tools .pause { min-width: 70px; }
.speed select { min-height: 39px; max-width: 72px; font-size: 12px; font-weight: 750; color: var(--ink); border-radius: 9px; padding: 0 4px 0 8px; }
.tool-menu { position: relative; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; z-index: 8; inset-inline-start: 0; bottom: calc(100% + 9px); display: grid; padding: 6px;
  min-width: max-content; background: var(--light); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px #40241828; color: var(--ink);
}
.menu-panel label { color: var(--muted); font-size: 12px; font-weight: 750; padding: 5px 7px; }
.menu-panel select { max-width: 195px; min-height: 38px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); padding: 4px 7px; color: var(--ink); }
.menu-panel button { width: 100%; min-height: 37px; text-align: start; font-size: 12px; font-weight: 650; padding: 6px 9px; border: 0; border-radius: 6px; background: transparent; }
.menu-panel button:hover { background: var(--soft); }
.menu-panel .reset-action { color: var(--accent); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.object-nudges { margin-block: 4px; display: flex; justify-content: center; }
.object-nudges button { display: grid; place-items: center; }
.arrow-left { rotate: -90deg; }
.arrow-down { rotate: 180deg; }
.arrow-right { rotate: 90deg; }

.control-stack { display: grid; grid-area: controls; gap: 8px; min-width: 0; }
.workspace-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.workspace-nav button { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; font-weight: 750; color: var(--muted); }
.workspace-nav button:hover { color: var(--ink); background: var(--soft); }
.workspace-nav svg { width: 15px; height: 15px; }
.control-scroll { display: grid; align-content: start; gap: 8px; padding: 1px; }
.control-scroll > .panel { scroll-margin: 2px; }
#pitch-panel { padding-bottom: 13px; }
@media (min-width: 901px) {
  .scene-board { position: sticky; top: 7px; }
  .control-stack { grid-template-rows: auto minmax(0, 1fr) auto; height: calc(var(--scene-height) + var(--stage-head) + var(--stage-dock) + 2px); }
  .control-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #9a9b8c transparent; padding-inline-end: 4px; }
}
@media (min-width: 901px) and (pointer: fine) {
  .control-stack .flavours { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .control-stack .swatch { min-height: 36px; }
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 11px; }
.panel-icon { width: 33px; height: 33px; display: grid; place-items: center; color: #3d695b; background: #e1e9db; border-radius: 10px; flex: none; }
.panel-icon svg { width: 18px; height: 18px; }
.panel h2 { font: 800 21px/1.05 var(--display); letter-spacing: -0.038em; margin: 0; }
.collapse { margin-inline-start: auto; min-width: 32px; min-height: 34px; }
.collapse[aria-expanded="true"] svg { rotate: 180deg; }
.pitch-settings { margin-inline: 16px; display: grid; gap: 15px; }
.control-section { min-width: 0; }
.control-section + .control-section { border-top: 1px solid var(--border); padding-top: 13px; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 5px; margin-bottom: 9px; min-height: 20px; }
.label-row > h3, .label-row > label:not(.preview-switch) { margin: 0; font-size: 12px; font-weight: 800; color: #416058; }
output { color: var(--accent); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.flavours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.swatch {
  position: relative; min-width: 0; min-height: 42px; padding: 0; border-radius: 10px; border: 1px solid #60412b28;
  box-shadow: inset 0 1px #ffffff7a, inset 0 -2px #64421c16; background-color: var(--swatch);
  background-image: radial-gradient(ellipse at 27% 22%, #fff7e585, #fff7e500 43%), linear-gradient(132deg, #fff8e21f, #66381519);
}
.swatch[data-specks="true"] { background-image: radial-gradient(circle at 25% 32%, var(--speck) 0 1.4px, transparent 2.45px), radial-gradient(circle at 69% 67%, var(--speck) 0 1.6px, transparent 2.6px), radial-gradient(circle at 45% 83%, var(--speck) 0 0.8px, transparent 2px), radial-gradient(ellipse at 27% 22%, #fff9ea75, transparent 50%); }
.swatch:hover { box-shadow: inset 0 0 0 2px #fff8e8d9; }
.swatch[aria-pressed="true"] { border-color: #3b5c50; box-shadow: inset 0 0 0 2px #fff9e7, 0 0 0 1px #3b5c50; }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; top: 46%; width: 5px; height: 10px; transform: translate(-50%, -50%) rotate(42deg); border-right: 2px solid #fff8e8; border-bottom: 2px solid #fff8e8; filter: drop-shadow(0 1px 1px #311b13) drop-shadow(0 0 1px #311b13); }
.sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 7px; }
.sizes button { min-width: 0; min-height: 32px; padding: 0 2px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: var(--light); font-size: 11px; font-weight: 750; }
.sizes button[aria-pressed="true"] { border-color: #91a799; color: #2c594d; background: #dae6d8; }
.sizes button:hover { border-color: #7b9987; }
input[type="range"] {
  width: 100%; margin: 0; min-height: 24px; background: transparent; display: block;
  appearance: none; -webkit-appearance: none; cursor: pointer; touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 9px; background: linear-gradient(to right, #7b9a87 var(--fill, 50%), #dfe5d7 var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 9px; background: linear-gradient(to right, #7b9a87 var(--fill, 50%), #dfe5d7 var(--fill, 50%)); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border-radius: 50%;
  background: #396a5e; border: 2px solid #f8f8f0; box-shadow: 0 0 0 1px #396a5e;
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #396a5e; border: 2px solid #f8f8f0; box-shadow: 0 0 0 1px #396a5e; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; line-height: 1; }
.aim .label-row { margin-bottom: 8px; }
.preview-switch { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; font-size: 11px; font-weight: 750; color: var(--muted); cursor: pointer; }
.preview-switch input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.slider { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label value" "range range"; align-items: center; }
.slider label { grid-area: label; font-size: 12px; color: var(--ink); font-weight: 650; }
.slider output { grid-area: value; }
.slider input { grid-area: range; }
.slider + .slider { margin-top: 4px; }
.pitch-footer { padding: 10px 11px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 3px 10px #55351d12; }
.launcher-status { display: flex; align-items: center; justify-content: space-between; color: var(--muted); margin-bottom: 7px; font-size: 11px; font-weight: 750; }
.launcher-status > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.pitch-button {
  width: 100%; min-height: 52px; padding: 0 12px 0 13px; background: var(--pitch); color: #fffaf0;
  display: flex; align-items: center; justify-content: space-between; border: 1px solid #2c574f; border-radius: 12px;
  box-shadow: inset 0 1px #ffffff43, 0 3px 5px #8c3d2128;
  font: 800 17px/1.1 var(--display); letter-spacing: -0.02em;
}
.pitch-button:hover:not(:disabled), .quick-pitch:hover:not(:disabled) { background: #2b5149; }
.pitch-button:active:not(:disabled), .quick-pitch:active:not(:disabled) { transform: translateY(1px); }
.pitch-button span { display: flex; align-items: center; gap: 8px; }
.pitch-button kbd { background: #762e1b45; border-color: #fff5df4f; color: #fffaf0; }
.inspector summary { display: flex; align-items: center; min-height: 51px; padding: 6px 14px; gap: 8px; font-size: 13px; font-weight: 750; }
.inspector .panel-icon { width: 30px; height: 30px; }
.inspector-chevron { margin-inline-start: auto; color: var(--muted); }
.inspector[open] .inspector-chevron { rotate: 180deg; }
.inspector p, .inspector dl { margin: 0; padding: 4px 15px 13px; color: var(--muted); font-size: 12px; }
.inspector dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; padding: 4px 0; border-bottom: 1px solid var(--soft); }
.inspector dd { margin: 0; font-weight: 750; color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; }
.workspace-footer { grid-area: footer; display: flex; justify-content: space-between; gap: 10px; padding: 0 2px 15px; color: var(--muted); font-size: 11px; font-weight: 650; }

.toast {
  position: fixed; z-index: 20; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 10px 13px; color: #fff9ed; background: #27413a; border-radius: 9px;
  box-shadow: 0 4px 16px #35221b22; font-size: 12px; font-weight: 700; pointer-events: none;
}
.toast:empty { padding: 0; box-shadow: none; }
dialog { width: min(435px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 17px; color: var(--ink); background: var(--light); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 16px 85px #4c251750; }
dialog::backdrop { background: #35221980; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font: 800 24px/1.1 var(--display); letter-spacing: -0.04em; }
.help-list { margin: 10px 0 0; }
.help-list div { padding: 9px 0; border-top: 1px solid var(--border); }
.help-list dt { font-weight: 800; font-size: 13px; }
.help-list dd { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.no-script { position: fixed; z-index: 15; top: 45%; left: 5%; right: 5%; text-align: center; background: var(--surface); color: var(--ink); padding: 16px; border-radius: 12px; }

@media (min-width: 1350px) {
  body { padding-inline: max(28px, env(safe-area-inset-left)) max(28px, env(safe-area-inset-right)); }
  .workspace { grid-template-columns: minmax(0, 1fr) 329px; }
}
@media (min-width: 901px) and (max-width: 1090px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 292px; gap: 11px; }
  .dock { padding-inline: 6px; }
  .tool { gap: 3px; padding-inline: 4px; }
}
@media (max-width: 900px) {
  body { padding-inline: max(13px, env(safe-area-inset-left)) max(13px, env(safe-area-inset-right)); }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "controls" "footer"; gap: 12px; }
  .site-head { min-height: 75px; padding-block: 11px; }
  .viewport { height: clamp(330px, 49svh, 580px); }
  .quick-pitch { display: inline-flex; }
  .pitch-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .control-section:nth-child(2) { border-top: 0; padding-top: 0; }
  .aim { grid-column: 1 / -1; }
  .pitch-footer { position: sticky; z-index: 7; bottom: max(5px, env(safe-area-inset-bottom)); }
}
@media (max-width: 540px) {
  body { padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right)); }
  .site-head { min-height: 71px; padding-inline: 3px; gap: 4px; }
  .brand { gap: 7px; min-width: 0; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand h1 { font-size: clamp(19px, 5.25vw, 28px); }
  .brand-name { gap: 4px; }
  .brand p { font-size: 9px; }
  .version { padding: 3px; font-size: 8px; }
  .top-tools { gap: 0; }
  .top-divider, .portfolio span { display: none; }
  .portfolio { width: 36px; padding: 0; }
  .top-tools .icon-button { min-width: 36px; min-height: 44px; }
  .scene-header { padding-inline: 7px; grid-template-columns: auto 1fr auto; gap: 4px; }
  .room-label span { display: none; }
  .room-label { padding-inline-start: 4px; }
  .camera-modes { justify-self: center; }
  .camera-modes button { padding-inline: 7px; min-height: 38px; }
  .viewport { height: clamp(295px, 48svh, 438px); }
  .viewport-top, .viewport-bottom { left: 7px; right: 7px; }
  .viewport-bottom { bottom: 7px; gap: 5px; }
  .hint { position: absolute; bottom: 51px; left: 0; max-width: calc(100% - 4px); padding-left: 6px; gap: 4px; }
  .dock { flex-wrap: wrap; min-height: 58px; justify-content: center; padding: 6px 5px; gap: 3px 8px; }
  .tool { min-height: 43px; padding-inline: 6px; }
  .tool-menu .menu-panel { inset-inline-start: auto; inset-inline-end: 0; }
  .history-tools .tool-menu .menu-panel { inset-inline-start: 0; inset-inline-end: auto; }
  .pitch-settings { grid-template-columns: minmax(0, 1fr); }
  .control-section:nth-child(2) { border-top: 1px solid var(--border); padding-top: 13px; }
  .sizes button { min-height: 40px; }
  .swatch { min-height: 46px; }
}
@media (max-width: 375px) {
  .top-tools .icon-button, .portfolio { min-width: 31px; width: 31px; }
  .site-head { padding-inline: 0; }
  .tool svg { width: 15px; }
  .tool { font-size: 11px; }
}
@media (pointer: coarse) {
  .tool, .icon-button, .speed select { min-height: 44px; }
  .swatch { min-height: 44px; }
  .hint .icon-button, .selected-tag .icon-button, .camera-tools .icon-button { min-height: 42px; }
  input[type="range"] { min-height: 31px; }
  .pitch-button kbd { display: none; }
  .quick-pitch { display: inline-flex; }
  .camera-modes button { min-height: 39px; }
  .workspace-nav button { min-height: 44px; }
}


@media (min-width: 901px) and (max-height: 800px) {
  .site-head { min-height: 73px; padding-block: 10px; }
  .pitch-settings { gap: 11px; }
  .panel-head { padding-block: 10px 8px; }
  .control-section + .control-section { padding-top: 9px; }
  .pitch-footer { padding-block: 8px 11px; }
  .inspector summary { min-height: 45px; }
}

#aim-reticle {
  position: absolute; width: 26px; height: 26px; border: 1px solid #fff8dc;
  border-radius: 100%; transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 2px 1px #223b33a8, inset 0 0 2px 1px #223b33a8;
}
#aim-reticle::before, #aim-reticle::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff8dc; transform: translate(-50%,-50%); }
#aim-reticle::before { width: 8px; height: 1px; }
#aim-reticle::after { width: 1px; height: 8px; }
.camera-tools .icon-button[aria-pressed="true"] { background: #d9e6d6; color: #28574b; }
.scene-counts { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.scene-counts #scene-mass { padding-inline-end: 12px; border-inline-end: 1px solid var(--border); }
.graphics-setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 650; border-top: 1px solid var(--border); padding-top: 12px; }
.graphics-setting select { min-height: 36px; background: var(--light); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); padding: 0 7px; }
#history-trimmed { color: var(--muted); font-size: 12px; }
#scene[data-mode="pitcher"][data-dragging="true"] { cursor: all-scroll; }

.room-label select {
  min-width: 0; max-width: min(100%, 180px); min-height: 36px; border: 0;
  background: transparent; color: var(--ink); font-size: 12px; font-weight: 750;
  text-overflow: ellipsis; cursor: pointer;
}
.assist-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; margin: 8px 0 10px; background: var(--soft); border-radius: 9px; }
.assist-modes button { min-height: 34px; border: 1px solid transparent; border-radius: 7px; padding: 0 5px; font-size: 12px; font-weight: 750; background: transparent; color: var(--muted); }
.assist-modes button[aria-pressed="true"] { background: var(--light); color: #284d44; border-color: var(--border); box-shadow: 0 1px 2px #233a2d16; }
.instrument-row, .mass-controls { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.instrument-row :is(button, select), .mass-controls select, .lab-options select, #lab-data button {
  min-height: 34px; border: 1px solid var(--border); border-radius: 7px; padding: 0 8px;
  color: var(--ink); background: var(--light); font-size: 12px; font-weight: 670; max-width: 100%;
}
.instrument-row button:hover:not(:disabled), #lab-data button:hover { background: var(--soft); }
.instrument-row button[aria-pressed="true"] { background: #d5e5dc; border-color: #8aab9e; }
.mass-controls { justify-content: space-between; color: var(--muted); font-size: 12px; }
.mass-controls :is(select, input) { min-height: 30px; }
.mass-controls input, .mount-coordinates input {
  width: 66px; border: 1px solid var(--border); border-radius: 7px; padding: 3px 5px;
  color: var(--ink); background: var(--light); font-size: 12px; font-variant-numeric: tabular-nums;
}
.precision-tools {
  border: 1px solid #d1ded0; border-radius: 8px; padding: 8px;
  background: #edf2e9; margin-bottom: 10px;
}
.precision-tools select { flex: 1; min-width: 90px; }
.precision-tools p, .lab-readout {
  font-size: 12px; color: #37564d; line-height: 1.43; font-weight: 680; margin: 7px 1px;
}
.flight-hud, .world-label {
  position: absolute; pointer-events: none; z-index: 1; letter-spacing: 0.005em;
  border: 1px solid #d9ddd0; border-radius: 7px; background: #fcfaf0f2; color: #3e574f;
  font: 750 11px/1.2 var(--body);
}
.flight-hud { top: 14px; left: 90px; padding: 6px 8px; max-width: calc(100% - 160px); }
.world-label { transform: translate(-50%, -50%); padding: 4px 7px; white-space: nowrap; }
.instrument-body { margin: 0; padding: 0 14px 14px; display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.mount-height { display: flex; align-items: center; justify-content: space-between; padding-top: 3px; font-weight: 750; }
.mount-height output { font-variant-numeric: tabular-nums; color: var(--accent); }
.mount-coordinates { gap: 5px; }
.mount-coordinates label { display: flex; align-items: center; gap: 3px; }
.mount-coordinates input { min-height: 31px; width: 61px; }
.lab-options { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.lab-options label { display: flex; align-items: center; gap: 4px; font-weight: 680; }
.lab-options input { accent-color: var(--pitch); }
.inspector-details { margin: 0 14px; border-top: 1px solid var(--border); }
.inspector .inspector-details summary, .inspector .lab-experiment summary, .inspector .lab-notes summary {
  min-height: 35px; padding: 3px 0; display: list-item; list-style-position: inside; color: var(--ink);
}
.inspector .inspector-details dl { padding-inline: 0; }
.lab-experiment { border-top: 1px solid var(--border); }
.launch-model { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; font-size: 12px; font-weight: 750; }
.launch-model select, .precise-fields input, #launch-exact input, .power-presets button {
  color: var(--ink); background: var(--light); border: 1px solid var(--border); border-radius: 7px; min-height: 32px; padding: 3px 7px;
}
.precise-fields { margin-top: 7px; }
.precise-fields summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.precise-fields .instrument-row { flex-wrap: nowrap; margin-top: 7px; }
.precise-fields label { flex: 1; min-width: 0; font-size: 10px; }
.precise-fields input { display: block; width: 100%; }
#launch-exact { margin-top: 6px; }
#launch-exact input { width: 86px; }
.power-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.power-presets button { font-size: 11px; font-weight: 750; cursor: pointer; }
.power-presets button[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); }
.launch-quantity-note { display: block; color: var(--muted); font-size: 10px; margin: -2px 0 6px; font-variant-numeric: tabular-nums; }
.model-results { overflow-x: auto; }
.model-results table { width: 100%; font-size: 11px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.model-results caption { text-align: left; color: var(--muted); margin: 4px 0; }
.model-results :is(th, td) { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--border); }
.instrument-body h3 { margin: 0; font-size: 13px; color: var(--ink); }
.inspector .build-hint { padding: 0 0 5px; font-size: 11px; }
.instrument-row button svg { width: 13px; height: 13px; margin-inline-end: 3px; vertical-align: -0.15em; }
.mount-coordinates { gap: 6px; align-items: end; }
.mount-coordinates label { font-size: 11px; color: var(--muted); }
.mount-coordinates label input { display: block; min-height: 32px; }
#placement-fields { display: grid; gap: 8px; padding-block-start: 9px; border-top: 1px solid var(--border); }
.build-apply { justify-self: start; min-height: 35px; padding: 0 8px; background: var(--light); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; font-weight: 750; }
@media (pointer: coarse) {
  .launch-model select, .precise-fields input, #launch-exact input, .power-presets button { min-height: 44px; }
  .mount-coordinates label input, .build-apply { min-height: 44px; }
}
.lab-experiment-body { display: grid; gap: 5px; }
.inspector .lab-experiment p { padding: 2px 0 4px; }
#lab-data label { justify-content: space-between; }
#lab-chart { width: 100%; height: auto; background: var(--light); border: 1px solid var(--border); border-radius: 7px; margin: 4px 0; display: block; }
#scene:is([data-pick="target"], [data-pick="measure"], [data-pick="mount"]) { cursor: crosshair; }
#sandbox[data-assistance="precision"] .quick-pitch { display: inline-flex; }

@media (pointer: coarse) {
  .room-label select, .assist-modes button, .instrument-row :is(button, select), .lab-options select,
  .mass-controls :is(select, input), #lab-data button { min-height: 44px; }
}
@media (max-width: 540px) {
  .scene-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-block: 4px; }
  .scene-header .camera-modes { grid-column: 1 / -1; grid-row: 2; }
  .scene-header .scene-status { grid-column: 2; grid-row: 1; }
  .room-label { min-width: 0; }
  .room-label select { max-width: 100%; }
  .flight-hud { top: 9px; left: 77px; max-width: calc(100% - 126px); }
}
@media (max-width: 540px) {
  .camera-tools .icon-button { width: 34px; min-width: 34px; }
  .scene-counts { gap: 5px; }
  .scene-counts #scene-mass { padding-inline-end: 5px; }
}
