/* BrickPlan.AI Kern · 3D-Viewer Bedienung (viewer-ui.js, Ergaenzung 05.10.). Nutzt die Tokens aus app.css. */
.vx-select { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 3px 6px; font-size: var(--fs-sm); max-width: 100%; }
.vx-icon { min-width: 30px; font-weight: 700; }
.btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.viewer-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.vx-levels { gap: 6px 12px; }
.vx-levels[hidden] { display: none; }
.vx-lvlabel { flex: 1 1 260px; }
.vx-lvlabel .btn { padding: 2px 8px; }
.vx-lvout { min-width: 13em; }

/* Ueberlagerungen im 3D-Fenster */
.vx-panel, .vx-help { position: absolute; z-index: 4; top: 10px; right: 10px; width: min(330px, calc(100% - 20px)); max-height: calc(100% - 20px);
  overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 6px;
  animation: vx-in .16s ease-out; }
.vx-panel[hidden], .vx-help[hidden], .vx-hud[hidden], .vx-toast[hidden] { display: none; }
@keyframes vx-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.vx-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vx-psec, .vx-hsec { margin-top: 6px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.vx-field { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 8px; }
.vx-field input[type=range] { accent-color: var(--accent); min-width: 0; }
.vx-field input[type=color] { width: 44px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: none; }
.vx-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.vx-note { margin: 4px 0; }
.vx-note .link { border: 0; background: transparent; padding: 0; font: inherit; color: var(--focus); cursor: pointer; text-decoration: underline; }
.vx-hrow { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px; align-items: baseline; }
.vx-hrow kbd { font: 600 .74rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; justify-self: start; }
.vx-toast { position: absolute; z-index: 5; left: 50%; top: 10px; transform: translateX(-50%); max-width: calc(100% - 24px);
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #ff8c1a; border-radius: 8px; padding: 6px 10px;
  font-size: var(--fs-sm); box-shadow: var(--shadow); animation: vx-in .16s ease-out; }

/* Begehen */
.vx-hud { position: absolute; z-index: 3; left: 50%; top: 10px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px);
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow); }
.vx-walking .viewer canvas { cursor: crosshair; }
.vx-walking .pick { display: none; }
.vx-walking::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); pointer-events: none; z-index: 2; }
.vx-touch { position: absolute; inset: auto 0 0 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; padding: 14px; pointer-events: none; }
.vx-stick { width: 110px; height: 110px; border-radius: 50%; background: rgba(0, 0, 0, .18); border: 2px solid rgba(255, 255, 255, .5);
  display: grid; place-items: center; pointer-events: auto; touch-action: none; }
.vx-knob { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.vx-lift { display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.vx-lift button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .22); color: #fff; font-size: 1.1rem; touch-action: none; }

/* Vollbild: Karte fuellt den Bildschirm, 3D-Fenster nimmt den Rest der Hoehe */
.viewer-card.vx-fs, .viewer-card.vx-pseudo { background: var(--bg); padding: 10px; overflow: auto; }
.viewer-card.vx-pseudo { position: fixed; inset: 0; z-index: 50; border-radius: 0; }
.viewer-card.vx-fs .viewer-wrap, .viewer-card.vx-pseudo .viewer-wrap { flex: 1 1 auto; height: auto; min-height: 55vh; }
.viewer-card.vx-fs .units, .viewer-card.vx-pseudo .units, .viewer-card.vx-fs .downloads, .viewer-card.vx-pseudo .downloads { display: none; }
.viewer-card:fullscreen { width: 100vw; height: 100vh; }
body.vx-noscroll { overflow: hidden; }

@media (max-width: 640px) {
  .vx-panel, .vx-help { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 72%; border-radius: 12px 12px 0 0; }
  .vx-field { grid-template-columns: 6.5em 1fr auto; }
  .vx-lvout { min-width: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .vx-panel, .vx-help, .vx-toast { animation: none; } }
