/* WeSearch Canvas V18 — isolated accessibility and interaction polish.
   No artwork, palette, camera, backend APIs or world persistence modified. */
#canvas-v18-help {
  flex:0 0 43px;
  width:43px;min-width:43px;min-height:43px;
  height:43px;padding:6px 0 !important;
  display:inline-flex;justify-content:center;align-items:center;
  border-radius:11px !important;
  border:1px solid rgba(26,77,59,.24) !important;
  background:rgba(20,62,49,.07) !important;
  color:#184434 !important;
  font-size:17px !important;font-weight:850 !important;
  transition:background .15s ease,border-color .15s ease;
}
#canvas-v18-help:hover,#canvas-v18-help:focus-visible {
  background:#d8e9da !important;border-color:#779f83 !important;
}
#world-stage:focus-visible,#canvas-v18-help:focus-visible,
.paint-dock button:focus-visible,.swatch:focus-visible,
#settings:focus-visible,#discover:focus-visible {
  outline:3px solid #d2f49e !important;outline-offset:3px !important;
}
@media(pointer:coarse){
  .paint-dock .mode-row button {min-height:44px;}
  #canvas-v18-help{min-height:44px;height:44px;}
  .paint-dock .swatch{min-height:38px;}
}
@media(max-width:1100px){
  .paint-dock{overflow:visible !important;}
  .paint-dock .mode-row{gap:2px;}
  .paint-dock .mode-row #canvas-v18-help{
    position:absolute !important;
    z-index:4;
    top:-53px;
    right:7px;
    width:44px !important;
    min-width:44px !important;
    height:44px !important;
    min-height:44px !important;
    flex:0 0 auto !important;
    background:#f1f5ec !important;
    box-shadow:0 5px 16px #0005;
    border:1px solid #87aa8e !important;
  }
}
@media(max-width:390px){
  .paint-dock .mode-row button:not(#canvas-v18-help){padding-left:6px;padding-right:6px;}
}
@media(prefers-reduced-motion:reduce){
  #canvas-v18-help{transition:none !important;}
}

/* Atlas discovery: functional links to existing official places, no invented art. */
#canvas-v18-trail {
  margin:0 0 16px;
  padding:14px 15px;
  border:1px solid #476858;
  border-radius:12px;
  background:linear-gradient(125deg,#15352f,#183244);
  color:#e4f2e5;
}
#canvas-v18-trail strong{
  display:block;font-size:10px;font-weight:820;letter-spacing:.12em;color:#b5e2bb;
}
#canvas-v18-trail p{
  margin:7px 0 12px;font-size:13px;line-height:1.55;color:#d0e3d5;
}
.canvas-v18-trail-actions{display:flex;flex-wrap:wrap;gap:8px}
.canvas-v18-trail-actions button{
  font-size:12px;min-height:43px;
  padding:9px 13px;border:1px solid #668978;
  border-radius:9px;background:#edf5ec;color:#1b4231;
  font-weight:735;white-space:normal;text-align:center;
}
.canvas-v18-trail-actions button:hover{background:#ffffff;border-color:#b1d2bc}
.canvas-v18-trail-actions button:focus-visible{outline:3px solid #c5ec8a;outline-offset:2px}
@media(max-width:430px){
 #canvas-v18-trail{margin:0 0 12px;padding:12px}
 .canvas-v18-trail-actions{display:grid;grid-template-columns:1fr}
 .canvas-v18-trail-actions button{width:100%;min-height:44px}
}

/* v27: restore original Canvas mobile control visibility.
   Source measured at 320x480: original 192px dock placed x=120; Shop ended at x=400.
   Keep native game controls, history, shop, and chat handlers intact. */
@media(max-width:740px){
 html body.world-first footer.paint-dock,html body.world-first.focused-canvas footer.paint-dock {
  position:fixed!important;box-sizing:border-box!important;
  left:8px!important;right:8px!important;
  bottom:calc(26px + env(safe-area-inset-bottom))!important;
  width:calc(100% - 16px)!important;max-width:none!important;min-width:0!important;
  margin:0!important;transform:none!important;padding:6px!important;z-index:260!important;
 }
 html body.world-first footer.paint-dock .mode-row {
  display:flex!important;align-items:center!important;justify-content:space-around!important;
  gap:2px!important;width:100%!important;max-width:100%!important;
  flex-wrap:nowrap!important;overflow:visible!important;
 }
 html body.world-first footer.paint-dock .mode-row>button:not(#canvas-v18-help) {
  flex:1 1 0!important;display:flex!important;justify-content:center!important;align-items:center!important;
  width:auto!important;min-width:0!important;max-width:none!important;
  min-height:48px!important;height:48px!important;padding:0 2px!important;font-size:12px!important;
 }
 html body.world-first footer.paint-dock .dock-divider{display:none!important}
 html body.world-first footer.paint-dock .palette-row{
  width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:auto!important;
  box-sizing:border-box!important;overscroll-behavior-x:contain!important;
 }
 html body.world-first footer.paint-dock #palette{
  max-width:100%!important;overflow-x:auto!important;overscroll-behavior-x:contain!important;
 }
 html body.world-first footer.paint-dock #canvas-v18-help{position:absolute!important;top:-52px!important;right:2px!important}
}

/* v28: keep original live-world chat and composer fully usable above mobile dock. */
@media(max-width:740px){
html body.world-first dialog#drawer[data-social="chat"]{
 position:fixed!important;inset:calc(62px + env(safe-area-inset-top)) 8px calc(100px + env(safe-area-inset-bottom)) 8px!important;
 width:calc(100% - 16px)!important;height:auto!important;max-width:none!important;max-height:none!important;
 margin:0!important;transform:none!important;padding:0!important;overflow:hidden!important;
 display:flex!important;flex-direction:column!important;border-radius:14px!important;z-index:320!important;
 background:#fcf7e9!important;box-shadow:0 16px 50px #0009!important;
}
html body.world-first dialog#drawer[data-social="chat"]>header{flex:0 0 auto!important;margin:0!important;padding:11px 12px!important;border-bottom:1px solid #c9bfa9!important}
html body.world-first dialog#drawer[data-social="chat"] #drawer-content{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;display:flex!important;flex-direction:column!important;gap:5px!important;padding:8px 10px!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-list{flex:1 1 65px!important;min-height:65px!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-compose{flex:0 0 auto!important;order:5!important;position:sticky!important;bottom:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:end!important;gap:6px!important;margin:4px 0 0!important;padding:7px 0 0!important;background:#fcf7e9!important;z-index:2!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-compose label{grid-column:1!important;min-width:0!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-compose textarea{height:44px!important;min-height:44px!important;max-height:64px!important;resize:vertical!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-compose button.primary{grid-column:2!important;grid-row:1!important;min-height:44px!important}
html body.world-first dialog#drawer[data-social="chat"] .conversation-compose p.muted{grid-column:1/-1!important;margin:0!important;font-size:10px!important;line-height:1.4!important}
html body.world-first dialog#drawer[data-social="chat"] #drawer-content>button{order:2!important;flex:0 0 auto!important;min-height:36px!important;padding:5px 10px!important}
}
@media(max-height:540px) and (max-width:740px){html body.world-first dialog#drawer[data-social="chat"]{top:57px!important;bottom:89px!important}}

/* Canvas shop quick choices v29 */
html body.world-first dialog#drawer #ws-shop-shortcuts{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;
 position:sticky;top:0;z-index:12;
 background:#faf4e7;padding:8px 7px;margin:0 -2px 10px;
 border-bottom:1px solid #c9bbab;box-shadow:0 6px 12px #3622181c;
}
html body.world-first dialog#drawer #ws-shop-shortcuts button{
 min-height:44px;display:flex;align-items:center;justify-content:center;
 padding:8px 7px;white-space:normal;border-radius:8px;
 border:1px solid #b9a9a0;background:#fffdf6;color:#2c2521;
 font:750 12px/1.3 Arial,Helvetica,sans-serif;text-align:center;
}
html body.world-first dialog#drawer #ws-shop-shortcuts button:first-child{
 background:#963d37;border-color:#963d37;color:#fff;
}
html body.world-first dialog#drawer #ws-shop-shortcuts button:hover{
 box-shadow:inset 0 0 0 2px #c4837a;
}
html body.world-first dialog#drawer #ws-shop-shortcuts button:focus-visible{
 outline:3px solid #ae5148;outline-offset:2px;
}
@media(min-width:741px){
 html body.world-first dialog#drawer #ws-shop-shortcuts{display:flex;flex-wrap:wrap}
 html body.world-first dialog#drawer #ws-shop-shortcuts button{flex:1 1 120px}
}
