/* Vista 3D — só estrutura e medidas. Cores vêm de --v3d-* aplicadas a partir de vista3d-temas.js. */
.v3d-palco {
  position: relative;
  width: 100%;
  min-height: 420px;
  height: min(68vh, 640px);
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--v3d-fundo);
  background-image:
    linear-gradient(var(--v3d-padrao) 1px, transparent 1px),
    linear-gradient(90deg, var(--v3d-padrao) 1px, transparent 1px);
  background-size: 56px 56px;
  isolation: isolate;
}
.v3d-palco canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: transparent;
}
.v3d-toolbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  background: var(--v3d-toolbar-fundo);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--v3d-etq-tx);
  pointer-events: none;
}
.v3d-toolbar > * { pointer-events: auto; }
.v3d-toolbar h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
}
.v3d-toolbar .v3d-dica {
  flex: 1;
  margin: 0;
  font-size: .75rem;
  color: var(--v3d-etq-muted);
}
.v3d-toolbar button {
  border: 0;
  background: var(--v3d-destaque);
  color: var(--v3d-on-destaque);
  font: inherit;
  font-size: .8rem;
  font-weight: 650;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
}
.v3d-dica-canto {
  position: absolute;
  right: .8rem;
  bottom: .7rem;
  z-index: 3;
  margin: 0;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: var(--v3d-etq-bg);
  color: var(--v3d-etq-tx);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  pointer-events: none;
}
.v3d-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.v3d-etq {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  max-width: 11rem;
  padding: .28rem .7rem .3rem;
  border-radius: 999px;
  background: var(--v3d-etq-bg);
  color: var(--v3d-etq-tx);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.v3d-etq .v3d-cod {
  display: block;
  font-size: .58rem;
  letter-spacing: .03em;
  color: var(--v3d-etq-muted);
}
.v3d-etq .v3d-nome {
  display: block;
  font-size: .78rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3d-etq.v3d-obra {
  border-radius: 10px;
  padding: .28rem .5rem .34rem;
  text-align: left;
  min-width: 7.2rem;
}
.v3d-barra {
  display: block;
  height: 4px;
  margin-top: .25rem;
  border-radius: 99px;
  background: var(--v3d-barra-fundo);
  overflow: hidden;
}
.v3d-barra > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--v3d-barra-valor);
}
.v3d-etq.v3d-sel {
  outline: 2px solid var(--v3d-destaque);
}
.v3d-aviso {
  margin: .8rem;
  padding: .7rem .9rem;
  border-radius: 10px;
  background: var(--v3d-aviso-fundo, var(--v3d-etq-bg));
  color: var(--v3d-aviso-tx, var(--v3d-etq-tx));
  font-size: .9rem;
}
.v3d-carrega {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--v3d-etq-muted);
  font-size: .9rem;
  z-index: 1;
}
.v3d-detalhe-prev {
  position: absolute;
  right: .7rem;
  bottom: 2.2rem;
  z-index: 4;
  width: min(22rem, calc(100% - 1.4rem));
  padding: .8rem .9rem;
  border-radius: 12px;
  background: var(--v3d-etq-bg);
  color: var(--v3d-etq-tx);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  pointer-events: auto;
}
.v3d-detalhe-prev h4 { margin: 0 0 .3rem; font-size: 1rem; }
.v3d-detalhe-prev p { margin: .15rem 0; font-size: .85rem; color: var(--v3d-etq-muted); }
.v3d-detalhe-prev p b { color: var(--v3d-etq-tx); font-weight: 650; }
.v3d-detalhe-prev .v3d-fechar-det {
  position: absolute;
  top: .4rem; right: .5rem;
  border: 0; background: transparent;
  color: var(--v3d-etq-muted);
  font-size: 1.1rem;
  cursor: pointer;
}
@media (max-width: 520px) {
  .v3d-palco { min-height: 360px; height: min(62vh, 520px); }
  .v3d-toolbar .v3d-dica { display: none; }
  .v3d-etq { max-width: 7.2rem; padding: .22rem .55rem; }
  .v3d-etq .v3d-nome { font-size: .7rem; }
}

/* Lista de obras: bottom sheet no móvel, painel lateral no desktop ≥1280 px. Não flutua sobre o diorama. */
.v3d-lista-bd {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(8, 14, 12, .42);
  border: 0;
}
.v3d-lista-obras {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: var(--v3d-etq-bg);
  color: var(--v3d-etq-tx);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.v3d-lista-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .9rem .5rem;
  flex: none;
}
.v3d-lista-h h4 { margin: 0; font-size: 1rem; font-weight: 650; }
.v3d-lista-x {
  border: 0; background: transparent;
  color: var(--v3d-etq-muted);
  font-size: 1.35rem; line-height: 1;
  cursor: pointer; padding: .15rem .35rem;
}
.v3d-lista-corpo {
  overflow: auto;
  flex: 1;
  padding: 0 .5rem .5rem;
  -webkit-overflow-scrolling: touch;
}
.v3d-lista-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: .55rem .5rem .6rem;
  border-radius: 10px;
  cursor: pointer;
}
.v3d-lista-item:hover, .v3d-lista-item:focus-visible {
  background: rgba(91, 168, 152, .16);
  outline: none;
}
.v3d-lista-cod {
  display: block;
  font-size: .68rem;
  letter-spacing: .03em;
  color: var(--v3d-etq-muted);
}
.v3d-lista-nome {
  display: block;
  font-size: .9rem;
  font-weight: 650;
}
.v3d-lista-meta {
  display: block;
  margin-top: .1rem;
  font-size: .72rem;
  color: var(--v3d-etq-muted);
}
.v3d-lista-item .v3d-barra { margin-top: .35rem; }
.v3d-lista-vazia {
  margin: .6rem .5rem;
  color: var(--v3d-etq-muted);
  font-size: .9rem;
}
.v3d-lista-todas {
  flex: none;
  margin: 0 .7rem .75rem;
  border: 0;
  background: var(--v3d-destaque);
  color: var(--v3d-on-destaque);
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  padding: .45rem .7rem;
  border-radius: 999px;
  cursor: pointer;
}
@media (max-width: 1279px) {
  .v3d-lista-obras {
    left: 0; right: 0; bottom: 0;
    max-height: min(58%, 420px);
    border-radius: 20px 20px 0 0;
  }
}
@media (min-width: 1280px) {
  .v3d-lista-bd { background: transparent; pointer-events: none; }
  .v3d-lista-obras {
    top: 3.2rem; right: .7rem; bottom: 2.4rem;
    width: 360px;
    max-height: none;
    border-radius: 16px;
    pointer-events: auto;
  }
}

/* Fallback 2D (desktop / Painel embutido): sem WebGL ou com «reduzir movimento». 12/11 */
.v3d-palco.v3d-2d-on canvas, .v3d-palco.v3d-2d-on .v3d-dica-canto, .v3d-palco.v3d-2d-on .v3d-overlays { display: none; }
.v3d-2d { position: relative; z-index: 1; display: grid; gap: 16px; padding: 64px 20px 20px; align-content: start; }
.v3d-2d-aviso { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--v3d-aviso-fundo, var(--v3d-etq-bg)); color: var(--v3d-aviso-tx, var(--v3d-etq-tx)); font-size: 14px; line-height: 1.4; }
.v3d-2d-grelha { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.v3d-2d-lote { display: grid; gap: 4px; align-content: end; min-height: 84px; padding: 14px; text-align: left; border-radius: 16px; cursor: pointer;
  border: 1px solid rgba(91,168,152,.28); background: linear-gradient(160deg, rgba(91,168,152,.16), rgba(91,168,152,.04)); color: var(--v3d-etq-tx, inherit); font: inherit;
  transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.v3d-2d-lote:hover, .v3d-2d-lote:focus-visible { border-color: var(--v3d-destaque, #5BA898); background: rgba(91,168,152,.22); outline: none; }
.v3d-2d-principal { border-color: rgba(91,168,152,.55); }
.v3d-2d-nome { font-weight: 600; font-size: 15px; }
.v3d-2d-nota { font-size: 12px; opacity: .72; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .v3d-2d-lote { transition: none; } }
