:root {
  color-scheme: light;
  --ink: #1a3037;
  --muted: #4d656b;
  --accent: #076c62;
  --line: #cbdedd;
  font: 15px/1.45 Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #edf5f4; color: var(--ink); display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
html:fullscreen { background: #edf5f4; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(20px, 3vw, 28px); line-height: 1.13; }
h2 { font-size: 17px; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, select, input[type=number] { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 40px; padding: 6px 9px; }
button, select { cursor: pointer; }
button:hover { background: #edf6f4; }
button:disabled { opacity: .5; cursor: default; }
button[aria-pressed=true], .primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button[aria-pressed=true]:hover, .primary:hover { background: #095950; }
:focus-visible { outline: 3px solid #b65b13; outline-offset: 2px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; background: #fff; border-bottom: 1px solid var(--line); padding: 11px clamp(12px, 2vw, 26px); }
.brand { text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--accent); margin-bottom: 3px; }
.toolbar nav, .transport, .sequence-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar nav button, .transport button, .sequence-switch button { font-size: 13px; }
.workspace { display: grid; grid-template-columns: minmax(204px, .85fr) minmax(300px, 2.05fr) minmax(248px, 1.05fr); grid-template-areas: "joints stage sequence"; grid-template-rows: minmax(450px, 1fr); align-items: stretch; gap: 11px; min-height: 0; overflow: auto; padding: 12px; }
.stage, .panel { min-width: 0; border-radius: 13px; }
.panel { background: #fff; border: 1px solid var(--line); padding: 13px; overflow: auto; }
.stage { grid-area: stage; display: flex; flex-direction: column; padding: 13px; color: #eaf8f7; background: #10252c; }
.stage-header, .stage-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; }
.stage-header span { font-size: 12px; border: 1px solid #56777b; padding: 4px 8px; border-radius: 6px; }
.views { display: flex; flex-wrap: wrap; gap: 5px; }
.views button { color: var(--ink); min-height: 36px; padding: 4px 8px; font-size: 13px; }
.views button[aria-pressed=true] { color: #fff; }
.scene { min-height: 210px; flex: 1; display: grid; place-items: center; padding: 4px 0; }
.scene svg { display: block; width: 100%; height: 100%; min-width: 0; max-height: 570px; }
.grid-line { stroke: #65868d; stroke-width: 1; opacity: .25; }
.pad-label { font: 700 13px Arial, sans-serif; letter-spacing: 1px; }
.stage-footer button { color: var(--ink); font-size: 13px; }
.coordinate-panel { min-width: 0; }
#view-axes { color: #c6dddd; font-size: 11px; margin-bottom: 4px; }
.readouts { display: grid; grid-template-columns: 92px 1fr; gap: 3px 6px; font: 12px/1.5 monospace; color: #c6dddd; }
.readouts b { color: #f3fffe; }
.joint-panel { grid-area: joints; }
.joint { margin-top: 10px; }
.joint-head { display: flex; align-items: center; gap: 5px; }
.joint-head label { font-weight: 700; }
.joint-head input { min-height: 37px; width: 68px; min-width: 0; margin-left: auto; padding: 4px; }
.joint-head span { font-size: 12px; color: var(--muted); }
.joint input[type=range] { display: block; width: 100%; height: 30px; margin: 0; accent-color: var(--accent); }
.save-pose { margin-top: 10px; }
#save-status, #sequence-status { min-height: 1.45em; font-size: 12px; color: var(--muted); margin-top: 3px; }
details { font-size: 13px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 7px; }
summary { cursor: pointer; }
details p { margin-top: 5px; }
.sequence-panel { grid-area: sequence; }
.sequence-switch { margin-top: 8px; }
#sequence-intro { color: var(--muted); font-size: 13px; margin: 8px 0; }
.speed-control { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.speed-control select { min-height: 33px; }
#challenge-controls { display: grid; gap: 5px; margin: 7px 0 10px; font-size: 13px; }
#challenge-controls label { font-weight: 700; }
#poses { list-style: none; padding: 0; margin: 5px 0 8px; display: grid; gap: 4px; }
#poses li { display: flex; align-items: center; gap: 3px; border-radius: 6px; }
#poses li.active { background: #d9f0eb; }
#poses li button:first-child { flex: 1; min-width: 0; text-align: left; padding-left: 7px; }
#poses li button { font-size: 12px; min-height: 34px; padding-inline: 5px; }
#challenge { background: #edf5f3; border-radius: 7px; padding: 7px 8px; font-size: 13px; margin-top: 8px; }
#challenge.complete { background: #dcf4e5; color: #185439; }
.shop { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 11px; font-size: 12px; margin-top: 9px; }
body.teaching .workspace { font-size: 17px; }
.teaching h2 { font-size: 19px; }
.teaching #sequence-intro, .teaching #challenge, .teaching #poses li button, .teaching .readouts { font-size: 15px; }
.teaching .shop { display: none; }
@media (max-width: 950px) {
  .workspace { grid-template-areas: "stage stage" "joints sequence"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; }
  .stage { min-height: 365px; }
  .scene svg { height: auto; max-height: 400px; }
  .panel { overflow: visible; }
}
@media (max-width: 560px) {
  .toolbar { padding: 8px; }
  .toolbar nav button { min-height: 35px; font-size: 12px; }
  .workspace { display: block; padding: 7px; }
  .stage, .panel { margin-bottom: 7px; padding: 9px; }
  .stage { min-height: 0; }
  .scene { min-height: 0; }
  .joint input[type=range] { height: 36px; }
}
@media (max-width: 560px) and (min-height: 460px) {
  .workspace { scroll-padding-top: min(300px, 47vh); }
  .stage { position: sticky; top: 0; z-index: 2; }
  .scene svg { max-height: min(165px, 24vh); }
  .stage-header { gap: 4px; }
  .stage-footer button { min-height: 35px; }
}
