/* v1.3.11 · Phone and tablet experience */
.sidebar-scrim{display:none}

@media (max-width:860px){
  .workspace-mode-switch button{min-height:52px;padding:9px 10px}.workspace-mode-switch button strong{font-size:11px}.workspace-mode-switch button small{font-size:9px}
  .sacred-actions button{min-height:44px;font-size:10px}.sacred-advanced select{min-height:40px}
  :root{--topbar-height:108px;--statusbar-height:30px}
  html,body{overscroll-behavior:none}
  button,a,input,select,textarea{touch-action:manipulation}
  .app-shell{height:100dvh;min-height:100dvh;grid-template-rows:var(--topbar-height) minmax(0,1fr) var(--statusbar-height)}
  .topbar{align-content:center;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:46px 48px;gap:4px;padding:env(safe-area-inset-top) 10px 5px;height:auto}
  .topbar>.icon-button{position:absolute;z-index:2;left:10px;top:calc(env(safe-area-inset-top) + 5px);display:grid;width:44px;height:40px;margin:0}
  .brand{min-width:0;justify-self:center;padding:0 52px}
  .brand-mark{width:32px;height:32px;flex:0 0 auto}.brand-mark span{width:19px}
  .brand-title{overflow:hidden;font-size:16px;text-overflow:ellipsis;white-space:nowrap}
  .topbar-actions{align-self:stretch;display:flex;width:100%;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;padding:3px 1px 5px;scrollbar-width:none;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .topbar-actions::-webkit-scrollbar,.interaction-tools::-webkit-scrollbar{display:none}
  .topbar-actions>*{display:inline-flex!important;flex:0 0 auto;min-height:40px;align-items:center;justify-content:center;scroll-snap-align:start}
  .topbar-actions .version-pill{display:none!important}
  .top-button,.experience-button,.account-button{min-width:44px;border-radius:10px;padding:8px 11px;font-size:10px;white-space:nowrap}
  .experience-button b,.account-label{display:inline!important;font-size:10px}
  .experience-button span{margin-right:2px}
  .account-button{gap:5px}.account-avatar{width:21px;height:21px}

  .sidebar{top:var(--topbar-height);bottom:var(--statusbar-height);width:min(86vw,340px);padding-bottom:env(safe-area-inset-bottom);visibility:hidden;z-index:82;transition:transform .24s ease,visibility .24s}
  .sidebar.is-open{visibility:visible}
  .sidebar-scroll{padding:18px 16px 24px}
  .sidebar-scrim{position:fixed;inset:var(--topbar-height) 0 var(--statusbar-height);z-index:80;display:block;border:0;background:rgba(0,0,0,.58);backdrop-filter:blur(3px)}
  .sidebar-scrim[hidden]{display:none}
  .layer-row{min-height:46px;padding:10px}
  .rotation-stepper button{width:44px;height:44px}.rotation-stepper{grid-template-columns:44px 1fr 44px}
  .rotation-control input,.control-card input{min-height:32px}

  .workspace{position:relative;gap:0;padding:0;overflow:hidden}
  .workspace-heading{position:absolute;z-index:40;inset:auto 8px 8px;display:block;min-height:0;padding:0;pointer-events:none}
  .workspace-heading>div:first-child,.workspace-meta{display:none!important}
  .interaction-tools{display:flex;width:100%;margin:0;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;padding:1px 0 max(1px,env(safe-area-inset-bottom));pointer-events:auto;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .interaction-modes,.selection-actions{flex:0 0 auto;overflow:visible;border-radius:13px;box-shadow:0 9px 28px rgba(0,0,0,.52)}
  .interaction-tools button{flex:0 0 auto!important;min-width:48px;min-height:48px;padding:0 13px;scroll-snap-align:start;font-size:10px;white-space:nowrap}
  .interaction-tools span{font-size:15px}
  .interaction-tools .animated-scales-button{max-width:165px;white-space:normal}
  .interaction-tools .seed-builder-button{max-width:140px;white-space:normal}
  .canvas-frame{height:100%;border:0;border-radius:0;box-shadow:none}
  .canvas-badge--top-left{top:10px;left:10px;padding:7px 9px}
  .intro-animation-control{top:9px;right:9px}.intro-animation-control button{min-height:42px;padding:0 11px}
  #panModeButton{position:fixed;z-index:76;right:10px;bottom:270px;display:flex!important;align-items:center;justify-content:center;gap:6px;min-width:76px!important;min-height:48px!important;padding:0 13px!important;border:2px solid rgba(255,255,255,.7)!important;border-radius:999px!important;background:linear-gradient(135deg,#f5c84c,#e8912f)!important;color:#171006!important;box-shadow:0 8px 28px rgba(0,0,0,.48),0 0 0 3px rgba(245,200,76,.18)!important;font-weight:900!important}
  #panModeButton.is-active{background:linear-gradient(135deg,#55d6be,#38aacf)!important;color:#061513!important;box-shadow:0 8px 28px rgba(0,0,0,.48),0 0 0 4px rgba(85,214,190,.24)!important}
  .canvas-tools{right:10px;bottom:70px;border:2px solid rgba(255,255,255,.72);background:linear-gradient(180deg,#55d6be,#2c99b7);box-shadow:0 10px 30px rgba(0,0,0,.55),0 0 0 3px rgba(85,214,190,.18)}.canvas-tools button{width:48px;height:47px;border-color:rgba(3,31,36,.25);color:#061a1d;font-size:21px;font-weight:900}.canvas-tools button:active{background:#f5c84c;color:#171006}
  .assistant-beta-launcher{position:fixed;z-index:77;right:10px;bottom:225px;min-height:42px;padding:0 11px}.assistant-beta-panel{position:fixed;z-index:100;inset:64px 8px max(8px,env(safe-area-inset-bottom));width:auto;max-height:none;border-radius:19px}.assistant-beta-messages{min-height:145px}.assistant-beta-form input{height:46px}.assistant-beta-form button{min-height:46px}
  .free-chord-control,.copied-pattern-control{bottom:70px;width:calc(100% - 74px);justify-content:center}
  .free-chord-control button,.copied-pattern-control button{min-height:48px;min-width:0;padding:0 13px}
  .free-chord-control #playSelectedChordButton,.copied-pattern-control button{max-width:100%}
  .free-chord-control small,.copied-pattern-control small{overflow:hidden;max-width:82px;text-overflow:ellipsis;white-space:nowrap}
  .sequence-replay-control{bottom:70px}.sequence-replay-control--left{left:9px}.sequence-replay-control--right{right:60px}
  .sequence-replay-control button{min-height:45px;padding:0 11px}.sequence-replay-control button span:last-child{max-width:82px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .seed-expansion-panel{bottom:70px}
  .seed-number-picker{position:fixed!important;left:12px!important;right:12px!important;bottom:76px!important;top:auto!important;width:auto;max-height:58dvh;overflow:auto}
  .seed-number-grid button,.seed-number-clear{min-height:44px}
  .animated-chord-label{left:50%!important;top:62px!important;right:auto!important;max-width:min(210px,calc(100vw - 116px));min-width:118px;padding:9px 11px;transform:translateX(-50%)!important;box-shadow:0 10px 32px rgba(0,0,0,.68),0 0 0 1px rgba(244,207,114,.12)}
  .empty-state{width:calc(100% - 24px);max-height:calc(100% - 144px);overflow:auto;padding:20px 17px}.empty-state h2{font-size:23px}
  .selection-panel,.analysis-panel{left:10px!important;right:10px!important;bottom:70px!important;top:auto!important;width:auto!important;max-height:55dvh;overflow:auto}
  .template-panel{position:fixed;top:auto;right:8px;bottom:70px;left:8px;width:auto;max-height:68dvh;overflow:auto;border-radius:16px}
  .template-mode button,.template-actions button,.template-cancel{min-height:44px}
  .template-restriction-notice{bottom:72px}
  .annotation-toolbar{bottom:calc(var(--statusbar-height) + 64px);max-height:54dvh}
  .annotation-toolbar button,.annotation-toolbar label{min-height:44px}
  .statusbar{padding:0 10px env(safe-area-inset-bottom);font-size:9px}.statusbar-actions{display:none}.statusbar-state{min-width:0}.statusbar-state span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .focus-mode-exit{top:calc(env(safe-area-inset-top) + 8px);right:8px;min-width:44px;min-height:44px}
  body.is-focus-mode .workspace-heading{inset:auto 8px calc(8px + env(safe-area-inset-bottom));width:auto;max-width:none;transform:none}
  body.is-focus-mode .canvas-frame{height:100dvh}
  body.is-focus-mode .canvas-tools{bottom:72px}body.is-focus-mode #panModeButton{bottom:272px}

  .auth-modal,.pattern-modal{align-items:end;padding:0}
  .auth-dialog,.pattern-dialog{width:100%;max-height:92dvh;border-radius:20px 20px 0 0;padding:25px 18px calc(20px + env(safe-area-inset-bottom));overflow:auto}
  .auth-close,.pattern-close{width:44px;height:44px;right:7px;top:7px}
  .auth-form input,.auth-card input,.pattern-form input,.pattern-form textarea,.public-pattern-filters input,.public-pattern-filters select{min-height:46px;font-size:16px}
  .auth-submit,.auth-tabs button,.pattern-card-actions button,.load-more-patterns,.public-pattern-filters button{min-height:44px}
  .pattern-card-actions{display:grid;grid-template-columns:1fr 1fr}.pattern-card-actions button{width:100%}

  .experience-tour__card{position:fixed!important;right:10px!important;bottom:10px!important;left:10px!important;top:auto!important;width:auto;padding:20px 18px calc(18px + env(safe-area-inset-bottom))}
  .experience-tour__actions button{min-height:44px}.context-help{display:none!important}
}

@media (max-width:480px){
  :root{--topbar-height:102px}
  .topbar{grid-template-rows:42px 46px;padding-left:8px;padding-right:8px}
  .brand{padding:0 46px}.brand-mark{display:none}.brand-title{font-size:15px}
  .topbar>.icon-button{left:8px;top:calc(env(safe-area-inset-top) + 3px)}
  .experience-button b,.account-label{display:none!important}
  .top-button{padding:7px 10px}
  .interaction-tools button{padding:0 11px}
  .canvas-badge{max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .intro-animation-control button>span:last-child{display:none}
  .free-chord-control{left:8px;right:58px;width:auto;transform:none}.copied-pattern-control{left:8px;right:58px;width:auto;transform:none}.copied-pattern-control button{width:100%;justify-content:center}
  .sequence-replay-control button span:last-child{display:none}
  .profile-actions{flex-direction:column}
}

@media (max-height:520px) and (orientation:landscape) and (max-width:960px){
  :root{--topbar-height:54px;--statusbar-height:0px}
  .topbar{display:flex;height:54px;padding:4px 8px 4px 58px}.topbar>.icon-button{top:7px}.brand{display:none}.topbar-actions{height:46px;padding:1px 0}
  .statusbar{display:none}.sidebar{top:54px;bottom:0}.sidebar-scrim{inset:54px 0 0}
  .workspace-heading{bottom:6px}.interaction-tools button{min-height:44px}.canvas-tools,.free-chord-control,.copied-pattern-control,.sequence-replay-control{bottom:62px}#panModeButton{bottom:258px}
  .annotation-toolbar{bottom:60px;max-height:72dvh}.template-panel{bottom:62px;max-height:78dvh}
}

@media (prefers-reduced-motion:reduce){.sidebar{transition:none}.topbar-actions,.interaction-tools{scroll-behavior:auto}}
