/* 6.13 Funktionsketten: list page, the chain as a band, the one editor, sorting of the
   existing effect chains. Reuses the rows and states of functional_paths.css and
   signal_paths.css. */
.fc-page {
  padding-bottom: var(--scs-space-5);
}
.fc-summary {
  display: block;
  color: var(--scs-ink-2);
  font-size: var(--scs-text-xs);
  line-height: 1.5;
}
/* Own widths instead of the column plan of the requirements list: ID, name (takes the rest),
   level, steps, state, criticality, relations, actions. */
.requirements-table.function-chain-table th:nth-child(1) {
  width: 104px;
}
.requirements-table.function-chain-table th:nth-child(2) {
  width: auto;
}
.requirements-table.function-chain-table th:nth-child(3) {
  width: 110px;
}
.requirements-table.function-chain-table th:nth-child(4) {
  width: 84px;
}
.requirements-table.function-chain-table th:nth-child(5) {
  width: 130px;
}
.requirements-table.function-chain-table th:nth-child(6) {
  width: 150px;
}
.requirements-table.function-chain-table th:nth-child(7) {
  width: 110px;
}
.requirements-table.function-chain-table th:nth-child(8) {
  width: 124px;
}
.fc-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fc-title strong {
  font-weight: 600;
}
.fc-title + .fc-summary {
  margin: 3px 0 0 25px;
}
.requirements-table.fc-sorting-table th:nth-child(1) {
  width: 26%;
}
.requirements-table.fc-sorting-table th:nth-child(2) {
  width: auto;
}
.requirements-table.fc-sorting-table th:nth-child(3) {
  width: 170px;
}
.requirements-table.fc-sorting-table th:nth-child(4) {
  width: 330px;
}
.fc-row-actions {
  white-space: nowrap;
  text-align: right;
}
.fc-row-actions button {
  font-size: var(--scs-text-xs);
  padding: 5px 10px;
  min-height: 30px;
  margin-left: 4px;
}

/* The chain as a band: numbered steps, arrows that say what is handed over and over what. */
.fc-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
}
.fc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--scs-line-strong);
  border-radius: var(--scs-radius-l);
  padding: 5px 12px 5px 6px;
  background: var(--scs-surface);
  min-width: 0;
}
.fc-chip b {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: var(--scs-text-xs);
  font-weight: 600;
  color: var(--scs-accent);
  background: var(--scs-accent-soft);
}
.fc-chip strong,
.fc-chip small {
  display: block;
  line-height: 1.35;
}
.fc-chip strong {
  font-size: var(--scs-text-s);
  font-weight: 600;
}
.fc-chip small {
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
/* The system of a step: its icon, or the short form of its name. */
.fc-face {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
}
.fc-face img {
  width: 24px;
  height: 24px;
}
.fc-face-short {
  padding: 0 5px;
  border: 1.5px solid var(--scs-line-strong);
  border-radius: var(--scs-radius-s, 6px);
  font-size: var(--scs-text-xs);
  font-weight: 600;
  color: var(--scs-ink-2);
}
/* Trigger and result close the flow picture at both ends. */
.fc-end {
  display: inline-flex;
  flex-direction: column;
  max-width: 240px;
  padding: 5px 14px;
  border: 1px solid var(--scs-accent-line);
  border-radius: 18px;
  background: var(--scs-accent-soft);
}
.fc-end small {
  font-size: var(--scs-text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--scs-accent);
}
.fc-end strong {
  font-size: var(--scs-text-s);
  font-weight: 500;
  line-height: 1.35;
}
.fc-arrow-plain {
  min-width: 34px;
}
.fc-chip-open {
  border-style: dashed;
  border-color: var(--scs-warn-line);
}
.fc-chip-detached {
  border-color: var(--scs-danger-line);
}
.fc-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}
.fc-arrow {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}
.fc-arrow::after {
  content: '';
  display: block;
  width: 100%;
  height: 10px;
  background: var(--scs-accent);
  clip-path: polygon(
    0 4px,
    calc(100% - 9px) 4px,
    calc(100% - 9px) 0,
    100% 5px,
    calc(100% - 9px) 10px,
    calc(100% - 9px) 6px,
    0 6px
  );
}
.fc-arrow-open::after {
  background: var(--scs-warn);
}
.fc-arrow small {
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-3);
  line-height: 1.4;
  white-space: nowrap;
  padding: 0 6px;
}
.fc-gap {
  width: 28px;
  margin: 0 6px;
  border-top: 2px dashed var(--scs-danger-line);
}
.fc-effect {
  margin-top: 2px;
}
.fc-effect .sp-arrow {
  min-width: 34px;
}

/* Sorting of the effect chains a project already has. */
.fc-sorting {
  margin: var(--scs-space-5) var(--scs-space-4) 0;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-l);
  background: var(--scs-surface);
}
.fc-sorting > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: var(--scs-text-m);
  font-weight: 600;
}
.fc-sorting > p,
.fc-sorting > .fc-transfer {
  margin: 0 14px 12px;
}
.fc-sorting .model-table-scroll {
  margin: 0 14px 12px;
}
.fc-sorting > p:last-child {
  margin-bottom: 14px;
}
.fc-sorting-table td {
  vertical-align: top;
}
.fc-class {
  display: inline-block;
  font-size: var(--scs-text-xs);
  border: 1px solid var(--scs-line);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.fc-class-signal,
.fc-class-signals {
  color: var(--scs-accent);
  border-color: var(--scs-accent-line);
  background: var(--scs-accent-soft);
}
.fc-class-processing {
  color: var(--scs-ok);
  border-color: var(--scs-ok-line);
  background: var(--scs-ok-soft);
}
.fc-class-open {
  color: var(--scs-warn);
  border-color: var(--scs-warn-line);
  background: var(--scs-warn-soft);
}
.fc-class-selection {
  color: var(--scs-ink-2);
  background: var(--scs-surface-2);
}
.fc-reason,
.fc-covered {
  display: block;
  margin-top: 4px;
  font-size: var(--scs-text-xs);
  line-height: 1.5;
  color: var(--scs-ink-2);
}
.fc-covered {
  color: var(--scs-ok);
}
.fc-linked {
  font-family: var(--scs-font-mono);
  font-size: var(--scs-text-xs);
}
.fc-transfer {
  border: 1px solid var(--scs-accent-line);
  background: var(--scs-accent-soft);
  border-radius: var(--scs-radius-m);
  padding: 10px 14px;
}
.fc-transfer h4 {
  margin: 0 0 4px;
  font-size: var(--scs-text-s);
}
.fc-transfer .fp-check {
  align-items: flex-start;
  padding: 4px 0;
}
.fc-transfer .fp-check strong,
.fc-transfer .fp-check small {
  display: block;
}
.fc-transfer .fp-check small {
  color: var(--scs-ink-2);
}
.fc-preview-item {
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-m);
  padding: 10px 12px;
  margin-top: 10px;
}
.fc-preview-item h4 {
  margin: 0 0 8px;
  font-size: var(--scs-text-s);
}
.fc-preview-item > small {
  display: block;
  margin-top: 8px;
  color: var(--scs-ink-2);
}

/* The one editor. */
dialog.fc-dialog {
  width: min(1240px, 96vw);
}
.fc-dialog #dialog-body {
  max-height: calc(90vh - 150px);
}
.fc-head {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px 16px;
}
.fc-head .field {
  grid-column: span 3;
}
.fc-head .fc-name {
  grid-column: span 5;
}
.fc-head .sp-colour {
  grid-column: span 1;
}
.fc-head .sp-colour input {
  height: 38px;
  padding: 3px;
}
.fc-head .fc-purpose {
  grid-column: span 6;
}
.fc-properties {
  margin: 4px 0 6px;
}
.fc-properties > summary {
  cursor: pointer;
  font-size: var(--scs-text-s);
  color: var(--scs-ink-2);
  padding: 4px 0;
}
.fc-properties .fc-head .field {
  grid-column: span 2;
}
.fc-columns {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(300px, 1fr);
  gap: 22px;
  margin-top: 10px;
  border-top: 1px solid var(--scs-line);
  padding-top: 12px;
}
.fc-columns h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: var(--scs-text-m);
}
.fc-columns h4 {
  margin: 14px 0 6px;
  font-size: var(--scs-text-xs);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--scs-ink-2);
}
.fc-steps-column,
.fc-preview-column {
  min-width: 0;
}
/* The preview stays in sight while the steps scroll. */
.fc-preview-column {
  position: sticky;
  top: 0;
  align-self: start;
}
.fc-step {
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-l);
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--scs-surface);
}
.fc-step-detached {
  border-color: var(--scs-danger-line);
}
.fc-step-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fc-step-line select {
  flex: 1 1 140px;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 6px 8px;
}
.fc-step-line > span:not(.fc-step-tools) {
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
.fc-step-no {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: var(--scs-text-xs);
  color: var(--scs-accent);
  background: var(--scs-accent-soft);
}
.fc-step-tools {
  flex: none;
  display: inline-flex;
  gap: 4px;
}
.fc-step-tools button,
.fc-exchange button {
  font-size: var(--scs-text-xs);
  padding: 4px 8px;
  min-height: 30px;
}
.fc-step-tools .fp-remove,
.fc-exchange .fp-remove {
  font-size: 18px;
  line-height: 1;
}
.fc-exchange {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0 0 32px;
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
.fc-exchange-arrow {
  color: var(--scs-accent);
  font-size: var(--scs-text-m);
}
.fc-exchange input {
  flex: 1 1 80px;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 5px 8px;
}
.fc-exchange select {
  flex: 0 1 180px;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 5px 8px;
}
.fc-exchange select[data-fc-to] {
  flex: none;
  width: 58px;
}
.fc-hint {
  display: block;
  flex-basis: 100%;
  margin-top: 5px;
  font-size: var(--scs-text-xs);
  line-height: 1.5;
  color: var(--scs-warn);
}
.fc-step > .fc-hint {
  margin-left: 32px;
}
.fc-offer {
  font-size: var(--scs-text-xs);
  padding: 2px 9px;
  min-height: 24px;
  margin: 0 4px 2px 0;
  border-radius: 999px;
}
.fc-picker {
  border: 1px solid var(--scs-accent-line);
  border-radius: var(--scs-radius-l);
  padding: 10px 12px;
  background: var(--scs-surface);
}
.fc-picker-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.fc-picker-head strong {
  font-size: var(--scs-text-s);
  white-space: nowrap;
}
.fc-picker-head input {
  flex: 1;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 5px 8px;
}
.fc-picker-head button {
  font-size: var(--scs-text-xs);
  padding: 5px 10px;
  min-height: 30px;
}
.fc-pick-list {
  max-height: 250px;
  overflow: auto;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-m);
}
.fc-pick-list h4 {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 5px 11px;
  background: var(--scs-surface-2);
  border-bottom: 1px solid var(--scs-line);
}
.fc-pick-list .fp-note {
  margin: 0;
  padding: 8px 11px;
}
.fc-pick {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--scs-line);
  border-radius: 0;
  background: transparent;
  padding: 6px 11px;
  min-height: 40px;
  cursor: pointer;
}
.fc-pick:hover,
.fc-pick:focus-visible {
  background: var(--scs-accent-soft);
}
.fc-pick strong,
.fc-pick small {
  display: block;
  font-weight: 400;
  line-height: 1.4;
}
.fc-pick strong {
  font-size: var(--scs-text-s);
  color: var(--scs-ink);
}
.fc-pick small {
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
.fc-new-function {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.fc-new-function input {
  flex: 1 1 180px;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 6px 8px;
}
.fc-new-function button {
  font-size: var(--scs-text-xs);
  padding: 6px 10px;
  min-height: 32px;
}
.fc-question {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 8px 0;
  border: 1px solid var(--scs-warn-line);
  background: var(--scs-warn-soft);
  border-radius: var(--scs-radius-m);
  padding: 8px 12px;
  font-size: var(--scs-text-s);
}
.fc-question > span {
  flex: 1 1 320px;
}
.fc-question button {
  font-size: var(--scs-text-xs);
  padding: 5px 10px;
  min-height: 30px;
}
.fc-start {
  margin: 8px 0;
}
.fc-level {
  font-size: var(--scs-text-xs);
  font-weight: 400;
  color: var(--scs-ink-2);
  border: 1px solid var(--scs-line);
  border-radius: 999px;
  padding: 2px 9px;
}
.fc-along {
  margin: 12px 0 0;
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
.fc-note-list {
  margin: 12px 0 4px;
  padding-left: 18px;
  font-size: var(--scs-text-xs);
  line-height: 1.6;
  color: var(--scs-warn);
}
.fc-preview-column .fp-check {
  margin-top: 14px;
}
.fc-effect-note {
  margin: 10px 0 0;
}

/* Object pages. */
.object-lead {
  display: grid;
  gap: var(--scs-space-4);
  padding: var(--scs-space-4) var(--scs-space-4) 0;
}
.fc-step-table td,
.fc-object-table td {
  vertical-align: top;
}
.fc-step-table td:first-child {
  width: 52px;
  color: var(--scs-ink-2);
}
.fc-step-table .fc-hint {
  margin-top: 0;
}
.fc-object-table .sp-id {
  margin-right: 6px;
}

/* Zeitanteile: a short field per step and exchange, the sum against the budget in the preview. */
.fc-steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--scs-space-3);
}
.fc-steps-head h3 {
  margin: 0;
}
.fc-step-line .fc-time,
.fc-exchange .fc-time {
  flex: 0 0 76px;
  width: 76px;
  min-width: 0;
  font-size: var(--scs-text-s);
  padding: 5px 8px;
}
/* With the time field the exchange still fits one line. */
.fc-timed .fc-exchange select[data-fc-via] {
  flex-basis: 130px;
}
.fc-timed .fc-exchange input[data-fc-what] {
  flex-basis: 60px;
}
.fc-timing {
  display: block;
  line-height: 1.6;
}
#fc-timing {
  margin: var(--scs-space-2) 0 var(--scs-space-3);
}
.fc-timing small {
  display: block;
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}
.fc-step-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fc-step-time small {
  display: block;
  font-size: var(--scs-text-xs);
  color: var(--scs-ink-2);
}

/* Realisierung: a row per exchange, a column per level, the offer for a gap in the row. */
.fc-real-summary {
  margin: 0 0 var(--scs-space-3);
  color: var(--scs-ink-2);
}
.fc-real-summary strong {
  color: var(--scs-ink);
}
.fc-real-table td {
  vertical-align: top;
}
.fc-real-table .fc-real-step {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--scs-ink-2);
}
.fc-real-entry {
  display: block;
}
.fc-real-entry + .fc-real-entry {
  margin-top: 4px;
}
.fc-real-entry small,
.fc-real-none,
.fc-real-sections {
  display: block;
  font-size: var(--scs-text-xs);
  line-height: 1.4;
  color: var(--scs-ink-2);
}
.fc-real-none {
  margin-top: 6px;
  max-width: 34ch;
}
.fc-real-sections {
  margin-top: 4px;
  color: var(--scs-warn);
}
.fc-real-gap {
  display: inline-block;
  padding: 1px 8px;
  border: 1px dashed var(--scs-warn);
  border-radius: 999px;
  font-size: var(--scs-text-xs);
  color: var(--scs-warn);
}
.fc-real-state .sp-state {
  white-space: nowrap;
}
.fc-real-offers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.fc-real-offers button {
  font-size: var(--scs-text-xs);
  padding: 2px 9px;
  min-height: 24px;
}
.fc-real-options {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  overflow: auto;
}
.fc-real-option small {
  display: block;
  color: var(--scs-ink-2);
}
.fc-real-progress {
  font-variant-numeric: tabular-nums;
  color: var(--scs-warn);
}
.fc-real-progress.fc-real-done {
  color: var(--scs-ok);
}
@media (max-width: 900px) {
  .fc-columns {
    grid-template-columns: 1fr;
  }
  .fc-head .field,
  .fc-head .fc-name,
  .fc-properties .fc-head .field {
    grid-column: span 6;
  }
}

/* The Wirkketten tab carries one more button per row since 6.13: in a narrow editor the
   actions move below the name instead of squeezing it. */
.fp-view {
  container-type: inline-size;
}
@container (max-width: 860px) {
  .fp-view .fp-row {
    flex-wrap: wrap;
  }
  .fp-view .fp-row-info {
    flex-basis: 40%;
  }
  .fp-view .fp-row-actions {
    flex-basis: 100%;
    padding-left: 84px;
  }
}

/* 7.1 Diagramme → Ketten: the three registers unfold under the entry, the page groups them. */
html:root .sidebar .chains-sub {
  margin: -2px 0 6px 14px;
  padding: 2px 0 2px 8px;
  border-top: 0;
  border-left: 1px solid var(--scs-nav-3);
}
html:root .sidebar .chains-sub button {
  padding: 7px 8px;
  margin: 1px 0;
  font-size: 12.5px;
}
html:root .sidebar .chains-sub button.active {
  background: var(--scs-nav-3);
  color: white;
}
.chains-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.chains-page .chains-list {
  list-style: none;
  margin: 0;
  padding: 4px 16px 12px;
}
.chains-page .chains-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--scs-line-2);
  min-width: 0;
}
.chains-page .chains-list li:last-child {
  border-bottom: 0;
}
.chains-page .chains-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chains-page .chains-list li small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chains-page .chains-empty {
  padding: 8px 16px 14px;
  margin: 0;
}
.chains-page .chains-subheading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 16px 0;
  padding-top: 12px;
  border-top: 1px solid var(--scs-line);
  font-size: 13px;
}
.chains-page .chains-subheading .count-link {
  margin-left: auto;
  font-weight: 400;
}
