:root{--tap:44px;--safe-bottom:env(safe-area-inset-bottom,0px)}
img,video{max-width:100%}
input,textarea,select,button{font-size:16px}
button,a,summary,select,input[type=checkbox]{touch-action:manipulation}

@media(min-width:1400px){
  .shell,.workspace-nav>div{width:min(1380px,calc(100% - 64px))}
  .top{padding-left:max(32px,calc((100% - 1380px)/2));padding-right:max(32px,calc((100% - 1380px)/2))}
  .task-artifacts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .youtube-center{display:grid;grid-template-columns:minmax(280px,.7fr) minmax(0,1.3fr);column-gap:28px}
  .youtube-center>.panel-head,.youtube-center>p,.youtube-center>.youtube-uploads{grid-column:1/-1}
  .youtube-center>.youtube-channel{grid-column:1}.youtube-center>.youtube-videos{grid-column:2;grid-row:3/5}
}

@media(min-width:760px) and (max-width:1099px){
  .shell{width:min(100% - 36px,980px)}
  .task-artifacts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .approval-list,.youtube-associated-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .youtube-associated-row{height:100%}
  .video-form-grid{grid-template-columns:repeat(3,1fr)}
  .conversation-layout{grid-template-columns:minmax(190px,.32fr) 1fr}
}

@media(max-width:759px){
  html{scroll-padding-top:82px}
  body{padding-bottom:calc(72px + var(--safe-bottom));background:linear-gradient(180deg,#11261f 0,#09110f 260px)}
  .top{position:sticky;top:0;height:62px;padding:0 10px;gap:8px}
  .mark{width:34px;height:34px;border-radius:10px;font-size:17px}.brand{gap:7px}
  .workspace-brand select{width:min(46vw,190px);max-width:none;font-size:14px;text-overflow:ellipsis}
  .top-actions{gap:5px}.top-actions .ghost{min-width:44px;padding:8px}.language{gap:3px}.language select{max-width:70px}
  .workspace-nav{position:fixed;z-index:60;top:auto;right:0;bottom:0;left:0;border-top:1px solid var(--line);border-bottom:0;background:#09110ff5;padding-bottom:var(--safe-bottom);box-shadow:0 -12px 35px #0008}
  .workspace-nav>div{width:100%;padding:5px 6px;gap:2px;overflow-x:auto;scrollbar-width:none}.workspace-nav>div::-webkit-scrollbar{display:none}
  .workspace-nav a{min-width:74px;min-height:54px;justify-content:center;flex:0 0 auto;padding:6px 8px;border-radius:9px;flex-direction:column;gap:1px;font-size:10px}.workspace-nav span{font-size:9px}
  .shell{width:calc(100% - 16px);padding:18px 0 30px}.shell>section{scroll-margin-top:74px}.shell>section+section{margin-top:12px}
  .youtube-first{margin-top:0}.hero{margin:18px 4px}.hero h1{font-size:32px}.hero p{font-size:13px}.live{font-size:12px}
  .stats{gap:5px;margin-bottom:12px}.stats article{padding:11px 9px;border-radius:12px}.stats strong{font-size:22px}
  .panel{padding:14px;border-radius:13px}.panel-head{padding-bottom:12px}.panel-head h2{font-size:19px}.panel-head .eyebrow{font-size:9px}
  button,.youtube-primary,.approval-link{min-height:var(--tap)}
  .youtube-channel-card{align-items:flex-start;flex-wrap:wrap}.youtube-refresh{margin-left:0}.youtube-channel-card>div{flex:1}
  .youtube-associated-row{padding:11px}.youtube-video-form{padding:12px}.youtube-private{position:static;justify-self:start}.youtube-options{grid-template-columns:1fr}
  .youtube-upload-row{grid-template-columns:auto 1fr}.youtube-upload-row small,.youtube-upload-row progress,.youtube-upload-row a{grid-column:2;width:100%}
  .task-list{gap:9px}.task-card{padding:13px}.task-head{gap:8px}.task-head h3{font-size:16px}.task-head small{font-size:10px;overflow-wrap:anywhere}
  .task-artifacts{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:9px;padding-bottom:7px}.task-artifact{min-width:88%;scroll-snap-align:start}.task-artifact video,.task-artifact img{max-height:58vh}
  .task-mini-pipeline{display:flex;overflow-x:auto;scroll-snap-type:x proximity}.task-mini-pipeline li{min-width:92px;scroll-snap-align:start}
  .phase-controls{padding:9px}.phase-controls select,.phase-controls input,.phase-controls button{min-height:var(--tap)}
  .pipeline-steps{margin:16px -4px;padding-bottom:8px;scroll-snap-type:x proximity}.pipeline-steps li{scroll-snap-align:start}
  .approval-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.approval-actions>*{text-align:center}
  #task-form input,#task-form textarea,#video-project-form input,#video-project-form select,#video-project-form textarea{min-height:var(--tap)}
  .source-row{align-items:stretch}.source-row span{flex-basis:100%}.source-row button,.source-row a{flex:1;text-align:center}
}

@media(max-width:390px){
  .mark{display:none}.workspace-brand select{width:47vw}.language select{max-width:58px}.top-actions .ghost{font-size:0}.top-actions .ghost::after{content:'↪';font-size:18px}
  .stats span{font-size:9px}.stats strong{font-size:20px}.workspace-nav a{min-width:68px}
}

@media(orientation:landscape) and (max-height:520px){
  .top{position:static}.shell{padding-top:12px}.task-artifact video{max-height:76vh}.workspace-nav a{min-height:48px}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
