/* Robot simulator pages: the 3D view on the left, the controls on the right; stacked on phones.
   Colours come from the page theme (--ink, --line, --muted, --yellow is the accent: duck yellow or LeRobot blue). */
.sim { --sim-ease: cubic-bezier(.2, .8, .2, 1); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; margin: 28px 0 36px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(16, 24, 40, .22); }
.sim-view { position: relative; min-height: 520px; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 90% at 50% 30%, #ffffff 0%, #eef3f8 45%, #dde5ee 100%); }
.sim-view canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.sim-canvas { opacity: 0; transition: opacity .7s var(--sim-ease); }
.sim-canvas.on { opacity: 1; }
.sim-status { position: absolute; left: 12px; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 7px; max-width: calc(100% - 70px); padding: 5px 12px 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 4px 14px -6px rgba(16, 24, 40, .25);
  font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sim-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #9aa6b2; }
.sim[data-ready="true"] .sim-status::before { background: #12b76a; box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); animation: sim-pulse 2.4s var(--sim-ease) infinite; }
.sim[data-ready="error"] .sim-status::before { background: #d92d20; }
@keyframes sim-pulse { 70% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); } }
.sim-hint { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 150px); z-index: 1; margin: 0; font-size: 12px; color: var(--muted); }
.sim-panel { max-height: 620px; overflow-y: auto; padding: 16px; border-left: 1px solid var(--line); scrollbar-width: thin; }
.sim-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sim-row button, .sim-file { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 4px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .18s var(--sim-ease), background-color .18s var(--sim-ease), box-shadow .18s var(--sim-ease), transform .12s var(--sim-ease); }
.sim-row button:hover, .sim-file:hover, .sim-file:focus-within { border-color: var(--ink); box-shadow: 0 4px 12px -6px rgba(16, 24, 40, .3); }
.sim-row button:active, .sim-file:active { transform: scale(.96); }
.sim-row button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sim-row button[aria-pressed="true"], .sim-row button.sim-current { background: var(--yellow); border-color: var(--ink); }
.sim-row button.sim-demo { background: var(--ink); border-color: var(--ink); color: #fff; }
.sim-panel h2 { font-size: 14px !important; margin: 14px 0 8px !important; }
.sim-actions { padding-top: 10px; border-top: 1px solid var(--line); }
.sim-actions .sim-label { flex-basis: 100%; }
.sim-actions button:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.sim-paint { padding-top: 2px; }
.sim-swatches button { gap: 7px; padding-left: 4px; }
.sim-swatches i { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(16, 24, 40, .18); transition: transform .2s var(--sim-ease); }
.sim-swatches button:hover i, .sim-swatches button[aria-pressed="true"] i { transform: scale(1.15) rotate(-12deg); }
.sim-sub { margin: 4px 0 8px; font-size: 13px; font-weight: 600; }
.sim-label { margin: 0 0 5px !important; font-size: 11px !important; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sim-parts button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sim-joint { margin: 0 0 9px; }
.sim-joint label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.sim-joint output { color: var(--ink); font-variant-numeric: tabular-nums; }
.sim-joint input { width: 100%; margin: 4px 0 0; accent-color: var(--ink); cursor: pointer; }
.sim-local { margin: 4px 0 14px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.sim-note { margin: 0 0 10px !important; font-size: 12px !important; line-height: 1.6 !important; color: var(--muted); }
.sim-note a { color: var(--ink); font-weight: 600; }
.sim-panel :is(input, select, textarea) { font-size: 16px; }
.sim-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sim-local-msg { min-height: 1em; margin: 0 0 8px !important; font-size: 12px !important; line-height: 1.6 !important; color: var(--ink); overflow-wrap: anywhere; }
.sim-local-msg.sim-bad { color: #b42318; }
.sim-view.sim-drop::after { content: ""; position: absolute; inset: 10px; z-index: 3; border: 2px dashed var(--ink); border-radius: 14px; background: rgba(255, 255, 255, .35); pointer-events: none; }

/* Full-screen button, top right of the view. */
.sim-full { position: absolute; right: 12px; top: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 4px 14px -6px rgba(16, 24, 40, .25); color: var(--ink); transition: transform .15s var(--sim-ease), background-color .15s; }
.sim-full:hover { background: #fff; transform: scale(1.06); }
.sim-full svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sim-full[data-on="true"] svg { transform: rotate(180deg); }
:is(.sim:fullscreen, .sim.sim-viewport) { display: grid; grid-template-rows: minmax(0, 1fr); width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
:is(.sim:fullscreen, .sim.sim-viewport) .sim-view { min-height: 0; height: 100%; }
:is(.sim:fullscreen, .sim.sim-viewport) .sim-panel { box-sizing: border-box; min-height: 0; height: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }

/* Steering pad and the heads-up display while a policy drives. */
.sim-pad { position: absolute; right: 14px; bottom: 34px; z-index: 2; width: 124px; height: 124px; border-radius: 50%; touch-action: none; cursor: grab;
  background: radial-gradient(circle, rgba(255, 255, 255, .25) 0 30%, rgba(255, 255, 255, .6) 31% 100%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 10px 30px -12px rgba(16, 24, 40, .4); animation: sim-in .35s var(--sim-ease); }
.sim-pad::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px dashed rgba(16, 24, 40, .18); }
.sim-pad:active { cursor: grabbing; }
.sim-pad[hidden] { display: none; }
.sim-pad span { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--yellow) 45%); border: 1px solid rgba(16, 24, 40, .35); box-shadow: 0 6px 16px -4px rgba(16, 24, 40, .45);
  transition: transform .18s var(--sim-ease); }
.sim-pad:active span { transition: none; box-shadow: 0 0 0 6px rgba(255, 255, 255, .5), 0 8px 18px -4px rgba(16, 24, 40, .5); }
.sim-hud { position: absolute; right: 12px; top: 56px; z-index: 2; display: grid; gap: 8px; padding: 10px; border-radius: 14px; pointer-events: none;
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 20px -10px rgba(16, 24, 40, .35); animation: sim-in .35s var(--sim-ease); }
.sim-hud[hidden] { display: none; }
.sim-keys { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; justify-content: center; }
.sim-keys b { display: grid; place-items: center; height: 26px; border-radius: 7px; background: #fff; border: 1px solid var(--line); border-bottom-width: 3px; font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted);
  transition: transform .08s, background-color .12s, color .12s, border-color .12s; }
.sim-keys b.on { transform: translateY(2px); border-bottom-width: 1px; background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.sim-meters { display: grid; gap: 5px; }
.sim-meter { display: grid; grid-template-columns: 14px 72px; align-items: center; gap: 6px; font-size: 11px; font-style: normal; color: var(--muted); }
.sim-meter em { font-style: normal; text-align: center; }
.sim-meter > span { position: relative; height: 6px; border-radius: 999px; background: rgba(16, 24, 40, .1); overflow: hidden; }
.sim-meter > span::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(16, 24, 40, .35); }
.sim-meter i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-radius: 999px; background: var(--ink); transition: left .1s linear, width .1s linear; }
@keyframes sim-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

.sim-credit { font-size: 12px !important; line-height: 1.7 !important; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .sim *, .sim *::before, .sim *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 800px) {
  .sim { grid-template-columns: 1fr; border-radius: 14px; }
  .sim-view { min-height: 360px; height: 58vh; }
  .sim-panel { max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  /* The site's floating contact button sits bottom right on phones, so the pad goes left and the hint makes way. */
  .sim-pad { right: auto; left: 14px; bottom: 14px; }
  .sim-view:has(.sim-pad:not([hidden])) .sim-hint { display: none; }
  .sim-keys { display: none; }
  :is(.sim:fullscreen, .sim.sim-viewport) { grid-template-rows: minmax(0, 45%) minmax(0, 1fr); }
  :is(.sim:fullscreen, .sim.sim-viewport) .sim-panel { max-height: none; }
}

/* Preserve space for the control panel and an exit target on short mobile screens. */
@media (max-width: 800px) and (max-height: 480px) {
  :is(.sim:fullscreen, .sim.sim-viewport) .sim-pad { width: 88px; height: 88px; left: 10px; bottom: 10px; }
  :is(.sim:fullscreen, .sim.sim-viewport) .sim-pad span { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  :is(.sim:fullscreen, .sim.sim-viewport) .sim-status { left: 110px; max-width: calc(100% - 180px); }
}

.sim.sim-viewport { position: fixed; inset: 0; z-index: 2147483000; }
