/* The phone layout, in one place and loaded last (Eddy 2026-11-18, "audit phone version and fix overlapping"). From the top: the bar; one lane
   of shortcuts (Exit, pictures, cameras, drawings, board) side by side; below it panels, readouts and pictures; at the bottom the chat, and
   the pen under it. A panel ends above the chat (--phone-free, phone-layout.js). Nothing here applies above 700 px. */
@media(max-width:700px){
  /* the lane */
  #v8-gallery,#v8-cameras,#v8-drawings,#v8-board,#v8-sketch{top:66px!important;bottom:auto!important;left:var(--lane-x,12px)!important;right:auto!important;height:34px;box-sizing:border-box;padding:0 10px!important}
  #v8-drawings b,#v8-board span:not(:has(svg)){display:none}
  #v8-picture-stage .v8-ps-close{top:66px!important;left:12px!important;right:auto!important;height:34px!important}
  #v8-picture-stage .v8-refine-toggle.v8-mirror,.v8-rt-toggle{top:66px!important;right:12px!important;height:34px!important;padding:0 10px!important;font-size:12px!important;letter-spacing:0!important}

  /* the picture view starts under the lane */
  body.v8-picture #v8-picture-stage{padding-top:var(--stage-top,108px)!important;box-sizing:border-box}
  body.v8-picture #v8-picture-stage .v8-ps-grid{height:100%!important}
  #v8-picture-stage .v8-ps-grid figcaption{top:8px!important;left:8px!important;max-width:calc(100% - 16px)!important}
  #v8-picture-stage .v8-painting{top:var(--paint-top,108px)!important;width:max-content;max-width:calc(100vw - 24px)!important}
  .v8-dj-bar{top:108px!important;left:12px!important;right:12px!important;max-width:none!important}

  /* the render settings open as a sheet under the lane, ending above the chat */
  #v8-picture-stage .v8-rt{top:108px!important;left:12px!important;right:12px!important;width:auto!important;max-height:calc(var(--phone-free,420px) + 2px)!important;overflow:auto!important;box-sizing:border-box}

  /* the explorer's arrow only when nothing else is using the left side */
  body.v7-properties-open #model-explorer-toggle,body.davinci-dock-open #model-explorer-toggle,body.v8-picture #model-explorer-toggle,body:has(:is(#exb,#sim):not([hidden])) #model-explorer-toggle{display:none!important}

  /* panels: under the lane, ending above the chat */
  body:not(.v8-revit) #v7-properties-drawer,body:not(.v8-revit) #v7-model-drawer{top:110px!important;bottom:auto!important;height:auto!important;max-height:var(--phone-free,420px)!important;overflow:auto!important;box-sizing:border-box}
  body:not(.v8-revit) #v7-properties-drawer{left:12px!important;right:auto!important;width:min(300px,calc(100vw - 24px))!important}
  body:not(.v8-revit) #v7-model-drawer{left:60px!important;right:12px!important;width:auto!important}

  /* drawing on the plan: the readout and the typed box in full width under the lane */
  body.v8-plan2d .v8-plan-readout,body.v8-plan2d .v8-plan-typed{left:12px!important;right:12px!important;width:auto!important;max-width:none!important;transform:none!important;box-sizing:border-box;text-align:center}
  body.v8-plan2d .v8-plan-readout{top:108px!important;bottom:auto!important}
  body.v8-plan2d .v8-plan-typed{top:146px!important;bottom:auto!important;font:400 12px var(--dv-font)!important}
  body.v8-plan2d:not(.v8-revit) #v7-properties-drawer{top:190px!important;max-height:calc(var(--phone-free,420px) - 80px)!important}

  /* editing one element: the bar holds its tools, not the project's */
  body:not(.v8-revit):has(#edit-bar:not([hidden])) :is(#project-name,#v8-look-open,#v8-mode-toggle,#v8-play,#v8-davinci-mode){display:none!important}
  /* the bar: the same pill of four views as on a computer (DAVINCI, edit, look, play), in the same symbols, the view you are in lit
     (bar-layout.js draws them and sets the order); the project's name takes the room that is left; the record mark in the set's weight */
  body.v8-bar-phone:not(.v8-revit):not(:has(#edit-bar:not([hidden]))) #workspace>header>:is(.brand,.header-right){display:contents!important}
  body.v8-bar-phone:not(.v8-revit):not(:has(#edit-bar:not([hidden]))) #workspace>header #project-name{flex:1 1 auto!important;min-width:0!important;max-width:none!important;text-align:left}
  body.v8-bar-phone:not(.v8-revit):not(:has(#edit-bar:not([hidden]))) #workspace>header :is(#v8-mode-toggle,#v8-look-open,#v8-play){margin-left:-6px!important}
  body.v8-bar-phone #workspace>header .v8-bar-icon{position:relative;flex:none!important;width:34px!important;height:34px!important;min-width:34px!important;padding:0!important;margin:0;border:0!important;border-radius:0!important;box-shadow:none!important;background:rgba(255,255,255,.14)!important;color:#fff!important;font-size:0!important;line-height:0!important}
  body.v8-bar-phone #workspace>header svg.v8i{display:block;width:20px;height:20px;margin:auto}
  body.v8-bar-phone #workspace>header #v8-davinci-mode{border-radius:999px 0 0 999px!important;padding-left:4px!important;width:38px!important}
  body.v8-bar-phone #workspace>header #v8-play{border-radius:0 999px 999px 0!important;padding-right:4px!important;width:38px!important}
  body.v8-bar-phone #workspace>header .v8-bar-icon.on>svg.v8i{background:rgba(255,255,255,.3);border-radius:999px;padding:4px;width:28px;height:28px;box-sizing:border-box}
  body.v8-bar-phone #workspace>header #v8-record .v8-rec-led .f{stroke-width:.78}
  body.v8-page-open #workspace>header{z-index:9002!important}
  body.v8-page-open :is(#davinci-dock,#v8-work-pill){z-index:9001!important}
  /* Look: the bar stays on top, Look's controls under it, its cards under those */
  body.v8-bar-phone.v8-looking #workspace>header{z-index:45!important}
  body.v8-bar-phone.v8-looking #v8-look :is(.lv-pick,.lv-tour-label){top:256px}
  /* ...in one row that scrolls sideways, with Done always in reach */
  body:not(.v8-revit):has(#edit-bar:not([hidden])) #workspace>header .brand{flex:1 1 auto;min-width:0;overflow:hidden}
  body:not(.v8-revit):has(#edit-bar:not([hidden])) #workspace>header .header-right{flex:none}
  body:not(.v8-revit) #edit-bar:not([hidden]){display:flex;flex:1 1 auto;flex-wrap:nowrap;min-width:0;margin:0!important;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  body:not(.v8-revit) #edit-bar::-webkit-scrollbar{display:none}
  body:not(.v8-revit) #edit-bar>*{flex:none}
  body:not(.v8-revit) #edit-bar #edit-done{position:sticky;right:0;z-index:1;background:var(--dv-gold);color:#1d1a14}

  /* the chat folded to its work line: the line on the left, DAVINCI's orb beside it, the selected element's chip above */
  #v8-work-pill.on{left:12px!important;right:auto!important;transform:none!important;width:calc(100vw - 80px)!important}
  body:has(#v8-work-pill.on) #v8-orb{left:auto!important;right:12px!important;top:auto!important;bottom:102px!important}
  body:has(#v8-work-pill.on) .v8-chat-link{transform:translateY(-58px)}

  /* the explosion board is a sheet of its own: the chat and the pen wait until it closes */
  body:has(:is(#exb,#sim):not([hidden])) :is(#davinci-dock,#v8-orb,#v7-pen-toggle,#v8-work-pill){display:none!important}

  /* the pen under the chat */
  #v7-pen-toggle{right:12px!important;bottom:12px!important}
  body.v8-revit #v7-pen-toggle{bottom:100px!important}
}
/* the narrowest phones: the render button keeps its glyph only, so it stays beside the lane */
@media(max-width:350px){#v8-picture-stage .v8-refine-toggle.v8-mirror span,.v8-rt-toggle span{display:none}}
