/* A friendly, hands-on factory: every machine has room to touch and explore. */
body.robot-factory-page {
  --rf-ink:#223b4b;
  --rf-muted:#536974;
  --rf-paper:#fffdf5;
  --rf-cream:#f6f0e2;
  --rf-line:#c5d0cc;
  --rf-orange:#bd531f;
  --rf-yellow:#ffd276;
  --rf-green:#276b51;
  margin:0;
  background-color:var(--rf-cream);
  background-image:radial-gradient(#d5dbce 1px,transparent 1px);
  background-size:24px 24px;
  color:var(--rf-ink);
  font-family:"Avenir Next","Trebuchet MS",Arial,sans-serif;
  font-size:17px;
  line-height:1.5;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

#robot-factory,#robot-factory * {box-sizing:border-box;}
#robot-factory {max-width:1180px;margin:0 auto;padding:20px 28px 48px;}
#robot-factory [hidden] {display:none!important;}
#robot-factory h1,#robot-factory h2,#robot-factory h3,#robot-factory p {margin-top:0;}
#robot-factory h1,#robot-factory h2,#robot-factory h3 {color:var(--rf-ink);font-weight:800;}
#robot-factory h1 {font-size:clamp(34px,4.4vw,56px);line-height:1.06;letter-spacing:-.035em;margin-bottom:18px;text-wrap:balance;}
#robot-factory h2 {font-size:clamp(25px,3vw,35px);line-height:1.15;letter-spacing:-.025em;margin-bottom:12px;}
#robot-factory h3 {font-size:20px;line-height:1.25;margin-bottom:10px;}
#robot-factory p {margin-bottom:16px;}
#robot-factory a {color:inherit;text-decoration-thickness:2px;text-underline-offset:4px;}
#robot-factory button,#robot-factory input,#robot-factory select {font-family:inherit;font-size:inherit;}
#robot-factory button,#robot-factory select {min-height:48px;}
#robot-factory button {min-width:48px;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
#robot-factory button:focus-visible,#robot-factory a:focus-visible,#robot-factory input:focus-visible,
#robot-factory select:focus-visible,#robot-factory summary:focus-visible {outline:3px solid #087d92;outline-offset:4px;}
#robot-factory button:disabled {cursor:default;opacity:.55;}
#robot-factory svg {max-width:100%;}
#robot-factory .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;}
.robot-factory-page>.rf-skip {position:absolute;top:-90px;left:12px;z-index:20;padding:12px 18px;border:2px solid #223b4b;border-radius:10px;background:#fffdf5;color:#223b4b;font-weight:700;}
.robot-factory-page>.rf-skip:focus {top:12px;}

.rf-topbar {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 20px;margin-bottom:24px;border-bottom:1px solid #b8c6bf;}
.rf-brand {display:inline-flex;align-items:center;gap:12px;font-size:17px;font-weight:800;line-height:1.25;text-decoration:none;}
.rf-brand svg {width:36px;height:36px;flex:none;}
.rf-brand .brand-icon {width:46px;height:44px;flex:0 0 46px;border-radius:13px;background:linear-gradient(145deg,#1d5eb3,#133e7a);box-shadow:3px 3px 0 #f5d96d;display:inline-flex;align-items:center;justify-content:center;gap:2px;color:#fff;font-weight:900;font-size:18px;letter-spacing:-1px;line-height:1;}
.rf-brand .brand-icon .brand-dot {width:6px;height:6px;border-radius:99px;background:#ffd859;display:inline-block;margin:0 1px;font-size:0;line-height:0;color:transparent;flex-shrink:0;}
.rf-brand .brand-text {display:flex;flex-direction:column;line-height:1.05;gap:2px;}
.rf-brand .brand-top {display:flex;align-items:center;gap:6px;}
.rf-brand .brand-name {font-size:21px;font-weight:900;letter-spacing:-.8px;color:#17324d;}
.rf-brand .beta-badge {display:inline-flex;align-items:center;padding:2px 7px;border-radius:99px;background:#fef3c7;color:#92400e;border:1px solid #f59e0b;font-size:10px;font-weight:800;letter-spacing:.5px;line-height:1.1;text-transform:uppercase;white-space:nowrap;}
.rf-brand .brand-end {font-size:13px;font-weight:700;color:#19519a;letter-spacing:.3px;line-height:1.1;}
.rf-back {display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:14px;font-weight:700;text-align:right;}
.rf-backlink {display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:15px;font-weight:700;text-align:right;}
.rf-kicker {font-size:12px;line-height:1.4;font-weight:800;letter-spacing:.11em;text-transform:uppercase;color:var(--rf-orange);margin-bottom:10px!important;}
.rf-lead {font-size:clamp(18px,2.1vw,22px);line-height:1.45;color:var(--rf-muted);max-width:38em;}
.rf-chips {display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 24px;}
.rf-chip {display:inline-flex;align-items:center;gap:7px;min-height:30px;padding:4px 11px;border:1px solid #bbc9bc;border-radius:999px;background:#e8efe3;font-size:13px;font-weight:700;line-height:1.35;}
.rf-chip svg {width:16px;height:16px;}
.rf-setup {position:relative;}
.rf-intro {display:grid;grid-template-columns:minmax(0,1.35fr) minmax(240px,.65fr);align-items:center;gap:42px;margin-bottom:36px;}
.rf-intro-copy>p:not(.rf-kicker) {max-width:37em;font-size:18px;line-height:1.5;color:var(--rf-muted);}
.rf-intro em {font-style:normal;color:#a84920;}
.rf-hero {position:relative;padding:10px;border:2px solid var(--rf-ink);border-radius:25px;background:#d5e2d4;box-shadow:0 6px 0 #bdcabd;text-align:center;}
.rf-hero-image {display:block;width:100%;height:auto;aspect-ratio:3 / 4;object-fit:cover;object-position:center;border-radius:15px;}
.rf-hero-label {margin:10px auto 2px;}
.rf-hero-label {display:inline-block;padding:8px 12px;border:1px solid #a1b99f;border-radius:10px;background:#f9f9e9;font-size:13px;line-height:1.4;font-weight:700;color:#3e6450;}
.rf-row-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:8px;max-width:740px;}
.rf-selection-actions {display:flex;flex-wrap:wrap;gap:6px 20px;margin:8px 0 0;}
.rf-text-button {padding:8px 0;border:0;background:transparent;color:#396b56;font-size:14px!important;font-weight:700;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;}
.rf-setup .rf-options>p {font-size:15px;color:var(--rf-muted);}
.rf-saved {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:18px 0;padding:16px 20px;border:1.5px solid #77a18a;border-radius:15px;background:#e1efdd;}
.rf-saved p {flex:1 1 220px;margin:0!important;}
.rf-setup-grid {display:grid;grid-template-columns:minmax(0,1.1fr) minmax(300px,.9fr);align-items:start;gap:28px;}
.rf-setup-panel,.rf-setup form {padding:25px;border:2px solid var(--rf-ink);border-radius:20px;background:var(--rf-paper);box-shadow:0 5px 0 #c8d0c5;}
.rf-setup-panel h2,.rf-setup form h2 {font-size:25px!important;}
.rf-setup fieldset {min-width:0;margin:0 0 22px;padding:0;border:0;}
.rf-setup legend {font-size:15px;font-weight:800;padding:0;margin-bottom:9px;}
.rf-choices {display:flex;flex-wrap:wrap;gap:8px;}
.rf-choices label {display:flex;align-items:center;gap:7px;min-height:46px;padding:8px 12px;border:1px solid #c0ccc8;border-radius:10px;background:#f5f6ec;cursor:pointer;line-height:1.25;}
.rf-choices input {width:19px;height:19px;accent-color:var(--rf-green);}
.rf-choices label:has(input:checked) {background:#e2f0e4;border-color:#397b5d;box-shadow:inset 0 0 0 1px #397b5d;}
.rf-choices button,.rf-row-choice {min-height:48px;padding:8px 14px;border:1.5px solid #b8c8c2;border-radius:10px;background:#fffdf5;color:var(--rf-ink);font-weight:700;line-height:1.3;}
.rf-row-choice {min-width:48px;flex:0 0 auto;text-align:center;font-variant-numeric:tabular-nums;}
.rf-row-grid .rf-row-choice {display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;}
.rf-row-choice input {width:18px;height:18px;margin:0;accent-color:var(--rf-green);}
.rf-row-choice:has(input:checked) {background:#dcefe0;border-color:#367450;box-shadow:inset 0 0 0 1px #367450;color:#20543b;}
.rf-choices button[aria-pressed="true"],.rf-row-choice[aria-pressed="true"] {background:#dcefe0;border-color:#367450;box-shadow:inset 0 0 0 1px #367450;color:#20543b;}
.rf-setup select,.rf-setup input[type="text"] {display:block;max-width:100%;width:100%;margin-top:7px;padding:10px 12px;border:1.5px solid #a9bbb4;border-radius:10px;background:#fff;color:var(--rf-ink);}
.rf-setup-note,.rf-small {font-size:14px;color:var(--rf-muted);line-height:1.45;}
.rf-control-help {font-size:14px;line-height:1.45;color:var(--rf-muted);}
.rf-save-status {margin:20px 0 0!important;font-size:13px;line-height:1.5;text-align:center;color:var(--rf-muted);}
.rf-setup-note {margin:10px 0 0!important;}
.rf-setup .rf-actions {margin-top:22px;}
.rf-setup .rf-primary {width:100%;}

/* Match the preparation controls used by the other adventures. */
#robot-factory .rf-setup form h2 {margin-bottom:24px;}
#robot-factory .rf-choices {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
#robot-factory .rf-choices label,#robot-factory .rf-row-grid .rf-row-choice {position:relative;display:block;min-width:0;min-height:0;padding:0;border:0;background:transparent;box-shadow:none;}
#robot-factory .rf-choices input,#robot-factory .rf-row-grid input {position:absolute;width:1px;height:1px;margin:-1px;opacity:0;}
#robot-factory .rf-choices label>span {display:flex;align-items:center;justify-content:center;gap:8px;min-height:60px;padding:8px;border:2px solid #b8c8c2;border-radius:12px;background:#fffdf5;color:var(--rf-ink);text-align:center;line-height:1.2;}
#robot-factory .rf-choices label>span i {font-size:24px;font-style:normal;line-height:1;}
#robot-factory .rf-choices label>span b {font-size:15px;}
#robot-factory .rf-row-grid {display:flex;flex-wrap:wrap;gap:6px;max-width:none;}
#robot-factory .rf-row-grid .rf-row-choice>span {display:grid;place-items:center;width:44px;height:44px;border:2px solid #b8c8c2;border-radius:10px;background:#fffdf5;color:var(--rf-ink);font-weight:800;}
#robot-factory .rf-choices input:checked+span,#robot-factory .rf-row-grid input:checked+span {background:#dcefe0;border-color:#367450;color:#20543b;box-shadow:0 3px 0 #b6d6bd;}
#robot-factory .rf-choices input:focus-visible+span,#robot-factory .rf-row-grid input:focus-visible+span {outline:3px solid #087d92;outline-offset:3px;}
@media (max-width:390px) {
  #robot-factory .rf-choices label>span {flex-direction:column;gap:3px;min-height:70px;padding:7px 2px;}
  #robot-factory .rf-choices label>span b {font-size:12px;}
  #robot-factory .rf-row-grid {gap:6px;}
  #robot-factory .rf-row-grid .rf-row-choice>span {width:44px;height:44px;}
}

.rf-primary,.rf-secondary,.rf-icon-button,.rf-choice {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:11px 19px;border:2px solid var(--rf-ink);border-radius:12px;font-weight:800;line-height:1.25;text-decoration:none;}
.rf-primary {background:var(--rf-yellow);color:#3d351f;box-shadow:0 4px 0 #a4793d;}
.rf-secondary {background:var(--rf-paper);color:var(--rf-ink);box-shadow:0 3px 0 #c4d0c9;}
.rf-icon-button {padding:10px;background:#eff4ec;color:var(--rf-ink);box-shadow:none;}
.rf-primary svg,.rf-secondary svg,.rf-icon-button svg {width:21px;height:21px;flex:none;}
.rf-primary:active:not(:disabled),.rf-secondary:active:not(:disabled) {box-shadow:0 1px 0 #9caa9e;transform:translateY(2px);}
.rf-actions {display:flex;flex-wrap:wrap;align-items:center;gap:12px;}
.rf-actions p {margin:0!important;}

.rf-story {display:flex;align-items:center;gap:18px;padding:18px 22px;margin:20px 0;border:1.5px solid #c5c7aa;border-radius:20px;background:#fff8d9;}
.rf-story p {margin-bottom:0!important;}
.rf-story strong {color:#7b4a1d;}
.rf-robot {flex:0 0 88px;align-self:center;}
.rf-robot svg,svg.rf-robot {display:block;width:88px;height:auto;overflow:visible;}
.rf-setup .rf-story {margin-top:24px;}
.rf-story-copy {min-width:0;}
.rf-rudi-avatar {display:grid;place-items:center;flex:none;align-self:center;width:60px;height:60px;border:2px solid #aa9a64;border-radius:16px;background:#ffe9a5;font-size:35px;line-height:1;transform:rotate(-4deg);}
.rf-speech {position:relative;padding:16px 19px;border:2px solid var(--rf-ink);border-radius:16px;background:#fffdf5;}
.rf-speech::before {content:"";position:absolute;left:-9px;top:24px;width:14px;height:14px;background:#fffdf5;border-left:2px solid var(--rf-ink);border-bottom:2px solid var(--rf-ink);transform:rotate(45deg);}

.rf-game {min-width:0;}
.rf-game-top {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px;}
.rf-game-top .rf-actions {justify-content:flex-end;}
.rf-stats {display:flex;flex-wrap:wrap;gap:10px;}
.rf-stat {display:flex;align-items:center;gap:7px;padding:6px 11px;border:1px solid #bdc9c2;border-radius:9px;background:#fffdf5;font-size:14px;font-weight:700;font-variant-numeric:tabular-nums;}
.rf-map {margin:0 0 20px;padding:14px 18px;border:1px solid #bbc8bf;border-radius:15px;background:#e7ede1;}
.rf-map ol {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;counter-reset:rf-station;list-style:none;padding:0;margin:0;}
.rf-map li {display:flex;align-items:center;gap:9px;min-width:0;font-size:13px;line-height:1.3;font-weight:700;color:#586c67;}
.rf-map li::before {counter-increment:rf-station;content:counter(rf-station);display:grid;place-items:center;flex:none;width:29px;height:29px;border:1px solid #a7b8ae;border-radius:50%;background:#f8faf2;color:#4b6257;font-size:13px;}
.rf-route-symbol {display:none;}
.rf-route-check {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}
.rf-map li>span:not(.rf-route-symbol):not(.rf-route-check) {min-width:0;overflow-wrap:anywhere;hyphens:auto;}
.rf-map li[aria-current="step"] {color:#174f38;}
.rf-map li[aria-current="step"]::before {background:#286b4e;border-color:#286b4e;color:#fff;box-shadow:0 0 0 3px #bfdcc6;}
.rf-map li.is-complete {color:#38664a;}
.rf-map li.is-complete::before {content:"✓";background:#cfdfce;border-color:#98b59d;color:#245337;}
.rf-map progress {display:block;appearance:none;-webkit-appearance:none;width:100%;height:6px;margin:12px 0 0;border:0;border-radius:9px;overflow:hidden;background:#c7d4c8;}
.rf-map progress::-webkit-progress-bar {background:#c7d4c8;}
.rf-map progress::-webkit-progress-value {background:#48835a;}
.rf-map progress::-moz-progress-bar {background:#48835a;}
.rf-room {min-width:0;border:2px solid var(--rf-ink);border-radius:22px;overflow:hidden;background:var(--rf-paper);box-shadow:0 6px 0 #c1ccc4;}
.rf-room-header {display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px 26px 18px;border-bottom:1px solid #c9d5cf;background:#fffdf5;}
.rf-room-header h2 {margin-bottom:4px!important;}
.rf-room-header p {margin-bottom:0!important;color:var(--rf-muted);font-size:15px;}
.rf-room-header .rf-kicker {color:var(--rf-orange);margin-bottom:7px!important;}
.rf-room-badge {display:grid;place-items:center;width:48px;height:48px;flex:none;border:2px solid var(--rf-ink);border-radius:13px;background:var(--rf-yellow);font-size:23px;font-weight:800;transform:rotate(3deg);}
.rf-stage {--rf-stage-bg:#dfe9e4;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);min-width:0;align-items:stretch;gap:0;background:var(--rf-stage-bg);}
.rf-machine {position:relative;min-width:0;min-height:330px;padding:28px 24px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;isolation:isolate;overflow:hidden;background-image:linear-gradient(#c0cec650 1px,transparent 1px),linear-gradient(90deg,#c0cec650 1px,transparent 1px);background-size:24px 24px;}
.rf-machine::before {content:"";position:absolute;inset:12px;z-index:-1;pointer-events:none;background:radial-gradient(circle at 0 0,#768e87 0 3px,transparent 4px),radial-gradient(circle at 100% 0,#768e87 0 3px,transparent 4px),radial-gradient(circle at 0 100%,#768e87 0 3px,transparent 4px),radial-gradient(circle at 100% 100%,#768e87 0 3px,transparent 4px);}
.rf-machine>svg {display:block;width:100%;max-width:430px;height:auto;max-height:320px;}
.rf-apparatus {display:flex;flex-direction:column;align-items:center;gap:10px;width:100%;max-width:380px;}
.rf-apparatus svg {display:block;width:100%;max-height:180px;overflow:visible;}
.rf-machine-label {display:inline-block;margin:0!important;padding:5px 12px;border:1px solid #a3b7a9;border-radius:7px;background:#f2f5e4;font-size:12px;line-height:1.3;font-weight:800;color:#3b5b4c;text-align:center;}
.rf-machine-caption {max-width:34em;margin:0!important;text-align:center;font-size:14px;font-weight:700;color:#425f53;}
.rf-console {min-width:0;padding:26px;background:var(--rf-paper);border-left:1px solid #b8c8bf;}
.rf-prompt {font-size:18px;line-height:1.45;font-weight:700;margin-bottom:18px;}
.rf-task {padding:16px;border:1.5px solid #b7c9bd;border-radius:14px;background:#edf3e7;margin-bottom:18px;}
.rf-task p:last-child {margin-bottom:0!important;}
.rf-equation {font-size:clamp(27px,3.1vw,40px);font-weight:800;line-height:1.25;letter-spacing:-.025em;text-align:center;font-variant-numeric:tabular-nums;color:#2c5841;margin:12px 0 18px!important;}
.rf-input-row {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:14px 0;}
.rf-input-row label {font-size:14px;font-weight:700;}
.rf-answer {min-width:0;max-width:100%;width:110px;height:54px;border:2px solid #7d9a8b;border-radius:11px;background:white;color:var(--rf-ink);font-size:27px!important;font-weight:800;text-align:center;padding:6px 10px;font-variant-numeric:tabular-nums;}
.rf-answer[aria-invalid="true"] {border-color:#a84526;background:#fff0e4;}
select.rf-answer {width:100%;max-width:100%;height:52px;font-size:17px!important;text-align:left;}
.rf-keypad {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-width:320px;margin:16px auto;}
.rf-keypad button {padding:8px;border:1.5px solid #9eb3a7;border-radius:10px;background:white;color:var(--rf-ink);font-size:22px!important;font-weight:700;box-shadow:0 2px 0 #c6d4c9;}
.rf-keypad button:active:not(:disabled) {background:#e2eee0;box-shadow:none;}
.rf-choice-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.rf-choice {min-width:0;background:#f4f6eb;font-size:18px;}
.rf-choice[aria-pressed="true"],.rf-choice.is-selected {border-color:#2c704e;background:#dcf0df;box-shadow:0 0 0 2px #8fbc9a;}
.rf-cards {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;list-style:none;padding:0;margin:0;}
.rf-cards li {min-width:0;}
.rf-card-button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;min-height:88px!important;padding:12px 10px;border:2px solid #7d6745;border-radius:11px;background:#f8dfad;color:#4e3d27;box-shadow:0 4px 0 #b9a383;font-weight:800;line-height:1.3;}
.rf-card {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:88px;padding:13px 10px;border:1.5px solid #91a78e;border-radius:11px;background:#f8f8e7;color:#304d3b;text-align:center;}
.rf-card-button strong,.rf-card strong {font-size:15px;line-height:1.3;font-variant-numeric:tabular-nums;}
.rf-card-button>span,.rf-card>span {font-size:24px;line-height:1.25;font-weight:800;font-variant-numeric:tabular-nums;}
.rf-card-button>.rf-card-equation,.rf-card>.rf-card-equation {font-size:20px;white-space:nowrap;}
.rf-card-button small {font-size:12px;font-weight:700;}
.rf-card-button[aria-pressed="true"],.rf-card-button.is-selected {background:#d4eacb;border-color:#47724a;box-shadow:0 0 0 3px #b0d0a6,0 4px 0 #8ca67f;}
.rf-targets {display:flex;flex-wrap:wrap;justify-content:center;gap:10px;width:100%;}
.rf-target {min-width:52px;min-height:58px!important;flex:1 1 52px;max-width:100px;padding:8px;border:2px dashed #6b8e80;border-radius:10px;background:#fafff0;color:#294b3c;font-size:22px!important;font-weight:800;line-height:1.2;}
.rf-target.is-filled,.rf-target[aria-pressed="true"] {border-style:solid;background:#d6e8d0;}
.rf-target small {display:block;margin-bottom:4px;font-size:11px;line-height:1.25;color:#5d7666;}
.rf-switches {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;}
.rf-answers {min-width:0;}
.rf-answers .rf-input-row {justify-content:center;}
.rf-rules {padding-left:20px;margin:0 0 18px;color:#4d675a;font-size:15px;line-height:1.5;}
.rf-rules li+li {margin-top:7px;}
.rf-journal {margin-top:18px;padding:9px 14px;border:1px solid #aebfae;border-radius:12px;background:#f4f5e7;color:#223b4b;font-size:14px;}
.rf-journal summary {display:flex;align-items:center;gap:8px;min-height:44px;border-radius:6px;color:#223b4b;font-weight:800;cursor:pointer;}
.rf-journal summary::before {content:"▸";font-size:17px;}
.rf-journal[open] summary::before {content:"▾";}
.rf-journal p:last-child {margin-bottom:4px!important;}
.rf-notes {display:grid;gap:10px;margin-top:10px;}
.rf-notes article {padding:12px;border-left:3px solid #93ab8b;background:#fffdf0;}
.rf-notes h3 {font-size:15px!important;margin-bottom:6px!important;}
.rf-inventory .rf-notes h3 {color:#223b4b!important;}
.rf-notes p,.rf-notes ul {font-size:14px;line-height:1.5;}
.rf-machine[data-solved="true"],.rf-stage[data-solved="true"] .rf-machine {box-shadow:inset 0 0 0 4px #87b18a;}
.rf-machine-success {display:flex;align-items:center;gap:9px;margin:0!important;padding:9px 15px;border:1px solid #77a378;border-radius:999px;background:#f2f9dc;color:#2c603b;font-size:15px;font-weight:800;animation:rf-success-in .45s ease-out both;}
.rf-machine-success>span {display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#35784c;color:white;font-size:16px;}
.rf-stage[data-solved="true"] .rf-apparatus {animation:rf-machine-ready .6s ease-in-out both;}
.rf-apparatus[data-room="conveyor"] path[stroke-dasharray] {animation:rf-belt-running 3s linear infinite;}
.rf-apparatus[data-room="lasers"] path[stroke-dasharray] {animation:rf-laser-trace 6s linear infinite;}
@keyframes rf-belt-running {to {stroke-dashoffset:-44;}}
@keyframes rf-laser-trace {to {stroke-dashoffset:-26;}}
@keyframes rf-machine-ready {0%,100% {transform:translateY(0);}45% {transform:translateY(-5px);}}
@keyframes rf-success-in {from {opacity:.4;transform:translateY(5px);}to {opacity:1;transform:translateY(0);}}

.rf-conveyor {position:relative;width:100%;padding:18px 10px 26px;border-radius:17px;background:repeating-linear-gradient(90deg,#526b6e 0 15px,#819496 15px 18px);border:6px solid #304e58;box-shadow:0 6px 0 #a5b7af;}
.rf-conveyor::after {content:"";position:absolute;left:8px;right:8px;bottom:-15px;height:12px;border-radius:6px;background:repeating-linear-gradient(90deg,#b9c8c1 0 18px,#4d6668 18px 24px);border:2px solid #3a565f;}
.rf-packages {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;width:100%;}
.rf-package {position:relative;min-width:68px;min-height:74px!important;padding:12px 9px;border:2px solid #7a552a;border-radius:9px;background:linear-gradient(90deg,transparent 40%,#edd6a6 40% 60%,transparent 60%),#d9ae68;color:#4e391f;font-size:22px!important;font-weight:800;box-shadow:0 4px 0 #a67d45;}
.rf-package[aria-pressed="true"],.rf-package.is-selected {border-color:#1b654b;outline:3px solid #aee2b8;outline-offset:3px;}
.rf-package.is-sorted,.rf-package[data-state="sorted"] {background:#d7e9bd;border-color:#628e57;box-shadow:0 3px 0 #9db589;}
.rf-stage[data-room="power"] {--rf-stage-bg:#d9e6dc;}
.rf-stage[data-room="gears"] {--rf-stage-bg:#f0e4cd;}
.rf-gears {display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:14px;}
.rf-gear {display:grid;place-items:center;min-width:76px;min-height:76px!important;padding:10px;border:3px solid #52636a;border-radius:50%;background:#bac9c9;box-shadow:0 4px 0 #8b9b9a;color:#223b4b;font-size:23px!important;font-weight:800;}
.rf-gear[aria-pressed="true"] {border-color:#955b21;background:#ffda83;box-shadow:0 4px 0 #b48146;}
.rf-gear svg {width:56px;height:56px;}
.rf-gear strong {font-size:29px;line-height:1.1;}
.rf-gear small {display:block;font-size:10px;font-weight:700;line-height:1.2;}
.rf-stage[data-room="lasers"] {--rf-stage-bg:#d9e4e9;}
.rf-laser-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:14px;width:100%;}
.rf-laser-beam {height:5px;min-width:0;border-radius:6px;background:#db7f4b;box-shadow:0 0 0 2px #ffe3b9,0 0 14px 3px #d9794340;}
.rf-laser-beam.is-off,.rf-laser-beam[data-active="false"] {height:3px;background:#7ba9a5;box-shadow:none;opacity:.55;}
.rf-switch {min-width:64px;min-height:64px!important;padding:10px;border:3px solid #2e4d5b;border-radius:12px;background:#f7cf80;box-shadow:0 4px 0 #82999d;font-size:22px!important;font-weight:800;color:#3f3c2f;}
.rf-switches .rf-switch {display:flex;align-items:center;justify-content:center;gap:10px;font-size:17px!important;}
.rf-switch-lever {display:block;position:relative;width:20px;height:34px;flex:none;border:2px solid #526451;border-radius:12px;background:#f1f0d6;}
.rf-switch-lever::after {content:"";position:absolute;left:2px;right:2px;bottom:2px;height:13px;border-radius:50%;background:#4b6b61;box-shadow:0 1px 2px #223b4b40;transition:transform .2s ease;}
.rf-switch[aria-pressed="true"] .rf-switch-lever::after {transform:translateY(-13px);background:#246346;}
.rf-switch[aria-pressed="true"] {background:#b8e0cd;border-color:#356b59;box-shadow:0 2px 0 #779b8c;}
.rf-stage[data-room="control"] {--rf-stage-bg:#dfded0;}
.rf-stage[data-room="escape"] {--rf-stage-bg:#e0e9d4;}
.rf-stage[data-room="escape"] .rf-card {align-items:flex-start;justify-content:flex-start;min-height:0;padding:14px;text-align:left;}
.rf-stage[data-room="escape"] .rf-card>span {font-size:16px;font-weight:400;line-height:1.5;font-variant-numeric:normal;}
.rf-stage[data-room="escape"] .rf-cards li:last-child:nth-child(odd) {grid-column:1/-1;}
.rf-terminal {width:100%;padding:20px;border:7px solid #35525c;border-radius:18px;background:#153d39;box-shadow:0 6px 0 #78918b;color:#e3f2bc;}
.rf-terminal p {color:inherit;}
.rf-code-slots {display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:18px 0;}
.rf-code-slot {display:grid;place-items:center;width:48px;min-height:56px;border:2px solid #88a797;border-radius:9px;background:#faffef;color:#315342;font-size:27px;font-weight:800;}
.rf-meter {overflow:hidden;width:100%;height:16px;border:2px solid #466557;border-radius:20px;background:#e4e9d5;}
.rf-meter>span {display:block;height:100%;background:repeating-linear-gradient(120deg,#60976c 0 10px,#8bb98b 10px 18px);}

.rf-feedback {margin:18px 0 0;padding:13px 15px;border-left:4px solid #92ac9c;border-radius:0 11px 11px 0;background:#edf2e7;font-size:15px;line-height:1.45;color:#3f5a4b;}
.rf-feedback:empty {padding:0;margin:0;border:0;}
.rf-feedback[data-state="correct"],.rf-feedback[data-kind="correct"],.rf-feedback.is-correct {border-color:#3b7c51;background:#e3f1dd;color:#28533a;}
.rf-feedback[data-state="incorrect"],.rf-feedback[data-kind="incorrect"],.rf-feedback.is-incorrect {border-color:#b96930;background:#fff0dc;color:#714622;}
.rf-feedback strong {font-weight:800;}
.rf-hint {margin-top:16px;padding:13px 15px;border:1px dashed #b2bb9d;border-radius:12px;background:#faf8e8;font-size:15px;}
.rf-hint summary {display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700;color:#526044;}
.rf-hint p {margin-top:10px;margin-bottom:0!important;}
.rf-hint button {font-size:14px;min-height:44px;}
.rf-hint .rf-secondary {box-shadow:none;border-width:1px;padding:8px 12px;}
.rf-hint ol {padding-left:20px;margin:12px 0 0;font-size:14px;line-height:1.5;}
.rf-hint ol:empty {display:none;}
.rf-hint li+li {margin-top:10px;}
.rf-inventory {margin-top:24px;padding:21px 24px;border-radius:18px;background:#294653;color:#f8f8e9;box-shadow:0 5px 0 #b7c5ba;}
.rf-inventory h2,.rf-inventory h3 {color:#f9f8e9!important;font-size:18px!important;letter-spacing:0!important;}
.rf-inventory>p {font-size:14px;color:#cddfda;margin-bottom:14px!important;}
.rf-inventory-header .rf-kicker {color:#ffe0a0;}
.rf-inventory-header>p:not(.rf-kicker) {color:#d2e2dd;font-size:14px;}
.rf-inventory>.rf-control-help {margin-top:13px;color:#d2e2dd;}
.rf-inventory ul,.rf-inventory-list {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;list-style:none;margin:0;padding:0;}
.rf-clue {display:flex;align-items:center;gap:10px;min-width:0;min-height:67px;padding:12px;border:1px dashed #809c9d;border-radius:12px;background:#365560;color:#e5e9df;font-size:14px;line-height:1.4;}
.rf-clue[data-state="found"],.rf-clue.is-found {border-style:solid;border-color:#e7ca7d;background:#ffefbd;color:#57482a;box-shadow:0 3px 0 #1d3642;}
.rf-clue svg {width:31px;height:31px;flex:none;}
.rf-clue strong {display:block;}
.rf-clue-empty {grid-column:1/-1;}
.rf-clue-button {display:flex;align-items:center;gap:10px;width:100%;min-width:0!important;padding:0;border:0;border-radius:6px;background:transparent;color:inherit;line-height:1.4;text-align:left;}
.rf-clue-button>strong {display:grid;place-items:center;min-width:34px;font-size:26px;font-variant-numeric:tabular-nums;}
.rf-clue-button[aria-expanded="true"] {outline:2px solid #f8db8f;outline-offset:6px;}
.rf-clue-number {display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:8px;background:#fff9e5;color:#4d5235;font-size:21px;font-weight:800;}
.rf-finale {position:relative;overflow:hidden;max-width:780px;margin:24px auto;padding:44px;border:2px solid var(--rf-ink);border-radius:24px;background:var(--rf-paper);box-shadow:0 7px 0 #becbbd;text-align:center;}
.rf-finale::before {content:"";position:absolute;left:0;right:0;top:0;height:11px;background:repeating-linear-gradient(120deg,#f0b65d 0 20px,#faf1d3 20px 40px,#72a48a 40px 60px,#faf1d3 60px 80px);}
.rf-finale h2 {font-size:clamp(30px,4.5vw,46px)!important;}
.rf-finale>.rf-robot,.rf-finale .rf-robot svg {width:140px;max-width:100%;margin:0 auto 22px;}
.rf-finale .rf-actions {justify-content:center;margin-top:26px;}
.rf-finale .rf-stats {justify-content:center;margin:22px 0;}
.rf-finale .rf-story {text-align:left;}
.rf-finale-art {font-size:68px;line-height:1.2;margin:8px 0 22px;}
.rf-finish-clues {display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:20px 0;}
.rf-finish-clues .rf-clue {border-style:solid;background:#fff0bf;color:#57482a;}
.rf-finish-clue {display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border:1px solid #c1b681;border-radius:10px;background:#f9efc8;color:#5c5030;font-size:14px;font-weight:700;}
.rf-footer {display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-top:32px;font-size:13px;line-height:1.5;color:#60756b;text-align:center;}
.rf-dialog {max-width:480px;width:calc(100% - 30px);padding:26px;border:2px solid #294653;border-radius:20px;background:#fffdf5;color:#223b4b;box-shadow:0 14px 55px #15382f40;}
.rf-dialog::backdrop {background:#173c3a70;}

@media(hover:hover) {
  .rf-primary:hover:not(:disabled) {background:#ffdc91;}
  .rf-secondary:hover:not(:disabled),.rf-choice:hover:not(:disabled) {background:#eaf2e5;}
  .rf-choices button:hover:not(:disabled),.rf-keypad button:hover:not(:disabled) {border-color:#4b8064;background:#edf5e7;}
  .rf-package:hover:not(:disabled) {filter:brightness(1.05);}
  .rf-journal summary:hover {background:#e6ecd8;}
}
@media(max-width:850px) {
  #robot-factory {padding-inline:22px;}
  .rf-setup-grid {grid-template-columns:minmax(0,1fr);gap:22px;}
  .rf-setup-panel,.rf-setup form {padding:22px;}
  .rf-intro {grid-template-columns:minmax(0,1.3fr) minmax(200px,.7fr);gap:24px;}
  .rf-hero {padding:10px;}
  .rf-stage {grid-template-columns:minmax(0,1fr);}
  .rf-machine {min-height:270px;padding:24px;}
  .rf-machine>svg {max-height:260px;}
  .rf-console {border-left:0;border-top:1px solid #b8c8bf;}
  .rf-inventory ul,.rf-inventory-list {gap:9px;}
  .rf-map li {flex-direction:column;gap:6px;text-align:center;font-size:12px;}
}
@media(max-width:560px) {
  body.robot-factory-page {font-size:16px;}
  #robot-factory {padding:12px 12px 30px;}
  .rf-topbar {gap:10px;padding-bottom:12px;margin-bottom:20px;}
  .rf-brand {font-size:14px;gap:7px;}
  .rf-brand svg {width:29px;height:29px;}
  .rf-backlink {font-size:13px;}
  #robot-factory h1 {font-size:35px;}
  .rf-intro {grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:28px;}
  .rf-intro-copy>p:not(.rf-kicker) {font-size:17px;}
  .rf-intro .rf-chips {margin-bottom:8px;}
  .rf-hero {display:block;width:100%;max-width:360px;margin-inline:auto;padding:9px;transform:none;}
  .rf-hero-image {aspect-ratio:1 / 1;object-position:center 40%;}
  .rf-hero-label {padding:9px 11px;font-size:13px;transform:none;}
  .rf-kicker {font-size:11px;}
  .rf-setup-panel,.rf-setup form {padding:18px 15px;}
  .rf-choices {gap:7px;}
  .rf-row-choice {padding-inline:10px;}
  .rf-story {align-items:flex-start;gap:11px;padding:15px 12px;}
  .rf-robot {flex-basis:62px;}
  .rf-robot svg,svg.rf-robot {width:62px;}
  .rf-story p {font-size:15px;line-height:1.45;}
  .rf-rudi-avatar {width:46px;height:46px;font-size:28px;border-radius:12px;}
  .rf-game-top {align-items:flex-start;flex-direction:column;gap:10px;}
  .rf-game-top .rf-actions {width:100%;justify-content:space-between;gap:8px;}
  .rf-map {padding:12px 8px;border-radius:12px;}
  .rf-map ol {grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 6px;}
  .rf-map li {flex-direction:column;gap:6px;font-size:11px;line-height:1.25;text-align:center;overflow-wrap:anywhere;}
  .rf-map li::before {width:27px;height:27px;font-size:12px;}
  .rf-room {border-radius:17px;}
  .rf-room-header {padding:18px 16px;gap:10px;flex-direction:column;align-items:flex-start;}
  .rf-room-header>div {min-width:0;max-width:100%;}
  .rf-room-header h2 {font-size:26px!important;}
  .rf-room-header p {font-size:14px;}
  .rf-room-badge {width:40px;height:40px;font-size:21px;}
  .rf-machine {min-height:230px;padding:22px 14px;gap:16px;}
  .rf-machine>svg {max-height:225px;}
  .rf-apparatus svg {max-height:145px;}
  .rf-console {padding:20px 16px;}
  .rf-prompt {font-size:17px;}
  .rf-equation {font-size:30px;}
  .rf-actions {gap:10px;}
  .rf-actions>.rf-primary {flex:1 1 180px;}
  .rf-inventory {padding:18px 14px;}
  .rf-inventory ul,.rf-inventory-list {grid-template-columns:minmax(0,1fr);}
  .rf-clue {min-height:60px;padding:10px 12px;}
  .rf-finale {padding:35px 20px 27px;}
  .rf-finale>.rf-robot,.rf-finale .rf-robot svg {width:110px;}
  .rf-laser-grid {gap:9px;}
  .rf-package {min-width:61px;min-height:68px!important;font-size:20px!important;}
  .rf-gears {gap:10px;}
  .rf-gear {min-width:65px;min-height:65px!important;}
  .rf-card-button strong,.rf-card strong {font-size:14px;}
  .rf-card-button>span,.rf-card>span {font-size:22px;}
  .rf-stage[data-room="lasers"] .rf-cards,.rf-stage[data-room="escape"] .rf-cards {grid-template-columns:minmax(0,1fr);}
  .rf-card-button>.rf-card-equation,.rf-card>.rf-card-equation {font-size:20px;}
  .rf-footer {justify-content:center;font-size:12px;}
  .rf-footer>span {flex-basis:100%;order:1;}
}
@media(prefers-reduced-motion:reduce) {
  #robot-factory *,#robot-factory *::before,#robot-factory *::after {scroll-behavior:auto!important;animation:none!important;transition:none!important;}
}
@media print {
  body.robot-factory-page {background:#fff;}
  #robot-factory {padding:0;}
  .rf-topbar,.rf-actions,.rf-keypad,.rf-footer {display:none!important;}
  .rf-room,.rf-finale,.rf-inventory {box-shadow:none;break-inside:avoid;}
}

/* Rudi accompanies the children through a little illustrated factory world. */
.rf-world {
  position:relative;isolation:isolate;overflow:hidden;min-height:178px;margin:0 0 18px;
  border:2px solid #244650;border-radius:20px;background:#628b89;
  box-shadow:0 5px 0 #bdcbbf;
}
.rf-world-art {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.rf-world-scene {display:none;}
.rf-world[data-scene="power"] .rf-world-power,
.rf-world[data-scene="conveyor"] .rf-world-conveyor,
.rf-world[data-scene="gears"] .rf-world-gears,
.rf-world[data-scene="lasers"] .rf-world-lasers,
.rf-world[data-scene="control"] .rf-world-control,
.rf-world[data-scene="escape"] .rf-world-escape {display:block;}
.rf-world-rudi {
  position:absolute;z-index:1;bottom:4px;left:18%;width:150px;height:auto;
  filter:drop-shadow(0 5px 0 #173a3c45);
  transform-origin:50% 100%;animation:rf-rudi-breathe 3s ease-in-out infinite;
}
.rf-world-caption {
  position:absolute;left:18px;top:16px;z-index:2;display:grid;gap:2px;max-width:40%;
  padding:9px 13px;border:1px solid #d6e8d3;border-radius:11px;
  background:#fffdf3ed;color:#234c52;box-shadow:0 3px 0 #2648522b;
}
.rf-world-caption span {font-size:11px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;}
.rf-world-caption strong {font-size:15px;line-height:1.2;}
.rf-world[data-solved="true"] {box-shadow:0 0 0 3px #f9db83,0 5px 0 #aebdaf;}
.rf-world-turn use,.rf-world-turn-reverse use {transform-box:fill-box;transform-origin:center;animation:rf-world-spin 15s linear infinite;}
.rf-world-turn-reverse use {animation-direction:reverse;animation-duration:11s;}
.rf-world-parcels {animation:rf-parcel-wiggle 2.8s ease-in-out infinite;}
.rf-world-beam {animation:rf-world-light 2.8s ease-in-out infinite;}
.rf-rudi-avatar {overflow:hidden;background:#ffe9a5;}
.rf-rudi-avatar img {width:68px;max-width:none;height:auto;transform:translateY(2px);}
.rf-story {position:relative;border-color:#e7d9aa;box-shadow:0 4px 0 #d7ddc9;}
.rf-story::after {content:"✦";position:absolute;top:7px;right:14px;color:#cd983d;font-size:16px;}
.rf-finale-art {display:flex;justify-content:center;align-items:center;gap:12px;}
.rf-finale-art img {width:155px;max-width:46%;height:auto;filter:drop-shadow(0 6px 0 #d3ddcb);animation:rf-rudi-celebrate 1.8s ease-in-out infinite;}
.rf-finale-spark {color:#d89b37;font-size:30px;animation:rf-world-light 1.6s ease-in-out infinite;}
.rf-finale-spark-right {animation-delay:.8s;}
@keyframes rf-rudi-breathe {0%,100%{transform:translateY(0) rotate(-2deg);}50%{transform:translateY(-4px) rotate(2deg);}}
@keyframes rf-rudi-celebrate {0%,100%{transform:translateY(0) rotate(-4deg);}50%{transform:translateY(-8px) rotate(4deg);}}
@keyframes rf-world-spin {to{transform:rotate(360deg);}}
@keyframes rf-parcel-wiggle {0%,100%{transform:translateX(0);}50%{transform:translateX(7px);}}
@keyframes rf-world-light {0%,100%{opacity:.55;}50%{opacity:1;}}
@media(max-width:560px) {
  .rf-world {min-height:145px;margin-bottom:14px;border-radius:15px;}
  .rf-world-rudi {left:10%;width:105px;bottom:3px;}
  .rf-world-caption {top:10px;left:10px;padding:6px 9px;max-width:50%;}
  .rf-world-caption span {font-size:9px;}
  .rf-world-caption strong {font-size:12px;}
  .rf-rudi-avatar img {width:53px;}
  .rf-finale-art img {width:120px;}
}
@media(prefers-reduced-motion:reduce) {
  .rf-world-rudi,.rf-world-turn use,.rf-world-turn-reverse use,.rf-world-parcels,
  .rf-world-beam,.rf-finale-art img,.rf-finale-spark {animation:none!important;}
}

/* Realistic Rudi world */
.rf-world {min-height:205px;background:#294c51 url('/assets/robot-factory/factory-world-real-v1.webp') 10% 60% / cover no-repeat;transition:background-position 1.1s ease-in-out;}
.rf-world::before {content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(18,43,45,.24),transparent 48%,rgba(18,43,45,.12));}
.rf-world-art {display:none;}
.rf-world-rudi {left:30%;bottom:0;width:auto;max-width:34%;height:calc(100% - 18px);object-fit:contain;object-position:center bottom;filter:drop-shadow(0 6px 6px #172f3080);transform-origin:50% 100%;animation:rf-rudi-real-breathe 3s ease-in-out infinite;transition:left 1.1s ease-in-out;}
.rf-world[data-scene="conveyor"] {background-position:35% 65%;}
.rf-world[data-scene="gears"] {background-position:55% 45%;}
.rf-world[data-scene="lasers"] {background-position:70% 40%;}
.rf-world[data-scene="control"] {background-position:80% 50%;}
.rf-world[data-scene="escape"] {background-position:100% 55%;}
.rf-world[data-scene="conveyor"] .rf-world-rudi {left:36%;}
.rf-world[data-scene="gears"] .rf-world-rudi {left:43%;}
.rf-world[data-scene="lasers"] .rf-world-rudi {left:50%;}
.rf-world[data-scene="control"] .rf-world-rudi {left:57%;}
.rf-world[data-scene="escape"] .rf-world-rudi {left:64%;}
@keyframes rf-rudi-real-breathe {0%,100%{transform:translateY(0) rotate(-1deg);}50%{transform:translateY(-4px) rotate(1deg);}}
@media(max-width:560px) {
  .rf-world {min-height:160px;}
  .rf-world-rudi {bottom:0;height:calc(100% - 12px);}
}
@media(prefers-reduced-motion:reduce) {
  .rf-world,.rf-world-rudi {animation:none!important;transition:none!important;}
}

/* The missing-order adventure has five recognisable factory rooms. */
body[data-mission="2"] .rf-map ol {grid-template-columns:repeat(5,minmax(0,1fr));}
body[data-mission="2"] .rf-world[data-scene="power"] {background-image:url('/assets/robot-factory/mission-receiving-v1.webp');}
body[data-mission="2"] .rf-world[data-scene="conveyor"] {background-image:url('/assets/robot-factory/mission-storage-v1.webp');}
body[data-mission="2"] .rf-world[data-scene="gears"] {background-image:url('/assets/robot-factory/mission-inspection-v1.webp');}
body[data-mission="2"] .rf-world[data-scene="lasers"] {background-image:url('/assets/robot-factory/mission-routing-v1.webp');}
body[data-mission="2"] .rf-world[data-scene="control"] {background-image:url('/assets/robot-factory/mission-shipping-v1.webp');}
body[data-mission="2"] .rf-machine {justify-content:flex-start;background-color:#e8eee0;}
.rf-mission-brief {width:100%;padding:14px 16px;border:1px solid #a6baa8;border-radius:12px;background:#fbfcf2;color:#244538;}
.rf-mission-brief h3 {margin:0 0 8px;font-size:18px;line-height:1.3;}
.rf-mission-brief .rf-rules {margin:0;padding-left:20px;font-size:14px;line-height:1.45;}
body[data-mission="2"] .rf-inventory-list {grid-template-columns:repeat(2,minmax(0,1fr));}
body[data-mission="2"] .rf-order-piece {border-radius:6px 14px 7px 13px;background:#fff3c8;}
body[data-mission="2"] .rf-finale-art img.rf-finale-photo {display:block;width:min(100%,600px);max-width:100%;height:auto;aspect-ratio:16 / 9;object-fit:cover;border-radius:18px;filter:none;animation:none;}
body[data-mission="2"] .rf-finale-spark {display:none;}
.rf-share {width:100%;display:grid;gap:12px;color:#203e37;}
.rf-share h3,.rf-share p {margin:0;}
.rf-share h3 {font-size:19px;}
.rf-share>p {font-size:14px;line-height:1.45;}
.rf-share-stock {padding:12px;border:2px dashed #bb9c5f;border-radius:14px;background:#fff5d8;}
.rf-share-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
.rf-share-return {min-height:40px;padding:7px 10px;border:1px solid #9aaea1;border-radius:9px;background:#fff;color:#275e49;font-size:13px;font-weight:700;}
.rf-share-boxes {display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:9px;}
.rf-share-box {min-width:0;min-height:96px;padding:7px;border:2px solid #a6bdae;border-radius:13px;background:#fffdf5;}
.rf-share-stock.rf-share-drop-active,.rf-share-box.rf-share-drop-active {border-color:#18784e;box-shadow:0 0 0 3px #91cfaa;}
.rf-share-box-target {display:flex;justify-content:space-between;align-items:center;gap:6px;width:100%;min-height:44px;padding:6px;border:0;border-radius:8px;background:#dcebdd;color:#234e3e;text-align:left;font-size:14px;font-weight:800;}
.rf-share-box-target span {font-size:12px;white-space:nowrap;}
.rf-share-pieces {display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:8px;padding-top:6px;}
.rf-share-piece {display:grid;place-items:center;flex:none;width:40px;min-width:40px!important;height:40px;min-height:40px!important;padding:0;border:2px solid #9c713e;border-radius:8px;background:#f7cf82;color:#75491f;font-size:23px;line-height:1;touch-action:none;cursor:grab;}
#robot-factory button.rf-share-piece {touch-action:none;}
.rf-share-piece.is-selected {outline:3px solid #157549;outline-offset:2px;background:#ffe29a;}
.rf-share-piece.is-dragging {opacity:.35;}
.rf-share-more {font-size:12px;font-weight:700;color:#536e60;}
.rf-share-round {justify-self:start;}
.rf-share-status {padding:8px 11px;border-radius:8px;background:#edf5e8;font-weight:700;}
.rf-share-ghost {position:fixed;z-index:1000;transform:translate(-50%,-50%);display:grid;place-items:center;width:40px;height:40px;border:2px solid #9c713e;border-radius:8px;background:#f7cf82;color:#75491f;font-size:23px;pointer-events:none;box-shadow:0 4px 9px #1a332f55;}
.rf-inspection-box {height:100%;border:2px solid #a98c5c;border-radius:13px;background:#fff2d0;color:#473923;overflow:hidden;}
.rf-inspection-box summary {display:grid;gap:6px;min-height:112px;padding:14px;cursor:pointer;list-style:none;}
.rf-inspection-box summary::-webkit-details-marker {display:none;}
.rf-inspection-box summary span {font-size:18px;font-weight:800;}
.rf-inspection-box summary small {color:#346b50;text-decoration:underline;}
.rf-inspection-inside {display:grid;gap:9px;padding:12px;border-top:1px solid #d3bc91;background:#fffdf6;}
.rf-inspection-inside p {margin:0;font-size:14px;}
.rf-inspection-pieces {display:flex;flex-wrap:wrap;gap:3px;color:#b68043;font-size:21px;}
.rf-inspection-pieces small {align-self:center;font-size:12px;}
.rf-route-plans {display:grid;gap:6px;width:100%;padding:12px;border:1px solid #a1b5a7;border-radius:12px;background:#fffdf4;font-size:14px;}
.rf-route-plans p {margin:0;}
.rf-route-plans strong {display:block;color:#244f3c;}
.rf-route-plans del {color:#80584e;}
.rf-trial {display:grid;gap:10px;width:100%;padding:13px;border-radius:13px;background:#dcebdd;}
.rf-trial p {margin:0;}
.rf-trial-track {display:flex;align-items:center;gap:10px;min-height:52px;color:#315b4b;font-weight:800;}
.rf-trial-package {display:grid;place-items:center;width:45px;height:45px;border:2px solid #a87942;border-radius:9px;background:#f4c77e;color:#78502a;font-size:24px;}
.rf-trial.is-sending .rf-trial-package {animation:rf-trial-send .65s ease-in-out both;}
.rf-lift-plan {display:grid;gap:10px;width:100%;padding:16px;border:2px solid #9aaf9e;border-radius:14px;background:#fffaf0;color:#254f3d;}
.rf-lift-plan>strong {font-size:18px;}
.rf-lift-plan p {margin:0;font-size:14px;line-height:1.45;}
.rf-assembled-order {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;list-style:none;margin:0;padding:0;}
.rf-assembled-order li {display:grid;gap:4px;min-width:0;padding:10px;border:1px dashed #b89558;background:#fff0c7;font-size:13px;line-height:1.4;}
.rf-assembled-order li strong {color:#7a4c25;}
@keyframes rf-trial-send {from{transform:translateX(0)}to{transform:translateX(70px);opacity:.35}}
@media(max-width:560px) {
  body[data-mission="2"] .rf-map ol {grid-template-columns:repeat(3,minmax(0,1fr));}
  body[data-mission="2"] .rf-inventory-list {grid-template-columns:minmax(0,1fr);}
  .rf-share-boxes {grid-template-columns:repeat(2,minmax(0,1fr));}
  .rf-assembled-order {grid-template-columns:minmax(0,1fr);}
}
@media(prefers-reduced-motion:reduce) {.rf-trial.is-sending .rf-trial-package {animation:none;}}

/* Story introduction for each new mission. */
.rf-mission-intro{box-sizing:border-box;width:min(calc(100% - 2rem),38rem);max-height:90dvh;overflow:auto;overscroll-behavior:contain;padding:0;border:2px solid #9bb8ac;border-radius:24px;background:#fffdf2;color:#203e50;box-shadow:0 25px 85px #102f3c66}
.rf-mission-intro::backdrop{background:#122c3bc4}
.rf-mission-intro-media{position:relative;height:clamp(170px,29dvh,300px);overflow:hidden;border-bottom:2px solid #c7d6cb;background:#bdcfc5}
.rf-intro-scene{position:absolute;left:44%;top:40%;width:max(100%,calc(clamp(170px,29dvh,300px) * 1.77684));aspect-ratio:1672/941;transform:translate(-44%,-40%)}
.rf-intro-background{display:block;width:100%;height:100%;object-fit:fill}
.rf-intro-shadow{position:absolute;left:29%;top:85%;width:27%;height:5%;border-radius:50%;background:#2d241d;opacity:.22;filter:blur(8px)}
.rf-intro-rudi{position:absolute;left:14.2%;top:12.8%;width:57.7%;height:77.1%;object-fit:fill;transform-origin:50% 88%;animation:rf-intro-rudi-move 3.8s ease-in-out infinite}
@keyframes rf-intro-rudi-move{0%,100%{transform:rotate(-1deg) translateY(0)}50%{transform:rotate(1.5deg) translateY(-1.2%)}}
@media(prefers-reduced-motion:reduce){.rf-intro-rudi{animation:none}}
.rf-mission-intro-body{padding:clamp(1.1rem,4vw,1.8rem)}
.rf-mission-intro h2{margin:.4rem 0 .9rem;font-size:clamp(1.6rem,5vw,2.1rem);line-height:1.15}
#rf-mission-intro-story{font-size:1rem;line-height:1.55}
#rf-mission-intro-story p{margin:0 0 .85rem}
.rf-mission-intro .rf-primary{width:100%;margin-top:.35rem;min-height:54px;font-size:1.15rem}

