:root {
  color-scheme: dark;
  --bg: #141618;
  --panel: #1c1f22;
  --line: #36393a;
  --ink: #f4f3ef;
  --muted: #acb0b0;
  --accent: #ff9160;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
canvas:focus-visible,
input:focus-visible {
  outline: 2px solid #ffad84;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}
svg.icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}
.mast {
  border-bottom: 1px solid #353739;
  background: #191b1d;
}
.mast-inner,
main {
  max-width: 1720px;
  margin: auto;
}
.mast-inner {
  height: 70px;
  padding: 0 clamp(18px, 2.5vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.identity,
.guide-btn {
  display: flex;
  align-items: center;
}
.identity {
  gap: 12px;
}
.identity img {
  width: 34px;
  height: 34px;
}
.identity strong {
  font-size: 22px;
  letter-spacing: -1.1px;
  font-weight: 800;
  white-space: nowrap;
}
.identity b {
  color: var(--accent);
  font-weight: 650;
}
.mast-divider {
  height: 19px;
  width: 1px;
  background: #454749;
  margin: 0 3px;
}
.subtitle {
  font-size: 13px;
  letter-spacing: 0.07em;
  color: #b2b4b4;
}
.guide-btn,
.icon-button {
  background: #242729;
  border: 1px solid #3b3f40;
  border-radius: 7px;
  min-height: 38px;
}
.guide-btn {
  white-space: nowrap;
  flex-shrink: 0;
  gap: 9px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 600;
}
.guide-btn:hover,
.icon-button:hover,
.scene-tools button:hover {
  background: #393b3b;
}
main {
  padding: clamp(16px, 2vw, 32px) clamp(18px, 2.5vw, 44px) 26px;
}
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(304px, 25vw, 378px);
  gap: 16px;
  align-items: stretch;
}
#viewport,
.panel,
.preset-card {
  border: 1px solid var(--line);
  border-radius: 12px;
}
#viewport {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  background: radial-gradient(ellipse at 51% 47%, #3c4043 0%, #303437 45%, #222629 86%);
  min-height: clamp(490px, 62vh, 710px);
}
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active {
  cursor: grabbing;
}
#scene:focus-visible {
  outline-offset: -3px;
}
.scene-head {
  position: absolute;
  pointer-events: none;
  left: clamp(18px, 2.2vw, 36px);
  top: clamp(20px, 2vw, 33px);
}
.eyebrow,
.presets-head > span {
  font: 600 11px/1.2 var(--mono);
  letter-spacing: 0.155em;
  color: var(--accent);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}
.line {
  display: inline-block;
  width: 23px;
  height: 2px;
  background: var(--accent);
}
h1 {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(33px, 3.5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.065em;
  font-weight: 760;
  margin: 9px 0 7px;
}
h1 span {
  font-weight: 360;
  color: #cdd0d0;
  letter-spacing: -0.065em;
}
.model-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #b9bebe;
  font: 12px var(--mono);
}
.model-meta span:first-child {
  font-size: 13px;
  line-height: 1.4;
}
.model-meta b {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #767d7d;
}
.scene-tools {
  position: absolute;
  right: 17px;
  top: 18px;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #222628d9;
  border: 1px solid #494d4e;
}
.scene-tools button,
.icon-button {
  display: grid;
  place-items: center;
}
.scene-tools button {
  width: 36px;
  height: 36px;
  color: #d0d3d1;
}
.scene-tools button + button {
  border-top: 1px solid #414547;
}
.scene-tools svg {
  width: 17px;
  height: 17px;
}
.view-footer {
  position: absolute;
  bottom: 18px;
  left: 21px;
  right: 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.view-picker {
  display: flex;
  align-items: center;
  position: relative;
  pointer-events: auto;
  border: 1px solid #515554;
  border-radius: 7px;
  background: #202425e8;
}
.view-picker > i:first-child {
  position: absolute;
  left: 10px;
  color: #e4e6df;
  pointer-events: none;
}
.view-picker > i:last-child {
  position: absolute;
  right: 9px;
  pointer-events: none;
}
.view-picker > i:last-child svg {
  width: 13px;
}
.view-picker select {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 27px 8px 36px;
  font-size: 13px;
  cursor: pointer;
}
.view-picker option {
  background: #252829;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #222627dc;
  border: 1px solid #4d514f;
  border-radius: 20px;
  padding: 5px 11px;
  color: #e4e5df;
  font-size: 12px;
  line-height: 1.45;
}
.status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  padding: 13px 18px;
  background: #212426ed;
  border: 1px solid #45494a;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 90%;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #6f736e;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
[hidden] {
  display: none !important;
}
.panel {
  background: var(--panel);
  overflow: hidden;
}
.panel-title {
  padding: 23px 21px 16px;
  position: relative;
}
.panel-title .eyebrow {
  color: #a5a9a9;
  font-size: 10px;
}
.panel-title h2 {
  font-size: 21px;
  letter-spacing: 0.04em;
  margin-top: 5px;
}
.panel-title > i {
  position: absolute;
  right: 20px;
  top: 27px;
  color: var(--accent);
}
.panel-title > i svg {
  width: 22px;
  height: 22px;
}
.tabs {
  background: #141618;
  border: 1px solid #343739;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 18px 4px;
  padding: 3px;
}
.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 35px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #aeb2b2;
  border-radius: 5px;
}
.tabs button[aria-selected="true"] {
  background: #34312e;
  color: #ffa071;
  box-shadow: inset 0 0 0 1px #574438;
}
.tabs svg {
  width: 15px;
  height: 15px;
}
.controls {
  padding: 0 21px 14px;
}
.group {
  border-top: 1px solid #353839;
  padding: 13px 0 9px;
}
.group:first-child {
  border: 0;
}
.group:last-child {
  padding-bottom: 0;
}
.group-title {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #9da4a4;
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.045em;
}
.group-title svg {
  width: 15px;
  height: 15px;
  color: #9da4a4;
}
.range-row {
  margin-bottom: 4px;
}
.range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 550;
}
.value {
  color: #c2c6c5;
  font: 12px var(--mono);
  letter-spacing: 0.02em;
}
.value em {
  font-style: normal;
  font-size: 10px;
  margin-left: 3px;
  color: #a1a6a5;
}
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  height: 22px;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--fill), #444849 var(--fill));
}
input[type="range"]::-moz-range-track {
  height: 3px;
  background: linear-gradient(to right, var(--accent) var(--fill), #444849 var(--fill));
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border-radius: 100%;
  background: #ff9b70;
  border: 2px solid #292b2b;
  box-shadow: 0 0 0 1px #ff9b70;
}
input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border: 2px solid #252729;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent);
}
.options {
  display: flex;
  gap: 5px;
  margin: 8px 0;
}
.options button {
  flex: 1;
  border: 1px solid #454849;
  border-radius: 5px;
  padding: 8px 4px;
  font-size: 13px;
  color: #c9ceca;
}
.options button[aria-pressed="true"] {
  background: #392e28;
  color: #ffa177;
  border-color: #926249;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 37px;
  font-size: 14px;
}
.switch {
  width: 36px;
  height: 22px;
  border-radius: 14px;
  background: #424647;
  position: relative;
  border: 1px solid #5c6160;
}
.switch:after {
  content: "";
  width: 14px;
  height: 14px;
  background: #bfc1bd;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.15s;
}
.switch[aria-checked="true"] {
  border-color: #d88460;
  background: var(--accent);
}
.switch[aria-checked="true"]:after {
  background: #2a2724;
  transform: translateX(14px);
}
.note {
  font-size: 13px;
  line-height: 1.7;
  color: #a9afad;
  margin: 9px 0 3px;
}
.ramp-illustration {
  width: 100%;
  height: auto;
  color: #9aa19c;
  margin: 12px 0 8px;
}
.ramp-angle {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}
.ramp-angle strong {
  font: 500 23px var(--mono);
  color: var(--accent);
}
.ramp-angle span {
  font-size: 13px;
  color: var(--muted);
}
.presets {
  margin-top: 24px;
}
.presets-head,
.presets-head > div {
  display: flex;
  align-items: center;
}
.presets-head {
  gap: 14px;
  margin-bottom: 13px;
}
.presets-head > div {
  gap: 9px;
}
.presets-head i {
  color: var(--accent);
}
h2 {
  font-size: 19px;
  letter-spacing: 0.035em;
}
.presets-head > span {
  font-size: 10px;
  color: #949a9a;
  letter-spacing: 0.13em;
}
.presets-head:after {
  content: "";
  height: 1px;
  background: #343637;
  flex: 1;
}
#preset-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.preset-card {
  position: relative;
  min-height: 98px;
  text-align: left;
  display: flex;
  align-items: center;
  background: linear-gradient(115deg, #292c2e, #212426 65%);
  padding: 10px 12px 10px 7px;
  gap: 6px;
  transition: border-color 0.16s, background 0.16s;
}
.preset-card:hover {
  border-color: #787b75;
  background: #303333;
}
.preset-card[aria-pressed="true"] {
  border-color: #b27551;
  background: linear-gradient(120deg, #3a342d, #292723 75%);
}
.preset-card img {
  width: 41%;
  max-height: 99px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px #10121490);
}
.card-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-text strong {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}
.card-text small {
  font-size: 12px;
  color: #adb2af;
  line-height: 1.5;
}
.card-check {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 13px;
  height: 13px;
  border: 1px solid #565c58;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.card-check svg {
  display: none;
  width: 10px;
  height: 10px;
  stroke-width: 3;
}
.preset-card[aria-pressed="true"] .card-check {
  background: var(--accent);
  color: #272823;
  border-color: var(--accent);
}
.preset-card[aria-pressed="true"] .card-check svg {
  display: block;
}
dialog {
  background: #222628;
  border: 1px solid #505556;
  border-radius: 12px;
  padding: 23px;
  color: var(--ink);
  width: min(420px, 92vw);
  max-height: 85dvh;
}
dialog::backdrop {
  background: #050708ad;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-button {
  height: 36px;
  width: 36px;
}
dialog h2 {
  margin: 4px 0 15px;
}
dialog dl {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 13px;
  font-size: 14px;
  line-height: 1.65;
}
dialog dt {
  color: var(--accent);
}
dialog dd,
dialog p {
  color: #d0d3d0;
}
dialog p {
  font-size: 14px;
  line-height: 1.65;
  margin-top: 17px;
  border-top: 1px solid #3e4243;
  padding-top: 14px;
}
@media (min-width: 1100px) and (min-height: 850px) {
  .group {
    padding-top: 17px;
    padding-bottom: 12px;
  }
  .range-row {
    margin-bottom: 7px;
  }
  .panel-title {
    padding-top: 27px;
    padding-bottom: 20px;
  }
  .tabs {
    margin-bottom: 9px;
  }
  .preset-card {
    min-height: 120px;
  }
}
@media (max-width: 1050px) {
  #preset-cards {
    gap: 8px;
  }
  .preset-card {
    padding: 12px 8px 12px 4px;
  }
  .card-text small {
    font-size: 11px;
  }
  .card-text strong {
    font-size: 15px;
  }
}
@media (max-width: 760px) {
  .mast-inner {
    height: 55px;
  }
  .identity {
    gap: 8px;
  }
  .identity img {
    width: 29px;
    height: 29px;
  }
  .identity strong {
    font-size: 19px;
  }
  .subtitle {
    font-size: 12px;
  }
  .mast-divider {
    margin: 0;
    height: 16px;
  }
  .guide-btn {
    min-height: 34px;
    font-size: 12px;
    padding: 0 9px;
    gap: 5px;
  }
  .guide-btn svg {
    width: 16px;
  }
  main {
    padding: 12px 12px 24px;
  }
  .workbench {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #viewport {
    height: clamp(294px, 44svh, 480px);
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 0 0 1px var(--bg);
  }
  .scene-head {
    top: 14px;
    left: 16px;
  }
  .scene-head .eyebrow {
    font-size: 9px;
    gap: 6px;
  }
  .scene-head .line {
    width: 16px;
  }
  h1 {
    font-size: 31px;
    margin: 5px 0 3px;
  }
  .model-meta {
    font-size: 10px;
    gap: 7px;
  }
  .scene-tools {
    top: 12px;
    right: 10px;
  }
  .scene-tools button {
    height: 34px;
    width: 34px;
  }
  .view-footer {
    left: 12px;
    right: 12px;
    bottom: 11px;
  }
  .view-picker select {
    font-size: 12px;
  }
  .status {
    font-size: 11px;
  }
  .panel-title {
    padding: 14px 16px 11px;
    display: flex;
    flex-direction: row-reverse;
    align-items: baseline;
    justify-content: flex-end;
    gap: 10px;
  }
  .panel-title h2 {
    font-size: 18px;
    margin: 0;
  }
  .panel-title .eyebrow {
    font-size: 9px;
  }
  .panel-title > i {
    right: 16px;
    top: 16px;
  }
  .panel-title > i svg {
    width: 18px;
    height: 18px;
  }
  .tabs {
    margin: 0 14px 2px;
  }
  .tabs button {
    height: 38px;
  }
  .controls {
    padding: 0 17px 16px;
  }
  .group {
    padding: 11px 0 8px;
  }
  .range-row {
    margin-bottom: 3px;
  }
  input[type="range"] {
    height: 28px;
  }
  .presets {
    margin-top: 17px;
  }
  #preset-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .preset-card {
    min-height: 80px;
    padding: 9px 7px 9px 3px;
  }
  .preset-card img {
    width: 37%;
  }
  .card-text {
    gap: 3px;
  }
  .card-text small {
    font-size: 10px;
  }
  .card-text strong {
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .subtitle,
  .mast-divider {
    display: none;
  }
}
@media (max-width: 385px) {
  main {
    padding-left: 8px;
    padding-right: 8px;
  }
  .card-text small {
    font-size: 10px;
  }
  .preset-card img {
    width: 32%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
[hidden] {
  display: none !important;
}
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid #777;
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.gesture-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  align-items: center;
  color: #c1c6c2;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.gesture-hint svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 760px) {
  .gesture-hint {
    display: none;
  }
}

.switch::before {
  content: "";
  position: absolute;
  inset: -7px -5px;
}
.option-row label {
  cursor: pointer;
}
