:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070b12;
  color: #e9eef6;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #070b12; }
body { overflow: hidden; }
#app { display: grid; grid-template-columns: minmax(315px, 380px) 1fr; height: 100vh; min-height: 560px; }
#panel { background: #11151d; border-right: 1px solid #2c3441; padding: 16px; overflow-y: auto; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h1 { font-size: 21px; line-height: 1.1; margin: 0 0 5px; }
.title-row p { margin: 0; color: #9ba8b8; font-size: 13px; }
.badge { color: #8bc6ff; border: 1px solid #35577a; background: #132437; border-radius: 999px; font-size: 11px; padding: 4px 7px; }
section { border: 1px solid #313b49; border-radius: 9px; padding: 12px; margin: 12px 0; }
section h2 { margin: -21px 0 11px 4px; width: max-content; background: #11151d; padding: 0 6px; font-size: 13px; font-weight: 650; }
label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 13px; margin: 9px 0; }
output { color: #c9d8ea; font-variant-numeric: tabular-nums; }
input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: #66b3ff; }
button, select, input[type="number"] { background: #1c2430; color: #e9eef6; border: 1px solid #394659; border-radius: 6px; min-height: 36px; padding: 7px 9px; font: inherit; }
button { cursor: pointer; }
button:hover { background: #263244; }
button:active { background: #32425a; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #66b3ff; outline-offset: 2px; }
select { min-width: 0; flex: 1; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.wide { width: 100%; margin-top: 7px; }
.check { display: flex; justify-content: flex-start; gap: 8px; margin: 7px 0; }
.check input { accent-color: #66b3ff; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; }
.form-grid label { display: block; margin: 0; }
.form-grid input { width: 100%; }
.metrics { color: #d5deea; font-size: 13px; line-height: 1.65; font-variant-numeric: tabular-nums; }
.metrics b { color: #fff; font-weight: 650; }
.note { color: #8d9bac; font-size: 12px; line-height: 1.45; margin: 10px 4px 2px; }
#viewportWrap { position: relative; min-width: 0; background: radial-gradient(circle at 50% 45%, #111b2c 0, #070b12 55%, #04070d 100%); }
#viewport { display: block; width: 100%; height: 100%; touch-action: none; }
#hint, #loading { position: absolute; left: 14px; color: #9aa9bb; background: rgba(8, 12, 20, .72); border: 1px solid rgba(72, 90, 113, .5); border-radius: 6px; padding: 6px 8px; font-size: 12px; pointer-events: none; backdrop-filter: blur(4px); }
#hint { bottom: 14px; }
#loading { top: 14px; }
#loading.hidden { display: none; }
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { display: block; height: auto; min-height: 0; }
  #panel { border-right: 0; border-bottom: 1px solid #2c3441; max-height: none; }
  #viewportWrap { height: 68vh; min-height: 420px; }
}
