:root {
  color-scheme:dark;
  --ink:#edf4f1;
  --muted:#a1b4ae;
  --line:#33443f;
  --panel:#1b2824;
  --teal:#9fdfbf;
  --amber:#fac477;
  --mono:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:#101719;
  color:var(--ink);
  font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
}

button,select,input {
  font:inherit;
}

button,a,input,select,summary {
  touch-action:manipulation;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:default;
  opacity:.42;
}

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

[hidden] {
  display:none!important;
}

button {
  color:var(--ink);
}

.mast,.brand,.actions,.scene-bar,.file-status,.panel-head,.range-label,.switch-row,.legend-caption,.limits {
  display:flex;
  align-items:center;
}

.mast {
  height:65px;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  background:#19251f;
  padding:0 clamp(15px,3vw,38px);
  gap:12px;
}

.brand,.actions {
  gap:13px;
}

.brand h1 {
  font-size:21px;
  letter-spacing:-.04em;
  margin:0;
  font-weight:690;
}

.back {
  color:#b1c5b9;
  text-decoration:none;
  font-size:14px;
  white-space:nowrap;
}

.back:hover,.inline:hover {
  color:#fff;
}

.divide {
  width:1px;
  height:21px;
  background:#42544a;
}

.cloud-mark {
  height:4px;
  width:4px;
  border-radius:50%;
  background:var(--amber);
  box-shadow:5px -7px #e3ab63,6px 4px #efb66b,12px -3px #fac477,-3px 6px #d49150;
  margin:0 10px 0 4px;
}

.actions button,.glass,.outline {
  border-radius:7px;
  padding:7px 13px;
  font-size:13px;
  font-weight:600;
}

.primary {
  background:var(--amber);
  color:#352619;
  border:1px solid #ffcd8c;
}

.primary:hover {
  background:#ffd39a;
}

.primary b {
  font-size:16px;
  line-height:13px;
}

.quiet {
  background:transparent;
  border:1px solid #43544b;
}

.quiet:hover,.outline:hover:enabled,.glass:hover {
  background:#314239;
}

.workspace {
  display:grid;
  grid-template-columns:minmax(0,1fr) 304px;
  min-height:calc(100vh - 65px);
  min-height:calc(100dvh - 65px);
}

.scene {
  min-width:0;
  display:flex;
  flex-direction:column;
  height:calc(100vh - 65px);
  height:calc(100dvh - 65px);
  min-height:430px;
  position:sticky;
  top:0;
}

.canvas-wrap {
  position:relative;
  flex:1;
  min-height:0;
  overflow:hidden;
  background:#101719;
}

canvas {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
  cursor:crosshair;
}

.scene-bar {
  position:absolute;
  top:20px;
  left:22px;
  right:22px;
  justify-content:space-between;
  gap:12px;
  pointer-events:none;
  align-items:flex-start;
}

.file-status {
  pointer-events:none;
  gap:10px;
  min-width:0;
  max-width:80%;
  padding:6px 10px 7px 8px;
  border-radius:8px;
  background:rgba(16,23,25,.76);
}

.file-status div {
  min-width:0;
}

.file-status strong {
  display:block;
  font-size:16px;
  font-weight:650;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden;
  max-width:100%;
}

.file-status small {
  display:block;
  color:#b0c2bb;
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.02em;
  margin-top:3px;
}

.live-dot {
  width:7px;
  height:7px;
  background:#9fdfbf;
  border-radius:50%;
  flex:none;
}

.glass {
  pointer-events:auto;
  white-space:nowrap;
  border:1px solid #43534d;
  background:#1b2824e6;
  color:#dfebe5;
}

.glass span {
  font-size:14px;
}

.notice {
  position:absolute;
  z-index:3;
  bottom:16px;
  left:50%;
  transform:translateX(-50%);
  max-width:min(85%,600px);
  width:max-content;
  overflow-wrap:anywhere;
  border:1px solid #465c50;
  border-radius:7px;
  background:#1d3028f5;
  padding:8px 14px;
  text-align:center;
}

.notice.error {
  background:#402b24;
  border-color:#935e46;
  color:#ffdec7;
}

.drop-shade {
  position:absolute;
  inset:8px;
  border:2px dashed var(--amber);
  background:#182520ed;
  color:var(--amber);
  border-radius:10px;
  display:grid;
  place-content:center;
  font-size:21px;
  pointer-events:none;
}

.gesture {
  border-top:1px solid #2c3b35;
  background:#17211d;
  color:#a1b4aa;
  padding:8px 20px;
  text-align:center;
  font-size:12px;
}

.gesture i {
  font-style:normal;
  color:#73877e;
  margin:0 5px;
}

.touch-help {
  display:none;
}

.touch-point {
  display: none;
}

.touch-input .touch-help {
  display: inline;
}

.touch-input .desktop-help {
  display: none;
}

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

.panel {
  padding:22px 20px;
  border-bottom:1px solid var(--line);
}

h2,summary {
  font-size:16px;
  font-weight:670;
  line-height:1.35;
  margin:0 0 16px;
  letter-spacing:-.015em;
}

.panel-head h2 {
  margin:0;
}

.panel-head,.range-label,.switch-row,.legend-caption,.limits {
  justify-content:space-between;
}

.inline {
  font-size:12px;
  color:var(--teal);
  border:0;
  background:transparent;
  padding:0;
}

.muted,.local-note {
  font-size:12px;
  color:var(--muted);
  line-height:1.65;
}

.muted {
  margin:8px 0;
}

.local-note {
  padding:16px 20px;
}

.panel fieldset {
  margin:0;
  padding:0;
  border:0;
  min-width:0;
}

legend,.range-label,.switch-row {
  font-size:13px;
}

.seg {
  display:flex;
  padding:3px;
  border:1px solid #3c4e44;
  background:#16221c;
  border-radius:7px;
  margin-top:7px;
}

.seg label {
  flex:1;
  text-align:center;
  position:relative;
  cursor:pointer;
}

.seg input {
  position:absolute;
  opacity:0;
  inset:0;
  width:100%;
  margin:0;
  cursor:inherit;
}

.seg span {
  display:block;
  border-radius:4px;
  padding:4px 3px;
  color:#b9c9c0;
  font-size:12px;
}

.seg input:checked+span {
  background:#385444;
  color:#edf9ef;
  font-weight:650;
}

.seg input:focus-visible+span {
  outline:1px solid var(--amber);
}

.seg input:disabled+span {
  opacity:.38;
}

.legend-caption,.limits {
  font:11px var(--mono);
  color:#b2c8b9;
}

.legend-caption {
  margin:13px 0 5px;
}

.ramp {
  height:7px;
  border-radius:3px;
  background:linear-gradient(to right,#440154,#3b528b,#21918c,#5ec962,#fde725);
}

.limits {
  margin-top:5px;
}

.range-label {
  margin:17px 0 2px;
}

.range-label output {
  font:12px var(--mono);
  color:var(--teal);
}

input[type=range] {
  width:100%;
  margin:7px 0;
  accent-color:#9bd8b3;
  cursor:pointer;
}

.switch-row {
  position:relative;
  margin-top:12px;
  cursor:pointer;
}

.switch-row input {
  opacity:0;
  position:absolute;
  right:0;
  width:32px;
  height:24px;
}

.switch-row i {
  width:30px;
  height:17px;
  border-radius:20px;
  background:#53625a;
  display:block;
  pointer-events:none;
}

.switch-row i:after {
  content:"";
  display:block;
  width:11px;
  height:11px;
  background:white;
  border-radius:50%;
  margin:3px;
}

.switch-row input:checked+i {
  background:#44825f;
}

.switch-row input:checked+i:after {
  transform:translateX(13px);
}

.switch-row input:focus-visible+i {
  outline:2px solid var(--amber);
}

.readout {
  margin:8px 0 13px;
}

.readout div {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid #324139;
  padding:5px 0;
}

.readout dt,.readout dd {
  font:13px/1.6 var(--mono);
}

.readout dt {
  display:flex;
  align-items:center;
  gap:7px;
  color:#b5c6bc;
}

.readout dd {
  margin:0;
  text-align:right;
  word-break:break-all;
  user-select:all;
}

.readout dt i {
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
}

.x {
  background:#f27970;
}

.y {
  background:#82cc8a;
}

.z {
  background:#71a8e9;
}

.i {
  background:#d4c389;
}

.outline {
  width:100%;
  border:1px solid #45594d;
  background:transparent;
  padding:5px 10px;
  color:#d1e1d6;
}

summary {
  cursor:pointer;
  margin:0;
}

.map-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  color:var(--muted);
  font-size:12px;
  margin:9px 0 13px;
}

select {
  background:#18241d;
  color:var(--ink);
  border:1px solid #4a5c50;
  border-radius:5px;
  display:block;
  width:100%;
  padding:4px;
  margin-top:3px;
}

.map-grid label {
  min-width:0;
}

#map-name {
  overflow-wrap:anywhere;
}

@media(pointer:coarse) {
  .touch-help {
    display:inline;
  }
  .desktop-help {
    display:none;
  }
}

@media(max-width:799px) {
  .touch-point {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px 10px;
    position: absolute;
    right: 10px;
    bottom: 10px;
    max-width: calc(100% - 94px);
    border-radius: 5px;
    padding: 5px 8px;
    background: rgba(16, 23, 25, .9);
    color: var(--ink);
    font: 11px/1.5 var(--mono);
    pointer-events: none;
  }
  .notice:not([hidden]) ~ .touch-point {
    display: none;
  }
  .mast {
    height:57px;
  }
  .workspace {
    display:block;
    min-height:0;
  }
  .scene {
    position:relative;
    height:60vh;
    height:60svh;
    min-height:320px;
    max-height:740px;
  }
  .inspector {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    border-left:0;
  }
  .panel {
    padding:17px 14px;
  }
  .local-note {
    padding:14px;
  }
  .scene-bar {
    left:9px;
    right:12px;
    top:10px;
  }
  .gesture {
    padding:6px 4px;
    font-size:11px;
  }
  .mast .actions,.brand {
    gap:8px;
  }
  .quiet,.actions .primary {
    padding:5px 9px;
  }
}

@media(max-width:530px) {
  .brand h1 {
    font-size:18px;
  }
  .brand .cloud-mark {
    display:none;
  }
  .mast {
    padding:0 10px;
  }
  .back {
    font-size:12px;
  }
  .actions .quiet,.actions .primary {
    font-size:12px;
  }
  .inspector {
    display:block;
  }
  .scene {
    height:57svh;
    min-height:300px;
  }
  .panel {
    padding:14px 17px;
  }
  .file-status strong {
    font-size:14px;
  }
  .file-status small {
    font-size:10px;
  }
  .glass {
    padding:5px 7px;
    font-size:12px;
  }
  .local-note {
    padding:14px 17px;
  }
  .notice {
    bottom:9px;
  }
}
