/* FMEA shares Q·FLOW's system font, global font scale and colour tokens. */
.fmea {
  --fmea-ink: var(--ink, #193a46);
  --fmea-muted: var(--muted, #6d8189);
  --fmea-accent: var(--teal, #157a80);
  --fmea-border: #dce7e9;
  --fmea-soft: #f3f8f8;
  color: var(--fmea-ink);
  font-family: var(--font-ui, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: calc(14px * var(--portal-font-scale, 1));
  min-width: 0;
  max-width: 2200px;
  margin: 0 auto;
  padding: 4px 0 28px;
}
.fmea * {
  box-sizing: border-box;
}
.fmea h2,
.fmea h3,
.fmea h4,
.fmea p {
  margin: 0;
}
.fmea h2 {
  font-size: 1.7em;
  letter-spacing: -0.035em;
  line-height: 1.5;
  font-weight: 750;
}
.fmea h3 {
  font-size: 1.13em;
}
.fmea h4 {
  font-size: 1em;
  margin: 14px 0 9px;
}
.fmea p {
  line-height: 1.65;
}
.fmea small {
  font-size: 0.78em;
}
.fmea button,
.fmea input,
.fmea select,
.fmea textarea {
  font-family: inherit;
  font-size: inherit;
}
.fmea button,
.fmea a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--fmea-border);
  border-radius: 7px;
  background: #fff;
  color: var(--fmea-ink);
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.fmea button:hover {
  background: #eff6f5;
  border-color: #a9cac8;
}
.fmea button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fmea button.primary,
.fmea a.primary {
  background: var(--fmea-accent);
  border-color: var(--fmea-accent);
  color: #fff;
}
.fmea button.danger {
  color: #ad4141;
  border-color: #e7c5c5;
  background: #fff8f7;
}
.fmea button:focus-visible,
.fmea input:focus-visible,
.fmea select:focus-visible,
.fmea textarea:focus-visible,
.fmea-node:focus-visible {
  outline: 3px solid #86c8cc;
  outline-offset: 2px;
}
.fmea button.active {
  background: #e4f1ef;
  border-color: #a5cbc5;
  color: #116b66;
}
.fmea button.fmea-link {
  border: 0;
  background: transparent;
  padding: 3px 5px;
  min-height: 25px;
  color: var(--fmea-accent);
  text-align: left;
  white-space: normal;
  justify-content: flex-start;
}
.fmea input:not([type="checkbox"]),
.fmea select,
.fmea textarea {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ceddde;
  border-radius: 6px;
  background: #fff;
  color: var(--fmea-ink);
  line-height: 1.45;
  box-shadow: none;
}
.fmea textarea {
  resize: vertical;
  min-height: 70px;
}
.fmea input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--fmea-accent);
  vertical-align: middle;
}
.fmea select[multiple] {
  min-height: 86px;
}
.fmea input:invalid,
.fmea textarea:invalid {
  border-color: #d87362;
}
.fmea input:disabled,
.fmea select:disabled,
.fmea textarea:disabled {
  background: #f5f7f7;
  color: #596f78;
  opacity: 1;
}
.fmea label {
  display: grid;
  gap: 6px;
  color: var(--fmea-ink);
  font-size: 0.9em;
  font-weight: 550;
  min-width: 0;
}
.fmea label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fmea-eyebrow {
  font-size: 0.72em;
  letter-spacing: 0.15em;
  font-weight: 750;
  color: var(--fmea-accent);
  margin-bottom: 6px;
}
.fmea-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 2px 24px;
}
.fmea-page-head p {
  font-size: 0.88em;
  color: var(--fmea-muted);
  margin-top: 6px;
}
.fmea-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.fmea-muted {
  color: var(--fmea-muted);
  font-size: 0.85em;
}
.fmea-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: #edf1f3;
  color: #637982;
  font-size: 0.78em;
  line-height: 1.5;
  white-space: nowrap;
}
.fmea-tag.H,
.fmea-tag.VOID {
  background: #fae9e5;
  color: #ae4e39;
}
.fmea-tag.M,
.fmea-tag.IN_REVIEW,
.fmea-tag.PENDING_VERIFICATION {
  background: #fff1d9;
  color: #946626;
}
.fmea-tag.L,
.fmea-tag.PUBLISHED,
.fmea-tag.CLOSED {
  background: #e3f1e9;
  color: #287353;
}
.fmea-tag.DRAFT {
  background: #e8eff6;
  color: #416b8b;
}
.fmea-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 15px;
  border: 1px solid var(--fmea-border);
  border-radius: 10px;
  margin-bottom: 17px;
}
.fmea-filters > label {
  flex: 1 1 130px;
}
.fmea-filters > label:first-child {
  flex: 1.5 1 190px;
}
.fmea-filters > details {
  font-size: 0.87em;
}
.fmea-filters > details[open] {
  flex-basis: 100%;
  order: 5;
}
.fmea summary {
  cursor: pointer;
  padding: 7px 0;
  color: var(--fmea-accent);
}
.fmea-panel {
  border: 1px solid var(--fmea-border);
  border-radius: 11px;
  background: #fff;
  padding: 20px;
  min-width: 0;
  margin-bottom: 16px;
}
.fmea-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 13px;
}
.fmea-toolbar > label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fmea-toolbar > label > select {
  width: auto;
}
.fmea-toolbar > b:first-child {
  margin-right: auto;
}
.fmea-toolbar > .fmea-muted {
  margin-right: auto;
}
.fmea-toolbar > input {
  width: 220px;
}
.fmea-table-wrap,
.fmea-grid-wrap {
  max-width: 100%;
  overflow: auto;
  scrollbar-color: #b9cecd #f1f6f6;
}
.fmea table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9em;
}
.fmea th {
  text-align: left;
  vertical-align: middle;
  padding: 11px 12px;
  background: #f0f6f6;
  border-top: 1px solid var(--fmea-border);
  border-bottom: 1px solid var(--fmea-border);
  color: #597179;
  font-weight: 650;
  white-space: nowrap;
}
.fmea th button {
  border: 0;
  background: transparent;
  min-height: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.fmea td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8eeee;
  vertical-align: top;
}
.fmea td small {
  display: block;
  color: var(--fmea-muted);
  margin-top: 4px;
}
.fmea tbody tr:hover > td {
  background: #f8fbfa;
}
.fmea-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 0 0;
  font-size: 0.85em;
}
.fmea-pagination > span:first-child {
  margin-right: auto;
}
.fmea-empty {
  min-height: 180px;
  padding: 30px 18px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--fmea-muted);
}
.fmea-empty > span {
  color: #8aa7a6;
  font-size: 2.8em;
  margin-bottom: 9px;
}
.fmea-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}
.fmea button.fmea-metric {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 18px 17px;
  min-height: 137px;
  border-top: 3px solid #31918a;
  white-space: normal;
}
.fmea-metric > span {
  font-size: 0.85em;
  color: #5e767e;
}
.fmea-metric strong {
  font-size: 2.25em;
  font-weight: 700;
  letter-spacing: -0.05em;
}
.fmea-metric small {
  color: var(--fmea-muted);
  font-weight: 450;
  margin-top: 2px;
}
.fmea button.fmea-metric.warm {
  border-top-color: #c98b5b;
}
.fmea-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 18px;
}
.fmea-insight-grid h3 {
  margin-bottom: 9px;
}
.fmea-bar {
  display: grid;
  grid-template-columns: 58px 1fr 45px;
  gap: 15px;
  align-items: center;
  margin: 20px 0;
}
.fmea-bar i {
  height: 12px;
  position: relative;
  background: #edf3f2;
  border-radius: 2px;
  overflow: hidden;
}
.fmea-bar i:after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fmea-bar, 0%);
  background: #4b9e98;
  border-radius: 2px;
}
.fmea-attention {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #e7eeee;
}
.fmea-attention small {
  display: block;
  margin-top: 4px;
  color: var(--fmea-muted);
}
.fmea-summary-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.fmea-summary-data article {
  background: var(--fmea-soft);
  padding: 12px;
  border-radius: 7px;
}
.fmea-summary-data p {
  margin-top: 8px;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.fmea-work-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 13px 18px 16px;
  background: #fff;
  border: 1px solid var(--fmea-border);
  border-radius: 11px 11px 0 0;
}
.fmea-work-head h2 {
  font-size: 1.35em;
  display: flex;
  align-items: center;
  gap: 11px;
}
.fmea-work-head .fmea-eyebrow {
  margin-top: 7px;
  font-size: 0.68em;
}
.fmea-save {
  font-size: 0.78em;
  color: #458379;
  margin-top: 6px;
}
.fmea-save.error {
  color: #b3523d;
}
.fmea-banner {
  padding: 13px 17px;
  background: #fff7e7;
  border: 1px solid #e9d8b9;
  border-radius: 6px;
  color: #8a642d;
  margin: 12px 0;
  font-size: 0.9em;
}
.fmea-banner.error,
.fmea-form-error,
.fmea-page-error {
  padding: 13px;
  background: #fff0ec;
  color: #a24632;
  border: 1px solid #ebc8bf;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 0.9em;
}
.fmea-view-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--fmea-border);
  border-top: 0;
  margin-bottom: 17px;
}
.fmea-view-tabs > button {
  border: 0;
  background: transparent;
}
.fmea-view-tabs > .fmea-muted {
  margin-left: auto;
}
.fmea-work-layout {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.fmea-steps {
  display: grid;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--fmea-border);
  border-radius: 9px;
  padding: 10px;
}
.fmea-steps button {
  justify-content: flex-start;
  text-align: left;
  border: 0;
  background: transparent;
  gap: 13px;
  padding: 14px 12px;
  min-height: 66px;
}
.fmea-steps button b {
  font-size: 1.25em;
  color: #9db2b6;
  font-weight: 550;
}
.fmea-steps button.active b {
  color: var(--fmea-accent);
}
.fmea-steps button span {
  display: grid;
  gap: 5px;
}
.fmea-steps button small {
  color: #7f9298;
  font-size: 0.7em;
  font-weight: 450;
}
.fmea-step-content {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--fmea-border);
  border-radius: 10px;
  padding: 24px;
}
.fmea-step-content > h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.fmea-step-content > h3 small {
  font-size: 0.67em;
  letter-spacing: 0.1em;
  color: var(--fmea-accent);
  font-weight: 600;
}
.fmea-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
}
.fmea-wide {
  grid-column: span 3;
}
.fmea-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 14px;
}
.fmea-subtabs button {
  font-size: 0.85em;
}
.fmea-subtabs small {
  color: #6d8e93;
  font-weight: 400;
}
.fmea-grid-wrap {
  max-height: 62vh;
  min-height: 230px;
  border: 1px solid var(--fmea-border);
  border-radius: 7px;
}
.fmea-grid {
  table-layout: fixed;
  width: max-content !important;
  min-width: 100%;
}
.fmea-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 150px;
}
.fmea-grid td {
  padding: 0 !important;
  min-width: 150px;
  width: 175px;
  vertical-align: top;
  border-right: 1px solid #e3ebeb;
}
.fmea-grid td:has(select[multiple]),
.fmea-grid td:has(textarea) {
  min-width: 230px;
  width: 230px;
}
.fmea-grid td > .fmea-tag {
  margin: 12px;
}
.fmea-grid input:not([type="checkbox"]),
.fmea-grid select,
.fmea-grid textarea {
  border: 0;
  border-radius: 0;
  min-height: 58px;
  padding: 9px;
  background: transparent;
}
.fmea-grid textarea {
  min-height: 70px;
  height: 70px;
  resize: vertical;
}
.fmea-grid td:focus-within {
  box-shadow: inset 0 0 0 2px #499d98;
}
.fmea-grid .fmea-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f6faf9;
  min-width: 145px;
  width: 145px;
  padding: 10px !important;
}
.fmea-grid th.fmea-sticky {
  z-index: 4;
}
.fmea-grid .fmea-sticky small {
  font-size: 0.67em;
}
.fmea-grid .fmea-sticky button {
  font-size: 0.8em;
}
.fmea-graph-viewport {
  height: 60vh;
  min-height: 380px;
  overflow: auto;
  border: 1px solid var(--fmea-border);
  border-radius: 10px;
  background-color: #f8fbfa;
  background-image: radial-gradient(#d4e4e2 1px, transparent 1px);
  background-size: 20px 20px;
  cursor: grab;
  touch-action: none;
}
.fmea-graph-viewport:active {
  cursor: grabbing;
}
.fmea-graph-viewport:fullscreen {
  height: 100vh;
  background-color: #f8fbfa;
}
.fmea-graph-canvas {
  transform-origin: 0 0;
}
.fmea-graph-svg {
  max-width: none;
  display: block;
}
.fmea-edge {
  fill: none;
  stroke: #87a3ae;
  stroke-width: 1.5;
}
.fmea-graph-svg text {
  font-family: inherit;
  font-size: 13px;
  fill: #244c59;
}
.fmea-node {
  cursor: pointer;
}
.fmea-node rect {
  fill: #fff;
  stroke: #b8cecf;
  stroke-width: 1.2;
}
.fmea-node:hover rect,
.fmea-node.selected rect {
  fill: #e7f4ef;
  stroke: #368c82;
  stroke-width: 2;
}
.fmea-graph-svg .fmea-node-caption {
  font-size: 10px;
  fill: #7a929a;
}
.fmea-event {
  border-left: 2px solid #a6ccc6;
  padding: 8px 14px;
  margin: 14px 0;
}
.fmea-event > small {
  display: block;
  margin: 5px 0;
  color: var(--fmea-muted);
}
.fmea-event > p {
  font-size: 0.9em;
  white-space: pre-wrap;
}
.fmea-config-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.fmea button.fmea-config-card {
  display: block;
  text-align: left;
  padding: 22px;
  white-space: normal;
  min-height: 180px;
}
.fmea-config-card > div {
  display: flex;
  justify-content: space-between;
}
.fmea-config-card h3 {
  margin: 17px 0 8px;
}
.fmea-config-card p,
.fmea-config-card small {
  font-weight: 450;
  color: var(--fmea-muted);
  display: block;
  margin: 8px 0;
}
.fmea-config-editor {
  padding: 0;
  border: 0;
  min-width: 0;
}
.fmea-config-editor table input {
  min-width: 80px;
}
.fmea-config-editor table td {
  padding: 6px;
}
.fmea-config-editor table input[type="checkbox"] {
  min-width: 0;
}
.fmea-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.fmea-score-row {
  display: grid !important;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  margin: 9px 0;
}
.fmea-score-row b {
  font-size: 1.1em;
  font-weight: 650;
  color: #7a979c;
}
.fmea-dialog {
  color: var(--fmea-ink);
  border: 1px solid #cedfde;
  border-radius: 13px;
  padding: 24px;
  max-height: 88vh;
  width: min(780px, 88vw);
  max-width: 1200px;
  overflow: auto;
  box-shadow: 0 20px 80px #163d4840;
  font-size: inherit;
}
.fmea-dialog.wide {
  width: min(1160px, 92vw);
}
.fmea-dialog::backdrop {
  background: #153c4a55;
  backdrop-filter: blur(2px);
}
.fmea-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.fmea-dialog-head h3 {
  font-size: 1.25em;
}
.fmea button.fmea-close {
  border: 0;
  font-size: 1.5em;
  font-weight: 400;
  min-width: 36px;
  padding: 0;
}
.fmea-dialog .fmea-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fmea-dialog .fmea-wide {
  grid-column: span 2;
}
.fmea-dialog p {
  margin: 12px 0;
}
.fmea-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: -24px;
  background: #fff;
  padding: 18px 0 5px;
  margin-top: 20px;
  border-top: 1px solid var(--fmea-border);
}
.fmea-dialog .fmea-table-wrap {
  max-height: 48vh;
}
.fmea-dialog td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 360px;
}
.fmea-lifecycle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 0;
}
.fmea-job {
  display: grid;
  gap: 12px;
  padding: 20px 0;
}
.fmea-job progress {
  width: 100%;
  accent-color: var(--fmea-accent);
}
.fmea-preview-rows {
  max-height: 30vh !important;
}
.fmea fieldset:disabled button {
  pointer-events: none;
}
@media (min-width: 1700px) {
  .fmea-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .fmea-wide {
    grid-column: span 2;
  }
  .fmea-work-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .fmea-step-content {
    padding: 28px;
  }
}
@media (max-width: 1400px) {
  .fmea-page-head {
    align-items: flex-start;
  }
  .fmea-page-head h2 {
    font-size: 1.5em;
  }
  .fmea-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fmea button.fmea-metric {
    min-height: 108px;
    padding: 14px;
  }
  .fmea-metric strong {
    font-size: 1.8em;
  }
  .fmea-work-layout {
    grid-template-columns: 175px minmax(0, 1fr);
    gap: 13px;
  }
  .fmea-steps {
    padding: 6px;
  }
  .fmea-steps button {
    gap: 9px;
    padding: 12px 8px;
  }
  .fmea-step-content {
    padding: 18px;
  }
  .fmea-work-head {
    align-items: flex-start;
  }
  .fmea-work-head > .fmea-actions {
    max-width: 410px;
    justify-content: flex-end;
  }
  .fmea-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fmea-wide {
    grid-column: span 2;
  }
  .fmea-view-tabs > .fmea-muted {
    font-size: 0.73em;
  }
  .fmea-config-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fmea-summary-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .fmea * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.fmea-scoring-guide {
  padding: 0 0 12px;
  font-size: 0.88em;
}
.fmea-scoring-guide[open] {
  padding: 12px;
  background: #f4f9f8;
  margin-bottom: 12px;
  border-radius: 7px;
}
.fmea-scoring-guide section p {
  padding: 8px 0;
  border-bottom: 1px solid var(--fmea-border);
}
.fmea-revoked {
  display: block;
  color: #a64e40;
  font-size: 0.85em;
}

/* Full business FMEA table: a bounded horizontal report, never page-wide overflow. */
.fmea-main-report {
  min-width: 0;
}
.fmea-main-summary {
  border: 1px solid var(--line, #d6e0e4);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--surface, #fff);
  margin: 12px 0;
}
.fmea-main-summary h3 {
  margin: 0;
}
.fmea-main-summary dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 8px 0 0;
}
.fmea-main-summary dl div {
  min-width: 0;
}
.fmea-main-summary dt {
  color: #667a82;
  font-size: 0.84em;
}
.fmea-main-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.fmea-main-scroll {
  max-width: 100%;
  overflow: auto;
  max-height: 68vh;
  min-height: 210px;
  border: 1px solid #c7d6dc;
  border-radius: 9px;
  background: #fff;
}
.fmea .fmea-main-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.87em;
}
.fmea-main-table caption {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: #2b5360;
}
.fmea .fmea-main-table th,
.fmea .fmea-main-table td {
  min-width: 180px;
  width: 180px;
  max-width: 220px;
  padding: 7px;
  vertical-align: top;
  border-right: 1px solid #d5e0e5;
  border-bottom: 1px solid #d5e0e5;
  white-space: normal;
}
.fmea .fmea-main-table thead th {
  position: sticky;
  height: 36px;
  padding: 8px 7px;
  top: 0;
  z-index: 3;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  background: #eaf2f5;
  line-height: 20px;
  color: #204b5b;
}
.fmea .fmea-main-table thead tr:nth-child(2) th {
  top: 36px;
  background: #f2f6f8;
}
.fmea .fmea-main-table thead tr:nth-child(3) th {
  top: 72px;
  background: #f8fafb;
}
.fmea .fmea-main-table .fmea-main-index {
  min-width: 120px;
  width: 120px;
  max-width: 120px;
  left: 0;
  position: sticky;
  z-index: 2;
  background: #f3f7f8;
}
.fmea .fmea-main-table thead .fmea-main-index {
  z-index: 5;
}
.fmea-main-index small,
.fmea-main-index button {
  display: block;
  margin-top: 5px;
}
.fmea .fmea-main-table .fmea-main-score {
  min-width: 65px;
  width: 65px;
  max-width: 80px;
  text-align: center;
}
.fmea-main-table td textarea {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  max-height: 180px;
  resize: vertical;
  line-height: 1.5;
}
.fmea-main-table td input {
  width: 100%;
  min-width: 0;
}
.fmea-main-static,
.fmea-main-multiple {
  display: block;
  white-space: pre-wrap;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.fmea-main-expand {
  width: 100%;
  text-align: left;
  white-space: normal;
  min-height: 70px;
  background: #f7fafb;
}
.fmea-main-expand small {
  display: block;
  margin-top: 7px;
  color: #537780;
}
.fmea-reference {
  display: block;
  min-width: 0;
}
.fmea-reference > button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  text-align: left;
  white-space: normal;
  min-height: 34px;
}
.fmea-reference > button span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.fmea-reference-picker {
  position: fixed;
  z-index: 150;
  right: 28px;
  top: 10vh;
  width: min(540px, calc(100vw - 60px));
  max-height: 80vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid #92aeb9;
  border-radius: 12px;
  box-shadow: 0 18px 60px #15364240;
  background: #fff;
}
.fmea-reference-picker header,
.fmea-reference-picker footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.fmea-reference-picker h3 {
  margin: 0;
}
.fmea-reference-picker label {
  display: grid;
  gap: 6px;
}
.fmea-reference-picker footer {
  margin-top: 14px;
  margin-bottom: 0;
}
.fmea-reference-options {
  display: grid;
  gap: 4px;
  max-height: 38vh;
  overflow: auto;
  margin-top: 10px;
}
.fmea-reference-options button {
  display: flex;
  justify-content: space-between;
  text-align: left;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
}
.fmea-reference-options button small {
  color: #687c85;
}
.fmea-reference-options .selected {
  background: #e4f3ef;
  border-color: #438f81;
}
.fmea-reference-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 100px;
  overflow: auto;
}
.fmea-reference-selected button {
  font-size: 0.86em;
}
@media (max-width: 1440px) {
  .fmea-main-summary dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fmea-main-scroll {
    max-height: 62vh;
  }
}
.fmea-node-status {
  fill: #526f78;
  font-size: 11px;
}

/* Keep the analysis itself in the first desktop screen, including large type. */
.fmea-work-chrome {
  position: sticky;
  top: 68px;
  z-index: 6;
  background: #fff;
  margin-bottom: 8px;
}
.fmea-work-chrome .fmea-work-head {
  position: static;
  padding: 8px 12px;
  gap: 12px;
}
.fmea-work-heading {
  min-width: 0;
  flex: 1;
}
.fmea-work-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.fmea-work-meta .fmea-eyebrow,
.fmea-work-meta .fmea-save {
  margin: 0;
}
.fmea-work-meta > button {
  min-height: 26px;
  padding: 2px 0;
}
.fmea-work-head h2 {
  font-size: 1.1em;
  line-height: 1.4;
  margin: 3px 0 0;
}
.fmea-work-chrome .fmea-view-tabs {
  margin: 0;
  padding: 5px 8px;
  flex-wrap: wrap;
}
.fmea-work-chrome .fmea-view-tabs > button {
  padding: 5px 9px;
  min-height: 30px;
}
.fmea-main-context {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--fmea-border);
  background: #fff;
  margin: 0 0 8px;
  padding: 5px 10px;
  border-radius: 6px;
}
.fmea-main-background {
  flex: 1;
  min-width: 0;
}
.fmea-main-background > summary {
  display: flex;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  min-height: 32px;
  list-style: none;
}
.fmea-context-item {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 35%;
  font-size: 0.9em;
}
.fmea-context-item b {
  color: var(--fmea-muted);
  font-weight: 500;
  margin-right: 4px;
}
.fmea-background-toggle {
  color: var(--fmea-accent);
  font-size: 0.85em;
  white-space: nowrap;
  margin-left: auto;
}
.fmea-background-toggle::before {
  content: "▸ ";
}
.fmea-main-background[open] .fmea-background-toggle::before {
  content: "▾ ";
}
.fmea-main-background dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 10px 0;
}
.fmea-main-background dt {
  color: var(--fmea-muted);
  font-size: 0.85em;
}
.fmea-main-background dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.fmea-main-tools {
  gap: 6px;
  padding-bottom: 8px;
}
.fmea .fmea-main-tools > input {
  width: 220px;
  min-width: 160px;
  flex: 1 1 200px;
}
.fmea-main-tools > .fmea-muted {
  font-size: 0.82em;
  margin-right: 0;
}
.fmea-main-tools > button {
  padding: 5px 9px;
}
.fmea-main-report > .fmea-scoring-guide {
  padding: 5px 0;
}
.fmea .fmea-main-table thead th {
  background: #e9eded;
  color: #294c4a;
  height: 36px;
  padding: 7px;
}
.fmea .fmea-main-table thead tr:nth-child(2) th {
  background: #f7f8f8;
  top: 36px;
  white-space: normal;
  height: 54px;
}
.fmea .fmea-main-table .fmea-main-index {
  background: #f7f9f9;
}
.fmea-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1440px) {
  .fmea-work-chrome .fmea-work-head > .fmea-actions {
    max-width: 360px;
    gap: 5px;
  }
  .fmea-work-chrome .fmea-work-head > .fmea-actions button {
    padding: 5px 8px;
  }
  .fmea-main-background dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fmea-work-chrome .fmea-view-tabs > .fmea-muted {
    margin-left: 0;
  }
}
.fmea-wb-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0;
}
.fmea-wb-progress button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  text-align: left;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #dfe4e8);
  min-width: 0;
}
.fmea-wb-progress button > b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #edf2f5;
  color: #294859;
  flex: none;
  font-size: 12px;
}
.fmea-wb-progress span {
  font-weight: 600;
  font-size: 0.85em;
}
.fmea-wb-progress small {
  display: block;
  color: #697780;
  font-size: 0.85em;
  font-weight: 400;
  margin-top: 3px;
}
.fmea-wb-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  max-width: 1720px;
  margin: 0 auto;
}
.fmea-wb-tree {
  position: sticky;
  top: 192px;
  border: 1px solid #dfe4e8;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}
.fmea-wb-tree > header,
.fmea-wb-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fmea-wb-tree h3 {
  margin: 4px 0 12px;
  font-size: 1em;
}
.fmea-wb-tree > input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85em;
}
.fmea-wb-tree-list {
  max-height: 55vh;
  overflow: auto;
  margin: 12px -4px;
}
.fmea-wb-tree-list > button {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 10px;
  margin: 3px 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.fmea-wb-tree-list > button small {
  display: block;
  margin-top: 4px;
  color: #6b7983;
  font-size: 0.8em;
}
.fmea-wb-tree-list > button.active {
  background: #eaf1f6;
  color: #123f59;
  box-shadow: inset 3px 0 #315c73;
}
.fmea-wb-tree > .fmea-muted {
  font-size: 0.8em;
  line-height: 1.6;
}
.fmea-wb-content {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.fmea-wb-section {
  border: 1px solid #dce2e6;
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  scroll-margin-top: 210px;
  min-width: 0;
}
.fmea-wb-section > header {
  border-bottom: 1px solid #e5e9ec;
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fmea-wb-section h3 {
  margin: 0;
  font-size: 1.07em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.fmea-wb-section h3 > span {
  font-size: 0.75em;
  font-weight: 500;
  color: #72818b;
}
.fmea-wb-section > summary {
  font-weight: 600;
  cursor: pointer;
}
.fmea-wb-section > summary > span {
  font-weight: 400;
  color: #6b7983;
  margin-left: 12px;
  font-size: 0.85em;
}
.fmea-wb-section[open] > summary {
  margin-bottom: 18px;
}
.fmea-wb-object {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 8px;
}
.fmea-wb-object > strong {
  margin-right: auto;
}
.fmea-wb-select {
  flex: 1;
  min-width: 180px;
  max-width: 650px;
  font-size: 0.85em;
}
.fmea-wb-select > select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.fmea-wb-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.fmea-wb-two .fmea-wide {
  grid-column: auto;
}
.fmea-wb-chain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.fmea-wb-chain > article {
  padding: 12px;
  border: 1px solid #dfe5e9;
  border-top: 3px solid #a6b9c5;
  border-radius: 5px;
  min-width: 0;
}
.fmea-wb-chain > article:nth-child(2) {
  border-top-color: #356279;
  background: #f6f9fb;
}
.fmea-wb-chain h4,
.fmea-wb-control h4 {
  font-size: 0.9em;
  margin: 0 0 10px;
  color: #355469;
}
.fmea-wb-context {
  color: #6b7983;
  font-size: 0.85em;
  line-height: 1.7;
  min-height: 54px;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.fmea-wb-context strong {
  color: #344e5c;
  font-weight: 500;
}
.fmea-wb-context small {
  display: block;
  max-height: 4em;
  overflow: auto;
}
.fmea-wb-section label {
  display: block;
  min-width: 0;
}
.fmea-wb-section label > span {
  display: block;
  font-size: 0.85em;
  color: #5b6c76;
  margin-bottom: 6px;
}
.fmea-wb-section textarea,
.fmea-wb-section input:not([type="checkbox"]),
.fmea-wb-section select {
  width: 100%;
  box-sizing: border-box;
}
.fmea-wb-section textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.6;
}
.fmea-wb-control {
  padding: 14px;
  background: #f7f9fa;
  border-radius: 6px;
}
.fmea-wb-control label {
  margin-bottom: 10px;
}
.fmea-wb-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(85px, 1fr)) minmax(110px, 1fr);
  gap: 14px;
  margin: 20px 0 14px;
  align-items: start;
}
.fmea-wb-scores > div {
  border-left: 1px solid #dfe5e9;
  padding-left: 16px;
}
.fmea-wb-scores > div > b,
.fmea-wb-scores > div > small {
  display: block;
  font-size: 0.8em;
  color: #657681;
  margin-bottom: 7px;
}
.fmea-wb-scores > div > small {
  margin-top: 8px;
}
.fmea-wb-actions article {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #e8ecef;
}
.fmea-wb-actions article > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.fmea-wb-actions p {
  font-size: 0.85em;
  margin: 7px 0;
}
.fmea-wb-after {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #dfe4e8;
}
.fmea-wb-after > summary {
  cursor: pointer;
  font-weight: 600;
}
.fmea-chain-endpoint {
  border: 1px solid #dce3e7;
  border-radius: 8px;
  margin: 16px 0;
  padding: 14px;
}
.fmea-chain-endpoint legend {
  color: #355469;
  padding: 0 8px;
  font-weight: 600;
}
.fmea-chain-endpoint details {
  margin-top: 12px;
}
.fmea-chain-endpoint summary {
  font-size: 0.9em;
  cursor: pointer;
}
@media (max-width: 1400px) {
  .fmea-wb-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
  }
  .fmea-wb-progress button {
    gap: 5px;
    padding: 8px 5px;
  }
  .fmea-wb-progress button > b {
    width: 21px;
    height: 21px;
  }
  .fmea-wb-section {
    padding: 14px;
  }
  .fmea-wb-chain {
    gap: 8px;
  }
  .fmea-wb-chain > article {
    padding: 9px;
  }
}

.fmea-analysis-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; margin:12px 0; }
.fmea-analysis-table th,.fmea-analysis-table td { padding:9px 12px; border-bottom:1px solid var(--fmea-border,#dce7e7); text-align:left; overflow-wrap:anywhere; }
.fmea-analysis-table thead,.fmea-analysis-table tfoot { background:var(--fmea-soft,#f0f7f7); }
.fmea-analysis-table tbody tr:nth-child(even) { background:#fafcfc; }
