:root {
  color-scheme: dark;
  --bg: #08131b;
  --panel: #0d202b;
  --line: #284650;
  --ink: #eaf3f3;
  --muted: #aec4cb;
  --cyan: #8ce6d4;
  --orange: #ffad8c;
  font-family: Arial,Helvetica,sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

button:disabled,input:disabled,select:disabled {
  cursor: default;
  opacity: .55;
}

button {
  min-height: 44px;
  border: 1px solid #4b7981;
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
}

button:hover:not(:disabled) {
  background: #23434d;
  border-color: var(--cyan);
}

.skip {
  position: fixed;
  left: 12px;
  top: -90px;
  background: var(--cyan);
  color: var(--bg);
  z-index: 20;
  padding: 12px;
}

.skip:focus {
  top: 12px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 32px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-size: 14px;
}

.wordmark>span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #739ba5;
  font: 11px ui-monospace,monospace;
}

.wordmark strong {
  font-weight: 600;
}

.back {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.back span {
  color: var(--cyan);
  margin-left: 16px;
}

.titlebar {
  padding: 24px 32px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  font: 11px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--cyan);
  margin: 0 0 12px;
}

h1,h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -.045em;
}

h1 {
  font-size: clamp(28px,3vw,42px);
  font-weight: 500;
}

.vehicle {
  font-size: 18px;
  text-align: right;
  margin: 0;
}

.vehicle span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0,1fr) 330px;
  border-block: 1px solid var(--line);
}

.viewer {
  min-width: 0;
}

.scene {
  position: relative;
  height: clamp(520px,calc(100svh - 270px),850px);
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.poster {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  inset: 0;
}

.scene[data-ready=true]>.poster {
  visibility: hidden;
}

.scene canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline-offset: -5px;
}

.scene-heading,.scene-bottom {
  position: absolute;
  left: 28px;
  right: 28px;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.scene-heading {
  top: 22px;
  color: var(--muted);
  font: 11px ui-monospace,monospace;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.scene-heading span:first-child {
  color: var(--cyan);
}

.mode-tools {
  position: absolute;
  left: 24px;
  top: 65px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.mode-tools button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0b1b24e8;
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.mode-tools button>span {
  color: var(--cyan);
  font-size: 20px;
  line-height: 1;
}

.mode-tools button[aria-pressed=true] {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

.mode-tools button[aria-pressed=true]>span {
  color: var(--bg);
}

.scene-bottom {
  bottom: 20px;
  align-items: end;
}

.scene-bottom>p {
  font-size: 12px;
  margin: 0;
  max-width: 300px;
  color: var(--muted);
  background: #08131bcc;
  padding: 4px;
}

.views {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.views button {
  font-size: 11px;
  padding: 6px 11px;
  background: #0b1b24e8;
}

.load-status {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  padding: 14px 22px;
  border: 1px solid var(--line);
  background: #08131bee;
  text-align: center;
  max-width: 85%;
  font-size: 14px;
}

.load-status[hidden] {
  display: none;
}

.no-script {
  position: absolute;
  bottom: 80px;
  left: 24px;
  right: 24px;
  background: #08131bee;
  padding: 14px;
  z-index: 5;
}

.separation {
  border-top: 1px solid var(--line);
  padding: 18px 28px 14px;
  background: linear-gradient(90deg,#8ce6d405 1px,transparent 1px) 0 0/36px 100%;
}

.separation label,.edit-control label {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
  margin-bottom: 8px;
}

.separation output,.edit-control output {
  font: 12px ui-monospace,monospace;
  color: var(--cyan);
}

input[type=range] {
  accent-color: var(--cyan);
  width: 100%;
  height: 28px;
  margin: 0;
  cursor: pointer;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 10px ui-monospace,monospace;
}

.scene-boundary {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  padding: 8px 28px 16px;
  max-width: 760px;
}

.inspector {
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}

.inspector-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.indicator {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  margin-top: 5px;
  box-shadow: 0 0 10px #8ce6d473;
}

.inspector h2 {
  font-size: 25px;
  font-weight: 500;
  max-width: 230px;
}

.intro {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 24px;
}

.field-label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

select {
  width: 100%;
  min-height: 46px;
  padding: 10px;
  background: #102a36;
  border: 1px solid #4b7981;
  border-radius: 0;
  color: var(--ink);
  font-size: 14px;
}

.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  gap: 14px;
  font-size: 12px;
}

.state-row>span {
  color: var(--muted);
}

.state-row strong {
  font: 12px ui-monospace,monospace;
  color: var(--cyan);
}

.state-row strong[data-released=true] {
  color: var(--orange);
}

.part-description {
  font-size: 12px;
  color: var(--muted);
  min-height: 42px;
  margin: 14px 0 18px;
}

.edit-control {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 17px;
}

.edit-control p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 5px 0 0;
}

.part-actions {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.part-actions button {
  font-size: 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.part-actions button:first-child {
  background: #173b43;
  color: var(--cyan);
}

.interaction-status {
  min-height: 38px;
  font-size: 12px;
  color: var(--orange);
  margin: 15px 0;
}

.record {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.record summary {
  font-size: 12px;
  min-height: 36px;
  cursor: pointer;
}

.record summary>span {
  float: right;
  color: var(--cyan);
  font-family: ui-monospace,monospace;
}

.record ol {
  list-style: none;
  margin: 0;
  padding: 0;
  font: 11px/1.7 ui-monospace,monospace;
  color: var(--muted);
  max-height: 220px;
  overflow: auto;
}

.record li {
  border-top: 1px solid var(--line);
  padding: 9px 0;
}

.record button {
  width: 100%;
  text-align: left;
  margin-top: 12px;
  font-size: 12px;
}

.record p {
  font-size: 11px;
  color: var(--muted);
}

.reset {
  width: 100%;
  margin-top: 18px;
  font-size: 12px;
  text-align: left;
}

.method {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 90px;
  padding: 64px 6vw;
  border-bottom: 1px solid var(--line);
}

.method h2 {
  font-size: clamp(26px,3vw,40px);
  font-weight: 500;
}

.method>div>p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  max-width: 740px;
}

.method a,.credits a {
  color: var(--cyan);
}

.credits {
  display: flex;
  gap: 60px;
  justify-content: space-between;
  padding: 24px 6vw;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.credits p {
  margin: 0;
  max-width: 850px;
}

.credits>a {
  flex-shrink: 0;
  align-self: start;
}

.scene[data-mode=pull] canvas {
  cursor: grab;
}

.scene[data-mode=pull] canvas:active {
  cursor: grabbing;
}

.scene[data-mode=dent] canvas {
  cursor: crosshair;
}

@media(min-width:1700px) {
  .dashboard {
    grid-template-columns: minmax(0,1fr) 370px;
  }
  .inspector {
    padding: 28px;
  }
}

@media(max-width:1050px) {
  .dashboard {
    grid-template-columns: minmax(0,1fr) 300px;
  }
  .scene-heading,.scene-bottom {
    left: 18px;
    right: 18px;
  }
  .mode-tools {
    left: 18px;
  }
  .scene-bottom {
    flex-direction: column;
    align-items: start;
    gap: 8px;
  }
  .inspector {
    padding: 20px;
  }
  .method {
    gap: 45px;
  }
}

@media(max-width:760px) {
  .masthead {
    padding: 12px 16px;
  }
  .wordmark strong {
    font-size: 12px;
  }
  .wordmark {
    gap: 8px;
  }
  .back {
    font-size: 11px;
    max-width: 140px;
    text-align: right;
  }
  .back span {
    margin-left: 4px;
  }
  .titlebar {
    padding: 22px 18px 18px;
    display: block;
  }
  .titlebar .eyebrow {
    margin-bottom: 8px;
  }
  h1 {
    font-size: 29px;
  }
  .vehicle {
    text-align: left;
    font-size: 14px;
    margin-top: 14px;
  }
  .vehicle span {
    font-size: 11px;
    margin-top: 3px;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
  .scene {
    height: 470px;
  }
  .scene-heading {
    top: 18px;
    left: 18px;
    right: 18px;
    font-size: 10px;
    gap: 10px;
  }
  .scene-heading span:last-child {
    max-width: 150px;
    text-align: right;
  }
  .mode-tools {
    top: 55px;
    right: 18px;
    display: grid;
    grid-template-columns: repeat(3,1fr);
  }
  .mode-tools button {
    justify-content: center;
    gap: 7px;
    padding: 8px 6px;
  }
  .scene-bottom {
    bottom: 14px;
    left: 18px;
    right: 18px;
    gap: 8px;
  }
  .scene-bottom>p {
    font-size: 11px;
    max-width: none;
    padding: 0;
  }
  .views {
    width: 100%;
  }
  .views button {
    flex: 1;
  }
  .separation {
    padding-inline: 18px;
  }
  .scene-boundary {
    padding-inline: 18px;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 26px 22px;
  }
  .inspector h2 {
    max-width: none;
  }
  .intro {
    max-width: 520px;
    margin-bottom: 18px;
  }
  .part-description {
    min-height: 0;
  }
  .inspector-heading {
    justify-content: start;
    align-items: start;
    gap: 15px;
  }
  .inspector-heading .indicator {
    order: -1;
  }
  .part-actions {
    grid-template-columns: 1fr 1fr;
  }
  .interaction-status {
    min-height: 20px;
  }
  .method {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 42px 22px;
  }
  .credits {
    padding: 24px 22px;
    flex-direction: column;
    gap: 16px;
  }
  .load-status {
    width: max-content;
    max-width: 85%;
  }
  .no-script {
    font-size: 12px;
  }
}

@media(max-width:360px) {
  .wordmark strong {
    max-width: 90px;
    line-height: 1.3;
  }
  .titlebar h1 {
    font-size: 26px;
  }
  .scene {
    height: 430px;
  }
  .mode-tools button {
    font-size: 11px;
  }
  .mode-tools button>span {
    font-size: 17px;
  }
  .part-actions {
    grid-template-columns: 1fr;
  }
  .scene-heading {
    font-size: 9px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
  }
}
