/* The dock: four glass buttons, Hand, Marks, Build and Decorations, each with its name under it. A group's button wears the tool last used in it,
   and opens a small tray of that group's tools just above the dock. The pressed tool keeps the sun-coloured underline */
.dock{position:absolute;left:50%;bottom:calc(14px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:max-content;display:flex;align-items:stretch;gap:3px;padding:5px;border-radius:26px}
.dock button.t,.tray button.t{position:relative;flex-direction:column;justify-content:center;gap:6px;box-sizing:border-box;height:58px;min-width:86px;padding:0 6px;border-radius:21px;
  font:500 10.5px/1 var(--label);letter-spacing:.09em;text-transform:uppercase;white-space:nowrap;transition:background .25s ease,transform .25s ease,box-shadow .25s ease}
.dock button.t svg,.tray button.t svg{width:26px;height:26px;fill:rgba(255,255,255,.6);stroke-width:1.35}
.dock button.t{-webkit-tap-highlight-color:transparent}
.shortcut-key{display:grid;place-items:center;box-sizing:border-box;width:15px;height:15px;
  border:1px solid rgba(75,91,108,.19);border-radius:5px;background:#e9eff5;color:var(--ink-soft);
  font:650 10px/1 var(--label);letter-spacing:0;text-indent:0;font-variant-numeric:tabular-nums;pointer-events:none}
.dock .shortcut-key{position:absolute;top:7px;left:7px}
.dock button:is([aria-pressed="true"],.on) .shortcut-key{background:#fae9db;border-color:rgba(132,77,41,.25);color:#6b422c}
.dock button:active .shortcut-key{background:var(--sun);color:var(--ink)}
@media (prefers-reduced-motion:no-preference){.dock button:active .shortcut-key{transform:scale(.86)}}
.dock button.t[aria-pressed="true"],.dock button.grp.on,.tray button.t[aria-pressed="true"]{background:#fff;box-shadow:0 6px 16px var(--shade),inset 0 -3px 0 var(--sun)}
@media (hover:hover){.dock button.t:hover,.tray button.t:hover{transform:translateY(-2px)}}
/* a group's button: a small chevron in its corner says it opens a tray, and turns over while the tray is open */
.dock button.grp::after{content:"";position:absolute;top:9px;right:11px;width:5px;height:5px;border:solid var(--ink-soft);border-width:1.4px 0 0 1.4px;transform:rotate(45deg);opacity:.8;transition:transform .25s ease}
.dock button.grp[aria-expanded="true"]::after{transform:translateY(-2px) rotate(225deg)}
/* the tray: a smaller dock of the group's tools. It rises from just above its group's button, kept on screen */
.tray{position:absolute;left:0;top:0;width:max-content;display:flex;gap:3px;padding:4px;border-radius:24px;opacity:0;visibility:hidden;transform:translateY(8px) scale(.96);transform-origin:var(--from,50%) 100%;
  transition:opacity .18s ease,transform .22s ease,visibility 0s .22s}
.tray.open{opacity:1;visibility:visible;transform:none;transition:opacity .2s ease,transform .3s cubic-bezier(.2,.8,.3,1.15),visibility 0s}
.tray button.t{height:54px;min-width:64px;gap:5px;border-radius:20px}
.tray button.t svg{width:24px;height:24px}
.ui:has(>.tray.open)>.walkpad{display:none}   /* on a short screen the tray can reach the stick: the stick steps aside while a tray is open */
.ui:has(>.tray.open)>.movement-hint{opacity:0;visibility:hidden;transition:opacity .2s ease,visibility 0s .2s}   /* the tray takes the hint's place above the dock */
#tray-marks{width:min(360px,calc(100vw - 24px));box-sizing:border-box}
#tray-marks button.t{flex:1 1 0;min-width:0;padding-inline:3px}
@media(max-width:340px){#tray-marks button.t{font-size:9.5px;letter-spacing:.045em}}
#tray-decorate{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(184px,calc(100vw - 24px));box-sizing:border-box}
#tray-decorate button.t{min-width:0}
@media (max-width:640px){
  .dock{max-width:calc(100vw - 24px);box-sizing:border-box}
  .dock button.t{flex:0 1 auto;width:72px;min-width:0;height:56px;font-size:10.5px;letter-spacing:.055em}   /* four named buttons fit a 320 px screen */
  .dock .shortcut-key{left:6px;width:14px;height:14px}
  .dock button.grp::after{right:8px;top:7px}
  .dock button.t svg{width:24px;height:24px}
  .tray button.t{min-width:60px;height:52px}
  .tray button.t svg{width:23px;height:23px}
  .ui:has(>#tray-decorate.open)>.side{bottom:calc(274px + env(safe-area-inset-bottom,0px))}   /* the taller tray keeps every side action above it */
}
/* on a phone the side bar, and the stick beside it, stand above the lane a tray opens into: 14 + dock 68 + 8 + tray 62 + 16 */
@media (max-width:640px) and (min-height:540px){
  .side{bottom:calc(168px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:reduce){.tray,.tray.open,.dock button.t,.tray button.t,.dock button.grp::after{transition:none}.tray{transform:none}}

/* On a short phone the six side actions fit beside, rather than above, the three-row tray. */
@media(max-width:640px) and (max-height:620px){
 .ui:has(>#tray-decorate.open)>.side{left:12px;right:auto;bottom:calc(88px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:repeat(2,42px);gap:4px}
}
