/* Its own colours, a graphite dock with the current step as a white tab, so it reads as the editor's navigation
   rather than one more blue control on the page. In dark mode the dock is lighter than the page, with an edge. */
.editor-step-nav {
  --step-dock: #1f2430;
  --step-edge: #1f2430;
  --step-text: #e9ecf2;
  --step-muted: #8f98aa;
  --step-hover: rgba(255, 255, 255, 0.1);
  --step-current: #fff;
  --step-current-text: #1f2430;
  --step-shadow: 0 6px 24px rgba(15, 20, 30, 0.28);
  position: fixed;
  z-index: 1010;
  left: 50%;
  bottom: max(.7rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 1rem);
  padding: .45rem;
  transform: translateX(-50%);
  border: 1px solid var(--step-edge);
  border-radius: .85rem;
  background: var(--step-dock);
  box-shadow: var(--step-shadow);
}

.editor-step-nav[hidden] { display: none; }
.editor-step-nav ol { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin: 0; padding: 0; list-style: none; }

.editor-step-nav button {
  display: grid;
  grid-template-rows: 1.15rem 1fr;
  align-content: start;
  justify-items: center;
  gap: .18rem;
  width: 4.75rem;
  height: 100%;
  min-height: 3.15rem;
  padding: .35rem .2rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: transparent;
  color: var(--step-text);
  text-align: center;
}

.editor-step-nav-number { font-size: 1rem; font-weight: 750; line-height: 1.15; }
.editor-step-nav-label { font-size: .7rem; font-weight: 650; line-height: 1.15; }
.editor-step-nav button:not(:disabled):hover { background: var(--step-hover); }
.editor-step-nav button[aria-current="step"] { background: var(--step-current); color: var(--step-current-text); }
.editor-step-nav button:is(:disabled, [data-unavailable]):not([aria-current="step"]) { color: var(--step-muted); background: transparent; }
.editor-step-nav button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.editor-step-nav button:disabled { cursor: default; }
.editor-step-jump-target { scroll-margin-top: 5rem; }
.editor-step-jump-target:focus:not(:focus-visible) { outline: none; }
body:has(.editor-step-nav:not([hidden])) #editor .merge-bar {
  bottom: calc(var(--editor-step-nav-height, 4rem) + max(.7rem, env(safe-area-inset-bottom)) + .35rem);
}

@media (max-width: 760px) {
  .editor-step-nav ol { max-width: 26rem; }
  .editor-step-nav button { width: clamp(3.3rem, 16.5vw, 4.75rem); min-height: 3rem; }
}

@media (max-width: 380px) {
  .editor-step-nav-label { font-size: .66rem; }
}

[data-bs-theme="dark"] .editor-step-nav {
  --step-dock: #2b3345;
  --step-edge: #3d465c;
  --step-muted: #9aa3b5;
  --step-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
