/* These styles are generated from project.scss. */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

.mermaid-preview {
  min-height: 200px;
  overflow: auto;
}

.md-preview {
  min-height: 120px;
}

.rendered-markdown p:last-child {
  margin-bottom: 0;
}

.clickable-row {
  cursor: pointer;
}

.card-narrow {
  max-width: 600px;
}

.badge-xs {
  font-size: 0.65em;
}

/* Canvas editor */
.canvas-workspace {
  position: relative;
  height: calc(100vh - 185px);
  min-height: 400px;
}

.canvas-stencil-panel {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 10;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 68px;
}

.stencil-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: grab;
  font-size: 0.65rem;
  color: #555;
  user-select: none;
}

.stencil-item:hover {
  background: #f0f4ff;
}

.stencil-item:active {
  cursor: grabbing;
}

/* Prevent SVG children from intercepting drag events on the parent div */
.stencil-item svg {
  pointer-events: none;
}

.stencil-edge-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  color: #555;
  user-select: none;
  background: none;
  border: none;
  width: 100%;
}

.stencil-edge-btn:hover {
  background: #f0f4ff;
}

.stencil-divider {
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 2px 0;
}

.canvas-area {
  flex: 1;
  min-width: 0;
  background: #f8f9fa;
  overflow: hidden;
}

.canvas-props-panel {
  width: 380px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #fff;
}

.canvas-section-header {
  background: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
  padding: 0.375rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6c757d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
}

button.canvas-section-header:hover {
  background: #e9ecef;
  color: #495057;
}

.canvas-meta-chevron {
  transition: transform 0.2s;
}

[aria-expanded="false"] .canvas-meta-chevron {
  transform: rotate(-90deg);
}

.canvas-zoom-display {
  min-width: 52px;
  cursor: default;
  text-align: center;
}

.canvas-rankdir-select {
  width: auto;
  min-width: 72px;
}

.canvas-panel-resize-handle {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 10;
}

.canvas-panel-resize-handle:hover,
.canvas-panel-resize-handle.dragging {
  background: #adb5bd;
}

/* Read-only workflow viewer embedded on procedure pages. */
.workflow-viewer {
  height: calc(100vh - 240px);
  min-height: 400px;
  background: #f8f9fa;
  overflow: hidden;
  border-radius: 0.375rem;
}

.viewer-sticky {
  position: sticky;
  top: 4rem;
}

.fmea-filter-sticky {
  position: sticky;
  top: 4rem;
  background: #fff;
  z-index: 10;
  padding-top: 0.375rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0.75rem;
}

.fmea-sort-link {
  color: inherit;
}

.fmea-sort-link:hover {
  color: #0d6efd;
}

.viewer-graph-header {
  cursor: default;
}

.viewer-fit-btn {
  font-size: 0.7rem;
}

/* FMEA Action Priority badges */
.ap-high {
  background-color: #dc3545;
  color: #fff;
}

.ap-medium {
  background-color: #fd7e14;
  color: #fff;
}

.ap-low {
  background-color: #198754;
  color: #fff;
}

/* FMEA entry list */
.fmea-search-input {
  max-width: 220px;
}

.btn-xs {
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
}

.fmea-revalidation-toggle {
  cursor: pointer;
}

.fmea-scoring-guide-link {
  font-size: 0.8rem;
}

.fmea-scoring-guide {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
}

.fmea-guide-table {
  font-size: 0.78rem;
}

.fmea-guide-table td:first-child {
  font-weight: 600;
  text-align: center;
  width: 2rem;
}

.fmea-col-nr {
  width: 2.5rem;
}

.fmea-col-score {
  width: 2.5rem;
}

.fmea-col-ap {
  width: 3rem;
}

.fmea-scores-table {
  table-layout: fixed;
  width: 100%;
}

.fmea-scores-col-label {
  width: 4rem;
}

.fmea-scores-col-val {
  width: 3rem;
}

.fmea-scores-col-rpn {
  width: 3.5rem;
}

.fmea-scores-col-ap {
  width: 3rem;
}

.fmea-review-select {
  width: auto;
  display: inline-block;
}

.fmea-scores-table .form-control {
  padding: 0.15rem 0.2rem;
  text-align: center;
  font-size: 0.8125rem;
}

.fmea-node-mini-form {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.fmea-filter-select {
  max-width: 220px;
}

.fmea-advanced-filter-row {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}

.fmea-phase-add-row {
  max-width: 320px;
}

.fmea-phase-remove-btn {
  background: none;
  border: none;
  padding: 0 0 0 4px;
  color: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.fmea-phase-remove-btn:hover {
  opacity: 1;
}

.fmea-guide-tab {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
}

.fmea-field-error {
  font-size: 0.7rem;
  color: #dc3545;
}

.fmea-autoresize {
  resize: none;
  overflow-y: hidden;
}

.fmea-timestamp {
  font-size: 0.72rem;
  color: #6c757d;
}

.fmea-action-card {
  padding: 0.4rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #f8f9fa;
}

.fmea-action-update {
  padding: 0.3rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #f8f9fa;
}
