/* One renderer, a full-car stage, and a separately scrolling control panel. */
.in-workshop .topbar,
.in-workshop .rail,
.in-workshop .camp-ui,
.in-workshop #map-labels,
.in-workshop .world-vignette,
.in-workshop #drive-ui {
  display: none !important;
}
#workshop-ui {
  position: fixed;
  inset: 0;
  z-index: 40;
  color: #293e33;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.workshop-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 14px 30px;
  border-bottom: 1px solid #c6d1bc;
  background: #f7f8f1;
}
.workshop-header .round-button {
  flex: 0 0 46px;
  height: 46px;
  background: #e8eddf;
  color: #31533d;
  border: 1px solid #d0dac6;
}
.workshop-header small {
  font-size: 10px;
  letter-spacing: 2.3px;
  color: #76846d;
  font-weight: 700;
}
.workshop-header h1 {
  font-size: clamp(20px, 2vw, 28px);
  margin: 5px 0 0;
  line-height: 1.25;
}
.workshop-badge {
  margin-left: auto;
  padding: 9px 15px;
  font-size: 12px;
  border: 1px solid #b7c9a9;
  border-radius: 30px;
  white-space: nowrap;
}
.workshop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  min-height: 0;
}
.workshop-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.workshop-view-tools {
  position: absolute;
  z-index: 3;
  inset: 22px 18px auto;
  display: flex;
  justify-content: center;
  gap: 7px;
}
.workshop-view-tools button,
#workshop-power {
  min-height: 44px;
  padding: 8px 14px;
  background: #f8f9f0ef;
  border: 1px solid #bac8ae;
  border-radius: 12px;
  font-size: 12px;
  color: #3f5d43;
  font-weight: 700;
}
.workshop-view-tools button:hover,
#workshop-power:hover {
  background: white;
}
#workshop-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#workshop-leaders path {
  stroke: #667b6270;
  fill: none;
  stroke-width: 1;
}
#workshop-leaders circle {
  fill: #f7f7e9;
  stroke: #6d805e;
  stroke-width: 1.5;
}

.workshop-pins button {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  min-width: 95px;
  justify-content: flex-start;
  padding: 6px 10px;
  background: #fafbf4f2;
  border: 1px solid #c5cfbb;
  border-radius: 14px;
  color: #2e4535;
  font-size: 13px;
  box-shadow: 0 4px 12px #3b513e0a;
  touch-action: none;
}
.workshop-pins button b {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--part-color);
  color: #fff;
  font-size: 12px;
}
.workshop-pins button.picked {
  background: #fff5c9;
  border: 2px solid #bc8936;
  box-shadow: 0 0 0 5px #deb96933;
}
.workshop-pins button:hover {
  border-color: #819c73;
}
.workshop-stage-note {
  position: absolute;
  inset: auto 10px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  pointer-events: none;
  font-size: 12px;
  color: #63725c;
}
.workshop-stage-note span::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 3px;
  background: #c98f22;
  vertical-align: middle;
  margin-right: 6px;
}
.workshop-stage-note span:nth-child(2)::before {
  background: #368e96;
}
.workshop-stage-note small {
  flex-basis: 100%;
  text-align: center;
  font-size: 11px;
}
.workshop-console {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f9faf4;
  border-left: 1px solid #cbd4c1;
  padding: 26px;
  scrollbar-width: thin;
  scroll-padding: 16px;
}
.workshop-intro .eyebrow {
  color: #819073;
  letter-spacing: 1.4px;
  font-size: 9px;
}
.workshop-intro h2 {
  font-size: 23px;
  line-height: 1.4;
  margin: 8px 0;
}
.workshop-intro p,
.workshop-part-info p {
  font-size: 14px;
  line-height: 1.8;
  margin: 6px 0 0;
  color: #5b6a54;
}
.workshop-feedback {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e8efdb;
  border-left: 3px solid #87a468;
  font-size: 13px;
  line-height: 1.7;
  min-height: 48px;
}
.workshop-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.workshop-part-info {
  border-top: 1px solid #dfe5d6;
  padding: 17px 0;
}
.workshop-part-info small {
  font-size: 11px;
  line-height: 1.7;
  color: #819071;
  display: block;
}
.workshop-part-info h3 {
  margin: 5px 0;
  font-size: 18px;
}
.workshop-part-info p {
  margin-bottom: 5px;
}
.workshop-controls {
  padding: 16px;
  background: #edf0e5;
  border: 1px solid #d4dec8;
  border-radius: 16px;
}
#workshop-power {
  min-height: 44px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 22px;
}
#workshop-power[aria-pressed="false"] {
  color: #856b54;
  background: #e9e3d8;
  border-color: #cfc4b5;
}
.workshop-throttle {
  display: flex;
  gap: 15px;
  align-items: center;
  margin: 14px 0 10px;
}
#workshop-throttle-hold {
  flex: 0 0 115px;
  min-height: 64px;
  border: 0;
  border-radius: 13px;
  background: #376449;
  color: #fffbed;
  font-size: 14px;
  font-weight: 700;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#workshop-throttle-hold:active {
  background: #234e34;
  transform: translateY(1px);
}
.workshop-throttle label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #6e805f;
}
.workshop-throttle output {
  float: right;
  color: #315134;
  font-weight: 700;
}
.workshop-throttle input {
  display: block;
  width: 100%;
  height: 44px;
  accent-color: #487049;
  margin: 0;
}
.workshop-steering {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1fr;
  gap: 7px;
}
.workshop-steering button {
  min-height: 48px;
  background: #fdfdf7;
  border: 1px solid #c7d2bb;
  border-radius: 10px;
  color: #44603c;
  font-size: 13px;
}
.workshop-steering button[aria-pressed="true"] {
  background: #d2dfc0;
  border-color: #95ac7c;
}
.workshop-live {
  margin-top: 12px;
  min-height: 38px;
  font-size: 12px;
  line-height: 1.7;
  color: #607052;
}
.workshop-flow {
  margin: 19px 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.9;
  color: #69775f;
}
.workshop-flow p {
  margin: 6px 0;
}
.workshop-flow b {
  color: #648d89;
  margin-right: 5px;
}
.workshop-flow p:nth-child(2) b {
  color: #ad8339;
}
.workshop-flow small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.8;
  color: #87917e;
}

#workshop-change-mode {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  font-size: 12px;
}
#workshop-ui button:focus-visible {
  outline: 3px solid #a3762d;
  outline-offset: 3px;
}
@media (min-width: 1300px) {
  .workshop-layout {
    grid-template-columns: minmax(0, 1fr) 430px;
  }
  .workshop-console {
    padding: 30px;
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  .workshop-header {
    min-height: 70px;
    padding: 10px 14px;
    gap: 11px;
  }
  .workshop-header h1 {
    font-size: 20px;
  }
  .workshop-header small {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .workshop-badge {
    display: none;
  }
  .workshop-layout {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(245px, 36dvh, 340px) minmax(0, 1fr);
  }
  .workshop-stage {
    border-bottom: 1px solid #bfccb1;
  }
  .workshop-view-tools {
    inset: 9px 10px auto;
    gap: 5px;
  }
  .workshop-view-tools button {
    padding: 7px 12px;
    font-size: 11px;
  }
  .workshop-pins button {
    min-width: 80px;
    min-height: 44px;
    font-size: 12px;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 11px;
  }
  .workshop-pins button b {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  .workshop-stage-note {
    bottom: 9px;
    gap: 4px 14px;
    font-size: 10px;
  }
  .workshop-stage-note small {
    font-size: 9px;
  }
  .workshop-console {
    border-left: 0;
    padding: 18px 20px 24px;
  }
  .workshop-intro h2 {
    font-size: 21px;
    margin: 5px 0;
  }
  .workshop-intro p {
    font-size: 13px;
  }
  .workshop-feedback {
    margin: 12px 0;
    padding: 10px 12px;
  }

  .workshop-part-info {
    padding: 14px 0;
  }
  .workshop-part-info p {
    font-size: 13px;
  }
}
@media (max-height: 500px) {
  .workshop-header {
    min-height: 58px;
    padding: 5px 14px;
    gap: 10px;
  }
  .workshop-header h1 {
    font-size: 18px;
  }
  .workshop-header small {
    display: none;
  }
  .workshop-layout {
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 43%);
  }
  .workshop-console {
    padding: 15px;
  }
  .workshop-view-tools {
    inset: 6px 5px auto;
    gap: 4px;
  }
  .workshop-view-tools button {
    padding: 6px 9px;
    font-size: 11px;
  }
  .workshop-pins button {
    min-width: 80px;
    min-height: 44px;
    font-size: 12px;
    padding: 5px 7px;
    gap: 4px;
  }
  .workshop-stage-note {
    bottom: 8px;
    gap: 3px 14px;
    font-size: 10px;
  }
  .workshop-stage-note small {
    font-size: 9px;
  }
}
@media (max-width: 350px) and (min-height: 501px) {
  .workshop-header h1 {
    font-size: 18px;
  }
  .workshop-layout {
    grid-template-rows: 245px minmax(0, 1fr);
  }
  .workshop-console {
    padding: 15px;
  }
  .workshop-controls {
    padding: 12px;
  }
  #workshop-throttle-hold {
    flex-basis: 105px;
  }
}

/* Guided tasks keep the car, current explanation and next action together. */
.workshop-guide {
  margin: 14px 0 18px;
}
#guide-invite {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #e3edd7;
  border: 1px solid #c0d3ae;
  border-radius: 14px;
}
#guide-invite b {
  font-size: 14px;
}
#guide-invite small {
  display: block;
  font-size: 11px;
  color: #698058;
  margin-top: 6px;
}
#guide-invite button,
.guide-actions button {
  min-height: 44px;
  padding: 10px 14px;
  background: #386448;
  color: #fffdf1;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}
#guide-invite button {
  margin-left: auto;
  flex-shrink: 0;
}
#guide-invite ~ * {
  min-width: 0;
}
.guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#guide-count {
  font-size: 12px;
  font-weight: 700;
  color: #628044;
  letter-spacing: 0.4px;
}
#guide-exit {
  min-height: 44px;
  border: 0;
  background: none;
  color: #7d896f;
  font-size: 12px;
}
#guide-title {
  font-size: 24px;
  line-height: 1.3;
  margin: 6px 0 9px;
}
#guide-message {
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  color: #4d6244;
}
.guide-beats {
  display: flex;
  gap: 5px;
  margin: 16px 0 12px;
}
.guide-beats span {
  flex: 1;
  height: 5px;
  border-radius: 8px;
  background: #dce5d4;
}
.guide-beats span.current,
.guide-beats span.done {
  background: #559aaa;
}
.guide-beats span[data-kind="power"].current,
.guide-beats span[data-kind="power"].done {
  background: #d6a13c;
}
.guide-beats span.current {
  box-shadow: 0 0 0 3px #647b4510;
}
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.guide-actions button {
  flex: 1;
}
#guide-pause,
#guide-replay {
  background: #e6ecdd;
  color: #526d40;
  border: 1px solid #c8d6bb;
}
.guide-stage {
  position: absolute;
  z-index: 3;
  left: 15px;
  right: 15px;
  bottom: 15px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  color: #247d94;
  text-align: center;
}
.guide-stage[data-kind="power"] {
  color: #9d6d13;
}
#guide-route-kind {
  font-size: 11px;
  font-weight: 750;
}
#guide-route {
  font-size: 17px;
  line-height: 1.3;
  padding: 3px 11px;
  background: #f8f9f0e8;
  border-radius: 7px;
}
.guide-stage small {
  color: #7d886f;
  font-size: 10px;
}
.is-guided .workshop-intro,
.is-guided .workshop-feedback,
.is-guided .workshop-part-info,
.is-guided .workshop-flow,
.is-guided #workshop-change-mode,
.is-guided .workshop-stage-note {
  display: none;
}
.is-guided .workshop-guide {
  margin-top: 0;
}
.is-guided .workshop-controls {
  margin-top: 16px;
}
.is-guided .workshop-live {
  display: none;
}
.is-guided .workshop-throttle label {
  display: none;
}
.is-guided #workshop-throttle-hold {
  flex-basis: 100%;
}
.is-guided .workshop-controls button:disabled {
  opacity: 0.38;
  cursor: default;
}
.is-guided .workshop-view-tools button:disabled {
  opacity: 0.45;
}
.workshop-pins button:disabled {
  cursor: default;
  opacity: 1;
}
.workshop-pins button.guide-dim {
  opacity: 0.4;
}
.workshop-pins button.guide-lit {
  border: 2px solid #348ca1;
  background: #e5f2f2;
  box-shadow: 0 0 0 5px #348ca122;
  opacity: 1;
}
.workshop-pins button.guide-lit[data-guide-kind="power"] {
  border-color: #c38b28;
  background: #fff0c9;
  box-shadow: 0 0 0 5px #c38b2822;
}
.guide-target {
  outline: 3px solid #c5a14b;
  outline-offset: 4px;
}
.is-guided .workshop-control-title {
  font-size: 13px;
}
.guide-replaying .workshop-controls,
.guide-finished .workshop-controls {
  display: none;
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-guided .workshop-console {
    padding: 10px 18px 20px;
  }
  #guide-title {
    font-size: 20px;
    margin: 2px 0 7px;
  }
  #guide-message {
    font-size: 13px;
    line-height: 1.7;
  }
  .guide-heading {
    margin-top: -4px;
  }
  .guide-stage {
    bottom: 8px;
    left: 5px;
    right: 5px;
    gap: 2px;
  }
  #guide-route {
    font-size: 12px;
    padding: 2px 5px;
  }
  #guide-route-kind {
    font-size: 10px;
  }
  .guide-stage small {
    font-size: 9px;
  }
  .guide-beats {
    margin: 12px 0 10px;
  }
  .workshop-guide {
    margin: 12px 0;
  }
  #guide-invite {
    padding: 11px;
    gap: 8px;
  }
  #guide-invite b {
    font-size: 12px;
  }
  #guide-invite small {
    font-size: 10px;
  }
  #guide-invite button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .is-guided .workshop-controls {
    margin-top: 14px;
    padding: 12px;
  }
  .is-guided .workshop-throttle {
    margin-top: 10px;
  }
  .is-guided #workshop-throttle-hold {
    min-height: 54px;
  }
}
@media (max-height: 500px) {
  #guide-title {
    font-size: 19px;
  }
  #guide-message {
    font-size: 13px;
  }
  .guide-stage {
    bottom: 7px;
    gap: 2px;
  }
  #guide-route {
    font-size: 12px;
  }
  #guide-route-kind {
    font-size: 10px;
  }
  .guide-stage small {
    font-size: 9px;
  }
}
.is-guided #workshop-power,
.is-guided[data-guide-task="throttle"] .workshop-steering,
.is-guided[data-guide-task="steer"] .workshop-throttle {
  display: none;
}
.is-guided[data-guide-task="steer"] .workshop-steering {
  margin-top: 12px;
}
.guide-timing {
  font-size: 11px;
  color: #7d886f;
  margin: 0 0 12px;
}
@media (max-width: 760px), (max-height: 500px) {
  .guide-stage small {
    display: none;
  }
}
.guide-trail {
  list-style: none;
  padding: 16px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid #dce4d2;
  display: grid;
  gap: 6px;
}
.guide-trail li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  color: #97a28c;
  border: 1px solid transparent;
  border-radius: 9px;
}
.guide-trail li span {
  flex: 0 0 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
  border-radius: 50%;
  background: #e9eddf;
}
.guide-trail li b {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
.guide-trail li.seen {
  color: #667c55;
}
.guide-trail li.current {
  color: #2e7889;
  border-color: #a6cbd1;
  background: #e6f1ef;
}
.guide-trail li.current[data-kind="power"] {
  color: #95691c;
  border-color: #dac291;
  background: #f9f0d7;
}
@media (max-width: 760px), (max-height: 500px) {
  .guide-trail {
    margin-top: 14px;
    padding-top: 12px;
    gap: 3px;
  }
  .guide-trail li {
    padding: 5px 9px;
  }
}

/* Three short repair scenes: one question, two large choices, then a real try. */
.is-repair .workshop-intro,
.is-repair .workshop-feedback,
.is-repair .workshop-controls,
.is-repair .workshop-part-info,
.is-repair .workshop-flow,
.is-repair .workshop-pins,
.is-repair #workshop-leaders,
.is-repair .workshop-stage-note,
.is-repair #workshop-shell {
  display: none;
}
.is-repair .workshop-layout {
  grid-template-columns: minmax(0, 1fr) 440px;
}
.is-repair .workshop-console {
  padding: 28px;
}
.repair-progress {
  color: #547349;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
#repair-title {
  margin: 14px 0 10px;
  font-size: 28px;
  line-height: 1.35;
}
#repair-title:focus {
  outline: none;
}
#repair-instruction {
  font-size: 20px;
  line-height: 1.65;
  margin: 0 0 22px;
  color: #48613f;
}
.repair-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.repair-choice {
  position: relative;
  min-height: 218px;
  padding: 12px 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #294b38;
  border: 2px solid #c3d2b7;
  border-radius: 22px;
  background: #fcfdf6;
  box-shadow: 0 5px 0 #dfe6d5;
  touch-action: manipulation;
}
.repair-choice svg {
  display: block;
  width: 100%;
  max-width: 185px;
  height: 122px;
}
.repair-choice b {
  font-size: 24px;
  line-height: 1.4;
}
.repair-choice span {
  font-size: 16px;
  margin-top: 6px;
  color: #59714c;
  line-height: 1.5;
}
.repair-choice:enabled:hover {
  border-color: #71905d;
  background: #f3f8e9;
}
.repair-choice:enabled:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #dfe6d5;
}
.repair-choice.suggested {
  border-color: #789a56;
  background: #eef5df;
}
.repair-choice i {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 9px;
  background: #dbeac7;
  border-radius: 20px;
  font-style: normal;
  font-size: 14px;
  color: #385831;
}
.is-repair button:disabled {
  cursor: default;
}
.repair-choice:disabled {
  opacity: 1;
}
.repair-feedback {
  margin: 18px 0 0;
  padding: 12px 14px;
  background: #eaf0df;
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.6;
}
.repair-help {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  border: 1px solid #c7d4b9;
  border-radius: 12px;
  background: transparent;
  color: #506e41;
  font-size: 16px;
  touch-action: manipulation;
}
.repair-test {
  margin: 24px 0;
}
.repair-test button {
  min-height: 64px;
  border: 2px solid #9ebc83;
  border-radius: 16px;
  background: #e8f0d7;
  color: #355830;
  font-size: 20px;
  font-weight: 700;
  touch-action: manipulation;
}
#repair-throttle {
  width: 100%;
  background: #f4e6b8;
  border-color: #c7a764;
  color: #715626;
}
#repair-steering {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#repair-steering button[aria-pressed="true"] {
  background: #c8dda8;
  border-color: #6b914d;
}
#repair-next {
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  font-size: 19px;
  touch-action: manipulation;
}
#repair-next:disabled {
  opacity: 0.7;
}
.repair-stage {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 18px;
  text-align: center;
  pointer-events: none;
}
#repair-stage-caption {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #c2cfb4;
  border-radius: 16px;
  background: #f6f8edee;
  color: #45613a;
  font-size: 18px;
  line-height: 1.4;
}
.is-repair #workshop-change-mode {
  font-size: 15px;
  margin-top: 20px;
}
.is-repair .workshop-view-tools button {
  font-size: 14px;
}
@media (min-width: 1300px) {
  .is-repair .workshop-layout {
    grid-template-columns: minmax(0, 1fr) 470px;
  }
  .is-repair .workshop-console {
    padding: 38px 30px;
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-repair .workshop-layout {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(170px, 30dvh, 280px) minmax(0, 1fr);
  }
  .is-repair .workshop-console {
    padding: 16px 18px 24px;
  }
  #repair-title {
    font-size: 26px;
    margin: 9px 0 6px;
  }
  #repair-instruction {
    font-size: 19px;
    margin-bottom: 16px;
    line-height: 1.5;
  }
  .repair-choices {
    gap: 12px;
  }
  .repair-choice {
    min-height: 176px;
    padding: 5px 6px 12px;
    border-radius: 18px;
  }
  .repair-choice svg {
    height: 102px;
  }
  .repair-choice b {
    font-size: 22px;
  }
  .repair-choice span {
    margin-top: 3px;
  }
  .repair-help {
    margin-top: 18px;
  }
  .repair-stage {
    bottom: 8px;
    left: 8px;
    right: 8px;
  }
  #repair-stage-caption {
    font-size: 16px;
    padding: 7px 10px;
  }
  .repair-test {
    margin: 18px 0;
  }
  .is-repair #workshop-change-mode {
    margin-top: 12px;
  }
}
@media (max-width: 350px) and (min-height: 501px) {
  .is-repair .workshop-console {
    padding: 12px 14px 22px;
  }
  #repair-title {
    font-size: 24px;
    margin-top: 7px;
  }
  #repair-instruction {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .repair-choice {
    min-height: 147px;
  }
  .repair-choice svg {
    height: 75px;
  }
  .repair-choice span {
    font-size: 16px;
  }
  .repair-help {
    margin-top: 14px;
  }
  .repair-test button {
    font-size: 18px;
    min-height: 58px;
  }
  #repair-stage-caption {
    font-size: 15px;
  }
}
@media (max-height: 500px) {
  .is-repair .workshop-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 47%);
  }
  .is-repair .workshop-console {
    padding: 14px 18px 22px;
  }
  #repair-title {
    font-size: 24px;
    margin: 6px 0;
  }
  #repair-instruction {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .repair-choice {
    min-height: 145px;
    padding: 4px 6px 10px;
    border-radius: 16px;
  }
  .repair-choice svg {
    height: 75px;
  }
  .repair-choice b {
    font-size: 22px;
  }
  .repair-choice span {
    margin-top: 3px;
  }
  .repair-help {
    margin-top: 14px;
  }
  .repair-stage {
    bottom: 10px;
  }
  #repair-stage-caption {
    font-size: 16px;
  }
  .repair-test {
    margin: 14px 0;
  }
}

@media (max-width: 760px) and (min-height: 501px) and (max-height: 650px) {
  .is-repair .workshop-view-tools {
    display: none;
  }
}

/* Close-ups keep a tiny location map, not six labels over the moving part. */
.camera-overview {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 12px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #bac8ae;
  border-radius: 14px;
  background: #fbfcf2f5;
  color: #36583c;
  font-size: 15px;
  font-weight: 700;
}
.camera-locator {
  position: absolute;
  z-index: 3;
  right: 10px;
  top: 8px;
  width: 66px;
  height: 94px;
  border: 1px solid #cad3bf;
  border-radius: 12px;
  background: #f7f9eff0;
  pointer-events: none;
}
.camera-locator svg {
  width: 100%;
  height: 100%;
}
.camera-locator text {
  font-size: 10px;
  fill: #526847;
}
.camera-locator rect {
  fill: #dce5cf;
  stroke: #839778;
  stroke-width: 1.5;
}
.camera-locator path {
  stroke: #54654b;
  stroke-width: 5;
  stroke-linecap: round;
}
.camera-locator circle {
  fill: #df9c39;
  stroke: #fffbea;
  stroke-width: 2;
}
.camera-place {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
  color: #355331;
  pointer-events: none;
}
.is-closeup .workshop-pins,
.is-closeup #workshop-leaders,
.is-closeup .workshop-view-tools,
.is-closeup .workshop-stage-note {
  display: none;
}
.workshop-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #e5ebdc;
  border-radius: 14px;
  margin-bottom: 18px;
}
.workshop-modes button {
  min-height: 46px;
  border-radius: 10px;
  background: transparent;
  font-size: 16px;
  color: #60774e;
}
.workshop-modes button[aria-pressed="true"] {
  background: #fffef5;
  color: #335735;
  box-shadow: 0 2px 5px #435c3212;
  font-weight: 700;
}
.workshop-part-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.workshop-part-picker button {
  min-height: 46px;
  border: 1px solid #c6d4b7;
  border-radius: 12px;
  background: #fbfcf5;
  color: #45643c;
  font-size: 16px;
}
.is-repair .workshop-modes,
.is-repair .workshop-part-picker,
.is-guided .workshop-modes,
.is-guided .workshop-part-picker {
  display: none;
}
.is-mechanics .workshop-guide,
.is-mechanics .workshop-intro,
.is-mechanics .workshop-part-picker,
.is-mechanics .workshop-feedback,
.is-mechanics .workshop-controls,
.is-mechanics .workshop-part-info,
.is-mechanics .workshop-flow,
.is-mechanics #workshop-change-mode,
.is-mechanics .workshop-pins,
.is-mechanics #workshop-leaders,
.is-mechanics .workshop-stage-note,
.is-mechanics #workshop-shell {
  display: none;
}
.is-mechanics .workshop-layout {
  grid-template-columns: minmax(0, 1fr) 440px;
}
.mechanic-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mechanic-tabs button {
  min-height: 46px;
  border-radius: 12px;
  background: #eef1e5;
  border: 1px solid #d0dcc2;
  font-size: 16px;
  color: #536c42;
}
.mechanic-tabs button[aria-pressed="true"] {
  background: #d7e6bc;
  border-color: #92ad75;
  color: #35542a;
  font-weight: 700;
}
#mechanic-title {
  font-size: 26px;
  line-height: 1.4;
  margin: 20px 0 10px;
  outline: none;
}
#mechanic-text {
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 18px;
  color: #4d6341;
}
.mechanic-actions,
.mechanic-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.mechanic-controls button {
  min-height: 52px;
  padding: 8px 5px;
  border: 1px solid #b5c99d;
  background: #edf3df;
  border-radius: 12px;
  color: #3b5a31;
  font-size: 16px;
}
.mechanic-actions button {
  min-height: 60px;
  font-size: 19px;
  font-weight: 700;
  background: #f5e6b9;
  border-color: #d2b579;
}
.mechanic-controls button[aria-pressed="true"] {
  background: #cbdcae;
  border: 2px solid #87a465;
}
.mechanic-turns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
#mechanic-run,
#mechanic-resume {
  width: 100%;
  min-height: 56px;
  margin: 14px 0 0;
  font-size: 19px;
}
#mechanic-status {
  padding: 12px 14px;
  border-radius: 12px;
  background: #e7eddc;
  color: #4e6740;
  font-size: 17px;
  line-height: 1.6;
  min-height: 52px;
  margin: 16px 0 10px;
}
#mechanic-hint {
  font-size: 16px;
  line-height: 1.7;
  color: #60784e;
  margin: 10px 0;
}
.mechanic-note {
  font-size: 12px;
  line-height: 1.8;
  color: #7c8870;
  display: block;
  margin-top: 18px;
}
.mechanic-controls small {
  font-size: 13px;
  color: #7a856f;
}
.wheel-speeds {
  display: grid;
  gap: 10px;
  margin: 16px 0 8px;
}
.wheel-speeds > div {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.wheel-speeds b {
  font-weight: 600;
  color: #427f91;
}
.wheel-speeds > div + div b {
  color: #a27b31;
}
.wheel-speeds span {
  height: 12px;
  border-radius: 20px;
  overflow: hidden;
  background: #e2e8d9;
}
.wheel-speeds i {
  display: block;
  width: 0;
  height: 100%;
  background: #55a5bd;
  border-radius: 20px;
}
.wheel-speeds > div + div i {
  background: #d6a347;
}
.wheel-speeds output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#gear-count {
  font-size: 18px;
  line-height: 1.6;
  color: #526c3f;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1300px) {
  .is-mechanics .workshop-layout {
    grid-template-columns: minmax(0, 1fr) 470px;
  }
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-mechanics .workshop-layout {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(235px, 37dvh, 340px) minmax(0, 1fr);
  }
  .is-closeup.is-repair .workshop-layout {
    grid-template-rows: clamp(220px, 36dvh, 320px) minmax(0, 1fr);
  }
  .is-closeup:not(.is-repair):not(.is-mechanics):not(.is-remote-control)
    .workshop-layout {
    grid-template-rows: clamp(235px, 38dvh, 350px) minmax(0, 1fr);
  }
  .workshop-modes {
    margin-bottom: 12px;
  }
  .is-mechanics .workshop-console {
    padding: 12px 16px 22px;
  }
  #mechanic-title {
    font-size: 23px;
    margin: 14px 0 7px;
  }
  #mechanic-text {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 14px;
  }
  .mechanic-actions {
    margin: 10px 0;
  }
  .mechanic-compare {
    margin: 10px 0;
  }
  .mechanic-controls button {
    min-height: 48px;
  }
  .mechanic-actions button {
    min-height: 54px;
    font-size: 18px;
  }
  #mechanic-status {
    font-size: 16px;
  }
  .camera-locator {
    width: 58px;
    height: 84px;
  }
}
@media (max-width: 350px) and (min-height: 501px) {
  .is-mechanics .workshop-layout {
    grid-template-rows: 205px minmax(0, 1fr);
  }
  .is-closeup.is-repair .workshop-layout {
    grid-template-rows: 210px minmax(0, 1fr);
  }
  #mechanic-title {
    font-size: 22px;
  }
  #mechanic-text {
    font-size: 17px;
  }
  .mechanic-tabs {
    gap: 5px;
  }
  .mechanic-tabs button {
    font-size: 15px;
  }
  .camera-overview {
    font-size: 14px;
    left: 8px;
  }
}
@media (max-height: 500px) {
  .is-mechanics .workshop-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 47%);
  }
  .is-mechanics .workshop-console {
    padding: 12px 16px 22px;
  }
  #mechanic-title {
    font-size: 23px;
    margin: 14px 0 7px;
  }
}
.is-closeup:not(.is-guided):not(.is-repair) .workshop-intro,
.is-closeup:not(.is-guided):not(.is-repair) .workshop-feedback,
.is-closeup:not(.is-guided):not(.is-repair) .workshop-flow,
.is-closeup:not(.is-guided):not(.is-repair) .workshop-guide {
  display: none;
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-closeup .workshop-throttle {
    gap: 12px;
  }
  .is-closeup #workshop-throttle-hold {
    font-size: 16px;
  }
  .is-closeup .workshop-steering button {
    font-size: 16px;
    min-height: 50px;
  }
}
.has-camera-subject .workshop-view-tools {
  display: none;
}
@media (max-width: 350px) and (min-height: 501px) {
  .mechanic-panel {
    display: flex;
    flex-direction: column;
  }
  .mechanic-tabs {
    order: 0;
  }
  #mechanic-title {
    order: 1;
  }
  .mechanic-controls {
    order: 2;
  }
  #mechanic-run,
  #mechanic-resume {
    order: 3;
  }
  #mechanic-status {
    order: 4;
  }
  #mechanic-text {
    order: 5;
  }
  #mechanic-hint {
    order: 6;
  }
  .mechanic-note {
    order: 7;
  }
}
.workshop-part-picker button[aria-pressed="true"] {
  background: #dcebc7;
  border-color: #91ad72;
  color: #31552e;
  font-weight: 700;
}

/* Spoken prompts are always child-initiated; the written prompt stays visible. */
.narration-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 10px 0 14px;
}
.narration-button {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #b9cdaa;
  border-radius: 11px;
  background: #edf4e3;
  color: #365b34;
  font-size: 14px;
}
.narration-status {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.6;
  color: #61714f;
}
.is-mechanic-guided [data-narration-tools="mechanism"] {
  display: none;
}
.guide-actions #guide-beat-next,
.guide-actions #guide-next {
  flex: 1 0 100%;
  min-height: 50px;
  font-size: 16px;
}
.guide-actions #guide-beat-previous,
.guide-actions #guide-autoplay {
  background: #e6ecdd;
  color: #526d40;
  border: 1px solid #c8d6bb;
}
.guide-actions #guide-autoplay[aria-pressed="true"] {
  background: #d3e6bb;
  border-color: #7c9c65;
}
.guide-actions button:not(#guide-beat-next):not(#guide-next) {
  flex: 1 1 calc(50% - 8px);
}

/* Touch the actual transmitter while a second view shows the same live car. */
.is-remote-control .workshop-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.is-remote-control .workshop-stage > :not(#remote-split),
.is-remote-control .workshop-console > :not(#remote-control-panel) {
  display: none !important;
}
.is-remote-control .workshop-console {
  padding: 12px 24px;
  border-top: 1px solid #c3d1b8;
}
.remote-split {
  position: absolute;
  inset: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
}
.remote-car-view,
.remote-hand-view {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #bacab0;
  border-radius: 20px;
}
.remote-view-heading {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 2;
  pointer-events: none;
}
.remote-view-heading b {
  font-size: 18px;
  padding: 5px 9px;
  background: #f6f8eddd;
  border-radius: 10px;
}
.remote-view-heading span {
  font-size: 13px;
  color: #5c7255;
}
.remote-view-heading button,
.remote-control-panel button {
  min-height: 44px;
  padding: 8px 14px;
  color: #416139;
  background: #f7f8ec;
  border: 1px solid #bdcdaf;
  border-radius: 12px;
  font-size: 16px;
  pointer-events: auto;
}
.remote-routes {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}
.remote-routes span {
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 9px;
  color: #7a8773;
  background: #f3f5e8ee;
  border: 1px solid #cbd4bf;
}
.remote-routes .lit {
  color: #256579;
  border-color: #5a9cab;
  background: #d9eef0;
  font-weight: 750;
}
.remote-routes [data-remote-route="motor"].lit {
  color: #7c5819;
  border-color: #c69b43;
  background: #f8e8b7;
}
#remote-touch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#remote-touch-lines path {
  fill: none;
  stroke: #d39720;
  stroke-width: 2;
  stroke-linecap: round;
}
.remote-steering-touch,
.remote-trigger-touch {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.remote-steering-touch {
  border: 3px solid #4c9db4;
  border-radius: 50%;
  background: #7eb4c00c;
  box-shadow: 0 0 0 5px #e4f4ed75;
  cursor: grab;
}
.remote-steering-touch.held {
  cursor: grabbing;
  border-color: #236f8a;
  background: #8bc3d222;
  box-shadow: 0 0 0 7px #4b9db42b;
}
.remote-steering-touch span {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 9px;
  background: #eff7edeb;
  color: #286d7e;
  font-weight: 750;
  font-size: 16px;
  pointer-events: none;
}
.remote-trigger-touch {
  width: 64px;
  height: 80px;
  border: 3px solid #dca33c;
  border-radius: 24px;
  background: #f6cc6033;
  box-shadow: 0 0 0 4px #fff1cb66;
  cursor: pointer;
}
.remote-trigger-touch[aria-pressed="true"] {
  background: #f6bb4480;
  border-color: #ac741b;
}
.remote-trigger-touch span {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff5d9ee;
  padding: 4px 8px;
  border-radius: 9px;
  color: #835b1b;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 750;
  pointer-events: none;
}
.remote-trigger-touch br {
  display: none;
}
.remote-steering-touch:focus-visible,
.remote-trigger-touch:focus-visible {
  outline: 3px solid #416b39;
  outline-offset: 7px;
}
.remote-hand-hint {
  position: absolute;
  bottom: 5px;
  left: 8px;
  right: 8px;
  margin: 0;
  text-align: center;
  padding: 3px 5px;
  border-radius: 8px;
  background: #f3f5e8ee;
  font-size: 15px;
  color: #596e50;
  pointer-events: none;
}
@media (max-height: 360px) {
  .remote-hand-hint {
    display: none;
  }
}
.remote-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
#remote-live {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}
.remote-control-panel > div {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-remote-control .workshop-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .is-remote-control .workshop-console {
    padding: 8px 14px 10px;
  }
  .remote-split {
    inset: 6px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(125px, 0.85fr) minmax(235px, 1.3fr);
    gap: 8px;
  }
  .remote-view-heading {
    top: 5px;
    left: 8px;
    right: 8px;
  }
  .remote-view-heading b {
    font-size: 16px;
  }
  .remote-view-heading button {
    font-size: 14px;
    min-height: 40px;
    padding: 5px 10px;
  }
  .remote-routes {
    bottom: 4px;
    gap: 4px;
  }
  .remote-routes span {
    padding: 3px 5px;
    font-size: 12px;
  }
  .remote-control-panel {
    display: block;
  }
  #remote-live {
    font-size: 16px;
    margin-bottom: 7px;
  }
  .remote-control-panel > div {
    justify-content: space-between;
  }
  .remote-hand-hint {
    font-size: 14px;
  }
}
@media (max-width: 350px) and (min-height: 501px) {
  .remote-split {
    grid-template-rows: minmax(120px, 0.7fr) minmax(230px, 1.3fr);
  }
  .remote-view-heading span {
    font-size: 11px;
  }
  #remote-live {
    font-size: 14px;
  }
  .remote-steering-touch span,
  .remote-trigger-touch span {
    font-size: 14px;
  }
  .remote-hand-hint {
    font-size: 12px;
  }
}
@media (max-height: 500px) {
  .is-remote-control .workshop-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .is-remote-control .workshop-console {
    padding: 6px 14px;
  }
  .remote-split {
    inset: 4px 8px;
    gap: 8px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
  .remote-view-heading {
    top: 4px;
  }
  .remote-view-heading b {
    font-size: 15px;
  }
  .remote-view-heading span {
    display: none;
  }
  #remote-live {
    font-size: 15px;
  }
  .remote-control-panel {
    gap: 12px;
  }
  .remote-control-panel button {
    font-size: 14px;
    padding: 6px 10px;
  }
  .remote-hand-hint {
    font-size: 12px;
  }
  .remote-routes span {
    font-size: 12px;
    padding: 3px 5px;
  }
}

/* One action, then one observation. The model and its controls stay together. */
.mechanic-guide-invite {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  padding: 16px 18px;
  margin: 0 0 16px;
  border: 1px solid #9eb98a;
  border-radius: 16px;
  background: #e5efce;
  color: #365431;
  min-height: 76px;
}
.mechanic-guide-invite span {
  font-size: 21px;
  font-weight: 800;
}
.mechanic-guide-invite small {
  font-size: 15px;
}
.is-mechanic-guided .workshop-modes,
.is-mechanic-guided .mechanic-tabs,
.is-mechanic-guided #mechanic-title,
.is-mechanic-guided #mechanic-text,
.is-mechanic-guided .mechanic-controls,
.is-mechanic-guided #mechanic-run,
.is-mechanic-guided #mechanic-resume,
.is-mechanic-guided #mechanic-status,
.is-mechanic-guided #mechanic-hint,
.is-mechanic-guided #mechanic-note,
.is-mechanic-guided .mechanic-detail {
  display: none;
}
.mechanic-lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#mechanic-lesson-count {
  font-size: 15px;
  font-weight: 750;
  color: #66785a;
}
.mechanic-lesson-top button,
.mechanic-lesson-tools button {
  min-height: 46px;
  padding: 9px 14px;
  font-size: 16px;
  color: #46663a;
  background: #edf1e5;
  border: 1px solid #c0cdb3;
  border-radius: 12px;
}
.mechanic-lesson-dots {
  display: flex;
  gap: 6px;
  margin: 13px 0 22px;
}
.mechanic-lesson-dots span {
  height: 5px;
  flex: 1;
  background: #dce3d3;
  border-radius: 5px;
}
.mechanic-lesson-dots .current {
  background: #bd8e42;
}
.mechanic-lesson-dots .seen {
  background: #719256;
}
#mechanic-lesson-title {
  font-size: 28px;
  line-height: 1.35;
  margin: 0 0 10px;
}
#mechanic-lesson-message {
  font-size: 19px;
  line-height: 1.6;
  min-height: 3.2em;
  margin: 0;
  color: #526644;
}
.mechanic-visual {
  border-radius: 20px;
  background: #edf0e5;
  margin: 10px 0 22px;
  padding: 10px 12px;
}
.mechanic-visual svg {
  display: block;
  width: 100%;
  height: 136px;
  overflow: visible;
}
.mechanic-visual svg path,
.mechanic-visual svg circle,
.mechanic-visual svg rect {
  fill: none;
  stroke: #899777;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mechanic-visual svg text {
  fill: #415936;
  font-size: 16px;
  font-weight: 700;
}
.mechanic-visual .picture-label {
  font-size: 14px;
}
.mechanic-visual .lesson-spring-coil path {
  stroke: #b99141;
}
.mechanic-visual #lesson-damper-picture rect {
  fill: #8ab4bd;
  stroke: #628e9c;
}
.mechanic-visual #lesson-damper-picture.removed {
  opacity: 0.17;
}
.mechanic-visual svg .left {
  stroke: #3098b5;
}
.mechanic-visual svg .right {
  stroke: #d2992c;
}
.mechanic-visual svg .lesson-wheel.left * {
  stroke: #3098b5;
}
.mechanic-visual svg .lesson-wheel.right * {
  stroke: #d2992c;
}
.mechanic-visual svg .lesson-road {
  stroke-width: 7;
  opacity: 0.55;
}
.mechanic-visual[data-highlight~="spring"] #lesson-spring-coil,
.mechanic-visual[data-highlight~="damper"] #lesson-damper-picture,
.mechanic-visual[data-highlight~="wheel"] #lesson-spring-wheel,
.mechanic-visual[data-highlight~="left"] .left,
.mechanic-visual[data-highlight~="right"] .right {
  filter: drop-shadow(0 0 4px #b5b95a);
  opacity: 1;
}
.mechanic-lesson-main {
  width: 100%;
  min-height: 66px;
  font-size: 23px;
  touch-action: manipulation;
}
.mechanic-lesson-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  min-height: 46px;
}
#mechanic-lesson-watching {
  font-size: 15px;
  color: #67785b;
}
.mechanic-stage-caption {
  position: absolute;
  bottom: 4px;
  left: 10px;
  right: 10px;
  text-align: center;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.35;
  padding: 8px;
  background: #f7f8edeb;
  border-radius: 12px;
  pointer-events: none;
}
@media (max-width: 760px) and (min-height: 501px) {
  .is-mechanic-guided .workshop-console {
    padding: 12px 18px 20px;
  }
  .is-mechanic-guided .workshop-layout {
    grid-template-rows: clamp(240px, 39dvh, 345px) minmax(0, 1fr);
  }
  .mechanic-lesson-dots {
    margin: 9px 0 15px;
  }
  #mechanic-lesson-title {
    font-size: 24px;
  }
  #mechanic-lesson-message {
    font-size: 18px;
    min-height: 1.6em;
  }
  .mechanic-visual {
    margin: 12px 0 16px;
    padding: 4px 10px;
  }
  .mechanic-visual svg {
    height: 108px;
  }
  .mechanic-lesson-main {
    min-height: 62px;
    font-size: 22px;
  }
  .mechanic-stage-caption {
    font-size: 16px;
  }
}

/* Grid items must shrink with the viewport; long labels must not widen the
   stage or push controls underneath the fixed edge of the screen. */
.workshop-layout,
.workshop-stage,
.workshop-console,
.workshop-header,
.workshop-header > div,
.workshop-console section,
.workshop-console button {
  min-width: 0;
}
.workshop-console {
  overflow-x: hidden;
  scroll-padding-block: 18px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}
.workshop-header > div {
  flex: 1;
}
.workshop-header h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#workshop-back,
.workshop-nav-button {
  flex: 0 0 auto;
  min-width: 76px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #c5d1ba;
  border-radius: 12px;
  background: #e8eddf;
  color: #31533d;
  font-size: 14px;
  white-space: nowrap;
}
.workshop-more {
  margin-top: 16px;
  border-top: 1px solid #dbe3d2;
  color: #647758;
}
.workshop-more summary {
  min-height: 44px;
  padding: 13px 2px;
  cursor: pointer;
  font-size: 13px;
}
.workshop-more summary:focus-visible {
  outline: 3px solid #a3762d;
  outline-offset: 2px;
}
.workshop-more .workshop-flow,
.workshop-more .mechanic-note {
  margin-top: 0;
}
.is-guided .workshop-more,
.is-repair .workshop-more,
.is-mechanic-guided .workshop-more {
  display: none;
}
.workshop-view-tools {
  flex-wrap: wrap;
}
.remote-control-panel {
  min-width: 0;
}
#remote-live {
  min-width: 0;
}

/* Folded-open phones and small tablets use a real side-by-side workbench.
   The control panel has its own scroll area instead of covering the car. */
@media (min-width: 640px) and (max-width: 1100px) and (orientation: landscape) {
  .workshop-header {
    min-height: 70px;
    padding: 10px 16px;
    gap: 12px;
  }
  .workshop-header h1 {
    font-size: 22px;
  }
  .workshop-header small {
    font-size: 9px;
    letter-spacing: 1px;
  }
  #workshop-ui:not(.is-remote-control) .workshop-layout {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 42vw, 360px);
    grid-template-rows: minmax(0, 1fr);
  }
  #workshop-ui .workshop-console {
    border-left: 1px solid #cbd4c1;
    padding: 16px 18px 24px;
  }
  .workshop-view-tools {
    inset: 10px 8px auto;
    gap: 5px;
  }
  .workshop-view-tools button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .workshop-pins button {
    min-width: 80px;
    min-height: 44px;
    padding: 5px 7px;
    font-size: 12px;
    gap: 4px;
  }
  .workshop-controls {
    padding: 12px;
  }
  .workshop-throttle {
    gap: 10px;
  }
  #workshop-throttle-hold {
    flex-basis: 104px;
  }
  .workshop-modes button,
  .workshop-part-picker button,
  .mechanic-tabs button {
    font-size: 14px;
  }
  #guide-title,
  #mechanic-title,
  #repair-title,
  #mechanic-lesson-title {
    font-size: 23px;
  }
  #repair-instruction,
  #mechanic-text,
  #mechanic-lesson-message {
    font-size: 16px;
    line-height: 1.6;
  }
  .repair-choices {
    gap: 10px;
  }
  .repair-choice {
    min-height: 154px;
    padding: 8px 5px 12px;
    border-radius: 16px;
  }
  .repair-choice svg {
    height: 82px;
  }
  .repair-choice b {
    font-size: 20px;
  }
  .repair-choice span {
    font-size: 14px;
  }
  .repair-test button,
  .mechanic-actions button,
  #mechanic-run,
  #mechanic-resume {
    min-height: 48px;
    font-size: 16px;
  }
  .wheel-speeds > div {
    grid-template-columns: 72px minmax(0, 1fr) 46px;
    gap: 5px;
    font-size: 13px;
  }
  #workshop-ui.is-remote-control .remote-split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  #workshop-ui.is-remote-control .workshop-console {
    border-left: 0;
    padding: 8px 16px;
  }
  .remote-view-heading {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }
  .remote-view-heading b {
    font-size: 15px;
  }
  .remote-view-heading span {
    display: none;
  }
  .remote-control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  #remote-live {
    flex: 1 1 180px;
    font-size: 15px;
    margin: 0;
  }
  .remote-control-panel button {
    font-size: 14px;
  }
}
/* Short portrait windows also need a usable console, not the desktop grid
   selected by a height-only breakpoint. */
@media (max-width: 639px) and (orientation: portrait),
  (min-width: 640px) and (max-width: 900px) and (orientation: portrait) {
  .workshop-header {
    min-height: 66px;
    padding: 8px 12px;
    gap: 8px;
  }
  .workshop-header h1 {
    font-size: 18px;
  }
  .workshop-header small,
  .workshop-badge {
    display: none;
  }
  #workshop-back,
  .workshop-nav-button {
    min-width: 70px;
    padding: 8px 9px;
    font-size: 13px;
  }
  #workshop-ui:not(.is-remote-control) .workshop-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, min(36dvh, 340px)) minmax(0, 1fr);
  }
  #workshop-ui .workshop-console {
    border-left: 0;
  }
  #workshop-ui.is-remote-control .remote-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
  .remote-control-panel {
    display: block;
  }
  .remote-control-panel > div {
    justify-content: space-between;
    gap: 8px;
  }
  #remote-live {
    font-size: 14px;
    margin: 0 0 7px;
  }
}
@media (max-height: 500px) {
  .workshop-header {
    min-height: 58px;
    padding-block: 6px;
  }
  .workshop-header small {
    display: none;
  }
  .workshop-header h1 {
    font-size: 18px;
  }
  .workshop-view-tools {
    top: 6px;
  }
}
@media (max-width: 350px) and (min-height: 501px) {
  .is-mechanic-guided .workshop-layout {
    grid-template-rows: 205px minmax(0, 1fr);
  }
  .is-mechanic-guided .workshop-console {
    padding: 8px 14px 16px;
  }
  #mechanic-lesson {
    order: -1;
  }
  #mechanic-guide-start {
    order: 1;
    margin-top: 12px;
  }
  .mechanic-lesson-top button {
    min-height: 44px;
  }
  .mechanic-lesson-dots {
    margin: 6px 0 10px;
  }
  #mechanic-lesson-title {
    font-size: 21px;
    margin-bottom: 5px;
  }
  #mechanic-lesson-message {
    font-size: 16px;
  }
  .mechanic-visual {
    margin: 6px 0 8px;
  }
  .mechanic-visual svg {
    height: 76px;
  }
  .mechanic-lesson-main {
    min-height: 54px;
    font-size: 20px;
  }
  .mechanic-lesson-tools {
    margin-top: 8px;
  }
  .mechanic-stage-caption {
    font-size: 14px;
  }
}
@media (max-height: 500px) {
  #mechanic-lesson-title {
    font-size: 23px;
  }
  #mechanic-lesson-message {
    min-height: 0;
    font-size: 17px;
  }
  .mechanic-lesson-dots {
    margin: 8px 0 12px;
  }
  .mechanic-visual {
    margin: 6px 0 10px;
    padding: 4px 10px;
  }
  .mechanic-visual svg {
    height: 78px;
  }
  .mechanic-lesson-main {
    min-height: 56px;
    padding: 12px 16px;
    font-size: 21px;
  }
  .mechanic-stage-caption {
    font-size: 15px;
  }
  .is-mechanic-guided .workshop-console {
    padding: 8px 16px 16px;
  }
}
