.roomba-live { position: relative; left: 50%; transform: translateX(-50%); width: min(calc(100vw - 16px), 1400px); margin: 12px 0 24px; color: #fff; font: 15px/1.35 system-ui, sans-serif; }
.roomba-live * { box-sizing: border-box; }
.roomba-live button { color: #fff; background: #111e; border: 1px solid #fff9; border-radius: 5px; padding: 8px 11px; font: inherit; font-weight: 700; cursor: pointer; }
.roomba-live button:disabled { opacity: .36; cursor: default; }
.roomba-live button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.roomba-live [hidden] { display: none !important; }
.rl-stage { position: relative; width: 100%; min-height: 420px; max-height: 78svh; aspect-ratio: 16/9; overflow: hidden; background: #050505; isolation: isolate; }
.rl-camera, .rl-camera img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.rl-camera img { object-fit: contain; display: none; }
.rl-camera img.rl-ready { display: block; }
.rl-camera-note { position: absolute; inset: 0; display: grid; place-items: center; color: #aaa; text-align: center; padding: 24px; }
.rl-camera img.rl-ready + .rl-camera-note { display: none; }
.rl-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px; background: linear-gradient(#000e, #0000); }
.rl-label { font-size: 1rem; font-weight: 850; letter-spacing: .045em; }
.rl-label small { display: block; color: #ddd; font-size: .72rem; font-weight: 500; letter-spacing: 0; }
.rl-head-right { display: flex; align-items: flex-start; gap: 7px; }
.rl-status { max-width: 260px; min-width: 110px; text-align: right; padding-right: 4px; font-size: .86rem; }
.rl-status p { margin: 0; }
.rl-timer { font: 800 1.7rem/1.1 ui-monospace, monospace; }
.roomba-live .rl-live-button { background: #b21e1edc; border-color: #ffb6b6; font-size: .73rem; letter-spacing: .08em; }
.roomba-live .rl-fullscreen { width: 35px; height: 35px; padding: 0; font-size: 1.4rem; line-height: 1; }
.roomba-live .rl-queue-toggle { position: absolute; top: 94px; right: 14px; z-index: 2; font-size: .78rem; letter-spacing: .05em; }
.rl-queue { position: absolute; top: 132px; right: 14px; z-index: 2; display: none; width: min(210px, 38%); max-height: calc(100% - 220px); overflow: auto; background: #050505e8; border: 1px solid #fff5; padding: 9px 12px; font-size: .82rem; }
.rl-queue.rl-open { display: block; }
.rl-queue strong { font-size: .77rem; letter-spacing: .08em; }
.rl-queue ol { margin: 6px 0 0; padding-left: 1.6em; }
.rl-queue li { padding: 2px 0; }
.rl-pad { position: absolute; left: 14px; bottom: 76px; display: grid; grid-template-columns: repeat(3, 58px); gap: 5px; touch-action: none; }
.roomba-live .rl-pad button { width: 58px; height: 58px; padding: 0; font-size: 1.6rem; touch-action: none; user-select: none; }
.roomba-live .rl-pad button.rl-held { background: #fff; color: #000; }
.rl-pad [data-rl-drive="forward"] { grid-column: 2; grid-row: 1; }
.rl-pad [data-rl-drive="left"] { grid-column: 1; grid-row: 2; }
.rl-pad [data-rl-drive="backward"] { grid-column: 2; grid-row: 2; }
.rl-pad [data-rl-drive="right"] { grid-column: 3; grid-row: 2; }
.roomba-live .rl-stop { position: absolute; right: 16px; bottom: 94px; width: 74px; height: 74px; border: 2px solid #fff; border-radius: 50%; background: #a71919df; }
.rl-speed { position: absolute; right: 16px; bottom: 184px; width: 202px; padding: 7px 10px; background: #050505dd; border: 1px solid #fff7; border-radius: 5px; font-size: .78rem; font-weight: 700; }
.rl-speed output { float: right; font: 700 .78rem ui-monospace, monospace; }
.rl-speed input { display: block; width: 100%; margin: 9px 0 2px; accent-color: #fff; cursor: pointer; }
.rl-speed input:disabled { opacity: .4; cursor: default; }
.roomba-live .rl-vacuum { position: absolute; right: 106px; bottom: 110px; min-width: 116px; height: 44px; background: #111e; }
.roomba-live .rl-vacuum.rl-on { background: #256b36e8; border-color: #a9f5b9; }
.roomba-live .rl-vacuum small { display: block; font-size: .65rem; font-weight: 400; }
.rl-bottom { position: absolute; bottom: 0; left: 0; right: 0; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #050505e8; }
.rl-bottom p { margin: 0; }
.rl-bottom .rl-hint { margin-left: auto; color: #bbb; font-size: .82rem; }
.rl-error { color: #b30000; min-height: 1.4em; padding: 5px 2px; }
.rl-stage:fullscreen, .rl-stage.rl-expanded { width: 100vw; height: 100dvh; max-height: none; min-height: 0; aspect-ratio: auto; background: #000; }
.rl-stage.rl-expanded { position: fixed; inset: 0; z-index: 999999; }
body.rl-body-expanded { overflow: hidden; }
.rl-stage:fullscreen .rl-top, .rl-stage.rl-expanded .rl-top { padding-top: max(14px, env(safe-area-inset-top)); }
.rl-stage:fullscreen .rl-bottom, .rl-stage.rl-expanded .rl-bottom { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
@media (max-width: 700px) and (orientation: portrait) {
  .roomba-live { width: 100vw; margin: 0 0 12px; }
  .rl-stage { height: 540px; min-height: 0; max-height: none; aspect-ratio: auto; }
  .rl-camera { top: 62px; bottom: auto; height: auto; aspect-ratio: 16/9; }
  .rl-camera img { object-fit: cover; }
  .rl-top { min-height: 62px; align-items: center; padding: 7px 9px; gap: 5px; background: #101010; }
  .rl-label { font-size: .86rem; }
  .rl-label small { display: none; }
  .rl-head-right { align-items: center; gap: 5px; }
  .rl-status { max-width: 130px; min-width: 75px; font-size: .69rem; line-height: 1.2; }
  .rl-timer { font-size: 1.25rem; }
  .roomba-live .rl-live-button { padding: 6px 7px; font-size: .69rem; }
  .roomba-live .rl-fullscreen { width: 31px; height: 31px; font-size: 1.2rem; }
  .roomba-live .rl-queue-toggle { top: calc(64px + 100vw * 9 / 16); right: 9px; }
  .rl-queue { top: calc(101px + 100vw * 9 / 16); right: 9px; width: min(210px, 62%); max-height: 150px; }
  .rl-pad { left: 9px; bottom: 75px; grid-template-columns: repeat(3, 54px); gap: 4px; }
  .roomba-live .rl-pad button { width: 54px; height: 54px; }
  .roomba-live .rl-stop { right: 13px; bottom: 91px; width: 67px; height: 67px; }
  .roomba-live .rl-vacuum { right: 90px; bottom: 101px; min-width: 110px; }
  .rl-speed { right: 9px; bottom: 177px; width: min(190px, 48vw); }
  .rl-bottom { min-height: 64px; padding: 8px 9px; }
  .rl-bottom .rl-hint { display: none; }
  .rl-stage:fullscreen .rl-camera, .rl-stage.rl-expanded .rl-camera { top: 62px; }
  .rl-stage:fullscreen .rl-queue-toggle, .rl-stage.rl-expanded .rl-queue-toggle { top: calc(64px + 100vw * 9 / 16); }
  .rl-stage:fullscreen .rl-queue, .rl-stage.rl-expanded .rl-queue { top: calc(101px + 100vw * 9 / 16); }
}
@media (max-width: 700px) and (orientation: landscape) {
  .roomba-live { width: 100vw; margin: 0; }
  .rl-stage { height: max(300px, calc(100dvh - 70px)); min-height: 0; max-height: none; aspect-ratio: auto; }
  .rl-top { padding: 7px 10px; }
  .rl-status { font-size: .72rem; }
  .roomba-live .rl-queue-toggle { top: 63px; right: 10px; }
  .rl-queue { top: 100px; right: 10px; max-height: calc(100% - 145px); }
  .rl-pad { left: 9px; bottom: 12px; grid-template-columns: repeat(3, 42px); gap: 3px; }
  .roomba-live .rl-pad button { width: 42px; height: 42px; font-size: 1.2rem; }
  .roomba-live .rl-stop { right: 12px; bottom: 25px; width: 58px; height: 58px; }
  .roomba-live .rl-vacuum { right: 80px; bottom: 30px; min-width: 108px; height: 43px; }
  .rl-speed { right: 9px; bottom: 95px; width: min(170px, 34vw); }
  .rl-bottom { left: 160px; right: 85px; bottom: 8px; min-height: 0; width: auto; padding: 0; background: none; }
  .rl-bottom .rl-hint { display: none; }
}
