[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #1a1918; color: #f1ece2; font-family: var(--f-body); overflow: hidden; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; outline: none; }
body.embed .v-top, body.embed .v-legend { display: none; }

.v-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 14px var(--gutter);
  background: linear-gradient(#1a1918ee, #1a191800); pointer-events: none; }
.v-top > * { pointer-events: auto; }
.v-brand { font-family: var(--f-display); font-weight: 700; letter-spacing: .14em; font-size: 20px; color: #fff; text-decoration: none;
  border-bottom: 3px solid var(--red); padding-bottom: 2px; }
.v-title { flex: 1; min-width: 0; }
.v-title h1 { margin: 0; font: 600 15px/1.2 var(--f-display); letter-spacing: .08em; text-transform: uppercase; }
.v-title p { margin: 2px 0 0; font-size: 12px; color: #b9b2a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v-btn { font: 500 13px/1 var(--f-body); color: #f1ece2; background: #2b2926; border: 1px solid #45413b; border-radius: var(--radius);
  padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.v-btn:hover { background: #36332f; }
.v-btn[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.v-btn.ghost { background: transparent; }
.v-btn:focus-visible, .v-x:focus-visible, input:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 2px; }

.v-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: center; background: #201f1dcc; backdrop-filter: blur(8px); border: 1px solid #3a3733; border-radius: 10px; padding: 10px 12px;
  max-width: calc(100vw - 32px); box-sizing: border-box; }
.v-seg { display: flex; gap: 6px; }
.v-slider { display: flex; align-items: center; gap: 10px; font: 600 12px var(--f-display); letter-spacing: .1em; text-transform: uppercase; }
.v-slider input { width: 180px; accent-color: var(--red); }

.v-panel { position: fixed; background: #201f1df2; border: 1px solid #3a3733; border-radius: 10px; box-shadow: 0 10px 40px #0008; }
.v-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v-x { background: none; border: 0; color: #b9b2a6; font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.v-info { right: var(--gutter); top: 76px; width: 340px; max-width: calc(100vw - 32px); padding: 14px 16px 16px; box-sizing: border-box;
  max-height: calc(100vh - 190px); overflow: auto; }
.v-info h2 { margin: 8px 0 6px; font: 600 20px/1.2 var(--f-display); letter-spacing: .02em; }
.v-info p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #ddd6ca; }
.v-chip { font: 600 11px var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--green); padding: 4px 8px; border-radius: 4px; }
.v-dl { margin: 0; display: grid; gap: 8px; font-size: 13px; }
.v-dl div { display: grid; grid-template-columns: 78px 1fr; gap: 8px; }
.v-dl dt { color: #9a9388; font: 500 11px/1.6 var(--f-display); letter-spacing: .1em; text-transform: uppercase; }
.v-dl dd { margin: 0; font-family: var(--f-mono); font-size: 12.5px; color: #e8e1d4; }

.v-parts { left: var(--gutter); top: 76px; width: 290px; max-width: calc(100vw - 32px); padding: 12px 6px 12px 14px; box-sizing: border-box; max-height: calc(100vh - 190px); overflow: auto; }
.v-parts h2 { margin: 0; font: 600 14px var(--f-display); letter-spacing: .12em; text-transform: uppercase; }
.v-parts h3 { margin: 14px 0 4px; font: 600 11px var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: #9a9388; display: flex; justify-content: space-between; align-items: center; padding-right: 8px; }
.v-parts h3 label { font: 400 11px var(--f-body); letter-spacing: 0; text-transform: none; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.v-parts ul { list-style: none; margin: 0; padding: 0; }
.v-parts li button { width: 100%; text-align: left; background: none; border: 0; color: #e8e1d4; font: 13px var(--f-body); padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.v-parts li button:hover, .v-parts li button.on { background: #34312d; }

.v-legend { position: fixed; left: var(--gutter); bottom: 90px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #d8d1c5;
  background: #201f1dcc; padding: 8px 10px; border-radius: 8px; border: 1px solid #3a3733; }
.v-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.v-loading { position: fixed; inset: 0; display: grid; place-items: center; font: 600 14px var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: #b9b2a6; pointer-events: none; }

@media (max-width: 720px) {
  .v-title p { display: none; }
  .v-slider input { width: 120px; }
  .v-info { top: auto; bottom: 150px; right: 16px; left: 16px; width: auto; max-height: 40vh; }
  .v-parts { top: 64px; left: 16px; right: 16px; width: auto; max-height: 55vh; }
  .v-bar { bottom: 10px; gap: 6px; padding: 8px; }
  .v-btn { padding: 8px 9px; font-size: 12px; }
  .v-legend { bottom: 150px; }
}

/* Embedded on a page: compact one-row bar in the bottom-right corner (empty floor; the hose coil is bottom-left), and the camera lifts the
   model above it (viewer.js fitToBar). The full viewer keeps every control. */
body.embed .v-bar { left: auto; right: 10px; bottom: 10px; transform: none; justify-content: flex-end; flex-wrap: nowrap; gap: 6px;
  padding: 6px; max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none; }
body.embed .v-bar::-webkit-scrollbar { display: none; }
body.embed .v-btn { padding: 6px 8px; font-size: 12px; }
body.embed .v-seg { gap: 4px; }
body.embed .v-slider { gap: 6px; font-size: 11px; }
body.embed .v-slider input { width: 80px; }
body.embed #btnPaint, body.embed #btnReset { display: none; }
body.embed .v-info { top: 10px; left: 10px; right: auto; bottom: auto; width: min(300px, calc(100vw - 20px)); max-height: calc(100vh - 76px); padding: 10px 12px 12px; }
body.embed .v-info h2 { font-size: 16px; margin: 6px 0 4px; }
body.embed .v-info p { font-size: 12.5px; margin-bottom: 8px; }
@media (max-width: 480px) { body.embed .v-bar { left: 8px; right: 8px; bottom: 8px; flex-wrap: wrap; justify-content: center; } }
