/* Full-viewport zero-overflow layout for 1440x900 and 1280x720 */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #101726 0%, #070a10 72%);
}

/* Top compact museum telemetry bar */
.top-bar {
  flex: 0 0 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(10, 14, 22, 0.96));
  border-bottom: 1px solid var(--brass-line);
  z-index: 20;
}

.top-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--brass-bright);
  white-space: nowrap;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #dfb469 65%, #a87424 100%);
  box-shadow: 0 0 8px rgba(223, 180, 105, 0.7);
}

/* Middle workspace: Terrarium Stage + Collapsible Right Chronicle/Miracles Drawer */
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
  position: relative;
}

.stage-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06090f;
}

#terrarium-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Collapsible right museum specimen panel */
.side-drawer {
  flex: 0 0 296px;
  width: 296px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--brass-line);
  transition: width 0.2s ease, flex-basis 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
  z-index: 15;
}

.side-drawer.collapsed {
  flex: 0 0 0px;
  width: 0;
  border-left: none;
  opacity: 0;
  pointer-events: none;
}

.drawer-tabs {
  flex: 0 0 38px;
  display: flex;
  border-bottom: 1px solid var(--brass-line);
  background: rgba(8, 12, 20, 0.7);
}

.drawer-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 4px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.drawer-tab:hover {
  color: var(--ink-primary);
  background: rgba(255, 255, 255, 0.03);
}

.drawer-tab.active {
  color: var(--brass-bright);
  border-bottom-color: var(--brass);
  background: rgba(223, 180, 105, 0.07);
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(223, 180, 105, 0.3) transparent;
}

.drawer-body::-webkit-scrollbar {
  width: 6px;
}

.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(223, 180, 105, 0.28);
  border-radius: 3px;
}

/* Bottom God Tool Dock */
.bottom-dock {
  flex: 0 0 92px;
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 12px 7px;
  background: linear-gradient(180deg, rgba(13, 18, 29, 0.97), rgba(8, 11, 18, 0.99));
  border-top: 1px solid var(--brass-line);
  z-index: 20;
}

.dock-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 28px;
}

.dock-tools-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.dock-tools-row::-webkit-scrollbar {
  display: none;
}

/* Responsive fine-tuning for 1280x720 */
@media (max-width: 1340px) {
  .side-drawer {
    flex: 0 0 272px;
    width: 272px;
  }
  .hide-compact {
    display: none !important;
  }
  .top-bar {
    padding: 0 8px;
    gap: 5px;
  }
}
