@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #0e141a; --panel: #151d26; --line: #26323f; --ctl: #1d2833; --ctl-hover: #263443;
  --text: #dde6ee; --muted: #8b9aaa; --accent: #37b3a4; --accent-ink: #06211e;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; background: var(--bg); color: var(--text); font: 400 13px/1.45 "Inter", system-ui, sans-serif; }

#panel { width: 330px; flex: none; height: 100%; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 16px 18px; }
#panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 8px; }
section, details { padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
summary { cursor: pointer; list-style-position: outside; margin-left: 14px; }
summary h2 { display: inline-block; margin-bottom: 4px; }
footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }

button { font: inherit; font-weight: 500; color: var(--text); background: var(--ctl); border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px; cursor: pointer; transition: background .12s, border-color .12s; }
button:hover { background: var(--ctl-hover); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.seg { display: flex; }
.seg button { flex: 1; border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.seg button:last-child { border-radius: 0 7px 7px 0; }
.seg.small button { padding: 4px 8px; font-size: 11.5px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border-radius: 999px; padding: 6px 12px; }
.chip::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--dot, var(--muted)); opacity: .45; }
.chip.on::before { opacity: 1; background: var(--accent-ink); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.grid3 button, .grid4 button { padding: 7px 4px; font-size: 12px; }
.grid4 button { color: var(--muted); font-size: 11.5px; }

.slider { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 12px; }
.slider b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 6px 0 0; accent-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; margin: 10px 0 6px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
#planeControls.disabled { opacity: .4; pointer-events: none; }
#viewSection.disabled .grid3, #viewSection.disabled .grid4 { opacity: .4; pointer-events: none; }

#poseSliders h3 { font-size: 12px; font-weight: 600; margin: 12px 0 0; }
#poseSliders .slider { margin: 6px 0 2px; display: grid; grid-template-columns: 96px 1fr 38px; align-items: center; gap: 8px; }
#poseSliders .slider input { margin: 0; }
#poseSliders .slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

#selection { min-height: 38px; }
#selection strong { display: block; font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }

#stage { position: relative; flex: 1; min-width: 0; height: 100%; }
#view { display: block; width: 100%; height: 100%; touch-action: none; }
#tip { position: absolute; pointer-events: none; z-index: 5; background: rgba(10, 15, 20, .92); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-weight: 500; white-space: nowrap; transform: translate(14px, 14px); }
#tip small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
#orient span { position: absolute; color: #f3d36b; font-weight: 600; font-size: 15px; }
#orient .oL { left: 14px; top: 50%; } #orient .oR { right: 14px; top: 50%; }
#orient .oT { top: 12px; left: 50%; } #orient .oB { bottom: 12px; left: 50%; }
#orient em { position: absolute; left: 14px; bottom: 12px; font-style: normal; color: var(--muted); font-size: 11.5px; }

@media (max-width: 760px) {
  body { flex-direction: column-reverse; }
  #panel { width: 100%; height: 45%; border-right: 0; border-top: 1px solid var(--line); }
  #stage { height: 55%; flex: none; }
}
#presets .chip::before { display: none; }

#loading { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: rgba(10, 15, 20, .92); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-weight: 500; }
#credit { position: absolute; right: 12px; bottom: 10px; background: rgba(10, 15, 20, .7); border-color: transparent; color: var(--muted); font-size: 11.5px; font-weight: 400; padding: 5px 10px; max-width: 60%; text-align: right; }
#credit:hover { color: var(--text); border-color: var(--line); }
#credit u { text-underline-offset: 2px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(720px, 92vw); max-height: 86vh; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
#licBody { padding: 20px 24px 4px; overflow-y: auto; max-height: calc(86vh - 64px); }
#licBody h3 { font-size: 15px; margin: 0 0 10px; }
#licBody h3:not(:first-child) { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
#licBody dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 0; }
#licBody dt { color: var(--muted); } #licBody dd { margin: 0; overflow-wrap: anywhere; }
#licBody ul { margin: 0; padding-left: 18px; }
#licBody a { color: var(--accent); }
#licBody pre { white-space: pre-wrap; font: 11.5px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 240px; overflow: auto; }
dialog form { padding: 12px 24px 18px; text-align: right; }
dialog form button { padding: 7px 18px; }

h1 small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; color: var(--muted); font-size: 12px; }
input[type=color] { width: 44px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--ctl); cursor: pointer; }
select { font: inherit; color: var(--text); background: var(--ctl); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
button.wide { width: 100%; margin-top: 6px; }
#stage.transparent { background: repeating-conic-gradient(#2a333d 0% 25%, #1c242c 0% 50%) 0 0 / 22px 22px; }
#bgColor:disabled { opacity: .35; }
