/* Colours come from /windrose.css; the local names are kept so the rules
   below did not have to be rewritten one at a time. */
:root {
  color-scheme:dark;
  --ink:var(--wr-ink);
  --muted:var(--wr-ink-muted);
  --line:var(--wr-rule);
  --blue:var(--wr-accent);
  --hot:var(--wr-hot);
  --paper:var(--wr-card);
  --bg:var(--wr-page)
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:14px/1.5 var(--wr-body);
  height:100dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden
}
body.embed {
  background:var(--paper)
}
button,input,select {
  font:inherit;
  color:inherit
}
button,select {
  cursor:pointer
}
button,input,select {
  border:1px solid var(--wr-rule-strong);
  border-radius:6px;
  background:var(--wr-card);
  color:var(--wr-ink);
  padding:8px
}
button:hover {
  background:var(--wr-accent-tint)
}
button:disabled {
  opacity:.4;
  cursor:default
}
a {
  color:var(--blue)
}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible {
  outline:3px solid var(--wr-accent);
  outline-offset:2px
}
header {
  background:var(--wr-mast);
  color:var(--wr-mast-ink);
  display:flex;
  justify-content:flex-start;
  align-items:flex-end;
  gap:24px;
  padding:18px 24px
}
body.embed header {
  display:none
}
header .eyebrow {
  font-size:10px;
  
  color:#b7d7ed;
  text-decoration:none
}
h1 {
  font-size:26px;
  line-height:1.2;
  margin:5px 0 8px;
  font-weight:600;
  }
header p {
  font-size:12px;
  margin:0;
  color:#c3d3df
}
header label {
  font-size:11px;
  min-width:150px;
  margin-left:auto
}
header .flow-link {
  color:var(--wr-mast-ink);
  white-space:nowrap;
  font-size:12px;
}
header select {
  display:block;
  width:100%;
  margin-top:4px
}
h2 {
  font-size:16px;
  margin:3px 0 6px;
  line-height:1.4
}
h3 {
  font-size:13px;
  margin:20px 0 8px
}
small,.note {
  color:var(--muted);
  font-size:11px;
  line-height:1.6
}
main {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  gap:12px;
  padding:12px;
  flex:1;
  min-height:0;
  overflow:hidden
}
body.embed main {
  grid-template-columns:minmax(0,1fr);
  height:100dvh;
  min-height:0;
  padding:10px
}
.panel {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:9px;
  min-height:0;
  min-width:0;
  overflow:hidden
}
.panel-head {
  padding:14px;
  border-bottom:1px solid var(--line)
}
.panel-head small {
  display:block
}
.panel-head a {
  font-size:12px
}
.head-links {
  display:flex;
  flex-wrap:wrap;
  gap:4px 16px;
  margin-top:6px
}
.step-column {
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0
}
.step-column .instructions,
.step-column .navigator {
  min-height:0;
  border:0;
  border-radius:0;
  background:transparent;
  max-height:none
}
.step-column .instructions {
  flex:0 1 auto;
  max-height:46%;
  overflow:auto
}
.step-column .navigator {
  flex:1 1 auto
}
.step-column .navigator {
  border-top:1px solid var(--line)
}
.navigator {
  display:flex;
  flex-direction:column
}
body.embed .navigator,
body.embed .references {
  display:none
}
.navigator label {
  font-size:11px;
  font-weight:600;
  display:block;
  margin-bottom:5px
}
.navigator input,.navigator select {
  width:100%;
  font-size:12px
}
.navigator input {
  margin-bottom:12px
}
#stationMeta {
  margin-top:8px
}
#operationList {
  overflow:auto;
  flex:1;
  min-height:0
}
.operation {
  display:block;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:var(--wr-card);
  text-align:left;
  padding:8px 14px;
  width:100%;
  scroll-margin:4px
}
.operation strong {
  display:block;
  font-size:12px;
  font-weight:600;
  line-height:1.5
}
.operation small {
  font-size:10px
}
.operation.active {
  background:var(--wr-notice);
  box-shadow:inset 3px 0 var(--hot)
}
.operation.active strong {
  color:var(--wr-notice-ink)
}
.op-code {
  font-size:10px;
  color:var(--blue);
  font-weight:600;
  }
.workarea {
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:minmax(0,1fr)
}
body.embed .workarea {
  height:100%;
  grid-template-rows:minmax(320px,1.2fr) minmax(220px,.8fr)
}
.stage {
  position:relative;
  overflow:hidden;
  min-height:0;
  height:100%;
  border:1px solid var(--wr-rule-strong);
  border-radius:9px;
  background:radial-gradient(ellipse at 50% 40%,var(--wr-card),var(--wr-page))
}
/* page-width.css pads every .stage by the page gutter. That inset is not
   uniform, so the truck bitmap was drawn for a wider frame than the canvas. */
main .workarea > .stage {
  padding-left:0 !important;
  padding-right:0 !important
}
#xray {
  display:none;
  position:absolute;
  z-index:6;
  top:12px;
  left:12px;
  width:min(300px,86%);
  max-height:calc(100% - 24px);
  overflow:auto;
  padding:14px;
  background:var(--paper);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:9px
}
html.xray-open #xray {
  display:block
}
#xray h2 {
  margin:4px 0 8px
}
#xray p {
  margin:0 0 8px
}
body.embed .stage {
  min-height:0
}
canvas {
  display:block;
  width:100%;
  height:100%
}
.hud {
  position:absolute;
  left:14px;
  top:12px;
  right:14px;
  pointer-events:none
}
.hud strong {
  font-size:12px;
  display:block
}
.hud span {
  display:block;
  font-size:11px;
  color:var(--wr-ink-muted);
  max-width:450px;
  white-space:pre-line
}
.stage-tools {
  position:absolute;
  bottom:12px;
  left:12px;
  display:flex;
  gap:6px;
  align-items:center
}
.stage-tools button,.stage-tools label {
  background:color-mix(in srgb,var(--wr-card) 94%,transparent);
  padding:6px 8px;
  font-size:10px;
  border:1px solid var(--wr-rule-strong);
  border-radius:5px
}
.stage-tools input {
  vertical-align:middle;
  margin:0 3px 0 0
}
.gesture {
  position:absolute;
  bottom:49px;
  left:14px;
  font-size:9px;
  color:var(--muted)
}
.instructions {
  overflow:auto
}
body.wr-photos .instructions .wr-cut,
body.wr-photos .references .wr-cut {
  display:block !important
}
body.wr-photos #unresolvedList li.wr-cut,
body.wr-photos #detailBlocks li.wr-cut {
  display:list-item !important
}
body:not(.embed) .instructions #instructionText,
body:not(.embed) .instructions details {
  display:none
}
#detailLead {
  font-size:15px;
  line-height:1.7;
  margin:0 0 12px
}
#detailBlocks h3 {
  font-size:13px;
  margin:14px 0 6px
}
#detailBlocks ul {
  margin:0;
  padding-left:18px
}
#detailBlocks li {
  margin:3px 0
}
body.embed .instructions {
  max-height:none
}
.instruction-body {
  padding:14px
}
.step-controls {
  display:flex;
  gap:8px
}
.step-controls select {
  flex:1;
  width:0;
  min-width:0;
  font-size:12px
}
.step-controls button {
  padding:7px 13px
}
#instructionText {
  display:block;
  font-size:14px;
  line-height:1.8;
  margin:13px 0
}
.note {
  margin:10px 0
}
details {
  border-top:1px solid var(--line);
  margin-top:12px;
  padding-top:10px;
  font-size:12px
}
summary {
  cursor:pointer;
  color:var(--blue)
}
#fullText {
  white-space:pre-line;
  font-size:12px;
  line-height:1.8;
  padding:10px 0
}
.references {
  overflow:auto
}
body.embed .references {
  overflow:visible
}
.reference-body {
  padding:12px
}
.part-stage {
  height:215px;
  border:1px solid var(--line);
  border-radius:7px;
  position:relative;
  background:var(--wr-rail);
  overflow:hidden
}
#partStatus {
  position:absolute;
  bottom:7px;
  left:8px;
  right:8px;
  font-size:10px;
  background:color-mix(in srgb,var(--wr-card) 93%,transparent);
  padding:5px 7px;
  border-radius:4px;
  color:var(--wr-ink)
}
#partInfo {
  font-size:11px;
  overflow-wrap:anywhere;
  margin:8px 0
}
.part {
  width:100%;
  text-align:left;
  display:block;
  border-color:var(--line);
  margin-top:6px;
  padding:8px 10px
}
.part strong {
  font-size:12px;
  font-weight:600;
  display:block
}
.part small {
  display:block;
  font-size:10px
}
.part.active {
  background:var(--wr-notice);
  border-color:var(--wr-notice-line)
}
.part.unavailable {
  background:var(--wr-rail);
  color:var(--wr-ink-muted)
}
#unresolvedList {
  padding-left:18px;
  line-height:1.8;
  color:var(--muted)
}
.gallery,#gallery {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px
}
.gallery img,#gallery img {
  width:100%;
  height:110px;
  object-fit:contain;
  background:var(--wr-rail);
  border:1px solid var(--line);
  border-radius:5px
}
.empty {
  padding:18px;
  color:var(--muted);
  font-size:12px
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
header select {
  color:var(--ink)
}
.hud {
  background:color-mix(in srgb,var(--wr-rail) 91%,transparent);
  border-radius:5px;
  padding:7px 9px
}
@media(max-width:800px) {
  main {
    grid-template-columns:minmax(0,1fr);
    min-height:0
  }
  .step-column,
  .workarea,
  .references {
    min-height:420px
  }
  .stage {
    height:420px
  }
}
@media(max-width:650px) {
  header {
    padding:15px;
    align-items:flex-start;
    flex-wrap:wrap;
    gap:12px
  }
  h1 {
    font-size:23px
  }
  header label {
    display:flex;
    align-items:center;
    gap:12px
  }
  header select {
    width:auto;
    margin:0
  }
  main {
    display:flex;
    flex-direction:column;
    padding:8px;
    gap:8px
  }
  .navigator {
    position:static;
    max-height:none
  }
  .panel-head {
    padding:12px
  }
  #operationList {
    max-height:230px;
    flex:auto
  }
  .workarea {
    display:flex;
    flex-direction:column;
    height:auto;
    gap:8px
  }
  .stage {
    height:360px;
    flex:none
  }
  .instructions {
    max-height:none
  }
  .references {
    overflow:visible
  }
  .part-stage {
    height:270px
  }
  .hud {
    left:12px;
    right:12px
  }
  .gesture {
    font-size:9px
  }
}
body.embed .navigator,
body.embed .references {
  display:none
}
body.embed .step-column,
body.embed .workarea {
  display:contents
}
body.embed main {
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(280px,1.1fr) minmax(180px,.9fr)
}
body.embed .stage {
  grid-row:1
}
body.embed .instructions {
  grid-row:2;
  max-height:none
}

/* Build-up scrubber: reveal the vehicle station by station. Hidden until the
   mode is on, so it never competes with the normal isolate view. */
.build-bar{
  position:absolute; left:16px; right:16px; bottom:52px;
  display:flex; align-items:center; gap:12px;
  padding:8px 12px; border-radius:8px;
  background:color-mix(in srgb,var(--wr-card) 92%,transparent); border:1px solid var(--line);
}
.build-bar:has(#buildStep:disabled){display:none}
.build-bar input[type=range]{flex:1; accent-color:var(--blue)}
#buildLabel{font-family:var(--wr-mono, ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace); font-size:12px; color:var(--muted); white-space:nowrap}

/* The instructions page embeds this file. Same three columns, no second site header. */
html.inpage #site-nav-mount,
html.inpage header{display:none !important}
html.inpage body{padding-top:0 !important}
