/* Print Designer rev 1.0.2.3.0 - professional output cleanup, import/revision UI, and save/export regression harness */

/* Keep image/SVG backed components clickable in edit mode without forcing a visible box around the symbol. */
.component-node .component-hitbox {
  fill: transparent !important;
  stroke: transparent !important;
  stroke-width: 0 !important;
  pointer-events: all;
}

/* Professional output mode: the edit/navigation chrome must never appear in printed/PDF output. */
body.printing-pdf .topbar,
body.printing-pdf .tool-panel,
body.printing-pdf .property-panel,
body.printing-pdf .stage-header,
body.printing-pdf .canvas-nav-tools,
body.printing-pdf .canvas-view-jump-tools,
body.printing-pdf .integrity-audit-status-badge,
body.printing-pdf .autosave-viewport-flag,
body.printing-pdf .context-menu,
body.printing-pdf .context-help-menu,
body.printing-pdf .context-help-card,
body.printing-pdf .app-dropdown-menu,
body.printing-pdf .quick-picker,
body.printing-pdf .modal-backdrop,
body.printing-pdf .print-preview-overlay,
body.printing-pdf .regression-harness-overlay,
body.printing-pdf .revision-import-panel {
  display: none !important;
}

body.printing-pdf .workspace-shell,
body.printing-pdf .drawing-stage,
body.printing-pdf .canvas-scroller {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
  overflow: visible !important;
}

body.printing-pdf .print-canvas {
  box-shadow: none !important;
  transform: none !important;
  margin: 0 !important;
  width: 17in !important;
  height: 11in !important;
  background: #ffffff !important;
}

/* Hide edit-only SVG artifacts in PDF/print output. */
body.printing-pdf #gridBackground,
body.printing-pdf #assistLayer,
body.printing-pdf #selectionLayer,
body.printing-pdf .selection-box,
body.printing-pdf .selection-marquee,
body.printing-pdf .connection-hit-area,
body.printing-pdf .connection-bend,
body.printing-pdf .port-dot,
body.printing-pdf .bb-snap-marker,
body.printing-pdf .engineering-overlay-label,
body.printing-pdf .engineering-overlay-bolt,
body.printing-pdf .engineering-overlay-good,
body.printing-pdf .engineering-component-label,
body.printing-pdf .engineering-bolt,
body.printing-pdf .engineering-error-label,
body.printing-pdf .engineering-good-lamp,
body.printing-pdf .engineering-flow-pulse,
body.printing-pdf .pdf-underlay-label,
body.printing-pdf .pdf-underlay-subtext {
  display: none !important;
}

body.printing-pdf .component-node,
body.printing-pdf .note-node,
body.printing-pdf .connection-polyline,
body.printing-pdf .shape-node {
  filter: none !important;
}

body.printing-pdf .component-node.selected rect,
body.printing-pdf .component-node.selected circle.symbol-body,
body.printing-pdf .note-node.selected rect,
body.printing-pdf .component-node.network-highlight rect,
body.printing-pdf .component-node.network-highlight circle.symbol-body,
body.printing-pdf .note-node.network-highlight rect,
body.printing-pdf .engineering-fail {
  filter: none !important;
}
body.printing-pdf .connection-polyline.selected,
body.printing-pdf .connection-polyline.network-highlight,
body.printing-pdf .connection-polyline.engineering-fail-line {
  filter: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.printing-pdf .component-node .component-hitbox {
  fill: transparent !important;
  stroke: transparent !important;
  stroke-width: 0 !important;
}

@media print {
  .canvas-nav-tools,
  .canvas-view-jump-tools,
  .integrity-audit-status-badge,
  .autosave-viewport-flag,
  .context-menu,
  .context-help-menu,
  .context-help-card,
  .app-dropdown-menu,
  .quick-picker,
  .modal-backdrop,
  .print-preview-overlay,
  .regression-harness-overlay,
  .revision-import-panel {
    display: none !important;
  }
  #gridBackground,
  #assistLayer,
  #selectionLayer,
  .selection-box,
  .selection-marquee,
  .connection-hit-area,
  .connection-bend,
  .port-dot,
  .bb-snap-marker,
  .engineering-overlay-label,
  .engineering-overlay-bolt,
  .engineering-overlay-good,
  .engineering-component-label,
  .engineering-bolt,
  .engineering-error-label,
  .engineering-good-lamp,
  .engineering-flow-pulse,
  .pdf-underlay-label,
  .pdf-underlay-subtext {
    display: none !important;
  }
  .component-node .component-hitbox {
    fill: transparent !important;
    stroke: transparent !important;
    stroke-width: 0 !important;
  }
}

/* Import/revision helper */
.revision-import-panel {
  position: fixed;
  right: 18px;
  top: 96px;
  z-index: 1500;
  width: min(360px, calc(100vw - 36px));
  background: #0b1220;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.revision-import-panel header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.revision-import-panel h3 { margin: 0; font-size: 16px; }
.revision-import-panel p { margin: 0; color: #cbd5e1; font-size: 12px; line-height: 1.45; }
.revision-import-panel button {
  border: 1px solid #475569;
  border-radius: 10px;
  background: #1f2937;
  color: #f8fafc;
  padding: 8px 10px;
  font-weight: 800;
}
.revision-import-panel .primary { border-color: #38bdf8; background: rgba(14,165,233,.16); }
.revision-import-panel .danger { border-color: #ef4444; color: #fecaca; }
.revision-import-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Save/export regression report */
.regression-harness-overlay {
  position: fixed;
  inset: 0;
  z-index: 16000;
  background: rgba(2,6,23,.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.regression-harness-card {
  width: min(980px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #0b1220;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 22px;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.regression-harness-card header {
  padding: 16px 18px;
  background: linear-gradient(135deg,#0f172a,#1d4ed8 60%,#0e7490);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.regression-harness-card h2 { margin: 0; font-size: 22px; }
.regression-harness-card header p { margin: 5px 0 0; color: #dbeafe; line-height: 1.4; }
.regression-harness-close { border: 0; border-radius: 999px; width: 38px; height: 38px; background: rgba(255,255,255,.18); color: #fff; font-size: 22px; font-weight: 900; }
.regression-harness-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid #334155;
}
.regression-harness-metric {
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 10px;
  background: rgba(15,23,42,.72);
}
.regression-harness-metric span { display: block; color: #94a3b8; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.regression-harness-metric strong { display: block; margin-top: 3px; font-size: 20px; }
.regression-harness-body { overflow: auto; padding: 14px 18px 18px; }
.regression-harness-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.regression-harness-toolbar button { border: 1px solid #475569; border-radius: 10px; background: #1f2937; color: #f8fafc; padding: 8px 10px; font-weight: 800; }
.regression-harness-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  background: rgba(15,23,42,.72);
}
.regression-harness-row.ok { border-color: rgba(34,197,94,.65); }
.regression-harness-row.warning { border-color: rgba(245,158,11,.72); }
.regression-harness-row.error { border-color: rgba(239,68,68,.75); }
.regression-harness-row .sev { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #cbd5e1; }
.regression-harness-row strong { display: block; margin-bottom: 4px; }
.regression-harness-row span.detail { display: block; color: #cbd5e1; font-size: 13px; line-height: 1.45; }
.regression-harness-row pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 8px;
  color: #bae6fd;
  max-height: 170px;
  overflow: auto;
}
