/* TIDY STREET SCREEN (2026-11-23): js/tidyhud.js. body.tidy = the walk / drive view with the More tray; body.tidy-clean = clean screen. */
/* the buttons that live in the tray now are not drawn in their old places */
body.tidy .rm-top [data-rm="rot"], body.tidy .rm-top [data-rm="cam"], body.tidy .rm-top [data-rm="bike"], body.tidy .rm-top [data-rm="shot"], body.tidy .rm-top [data-rm="hud"],
body.tidy .rm-smode, body.tidy .rm-sauto, body.tidy .rm-tools [data-cc="engine"],
body.tidy .rm-navfab, body.tidy .rm-dronefab, body.tidy .rm-togfab, body.tidy .rm-voxfab, body.tidy .pm-dancefab, body.tidy .rm-jobfab { display: none !important; }
/* ☰ More: a round button like the others in the top row */
.td-more { width: 40px; height: 40px; padding: 0; display: inline-grid; place-content: center; gap: 4px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(14, 30, 22, .78); cursor: pointer; }
.td-more i { display: block; width: 16px; height: 2.5px; border-radius: 2px; background: #fff; }
.td-more[aria-expanded="true"] { background: #16a34a; }
/* the tray: under the top row, on the right, big rows */
.td-tray { position: absolute; z-index: 8; top: calc(var(--safe-t, 0px) + 58px); right: calc(var(--safe-r, 0px) + 10px); width: min(240px, calc(100vw - 20px)); max-height: calc(100% - var(--safe-t, 0px) - var(--safe-b, 0px) - 58px - 250px);          /* (it ends above Jump and Run) */ overflow-y: auto; display: grid; gap: 4px; padding: 8px; border-radius: 18px; background: rgba(12, 22, 17, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.td-tray[hidden] { display: none; }
.td-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 12px; background: transparent; color: #fff; text-align: left; font: 700 14.5px/1.2 var(--font, system-ui); cursor: pointer; }
.td-row:active { background: rgba(255, 255, 255, .12); }
.td-row span { flex: 0 0 auto; width: 30px; text-align: center; font-size: 20px; }
.td-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-clean { margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .14); border-radius: 0 0 12px 12px; color: #fde68a; }
/* the clean screen: nothing but a faint stick (and the pedals in a car); 👁 brings it all back */
.td-show { position: absolute; z-index: 9; top: calc(var(--safe-t, 0px) + 10px); right: calc(var(--safe-r, 0px) + 10px); width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .28); color: #fff; font-size: 18px; opacity: .55; }
.td-show[hidden] { display: none; }
body.tidy-clean .rm-top, body.tidy-clean .rm-mm, body.tidy-clean .sa-clockpill, body.tidy-clean .nbell, body.tidy-clean #phonefab, body.tidy-clean .navmini, body.tidy-clean .rm-enter,
body.tidy-clean .rm-hint, body.tidy-clean .rm-walkb, body.tidy-clean .rm-spd, body.tidy-clean .rm-tools, body.tidy-clean .td-tray, body.tidy-clean .pz-hud, body.tidy-clean .rm-drone, body.tidy-clean .sa-title, body.tidy-clean .s3tags { display: none !important; }
body.tidy-clean .rm-joy, body.tidy-clean .rm-wheel, body.tidy-clean .rm-steer, body.tidy-clean .rm-gas, body.tidy-clean .rm-brk { opacity: .28; }
/* sideways: the tray a little shorter */
body.rotview .td-tray, .td-tray { scrollbar-width: none; }
/* sideways: two columns, and it ends above the pedals and the Jump / Run buttons (nothing under it) */
@media (max-height: 460px) { .td-tray { top: calc(var(--safe-t, 0px) + 56px); width: min(400px, calc(100vw - 20px)); grid-template-columns: 1fr 1fr; max-height: calc(100% - var(--safe-t, 0px) - var(--safe-b, 0px) - 56px - 150px); } .td-row { min-height: 40px; } .td-clean { grid-column: 1 / -1; } }
body.rotview .td-tray { width: min(400px, calc(100% - 20px)); grid-template-columns: 1fr 1fr; max-height: calc(100% - 56px - 150px); } body.rotview .td-row { min-height: 40px; } body.rotview .td-clean { grid-column: 1 / -1; }
/* sideways in a car: the car buttons sit in one row with the speedometer in a gap in the middle (css/style.css); Engine went into the
   tray, so its place is kept empty (not removed), or the row re-centres and the Horn lands on the speedometer */
@media (orientation: landscape) { body.tidy .rm-tools [data-cc="engine"] { display: inline-flex !important; visibility: hidden; pointer-events: none; } }
body.tidy.rotview .rm-tools [data-cc="engine"] { display: inline-flex !important; visibility: hidden; pointer-events: none; }
/* choosing where to go (the Directions sheet is open): the walking stick and Jump/Run step aside so nothing sits under its buttons */
body.tidy .rm.snopen .rm-joy, body.tidy .rm.snopen .rm-walkb { visibility: hidden; }
/* while the tray is open (a menu moment) the action buttons under it step aside: Get in, Jump, Run, the place button */
body.td-open .rm-walkb, body.td-open .rm-enter, body.td-open .rm-spd, body.td-open .rm-mmn { visibility: hidden; }          /* (+ the speedometer and the place name under the map, which the tray covers when driving upright) */
