/* Abweichungen vom Katalog (6.12, catalog_deviation.js).
   One mark, two levels, always left of the value in its own cell: the icon corners stay
   reserved for the identity seals (link, ×n, document). Info is quiet ink, Prüfen uses the
   state colour "warn" like every other warning; red stays reserved for errors. */
.deviation-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--scs-radius-s);
  background: transparent;
  color: var(--scs-ink-3);
  line-height: 0;
  cursor: pointer;
}
.deviation-mark[hidden] {
  display: none;
}
.deviation-mark svg {
  width: 13px;
  height: 13px;
}
.deviation-mark[data-level='warn'] {
  border-color: var(--scs-warn-line);
  background: var(--scs-warn-soft);
  color: var(--scs-warn);
}
button.deviation-mark:hover {
  border-color: var(--scs-line-strong);
  background: var(--scs-surface-3);
  color: var(--scs-ink-2);
}
button.deviation-mark[data-level='warn']:hover {
  border-color: var(--scs-warn);
  background: var(--scs-warn-soft);
  color: var(--scs-warn);
}
button.deviation-mark:focus-visible {
  outline: 2px solid var(--scs-focus);
  outline-offset: 1px;
}
/* The function level warning (function_tree.js) wears the same mark; it only explains. */
span.deviation-mark.function-level-warning {
  cursor: help;
}
.grid .deviation-cell {
  gap: 6px;
}
.grid .appearance-cell > .deviation-cell {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 9px;
}
.grid .appearance-cell > .deviation-cell > span[data-no-translate] {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Popover: what the catalog says, what this element says, one decision. */
.deviation-pop {
  position: fixed;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-l);
  background: var(--scs-surface);
  color: var(--scs-ink);
  box-shadow: var(--scs-shadow-pop);
  font-size: var(--scs-text-m);
  line-height: 1.45;
}
.deviation-pop h3 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: var(--scs-text-m);
  font-weight: 600;
  text-wrap: balance;
}
.deviation-pop h3 .deviation-mark {
  cursor: default;
}
.deviation-pop dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--scs-radius-m);
  background: var(--scs-surface-2);
}
.deviation-pop dt {
  color: var(--scs-ink-3);
}
.deviation-pop dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.deviation-pop p {
  margin: 0;
  color: var(--scs-ink-2);
}
.deviation-pop .deviation-shared {
  color: var(--scs-ink-3);
  font-size: var(--scs-text-s);
}
.deviation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Toolbar filter "Abweichungen": shown only while the diagram has some. */
.deviation-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.deviation-filter svg {
  width: 13px;
  height: 13px;
  color: var(--scs-ink-3);
}
.deviation-filter[data-level='warn'] svg {
  color: var(--scs-warn);
}
.deviation-filter .deviation-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--scs-surface-3);
  color: var(--scs-ink-2);
  font-size: var(--scs-text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-align: center;
}
.deviation-filter[data-level='warn'] .deviation-count {
  background: var(--scs-warn-soft);
  color: var(--scs-warn);
}
.deviation-filter[aria-pressed='true'] {
  border-color: var(--scs-accent);
  background: var(--scs-accent-soft);
  color: var(--scs-accent);
}

/* Prüfzentrum: review dialog */
.deviation-review {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-m);
}
.deviation-review table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--scs-text-m);
}
.deviation-review th,
.deviation-review td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--scs-line-2);
  text-align: left;
  vertical-align: top;
}
.deviation-review th {
  position: sticky;
  top: 0;
  background: var(--scs-surface-2);
  color: var(--scs-ink-2);
  font-weight: 600;
}
.deviation-review small {
  color: var(--scs-ink-3);
}

/* Colour and domains cells style their buttons as 34 px tool buttons; the mark stays small. */
.grid .appearance-cell button.deviation-mark {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
}
.grid .appearance-cell button.deviation-mark[data-level='warn'] {
  border-color: var(--scs-warn-line);
  background: var(--scs-warn-soft);
}

/* Pro editor inspector (Stufe 2): a note right under the field it explains. Same family as the
   function level warning, so the inspector speaks one warning language; Info stays quiet. */
.deviation-note {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  margin: -4px 0 12px;
  padding: 7px 9px;
  border: 1px solid var(--scs-line);
  border-left: 3px solid var(--scs-ink-3);
  border-radius: var(--scs-radius-m);
  background: var(--scs-surface-2);
  color: var(--scs-ink);
  font-size: 12px;
  line-height: 1.45;
}
.deviation-note[data-level='warn'] {
  border-color: var(--scs-warn-line);
  border-left-color: var(--scs-warn);
  background: var(--scs-warn-soft);
}
.deviation-note > .deviation-mark {
  margin-top: 1px;
  cursor: default;
}
.deviation-note p {
  margin: 0;
  overflow-wrap: anywhere;
}
.deviation-note p + p {
  color: var(--scs-ink-2);
}
.deviation-note .deviation-actions {
  gap: 4px 12px;
  margin-top: 4px;
}
html:root .deviation-note .deviation-actions button {
  height: auto;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--scs-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
  cursor: pointer;
}
html:root .deviation-note .deviation-actions button:hover {
  background: none;
  color: var(--scs-accent);
  text-decoration-color: currentColor;
}
html:root .deviation-note .deviation-actions button:focus-visible {
  outline: 2px solid var(--scs-focus);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Object page "Verwendet in": a read-only mark after the label of the occurrence. */
.object-usage-table .deviation-mark {
  margin-left: 6px;
  vertical-align: middle;
  cursor: help;
}
