/* Product & variants: product state, deviations with reasons, derived projects and product updates. */

.variant-page {
  display: grid;
  gap: var(--scs-space-4);
  padding: var(--scs-space-4);
  max-width: 1400px;
}

.variant-page .object-card > :not(header):not(.object-table-scroll) {
  margin: var(--scs-space-3) var(--scs-space-4);
}

.variant-product .object-attrs {
  max-width: 720px;
}

.variant-update {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--scs-space-3);
  padding: var(--scs-space-3) var(--scs-space-4);
  border: 1px solid var(--scs-warn-line);
  border-radius: var(--scs-radius-m);
  background: var(--scs-warn-soft);
}

.variant-update > div {
  display: grid;
  gap: 2px;
}

.variant-update small {
  color: var(--scs-ink-2);
}

.variant-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scs-space-2);
}

.variant-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 3px;
  border: 1px solid var(--scs-line);
  border-radius: 999px;
  font-size: var(--scs-text-s);
}

.variant-count.open {
  padding-left: 10px;
  border-color: var(--scs-warn-line);
  color: var(--scs-warn);
}

.variant-table tr.unexplained td:first-child {
  box-shadow: inset 3px 0 0 var(--scs-warn);
}

.variant-table td:nth-child(2) {
  white-space: nowrap;
}

.variant-table td:is(:nth-child(3), :nth-child(4), :nth-child(5)),
html:root .variant-table .object-link {
  overflow-wrap: anywhere;
  white-space: normal;
}

.variant-details {
  color: var(--scs-ink-2);
  font-size: var(--scs-text-s);
}

.variant-details code {
  font-size: var(--scs-text-xs);
}

.variant-reason {
  margin: 0;
  white-space: pre-wrap;
}

.variant-open-count {
  display: block;
  color: var(--scs-warn);
}

.variant-state {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--scs-text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.variant-state.current {
  background: var(--scs-ok-soft);
  color: var(--scs-ok);
}

.variant-state.behind {
  background: var(--scs-warn-soft);
  color: var(--scs-warn);
}

.variant-steps {
  display: grid;
  gap: var(--scs-space-2);
  padding-left: 1.4em;
}

/* Product update dialog */
.variant-group {
  margin: var(--scs-space-3) 0;
}

.variant-group h4 {
  margin: 0 0 4px;
}

.variant-group > p {
  margin: 0 0 var(--scs-space-2);
}

.variant-group.conflict h4 {
  color: var(--scs-warn);
}

.variant-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: var(--scs-space-2);
  padding: var(--scs-space-2) 0;
  border-bottom: 1px solid var(--scs-line-2);
}

.variant-choice > span:last-child {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

.variant-choice small {
  color: var(--scs-ink-3);
}

.variant-choice .variant-conflict-note {
  color: var(--scs-warn);
}

.variant-notice {
  border-color: var(--scs-accent-line);
  background: var(--scs-accent-soft);
}

/* Produkte (6.5): one card per product variant. */
.product-cards-section {
  display: grid;
  gap: var(--scs-space-3);
}

.product-cards-title {
  margin: 0;
  font-size: 14px;
  color: var(--scs-ink-2);
}

.product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--scs-space-3);
}

.product-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--scs-space-2);
}

.product-card header small {
  color: var(--scs-ink-3);
  white-space: nowrap;
}

.product-card .product-members {
  line-height: 1.9;
}

.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--scs-space-2);
}

.product-card-actions button {
  font-size: 12px;
  padding: 6px 10px;
}

.product-card-actions .danger-link {
  margin-left: auto;
  color: var(--scs-danger);
}

.product-member-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 12px;
  max-height: 46vh;
  overflow: auto;
}

.product-member-filter {
  width: 100%;
  margin-bottom: 10px;
}

/* 6.10: Produktumfang – one row per system, one column per product variant. */
.product-scope-table .product-scope-cell {
  text-align: center;
  width: 1%;
  white-space: nowrap;
}
.product-scope-table .product-scope-variant {
  text-align: center;
}

/* 6.9 audit O13: the empty state is one sentence and the action; the steps open on demand. */
.variant-intro-actions {
  margin: var(--scs-space-2) 0 var(--scs-space-3);
}

.variant-intro-how > summary {
  cursor: pointer;
  color: var(--scs-ink-2);
  font-weight: 600;
}
