/*
 * PMP Create Pro v38 — Production Command Deck
 * Original PMP workspace composition. This file changes presentation only;
 * every editor ID, data attribute, command, and production workflow is intact.
 */

:root {
  --deck-ink: #07151f;
  --deck-deep: #0b2430;
  --deck-slate: #15333f;
  --deck-teal: #20c8bb;
  --deck-orange: #ff9d32;
  --deck-paper: #f8fbfc;
  --deck-table: #dbe4e8;
  --deck-line: #c5d2d8;
}

body[data-layout="pmp-command-deck"] { background: var(--deck-table); }

/* Compact job header — identity and output, not a design-app menu bar. */
.topbar {
  height: 86px;
  flex-basis: 86px;
  display: grid;
  grid-template-columns: 196px 126px minmax(220px, 1fr) minmax(180px, 280px) auto;
  grid-template-rows: 43px 43px;
  align-items: center;
  gap: 0 12px;
  padding: 0 14px 0 0;
  overflow: visible;
  border: 0;
  background: var(--deck-ink);
  box-shadow: 0 8px 26px rgba(3, 17, 25, .24);
}

.topbar::after {
  left: 196px;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--deck-teal) 0 64%, var(--deck-orange) 64% 100%);
}

.brand {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: stretch;
  min-width: 0;
  padding: 0 17px;
  gap: 10px;
  border-right: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, rgba(32,200,187,.09), transparent 56%), #0b202b;
}

.brand strong { font-size: 14px; letter-spacing: -.2px; }
.brand em { background: var(--deck-orange); color: #17212b; }
.topbar .brand-orb { width: 43px; height: 43px; }

.file-nav {
  grid-column: 2;
  grid-row: 1;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.file-nav button {
  min-width: 56px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 5px;
  background: rgba(255,255,255,.045);
  color: #d6e2e7;
}

.project-title {
  grid-column: 3;
  grid-row: 1;
  max-width: none;
  min-width: 150px;
  margin: 0;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}

.project-title::before {
  content: "ACTIVE JOB";
  flex: 0 0 auto;
  color: #72909e;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 1.1px;
}

.project-title input {
  width: min(320px, 26vw);
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 5px;
  background: rgba(255,255,255,.045);
}

.project-title small { flex: 0 0 auto; }
.history-nav { grid-column: 4; grid-row: 1; justify-self: end; margin: 0; }

.job-pipeline {
  grid-column: 2 / 5;
  grid-row: 2;
  height: 33px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px;
  background: rgba(255,255,255,.025);
}

.job-pipeline span {
  position: relative;
  min-width: 120px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 17px 0 12px;
  color: #668491;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.job-pipeline span::after {
  content: "";
  position: absolute;
  right: 2px;
  width: 7px;
  height: 7px;
  border-top: 1px solid #45606b;
  border-right: 1px solid #45606b;
  transform: rotate(45deg);
}

.job-pipeline span:last-child::after { display: none; }
.job-pipeline b { color: #bfd0d7; font-size: 8px; letter-spacing: 0; }
.job-pipeline .active { color: var(--deck-teal); background: rgba(32,200,187,.09); }
.job-pipeline .active b { color: #fff; }

.top-actions {
  grid-column: 5;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  gap: 4px;
}

.top-actions > button { height: 32px; padding-inline: 9px; border-radius: 5px; }
.top-actions .gradient-button {
  min-width: 114px;
  height: 38px;
  background: var(--deck-orange);
  color: #17212b;
  box-shadow: 0 6px 16px rgba(255,157,50,.2);
}

/* Horizontal command deck is the app's signature navigation system. */
.editor-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 74px minmax(0, 1fr);
  background: var(--deck-table);
}

.tool-rail {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 74px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 9px 18px 9px 126px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-bottom: 1px solid #07151f;
  background: linear-gradient(90deg, rgba(32,200,187,.08), transparent 34%), var(--deck-deep);
  box-shadow: 0 7px 18px rgba(3,20,28,.16);
  z-index: 8;
}

.tool-rail::before {
  content: "CREATE\A DECK";
  position: absolute;
  left: 18px;
  top: 13px;
  width: 92px;
  height: 46px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  border-left: 4px solid var(--deck-orange);
  color: #8da6b1;
  font-size: 8px;
  font-weight: 950;
  line-height: 1.35;
  letter-spacing: 1.3px;
  white-space: pre;
  writing-mode: initial;
  transform: none;
}

.tool-rail button {
  width: auto;
  min-width: 108px;
  height: 52px;
  min-height: 52px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
  color: #b9cbd3;
  font-size: 8px;
  font-weight: 850;
}

.tool-rail button i,
.tool-rail .rail-icon { flex: 0 0 24px; color: #8aa7b3; }
.tool-rail button:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.075); }
.tool-rail button.active {
  border-color: rgba(32,200,187,.58);
  background: #123d45;
  color: #fff;
  box-shadow: inset 4px 0 0 var(--deck-teal), 0 5px 13px rgba(2,15,22,.2);
}
.tool-rail button.active i,
.tool-rail button.active .rail-icon { color: var(--deck-teal); }
.tool-rail .mobile-command { display: none; }

.workspace {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Libraries are a materials bay, opening from the opposite edge of the tools. */
.asset-panel {
  position: absolute;
  grid-column: 1;
  grid-row: 1 / 3;
  left: auto;
  right: 16px;
  top: 88px;
  bottom: 16px;
  width: 410px;
  max-width: calc(100vw - 32px);
  max-height: none;
  padding: 19px 18px 24px;
  overflow: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateX(calc(100% + 30px));
  border: 1px solid rgba(7,42,57,.2);
  border-top: 4px solid var(--deck-orange);
  border-radius: 8px;
  background: rgba(249,252,253,.99);
  box-shadow: -20px 22px 48px rgba(5,25,35,.24);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .16s ease;
  z-index: 42;
}

.editor-shell.panel-open .asset-panel { visibility: visible; opacity: 1; transform: translateX(0); }

@media (min-width: 981px) {
  .editor-shell > .scrim { top: 74px; }
  .workspace { transition: padding-right .22s cubic-bezier(.2,.8,.2,1); }
  .editor-shell.panel-open .workspace { padding-right: 442px; }
  .editor-shell.panel-open .stage-options { max-width: calc(100% - 250px); overflow-x: auto; flex-wrap: nowrap; }
}
.panel-title { border-bottom: 1px solid #dbe4e8; }
.panel-title::before {
  content: "PMP MATERIALS BAY";
  display: block;
  margin-bottom: 5px;
  color: #71858f;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 1.15px;
}

/* Selected-object properties read as calibrated instrumentation. */
.context-toolbar {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  max-width: none;
  height: 0;
  min-height: 0;
  flex: 0 0 0;
  padding: 0 18px;
  opacity: 0;
  visibility: hidden;
  transform: none;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--deck-line);
  border-radius: 0;
  background: #f8fafb;
  box-shadow: 0 4px 10px rgba(6,25,34,.08);
  transition: height .16s ease, flex-basis .16s ease, opacity .12s ease;
}

.context-toolbar.has-selection {
  height: 54px;
  flex-basis: 54px;
  padding: 7px 18px;
  opacity: 1;
  visibility: visible;
  transform: none;
  overflow-x: auto;
}

.context-toolbar.has-selection::before {
  content: "CALIBRATED OBJECT";
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid #d2dde2;
  color: #5f7681;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 1px;
}

.context-toolbar input,
.context-toolbar select,
.context-toolbar button { border-radius: 5px; }

/* Physical production table. */
.stage {
  flex: 1;
  min-height: 0;
  background-color: var(--deck-table);
  background-image:
    linear-gradient(rgba(255,255,255,.52) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.52) 1px, transparent 1px),
    linear-gradient(rgba(55,82,95,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55,82,95,.055) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
}

.stage::before {
  content: "TABLE 01 / TRUE SCALE";
  position: absolute;
  left: 14px;
  top: 132px;
  color: rgba(36,63,76,.38);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 1.3px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: none;
}

.stage::after {
  content: "PMP CREATE / LARGE-FORMAT PRODUCTION DECK";
  left: 48px;
  bottom: 13px;
  color: rgba(36,63,76,.42);
}

.stage-meta {
  left: 18px;
  top: 14px;
  min-width: 215px;
  padding: 8px 11px;
  border: 1px solid #c3d0d6;
  border-left: 4px solid var(--deck-teal);
  border-radius: 5px;
  background: rgba(248,251,252,.97);
}

.stage-meta::before { content: "MEDIA PROFILE  /  "; }
.stage-options { top: 14px; right: 18px; left: auto; }
.stage-options button,
.canvas-color-control { border-radius: 5px; }
.canvas-viewport { inset: 61px 26px 42px 48px; }
.canvas-frame { border: 1px solid rgba(18,44,57,.18); box-shadow: 0 20px 44px rgba(9,31,42,.23), 0 3px 7px rgba(9,31,42,.14); }
.canvas-size-label { border-radius: 4px; }
.workspace-hint { right: auto; left: 48px; bottom: 42px; border-radius: 6px; }

/* Sheet strip and view calibration share an instrument footer. */
.page-bar {
  position: relative;
  height: 48px;
  flex: 0 0 48px;
  justify-content: space-between;
  padding: 5px 12px;
  border-top: 1px solid #c6d2d7;
  background: #f8fafb;
}

.page-actions { position: static; left: auto; bottom: auto; transform: none; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.page-actions::before,
.view-controls::before { margin-right: 6px; color: #70848d; font-size: 7px; font-weight: 950; letter-spacing: .9px; }
.page-actions::before { content: "SHEETS"; }
.view-controls::before { content: "VIEW SCALE"; }
.add-page,
.page-action { border-radius: 5px; }
.page-strip { left: 206px; right: 322px; bottom: 55px; }
.view-controls { margin-left: auto; }
.production-drawer { top: 0; border-left: 4px solid var(--deck-orange); }

.app-shell.preview-mode .workspace { grid-column: 1; grid-row: 1 / 3; }
.app-shell.preview-mode .canvas-viewport { inset: 20px; }

@media (max-width: 1420px) {
  .topbar { grid-template-columns: 196px 126px minmax(180px,1fr) auto; }
  .job-pipeline, .history-nav { display: none; }
  .top-actions { grid-column: 4; }
  .top-actions > button { padding-inline: 8px; }
  .tool-rail button { min-width: 96px; }
}

@media (max-width: 980px) {
  html, body { overflow: hidden; }
  .app-shell { width: 100%; height: 100dvh; overflow: hidden; }
  .topbar { height: 66px; flex-basis: 66px; grid-template-columns: 148px minmax(120px,1fr) auto; grid-template-rows: 64px; padding-right: 8px; }
  .topbar::after { left: 148px; }
  .brand { grid-row: 1; padding: 0 10px; }
  .file-nav, .job-pipeline, .history-nav { display: none; }
  .project-title { grid-column: 2; grid-row: 1; }
  .project-title::before, .project-title small { display: none; }
  .project-title input { width: 100%; }
  .top-actions { grid-column: 3; grid-row: 1; }
  .editor-shell { grid-template-rows: minmax(0,1fr) 70px; }
  .workspace { grid-row: 1; }
  .tool-rail { grid-row: 2; height: 70px; padding: 7px 10px; border-top: 3px solid var(--deck-orange); border-bottom: 0; justify-content: flex-start; }
  .tool-rail::before { display: none; }
  .tool-rail button { min-width: 78px; height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 3px 7px; }
  .asset-panel { grid-column: 1; grid-row: 1 / 3; left: 12px; right: 12px; top: 12px; bottom: 82px; width: auto; max-width: none; max-height: none; transform: translateY(calc(100% + 100px)); }
  .editor-shell.panel-open .asset-panel { transform: translateY(0); }
  .stage-options { max-width: calc(100% - 260px); overflow-x: auto; flex-wrap: nowrap; }
  .canvas-viewport { inset: 60px 14px 40px 38px; }
}

@media (max-width: 620px) {
  .topbar { grid-template-columns: 132px minmax(86px,1fr) auto; }
  .brand strong { display: block; font-size: 11px; }
  .brand em { display: none; }
  .project-title { display: flex; }
  .top-actions > button { display: none !important; }
  .top-actions > .gradient-button { display: block !important; min-width: 88px; padding: 0 8px; }
  .tool-rail { gap: 5px; }
  .tool-rail button { min-width: 68px; }
  .tool-rail .mobile-command { display: flex; }
  .tool-rail .mobile-save-command { border-color: rgba(255,157,50,.48); color: #fff; background: rgba(255,157,50,.14); }
  .tool-rail .mobile-save-command i { color: var(--deck-orange); }
  .tool-rail .mobile-output-command { border-color: rgba(94,224,220,.48); color: #fff; background: rgba(35,190,188,.14); }
  .tool-rail .mobile-output-command i { color: #5ee0dc; font-size: 9px; font-weight: 950; letter-spacing: -.3px; }
  .tool-rail .mobile-proof-command.active { border-color: rgba(255,157,50,.72); background: rgba(255,157,50,.2); }
  .tool-rail .mobile-history-command:disabled { opacity: .34; }
  .stage-meta { top: 9px; left: 10px; min-width: 0; }
  .stage-options { left: 10px; right: 10px; top: 48px; max-width: none; }
  .canvas-viewport { inset: 86px 8px 40px 27px; align-items: flex-start; justify-content: flex-start; padding: 18px 12px; }
  .workspace-hint, .stage::after { display: none; }
  .page-actions::before, .view-controls::before { display: none; }
  .page-strip { left: 8px; right: 8px; bottom: 54px; }
  .production-drawer { width: min(410px, 96vw); }
}

@media (max-width: 360px) {
  .topbar {
    grid-template-columns: 96px minmax(64px, 1fr) 78px;
    column-gap: 4px;
    padding-right: 4px;
  }
  .topbar::after { left: 96px; }
  .brand { gap: 6px; padding: 0 6px; }
  .topbar .brand-orb { width: 38px; height: 38px; }
  .brand strong { font-size: 9px; line-height: 1.05; }
  .project-title input { padding-inline: 4px; font-size: 9px; }
  .top-actions > .gradient-button {
    width: 74px;
    min-width: 74px;
    padding: 0 4px;
    font-size: 0;
  }
  .top-actions > .gradient-button::before { content: "Quote"; font-size: 8px; }
  .top-actions > .gradient-button b { margin-left: 4px; font-size: 11px; }
  .tool-rail button { min-width: 62px; }
}

@media (prefers-reduced-motion: reduce) { .asset-panel { transition: none; } }
