/* Viewer-only styles; won't affect the editor. */

/* Remove default padding so stage truly fills viewport */
.viewer .viewer-main {
  padding: 0;
  margin: 0;
}

/* Stage wrap fills the viewport; overlay toolbar does NOT reduce this height */
.viewer #stageWrap {
  position: relative;
  width: 100%;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* The visual "canvas" (natural px size; scaled via transform by view-fitter.js) */
.viewer .stage {
  position: absolute;
  left: 0; top: 0;
  transform-origin: top left;
  will-change: transform;

  background: #0a0f1e;
  border: 2px dashed #203562;
  border-radius: 16px;
  box-shadow: 0 10px 40px #0008, inset 0 0 0 1px #000;

  min-width: 0;
  min-height: 0;
}

.viewer .stage.view { border-style: solid; }

/* ---------- Overlay toolbar: PRIVATE layouts only ---------- */
.overlay-toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: .5rem .75rem;
  background: linear-gradient(180deg, #0b1020f2, #0b1020cc 70%, transparent);
  border-bottom: 1px solid #111629;
  backdrop-filter: blur(6px);

  transform: translateY(-100%);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  z-index: 2147483600;

  pointer-events: none;
}

.overlay-toolbar.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#toolbarRevealZone {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 12px;
  z-index: 2147483599;
}

.overlay-toolbar .btn { margin-left: .5rem; }
.overlay-toolbar .logo { opacity: .9; }

/* ========== CARD CONTAINMENT FIXES ========== */
.card {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 12px;
}

.card-header {
  flex-shrink: 0;
  padding: 0.5rem;
  background: rgba(16, 22, 42, 0.9);
  border-bottom: 1px solid rgba(39, 50, 79, 0.5);
  font-weight: 600;
  font-size: 0.875rem;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.card-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  box-sizing: border-box;
  padding: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Prevent module content from breaking card boundaries */
.card-body > * {
  max-width: 100%;
  box-sizing: border-box;
}

.card-body img,
.card-body video,
.card-body iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

.card-body table {
  width: 100%;
  table-layout: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hide-cursor {
  cursor: none !important;
}
