/* Phone layout (loaded last so it wins). */
@media(max-width:700px){
  html{-webkit-text-size-adjust:100%}
  body{overscroll-behavior-y:none}
  button,.btn,.chip,select,.tb,.ib{touch-action:manipulation;-webkit-tap-highlight-color:transparent}

  /* landing */
  #v-landing .shell{width:calc(100% - 32px)}
  #v-landing nav{display:flex;align-items:center;gap:6px}
  #v-landing nav a[data-arg="login"]{display:inline-flex!important;padding:10px 12px;font-weight:600}
  #v-landing .hero{padding:32px 0 36px;gap:18px}
  #v-landing .button,#v-landing .nav-cta{min-height:46px}

  /* app header: title row + action row */
  #v-app .wrap{padding:8px 12px 6px}
  .tbar{flex-wrap:wrap;gap:6px 8px;margin-bottom:6px}
  .tbar>#back{order:1}.tbar>.ti{order:2;flex:1 1 calc(100% - 108px);min-width:0;font-size:18px}.tbar>.mw{order:3}
  .tbar>#call-btn,.tbar>#chat-btn,.tbar>#live,.tbar>#save,.tbar>#share-btn{order:5;flex:1 1 56px;min-width:0;justify-content:center;min-height:42px;padding-inline:8px}
  .tbar>#save,.tbar>#share-btn{flex:1.4 1 72px}
  #call-t,#live-t{display:none}
  .tbar>.st{order:9;flex-basis:100%;font-size:12px;margin:0 2px;min-height:0}
  .tbar>.st:empty{display:none}
  .ib{width:42px;height:42px}

  /* menu bar scrolls sideways, comfortable taps */
  .menubar{margin:0 0 8px;gap:0}.menubar button{padding:10px 12px;font-size:14px}

  /* who is here: small, out of the way, above the tab bar */
  #presence .alone{display:none}
  #presence{top:auto;bottom:calc(86px + env(safe-area-inset-bottom,0px));right:10px}

  /* notes / document */
  .zh{padding:8px 10px}
  .pgbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:6px 8px;gap:6px}.pgbar::-webkit-scrollbar{display:none}
  .pgbar>*{flex:none}
  #tpls{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;padding:6px 8px!important}#tpls::-webkit-scrollbar{display:none}#tpls>*{flex:none}
  .pgwrap{flex:1;min-height:0}
  .ws-doc .pgwrap{padding:0;background:var(--card,#fff);overflow:hidden}
  .ws-doc #notes{flex:1;width:100%;min-height:0;height:100%;padding:16px 16px 40px;box-shadow:none;border-radius:0}
  .outline.show{position:absolute;z-index:6;left:0;top:0;bottom:0;width:78%;max-width:300px;box-shadow:8px 0 24px rgba(0,0,0,.18)}
  .wc{padding:6px 12px;font-size:11.5px}

  /* sketch toolbar scrolls instead of wrapping */
  #zs .zh{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}#zs .zh::-webkit-scrollbar{display:none}#zs .zh>*{flex:none}

  /* plan */
  .ps{padding:12px}
  .acts .btn,.acts button{min-height:42px}

  /* bottom tab bar */
  #tabbar{padding-bottom:max(8px,env(safe-area-inset-bottom,0px))}
  #tabbar button{min-height:54px}

  /* call window: full screen with big controls */
  #call{inset:0;left:0;bottom:0;width:100%;height:100dvh;border-radius:0;display:flex;flex-direction:column}
  #call .call-g{flex:1;overflow:auto;align-content:start}
  #call .tile{aspect-ratio:4/3}
  #call .call-b{padding:10px 8px calc(14px + env(safe-area-inset-bottom,0px))}
  .cb{width:56px;height:56px}
  /* chat as a near full-height sheet */
  #chat{left:8px;right:8px;width:auto;height:min(76dvh,620px);bottom:calc(72px + env(safe-area-inset-bottom,0px))}
  #chat textarea,#chat input{font-size:16px}

  /* dialogs become bottom sheets */
  .mdl-back{place-items:end center;padding:0}
  .mdl{width:100%;border-radius:18px 18px 0 0;max-height:88dvh;padding-bottom:env(safe-area-inset-bottom,0px)}
}
@media(max-width:380px){.tbar>.ti{font-size:16px}.menubar button{padding:10px 9px}}
