:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #eee; background: #000; font-size: 13px; }
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable="true"], #filename { -webkit-user-select: text; user-select: text; }
#viewport { display: block; width: 100vw; height: 100dvh; touch-action: none; position: fixed; inset: 0; }
button, select { font: inherit; color: inherit; border: 1px solid transparent; background: transparent; border-radius: 7px; height: 34px; padding: 0 12px; cursor: pointer; }
button:hover:not(:disabled), select:hover { background: #ffffff16; }
button:disabled { opacity: .32; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #becbff; outline-offset: 4px; }
button.primary { background: #e9edfa; color: #1c2234; font-weight: 600; }
button.primary:hover { background: #fff; }
.panel { background: #1a1b20e8; border: 1px solid #ffffff1c; border-radius: 12px; backdrop-filter: blur(16px); box-shadow: 0 4px 24px #0002; }
.toolbar { position: fixed; left: max(20px, env(safe-area-inset-left)); top: max(20px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 17px; max-width: calc(100vw - 900px); }
.brand { text-decoration: none; color: #fff; font-size: 17px; letter-spacing: .06em; font-weight: 750; }
.brand span { color: #9ea6be; }
.divider { width: 1px; height: 20px; background: #ffffff20; flex-shrink: 0; }
#filename { color: #b5b8c4; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fit { font-size: 24px; padding: 0 7px; }
.settings { position: fixed; right: max(20px, env(safe-area-inset-right)); top: max(20px, env(safe-area-inset-top)); display: flex; gap: 5px; align-items: center; padding: 8px 9px; }
#stereo-strength-control { display: grid; grid-template-columns: auto auto; gap: 2px 8px; width: 110px; flex-shrink: 0; }
#stereo-strength-value { text-align: right; font-variant-numeric: tabular-nums; }
#stereo-strength { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: #c2ccef; cursor: pointer; }
.settings > details > summary { cursor: pointer; padding: 9px 8px; border-radius: 7px; white-space: nowrap; }
.settings > details > summary:hover { background: #ffffff16; }
.settings > details > summary:focus-visible { outline: 2px solid #becbff; outline-offset: 2px; }
.lighting-controls { position: absolute; top: calc(100% + 10px); right: 0; width: min(280px, calc(100vw - 24px)); padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.lighting-controls label { color: #c5c8d2; }
.lighting-controls output { font-variant-numeric: tabular-nums; color: #e9edfa; }
.lighting-controls input { grid-column: 1 / -1; width: 100%; margin: 0 0 10px; accent-color: #c2ccef; cursor: pointer; }
.lighting-controls input:last-child { margin-bottom: 0; }
fieldset { display: flex; border: none; gap: 9px; margin: 0 10px 0 4px; padding: 0; }
legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button.swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; border: 1px solid #ffffff40; }
button.black, button.black:hover { background: #000; }
button.gray, button.gray:hover { background: #777; }
button.white, button.white:hover { background: #f1f0ec; }
button.swatch.room { width: auto; padding: 0 6px; border-radius: 4px; font-size: 11px; }
.swatch[aria-pressed="true"] { outline: 1px solid #e8edff; outline-offset: 3px; }
#welcome { position: fixed; top: 48%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: min(90vw, 450px); }
.file-icon { margin-bottom: 25px; color: #9ba9d4; font-size: 72px; font-weight: 200; line-height: 1; }
h1 { font-size: 26px; font-weight: 500; letter-spacing: .13em; margin: 0 0 15px; }
#welcome p { color: #92949d; margin: 0 0 28px; }
#choose { height: 43px; padding: 0 20px; }
#choose span { margin-left: 24px; }
.text-button { display: block; margin: 16px auto 0; font-size: 12px; color: #b7bdd0; }
small { display: block; color: #696c77; font-size: 11px; margin-top: 26px; }
footer { position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 20px; right: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; }
#hint { color: #92959f; font-size: 11px; margin: 0; text-shadow: 0 1px 5px #000; }
#hint span { padding: 0 9px; }
#info { color: #92959f; font-size: 10px; text-shadow: 0 1px 5px #000; }
#playback { pointer-events: auto; display: flex; align-items: center; gap: 9px; padding: 8px; width: min(620px, 100%); }
#play { width: 34px; padding: 0; flex-shrink: 0; }
#clips { max-width: 150px; width: 26%; }
select { background: #25262c; padding: 0 6px; }
#timeline { flex: 1; min-width: 35px; accent-color: #c2ccef; cursor: pointer; }
#time { color: #b0b4c1; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#status { position: fixed; left: 50%; top: 93px; transform: translateX(-50%); max-width: min(560px, 90vw); color: #c9d1e8; text-align: center; font-size: 12px; background: #20232bec; border-radius: 9px; padding: 12px 18px; pointer-events: none; }
#status:empty { display: none; }
#status.error { color: #ffb6b6; }
#drop { position: fixed; inset: 10px; border: 2px dashed #a9b9eb; border-radius: 16px; background: #151d33ed; display: grid; place-items: center; font-size: 22px; pointer-events: none; z-index: 5; }
[hidden] { display: none !important; }
#object-tree summary:focus-visible { outline: 2px solid #becbff; outline-offset: -2px; }
#object-tree { position: absolute; top: calc(100% + 10px); right: 0; width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 260px); overflow: auto; padding: 12px 10px; overscroll-behavior: contain; }
#object-tree ul { list-style: none; margin: 0; padding-left: 16px; }
#object-tree > ul { padding-left: 0; }
#object-tree summary { display: flex; align-items: center; cursor: pointer; list-style: none; }
#object-tree summary::-webkit-details-marker { display: none; }
#object-tree summary::before { content: '▸'; flex: 0 0 16px; color: #92959f; text-align: center; }
#object-tree details[open] > summary::before { content: '▾'; }
.object-row { flex: 1; min-width: 0; border-radius: 5px; }
.object-row:hover { background: #ffffff0c; }
.object-row label { display: flex; align-items: center; gap: 7px; min-height: 32px; cursor: pointer; padding: 3px; }
.object-row input { margin: 0; accent-color: #c2ccef; flex-shrink: 0; }
.object-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-row small { margin: 0 0 0 auto; font-size: 10px; color: #92959f; flex-shrink: 0; }
.object-leaf { margin-left: 16px; }
.object-row.ancestor-hidden { opacity: .45; }
.object-row.node-hidden span { color: #92959f; }
body.xr .toolbar, body.xr .settings, body.xr footer, body.xr #welcome, body.xr #objects { display: none; }
@media (max-width: 1420px) {
  .toolbar { left: 12px; top: max(12px, env(safe-area-inset-top)); padding-left: 12px; gap: 8px; max-width: calc(100vw - 24px); right: 12px; }
  #filename { flex: 1; max-width: none; }
  .settings { top: max(77px, calc(env(safe-area-inset-top) + 65px)); right: 12px; max-width: calc(100vw - 24px); gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
  .settings fieldset { gap: 7px; margin-right: 4px; }
  .settings > button { padding: 0 7px; }
  #camera-mode, #render-mode { min-width: 0; max-width: 130px; flex-shrink: 1; }
  #status { top: 140px; }
  #object-tree { max-height: min(35dvh, calc(100dvh - 330px)); }
  footer { left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); }
  #playback { gap: 5px; }
  #time { font-size: 10px; }
  #clips { max-width: 100px; }
  h1 { font-size: 23px; }
}

#exit-xr { display: none; position: fixed; right: 20px; top: max(20px, env(safe-area-inset-top)); padding: 0 18px; z-index: 10; }
body.xr #exit-xr { display: block; }
