.ed-view {
  display: grid;
  gap: clamp(20px, 3.7vw, 44px);
  overflow-wrap: anywhere;
}

.ed-view > * { min-width: 0; }
.ed-view [hidden] { display: none !important; }
.ed-view .ed-intro { margin: 0; }
.ed-intro p { max-width: 70ch; }
.ed-intro .ed-attribution { margin-bottom: 0; font-size: 0.82rem; }

.ed-layout {
  display: grid;
  grid-template-columns: minmax(11.5rem, 0.8fr) minmax(0, 2.4fr);
  gap: clamp(16px, 3.2vw, 45px);
  margin-top: 15px;
}

.ed-steps {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ed-steps button {
  display: grid;
  grid-template-columns: 1.5em minmax(0, 1fr);
  align-items: baseline;
  gap: 0.55em;
  width: 100%;
  height: 100%;
  min-height: 44px;
  background: var(--cream);
  color: var(--navy);
}

.ed-step-number {
  color: var(--royal);
  font-variant-numeric: tabular-nums;
}

.ed-steps [aria-current="step"] {
  border-color: var(--royal);
  background: var(--royal);
  color: var(--surface);
}

.ed-steps [aria-current="step"] .ed-step-number { color: inherit; }

.ed-reading { min-width: 0; }

.ed-stage > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 11px;
  padding-block-end: 7px;
  border-block-end: 1px solid var(--border);
  margin-block-end: 12px;
}

.ed-stage > header h3 { margin-bottom: 0; scroll-margin-block-start: 12px; }
.ed-stage > header small { white-space: nowrap; }
.ed-stage > p { max-width: 75ch; }

.ed-stage:not([hidden]), .ed-compare-case:not([hidden]) {
  animation: ed-reveal 180ms ease-out;
}

@keyframes ed-reveal {
  from { opacity: 0.65; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.ed-feature-list, .ed-retained, .ed-applicants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin-block: 8px 14px;
  padding: 0;
  list-style: none;
}

.ed-feature-list li, .ed-retained li, .ed-applicants li {
  border-block-end: 1px solid var(--border);
  padding: 7px 0 9px;
}

.ed-feature-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }

.ed-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 16px;
  margin-block: 14px;
}

.ed-context div {
  border-block-start: 2px solid var(--border);
  padding-block-start: 8px;
}

.ed-context dt, .ed-filter-list dt { color: var(--navy); font-weight: 700; }
.ed-context dd, .ed-filter-list dd { margin: 0; }

.ed-result {
  border-inline-start: 2px solid var(--teal);
  padding: 13px 16px;
  background: var(--teal-soft, #e6f5f2);
}

.ed-result figcaption {
  margin-bottom: 5px;
  color: var(--teal);
  font: 700 0.82rem/1.45 var(--ui);
}

.ed-result blockquote {
  max-width: 39ch;
  color: var(--navy);
  font: 500 clamp(1.15rem, 2.5vw, 1.6rem)/1.28 var(--display);
}

.ed-switch, .ed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ed-switch [aria-pressed="true"] {
  border-color: var(--royal);
  background: var(--mist);
  color: var(--royal);
}

.ed-compare-case {
  border-inline-start: 2px solid var(--amber);
  margin-block-start: 12px;
  padding: 10px 0 10px 14px;
}

.ed-compare-case > p:last-child { margin-bottom: 0; }

.ed-details { border-block-end: 1px solid var(--border); }
.ed-details summary {
  padding-block: 8px;
  color: var(--royal);
  font-weight: 700;
}

.ed-list { margin-block-start: 0; padding-inline-start: 1.2em; }
.ed-list li + li { margin-top: 0.25em; }
.ed-filter-list { margin-block-start: 0; }
.ed-filter-list > div + div { margin-top: 0.65em; }

.ed-controls {
  margin-block-start: 20px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border);
}

.ed-exercise { border-block-start: 2px solid var(--amber); }
.ed-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-block: 10px 16px;
}

.ed-fields > div { display: flex; flex-direction: column; min-width: 0; }
.ed-fields label { display: block; color: var(--navy); font-weight: 700; }
.ed-fields p { margin: 2px 0 7px; color: var(--muted); font-size: 0.83rem; }
.ed-fields input { width: 100%; margin-top: auto; }

@media (max-width: 760px) {
  .ed-layout, .ed-fields { grid-template-columns: minmax(0, 1fr); }
  .ed-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-steps button { font-size: 0.8rem; }
}

@media (max-width: 510px) {
  .ed-workbench { padding-inline: 12px; }
  .ed-stage > header { display: block; }
  .ed-stage > header h3 { margin-bottom: 4px; }
  .ed-context, .ed-feature-list, .ed-retained { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ed-stage:not([hidden]), .ed-compare-case:not([hidden]) { animation: none; }
}
