/*
 * Dr.Prompt · PSD parity correction (P11)
 * Product-wide PSD canvas/glass continuity, restrained prompt frames, and
 * composer action containment. Presentation only; no workflow or content edits.
 */
:root {
  --df-p11-canvas: #272727;
  --df-p11-canvas-image: url("assets/directorflow-global-background-dark-mosaic-v2.webp");
  --df-p11-glass: rgba(10, 9, 13, .60);
  --df-p11-line: rgba(255, 255, 255, .14);
  --df-p11-inset: rgba(8, 8, 11, .62);
}

/* One PSD canvas for every functional page; transparent content layers let it
   remain visible rather than each page painting its own opaque background. */
#app#app[data-active-view]:not([data-active-view="home"]) {
  background-color: var(--df-p11-canvas) !important;
  background-image:
    linear-gradient(180deg, rgba(10,9,12,.08) 0, rgba(10,9,12,.16) 180px, rgba(39,39,39,.18) 320px, rgba(39,39,39,.68) 500px, var(--df-p11-canvas) 680px, var(--df-p11-canvas) 100%),
    var(--df-p11-canvas-image) !important;
  background-position: center top, center top !important;
  background-size: 100% 100%, 100% auto !important;
  background-repeat: no-repeat !important;
}
#app#app[data-active-view]:not([data-active-view="home"]) > .shell,
#app#app[data-active-view]:not([data-active-view="home"]) .view,
#app#app[data-active-view]:not([data-active-view="home"]) .page-scroll {
  background-color: transparent !important;
  background-image: none !important;
}
#app#app[data-active-view]:not([data-active-view="home"]) > .shell {
  background-color: transparent !important;
}

/* Keep the same translucent, blurred topbar over the canvas on every module. */
#app#app[data-active-view]:not([data-active-view="home"]) .topbar {
  background: linear-gradient(180deg, rgba(22,18,25,.24), rgba(8,8,11,.10)) !important;
  -webkit-backdrop-filter: blur(18px) saturate(116%) !important;
  backdrop-filter: blur(18px) saturate(116%) !important;
}

/* Keep work areas as quiet glass surfaces above the shared canvas. */
#app#app[data-active-view]:not([data-active-view="home"]) .panel:not(.setup-panel),
#app#app[data-active-view]:not([data-active-view="home"]) .page-hero,
#app#app[data-active-view]:not([data-active-view="home"]) .task-session-board,
#app#app[data-active-view]:not([data-active-view="home"]) .template-use-workspace,
#app#app[data-active-view]:not([data-active-view="home"]) .project-log-page,
#app#app[data-active-view]:not([data-active-view="home"]) .model-service-workspace,
#app#app[data-active-view]:not([data-active-view="home"]) .coming-soon-panel {
  background-color: rgba(10, 9, 13, .22) !important;
  -webkit-backdrop-filter: blur(14px) saturate(108%) !important;
  backdrop-filter: blur(14px) saturate(108%) !important;
}

/* Output: one module frame, then one inset prompt field. Remove the extra card,
   pane and workspace borders/backgrounds without changing any action controls. */
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .output-stage-premium {
  gap: 14px !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .output-stage-premium > .prompt-card,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .output-stage-premium > .prompt-card.prompt-primary,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] #first-frame-output-card,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] #first-frame-output-card .first-frame-workspace,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] #first-frame-output-card .first-frame-pane {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] #first-frame-output-card .first-frame-workspace,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] #first-frame-output-card .first-frame-pane {
  padding: 0 !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .output-stage-premium .prompt-head,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .first-frame-pane-head {
  background: transparent !important;
  box-shadow: none !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .output-stage-premium .prompt-body {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border: 1px solid var(--df-p11-line) !important;
  border-radius: 12px !important;
  background: var(--df-p11-inset) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
}

/* The composer card is the outer frame. Clamp its nested layout tracks so the
   Generate control and action bar cannot protrude beyond that frame. */
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio > .reactor-shell,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .reactor-flow-map,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .reactor-core,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottombar {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottombar {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 8px !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottom-left,
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottom-right {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottom-right {
  justify-self: end !important;
  grid-template-columns: minmax(0, 1fr) 48px !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio #run-demo-btn {
  justify-self: end !important;
  margin-right: 0 !important;
}

@media (max-width: 600px) {
  #app#app[data-active-view]:not([data-active-view="home"]) {
    background-size: 100% 720px, auto 620px !important;
    background-position: center top, center top !important;
  }
  #app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottombar {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottom-right {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) 48px !important;
  }
}

/* Final containment guard: the action row belongs to the composer outer frame,
   not to the page canvas. Give it an explicit inset so the Generate control
   cannot sit outside the visible frame even when legacy tracks are wider. */
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio {
  overflow: hidden !important;
  padding-bottom: 10px !important;
}
#app#app[data-active-view="workbench"][data-creation-entry="fast"] .composer-card.composer-studio .composer-bottombar {
  width: calc(100% - 20px) !important;
  max-width: calc(100% - 20px) !important;
  margin: 8px 10px 0 !important;
}
