/* ============================================================================
 * UpstreamChanges — CSS Module
 *
 * The drawer listing what a page has to take from the page it derives from. It
 * follows the editor's other right-side panels.
 * ============================================================================ */

/* ------------------------------------------------------------------
 * Drawer head — the particulars under the title
 * ------------------------------------------------------------------ */
.versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pds-spacing-2xs, 0.5rem);
  font-size: var(--pds-typography-size-s, 0.875rem);
  color: var(--pds-color-foreground-subtle, oklch(0.42 0 0));
}

.side {
  display: inline-flex;
  align-items: center;
  gap: var(--pds-spacing-3xs, 0.3rem);
  font-variant-numeric: tabular-nums;
}

.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.125rem 0.25rem;
  background: oklch(0.96 0 0);
  border-radius: var(--pds-border-radius-s, 0.25rem);
  font-size: var(--pds-typography-size-2xs, 0.6875rem);
  font-weight: var(--pds-typography-fw-semibold, 600);
  letter-spacing: 0.02em;
  color: var(--pds-color-foreground-subtle, oklch(0.42 0 0));
}

.behind {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 9px;
  background: var(--pds-color-background-warning-subtle, oklch(0.96 0.03 55));
  border-radius: var(--pds-border-radius-button, 3.5rem);
  font-size: 0.71875rem;
  font-weight: var(--pds-typography-fw-semibold, 600);
  color: var(--pds-color-foreground-warning, oklch(0.47 0.13 45));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ------------------------------------------------------------------
 * Body — one section per classification
 * ------------------------------------------------------------------ */

.sessionNote {
  margin-bottom: var(--pds-spacing-m, 1rem);
}

.group {
  margin-bottom: var(--pds-spacing-l, 1.5rem);
}

.structuralHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pds-spacing-2xs, 0.5rem);
  margin-bottom: 0.125rem;
}

.structuralHead .groupHead {
  margin: 0;
}

.structuralToggle {
  display: inline-flex;
  align-items: center;
  gap: var(--pds-spacing-4xs, 0.25rem);
  padding: var(--pds-spacing-5xs, 0.125rem) 0;
  background: transparent;
  border: 0;
  color: var(--pds-color-foreground-default-secondary, oklch(0.5103 0 0));
  font-family: var(--pds-typography-ff-default, 'Inter', sans-serif);
  font-size: var(--pds-typography-size-xs, 0.75rem);
  font-weight: var(--pds-typography-fw-medium, 500);
  line-height: var(--pds-typography-lh-s, 1.25);
  cursor: pointer;
  white-space: nowrap;
}

.structuralToggle:hover {
  color: var(--pds-color-foreground-default, oklch(0.2046 0 0));
  text-decoration: underline;
}

.structuralToggle:focus-visible {
  border-radius: var(--pds-border-radius-default, 0.188rem);
  outline: 2px solid var(--pds-color-interactive-focus, currentColor);
  outline-offset: 2px;
}

.structuralListExpanded {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: var(--pds-spacing-3xs, 0.3rem);
  overscroll-behavior: contain;
}

.groupHead {
  display: flex;
  align-items: center;
  gap: var(--pds-spacing-2xs, 0.5rem);
  margin: 0 0 0.125rem;
  font-size: var(--pds-typography-size-m, 1rem);
  font-weight: var(--pds-typography-fw-semibold, 600);
}

.groupDot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
}

.groupSub {
  margin: 0 0 var(--pds-spacing-2xs, 0.5rem);
  font-size: var(--pds-typography-size-s, 0.875rem);
  color: var(--pds-color-foreground-subtle, oklch(0.55 0 0));
}

/* ------------------------------------------------------------------
 * Row — one reported change
 * ------------------------------------------------------------------ */
.row {
  padding: var(--pds-spacing-s, 0.75rem);
  margin-bottom: var(--pds-spacing-2xs, 0.5rem);
  background: var(--pds-color-background-default, oklch(1 0 0));
  border: 1px solid var(--pds-color-border-default, oklch(0.8853 0 0));
  border-radius: var(--pds-border-radius-m, 0.5rem);
}

.field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pds-spacing-2xs, 0.5rem);
  font-size: var(--pds-typography-size-s, 0.875rem);
  font-weight: var(--pds-typography-fw-semibold, 600);
}

.ownership {
  padding: 0.0625rem 0.375rem;
  background: oklch(0.96 0 0);
  border-radius: var(--pds-border-radius-s, 0.25rem);
  font-size: var(--pds-typography-size-2xs, 0.6875rem);
  font-weight: var(--pds-typography-fw-semibold, 600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pds-color-foreground-subtle, oklch(0.42 0 0));
}

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--pds-spacing-s, 0.75rem);
  margin-top: var(--pds-spacing-2xs, 0.5rem);
}

.col {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.colLabel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--pds-typography-size-2xs, 0.6875rem);
  font-weight: var(--pds-typography-fw-semibold, 600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pds-color-foreground-subtle, oklch(0.55 0 0));
  font-variant-numeric: tabular-nums;
}

.colLabel .flag {
  margin-inline: var(--pds-spacing-5xs, 0.125rem);
}

.replaceLabel {
  margin-top: var(--pds-spacing-3xs, 0.3rem);
}

.value {
  font-size: var(--pds-typography-size-s, 0.875rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.richtextValue {
  display: block;
  margin-block: var(--pds-spacing-5xs, 0.125rem);
  padding: var(--pds-spacing-3xs, 0.375rem);
  background: var(--pds-color-surface-default-secondary, oklch(0.9702 0 0));
  border-radius: var(--pds-border-radius-default, 0.188rem);
  color: inherit;
  font-family: var(--pds-typography-ff-code, monospace);
  white-space: pre-wrap;
}

.imageValue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--pds-spacing-3xs, 0.3rem);
  min-width: 0;
  margin-block: var(--pds-spacing-5xs, 0.125rem);
}

.imagePreview {
  width: min(100%, 14rem);
  height: 9rem;
  object-fit: contain;
  background: var(--pds-color-surface-default-secondary, oklch(0.9702 0 0));
  border: 1px solid var(--pds-color-border-default, oklch(0.8853 0 0));
  border-radius: var(--pds-border-radius-default, 0.188rem);
}

.imageDetails {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: var(--pds-typography-size-xs, 0.75rem);
  overflow-wrap: anywhere;
}

.imageAlt {
  color: inherit;
}

.imageName {
  color: var(--pds-color-foreground-subtle, oklch(0.55 0 0));
}

.valueStale {
  color: var(--pds-color-foreground-danger, oklch(0.52 0.19 20));
}

.pending {
  font-style: italic;
  color: var(--pds-color-foreground-subtle, oklch(0.62 0 0));
}

.note {
  display: flex;
  align-items: flex-start;
  gap: var(--pds-spacing-3xs, 0.3rem);
  margin-top: var(--pds-spacing-2xs, 0.5rem);
  font-size: var(--pds-typography-size-s, 0.875rem);
  color: var(--pds-color-foreground-subtle, oklch(0.55 0 0));
}

.structuralNote {
  display: block;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pds-spacing-2xs, 0.5rem);
  margin-top: var(--pds-spacing-s, 0.75rem);
}
