/* HEIMDALL — build guide (hub + step pages)
   Reuses tokens.css / base.css. Colors come from design tokens, so the palette
   switcher recolors these pages too. */

/* ---------- build header ---------- */
.build-nav{position:fixed;top:0;left:0;right:0;z-index:50;
  background:var(--bg);
  border-bottom:1px solid var(--line)}
.build-nav-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;
  height:88px;max-width:var(--maxw);margin:0 auto;padding-left:var(--pad);padding-right:var(--pad)}
.build-brand{display:flex;align-items:center;gap:11px}
.build-brand img{height:68px;width:auto}
.build-brand .brand-text{display:flex;align-items:center;gap:11px;
  font-family:var(--display);font-weight:700;letter-spacing:.14em;font-size:15px;color:var(--text)}
.build-brand .brand-text .mark{width:18px;height:18px;position:relative}
.build-brand .brand-text .mark::before{content:"";position:absolute;inset:0;
  border:1.5px solid var(--accent);border-radius:50% 50% 50% 0;transform:rotate(45deg);
  box-shadow:0 0 10px var(--glow)}
.build-nav .back{font-family:var(--mono);font-size:12.5px;letter-spacing:.04em;color:var(--muted)}
.build-nav .back:hover{color:var(--text)}
.build-nav-actions{display:flex;align-items:center;gap:18px}

/* ---------- hub hero ---------- */
.build-hero{padding-top:130px;padding-bottom:40px}
.build-hero h1{font-family:var(--display);font-weight:700;letter-spacing:-.02em;
  font-size:clamp(38px,6vw,68px);line-height:1.02;margin-bottom:16px}
.build-hero h1 .accent{color:var(--accent)}
.build-hero .lead{margin-bottom:34px}

/* ---------- progress + unlock-all ---------- */
.build-controls{display:flex;align-items:center;gap:clamp(18px,4vw,44px);flex-wrap:wrap;
  padding:22px 24px;border:1px solid var(--line);border-radius:8px;background:var(--bg-2)}
.progress{flex:1 1 280px;min-width:240px}
.progress-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:9px;
  font-family:var(--mono);font-size:12px;letter-spacing:.06em;color:var(--muted)}
.progress-top b{color:var(--text);font-weight:500}
.progress-track{height:8px;border-radius:99px;background:var(--surface);
  border:1px solid var(--line-2);overflow:hidden}
.progress-fill{height:100%;width:0;border-radius:99px;
  background:linear-gradient(90deg,var(--accent-2),var(--accent));
  box-shadow:0 0 12px var(--glow);transition:width .6s cubic-bezier(.2,.8,.2,1)}
.unlock-all{white-space:nowrap}

/* ---------- level cards (hub) ---------- */
.levels{list-style:none;display:flex;flex-direction:column;gap:16px;margin:44px 0 130px}
.level{border:1px solid var(--line);border-radius:10px;background:var(--bg-2);
  transition:border-color .3s,box-shadow .3s}
.level.is-unlocked{border-color:var(--line-2)}
.level.is-complete{border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}
.level.is-locked{opacity:.9}

.level-head{display:flex;align-items:center;gap:18px;padding:24px 26px;
  color:inherit;text-decoration:none;border-radius:10px}
.level:not(.is-locked) .level-head{cursor:pointer}
.level:not(.is-locked) .level-head:hover{background:var(--surface)}
.level:not(.is-locked) .level-head:hover .go-arrow{transform:translateX(4px);color:var(--accent)}
.level.is-locked .level-head{cursor:default}
.level-num{font-family:var(--mono);font-size:13px;letter-spacing:.14em;color:var(--muted-2);min-width:26px}
.level-titles{flex:1;min-width:0}
.level-titles h2{font-family:var(--display);font-weight:600;font-size:clamp(19px,2.4vw,25px);
  letter-spacing:-.01em;line-height:1.15}
.level-sub{color:var(--muted);font-size:14px;margin-top:5px}
.level-status{flex:0 0 auto;display:flex;align-items:center;gap:14px}
.go-arrow{font-size:20px;line-height:1;color:var(--muted-2);transition:transform .25s,color .25s}
.level.is-locked .go-arrow{display:none}

/* lock / status pill */
.lock-pill{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:11px;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted-2);
  border:1px solid var(--line-2);border-radius:99px;padding:6px 12px}
.level.is-unlocked .lock-pill{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 45%,transparent)}
.level.is-complete .lock-pill{color:var(--on-accent);background:var(--accent);border-color:var(--accent)}
.lock-pill svg{width:13px;height:13px}

/* locked message (shown only when locked) */
.level-lockmsg{display:none;align-items:center;gap:14px;margin:0 26px 24px;
  padding:15px 17px;border:1px dashed var(--line-2);border-radius:8px;color:var(--muted)}
.level.is-locked .level-lockmsg{display:flex}
.level-lockmsg svg{width:20px;height:20px;flex:0 0 auto;color:var(--muted-2)}
.level-lockmsg p{font-size:13.5px;line-height:1.5}
.level-lockmsg .reveal-btn{background:none;border:0;color:var(--accent);cursor:pointer;
  font:inherit;text-decoration:underline;padding:0}
.level-lockmsg .reveal-btn:hover{color:var(--accent-2)}

/* ---------- step page ---------- */
.step-main{max-width:820px;padding-top:120px;padding-bottom:120px}
.step-head{margin-bottom:34px}
.step-head .step-num{font-family:var(--mono);font-size:12.5px;letter-spacing:.16em;color:var(--muted-2)}
.step-head h1{font-family:var(--display);font-weight:700;letter-spacing:-.02em;
  font-size:clamp(32px,5vw,54px);line-height:1.04;margin:12px 0 12px}
.step-head .lead{margin:0}
.step-status{display:inline-flex;align-items:center;gap:8px;margin-top:18px;
  font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted-2);border:1px solid var(--line-2);border-radius:99px;padding:6px 13px}
.is-step-complete .step-status{color:var(--on-accent);background:var(--accent);border-color:var(--accent)}

/* content typography (shared by step pages) */
.step-content{border-top:1px solid var(--line);padding-top:28px}
.step-content h3{font-family:var(--display);font-weight:600;font-size:17px;margin:26px 0 10px}
.step-content h3:first-child{margin-top:0}
.step-content p,.step-content li{color:var(--prose);font-size:15px;line-height:1.68}
.step-content ul,.step-content ol{padding-left:22px;display:flex;flex-direction:column;gap:7px}
/* an instruction step that other pages deep-link to (e.g. Calibration points at
   the tip ejector step) has to clear the sticky header when it is jumped to */
.step-content ol > li[id]{scroll-margin-top:100px}
.step-content code{font-family:var(--mono);font-size:.9em;background:var(--surface);
  border:1px solid var(--line-2);border-radius:4px;padding:1px 6px;color:var(--text)}
.placeholder-note{display:inline-block;font-family:var(--mono);font-size:11px;letter-spacing:.06em;
  color:var(--muted-2);border:1px dashed var(--line-2);border-radius:5px;padding:4px 9px;margin-bottom:6px}
/* ---------- BOM tables (live Google-Sheet-driven checklists) ----------
   .bom-wrapper is the island panel each <table> sits in; .parts-section /
   .parts-section-label (see parts-list page) provide the divider + category
   label above each one, reused as-is for visual consistency. */
.bom-wrapper{position:relative;z-index:1;background:var(--panel-bg);border-radius:12px;
  padding:6px 22px;overflow-x:auto}
.bom-table{width:100%;min-width:480px;border-collapse:collapse;margin:6px 0;font-size:14px}
.bom-table th,.bom-table td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--island-line)}
.bom-table tr:last-child td{border-bottom:0}
.bom-table th{font-family:var(--display);font-weight:700;font-size:11px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--island-muted)}
.bom-table td{color:var(--island-text);font-size:13.5px}
.bom-check-cell{width:44px;text-align:center!important}
.bom-table input[type="checkbox"]{width:17px;height:17px;accent-color:var(--accent);cursor:pointer}
.bom-link{display:inline-flex;align-items:center;gap:5px;color:var(--island-link);font-weight:500;
  text-decoration:underline;text-underline-offset:2px}
.bom-empty,.bom-error{text-align:center!important;color:var(--island-muted);font-family:var(--mono);
  font-size:12.5px;padding:22px 10px!important}
.bom-error{color:#c14848}

/* ---------- key-item detail call-outs (3D Printer / Pipette) ---------- */
.bom-callout{position:relative;z-index:1;display:flex;gap:26px;align-items:flex-start;flex-wrap:wrap;
  background:var(--panel-bg);border-radius:12px;padding:24px 26px;margin-top:16px}
.bom-callout-photo{flex:0 0 180px;display:flex;align-items:center;justify-content:center}
.bom-callout-photo img{max-width:100%;max-height:190px;border-radius:8px;object-fit:contain}
.bom-callout-body{flex:1 1 320px;min-width:0}
.bom-callout-body h4{font-family:var(--display);font-weight:700;font-size:16px;color:var(--island-text);margin-bottom:8px}
.bom-callout-body p{color:var(--island-muted);font-size:14px;line-height:1.65;margin-bottom:10px}
.bom-callout-body p:last-child{margin-bottom:0}
.bom-callout-body a{color:var(--island-link);text-decoration:underline;text-underline-offset:2px}
.bom-callout-body ul{padding-left:20px;color:var(--island-muted);font-size:13.5px;line-height:1.7;margin-top:8px}
.bom-callout-body ul strong{color:var(--island-text)}
.bom-callout-caption{margin-top:8px;font-family:var(--mono);font-size:11px;font-weight:600;color:var(--island-muted);text-align:center}

@media(max-width:600px){
  .bom-wrapper{padding:6px 14px}
  .bom-callout{padding:20px}
}

/* ---------- parts-list banner (full-bleed within a .step-main step page) ----------
   Breaks out of the 820px step column to span the viewport edge-to-edge, then
   re-centers its content at the wider site max-width. Uses overflow-x:hidden
   on body (base.css) as the guard against the 100vw-vs-scrollbar sliver. */
.parts-banner{width:100vw;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);
  margin-top:36px;margin-bottom:8px;
  background:var(--accent);color:var(--on-accent);text-align:center}
.parts-banner-inner{max-width:var(--maxw);margin:0 auto;padding:56px var(--pad);}
.parts-banner h2{font-family:var(--display);font-weight:700;font-size:clamp(26px,3.6vw,36px);margin-bottom:10px}
.parts-banner p{max-width:52ch;margin:0 auto 26px;font-size:15px;line-height:1.6;opacity:.88}
/* Canonical pill CTA — the white "island" button with a leading icon
   (View Parts List / Download Parts / Go to BOM, …). Content-width by
   design (not full-bleed); center it via text-align:center or justify-
   content:center on its container. Reuse this exact class for any future
   button of this kind rather than introducing a near-duplicate. */
.parts-banner-btn{display:inline-flex;align-items:center;gap:9px;
  background:var(--island-bg);color:var(--island-text);
  font-family:var(--mono);font-size:13px;font-weight:500;letter-spacing:.02em;
  border-radius:99px;padding:12px 22px;box-shadow:0 6px 18px rgba(0,0,0,.18);
  transition:transform .2s,box-shadow .2s}
.parts-banner-btn svg{width:15px;height:15px;flex:none}
.parts-banner-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:14px}
.parts-head-btn{display:flex;width:fit-content;margin-top:28px}
.parts-banner-btn:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(0,0,0,.24)}

/* ---------- assembly step-card list ----------
   Deliberately "light island" cards (fixed white, not theme-flipped — see
   --island-* in tokens.css) so they read as bright, tappable objects against
   the ambient canvas in both themes, the same way .parts-banner-btn does. */
.steps-heading{font-size:clamp(22px,3vw,30px);margin-bottom:6px}
.steps-heading .accent{text-decoration:underline;text-decoration-color:var(--accent-2);
  text-decoration-thickness:3px;text-underline-offset:6px}
.steps-sub{font-family:var(--mono);font-size:12px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted-2);margin-bottom:20px}

.assembly-steps{list-style:none;display:flex;flex-direction:column;gap:14px;margin-top:8px}
.assembly-step-card{position:relative;z-index:1;display:flex;align-items:center;gap:18px;flex-wrap:wrap;
  background:var(--island-bg);border:1px solid var(--accent);border-radius:12px;
  padding:20px 24px;box-shadow:0 0 0 1px var(--accent),0 1px 3px rgba(15,18,23,.05);
  transition:box-shadow .25s,transform .25s}
.assembly-step-card:hover{transform:translateY(-2px);box-shadow:0 0 0 1px var(--accent),0 10px 26px rgba(15,18,23,.12)}

.step-card-dot{flex:none;width:20px;height:20px;border-radius:50%;
  border:2px solid var(--island-line);display:block}
.assembly-step-card.is-complete .step-card-dot{border-color:var(--accent);background:var(--accent)}

.step-card-body{flex:1 1 320px;min-width:0}
.step-card-body h3{font-family:var(--display);font-weight:600;font-size:16px;color:var(--island-text);
  margin:0 0 4px}
.step-card-body p{color:var(--island-muted);font-size:13.5px;line-height:1.55;margin:0 0 8px}
.step-card-time{display:inline-flex;align-items:center;gap:6px;
  font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;color:var(--island-muted)}
.step-card-time svg{width:13px;height:13px}

.step-card-start{flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:var(--island-text);color:var(--island-bg);
  font-family:var(--mono);font-size:12.5px;font-weight:500;letter-spacing:.04em;
  border-radius:99px;padding:11px 30px;transition:opacity .2s}
.step-card-start:hover{opacity:.82}

@media(max-width:640px){
  .assembly-step-card{padding:18px 20px}
  .step-card-start{width:100%;padding:12px 20px;margin-top:4px}
}

/* ---------- "You will need" panel (sub-step pages) ----------
   Fixed light panel (see --panel-bg / --island-* in tokens.css) — same
   theme-independent-island treatment as the step cards on the Assembly
   overview page, so tool/part call-outs read consistently everywhere. */
.need-card{position:relative;z-index:1;background:var(--panel-bg);border-radius:16px;
  padding:28px 30px;margin:24px 0 34px}
/* .step-content already has padding-top for top clearance (see the h3:first-child
   rule below it) — when the placeholder note above need-card is gone, it becomes
   the first child and that padding would double up with this margin-top. */
.step-content .need-card:first-child{margin-top:0}
.need-heading{font-family:var(--display);font-weight:700;font-size:19px;color:var(--island-text);
  margin-bottom:20px}
/* fixed-width items, stretched to their row's height: icons line up along
   the top and sit evenly spaced no matter how long or how many lines each
   label is, while the check box below pins itself to the bottom (see
   .need-check) so the boxes line up too */
.need-list{display:flex;flex-wrap:wrap;align-items:stretch;gap:28px}
.need-item{display:flex;flex-direction:column;align-items:center;gap:10px;width:96px}
.need-icon{width:56px;height:56px;object-fit:contain;flex:none}
.need-label{font-family:var(--display);font-weight:700;font-size:13px;line-height:1.3;
  color:var(--island-text);text-align:center;white-space:pre-line}

/* tick off each tool, fastener and part as you gather it (js/step-checklist.js).
   Reuses the parts-list check box, so it drops the absolute corner placement
   and sits as the item's last row instead. */
/* .need-item qualifier is load-bearing: plain .need-check ties with
   .part-check's own specificity and loses, since that rule sits further
   down the file and would keep the box absolutely placed in the card's
   corner. position:relative (not static) so the tick and the oversized
   hit area in .part-check's ::after/::before stay anchored to the box. */
/* margin-top:auto drops the box to the bottom of the stretched item, so a
   row's boxes line up however many lines each label runs to */
.need-item .need-check{position:relative;top:auto;right:auto;margin-top:auto}
/* only the contents dim when ticked — the box itself has to stay legible */
.need-item.is-checked .need-icon,
.need-item.is-checked .need-label,
.need-item.is-checked .part-name,
.need-item.is-checked .part-thumb{opacity:.38}

/* ---------- parts panel (sub-step pages) ----------
   The CAD parts that get installed in this sub-step, in the same island
   panel as "You will need" directly above it. Items are wider than the
   96px tool/fastener ones because the CAD renders are ~2.3:1 landscape,
   so a 56px-square icon frame would shrink them to an unreadable strip.
   Reuses .part-name / .part-thumb from the parts-list page so a part
   looks the same wherever it appears. */
.need-list--parts{gap:22px 26px}
.need-item--part{width:160px}
/* min-height reserves two lines so a name that wraps ("Frame Linear
   Actuator Mount") doesn't push its render below the ones beside it */
.need-item--part .part-name{margin-bottom:0;text-align:center;
  line-height:1.3;min-height:2.6em}
/* Sized by HEIGHT, not width: every CAD render shares one 1920x844 canvas
   in which the part is centred and ~75-85% of the canvas height, but only
   8-66% of its width (a long thin ejector vs. a wide bed plate). Fitting
   to the box width would therefore shrink the narrow parts to a sliver,
   so the image is scaled to a fixed height and allowed to run past the
   box — what overflows is the transparent padding, not the part. The
   heights here and in the media query below are picked so the widest
   part (bed plate, 66%) still fits its box, so nothing is ever clipped. */
.need-item--part .part-thumb{width:100%;height:88px;overflow:hidden}
/* clicking a part render opens it in the lightbox (see js/lightbox.js) */
.need-item--part .part-thumb img{height:88px;width:auto;max-width:none;max-height:none;
  cursor:zoom-in}
/* Photos keep the background they were shot against, so unlike the cut-out CAD
   renders they meet their box as a hard rectangle. Rounding softens that against
   the card's own 16px corners. */
.need-item--photo .part-thumb img{border-radius:8px}

@media(max-width:640px){
  .need-card{padding:22px 20px}
  .need-list{gap:26px}
  /* a tighter column gap and slightly smaller items fit two parts per row
     in the ~295px the card leaves at 375px wide, instead of one per row */
  .need-list--parts{gap:22px 20px}
  .need-item--part{width:130px}
  .need-item--part .part-thumb,
  .need-item--part .part-thumb img{height:80px}
}

/* ---------- in-step reference photos (sub-step pages) ---------- */
.step-figure{margin:12px auto 0;max-width:480px}
/* :has(img) — scopes the white card frame to photo figures only, not the
   video figure (.step-video already has its own dark-bordered box; double-
   framing it wasn't asked for). position:relative;z-index:1 is the actual
   fix for "seeing the grid in the image" — .step-figure never got the
   same treatment .assembly-step-card needed for the same reason: a plain
   block element with an opaque background still paints BELOW the fixed,
   z-index:0 .ambient grid layer unless it's lifted into its own stacking
   context, so the grid showed through even though the image is opaque. */
.step-figure:has(img){position:relative;z-index:1;background:var(--figure-bg);
  border-radius:12px;padding:20px;box-shadow:var(--figure-shadow)}
/* opt back into the fixed-white mat: for transparent PNG/SVG line art, the mat
   is what makes the artwork legible, so it must not follow the theme */
.step-figure--plate:has(img){background:var(--island-bg);
  box-shadow:0 1px 3px rgba(15,18,23,.06),0 10px 26px rgba(15,18,23,.08)}
.step-figure img{width:100%;border-radius:6px;display:block}
.step-figure figcaption{margin-top:10px;font-family:var(--mono);font-size:12px;font-weight:600;color:var(--figure-caption);text-align:center}
.step-figure--plate figcaption{color:var(--island-muted)}
.step-figure-group{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;margin-top:12px}
/* margin:0 (not just margin-top) — .step-figure's own margin shorthand
   sets left/right:auto for standalone centering, and auto side-margins on
   a flex item individually absorb free space (the classic flexbox
   auto-margin trick), which blew the gap between two grouped figures out
   to ~63px instead of the intended 16px. Confirmed via measurement, not
   flex-grow as first suspected — reset all four margin longhands here. */
.step-figure-group .step-figure{margin:0;flex:1 1 200px}
/* smaller variant — e.g. a supporting/secondary photo that doesn't need full size */
.step-figure--sm{max-width:280px}
/* medium variant — e.g. a 16:9 video paired with a portrait --sm photo:
   video height = width * 9/16, so at equal width it renders far shorter
   than a tall photo; a wider cap here gets it closer in visual weight
   without matching the photo's height exactly (that'd take ~660px wide) */
.step-figure--md{max-width:1080px}
/* embedded video (e.g. YouTube) sitting inside a .step-figure, same rounded/
   bordered treatment as .step-figure img, sized by aspect-ratio instead of
   a fixed height so it stays responsive at whatever width the figure gets */
.step-video{position:relative;height:100%;aspect-ratio:16/9;border-radius:10px;
  overflow:hidden;border:1px solid var(--line-2)}
.step-video iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* ---------- tutorial video list (steps/tutorial-videos.html) ----------
   One <li> per video, in watch order — the list marker carries the number.
   .step-video already draws the 16/9 box, so all this has to do is open up
   the spacing from the tight default .step-content ol uses for prose steps. */
.step-content .video-steps{gap:30px}
/* each <li> is an anchor target for deep links from the sub-step pages */
.step-content .video-steps > li{scroll-margin-top:100px}
.step-content .video-steps .step-figure{margin-top:6px}
/* caption sits ABOVE its player here (see the page markup), so the list
   number lines up with the title rather than the player's bottom edge */
.step-content .video-steps figcaption{margin:0 0 10px;text-align:left;color:var(--muted)}

/* ---------- links into the tutorial videos (sub-step pages) ----------
   One row per clip, linking to steps/tutorial-videos.html at that video's
   anchor. A bare <a> is color:inherit;text-decoration:none site-wide
   (base.css), so each row carries its own affordance instead: accent play
   icon, a border that lights up, and a nudge on hover. */
.step-content .video-links{list-style:none;padding-left:0;gap:8px;margin:12px 0 0}
.video-links a{display:flex;align-items:center;gap:12px;padding:11px 14px;
  background:var(--surface);border:1px solid var(--line-2);border-radius:9px;
  transition:border-color .2s,background .2s,transform .2s}
.video-links a:hover{border-color:var(--accent);background:var(--bg-2);transform:translateX(3px)}
.video-links a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.video-links svg{flex:none;width:18px;height:18px;color:var(--accent)}
/* --muted, not the dimmer --muted-2 used for pure chrome: this label carries
   the video number, so it has to clear AA against the row at 11.5px */
.video-links .vl-num{flex:none;font-family:var(--mono);font-size:11.5px;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted)}
.video-links .vl-title{flex:1 1 auto;min-width:0;color:var(--text);font-size:14.5px;line-height:1.45}
@media(max-width:560px){
  .video-links a{align-items:flex-start}
  .video-links svg,.video-links .vl-num{margin-top:1px}
}

/* ---------- explanation card (sub-step pages) ----------
   Same fixed-light "island" surface as .need-card / .callout-important,
   just with a visible --accent border instead of the vertical bar, and a
   book icon — site colors/fonts standing in for the reference mockup's
   peach/orange styling. */
.explain-card{position:relative;z-index:1;display:flex;gap:16px;align-items:flex-start;
  background:var(--panel-bg);border:1px solid var(--accent);border-radius:10px;
  padding:22px 26px;margin-top:16px}
.explain-icon{flex:none;width:22px;height:22px;color:var(--accent);margin-top:2px}
.explain-body h4{font-family:var(--display);font-weight:700;font-size:14px;letter-spacing:.02em;
  text-transform:uppercase;color:var(--island-text);margin-bottom:10px}
.explain-body p{color:var(--island-muted);font-size:14px;line-height:1.7}
/* base.css zeroes every margin, so an explain card's own blocks need their own
   rhythm — without this its paragraphs run together. */
.explain-body > * + *{margin-top:10px}
/* A list inside an explain card. The card paints --panel-bg, a pale island in
   BOTH themes, so list text must take the island tokens like .explain-body p
   above: inheriting --text would put near-white on pale blue in dark mode.
   padding-left repeats .step-content ul's 22px so a card used outside
   .step-content still clears its markers; that rule's flex gap spaces the
   items, so no per-item margin here. */
.explain-body ul{padding-left:22px}
.explain-body li{color:var(--island-muted);font-size:14px;line-height:1.7}
.explain-body li strong{color:var(--island-text);font-weight:600}
/* base.css makes every <a> color:inherit;text-decoration:none, so a link in
   here would be invisible as a link. --island-link is the token for exactly
   this: legible on the fixed-light panels in both themes (see .part-more). */
.explain-body a{color:var(--island-link);text-decoration:underline}
.explain-body li::marker{color:var(--accent)}
/* Same reason .callout-warning and .guide-table override it below: a code chip
   sitting on a pale island must not use the dark --surface/--text pair. */
.step-content .explain-card code{background:#f1f3f6;color:var(--island-text)}

/* Expandable explain card — a native <details>, so it needs no JS and is
   keyboard-operable for free. .explain-card is display:flex with the icon as a
   flex child; a <details> has to stack instead, hence the block override. */
details.explain-card{display:block}
details.explain-card > summary{display:flex;align-items:center;gap:16px;cursor:pointer;
  font-family:var(--display);font-weight:700;font-size:14px;letter-spacing:.02em;
  text-transform:uppercase;color:var(--island-text);list-style:none}
/* both halves of hiding the default triangle — WebKit uses its own pseudo */
details.explain-card > summary::-webkit-details-marker{display:none}
details.explain-card > summary::marker{content:""}
/* chevron, rotated when open */
details.explain-card > summary::after{content:"";flex:none;margin-left:auto;width:8px;height:8px;
  border-right:2px solid var(--island-muted);border-bottom:2px solid var(--island-muted);
  transform:rotate(45deg) translate(-2px,-2px);transition:transform .2s}
details.explain-card[open] > summary::after{transform:rotate(-135deg)}
details.explain-card > summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:4px}
details.explain-card > .explain-body{margin-top:14px}

@media(max-width:520px){
  .explain-card{padding:18px 20px;gap:12px}
}

/* ---------- important note + persisted input (sub-step pages) ---------- */
.callout-row{display:flex;flex-wrap:wrap;align-items:stretch;gap:16px;margin-top:16px}
.callout-important{flex:2 1 320px;position:relative;background:var(--island-bg);
  border:1px solid var(--island-line);border-radius:10px;padding:16px 20px 16px 26px;
  display:flex;align-items:center}
.callout-important::before{content:"";position:absolute;left:10px;top:14px;bottom:14px;
  width:3px;border-radius:2px;background:var(--island-muted)}
.callout-important p{color:var(--island-text);font-size:14px;line-height:1.6;margin:0}
.callout-important strong{font-weight:700}

.chip-version-box{flex:1 1 190px;background:var(--island-bg);border:2px solid var(--accent);
  border-radius:10px;padding:14px 18px;display:flex;flex-direction:column;justify-content:center;gap:9px}
.chip-version-box label{font-family:var(--display);font-weight:700;font-size:14px;line-height:1.25;color:var(--island-text)}
.chip-version-box input{border:1px solid var(--island-line);border-radius:6px;padding:8px 10px;
  font-family:var(--body);font-size:14px;color:var(--island-text);background:var(--island-bg);width:100%}
.chip-version-box input:focus{outline:2px solid var(--accent);outline-offset:1px}

/* ---------- long-form guide pages (e.g. software/gui.html) ---------- */
/* "On this page" sidebar (js/toc.js). Wide screens: three columns with
   equal-width outer tracks, so the content column stays centered on the page
   (as on the other step pages) and the sidebar sits in the right-hand track,
   sticking under the fixed .build-nav. The content column narrows as the
   viewport does to keep room for the sidebar.
   Narrow screens: falls back to a plain block between head and content. */
@media(min-width:1180px){
  .step-main.has-toc{max-width:none;display:grid;
    grid-template-columns:minmax(210px,1fr) minmax(0,740px) minmax(210px,1fr);column-gap:40px;align-items:start}
  .step-main.has-toc > *{grid-column:2}
  .step-main.has-toc > .guide-toc{grid-column:3;grid-row:1 / span 2;justify-self:start;width:100%;max-width:250px;
    position:sticky;top:110px;max-height:calc(100vh - 140px);overflow-y:auto;overscroll-behavior:contain}
}
.guide-toc{position:relative;z-index:1;border-left:1px solid var(--line);padding:4px 0 4px 18px;margin-bottom:28px;
  scrollbar-width:thin}
.guide-toc-title{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted-2);margin-bottom:12px}
.guide-toc ol{list-style:none;margin:0;padding:0}
.guide-toc-list > li + li{margin-top:8px}
.guide-toc a{position:relative;display:block;font-size:13.5px;line-height:1.4;color:var(--muted);
  padding:3px 0;transition:color .2s}
.guide-toc a:hover{color:var(--text)}
.guide-toc-list > li > a{font-family:var(--display);font-weight:600;font-size:14px}
.guide-toc-list ol{display:none;margin:4px 0 2px;padding-left:12px}
.guide-toc-list li.is-open > ol{display:block}
.guide-toc-list ol li.is-deep{padding-left:12px}
.guide-toc-list ol a{font-size:13px}
.guide-toc a.is-active{color:var(--accent)}
.guide-toc a.is-active::before{content:"";position:absolute;left:-19px;top:3px;bottom:3px;width:2px;
  border-radius:2px;background:var(--accent)}
.guide-toc-list ol li.is-deep a.is-active::before{left:-43px}
.guide-toc-list ol > li > a.is-active::before{left:-31px}
@media(max-width:1179px){
  .guide-toc-list li > ol{display:none!important}
}
.is-step-locked .guide-toc{display:none}
.step-content .guide-features{margin:0}
/* --island-text is the dark ink for pale island panels. A .guide-features list
   is used BOTH inside an island (.need-card / .explain-card) and bare on the
   ambient page, where that ink rendered near-black on the dark canvas — so the
   island colour is scoped to the islands and the bare list takes prose colour. */
.step-content .guide-features li{color:var(--prose);font-size:14.5px}
.step-content .need-card .guide-features li,
.step-content .explain-card .guide-features li{color:var(--island-text)}
.guide-section{padding-top:34px;margin-top:34px;border-top:1px solid var(--line);scroll-margin-top:100px}
.step-content .guide-section h2{font-family:var(--display);font-weight:700;font-size:clamp(21px,2.6vw,26px);margin-bottom:12px}
.guide-section h4{font-family:var(--display);font-weight:600;font-size:13px;letter-spacing:.06em;
  text-transform:uppercase;color:var(--text);margin:22px 0 6px}
.guide-section .explain-body h4{font-weight:700;font-size:14px;letter-spacing:.02em;color:var(--island-text);margin:0 0 10px}
.guide h3{scroll-margin-top:100px}
/* ".guide-section" alone would miss the intro paragraphs, which sit directly
   under .step-content.guide ABOVE the first section — with more than one of
   them they ran together as a single block (no margin on <p> by default). */
.guide-section p + p,
.step-content.guide > p + p{margin-top:10px}
.guide-section ul,.guide-section ol{margin:10px 0}
.guide-section strong{color:var(--text);font-weight:600}
/* ...but NOT inside the fixed-light "island" panels (see --island-* in
   tokens.css): those stay pale in BOTH themes, while --text flips to
   near-white in dark mode — which painted <strong> near-white on near-white,
   at a contrast ratio of 1.04. It wiped out the Set/Save button names on the
   calibration page and the whole part-category column on printing
   instructions. .callout-warning needs no entry: its own amber rule wins. */
.step-content .guide-table strong,
.step-content .need-card strong,
.step-content .explain-card strong,
.step-content .callout-important strong,
.step-content .guide-diagram strong{color:var(--island-text)}
.guide-section > p a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.code-block{position:relative;z-index:1;margin:10px 0 14px;background:#0f1217;color:#e6e9ee;
  border:1px solid var(--line-2);border-radius:8px;padding:14px 18px;overflow-x:auto;
  font-family:var(--mono);font-size:13.5px;line-height:1.6;white-space:pre}
.step-content .code-block code{background:none;border:0;border-radius:0;padding:0;color:inherit;font-size:inherit}
.callout-warning{position:relative;z-index:1;background:var(--island-bg);border:1px solid #e8a33d;
  border-left:4px solid #e8a33d;border-radius:10px;padding:14px 18px;margin:14px 0}
.step-content .callout-warning p{color:var(--island-text);font-size:14px;line-height:1.6;margin:0}
.step-content .callout-warning p + p{margin-top:10px}
.step-content .callout-warning strong{color:#b36b00}
.step-content .callout-warning code{background:#f1f3f6;color:var(--island-text)}
.step-content .callout-important code{background:#f1f3f6;color:var(--island-text)}
.guide-table-wrap{position:relative;z-index:1;background:var(--panel-bg);border-radius:12px;padding:6px 20px;
  margin-top:12px;overflow-x:auto}
.guide-table{width:100%;min-width:460px;border-collapse:collapse;font-size:14px}
.guide-table th,.guide-table td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--island-line);vertical-align:top}
.guide-table tr:last-child td{border-bottom:0}
.guide-table th{font-family:var(--display);font-weight:700;font-size:11px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--island-muted)}
.guide-table td{color:var(--island-text);line-height:1.55}
.step-content .guide-table code{background:#f1f3f6;color:var(--island-text);white-space:nowrap}

/* ---------- schematic diagrams inside a guide (.guide-diagram) ----------
   Same pale --panel-bg island as .guide-table-wrap, so an inline <svg> line
   drawing sits on a surface that is light in BOTH themes — which is why the
   strokes/labels below key off the fixed --island-* tokens rather than
   --text/--muted (those flip with the theme and would go invisible here). */
.guide-diagram{position:relative;z-index:1;background:var(--panel-bg);border-radius:12px;
  padding:20px 22px 14px;margin-top:14px;overflow-x:auto}
.guide-diagram svg{display:block;width:100%;min-width:560px;height:auto}
.guide-diagram text{font-family:var(--mono);font-size:11px;fill:var(--island-text)}
.guide-diagram .d-muted{fill:var(--island-muted);font-size:10px}
.guide-diagram .d-head{font-family:var(--display);font-size:12px;font-weight:700}
.guide-diagram .d-label{fill:var(--island-link);font-weight:600}
/* fill:none on every stroked shape — an SVG <path>/<rect> defaults to black fill */
.guide-diagram .d-line,.guide-diagram .d-dash,.guide-diagram .d-arrow{fill:none;stroke-width:1.5}
.guide-diagram .d-line{stroke:var(--island-text);stroke-opacity:.5}
.guide-diagram .d-dash{stroke:var(--island-muted);stroke-opacity:.9;stroke-dasharray:4 4}
.guide-diagram .d-arrow{stroke:var(--island-link)}
.guide-diagram .d-arrow--dash{stroke-dasharray:4 3}
.guide-diagram .d-box{fill:var(--island-text);fill-opacity:.06;stroke:var(--island-text);
  stroke-opacity:.45;stroke-width:1.5}
.guide-diagram .d-liquid{fill:var(--island-link);fill-opacity:.2;stroke:none}
/* markers do NOT inherit fill from the element that references them */
.guide-diagram marker path{fill:var(--island-link)}
.guide-diagram figcaption{margin-top:12px;font-family:var(--mono);font-size:11.5px;
  color:var(--island-muted);text-align:center}
.step-figure--lg{max-width:760px}

.step-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:42px}
/* display:flex above would otherwise override [hidden] (set on locked steps by js/build-step.js) */
.step-actions[hidden]{display:none}
.complete-btn.is-complete{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.step-actions .hint{font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;color:var(--muted-2)}

/* ---------- parts-list checklist page ----------
   Reuses .step-head as-is (same class as Assembly's header) so both pages'
   titles land at exactly the same vertical position — no page-specific
   override here on purpose. */
.parts-progress{font-family:var(--mono);font-size:12.5px;letter-spacing:.04em;color:var(--muted-2);margin-top:14px}
.parts-progress b{color:var(--accent);font-weight:500}

.parts-section{padding-top:30px;border-top:1px solid var(--line);margin-top:34px}
.parts-section:first-of-type{margin-top:44px}
/* Parts List header ends in a button, so tighten the gap to the divider below it */
.step-head--with-btn{margin-bottom:24px}
.step-head--with-btn + .parts-section{margin-top:24px}
/* .step-content already draws its own top border + padding (build.css above)
   before the first section — without this, the BOM page (where .parts-section
   sits inside .step-content, unlike the standalone parts-list page) would
   double up: two rules and too much gap stacked back to back. */
.step-content .parts-section:first-child{margin-top:0;padding-top:0;border-top:0}
.parts-section-label{font-family:var(--display);font-weight:700;font-size:12px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted-2);margin-bottom:18px}

.parts-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}

.part-card{position:relative;z-index:1;background:var(--panel-bg);border:2px solid transparent;
  border-radius:12px;padding:20px;cursor:pointer;user-select:none;
  transition:border-color .2s,box-shadow .2s;outline-offset:2px}
.part-card:hover{box-shadow:0 8px 20px rgba(15,18,23,.08)}
.part-name{font-family:var(--display);font-weight:700;font-size:14.5px;color:var(--island-text);margin-bottom:14px}
/* Parts are numbered in page order, continuing across sections (1–17), via a
   CSS counter so the numbers stay correct when cards are added or reordered.
   The number sits on its own line, level with the check box, so the name
   below gets the card's full width instead of wrapping around the box. */
.step-main:has(.part-card){counter-reset:part}
.part-card{counter-increment:part}
.part-card .part-name::before{content:counter(part) ".";display:block;margin-bottom:6px;font-family:var(--mono);
  font-size:13px;line-height:18px;font-weight:600;color:var(--accent)}
.part-thumb{display:flex;align-items:center;justify-content:center;height:82px}
.part-thumb img{max-width:100%;max-height:82px;object-fit:contain}

.part-check{position:absolute;top:18px;right:18px;width:18px;height:18px;border-radius:5px;
  border:2px solid var(--island-line);background:var(--island-bg);cursor:pointer}
/* bigger invisible hit area around the small check box */
.part-check::before{content:"";position:absolute;inset:-10px}
.part-card.is-checked{border-color:var(--accent);box-shadow:0 8px 20px var(--glow-soft)}
/* the filled box + tick is shared with the sub-step "you will need"/parts
   items (.need-item), so it keys off .is-checked rather than .part-card */
.is-checked > .part-check{background:var(--accent);border-color:var(--accent)}
.is-checked > .part-check::after{content:"";position:absolute;left:3px;top:0px;width:5px;height:9px;
  border:solid var(--on-accent);border-width:0 2px 2px 0;transform:rotate(45deg)}

.part-more{margin-top:10px;background:none;border:0;padding:0;font-family:var(--body);font-size:12.5px;
  color:var(--island-link);text-decoration:underline;cursor:pointer}
.part-more-panel{margin-top:12px;padding-top:12px;border-top:1px solid var(--island-line);
  display:flex;flex-direction:column;align-items:center;gap:8px}
.part-more-panel img{max-width:100%;max-height:82px;object-fit:contain}
.part-more-panel span{font-family:var(--mono);font-size:11px;color:var(--island-muted)}

.parts-section-actions{margin-top:22px;text-align:center}
@media(max-width:900px){.parts-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:640px){.parts-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:420px){.parts-grid{grid-template-columns:1fr}}

/* locked step notice (shown when a level is reached out of order) */
.step-locked{border:1px dashed var(--line-2);border-radius:10px;background:var(--bg-2);
  padding:40px 32px;text-align:center;margin-top:8px}
.step-locked svg{width:34px;height:34px;color:var(--muted-2);margin-bottom:14px}
.step-locked h3{font-family:var(--display);font-weight:600;font-size:20px;margin-bottom:8px}
.step-locked p{color:var(--muted);font-size:15px;line-height:1.6;max-width:44ch;margin:0 auto}
.step-locked strong{color:var(--text);font-weight:500}
.step-locked-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:24px}

.step-nav{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  margin-top:60px;padding-top:26px;border-top:1px solid var(--line)}
.step-nav .step-next{margin-left:auto}
.step-nav .step-hub{font-family:var(--mono);font-size:12px;letter-spacing:.06em;color:var(--muted)}
.step-nav .step-hub:hover{color:var(--text)}

/* ---------- mascot (injected by js/mascot.js) ---------- */
.mascot{position:fixed;left:20px;bottom:20px;z-index:9998;
  display:flex;align-items:flex-end;gap:12px;pointer-events:none}
.mascot-figure{width:96px;height:auto;cursor:pointer;pointer-events:auto;
  filter:drop-shadow(0 8px 22px rgba(0,0,0,.4));
  transition:transform .3s cubic-bezier(.2,.8,.2,1)}
.mascot-figure:hover{transform:translateY(-4px) rotate(-3deg)}
.mascot.bob .mascot-figure{animation:mascot-bob 2.4s ease-in-out infinite}
.mascot.react .mascot-figure{animation:mascot-pop .6s cubic-bezier(.2,1.4,.4,1)}
@keyframes mascot-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes mascot-pop{0%{transform:scale(1)}40%{transform:scale(1.12) rotate(-5deg)}100%{transform:scale(1)}}

.mascot-bubble{pointer-events:auto;position:relative;max-width:230px;margin-bottom:26px;
  background:var(--surface);border:1px solid var(--line-2);border-radius:12px;
  padding:12px 15px;font-size:13.5px;line-height:1.5;color:var(--text);
  box-shadow:0 10px 30px rgba(0,0,0,.4);
  opacity:0;transform:translateY(8px) scale(.96);transform-origin:0 100%;
  transition:opacity .3s,transform .3s;visibility:hidden}
.mascot.speaking .mascot-bubble{opacity:1;transform:none;visibility:visible}
.mascot-bubble::after{content:"";position:absolute;left:-7px;bottom:16px;width:12px;height:12px;
  background:var(--surface);border-left:1px solid var(--line-2);border-bottom:1px solid var(--line-2);
  transform:rotate(45deg)}
.mascot-bubble .m-name{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--accent);margin-bottom:4px}
.mascot-figure .m-eye{fill:var(--on-accent)}
.mascot-figure .m-mouth{fill:none;stroke:var(--on-accent);stroke-width:3;stroke-linecap:round}

@media(prefers-reduced-motion:reduce){
  .mascot.bob .mascot-figure,.mascot.react .mascot-figure{animation:none}
  .progress-fill{transition:none}
}

/* ---------- responsive ---------- */
@media(max-width:720px){
  .build-nav-inner{height:68px}
  .build-brand img{height:50px}
}
@media(max-width:640px){
  .level-head{flex-wrap:wrap;gap:12px}
  .level-status{order:3;width:100%}
  .mascot{transform:scale(.82);transform-origin:0 100%}
}

/* ---------- image lightbox (js/lightbox.js) ----------
   Click any in-step reference photo to view it larger. The overlay is a
   single shared element injected once by the script, styled as a fixed
   dark backdrop regardless of site theme — the conventional look for a
   photo viewer, and it reads fine over either theme's page underneath. */
.step-figure img,.bom-callout-photo img,.part-card{cursor:zoom-in}
.lightbox-overlay{position:fixed;inset:0;z-index:999;display:flex;align-items:center;justify-content:center;
  background:rgba(4,6,10,.88);padding:56px 40px;opacity:0;visibility:hidden;transition:opacity .25s}
.lightbox-overlay.is-open{opacity:1;visibility:visible}
.lightbox-overlay img{max-width:100%;max-height:80vh;border-radius:8px;
  box-shadow:0 20px 60px rgba(0,0,0,.5);cursor:default;display:block}
.lightbox-caption{position:absolute;left:0;right:0;bottom:22px;text-align:center;
  font-family:var(--mono);font-size:12.5px;font-weight:600;color:#D8DEE6;padding:0 60px}
.lightbox-close{position:absolute;top:20px;right:24px;width:40px;height:40px;border-radius:50%;
  border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .2s}
.lightbox-close:hover{background:rgba(255,255,255,.18)}
.lightbox-close svg{width:18px;height:18px}

@media(prefers-reduced-motion:reduce){
  .lightbox-overlay{transition:none}
}
