/* 15.1708, 15.1719: a work stage on a phone, as Ares's: the scene over the whole screen, one bar of tools under the header that scrolls sideways and
   hides, the panel one sheet with its grip inside its top edge, at the side on a screen turned on its side. /kit/phonesheet.js */
html body #screen .stage-work.full-tab.stage-phone {
  --bar-h: 48px;
  --grip-h: 20px;
  position: fixed;
  inset: var(--shell-top) 0 0;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: clip;
  background: var(--bg);
}
html body #screen .stage-work.full-tab.stage-phone.bars-hidden { --bar-h: 0px; }
html body #screen .stage-work.full-tab.stage-phone:is(:fullscreen, .fs-self) { inset: 0; }
html body #screen .stage-work.full-tab.stage-phone > .stage {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  --stage-cover: 0px;
  --stage-cover-left: 0px;
  -webkit-touch-callout: none;
  user-select: none;
}
html body #screen .stage-work.full-tab.stage-phone > .stage-aside {
  position: absolute;
  inset: auto 0 0;
  width: auto;
  max-width: none;
  height: var(--sheet-h, 60px);
  max-height: 100%;
  margin: 0;
  padding: var(--grip-h) 0 0;
  border-width: 0;
  border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: var(--sh-overlay);
  z-index: 3;
  overflow: hidden;
  transition: height var(--dur-fold) var(--ease-out);
}
html body #screen .stage-work.full-tab.stage-phone.sheet-side > .stage-aside {
  inset: 0 0 0 auto;
  width: var(--sheet-side-w, 340px);
  height: auto;
  padding: var(--sp-100) 0 0;
  /* 15.1761: square beside the bar's square corners */
  border-radius: 0;
  transform: translateX(calc(var(--sheet-side-w, 340px) - var(--sheet-w, 0px)));
  transition: transform var(--dur-fold) var(--ease-out);
}
html body #screen .stage-work.full-tab.stage-phone.sheet-moving > .stage-aside { transition: none; }
html body #screen .stage-work.full-tab.stage-phone .stage-aside > .stage-head {
  height: 40px;
  padding: 0 var(--sp-200);
  touch-action: none;
}
html body #screen .stage-work.full-tab.stage-phone .stage-aside > .stage-body { padding-inline: var(--sp-050); overscroll-behavior: contain; }
.phone-grip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--sheet-h, 0px) - var(--grip-h));
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--grip-h);
  padding: 0;
  border: 0;
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: none;
  touch-action: none;
  transition: bottom var(--dur-fold) var(--ease-out);
}
/* 15.1734 («Можно ли холдер более модным сделать?»): a slim pill, the known handle of the tablets' split view: no bump on the panel's edge,
   lit under a finger; the place a finger takes is wider than what is seen */
.phone-grip > span {
  width: 40px;
  height: 4px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  transition: width var(--dur-pop) var(--ease-out), height var(--dur-pop) var(--ease-out), background var(--dur-pop) var(--ease-out);
}
.phone-grip:active > span { width: 56px; background: var(--acc); }
.stage-phone.sheet-side > .phone-grip {
  top: calc((100% + var(--bar-h)) / 2 - 44px);
  left: auto;
  right: var(--sheet-w, 0px);
  bottom: auto;
  justify-content: flex-end;
  width: 32px;
  height: 88px;
  padding-inline-end: var(--sp-075);
  border-radius: 0;
  transition: right var(--dur-fold) var(--ease-out);
}
.stage-phone.sheet-side > .phone-grip > span {
  width: 5px;
  height: 44px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  box-shadow: 0 0 0 var(--bw) color-mix(in srgb, var(--bg) 60%, transparent), var(--sh-raised);
}
.stage-phone.sheet-side > .phone-grip:active > span { width: 5px; height: 60px; background: var(--acc); }
.stage-phone.sheet-moving > .phone-grip { transition: none; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar {
  top: 0;
  left: var(--bar-left, 0px);
  right: 0;
  height: var(--bar-h);
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0 52px 0 var(--sp-050);
  border-bottom: var(--bw) solid var(--line);
  background: var(--card);
  overflow: auto hidden;
  overscroll-behavior: contain;
  pointer-events: auto;
  scrollbar-width: none;
  touch-action: pan-x;
  transition: transform var(--dur-fold) var(--ease-out);
}
html body #screen .stage-work.full-tab.stage-phone.sheet-side .float-toolbar {
  right: var(--sheet-w, 0px);
  transition: right var(--dur-fold) var(--ease-out), transform var(--dur-fold) var(--ease-out);
}
html body #screen .stage-work.full-tab.stage-phone.sheet-moving .float-toolbar { transition: none; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar::-webkit-scrollbar { display: none; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar-start { max-width: none; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar .float-group.joined {
  flex-wrap: nowrap;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
html body #screen .stage-work.full-tab.stage-phone .float-toolbar-middle { display: none; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar-end {
  flex: none;
  margin-left: var(--sp-050);
  padding-left: var(--sp-050);
  border-left: var(--bw) solid var(--line);
}
html body #screen .stage-work.full-tab.stage-phone .float-toolbar-end .float-btn { border: 0; background: none; box-shadow: none; }
html body #screen .stage-work.full-tab.stage-phone .float-btn { min-width: 44px; min-height: 44px; }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar .float-btn:not(.text) { border-radius: var(--r); }
html body #screen .stage-work.full-tab.stage-phone .float-toolbar .float-btn.on:not(.text) { clip-path: inset(var(--sp-050) round var(--r-s)); }
html body #screen .stage-work.full-tab.stage-phone .float-sep { margin-block: var(--sp-150); }
html body #screen .stage-work.full-tab.stage-phone.bars-hidden .float-toolbar { transform: translateY(-100%); }
@media (hover: none) {
  html body #screen .stage-work.full-tab.stage-phone .float-toolbar .float-btn:hover:not(.on) { background: none; color: var(--ink); }
}
.phone-bars-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 60px;
  height: calc(var(--bar-h) - var(--bw));
  padding: 0 var(--sp-150) 0 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(to right, transparent, var(--card) 45%);
  color: var(--ink);
  touch-action: manipulation;
}
.phone-bars-toggle > * { transform: rotate(180deg); }
.stage-phone.sheet-side > .phone-bars-toggle {
  right: var(--sheet-w, 0px);
  transition: right var(--dur-fold) var(--ease-out);
}
.stage-phone.sheet-moving > .phone-bars-toggle { transition: none; }
.stage-phone.bars-hidden > .phone-bars-toggle {
  top: var(--sp-100);
  right: var(--sp-100);
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-full);
  background: var(--card);
  box-shadow: var(--sh-raised);
}
.stage-phone.bars-hidden > .phone-bars-toggle > * { transform: none; }
html body #screen .stage-work.full-tab.stage-phone > .stage-layers { display: none; }
/* 15.1730: the keys of Atom's lists stand on the bar, the lists hang under it */
html body #screen .stage-work.full-tab.stage-phone > .stage > .float-panel:is(.trash-panel, .legend-pop) {
  top: calc(var(--bar-h) + var(--sp-100));
  right: calc(var(--sheet-w, 0px) + var(--sp-100));
  bottom: auto;
  max-width: calc(100% - var(--sheet-w, 0px) - var(--sp-100) * 2);
  max-height: calc(100% - var(--bar-h) - var(--sheet-h, 0px) - var(--sp-100) * 2);
}
/* 15.1728 («Окно довольно низкое. Боковая панель не лезет»): a phone on its side: the head gives its row to the stage, its burger stands
   in the bar's corner; the whole head comes back when the phone stands up */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) {
  /* the mark is set by the shell (app.js, watchStagePhone); живой: Ares's editor on a phone inside DEOS (Ares apps/web/src/editor/window/phone.ts) */
  /* 15.2904: an iPhone lying - the burger's colour runs to the edge, the burger itself keeps clear of the notch (--notch-l, deos.css) */
  html[data-nav="drawer"][data-stage-phone] { --shell-top: 0px; --bar-left: calc(var(--tap) + var(--notch-l)); }
  html[data-nav="drawer"][data-stage-phone] .app { grid-template-rows: 0 auto 1fr; }
  html[data-nav="drawer"][data-stage-phone] .app.shine-bar::after { display: none; }
  html[data-nav="drawer"][data-stage-phone] .topbar > :not(.nav-burger) { display: none; }
  html[data-nav="drawer"][data-stage-phone] .nav-burger {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    width: calc(var(--tap) + var(--notch-l));
    height: 48px;
    padding-left: var(--notch-l);
    border: 0;
    border-bottom: var(--bw) solid var(--line);
    border-radius: 0;
    background: var(--card);
  }
  html[data-nav="drawer"][data-stage-phone="bars-hidden"] .nav-burger {
    top: var(--sp-100);
    left: calc(var(--sp-100) + var(--notch-l));
    width: 40px;
    height: 40px;
    padding-left: 0;
    border: 0;
    border-radius: var(--r-full);
    box-shadow: var(--sh-raised);
  }
  .stage-work:fullscreen { --bar-left: 0px; }
}
