/* One scheduling conflict: inputs, a proposed change, and completed work. */
.workflow { --workflow-connector: color-mix(in srgb, var(--color-accent) 42%, var(--color-rule-2)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 0; padding: 0; list-style: none; }
.workflow__step { position: relative; display: grid; grid-template-rows: auto auto 1fr; align-content: start; min-width: 0; }
.workflow__heading { margin: 0; padding-inline: calc(1.25rem + 1px); color: var(--color-ink); font-family: var(--font-display); font-size: 1.375rem; font-weight: 550; line-height: 1.25; letter-spacing: -.025em; }
.workflow__heading::before { content: none; }
.workflow__intro { min-height: 3em; margin: .625rem 0 1.25rem; padding-inline: calc(1.25rem + 1px); color: var(--color-ink-2); font-size: .9375rem; font-weight: 400; line-height: 1.5; }
.workflow__reveal-slot { display: grid; min-width: 0; }
.workflow__card { display: flex; flex-direction: column; min-width: 0; padding: 1.25rem; border: 1px solid var(--color-rule-2); border-radius: 14px; background: #fff; box-shadow: var(--shadow-card); transition: border-color 560ms ease, box-shadow 560ms ease; }
.workflow__step.is-emphasized .workflow__card { border-color: color-mix(in srgb, var(--color-accent) 38%, var(--color-rule-2)); box-shadow: var(--shadow-card), 0 0 0 1px rgba(25, 86, 57, .05), 0 0 8px rgba(25, 86, 57, .085); }
.workflow__icon { display: block; flex: none; width: 1rem; height: 1rem; color: var(--color-accent); }

/* Static arrows occupy the existing 2rem gaps. The direct card is the no-JS
   fallback; enhanced pages anchor to its stable, untransformed reveal slot. */
.workflow__step > :is(.workflow__reveal-slot, .workflow__card) { position: relative; }
.workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::before,
.workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::after {
  content: "";
  position: absolute;
  top: 50%;
  pointer-events: none;
}
.workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::before {
  left: calc(100% + .375rem);
  width: 1.25rem;
  height: 1px;
  background: var(--workflow-connector);
  transform: translateY(-50%);
}
.workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::after {
  left: calc(100% + 1.1875rem);
  width: .375rem;
  height: .375rem;
  border-top: 1px solid var(--workflow-connector);
  border-right: 1px solid var(--workflow-connector);
  transform: translateY(-50%) rotate(45deg);
}

/* The source, icon and update form one compact incoming row. */
.workflow__updates { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.workflow__update { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; padding-block: 1rem; border-top: 1px solid var(--color-rule-2); }
.workflow__update:first-child { padding-top: 0; border-top: 0; }
.workflow__update:last-child { padding-bottom: 0; }
.workflow__source-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--color-paper-2); }
.workflow__source-icon .workflow__icon { color: var(--color-ink-2); }
.workflow__source { display: block; margin-bottom: .25rem; color: var(--color-muted); font-size: .6875rem; line-height: 1.4; }
.workflow__update p { margin: 0; color: var(--color-ink); font-size: .875rem; line-height: 1.45; }

/* The proposed calendar move carries the recommendation. */
.workflow__recommendation { margin: 0 0 1rem; color: var(--color-ink); font-family: var(--font-display); font-size: 1rem; font-weight: 550; line-height: 1.4; letter-spacing: -.015em; }
.workflow__schedule { display: grid; grid-template-columns: minmax(0, 1fr) 1.25rem minmax(0, 1fr); align-items: center; gap: .625rem; }
.workflow__date { position: relative; display: grid; gap: .375rem; padding: 1.125rem .375rem .875rem; overflow: hidden; border-radius: 9px; background: var(--color-paper-2); text-align: center; }
.workflow__date::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--color-rule); }
.workflow__date--proposed { background: var(--color-accent-wash); }
.workflow__date--proposed::before { background: var(--color-accent); }
.workflow__day { color: var(--color-muted); font-size: clamp(1.75rem, 2.6vw, 2.25rem); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.workflow__date--proposed .workflow__day { color: var(--color-accent); }
.workflow__date-label { color: var(--color-muted); font-size: .6875rem; line-height: 1.4; }
.workflow__schedule > .workflow__icon { width: 1.25rem; height: 1.25rem; color: var(--color-muted); }
.workflow__reason { margin: 1rem 0 0; color: var(--color-ink-2); font-size: .8125rem; line-height: 1.5; }

/* Approval is followed by two visible, completed actions. */
.workflow__approval { display: flex; align-items: center; gap: .625rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-rule-2); }
.workflow__avatar { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 50%; background: var(--color-paper-2); color: var(--color-ink-2); font-size: .625rem; font-weight: 500; }
.workflow__approval-copy { min-width: 0; }
.workflow__speaker { display: block; margin-bottom: .25rem; color: var(--color-muted); font-size: .6875rem; line-height: 1.4; }
.workflow__approval p { margin: 0; color: var(--color-ink); font-size: .875rem; line-height: 1.45; }
.workflow__actions { display: grid; gap: 1rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.workflow__action { display: flex; align-items: center; gap: .625rem; color: var(--color-ink); font-size: .875rem; line-height: 1.45; }
.workflow__check { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; background: var(--color-accent-wash); }
.workflow__check .workflow__icon { width: .875rem; height: .875rem; }

/* Entrance transforms are separate from the outline-only emphasis.
   Without JS, every step is fully visible. */
.workflow.is-enhanced .workflow__step:not(.is-revealed) .workflow__card {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
}
.workflow__step.is-entering .workflow__card { will-change: transform, opacity; }

/* Share the heading and description rows instead of reserving a second line
   beneath every intro. Wrapped descriptions still produce aligned card tops. */
@media (min-width: 60rem) {
  @supports (grid-template-rows: subgrid) {
    .workflow { grid-template-rows: auto auto 1fr; row-gap: 0; }
    .workflow__step { grid-row: span 3; grid-template-rows: subgrid; }
    .workflow__intro { min-height: 0; margin-bottom: 1.5rem; }
  }
}

@media (max-width: 59.99rem) {
  .workflow { grid-template-columns: 1fr; gap: 2rem; }
  .workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::before,
  .workflow__step:not(:last-child) > :is(.workflow__reveal-slot, .workflow__card)::after { content: none; }
  .workflow__step:not(:last-child)::before,
  .workflow__step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    pointer-events: none;
  }
  .workflow__step:not(:last-child)::before {
    top: calc(100% + .375rem);
    width: 1px;
    height: 1.25rem;
    background: var(--workflow-connector);
    transform: translateX(-50%);
  }
  .workflow__step:not(:last-child)::after {
    top: calc(100% + 1.1875rem);
    width: .375rem;
    height: .375rem;
    border-right: 1px solid var(--workflow-connector);
    border-bottom: 1px solid var(--workflow-connector);
    transform: translateX(-50%) rotate(45deg);
  }
  .workflow__intro { min-height: 0; margin-bottom: 1rem; }
  .workflow__card { padding: 1.25rem; }
  .workflow__schedule { max-width: 24rem; gap: 1rem; }
  .workflow__date { padding-block: 1.25rem 1rem; }
  .workflow__day { font-size: 2.25rem; }
  .workflow__reason { max-width: 42ch; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow__card { transition: none; }
  .workflow__step.is-emphasized .workflow__card { border-color: var(--color-rule-2); box-shadow: var(--shadow-card); }
  .workflow.is-enhanced .workflow__step:not(.is-revealed) .workflow__card { opacity: 1; transform: none; }
  .workflow__step.is-entering .workflow__card { will-change: auto; }
}
