.step-hero {
  --step-accent: #f1b879;
  --step-ink: #17110c;
  --step-stage: #11191f;
  --step-view-line: #2b3b48;
  padding-bottom: clamp(2.8rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 76% 15%, #182128 0, transparent 50%), var(--page);
}
html[data-theme='light'] .step-hero {
  background: radial-gradient(ellipse at 76% 15%, #e9edf0 0, transparent 55%), var(--page);
}
.step-lead { margin: 0 0 clamp(1.55rem, 3vw, 2.6rem); }
.step-lead h1 { font-size: clamp(2.65rem, 5.5vw, 5rem); }
.step-lead .lede { max-width: 67ch; margin-top: 0.85rem; }
.step-workbench { display: grid; grid-template-columns: minmax(18rem, 0.83fr) minmax(0, 1.55fr); gap: clamp(1rem, 2.2vw, 1.75rem); align-items: start; }
.step-controls { min-width: 0; padding: clamp(1rem, 2.15vw, 1.45rem); border: 1px solid var(--line-strong); border-radius: 1rem; background: var(--surface); }
.step-drop {
  display: grid; justify-items: center; gap: 0.4rem; padding: 1.25rem 0.7rem;
  border: 1px dashed var(--line-strong); border-radius: 0.75rem; background: var(--page); text-align: center;
}
.step-drop[data-dragging] { outline: 2px solid var(--step-accent); outline-offset: -2px; background: var(--surface-raised); }
.step-drop-icon { color: #c38246; margin-bottom: 0.2rem; }
.step-drop .button { margin-bottom: 0.16rem; }
.step-drop > span:not(.step-drop-icon) { font-size: 0.88rem; color: var(--muted); }
.step-drop small { font-size: 0.75rem; color: var(--muted); }
.step-file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.65rem; margin-top: 0.85rem; }
.step-file-row .button { min-height: 2.4rem; padding: 0.5rem 0.7rem; font-size: 0.82rem; }
.step-file-name { font: 0.74rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.step-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.step-settings label { display: grid; align-content: start; gap: 0.35rem; min-width: 0; font-size: 0.84rem; font-weight: 700; }
.step-settings select {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: 0.45rem 0.55rem;
  border: 1px solid var(--line-strong); border-radius: 0.5rem;
  color: var(--ink); background: var(--page); font: 500 0.85rem/1.25 var(--sans);
}
.step-download-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.step-download-row > :first-child { flex: 1 1 9rem; }
.step-download-row .step-download:not(:disabled) { color: var(--step-ink); background: var(--step-accent); border-color: var(--step-accent); }
.step-download-row .step-download:hover:not(:disabled) { background: #ffd19e; border-color: #ffd19e; }
.step-privacy, .step-status { display: flex; align-items: flex-start; gap: 0.45rem; margin-top: 0.8rem; color: var(--muted); font-size: 0.83rem; }
.step-privacy svg { margin-top: 0.14rem; color: var(--accent); }
.step-status[data-tone='success'] { color: #80c9a9; }
.step-status[data-tone='error'] { color: #f3aca7; }
html[data-theme='light'] .step-status[data-tone='success'] { color: #1d6c50; }
html[data-theme='light'] .step-status[data-tone='error'] { color: #9e372f; }
.step-status[data-tone='progress']::before { content: ''; flex: 0 0 auto; width: 0.7rem; height: 0.7rem; margin-top: 0.3rem; border: 1px solid var(--line-strong); border-top-color: #ce8f50; border-radius: 50%; animation: step-spin 750ms linear infinite; }
@keyframes step-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .step-status[data-tone='progress']::before { animation: none; } }

.step-viewer { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--step-view-line); border-radius: 1rem; background: #151e26; color: #dce8f0; box-shadow: 0 1.5rem 3.5rem #0004; }
.step-viewer-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 0.65rem;
  min-height: 2.8rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--step-view-line);
  font: 0.75rem/1.35 var(--mono);
}
.step-viewer-heading > span:first-child { display: flex; align-items: center; gap: 0.5rem; min-width: 0; overflow-wrap: anywhere; }
.step-viewer-heading > span:first-child svg { color: var(--step-accent); }
.step-viewer-heading > span:last-child { text-align: end; color: #aab9c5; }
.step-viewport {
  position: relative; display: grid; place-items: center; isolation: isolate;
  width: 100%; aspect-ratio: 5 / 3; min-height: 15rem;
  background: radial-gradient(ellipse at 50% 36%, #243645 0, var(--step-stage) 76%);
}
.step-poster, .step-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.step-poster { object-fit: contain; }
.step-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.step-canvas canvas:active { cursor: grabbing; }
.step-preview-fallback { max-width: 22rem; padding: 1rem; color: #c4d2de; text-align: center; }
.step-view-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 0.75rem;
  padding: 0.45rem 0.8rem; min-height: 2.7rem; border-top: 1px solid var(--step-view-line); color: #aebdcb; font-size: 0.8rem;
}
.step-view-buttons { display: flex; align-items: center; gap: 0.3rem; }
.step-icon-button, .step-wireframe { display: inline-grid; place-items: center; min-height: 1.95rem; color: #e2ecf3; background: transparent; border: 1px solid transparent; border-radius: 0.38rem; font-size: 0.75rem; }
.step-icon-button { width: 1.95rem; padding: 0; }
.step-wireframe { padding: 0.3rem 0.52rem; }
.step-icon-button:hover, .step-wireframe:hover { border-color: var(--step-view-line); background: #202d37; }
.step-wireframe[aria-pressed='true'] { color: var(--step-accent); background: #30271f; border-color: #76583b; }
.step-stats { display: grid; grid-template-columns: 1fr 1.8fr 1fr; margin: 0; border-top: 1px solid var(--step-view-line); }
.step-stats div { min-width: 0; padding: 0.65rem 0.85rem; }
.step-stats div + div { border-left: 1px solid var(--step-view-line); }
.step-stats dt { color: #aab9c5; font-size: 0.73rem; }
.step-stats dd { margin: 0.12rem 0 0; font: 600 0.85rem/1.4 var(--mono); overflow-wrap: anywhere; }

.step-body > .section-block:first-child { margin-top: 0; padding-top: clamp(2.5rem, 5vw, 4rem); }
.step-quality { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: 1.35rem 2.5rem; }
.step-quality p { margin-top: 0.7rem; max-width: 54ch; color: var(--muted); }
.step-quality table { width: 100%; border-collapse: collapse; text-align: start; font-size: 0.91rem; }
.step-quality :is(th, td) { padding: 0.6rem 0.65rem; text-align: start; border-bottom: 1px solid var(--line); }
.step-quality thead th { color: var(--muted); border-bottom-color: var(--line-strong); }
.step-quality td { font-family: var(--mono); }
.step-credits { padding-bottom: 2.5rem; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 860px) {
  .step-workbench { grid-template-columns: minmax(0, 1fr); }
  .step-controls { padding: 1.1rem; }
  .step-quality { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .step-lead h1 { font-size: clamp(2.25rem, 10vw, 3rem); }
  .step-viewer-heading { padding-inline: 0.65rem; }
  .step-stats div { padding-inline: 0.5rem; }
  .step-stats dd { font-size: 0.76rem; }
  .step-quality :is(th, td) { padding-inline: 0.35rem; overflow-wrap: anywhere; }
}
