#step-view {
  --sg-base: #041E29;
  --sg-panel: #0B3540;
  --sg-paper: #FBFAF8;
  --sg-ink: #0B1623;
  --sg-silver: #C5D1D6;
  --sg-orange: var(--accent);
  --sg-muted: #4c5a62;
  --sg-line: #d4dadd;
  --sg-soft: #f0f1f2;
  color: var(--sg-ink);
  background: var(--sg-paper);
  font-family: var(--sans, Inter, Arial, sans-serif);
}
#step-view .sg-layout {
  width: min(1376px, 91%);
  margin: 0 auto;
  padding: clamp(1.7rem, 3.75vw, 3.9rem) 0 5rem;
  display: grid;
  grid-template-columns: minmax(205px, 245px) minmax(0, 960px);
  align-items: start;
  justify-content: space-between;
  gap: clamp(2rem, 4.7vw, 5.6rem);
}
#step-view .sg-layout * { box-sizing: border-box; }
#step-view .sg-layout :is(h1,h2,h3,p) { margin: 0; }
#step-view .sg-layout :is(button,select,textarea) { font: inherit; }
#step-view .sg-layout button { cursor: pointer; }
#step-view .sg-main { min-width: 0; width: 100%; }
#step-view .sg-sticky { position: sticky; top: 6rem; }
#step-view .sg-aside { align-self: stretch; min-width: 0; }
#step-view .sg-back, #step-view .sg-previous {
  width: fit-content;
  display: inline-flex;
  gap: .32rem;
  align-items: center;
  min-height: 40px;
  color: var(--sg-muted);
  font-size: .9rem;
  font-weight: 560;
  text-decoration: none;
}
#step-view .sg-back { margin: -.48rem 0 1.4rem; }
#step-view .sg-back:hover, #step-view .sg-previous:hover { color: var(--sg-panel); text-decoration: underline; text-underline-offset: 3px; }
#step-view .sg-sidepanel { padding: 1.35rem 1.1rem 1rem; border: 1px solid var(--sg-line); border-radius: 10px; background: var(--sg-paper); }
#step-view .sg-side-title { font-size: 1.13rem; font-weight: 650; letter-spacing: -.035em; }
#step-view .sg-count { color: var(--sg-muted); font-size: .86rem; margin-top: .4rem; }
#step-view .sg-progress {
  display: block;
  width: 100%;
  height: 4px;
  appearance: none;
  color: var(--sg-panel);
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--sg-line);
  margin: .85rem 0 1.15rem;
}
#step-view .sg-progress::-webkit-progress-bar { background: var(--sg-line); }
#step-view .sg-progress::-webkit-progress-value { background: var(--sg-panel); border-radius: 99px; }
#step-view .sg-progress::-moz-progress-bar { background: var(--sg-panel); }
#step-view .sg-side-nav ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
#step-view .sg-side-nav li { margin: 0; }
#step-view .sg-side-link {
  display: flex;
  align-items: center;
  gap: .62rem;
  color: var(--sg-muted);
  font-size: .9rem;
  font-weight: 530;
  line-height: 1.35;
  padding: .6rem .48rem;
  border-radius: 5px;
  text-decoration: none;
}
#step-view .sg-side-link:hover { background: var(--sg-soft); }
#step-view .sg-side-link.sg-current { background: var(--sg-panel); color: var(--sg-paper); font-weight: 680; }
#step-view .sg-step-mark, #step-view .sg-action-n { font-family: var(--mono, monospace); font-size: .77rem; font-weight: 500; }
#step-view .sg-step-mark {
  flex: 0 0 1.65rem; height: 1.65rem; display: grid; place-items: center;
  color: var(--sg-muted); border: 1px solid var(--sg-line); border-radius: 50%; background: var(--sg-paper);
}
#step-view .sg-current .sg-step-mark { background: var(--sg-orange); color: var(--sg-base); border-color: var(--sg-orange); }
#step-view .sg-done:not(.sg-current) .sg-step-mark { background: var(--sg-silver); border-color: var(--sg-silver); color: var(--sg-base); }
#step-view .sg-mobile-nav { display: none; }
#step-view .sg-watched { display: block; color: var(--sg-muted); font-size: .76rem; font-weight: 480; line-height: 1.3; margin-top: .15rem; }
#step-view .sg-heading { padding-bottom: 1.65rem; border-bottom: 1px solid var(--sg-line); }
#step-view .sg-banner {
  display: grid; overflow: hidden; margin: 0 0 clamp(1.3rem, 2.1vw, 2rem);
  color: var(--sg-paper); background: var(--sg-base); border-radius: 7px;
}
#step-view .sg-banner-photo {
  display: block; width: 100%; aspect-ratio: 2.5; object-fit: cover; object-position: center;
}
#step-view .sg-banner-text {
  display: flex; align-items: baseline; gap: clamp(.7rem, 2vw, 1.3rem);
  padding: .7rem clamp(.9rem, 2.4vw, 1.7rem) .8rem; border-top: 1px solid #ffffff20;
}
#step-view .sg-kicker {
  display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .085em; font: 480 .78rem/1.4 var(--mono, monospace); color: var(--sg-silver);
}
#step-view .sg-kicker::before { content: ""; width: 1rem; height: 2px; background: var(--sg-orange); }
#step-view .sg-chapter {
  font: 540 clamp(1rem, 1.6vw, 1.2rem)/1.35 var(--sans, Inter, Arial, sans-serif);
  letter-spacing: -.025em; color: var(--sg-paper);
}
#step-view .sg-heading h1 {
  color: var(--sg-ink);
  margin: .9rem 0 .9rem;
  max-width: 20ch;
  font-family: var(--sans, Inter, Arial, sans-serif);
  font-size: clamp(2.4rem, 4.9vw, 4.45rem);
  line-height: 1.025;
  font-weight: 545;
  letter-spacing: -.055em;
  text-wrap: balance;
}
#step-view .sg-heading h1:focus { outline: 0; }
#step-view .sg-intro { max-width: 66ch; color: var(--sg-muted); font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.61; }
#step-view .sg-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.25rem; }
#step-view .sg-meta span { display: inline-flex; align-items: center; gap: .45rem; color: var(--sg-muted); font-size: .88rem; }
#step-view .sg-meta svg { flex: 0 0 auto; color: var(--sg-panel); }
#step-view .sg-section { padding: 1.8rem 0 .25rem; }
#step-view .sg-main h2 { font-family: var(--sans, Inter, Arial, sans-serif); font-size: clamp(1.35rem, 1.9vw, 1.64rem); line-height: 1.22; font-weight: 625; letter-spacing: -.04em; color: var(--sg-ink); }
#step-view .sg-actions { padding: 0; margin: .78rem 0 0; list-style: none; }
#step-view .sg-actions li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .9rem; align-items: start; padding: .95rem 0; border-bottom: 1px solid var(--sg-line); }
#step-view .sg-actions li:last-child { border-bottom: 0; padding-bottom: 0; }
#step-view .sg-action-n { height: 2.1rem; width: 2.1rem; color: var(--sg-panel); border: 1px solid var(--sg-line); background: var(--sg-soft); display: grid; place-items: center; border-radius: 6px; }
#step-view .sg-actions h3 { margin: .02rem 0 .3rem; font: 625 1.04rem/1.43 var(--sans, Inter, Arial, sans-serif); letter-spacing: -.02em; }
#step-view .sg-actions p, #step-view .sg-help p, #step-view .sg-result-head p { color: var(--sg-muted); font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
#step-view .sg-prompts { display: grid; gap: .6rem; margin-top: .95rem; }
#step-view .sg-prompt { border: 1px solid var(--sg-panel); border-radius: 7px; overflow: hidden; background: var(--sg-base); }
#step-view .sg-prompt-head { min-height: 3.2rem; display: flex; justify-content: space-between; align-items: center; color: var(--sg-paper); gap: .4rem; padding: .42rem .58rem .42rem .72rem; }
#step-view .sg-prompt-toggle, #step-view .sg-copy { border: 0; display: inline-flex; align-items: center; background: transparent; font-size: .9rem; font-weight: 590; color: inherit; }
#step-view .sg-prompt-toggle { text-align: left; padding: .45rem .15rem; flex: 1; min-width: 0; gap: .55rem; }
#step-view .sg-prompt-chevron { color: var(--sg-orange); display: flex; transform: rotate(0); transition: transform .18s; }
#step-view .sg-prompt-toggle[aria-expanded="true"] .sg-prompt-chevron { transform: rotate(90deg); }
#step-view .sg-copy { flex-shrink: 0; gap: .4rem; padding: .45rem .7rem; border: 1px solid #647c86; border-radius: 5px; background: var(--sg-panel); color: var(--sg-paper); font-size: .83rem; }
#step-view .sg-copy:hover { background: #194754; }
#step-view .sg-prompt-text { margin: 0; padding: 1.1rem 1.25rem 1.25rem; max-height: 27rem; overflow: auto; overscroll-behavior-y: auto; border-top: 1px solid #35505c; color: var(--sg-paper); background: var(--sg-panel); }
#step-view .sg-demo figure {
  display: block; margin: .95rem 0 .7rem; border-radius: 7px; overflow: hidden; background: var(--sg-base);
}
#step-view .sg-player { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; color: var(--sg-paper); background: var(--sg-base); }
#step-view .sg-demo figcaption {
  color: var(--sg-silver); font-size: .9rem; padding: .63rem 1rem; border-top: 1px solid #ffffff20;
}
#step-view .sg-transcript { color: var(--sg-muted); font-size: .94rem; line-height: 1.55; }
#step-view .sg-transcript strong { color: var(--sg-ink); font-weight: 610; }
#step-view .sg-comparison .sg-comparison-intro { margin-top: .5rem; font-size: 1rem; line-height: 1.55; color: var(--sg-muted); }
#step-view .sg-comparison figure { width: 100%; max-width: 32rem; margin: 1rem 0 0; }
#step-view .sg-comparison-tabs {
  display: flex; padding: .22rem; gap: .22rem; margin-bottom: .6rem; border: 1px solid var(--sg-line);
  border-radius: 7px; background: var(--sg-soft);
}
#step-view .sg-comparison-tabs button {
  flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 5px; padding: .5rem .65rem;
  font-size: .92rem; line-height: 1.35; font-weight: 565; color: var(--sg-panel); background: transparent;
}
#step-view .sg-comparison-tabs button:hover { background: var(--sg-paper); }
#step-view .sg-comparison-tabs button[aria-selected="true"] { background: var(--sg-panel); color: var(--sg-paper); }

#step-view .sg-comparison-frame {
  position: relative; aspect-ratio: 1; width: 100%; border-radius: 6px; overflow: hidden; background: var(--sg-base);
}
#step-view .sg-comparison-frame [role="tabpanel"] { position: absolute; inset: 0; }
#step-view .sg-comparison-frame [role="tabpanel"]:focus-visible { outline: 3px solid var(--sg-orange); outline-offset: -4px; }
#step-view .sg-comparison-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
#step-view .sg-comparison figcaption { margin-top: .65rem; color: var(--sg-muted); font-size: .9rem; line-height: 1.55; }
#step-view .sg-comparison figcaption a { text-underline-offset: .15em; color: var(--sg-panel); }
#step-view .sg-prompt-text code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .9rem/1.65 var(--mono, ui-monospace, monospace); color: inherit; background: transparent; padding: 0; }
#step-view .sg-resources { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .9rem; }
#step-view .sg-resource { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: .5rem; padding: .58rem .8rem; border: 1px solid var(--sg-line); border-radius: 5px; background: var(--sg-paper); color: var(--sg-panel); font-size: .9rem; font-weight: 540; line-height: 1.45; text-decoration: none; }
#step-view .sg-resource:hover { border-color: #788a91; background: var(--sg-soft); }
#step-view .sg-resource svg { flex-shrink: 0; }
#step-view .sg-resource span { overflow-wrap: anywhere; }
#step-view .sg-help, #step-view .sg-notes { margin-top: 1.2rem; padding: 0 1rem; border: 1px solid var(--sg-line); border-radius: 6px; background: var(--sg-paper); }
#step-view .sg-help + .sg-notes { margin-top: .5rem; }
#step-view .sg-help p { padding: 0 0 1rem; }
#step-view .sg-layout details summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; font-size: .96rem; line-height: 1.42; font-weight: 560; }
#step-view .sg-layout details summary::-webkit-details-marker { display: none; }
#step-view .sg-layout details summary > span { display: inline-flex; align-items: center; gap: .6rem; }
#step-view .sg-layout details summary svg { color: var(--sg-panel); flex-shrink: 0; }
#step-view .sg-layout details[open] .sg-expand { transform: rotate(45deg); }
#step-view .sg-notes-body { display: grid; padding: .25rem 0 1rem; gap: .55rem; }
#step-view .sg-notes label { font-size: .94rem; font-weight: 540; }
#step-view .sg-notes textarea { width: 100%; min-height: 6.4rem; padding: .75rem; border: 1px solid #a5b4ba; border-radius: 4px; color: var(--sg-ink); background: var(--sg-paper); font-size: 1rem; line-height: 1.5; resize: vertical; }
#step-view .sg-notes p { color: var(--sg-muted); font-size: .84rem; }
#step-view .sg-finish { margin-top: 1.5rem; padding: clamp(1.2rem, 3vw, 1.6rem); border-radius: 8px; border: 1px solid var(--sg-line); background: var(--sg-soft); }
#step-view .sg-result-head { display: flex; gap: .8rem; }
#step-view .sg-result-icon { flex: 0 0 auto; color: var(--sg-panel); margin-top: .12rem; }
#step-view .sg-result-head p { margin-top: .4rem; }
#step-view .sg-finish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-top: 1.1rem; }
#step-view .sg-primary { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 44px; padding: .7rem 1.05rem; border: 1px solid var(--sg-orange); border-radius: 5px; color: var(--sg-base); background: var(--sg-orange); font-size: .94rem; font-weight: 620; }
#step-view .sg-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
#step-view .sg-text-button { min-height: 40px; padding: .35rem .2rem; border: none; background: transparent; color: var(--sg-panel); font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
#step-view .sg-previous { margin-top: 1rem; }
#step-view .sg-layout :is(a,button,textarea,select,summary,pre,video):focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
#step-view .sg-comparison-tabs button:focus-visible { outline-color: var(--accent-ink); outline-offset: -3px; }
#step-view .sg-comparison-tabs button[aria-selected="true"]:focus-visible { outline-color: var(--sg-orange); }
#step-view .sg-layout .sg-player:focus-visible, #step-view .sg-prompt :is(button,pre):focus-visible { outline-color: var(--sg-orange); outline-offset: -3px; }
#step-view .sg-notice:not(:empty) { position: fixed; right: max(1rem, 4vw); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 80; max-width: min(90vw, 24rem); background: var(--sg-base); color: var(--sg-paper); padding: .78rem 1.06rem; border-radius: 5px; box-shadow: 0 4px 16px #041e2925; font-size: .94rem; }
#step-view .sg-visually-hidden { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; position: absolute; }
#step-view [hidden] { display: none !important; }
@media (max-width: 840px) {
  #step-view .sg-layout { width: min(94%, 680px); grid-template-columns: 1fr; gap: 1.6rem; padding: 1.25rem 0 3.2rem; }
  #step-view .sg-sticky { position: static; }
  #step-view .sg-sidepanel { padding: .75rem .9rem; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 0 .8rem; align-items: center; }
  #step-view .sg-back { margin: 0 0 .35rem; }
  #step-view .sg-side-title { font-size: .96rem; }
  #step-view .sg-count { font-size: .8rem; margin-top: .15rem; grid-column: 1; }
  #step-view .sg-progress { margin: .4rem 0 0; grid-column: 1; }
  #step-view .sg-side-nav { display: none; }
  #step-view .sg-mobile-nav { position: relative; display: grid; gap: .25rem; grid-row: 1/4; grid-column: 2; }
  #step-view .sg-mobile-nav::after { content: ""; pointer-events: none; position: absolute; right: .75rem; bottom: 1rem; width: .42rem; height: .42rem; border: solid var(--sg-panel); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
  #step-view .sg-mobile-nav label { font-size: .8rem; color: var(--sg-muted); }
  #step-view .sg-mobile-nav select { appearance: none; width: 100%; min-height: 38px; font-size: max(1rem, 16px); padding: .3rem 1.6rem .3rem .45rem; background: var(--sg-paper); color: var(--sg-ink); border: 1px solid var(--sg-line); border-radius: 5px; }
}
@media (max-width: 510px) {
  #step-view .sg-layout { width: calc(100% - 2rem); padding-top: .75rem; }
  #step-view .sg-banner { margin-bottom: 1.1rem; }
  #step-view .sg-banner-photo { aspect-ratio: 1.95; }
  #step-view .sg-banner-text { flex-wrap: wrap; gap: .18rem .7rem; padding: .65rem .8rem; }
  #step-view .sg-kicker { font-size: .71rem; }
  #step-view .sg-banner .sg-chapter { font-size: 1rem; }
  #step-view .sg-heading h1 { font-size: clamp(2.15rem, 10vw, 3rem); }
  #step-view .sg-section { padding-top: 1.5rem; }
  #step-view .sg-actions li { grid-template-columns: 1.8rem minmax(0,1fr); gap: .62rem; }
  #step-view .sg-action-n { width: 1.75rem; height: 1.75rem; }
  #step-view .sg-prompt-head { padding: .3rem .4rem; }
  #step-view .sg-copy { padding: .55rem .5rem; }
  #step-view .sg-prompt-text { padding: .85rem; }
  #step-view .sg-finish { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  #step-view .sg-prompt-chevron { transition: none; }
}

#step-view .sg-action-copy { margin: .7rem 0 0; }

#step-view .sg-actions > li.sg-connection-step {
  display: block;
  padding: .65rem 0 1.65rem;
}
#step-view .sg-connection-heading {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin: 0 0 1.25rem;
}
#step-view .sg-connection-number {
  display: grid;
  place-items: center;
  flex: 0 0 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #071f2a;
  color: #ff994d;
  font: 600 .85rem/1 var(--mono, monospace);
}
#step-view .sg-actions .sg-connection-heading h3 {
  margin: 0 0 .2rem;
  font-size: clamp(1.22rem, 2vw, 1.5rem);
  font-weight: 680;
  line-height: 1.28;
  letter-spacing: -.035em;
}
#step-view .sg-actions .sg-connection-heading p { margin: 0; }
