:root {
  color-scheme: light;
  font: 16px/1.45 "Inter", "Segoe UI", sans-serif;
  color: #141c18;
  background: #efece5;
  --paper: #fbf9f4;
  --ink: #141c18;
  --muted: #565d54;
  --line: #c7c8bd;
  --lime: #c5f65b;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(1500px, 100%); margin: auto; padding: 0 clamp(18px, 3vw, 46px) 38px; }
header { display: flex; gap: 23px; align-items: center; padding: 21px 0 17px; border-bottom: 1px solid #d1cfc5; }
header a { color: var(--ink); text-underline-offset: 4px; }
.brand { font-size: 1.24rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.intro { padding: 27px 0 22px; }
h1 { font-size: clamp(2.25rem, 5.4vw, 5.3rem); line-height: .99; letter-spacing: -.075em; margin: 0; }
.intro p { margin: 13px 0 0; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.2rem); }
h2 { margin: 0 0 13px; font-size: 1.47rem; line-height: 1.13; letter-spacing: -.036em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(310px, 1fr); gap: 13px; align-items: stretch; }
.preview { display: flex; flex-direction: column; min-width: 0; min-height: clamp(475px, 49vw, 660px); overflow: hidden; border-radius: 12px; background: #171f1c; color: #f6f7ee; }
.viewport { position: relative; flex: 1; min-height: 0; background: radial-gradient(ellipse at 46% 47%, #34413b, #171f1c 76%); }
model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; --poster-color: transparent; }
.preview.light .viewport { background: radial-gradient(ellipse at 45% 50%, #fcfcf6, #dce4d8 84%); }
.view-status { position: absolute; inset: auto 16px 17px; margin: 0; width: fit-content; max-width: calc(100% - 32px); padding: 6px 10px; border-radius: 5px; background: #111916; color: #fff; pointer-events: none; }
.view-status:empty { display: none; }
.fullscreen { position: absolute; top: 15px; right: 15px; width: 43px; height: 43px; padding: 0; display: grid; place-items: center; background: var(--lime); color: var(--ink); border-color: transparent; }
.playback { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto auto; align-items: center; gap: 9px; padding: 13px; border-top: 1px solid #42504a; }
.playback label { font-size: .84rem; padding-left: 3px; }
.playback select, .playback button:not(.primary) { color: #f6f7ee; border-color: #738179; background: #232c27; }
.playback option { color: #f6f7ee; background: #232c27; }
.settings { padding: 19px; min-width: 0; background: var(--paper); border: 1px solid #e2e0d7; border-radius: 12px; }
.settings label:not(.file) { display: block; font-size: .89rem; font-weight: 650; }
.settings label > :is(input[type=number], select) { margin-top: 5px; width: 100%; }
.dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0 13px; }
.switches { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 13px 0 17px; }
.switches input { accent-color: #54811d; margin-left: 0; vertical-align: -1px; }
.embed-options { border-top: 1px solid var(--line); padding-top: 16px; }
.embed-options input, .embed-options textarea { width: 100%; margin: 4px 0; }
.installation {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-top: 13px; padding: 20px; border: 1px solid #e2e0d7; border-radius: 12px; background: var(--paper);
}
.installation h2 { margin-bottom: 6px; }
.installation p { margin: 4px 0 0; color: var(--muted); }
.contact { padding: 10px 14px; border: 1px solid #8fb034; border-radius: 7px; flex: none; background: var(--lime); color: var(--ink); font-weight: 700; text-decoration: none; }
.helper, .error { font-size: .815rem; margin: 7px 0 0; color: var(--muted); }
.error { color: #a3332e; font-weight: 650; }
#copy-status:empty, [hidden] { display: none; }
input:not([type=checkbox]), select, textarea, button {
  min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink);
  font: inherit; padding: 8px 10px; min-height: 39px;
}
button { cursor: pointer; font-weight: 700; }
button:disabled, select:disabled { opacity: .52; cursor: default; }
button:not(:disabled):hover { filter: brightness(.94); }
button.primary { background: var(--lime); border-color: #8fb034; }
.copy { width: 100%; margin-top: 5px; }
textarea { display: block; resize: vertical; font: .81rem/1.46 Consolas, monospace; }
.file {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: .865rem;
}
.file span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-action { color: var(--ink); background: #e5edcf; padding: 6px 8px; border-radius: 4px; flex: none; font-weight: 700; }
.file input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
:focus-visible, .file:focus-within { outline: 2px solid #518321; outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.preview:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.is-embed main { width: 100%; padding: 0; }
.is-embed .workspace { display: block; }
.is-embed :is(header, .intro, .settings, .installation) { display: none; }
.is-embed .preview { width: 100%; height: 100vh; min-height: 0; border-radius: 0; }
@media (max-width: 790px) {
  .workspace { grid-template-columns: 1fr; }
  .preview { min-height: clamp(360px, 73vw, 555px); }
  .installation { align-items: flex-start; flex-direction: column; gap: 11px; }
}
@media (max-width: 495px) {
  header { padding: 16px 0; }
  .intro { padding: 25px 0 20px; }
  .settings { padding: 17px; }
  .playback { grid-template-columns: 1fr 1fr; gap: 7px; }
  .playback label { grid-column: 1 / -1; }
  .playback select { grid-column: 1 / -1; }
  .preview { min-height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
